/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* -- Bright & Fresh Theme -- */
    --theme-primary: #f8f9fa;          /* 浅灰白色背景 */
    --theme-secondary: #ffffff;        /* 纯白色次要背景 */
    --theme-accent: #4ecdc4;           /* 清新薄荷绿 */
    --theme-highlight: #ff6b6b;        /* 珊瑚粉红色 */
    --theme-text: #2d3436;             /* 深灰色文字 */
    --theme-text-secondary: #636e72;   /* 次要文字颜色 */
    --theme-border: #dfe6e9;           /* 浅灰色边框 */
    --theme-shadow: rgba(0, 0, 0, 0.1); /* 柔和阴影 */
    --theme-gradient: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%); /* 渐变背景 */

    /* -- Mapping variables -- */
    --bg-main-yellow: var(--theme-primary);
    --bg-section-green: var(--theme-secondary);
    --text-dark-on-light: var(--theme-text);
    --text-light-on-dark: var(--theme-text);
    --accent-bright-yellow: var(--theme-highlight);
    --accent-vibrant-green: var(--theme-accent);
    --border-color-soft: var(--theme-border);
    --shadow-color-general: var(--theme-shadow);
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--theme-text);
    background-color: var(--theme-primary);
    background-image: var(--theme-gradient);
    min-height: 100vh;
}

/* Header Styles */
header {
    background: var(--theme-gradient);
    color: var(--theme-text);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px var(--theme-shadow);
    border-bottom: 1px solid var(--theme-border);
}

.logo-container {
    display: flex;
    align-items: center;
}

.retro-logo {
    font-family: 'Press Start 2P', cursive;
    font-size: 2rem;
    color: var(--theme-highlight);
    text-shadow: 2px 2px 4px rgba(255, 107, 107, 0.2);
    letter-spacing: 2px;
}

.language-selector {
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    background-color: var(--theme-accent);
    color: var(--theme-text);
    border: 1px solid var(--theme-border);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-btn:hover, .lang-btn.active {
    background-color: var(--theme-highlight);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.2);
}

/* Main Content Layout */
main {
    display: grid;
    grid-template-areas:
        "top top top"
        "left main-content right"
        "bottom bottom bottom";
    grid-template-columns: 1fr 4fr 1fr !important;
    grid-template-rows: auto 1fr auto;
    gap: 1rem !important;
    padding: 1rem;
    max-width: 100%;
    min-height: calc(100vh - 70px - 2rem);
    margin: 0 auto;
}

/* Left Sidebar - Game Links */
.game-links {
    background-color: var(--theme-secondary);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow-color-general);
    border: 1px solid var(--theme-border);
    font-family: 'Poppins', Arial, sans-serif;
    font-size: 1rem;
}

.game-links h2 {
    color: var(--theme-accent);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    border-bottom: 2px solid var(--theme-accent);
    padding-bottom: 0.5rem;
}

.game-links ul {
    list-style: none;
    padding-left: 0;
}

.game-links li {
    display: flex;
    align-items: center;
    margin-bottom: 0.3rem;
}

.game-links a {
    display: flex;
    align-items: center;
    gap: 0.7em;
    font-size: 1.05rem;
    font-weight: 500;
    padding: 0.45rem 0.7rem;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    letter-spacing: 0.01em;
    color: var(--theme-text);
    text-decoration: none;
}

.game-links a:hover {
    background-color: var(--theme-accent);
    color: white;
    transform: translateX(6px) scale(1.04);
}

.game-links hr {
    border: 0;
    border-top: 1.5px solid var(--border-color-soft);
    margin: 0.7rem 0;
}

.game-links a {
    font-family: 'Poppins', 'Segoe UI Emoji', 'Segoe UI Symbol', Arial, sans-serif;
}

/* Main Game Section */
.main-game {
    grid-area: main-content;
    background-color: var(--theme-secondary);
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--theme-shadow);
    overflow: hidden;
    border: 1px solid var(--theme-border);
    display: flex;
    flex-direction: column;
}

.game-container {
    position: relative;
    width: 100%;
    height: 600px;
    background-color: var(--theme-primary);
}

.game-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.fullscreen-btn {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background-color: var(--theme-accent);
    color: var(--theme-text);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fullscreen-btn:hover {
    background-color: var(--theme-highlight);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.2);
}

/* Game Information Section */
.game-info {
    padding: 1.5rem;
    background-color: var(--theme-secondary);
}

.game-info h2 {
    color: var(--theme-accent);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--theme-accent);
    padding-bottom: 0.5rem;
}

.game-screenshots {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    overflow-x: auto;
}

.game-screenshots img {
    width: 200px;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
}

/* 针对 .game-features, .how-to-play 等内容区块的统一样式调整将在此文件下方进行 */
/* 旧的 .game-features, .how-to-play 等区块样式会被下方更具体的规则覆盖 */

.review {
    margin-bottom: 1rem;
}

.review p {
    font-style: italic;
    margin-bottom: 0.5rem;
}

.review span {
    font-size: 0.9rem;
}

.faq-item {
    margin-bottom: 1rem;
}

.faq-item h4 {
    margin-bottom: 0.5rem;
}

/* Right Sidebar - Mini Games */
.mini-games {
    background-color: var(--theme-secondary);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow-color-general);
    border: 1px solid var(--theme-border);
}

.mini-games h2 {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: var(--theme-accent);
    text-align: center;
}

.mini-game-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.mini-game {
    border: 1px solid var(--theme-border);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    background-color: var(--theme-primary);
    position: relative;
}

.mini-game .game-cover {
    position: relative;
    width: 100%;
    height: auto;
    transition: opacity 0.3s ease;
}

.mini-game .game-cover img {
    width: 100%;
    height: auto;
    display: block;
}

.mini-game .game-title {
    text-align: center;
    padding: 8px;
    font-size: 0.9em;
    font-weight: bold;
    color: var(--theme-text);
    background-color: var(--theme-accent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-top: 1px solid var(--theme-border);
    transition: opacity 0.3s ease, transform 0.3s ease;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transform: translateY(100%);
    z-index: 2;
}

/* 鼠标悬停效果 */
.mini-game:hover .game-title {
    opacity: 1;
    transform: translateY(0);
}

.mini-game:hover .game-cover {
    opacity: 0.8;
}

.mini-game:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px var(--theme-shadow);
}

.mini-game iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.mini-game.active .game-cover {
    opacity: 0;
}

.mini-game.active iframe {
    opacity: 1;
}

/* Footer Styles */
footer {
    background: var(--theme-gradient);
    color: var(--theme-text-secondary);
    padding: 1rem;
    margin-top: 2rem;
    border-top: 1px solid var(--theme-border);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.copyright {
    font-size: 0.9rem;
}

.copyright a {
    color: var(--theme-accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

.copyright a:hover {
    color: var(--theme-highlight);
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1200px) {
    main {
        grid-template-columns: 1fr 3fr 1fr !important;
    }
}

@media (max-width: 992px) {
    main {
        grid-template-columns: 1fr !important;
        grid-template-areas:
            "top"
            "main-content"
            "left"
            "right"
            "bottom";
    }
    
    .game-links, .mini-games {
        display: none;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .language-selector {
        margin-top: 1rem;
    }
    
    .game-container {
        height: 400px;
    }
    
    .game-screenshots {
        flex-direction: column;
    }
    
    .game-screenshots img {
        width: 100%;
        height: auto;
    }
    
    .why-content {
        grid-template-columns: 1fr;
    }
    
    .game-links {
        font-size: 0.95rem;
    }
    
    .game-links a {
        font-size: 1rem;
        padding: 0.4rem 0.5rem;
    }
}

/* Game Description Section */
.game-description {
    margin-bottom: 2rem;
    padding: 1rem;
    border-radius: 8px;
}

.game-description p {
    line-height: 1.8;
}

/* Game Tips Section */
.game-tips {
    margin-bottom: 2rem;
    padding: 1rem;
    border-radius: 8px;
}

.game-tips ul {
    list-style-type: none;
    padding-left: 0;
}

.game-tips li {
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
}

.game-tips li:before {
    content: "💡";
    position: absolute;
    left: 0;
    color: var(--theme-highlight);
}

/* Game Updates Section */
.game-updates {
    margin-bottom: 2rem;
    padding: 1rem;
    border-radius: 8px;
}

.game-updates ul {
    list-style-type: none;
    padding-left: 0;
}

.game-updates li {
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
}

.game-updates li:before {
    content: "🔄";
    position: absolute;
    left: 0;
    color: var(--theme-accent);
}

/* Enhanced How to Play Section */
.how-to-play ul {
    list-style-type: none;
    padding-left: 0;
    margin-top: 1rem;
}

.how-to-play li {
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
}

.how-to-play li:before {
    content: "🎮";
    position: absolute;
    left: 0;
    color: var(--theme-highlight);
}

/* Enhanced FAQ Section */
.faq-item {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.faq-item h4 {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.faq-item h4:before {
    content: "❓";
    margin-right: 0.5rem;
    color: var(--theme-accent);
}

.faq-item p {
    line-height: 1.6;
}

/* Why Section Styles */
.why-section {
    margin-bottom: 2rem;
    padding: 1rem;
    border-radius: 8px;
}

.why-section h3 {
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.5rem;
    padding-bottom: 0.5rem;
}

.why-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.why-item {
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px var(--shadow-color-general);
    transition: all 0.3s ease;
    background-color: var(--theme-primary);
    border: 1px solid var(--theme-border);
}

.why-item:hover {
    transform: translateY(-5px);
    border-color: var(--accent-vibrant-green);
}

.why-item h4 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.why-item p {
    line-height: 1.6;
}

/* Game Container Loading State */
.game-container {
    position: relative;
    width: 100%;
    height: 600px;
}

.game-container.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid"><circle cx="50" cy="50" fill="none" stroke="%233A7CA5" stroke-width="10" r="35" stroke-dasharray="164.93361431346415 56.97787143782138"><animateTransform attributeName="transform" type="rotate" repeatCount="indefinite" dur="1s" values="0 50 50;360 50 50" keyTimes="0;1"/></circle></svg>') center center no-repeat;
    background-size: 50px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-container.loading::after {
    opacity: 1;
}

/* Mini Game Active State */
.mini-game.active {
    border: 2px solid var(--accent-vibrant-green);
    box-shadow: 0 0 10px var(--accent-vibrant-green);
}

.mini-game.active .game-cover {
    opacity: 0;
}

.mini-game.active iframe {
    opacity: 1;
}

/* Game Title Transition */
.game-info h2 {
    transition: opacity 0.3s ease;
}

.game-info h2.updating {
    opacity: 0;
}

/* 导航栏新字体和图标样式 */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;700&display=swap');

/* 移除主要区域和内容块的边框 (用户自定义重要样式) */
/* This !important might need to be removed if borders are desired in the dark theme */
/* .game-links,
.mini-games,
.main-game,
.game-features,
.how-to-play,
.player-reviews,
.faq,
.why-section,
.why-item {
    border: none !important; (Consider if some subtle borders are needed with --theme-border-dark)
    If no border, then this rule is fine. If borders are desired, remove !important or the rule.
} */

/* 移除标题下划线边框 (用户自定义重要样式) */
/* Similar consideration for title underlines */
/* .game-links h2,
.mini-games h2,
.game-info h2,
.why-section h3 {
    border-bottom: none !important;
} */

/* --- 重构后的内容区块样式 --- */
/* Re-evaluate these for the dark theme */

/* 区块组1 (e.g., game features, etc.) - these were --bg-section-green, now --theme-dark-blue */
.game-features,
.how-to-play,
.player-reviews, 
.faq, 
.why-section {
    color: var(--theme-text-on-dark) !important; 
    background-color: var(--theme-dark-blue); /* This is already mapped */
    padding: 1rem; 
    border-radius: 8px; 
    margin-bottom: 1.5rem; 
    border: 1px solid var(--theme-border-dark); /* Add subtle border for definition */
}

/* 区块组2 (e.g., game description) - these were --bg-main-yellow, now --theme-black */
.game-description,
.game-tips,
.game-updates,
.faq-item { 
    color: var(--theme-text-on-dark) !important; 
    background-color: var(--theme-black); /* This is already mapped */
    padding: 1rem; 
    border-radius: 8px; 
    margin-bottom: 1rem; 
    border: 1px solid var(--theme-border-dark); /* Add subtle border */
}

/* Content block titles (h3, h4) */
.game-features h3,
.how-to-play h3,
.player-reviews h3, 
.faq h3, 
.why-section h3,
.game-description h3,
.game-tips h3,
.game-updates h3,
.faq-item h4, 
.why-item h4 {
    color: var(--theme-accent-blue) !important; /* Titles use accent blue */
    margin-bottom: 0.75rem; 
}

/* Reviews and Why-items */
.review { 
    background-color: var(--theme-black); /* Reviews on main black background */
    padding: 1rem; 
    border-radius: 6px; 
    border: 1px solid var(--theme-border-dark);
}
.review p, .review span {
    color: var(--theme-text-on-dark) !important;
}

.why-item { 
    background-color: var(--theme-black); /* Why-items on main black background */
    border: 1px solid var(--theme-border-dark); /* Add border */
}
.why-item p {
    color: var(--theme-text-on-dark) !important; 
}

/* New styles for the game lists in the new layout */
.game-list {
    background-color: var(--theme-dark-blue); /* Game lists on section dark blue */
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--theme-border-dark);
    overflow-y: auto;
}

.game-list h2 { /* Titles inside game lists, if they are uncommented */
    color: var(--theme-text-on-dark);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--theme-border-dark);
    padding-bottom: 0.3rem;
}

/* Central mini games section (if ever uncommented) */
.central-mini-games-section {
    padding: 20px 0; 
    margin-bottom: 20px; 
}

.central-mini-games-section h2 {
    font-size: 1.8em; 
    color: var(--theme-accent-blue); /* Use accent blue for these titles */
    text-align: center; 
    margin-bottom: 20px; 
    font-family: 'Press Start 2P', cursive; 
}

/* 中间小游戏网格布局 */
.sub-mini-game-grid {
    display: grid; /* Grid布局 */
    grid-template-columns: repeat(5, 1fr); /* 5列等宽 */
    grid-template-rows: repeat(3, auto); /* 3行，高度自动 */
    gap: 15px; /* 网格间距 */
    padding: 0 10px; /* 左右内边距 */
}

/* 响应式调整：在中等屏幕上改为3列 */
@media (max-width: 1024px) {
    .sub-mini-game-grid {
        grid-template-columns: repeat(3, 1fr); /* 3列 */
    }
}

/* 响应式调整：在小屏幕上改为2列 */
@media (max-width: 600px) {
    .sub-mini-game-grid {
        grid-template-columns: repeat(2, 1fr); /* 2列 */
    }
    .central-mini-games-section h2 {
        font-size: 1.5em; /* 减小标题字号 */
    }
}

/* 将主游戏区域分配到网格中间 */
.main-game {
    grid-area: main-content; /* 指定该元素在网格中的位置为 'main-content' */
    background-color: var(--bg-section-green); /* 背景颜色：浅薄荷绿 */
    border-radius: 8px; /* 圆角 */
    box-shadow: 0 4px 20px var(--theme-shadow); /* 阴影 */
    overflow: hidden; /* 隐藏溢出内容 */
    border: 1px solid var(--theme-border); /* 边框：柔和暗黄褐色 */
    display: flex; /* 使用flex布局，使其子元素（game-container, game-info）能更好控制 */
    flex-direction: column; /* flex子元素垂直排列 */
}

.game-list h2 {
    color: var(--text-dark-on-light); /* 标题颜色 */
    margin-bottom: 0.5rem; /* 下外边距 */
    font-size: 1.1rem; /* 标题字号 */
    border-bottom: 1px solid var(--border-color-soft); /* 下边框 */
    padding-bottom: 0.3rem; /* 内边距 */
}

.top-games {
    grid-area: top; /* 分配到 'top' 网格区域 */
    min-height: 100px; /* 顶部游戏列表最小高度，根据内容调整 */
    display: grid; /* 让内部游戏项可以横向排列 */
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* 横向自动填充，每个最小120px */
    gap: 0.5rem; /* 游戏项间距 */
}

.left-games {
    grid-area: left; /* 分配到 'left' 网格区域 */
    /* 左侧容器宽度由main的grid-template-columns定义 */
    display: grid; /* 使用Grid布局来排列内部游戏项 */
    grid-template-columns: repeat(2, 1fr); /* 将游戏项恢复为两列 */
    gap: 0.5rem; /* 游戏项之间的间距 */
    align-content: start; /* 内容从顶部开始排列，防止拉伸 */
}

.right-games {
    grid-area: right; /* 分配到 'right' 网格区域 */
    /* 右侧容器宽度由main的grid-template-columns定义 */
    display: grid; /* 让内部游戏项可以排列 */
    grid-template-columns: 1fr; /* 将游戏项改为单列 */
    gap: 0.5rem; /* 游戏项间距 */
    align-content: start; /* 内容从顶部开始排列 */
}

.bottom-games {
    grid-area: bottom; /* 分配到 'bottom' 网格区域 */
    min-height: 100px; /* 底部游戏列表最小高度，根据内容调整 */
    display: grid; /* 让内部游戏项可以横向排列 */
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* 横向自动填充 */
    gap: 0.5rem; /* 游戏项间距 */
}

/* 确保这是CSS文件的最后一行，不要在此后添加任何样式 */ 