/* ===== 全局样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #ffffff;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* ===== 屏幕容器 ===== */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.screen.overlay {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.screen.hidden {
    display: none;
}

/* ===== 开始界面 ===== */
.game-title {
    font-size: 4rem;
    font-weight: bold;
    color: #ffff00;
    text-shadow: 
        0 0 10px #ffff00,
        0 0 20px #ffff00,
        0 0 30px #ffff00,
        0 0 40px #ff00ff,
        0 0 70px #ff00ff;
    margin-bottom: 1rem;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 
            0 0 10px #ffff00,
            0 0 20px #ffff00,
            0 0 30px #ffff00,
            0 0 40px #ff00ff;
    }
    to {
        text-shadow: 
            0 0 20px #ffff00,
            0 0 30px #ffff00,
            0 0 40px #ffff00,
            0 0 70px #ff00ff,
            0 0 100px #ff00ff;
    }
}

.subtitle {
    font-size: 1.2rem;
    color: #00d9ff;
    margin-bottom: 2rem;
    opacity: 0.8;
}

.high-score-display {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    padding: 1rem 2rem;
    background: rgba(0, 217, 255, 0.1);
    border: 2px solid #00d9ff;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.3);
}

#highScore {
    color: #ffff00;
    font-weight: bold;
    font-size: 1.8rem;
}

/* ===== 按钮样式 ===== */
.btn-primary {
    font-size: 1.5rem;
    padding: 1rem 3rem;
    background: linear-gradient(135deg, #ff00ff, #00d9ff);
    border: none;
    border-radius: 50px;
    color: #ffffff;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 0 20px rgba(255, 0, 255, 0.5),
        0 0 40px rgba(0, 217, 255, 0.3);
    margin-bottom: 2rem;
}

.btn-primary:hover {
    transform: scale(1.1);
    box-shadow: 
        0 0 30px rgba(255, 0, 255, 0.8),
        0 0 60px rgba(0, 217, 255, 0.5);
}

.btn-primary:active {
    transform: scale(0.95);
}

/* ===== 控制说明 ===== */
.controls-info {
    text-align: center;
    opacity: 0.7;
    line-height: 1.8;
}

.controls-info p:first-child {
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #00d9ff;
}

/* ===== 游戏界面 ===== */
#gameUI {
    background: transparent;
}

.game-stats {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 3rem;
    background: rgba(26, 26, 46, 0.8);
    padding: 1rem 2rem;
    border-radius: 15px;
    border: 2px solid #00d9ff;
    box-shadow: 0 0 30px rgba(0, 217, 255, 0.3);
    z-index: 50;
    backdrop-filter: blur(10px);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: #00d9ff;
    opacity: 0.8;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffff00;
    text-shadow: 0 0 10px #ffff00;
}

/* ===== Canvas样式 ===== */
#gameCanvas {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 3px solid #00d9ff;
    border-radius: 10px;
    box-shadow: 
        0 0 30px rgba(0, 217, 255, 0.5),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
    background: #0a0a15;
}

/* ===== 暂停界面 ===== */
.pause-container {
    text-align: center;
    padding: 3rem;
    background: rgba(26, 26, 46, 0.9);
    border: 3px solid #00d9ff;
    border-radius: 20px;
    box-shadow: 0 0 50px rgba(0, 217, 255, 0.5);
}

.pause-container h2 {
    font-size: 3rem;
    color: #ffff00;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px #ffff00;
}

.pause-container p {
    font-size: 1.2rem;
    color: #00d9ff;
}

/* ===== 游戏结束界面 ===== */
.gameover-container {
    text-align: center;
    padding: 3rem;
    background: rgba(26, 26, 46, 0.95);
    border: 3px solid #ff00ff;
    border-radius: 20px;
    box-shadow: 0 0 50px rgba(255, 0, 255, 0.5);
}

.gameover-title {
    font-size: 3rem;
    color: #ff00ff;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 20px #ff00ff;
}

.final-score {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: #ffffff;
}

.final-score span:last-child {
    color: #ffff00;
    font-weight: bold;
    font-size: 2.5rem;
    text-shadow: 0 0 20px #ffff00;
}

.highlight {
    color: #ff00ff;
    font-size: 1.5rem;
    animation: pulse 1s ease-in-out infinite;
}

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

/* ===== 关卡完成界面 ===== */
.level-complete-container {
    text-align: center;
    padding: 3rem;
    background: rgba(26, 26, 46, 0.95);
    border: 3px solid #00ff00;
    border-radius: 20px;
    box-shadow: 0 0 50px rgba(0, 255, 0, 0.5);
}

.complete-title {
    font-size: 3rem;
    color: #00ff00;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px #00ff00;
    animation: bounce 0.5s ease-in-out;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.complete-msg {
    font-size: 1.2rem;
    color: #00d9ff;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .game-title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .game-stats {
        gap: 1rem;
        padding: 0.8rem 1.5rem;
    }
    
    .stat-value {
        font-size: 1.2rem;
    }
    
    .btn-primary {
        font-size: 1.2rem;
        padding: 0.8rem 2rem;
    }
}

/* ===== 加载动画 ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.screen {
    animation: fadeIn 0.5s ease-out;
}
