/* 1942 飞机射击游戏 - 样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    font-family: 'Courier New', 'PingFang SC', 'Microsoft YaHei', monospace;
    user-select: none;
    -webkit-user-select: none;
}

#game-container {
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(80, 130, 200, 0.3);
    border-radius: 4px;
    box-shadow:
        0 0 30px rgba(50, 100, 200, 0.2),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
}

#gameCanvas {
    display: block;
    image-rendering: pixelated;
}

/* 覆盖层通用 */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(5, 10, 30, 0.85);
    z-index: 10;
    backdrop-filter: blur(4px);
}

.overlay.hidden {
    display: none;
}

/* 开始界面 */
#start-screen .title-area {
    text-align: center;
    margin-bottom: 40px;
}

#start-screen h1 {
    font-size: 72px;
    color: #ffcc33;
    text-shadow:
        0 0 10px rgba(255, 200, 50, 0.5),
        0 0 40px rgba(255, 150, 50, 0.3),
        0 4px 0 #aa6600;
    letter-spacing: 12px;
    font-weight: bold;
}

#start-screen .subtitle {
    color: #88aadd;
    font-size: 16px;
    margin-top: 8px;
    letter-spacing: 6px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* 游戏按钮 */
.game-btn {
    padding: 14px 48px;
    font-size: 20px;
    font-family: inherit;
    font-weight: bold;
    color: #ffffff;
    background: linear-gradient(180deg, #4488cc, #2a5a8f);
    border: 2px solid rgba(100, 180, 255, 0.4);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.game-btn:hover {
    background: linear-gradient(180deg, #55aaee, #3a6aaf);
    border-color: rgba(120, 200, 255, 0.6);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(80, 160, 255, 0.3);
}

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

.game-btn.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 5px rgba(80, 160, 255, 0.2); }
    50% { box-shadow: 0 0 25px rgba(80, 160, 255, 0.5); }
}

/* 操作提示 */
.controls-hint {
    margin-top: 10px;
    text-align: center;
}

.controls-hint p {
    color: rgba(180, 200, 230, 0.7);
    font-size: 12px;
    margin: 5px 0;
    letter-spacing: 1px;
}

/* 暂停界面 */
#pause-screen h2 {
    color: #ffffff;
    font-size: 36px;
    margin-bottom: 30px;
    letter-spacing: 8px;
}

/* 结束界面 */
#gameover-screen h2 {
    color: #ff6644;
    font-size: 36px;
    margin-bottom: 20px;
    letter-spacing: 4px;
    text-shadow: 0 0 20px rgba(255, 100, 60, 0.4);
}

#gameover-screen p {
    color: #dddddd;
    font-size: 18px;
    margin: 6px 0;
}

#gameover-screen #high-score {
    color: #ffcc33;
}

#gameover-screen .game-btn {
    margin-top: 20px;
}

/* HUD */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 5;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, transparent 100%);
}

#hud.hidden {
    display: none;
}

#hud-left, #hud-center, #hud-right {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#hud-center {
    align-items: center;
}

#hud-right {
    align-items: flex-end;
}

#hud span {
    color: #ffffff;
    font-size: 13px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
}

#score-display {
    color: #ffdd66 !important;
    font-weight: bold;
    font-size: 15px !important;
}

#wave-display {
    color: #88ccff !important;
    font-weight: bold;
}

/* 音量/暂停按钮 */
#sound-toggle, #pause-toggle {
    position: absolute;
    bottom: 12px;
    z-index: 15;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#sound-toggle {
    left: 12px;
}

#pause-toggle {
    right: 12px;
}

#sound-toggle:hover, #pause-toggle:hover {
    background: rgba(50, 100, 200, 0.4);
}

#pause-toggle.hidden {
    display: none;
}

/* 移动端适配 */
@media (max-width: 500px) {
    #game-container {
        border: none;
        border-radius: 0;
    }

    .game-btn {
        padding: 12px 36px;
        font-size: 18px;
    }

    #start-screen h1 {
        font-size: 56px;
    }

    .controls-hint p {
        font-size: 11px;
    }
}

/* 滚动条隐藏 */
::-webkit-scrollbar {
    display: none;
}
