/* Global Styles */
:root {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --accent-color: #FF5722;
    --dark-color: #212121;
    --light-color: #F5F5F5;
    --background-color: #121212;
    --text-color: #FFFFFF;
    --border-color: #333333;
    --font-primary: 'Press Start 2P', cursive;
    --font-secondary: Arial, sans-serif;
    --grid-size: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-secondary);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    margin-bottom: 1rem;
    line-height: 1.2;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
}

/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-family: var(--font-primary);
    font-size: 1rem;
    text-transform: uppercase;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 1rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 10; /* 提高z-index确保按钮在最上层 */
    pointer-events: auto; /* 确保按钮可以接收点击事件 */
    touch-action: manipulation; /* 防止移动设备上的双击缩放 */
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
}

.primary-btn:hover {
    background-color: #45a049;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.secondary-btn {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.secondary-btn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

/* Header Styles */
.main-header {
    background-color: rgba(33, 33, 33, 0.9);
    padding: 20px 0;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--border-color);
}

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

.logo .snake {
    font-size: 2rem;
    margin-right: 10px;
    animation: wiggle 2s infinite;
}

.logo h1 {
    font-size: 1.5rem;
    margin: 0;
}

@media (max-width: 480px) {
    .logo .snake {
        font-size: 1.5rem;
        margin-right: 8px;
    }
    
    .logo h1 {
        font-size: 1.2rem;
    }
}

.main-nav ul {
    display: flex;
    list-style: none;
}

.main-nav ul li {
    margin-left: 20px;
}

.main-nav ul li a {
    font-family: var(--font-primary);
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-color);
    padding: 5px 10px;
    border-radius: 5px;
}

.main-nav ul li a.active, .main-nav ul li a:hover {
    background-color: var(--primary-color);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 0 50px;
    background: linear-gradient(135deg, #1e1e1e 0%, #2d2d2d 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(76, 175, 80, 0.1) 0%, transparent 10%),
        radial-gradient(circle at 90% 80%, rgba(33, 150, 243, 0.1) 0%, transparent 10%);
    z-index: 0;
    pointer-events: none; /* 确保背景图案不阻挡点击 */
}

.hero-content {
    flex: 1;
    z-index: 5; /* 提高z-index确保内容区域在覆盖层之上 */
    max-width: 600px;
    position: relative; /* 确保z-index生效 */
}

.hero-content h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.game-preview {
    max-width: 100%;
    height: auto;
    max-height: 500px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(76, 175, 80, 0.3);
    transition: transform 0.3s ease;
}

@media (max-width: 768px) {
    .game-preview {
        max-height: 280px;
    }
}

@media (max-width: 480px) {
    .game-preview {
        max-height: 200px;
    }
    
    .hero {
        padding: 120px 0 30px;
    }
}

.game-preview:hover {
    transform: scale(1.05);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #CCCCCC;
}

.hero-image {
    flex: 1;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.snake-animation {
    width: 300px;
    height: 300px;
    position: relative;
    background-color: rgba(33, 33, 33, 0.5);
    border: 3px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

/* Features Section */
.features {
    padding: 100px 0;
    background-color: #1a1a1a;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.feature-card {
    background-color: rgba(33, 33, 33, 0.5);
    padding: 30px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(76, 175, 80, 0.3);
    border-color: var(--primary-color);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

/* How To Play Section */
.how-to-play {
    padding: 100px 0;
    background-color: #1e1e1e;
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.step {
    background-color: rgba(33, 33, 33, 0.5);
    padding: 30px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    position: relative;
    padding-left: 60px;
}

.step-number {
    position: absolute;
    left: 15px;
    top: 15px;
    width: 30px;
    height: 30px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-primary);
}

/* Game Stats Section */
.game-stats {
    padding: 80px 0;
    background-color: #1a1a1a;
}

.stats-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
}

.stat-box {
    flex: 1;
    min-width: 300px;
    background-color: rgba(33, 33, 33, 0.5);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
}

.stat-facts {
    flex: 1;
    min-width: 250px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 480px) {
    .stat-box {
        min-width: 100%;
        padding: 15px;
    }
    
    .game-stats {
        padding: 60px 0;
    }
}

.fact {
    background-color: rgba(33, 33, 33, 0.5);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    text-align: center;
    transition: all 0.3s ease;
}

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

.fact-number {
    display: block;
    font-family: var(--font-primary);
    font-size: 1.5rem;
    color: var(--primary-color);
}

.fact-label {
    display: block;
    font-size: 0.8rem;
    color: #CCCCCC;
}

/* Testimonials Section */
.testimonials {
    padding: 100px 0;
    background-color: #1e1e1e;
}

.testimonials-slider {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.testimonial {
    background-color: rgba(33, 33, 33, 0.5);
    padding: 30px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    position: relative;
}

.testimonial-text {
    font-style: italic;
    margin-bottom: 20px;
    position: relative;
    padding-left: 20px;
}

.testimonial-text::before {
    content: '"';
    position: absolute;
    left: 0;
    top: 0;
    font-size: 2rem;
    color: var(--primary-color);
}

.testimonial-author {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: bold;
    color: var(--primary-color);
}

.author-location {
    font-size: 0.8rem;
    color: #CCCCCC;
}

/* CTA Section */
.cta {
    padding: 100px 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    text-align: center;
}

.cta h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.cta p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 768px) {
    .cta h2 {
        font-size: 2rem;
    }
    
    .cta p {
        font-size: 1rem;
    }
    
    .cta {
        padding: 60px 0;
    }
}

/* Footer Styles */
.main-footer {
    background-color: #121212;
    padding: 50px 0 20px;
    border-top: 2px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-brand .logo h2 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.footer-brand p {
    color: #CCCCCC;
    font-size: 0.9rem;
}

.footer-links h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.footer-links ul {
    list-style: none;
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links ul li a {
    color: #CCCCCC;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-links ul li a:hover {
    color: var(--primary-color);
}

.social-icons {
    display: flex;
    gap: 10px;
}

.social-icon {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    background-color: rgba(33, 33, 33, 0.5);
    border-radius: 50%;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: #CCCCCC;
    font-size: 0.8rem;
}

/* Team Member Styles */
.team-member .member-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    margin-bottom: 20px;
    max-width: 100%;
}

@media (max-width: 768px) {
    .team-member .member-image {
        width: 120px;
        height: 120px;
    }
}

@media (max-width: 480px) {
    .team-member .member-image {
        width: 100px;
        height: 100px;
        margin-bottom: 15px;
    }
}

/* 404 Page Styles */
.error-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 15px 50px;
    background: linear-gradient(135deg, #1e1e1e 0%, #2d2d2d 100%);
    position: relative;
    overflow: hidden;
}

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

.error-number {
    font-family: var(--font-primary);
    font-size: 8rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    text-shadow: 0 10px 20px rgba(76, 175, 80, 0.3);
    line-height: 1;
}

.error-content h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.error-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #CCCCCC;
}

.error-image {
    width: 150px;
    height: 150px;
    margin: 30px auto;
    animation: wiggle 2s infinite;
}

.error-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Animations */
@keyframes wiggle {
    0%, 100% {
        transform: rotate(-5deg);
    }
    50% {
        transform: rotate(5deg);
    }
}

/* Responsive Styles */
@media (max-width: 992px) {
    .hero .container {
        flex-direction: column;
    }
    
    .hero-content {
        max-width: 100%;
        text-align: center;
    }
    
    .hero-image {
        margin-top: 30px;
    }
    
    .game-preview {
        max-height: 350px;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .steps-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .main-header .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: rgba(33, 33, 33, 0.95);
        backdrop-filter: blur(10px);
        padding: 20px;
        border-bottom: 2px solid var(--border-color);
    }
    
    .main-nav.active {
        display: block;
    }
    
    .main-nav ul {
        flex-direction: column;
    }
    
    .main-nav ul li {
        margin: 10px 0;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .stats-container {
        flex-direction: column;
    }
    
    .stat-box {
        min-width: 100%;
    }
    
    .stat-facts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.4rem;
    }
    
    h3 {
        font-size: 1.2rem;
    }
    
    .btn {
        font-size: 0.8rem;
        padding: 10px 20px;
        margin-right: 0;
        margin-bottom: 1rem;
        width: 100%;
        text-align: center;
    }
    
    .hero-content h2 {
        font-size: 1.5rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    /* Game Statistics Section - Mobile Optimization */
    .game-stats {
        padding: 40px 0;
    }
    
    .stat-box {
        min-width: 100%;
        padding: 15px;
        margin: 0 -15px;
        border-radius: 0;
        border-left: none;
        border-right: none;
        height: 250px; /* 为移动设备设置固定高度 */
    }
    
    #gameChart {
        width: 100% !important;
        height: 100% !important;
        display: block;
    }
    
    .stat-facts {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .fact {
        padding: 15px 10px;
    }
    
    .fact-number {
        font-size: 1.2rem;
    }
    
    .fact-label {
        font-size: 0.75rem;
    }
    
    .features-grid,
    .steps-container,
    .testimonials-slider {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .feature-card,
    .step,
    .testimonial {
        padding: 20px;
    }
    
    /* 404 Page Responsive */
    .error-number {
        font-size: 5rem;
    }
    
    .error-content h2 {
        font-size: 1.8rem;
    }
    
    .error-content p {
        font-size: 1rem;
    }
    
    .error-image {
        width: 100px;
        height: 100px;
    }
    
    .error-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .error-buttons .btn {
        width: 200px;
    }
}