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

:root {
    --primary-purple: #7c3aed;
    --secondary-purple: #a259f7;
    --primary-black: #18122b;
    --secondary-black: #232136;
    --highlight-purple: #e0aaff;
    --text-light: #f8f8ff;
    --text-dark: #bdbdbd;
    --background-dark: #18122b;
    --background-deep: #232136;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-light);
    background-color: var(--background-dark);
}

/* Header Styles */
header {
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-black));
    color: var(--text-light);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.retro-logo {
    font-family: 'Press Start 2P', cursive;
    font-size: 2rem;
    color: var(--highlight-purple);
    text-shadow: 3px 3px 0 var(--primary-black);
    letter-spacing: 2px;
}

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

.lang-btn {
    background-color: var(--secondary-purple);
    color: var(--text-light);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.lang-btn:hover, .lang-btn.active {
    background-color: var(--highlight-purple);
    color: var(--primary-black);
    transform: translateY(-2px);
}

/* Main Content Layout */
main {
    display: grid;
    grid-template-columns: 200px 1fr 300px;
    gap: 1rem;
    padding: 1rem;
    max-width: 1600px;
    margin: 0 auto;
    background: none;
}

/* Left Sidebar - Game Links */
.game-links {
    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);
    font-family: 'Poppins', Arial, sans-serif;
    font-size: 1rem;
}

.game-links h2 {
    color: var(--highlight-purple);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    border-bottom: 2px solid var(--primary-purple);
    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(--text-light);
    text-decoration: none;
}

.game-links a:hover {
    background-color: var(--primary-purple);
    color: var(--highlight-purple);
    transform: translateX(6px) scale(1.04);
}

.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 {
    background-color: var(--background-deep);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 2px solid var(--primary-purple);
}

.game-container {
    position: relative;
    width: 100%;
    height: 600px;
}

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

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

.fullscreen-btn:hover {
    background-color: var(--highlight-purple);
    color: var(--primary-black);
    transform: translateY(-2px);
}

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

.game-info h2 {
    color: var(--highlight-purple);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--primary-purple);
    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, .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(--highlight-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(--highlight-purple);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    border-bottom: 2px solid var(--primary-purple);
    padding-bottom: 0.5rem;
}

.mini-game-grid {
    display: grid;
    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: #f8f9fa;
    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: var(--text-dark);
    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: #f8f8ff !important; /* 浅色文字 */
    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: #f8f8ff !important; /* 浅色文字 */
}

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

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

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