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

:root {
    /* -- 定义主题颜色变量 -- */
    /* -- 主紫色调 -- */
    --primary-purple: #7000FF; /* 鲜艳的紫罗兰色 */
    --dark-purple: #4D00B2;    /* 深紫罗兰色，用于强调或背景 */
    --light-purple-bg: #F8F8F8;   /* 非常浅的灰色背景，替代之前的淡紫色 */
    --accent-magenta: #FF00FF;     /* 品红色点缀，增加活力 */
    /* -- 文本颜色 -- */
    --text-color: #333;         /* 主要文本颜色 */
    --light-text-color: #fff;   /*浅色文本，用于深色背景 */
    /* -- 边框和分隔线颜色 -- */
    --border-color: #ccc;       /* 边框颜色 */
    /* -- 字体变量 -- */
    --font-main: 'Nunito', sans-serif; /* 主要字体 (可爱风格) */
    --font-logo-unused: 'Press Start 2P', cursive; /* 旧Logo字体, 不再主要使用 */
}

body {
    /* -- 页面背景颜色 -- */
    background-color: var(--light-purple-bg); /* 使用新的浅灰色背景 */
    /* -- 页面文字颜色 -- */
    color: var(--text-color); /* 使用标准文本颜色 */
    /* -- 统一页面字体 -- */
    font-family: var(--font-main); /* 应用主要的可爱字体 */
    /* -- 外边距清零 -- */
    margin: 0;
    /* -- 内边距清零 -- */
    padding: 0;
    /* -- 行高设置，提高可读性 -- */
    line-height: 1.6;
    /* -- 移除移动端点击延迟 -- */
    touch-action: manipulation;
}

/* Header Styles */
header {
    /* -- 头部背景颜色 -- */
    background-color: var(--dark-purple); /* 使用新的深紫罗兰色作为头部背景 */
    /* -- 头部文字颜色 -- */
    color: var(--light-text-color); /* 浅色文字以适应深色背景 */
    /* -- 内边距 -- */
    padding: 1rem;
    /* -- flex布局，用于子元素对齐 -- */
    display: flex;
    /* -- 子元素两端对齐 -- */
    justify-content: space-between;
    /* -- 子元素垂直居中 -- */
    align-items: center;
    /* -- 底部边框，增加层次感 -- */
    border-bottom: 3px solid var(--primary-purple); /* 使用新的主紫罗兰色 */
}

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

/* Renamed from .retro-logo to .site-logo to match HTML */
.site-logo {
    /* -- Logo文字颜色 -- */
    color: var(--light-text-color); /* Logo文字为浅色 */
    /* -- Logo字体 -- */
    font-family: var(--font-main); /* 使用主要的可爱字体 */
    /* -- Logo字体大小 -- */
    font-size: 2.2em; /* 略微调整字体大小 */
    /* -- Logo字体粗细 -- */
    font-weight: 700; /* 使用粗体 */
    /* -- 外边距清零 -- */
    margin: 0;
    /* -- 移除复杂的文字描边效果，追求简洁 -- */
    text-shadow: none;
    /* -- 无文本修饰 -- */
    text-decoration: none; 
}

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

.lang-btn {
    /* -- 语言按钮背景颜色 -- */
    background-color: var(--primary-purple); /* 新的主要紫罗兰色背景 */
    /* -- 语言按钮文字颜色 -- */
    color: var(--light-text-color); /* 浅色文字 */
    /* -- 边框去除 -- */
    border: none;
    /* -- 内边距 -- */
    padding: 0.5rem 1rem;
    /* -- 外边距 -- */
    margin-left: 0.5rem;
    /* -- 边角圆润度 -- */
    border-radius: 5px;
    /* -- 鼠标指针样式 -- */
    cursor: pointer;
    /* -- 过渡效果，使状态变化更平滑 -- */
    transition: background-color 0.3s ease;
}

.lang-btn:hover, .lang-btn.active {
    /* -- 激活及悬停状态的按钮背景颜色 -- */
    background-color: var(--accent-magenta); /* 使用新品红色点缀作为高亮 */
    /* -- 激活及悬停状态的按钮文字颜色 -- */
    color: var(--light-text-color); /* 文字颜色在高亮时也保持浅色，或改为深色对比 */
}

/* Main Content Layout */
main {
    /* -- 主内容区flex布局 -- */
    display: flex; /* 改为flex布局以适应三栏 */
    /* -- 主内容区内边距 -- */
    padding: 1rem;
    /* -- 子元素间隔 -- */
    gap: 1rem; /* flex子元素之间的间距 */
}

/* Left Sidebar - Game Links */
.game-links,
.mini-games {
    /* -- 侧边栏背景颜色 -- */
    background-color: #fff; /* 白色背景 */
    /* -- 侧边栏内边距 -- */
    padding: 1rem;
    /* -- 侧边栏边角圆润度 -- */
    border-radius: 8px;
    /* -- 侧边栏阴影效果 -- */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    /* -- flex基础宽度 -- */
    flex-basis: 49.75%; /* 调整侧边栏宽度为49.75%，使中间区域再缩小一半 (原为49.5%) -- */
    /* -- flex收缩因子 -- */
    flex-shrink: 0; /* 防止在空间不足时收缩 */
    font-family: 'Poppins', Arial, sans-serif;
    font-size: 1rem;
}

.game-links h2 {
    /* -- 标题字体 -- */
    font-family: var(--font-main); /* 标题也使用主要字体，可以加粗 */
    font-weight: 700;
    /* -- 标题颜色 -- */
    color: var(--primary-purple); /* 新的主要紫罗兰色 */
    /* -- 标题下边框 -- */
    border-bottom: 2px solid var(--accent-magenta); /* 新品红色下边框 */
    /* -- 标题内边距 -- */
    padding-bottom: 0.5rem;
    /* -- 标题外边距 -- */
    margin-bottom: 1rem;
}

.game-links ul {
    /* -- 列表样式去除 -- */
    list-style: none;
    /* -- 内边距清零 -- */
    padding: 0;
    /* -- 外边距清零 -- */
    margin: 0;
}

.game-links ul li a {
    /* -- 链接文字颜色 -- */
    color: var(--dark-purple); /* 新的深紫罗兰色文字 */
    /* -- 文本装饰去除 -- */
    text-decoration: none;
    /* -- 块级显示，占据整行 -- */
    display: block;
    /* -- 内边距 -- */
    padding: 0.5rem 0;
    /* -- 过渡效果 -- */
    transition: color 0.3s ease, background-color 0.3s ease;
    /* -- 边角圆润度 -- */
    border-radius: 4px;
}

.game-links ul li a:hover {
    /* -- 链接悬停文字颜色 -- */
    color: var(--light-text-color);
    /* -- 链接悬停背景颜色 -- */
    background-color: var(--accent-magenta); /* 新品红色背景 */
    /* -- 内边距（保持一致或微调） -- */
    padding-left: 0.5rem; /* 悬停时增加一点左内边距做效果 */
}

.game-links hr {
    border: 0;
    border-top: 1.5px solid #e0e0e0;
    margin: 0.7rem 0;
}

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

/* Main Game Section */
.main-game {
    /* -- 主游戏区flex增长因子 -- */
    flex-grow: 1; /* 占据剩余空间 */
    /* -- 主游戏区背景颜色 -- */
    background-color: #fff;
    /* -- 主游戏区内边距 -- */
    padding: 1rem;
    /* -- 主游戏区边角圆润度 -- */
    border-radius: 8px;
    /* -- 主游戏区阴影效果 -- */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.game-container {
    /* -- 游戏容器相对定位，用于全屏按钮的绝对定位 -- */
    position: relative;
    /* -- 游戏容器宽度，设置为父元素（.main-game）的70%，即缩小30% -- */
    width: 70%; 
    /* -- 水平居中游戏容器 -- */
    margin: 0 auto;
    /* -- 游戏容器内边距自适应高度 (16:9 比例)，基于新的宽度 -- */
    padding-bottom: calc(70% * 0.5625); /* 维持16:9比例, (width * 9/16) */
    /* -- 背景颜色，iframe加载时可见 -- */
    background-color: #000;
    /* -- 边角圆润度 -- */
    border-radius: 8px;
    /* -- 溢出隐藏 -- */
    overflow: hidden; /* 确保iframe在容器内 */
}

.game-container iframe {
    /* -- iframe绝对定位，充满容器 -- */
    position: absolute;
    /* -- 顶部对齐 -- */
    top: 0;
    /* -- 左侧对齐 -- */
    left: 0;
    /* -- 宽度100% -- */
    width: 100%;
    /* -- 高度100% -- */
    height: 100%;
    /* -- 无边框 -- */
    border: none;
}

.fullscreen-btn {
    /* -- 全屏按钮绝对定位 -- */
    position: absolute;
    /* -- 底部对齐 -- */
    bottom: 10px;
    /* -- 右侧对齐 -- */
    right: 10px;
    /* -- 背景颜色 -- */
    background-color: rgba(0, 0, 0, 0.7); /* 半透明黑色背景 */
    /* -- 文字颜色 -- */
    color: rgb(255, 253, 253);
    /* -- 无边框 -- */
    border: none;
    /* -- 内边距 -- */
    padding: 0.5rem 1rem;
    /* -- 边角圆润度 -- */
    border-radius: 5px;
    /* -- 鼠标指针 -- */
    cursor: pointer;
    /* -- 过渡效果 -- */
    transition: background-color 0.3s ease;
}

.fullscreen-btn:hover {
    /* -- 全屏按钮悬停背景 -- */
    background-color: var(--primary-purple); /* 紫色背景 */
}

/* Game Information Section */
.game-info {
    padding: 1rem;
}

.game-info h2 {
    /* -- 字体大小 -- */
    font-size: 1.8em;
}

.game-info h3 {
    /* -- 字体大小 -- */
    font-size: 1.4em;
}

.game-screenshots {
    display: flex;
    /* -- 水平居中flex容器内的截图 -- */
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    overflow-x: auto;
}

.game-screenshots img {
    /* -- 截图宽度，flex basis -- */
    width: calc(55.555% - 10px); /* 三分之一宽度减去间距 */
    /* -- 边角圆润度 -- */
    border-radius: 5px;
    /* -- 阴影效果 -- */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    /* -- 图片最大宽度，防止过大 -- */
    max-width: 320px; /* 从150px放大50%到320px */
    /* -- 高度自适应 -- */
    height: auto;
}

.game-features, .how-to-play, .player-reviews, .faq {
    margin-bottom: 2rem;
    background-color: #221a36;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--primary-purple);
}

.game-features h3, .how-to-play h3, .player-reviews h3, .faq h3 {
    color: var(--primary-purple);
    margin-bottom: 0.5rem;
}

.game-features ul {
    list-style-position: inside;
    margin-left: 1rem;
}

.review {
    background-color: #2d2346;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    color: var(--text-light);
}

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

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

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

.faq-item h4 {
    color: #34495e;
    margin-bottom: 0.5rem;
}

/* Right Sidebar - Mini Games */
.mini-games {
    background-color: var(--background-deep);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--primary-purple);
}

.mini-games h2 {
    color: var(--primary-purple);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    border-bottom: 2px solid var(--accent-magenta);
    padding-bottom: 0.5rem;
}

.mini-game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.mini-game {
    position: relative;
    padding-bottom: 75%;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
    border: 2px solid var(--primary-purple);
}

.mini-game:hover {
    transform: scale(1.05);
    border-color: var(--primary-purple);
}

.game-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.game-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.game-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(to top, var(--primary-purple), transparent);
    color: var(--text-light);
    font-size: 14px;
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.mini-game:hover .game-title {
    transform: translateY(0);
}

.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: linear-gradient(135deg, var(--primary-purple), var(--primary-black));
    color: var(--text-light);
    padding: 2rem;
    margin-top: 2rem;
}

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

.copyright {
    font-size: 0.9rem;
}

.copyright a {
    color: var(--highlight-purple);
    text-decoration: none;
    transition: all 0.3s;
}

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

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

@media (max-width: 992px) {
    main {
        grid-template-columns: 1fr;
    }
    
    .game-links, .mini-games {
        display: none;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
    }
    
    .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, .mini-games {
        background-color: var(--background-deep);
    }
    
    .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;
    background-color: #f8f9fa;
    border-radius: 8px;
}

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

/* Game Tips Section */
.game-tips {
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: #f2f3f5;
    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: #e74c3c;
}

/* Game Updates Section */
.game-updates {
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: #f8f9fa;
    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: #2c3e50;
}

/* 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: #e74c3c;
}

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

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

.faq-item h4:before {
    content: "❓";
    margin-right: 0.5rem;
    color: #e74c3c;
}

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

/* Why Section Styles */
.why-section {
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: var(--background-deep);
    border-radius: 8px;
    border: 1px solid var(--primary-purple);
}

.why-section h3 {
    color: var(--highlight-purple);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.5rem;
    border-bottom: 2px solid var(--primary-purple);
    padding-bottom: 0.5rem;
}

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

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

.why-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary-purple);
}

.why-item h4 {
    color: var(--highlight-purple);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.why-item p {
    color: #22223b !important; /* 深色文字 */
    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(255, 255, 255, 0.8) 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="%23e74c3c" 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 #e74c3c;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.3);
}

.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');

/* 移除主要区域和内容块的边框 */
.game-links,
.mini-games,
.main-game,
.game-features,
.how-to-play,
.player-reviews,
.faq,
.why-section,
.why-item {
    border: none !important;
}

/* 移除标题下划线边框 */
.game-links h2,
.mini-games h2,
.game-info h2,
.why-section h3 {
    border-bottom: none !important;
}

/* 自动检测背景色并适配文字颜色 */
/* 深色背景内容区 */
.game-features,
.how-to-play,
.player-reviews,
.faq,
.why-section {
    color: #414141 !important; /* 调整为#cccccc，比#f8f8ff稍暗 */
    background-color: var(--background-deep); /* 深色背景 */
}

/* 浅色背景内容区 */
.game-description,
.game-tips,
.game-updates,
.faq-item {
    color: #22223b !important; /* 深色文字 */
    background-color: #f8f9fa; /* 浅色背景 */
}

/* 确保所有标题可见 */
.game-features h3,
.how-to-play h3,
.player-reviews h3,
.faq h3,
.why-section h3 {
    color: #a259f7 !important; /* 亮紫色标题 */
}

.game-description h3,
.game-tips h3,
.game-updates h3 {
    color: #7c3aed !important; /* 深紫色标题，适合浅色背景 */
}

/* 确保FAQ项内容可见 */
.faq-item p {
    color: #22223b !important; /* 深色文字 */
}

/* 确保评论文字可见 */
.review {
    background-color: #2d2346; /* 深色背景 */
}
.review p, .review span {
    color: #cccccc !important; /* 调整为#cccccc，同上 */
}

/* Why区域项目内容可见 */
.why-item {
    background-color: white; /* 浅色背景 */
}
.why-item p {
    color: #22223b !important; /* 深色文字 */
}

/* 深色背景内容区用浅色字 */
.dark-block {
    color: #f8f8ff !important;
}

/* 浅色背景内容区用深色字 */
.light-block {
    color: #22223b !important;
}

/* Game Features section specific text color override */
/* -- "游戏特性"部分列表项特定文字颜色调整 -- */
.game-features ul li {
    /* -- "游戏特性"列表项文字颜色，已是#cccccc，无需重复或可移除此特定规则，如果父元素已是#cccccc -- */
    /* color: #cccccc !important; */ 
} 