/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header and Navigation */
header {
    background: #1a1a1a;
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header h1 {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
}

.mobile-menu-btn {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: #fff;
}

.mobile-menu-btn i {
    transition: transform 0.3s ease;
}

.mobile-menu-btn.active i {
    transform: rotate(90deg);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #4CAF50;
}

/* Game Section */
.game-section {
    margin-top: 80px;
    padding: 2rem 0;
    background: #f5f5f5;
}

.game-container {
    max-width: 1000px;
    margin: 0 auto;
    aspect-ratio: 16/9;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    background: #1a1a1a;
}

.game-frame-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.game-loader,
.game-error {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(26, 26, 26, 0.95);
    z-index: 2;
}

.game-error {
    display: none;
}

.loader-content,
.error-content {
    text-align: center;
    color: #fff;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.error-content i {
    font-size: 3rem;
    color: #ff4444;
    margin-bottom: 1rem;
}

.error-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.error-content p {
    margin-bottom: 1rem;
    color: #ccc;
}

.reload-btn {
    background: #4CAF50;
    color: #fff;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto;
    transition: background 0.3s ease;
}

.reload-btn:hover {
    background: #45a049;
}

.reload-btn i {
    font-size: 1rem;
    color: #fff;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.game-container.error .game-loader {
    display: none;
}

.game-container.error .game-error {
    display: flex;
}

.game-container.loaded .game-loader {
    display: none;
}

.game-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    display: flex;
    gap: 0.5rem;
}

.control-btn {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.control-btn i {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

/* Fullscreen styles */
.game-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    margin: 0;
    max-width: none;
    border-radius: 0;
}

.game-container.fullscreen .game-frame-container {
    height: 100vh;
}

.game-container.fullscreen .control-btn i.fa-expand::before {
    content: "\f066";
    /* Font Awesome compress icon */
}

/* 确保iframe在全屏模式下正确显示 */
.game-frame-container iframe {
    display: block;
    border: none;
    background: #000;
}

/* About Section */
.about-section {
    padding: 4rem 0;
    background: #fff;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card {
    background: linear-gradient(145deg, #ffffff 0%, #f9f9f9 100%);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.feature-card h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.feature-card h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: #4CAF50;
    border-radius: 2px;
}

.feature-card p {
    color: #666;
    line-height: 1.7;
}

/* Tutorial Section */
.tutorial-section {
    padding: 4rem 0;
    background: #f5f5f5;
}

.video-container {
    max-width: 800px;
    margin: 2rem auto 0;
    aspect-ratio: 16/9;
    position: relative;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

.gameplay-tips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.tip-card {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

.tip-card:hover {
    transform: translateY(-5px);
}

.tip-card h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.tip-card p {
    color: #666;
    font-size: 1rem;
}

/* More Games Section */
.more-games-section {
    padding: 4rem 0;
    background: #fff;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.game-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.game-card:hover {
    transform: translateY(-5px);
}

.game-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.game-card h3 {
    padding: 1rem;
    color: #2c3e50;
}

.play-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0 1rem 1rem;
    background: #4CAF50;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.play-btn:hover {
    background: #45a049;
}

/* Section Headers */
h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 2rem;
    font-size: 2.5rem;
    font-weight: 700;
}

/* Footer */
footer {
    background: #1a1a1a;
    color: #fff;
    padding: 2rem 0;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.2rem;
    }

    nav ul {
        gap: 1rem;
    }

    .game-container {
        margin: 0 20px;
    }

    h2 {
        font-size: 2rem;
    }

    .gameplay-tips {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .tip-card {
        padding: 1.5rem;
    }

    .nav-container {
        position: relative;
    }

    .mobile-menu-btn {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #1a1a1a;
        flex-direction: column;
        padding: 1rem 0;
        gap: 1rem;
        text-align: center;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        padding: 0.5rem 0;
    }

    .nav-links a {
        display: block;
        padding: 0.5rem 0;
    }
}

@media (max-width: 480px) {
    nav ul {
        display: none;
    }

    .feature-card {
        padding: 1.5rem;
    }

    .tip-card h3 {
        font-size: 1.3rem;
    }
}