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

body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 780px;
    height: 590px;
    background: #000;
    border: 4px solid #444;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
    overflow: hidden;
}

.screen {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.screen.active {
    display: flex;
}

/* 主菜单样式 */
#main-menu {
    background: linear-gradient(180deg, #0a0a0a 0%, #1a1a2e 100%);
    padding: 40px;
    text-align: center;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#main-menu h1 {
    color: #00ffff;
    font-size: 42px;
    text-shadow: 0 0 20px #00ffff, 0 0 40px #00ffff;
    margin-bottom: 30px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 0 0 20px #00ffff, 0 0 40px #00ffff;
    }
    to {
        text-shadow: 0 0 30px #00ffff, 0 0 60px #00ffff, 0 0 80px #00ffff;
    }
}

.menu-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.menu-btn {
    padding: 12px 35px;
    font-size: 16px;
    background: linear-gradient(180deg, #2a2a4a 0%, #1a1a3a 100%);
    color: #fff;
    border: 2px solid #00ffff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 180px;
}

.menu-btn:hover {
    background: linear-gradient(180deg, #3a3a5a 0%, #2a2a4a 100%);
    border-color: #00ff00;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
    transform: scale(1.05);
}

.menu-btn:active {
    transform: scale(0.98);
}

.high-score {
    color: #ffd700;
    font-size: 18px;
    margin-top: 15px;
}

/* 操作说明样式 */
#controls-screen {
    background: linear-gradient(180deg, #0a0a0a 0%, #1a1a2e 100%);
    padding: 25px;
    text-align: center;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#controls-screen h2 {
    color: #00ffff;
    margin-bottom: 20px;
    font-size: 28px;
}

.controls-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.player-controls {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #444;
    min-width: 200px;
}

.player-controls h3 {
    color: #00ffff;
    margin-bottom: 12px;
    font-size: 16px;
}

.player-controls p {
    color: #fff;
    margin: 6px 0;
    font-size: 14px;
}

.game-tips {
    background: rgba(0, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
}

.game-tips h3 {
    color: #ffd700;
    margin-bottom: 10px;
    font-size: 16px;
}

.game-tips p {
    color: #ccc;
    margin: 4px 0;
    text-align: left;
    font-size: 13px;
}

/* 关卡选择样式 */
#level-select-screen {
    background: linear-gradient(180deg, #0a0a0a 0%, #1a1a2e 100%);
    padding: 25px;
    text-align: center;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#level-select-screen h2 {
    color: #00ffff;
    margin-bottom: 15px;
    font-size: 26px;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    max-width: 540px;
    margin: 0 auto 15px;
}

.level-btn {
    width: 100%;
    height: 45px;
    font-size: 14px;
    font-weight: bold;
    background: linear-gradient(180deg, #2a2a4a 0%, #1a1a3a 100%);
    color: #fff;
    border: 2px solid #555;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.level-btn:hover:not(:disabled) {
    border-color: #00ffff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.level-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.level-btn.boss {
    background: linear-gradient(180deg, #4a1a1a 0%, #3a0a0a 100%);
    border-color: #ff4444;
    color: #ff6666;
}

.level-btn.boss:hover:not(:disabled) {
    border-color: #ff0000;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
}

/* 游戏画面样式 */
#game-screen {
    position: absolute;
    flex-direction: column;
}

#hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    background: linear-gradient(180deg, #1a1a2e 0%, #0a0a1e 100%);
    border-bottom: 2px solid #333;
    height: 50px;
}

.hud-left, .hud-right {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.hud-center {
    text-align: center;
    color: #fff;
}

.hud-center span {
    display: block;
    margin: 2px 0;
    font-size: 13px;
}

.player-info {
    display: flex;
    gap: 12px;
    color: #fff;
    font-size: 12px;
}

.player-name {
    font-weight: bold;
}

#player1-info .player-name {
    color: #4488ff;
}

#player2-info .player-name {
    color: #44ff88;
}

#game-timer {
    color: #ffd700;
    font-size: 16px;
    font-weight: bold;
}

.small-btn {
    padding: 4px 12px;
    font-size: 12px;
    background: #333;
    color: #fff;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
}

.small-btn:hover {
    background: #444;
}

#game-canvas {
    display: block;
    background: #000;
}

/* 覆盖层样式 */
.overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.overlay.active {
    display: flex;
}

.overlay-content {
    text-align: center;
    color: #fff;
    padding: 30px;
}

.overlay-content h2 {
    color: #00ffff;
    font-size: 28px;
    margin-bottom: 15px;
}

.overlay-content p {
    font-size: 16px;
    margin: 8px 0;
}

/* 关卡过渡目标提示 */
.transition-objective {
    color: #ffd700;
    font-size: 18px !important;
    margin-top: 15px !important;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* 游戏失败界面样式 */
.game-over-content {
    background: linear-gradient(135deg, rgba(80, 0, 0, 0.9) 0%, rgba(50, 0, 0, 0.9) 100%);
    border: 3px solid #ff4444;
    border-radius: 15px;
}

.game-over-content h2 {
    color: #ff4444;
    text-shadow: 0 0 15px #ff4444;
}

.gameover-stats {
    margin: 15px 0;
}

.gameover-stats p {
    font-size: 16px;
    color: #fff;
    margin: 8px 0;
}

/* 通关画面样式 */
.victory {
    background: linear-gradient(135deg, rgba(0, 50, 0, 0.9) 0%, rgba(0, 100, 0, 0.9) 100%);
    border: 3px solid #00ff00;
    border-radius: 15px;
    animation: victoryGlow 1s ease-in-out infinite alternate;
}

@keyframes victoryGlow {
    from {
        box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
    }
    to {
        box-shadow: 0 0 40px rgba(0, 255, 0, 0.8);
    }
}

.victory h2 {
    color: #ffd700;
    font-size: 32px;
    text-shadow: 0 0 20px #ffd700;
}

.victory-stats {
    margin: 15px 0;
}

.victory-stats p {
    font-size: 16px;
    color: #fff;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.overlay.active .overlay-content {
    animation: fadeIn 0.3s ease-out;
}

/* 关卡完成界面样式 */
.success {
    background: linear-gradient(135deg, rgba(0, 80, 0, 0.9) 0%, rgba(0, 120, 60, 0.9) 100%);
    border: 3px solid #00ff88;
    border-radius: 15px;
}

.success h2 {
    color: #00ff88;
    text-shadow: 0 0 15px #00ff88;
}

.complete-stats {
    margin: 15px 0;
}

.complete-stats p {
    font-size: 18px;
    color: #fff;
    margin: 8px 0;
}

.next-level-info {
    color: #aaffaa;
    font-size: 16px;
    margin: 15px 0;
}

.complete-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.menu-btn.primary {
    background: linear-gradient(180deg, #006644 0%, #004422 100%);
    border-color: #00ff88;
    font-size: 18px;
}

.menu-btn.primary:hover {
    background: linear-gradient(180deg, #008855 0%, #006633 100%);
    border-color: #00ffaa;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}
