/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Retro gaming color palette */
    --primary-color: #ff0000;
    --secondary-color: #00ff00;
    --background-color: #000000;
    --text-color: #ffffff;
    --accent-color: #ffff00;
    --border-color: #ff00ff;
    --game-bg: rgba(0, 0, 0, 0.8);
}

body {
    font-family: 'Press Start 2P', cursive;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    background-image: 
        linear-gradient(45deg, rgba(255, 0, 0, 0.1) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255, 0, 0, 0.1) 25%, transparent 25%);
    background-size: 20px 20px;
}

/* Header styles */
.site-header {
    background-color: rgba(0, 0, 0, 0.9);
    padding: 1rem;
    border-bottom: 4px solid var(--border-color);
    box-shadow: 0 4px 8px rgba(255, 0, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.site-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        var(--primary-color),
        var(--secondary-color),
        var(--accent-color),
        var(--primary-color)
    );
    animation: scanline 2s linear infinite;
}

@keyframes scanline {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.main-nav {
    display: flex;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    background: rgba(0, 0, 0, 0.7);
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
}

.home-link {
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease, color 0.3s ease;
}

.home-link:hover {
    transform: translateX(-5px);
    color: var(--primary-color);
}

.back-arrow {
    font-size: 1.5rem;
    color: var(--accent-color);
    text-shadow: 2px 2px 0 var(--primary-color);
    transition: transform 0.3s ease;
}

.home-link:hover .back-arrow {
    transform: translateX(-5px);
}

.site-logo {
    height: 40px;
    width: auto;
    filter: drop-shadow(2px 2px 0 var(--primary-color));
    transition: transform 0.3s ease;
}

.home-link:hover .site-logo {
    transform: scale(1.1);
}

.logo h1 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 
        2px 2px 0 var(--primary-color),
        -2px -2px 0 var(--secondary-color),
        0 0 5px var(--accent-color);
    animation: glitch 0.5s infinite;
}

@keyframes glitch {
    0% {
        text-shadow: 
            2px 2px 0 var(--primary-color),
            -2px -2px 0 var(--secondary-color);
    }
    25% {
        text-shadow: 
            -2px 2px 0 var(--primary-color),
            2px -2px 0 var(--secondary-color);
    }
    50% {
        text-shadow: 
            2px -2px 0 var(--primary-color),
            -2px 2px 0 var(--secondary-color);
    }
    75% {
        text-shadow: 
            -2px -2px 0 var(--primary-color),
            2px 2px 0 var(--secondary-color);
    }
    100% {
        text-shadow: 
            2px 2px 0 var(--primary-color),
            -2px -2px 0 var(--secondary-color);
    }
}

/* Game Area Styles */
.game-area {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    min-height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.6));
    border: 4px solid var(--border-color);
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.game-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(90deg, rgba(255, 0, 0, 0.1) 1px, transparent 1px) 0 0 / 20px 20px,
        linear-gradient(0deg, rgba(255, 0, 0, 0.1) 1px, transparent 1px) 0 0 / 20px 20px;
    pointer-events: none;
    animation: scanline 2s linear infinite;
}

@keyframes scanline {
    0% { transform: translateY(0); }
    100% { transform: translateY(20px); }
}

.game-layout {
    display: grid;
    grid-template-columns: 4fr 1fr;
    grid-template-rows: auto auto;
    gap: 1rem;
    padding: 1rem;
    min-height: 0;
    min-width: 0;
    position: relative;
    flex: 1;
    height: 100%;
    z-index: 1;
}

.game-iframe-container {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #000;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
    overflow: hidden;
}

.game-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
}

.right-game-nav {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(7, 1fr);
    gap: 0.5rem;
    align-content: space-between;
    min-height: 0;
    min-width: 0;
    height: 100%;
    padding-bottom: 0.5rem;
}

.right-game-nav .game-nav-item {
    aspect-ratio: 4/3;
    padding: 0.3rem;
    min-height: 0;
    height: auto;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.right-game-nav .game-thumbnail {
    width: 100%;
    height: auto;
    object-fit: cover;
    margin-bottom: 0.2rem;
}

.right-game-nav .game-title {
    font-size: 0.5rem;
    padding: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(0, 0, 0, 0.7);
    text-align: center;
    position: relative;
    bottom: 0;
    left: 0;
    right: 0;
}

.bottom-game-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    min-height: 0;
    min-width: 0;
    margin-top: 1rem;
    padding-top: 1rem;
    align-items: start;
    border-top: 2px solid var(--border-color);
}

.bottom-game-nav .game-nav-item {
    aspect-ratio: 4/3;
    min-height: 0;
    height: auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.7);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bottom-game-nav .game-nav-item:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.bottom-game-nav .game-thumbnail {
    aspect-ratio: 4/3;
    width: 100%;
    height: auto;
    margin-bottom: 0.5rem;
}

.bottom-game-nav .game-title {
    font-size: 0.6rem;
    text-align: center;
    text-shadow: 1px 1px 0 var(--primary-color);
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: auto;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.5rem;
}

/* Game Description Styles */
.seo-content {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-top: 1rem;
    padding-top: 1rem;
}

.game-description, .game-features {
    padding: 1rem;
    margin-bottom: 1rem;
}

.game-description h3, .game-features h3 {
    color: var(--accent-color);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 0 var(--primary-color);
}

.game-description p {
    line-height: 1.8;
    margin-bottom: 1rem;
}

.game-features ul {
    list-style: none;
    padding-left: 1rem;
}

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

.game-features li::before {
    content: '▶';
    color: var(--primary-color);
    position: absolute;
    left: 0;
}

.game-nav-item {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--border-color);
    padding: 0.5rem;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    height: 100%;
    overflow: hidden;
}

.game-nav-item:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--accent-color);
}

.game-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    width: 100%;
    height: 100%;
}

.game-thumbnail {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    margin-bottom: 0.5rem;
}

.game-title {
    font-size: 0.6rem;
    text-align: center;
    text-shadow: 1px 1px 0 var(--primary-color);
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: auto;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.5rem;
}

/* Responsive design */
@media (max-width: 1024px) {
    .game-area {
        min-height: calc(100vh - 6rem);
    }
    
    .game-layout {
        grid-template-columns: 3fr 1fr;
    }
    
    .bottom-game-nav {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .game-area {
        min-height: calc(100vh - 8rem);
    }
    
    .game-layout {
        grid-template-columns: 1fr;
    }
    
    .game-iframe-container {
        grid-column: 1;
        grid-row: 1;
    }
    
    .right-game-nav {
        grid-column: 1;
        grid-row: 2;
        grid-template-columns: repeat(2, 1fr);
    }
    
    .bottom-game-nav {
        grid-row: 3;
        grid-template-columns: repeat(3, 1fr);
    }
    
    .seo-content {
        grid-row: 4;
    }
    
    .logo h1 {
        font-size: 0.8rem;
    }
    
    .back-arrow {
        font-size: 1.2rem;
    }
    
    .site-logo {
        height: 30px;
    }
}

@media (max-width: 480px) {
    .game-area {
        min-height: calc(100vh - 10rem);
    }
    
    .game-iframe-container {
        padding-top: 75%; /* 4:3 Aspect Ratio for smaller screens */
    }
    
    .right-game-nav {
        grid-template-columns: 1fr;
    }
    
    .bottom-game-nav {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .logo h1 {
        font-size: 0.8rem;
    }
    
    .back-arrow {
        font-size: 1rem;
    }
    
    .site-logo {
        height: 25px;
    }
    
    .game-title {
        font-size: 0.6rem;
    }
}

/* Hero Section Styles */
.hero-section {
    padding: 2rem 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.6));
    border: 2px solid var(--border-color);
    margin-bottom: 2rem;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.hero-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-text h2 {
    font-size: 1.6rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 0 var(--secondary-color);
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}

.hero-description {
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text-color);
    margin-bottom: 2rem;
}

.hero-features ul {
    list-style: none;
    padding: 0;
}

.hero-features li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.8rem;
    color: var(--text-color);
}

.hero-features li::before {
    content: '▶';
    color: var(--primary-color);
    position: absolute;
    left: 0;
}

.hero-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 400px;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.hero-img:hover {
    transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
    }
    
    .hero-text h2 {
        font-size: 1.4rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .hero-description {
        font-size: 0.7rem;
    }
    
    .hero-image {
        min-height: 300px;
    }
}

@media (max-width: 480px) {
    .hero-image {
        min-height: 250px;
    }
}

/* Features Section Styles */
.features-section {
    padding: 3rem 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.5));
    border: 2px solid var(--border-color);
    margin-bottom: 2rem;
}

.features-section h3 {
    font-size: 1.4rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 0 var(--secondary-color);
}

.features-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.feature-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 确保所有偶数项都是图片在左，文字在右 */
.feature-item:nth-child(even) {
    grid-template-columns: 1fr 1fr;
}

.feature-item:nth-child(even) .feature-image {
    order: -1;
}

/* 确保所有奇数项都是文字在左，图片在右 */
.feature-item:nth-child(odd) {
    grid-template-columns: 1fr 1fr;
}

.feature-item:nth-child(odd) .feature-image {
    order: 1;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(255, 0, 0, 0.3);
}

.feature-text {
    padding: 1rem;
}

.feature-text h4 {
    font-size: 1.1rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.feature-text p {
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text-color);
}

.feature-image {
    position: relative;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
    border-radius: 8px;
}

.feature-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.feature-item:hover .feature-img {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .feature-item {
        grid-template-columns: 1fr;
        padding: 1rem;
}

    .feature-item:nth-child(even) .feature-image,
    .feature-item:nth-child(odd) .feature-image {
        order: 0;
    }

    .feature-text {
        padding: 0.5rem;
    }
    
    .feature-text h4 {
        font-size: 0.9rem;
    }
    
    .feature-text p {
        font-size: 0.7rem;
    }
}

/* What is, How to Play, and Why Play Sections */
.what-is-section,
.how-to-section,
.why-play-section {
    padding: 2rem;
    margin: 2rem 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.5));
    border: 2px solid var(--border-color);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.what-is-section::before,
.how-to-section::before,
.why-play-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        var(--primary-color),
        var(--secondary-color),
        var(--accent-color),
        var(--primary-color)
    );
    animation: scanline 2s linear infinite;
}

.what-is-content,
.how-to-content,
.why-play-content {
    position: relative;
    z-index: 1;
}

.what-is-section h3,
.how-to-section h3,
.why-play-section h3 {
    font-size: 1.4rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 0 var(--secondary-color);
    animation: glitch 0.5s infinite;
}

.what-is-content p,
.how-to-content p,
.why-play-content p {
    font-size: 0.8rem;
    line-height: 1.8;
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

.what-is-content ul,
.how-to-content ul,
.why-play-content ul {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.what-is-content li,
.how-to-content li,
.why-play-content li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 0.8rem;
    line-height: 1.6;
}

.what-is-content li::before,
.how-to-content li::before,
.why-play-content li::before {
    content: '▶';
    color: var(--primary-color);
    position: absolute;
    left: 0;
    animation: pulse 1s infinite;
}

.what-is-content strong,
.how-to-content strong,
.why-play-content strong {
    color: var(--accent-color);
    text-shadow: 1px 1px 0 var(--primary-color);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .what-is-section,
    .how-to-section,
    .why-play-section {
        padding: 1.5rem;
    }
    
    .what-is-section h3,
    .how-to-section h3,
    .why-play-section h3 {
        font-size: 1.4rem;
    }
    
    .what-is-content p,
    .how-to-content p,
    .why-play-content p {
        font-size: 0.7rem;
    }
    
    .what-is-content li,
    .how-to-content li,
    .why-play-content li {
        font-size: 0.7rem;
    }
}

/* FAQ Section Styles */
.faq-section {
    padding: 2rem;
    margin: 2rem 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.5));
    border: 2px solid var(--border-color);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.faq-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        var(--primary-color),
        var(--secondary-color),
        var(--accent-color),
        var(--primary-color)
    );
    animation: scanline 2s linear infinite;
}

.faq-section h3 {
    font-size: 1.4rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 0 var(--secondary-color);
    animation: glitch 0.5s infinite;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.faq-item {
    background: rgba(0, 0, 0, 0.5);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.faq-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(255, 0, 0, 0.3);
}

.faq-item h4 {
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 0 var(--primary-color);
}

.faq-item p {
    color: var(--text-color);
    font-size: 0.8rem;
    line-height: 1.8;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .faq-section {
        padding: 1.5rem;
    }
    
    .faq-section h3 {
        font-size: 1.4rem;
    }
    
    .faq-item h4 {
        font-size: 0.9rem;
    }
    
    .faq-item p {
        font-size: 0.7rem;
    }
}

/* Why Play Section Styles */
.why-play-section {
    padding: 2rem;
    margin: 2rem 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.5));
    border: 2px solid var(--border-color);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.why-play-content {
    max-width: 1200px;
    margin: 0 auto;
}

.why-play-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
    align-items: center;
}

.why-play-item.reverse {
    grid-template-columns: 1fr 1fr;
}

.why-play-item.reverse .why-play-image {
    order: -1;
}

.why-play-text {
    padding: 1rem;
}

.why-play-text p {
    font-size: 0.8rem;
    line-height: 1.8;
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

.why-play-text ul {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.why-play-text li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 0.8rem;
    line-height: 1.6;
}

.why-play-text li::before {
    content: '▶';
    color: var(--primary-color);
    position: absolute;
    left: 0;
    animation: pulse 1s infinite;
}

.why-play-image {
    position: relative;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

.why-play-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.why-play-image:hover .why-play-img {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .why-play-item {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .why-play-item.reverse {
        grid-template-columns: 1fr;
    }

    .why-play-item.reverse .why-play-image {
        order: 0;
    }

    .why-play-text {
        padding: 0.5rem;
    }

    .why-play-text p,
    .why-play-text li {
        font-size: 0.7rem;
    }
}