/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    position: relative;
    scroll-padding-top: 160px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: linear-gradient(135deg, #7f5af0 0%, #c44569 50%, #e056fd 100%);
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 容器 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 120px;
}

/* 头部导航 */
.header {
    position: fixed !important;
    top: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 9999 !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    max-width: 1400px;
    width: calc(100vw - 40px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    will-change: transform;
    box-sizing: border-box;
}

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

.logo-icon {
    font-size: 2.5rem;
    animation: pulse 2s infinite;
}

.logo p {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.nav {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-link {
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    padding: 10px 20px;
    border-radius: 10px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.nav-link .icon {
    font-size: 1.2rem;
}

/* 主要内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    align-items: start;
}

/* 左侧内容区域 */
.left-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
    text-shadow: none;
    display: inline-block;
    line-height: 1.2;
}

.hero-description {
    font-size: 1.3rem;
    line-height: 1.6;
    color: #f0f0f0;
    max-width: 800px;
    margin: 0 auto;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* 游戏区域 */
.game-section {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 游戏容器 */
.game-container {
    background: #000;
    border-radius: 15px;
    padding: 20px;
    position: relative;
}

.score-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

#score {
    font-weight: bold;
    color: #f1c40f;
}

.sound-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sound-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 游戏iframe */
#gameFrame {
    width: 100%;
    height: 600px;
    background: #0a0a0a;
    border-radius: 10px;
    border: none;
    display: block;
}

/* 全屏按钮 */
.fullscreen-btn {
    position: absolute;
    top: -5px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 30px;
    transition: all 0.3s ease;
    z-index: 10;
}

.fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
}

.game-container {
    position: relative;
}

/* 游戏控制按钮 */
.game-controls {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

.btn-primary, .btn-secondary {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(231, 76, 60, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 在线状态 */
.online-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #2ecc71;
    border-radius: 50%;
    animation: blink 2s infinite;
}

/* 游戏介绍区域 */
.info-section {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-content {
    max-width: 100%;
}

.info-block {
    margin-bottom: 40px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.info-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.info-block h3 {
    font-size: 1.6rem;
    margin-bottom: 20px;
    color: #fff;
    background: linear-gradient(45deg, #e74c3c, #f39c12);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.info-block p {
    line-height: 1.8;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
}

.info-block strong {
    color: #e74c3c;
    font-weight: 600;
}

.gameplay-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.gameplay-list li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

.gameplay-list li:last-child {
    border-bottom: none;
}

.gameplay-list strong {
    color: #e74c3c;
    font-weight: 600;
}

.cta-button {
    display: inline-block;
    background: linear-gradient(45deg, #e74c3c, #f39c12);
    color: white;
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1.1rem;
    margin-top: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
    background: linear-gradient(45deg, #c0392b, #e67e22);
}







/* 统计信息区域 */
.stats-section {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-section h3 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    text-align: center;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item:last-of-type {
    border-bottom: none;
}

.stat-item .stat-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
}

.stat-item .stat-value {
    font-size: 1.3rem;
    font-weight: 600;
}

.rating {
    color: #f1c40f;
}

/* 广告区域 */
.ad-section {
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    border-radius: 15px;
    padding: 25px;
    margin-top: 30px;
    text-align: center;
}

.ad-badge {
    background: rgba(0, 0, 0, 0.2);
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.ad-section p {
    margin-bottom: 10px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.ad-chinese {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

.ad-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 10px;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.ad-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(5px);
}

/* 锚点跳转偏移 */
[id] {
    scroll-margin-top: 160px;
    position: relative;
}

/* 确保how-to-play锚点正确显示 */
#how-to-play {
    scroll-margin-top: 10px;
    position: relative;
}

/* 游戏区域锚点 */
#game-section {
    scroll-margin-top: 160px;
    position: relative;
}

/* 动画 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .stats-section {
        order: 2;
    }
    
    .header {
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
        padding: 15px;
    }
    
    .game-header h2 {
        font-size: 2.5rem;
        margin-bottom: 18px;
    }
    
    .info-block h2 {
        font-size: 2.2rem;
        margin-bottom: 22px;
    }
    
    .stats-section h2 {
        font-size: 2rem;
        margin-bottom: 22px;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 20px;
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
        padding: 15px;
        top: 10px !important;
    }
    
    .nav {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .hero-description {
        font-size: 1.1rem;
        padding: 0 10px;
    }
    
    .game-header h2 {
        font-size: 2.2rem;
        margin-bottom: 15px;
    }
    
    .info-block h2 {
        font-size: 2rem;
        margin-bottom: 20px;
    }
    
    .stats-section h2 {
        font-size: 1.6rem;
        margin-bottom: 16px;
    }
    
    .game-controls {
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
    }
    
    /* 移动设备上的iframe适应 */
    #gameFrame {
        height: 400px;
    }
    
    /* 移动设备上的故事统计 */
    .viral-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .story-header h4 {
        font-size: 1.2rem;
    }
    
    .chris-quote {
        padding: 15px;
        font-size: 1rem;
    }
}

/* 玩家数量变化动画 */
.player-count,
.stat-value {
    transition: all 0.3s ease;
    display: inline-block;
}

.player-count.updating,
.stat-value.updating {
    animation: numberPulse 0.3s ease;
}

@keyframes numberPulse {
    0% {
        transform: scale(1);
        color: #fff;
    }
    50% {
        transform: scale(1.05);
        color: #ffd700;
    }
    100% {
        transform: scale(1);
        color: #fff;
    }
}

/* 在线状态指示器动画 */
.status-dot {
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Cloudflare Pages 兼容性修复 */
.header {
    position: fixed !important;
    top: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 9999 !important;
    max-width: 1400px !important;
    width: calc(100vw - 40px) !important;
    box-sizing: border-box !important;
}

.hero-section h1 {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4) !important;
    background-size: 400% 400% !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    animation: gradientShift 3s ease-in-out infinite !important;
    display: inline-block !important;
    line-height: 1.2 !important;
}

/* 确保容器样式正确 */
.container {
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 20px !important;
    padding-top: 120px !important;
    box-sizing: border-box !important;
}

/* Info block中的h2样式 */
.info-block h2 {
    font-size: 2.4rem;
    margin-bottom: 25px;
    color: #fff;
    background: linear-gradient(45deg, #e74c3c, #f39c12);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    line-height: 1.2;
}

/* Stats section中的h2样式 */
.stats-section h2 {
    font-size: 2.2rem;
    margin-bottom: 25px;
    text-align: center;
    color: #fff;
    background: linear-gradient(45deg, #4ecdc4, #45b7d1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}