/* ============================================
   Solstice Light — 夏至之光 光明主题
   ============================================ */

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

html, body {
    width: 100%; height: 100%;
    overflow: hidden;
    background: #000;
    font-family: 'Segoe UI', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    cursor: crosshair;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
}

/* --- 16:9 游戏容器 — 始终居中填满屏幕 --- */
#gameContainer {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    /* JS 将动态设置 width/height 以保持 16:9 */
    overflow: hidden;
    background: #000011;
}

#gameCanvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: block;
}

/* --- 通用屏幕层 --- */
.screen {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    transition: opacity 0.4s ease;
}

.screen.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 游戏结束场景背景微暗 */
.screen.gameover-backdrop {
    background: rgba(0,0,0,0.15);
    backdrop-filter: blur(2px);
}

/* --- 选船场景 --- */
.ship-select-panel {
    text-align: center;
    background: rgba(5,10,25,0.92);
    border: 1px solid rgba(100,140,180,0.3);
    border-radius: 8px;
    padding: clamp(16px, 3vh, 32px) clamp(20px, 3vw, 40px);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(8px, 1.2vh, 16px);
}
.ship-select-title {
    font-size: clamp(24px, 3vw, 36px);
    letter-spacing: clamp(4px, 0.8vw, 10px);
    color: #ffdd77;
    text-shadow: 0 0 20px rgba(255,200,80,0.3);
}
.ship-select-sub {
    font-size: clamp(11px, 1.1vw, 14px);
    color: rgba(200,210,230,0.35);
    letter-spacing: 4px;
    margin-bottom: 4px;
}
.ship-cards {
    display: flex;
    gap: clamp(8px, 1.2vw, 16px);
    justify-content: center;
    flex-wrap: wrap;
}
.ship-card {
    background: rgba(20,30,50,0.5);
    border: 1px solid rgba(100,140,180,0.2);
    border-radius: 8px;
    padding: clamp(10px, 1.5vh, 18px);
    width: clamp(140px, 18vw, 200px);
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.ship-card:hover {
    border-color: rgba(200,180,60,0.4);
    background: rgba(30,40,60,0.6);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.ship-card.selected {
    border-color: #ffcc44;
    background: rgba(50,40,20,0.5);
    box-shadow: 0 0 24px rgba(255,200,68,0.15), inset 0 0 20px rgba(255,200,68,0.05);
}
.ship-card-visual {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    overflow: hidden;
}
.ship-card-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(255,200,80,0.3));
    image-rendering: pixelated;
}
.ship-card-name {
    font-size: clamp(14px, 1.4vw, 18px);
    font-weight: 600;
    color: #ccddff;
    letter-spacing: 2px;
}
.ship-card-desc {
    font-size: clamp(10px, 0.9vw, 12px);
    color: rgba(180,200,230,0.45);
    letter-spacing: 1px;
    margin: 2px 0;
}
.ship-card-stats {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 4px;
}
.ship-stat {
    font-size: clamp(10px, 0.9vw, 12px);
    color: rgba(255,220,150,0.7);
    letter-spacing: 1px;
}
.ship-buttons {
    display: flex;
    gap: clamp(8px, 1.2vw, 16px);
    margin-top: 4px;
}

/* --- 标题场景 --- */
.title-container {
    display: flex;
    align-items: center;
    gap: 2vw;
    margin-bottom: 1vh;
}

.title-decor {
    width: 6vw;
    height: 2px;
    max-width: 80px;
}

.left-decor  { background: linear-gradient(90deg, transparent, #ffcc44); }
.right-decor { background: linear-gradient(90deg, #ffcc44, transparent); }

.game-title {
    font-size: clamp(28px, 5vw, 64px);
    font-weight: 700;
    letter-spacing: clamp(4px, 1vw, 14px);
    color: #ffdd77;
    text-shadow: 0 0 30px rgba(255,200,80,0.5), 0 0 60px rgba(255,180,50,0.2), 0 2px 4px rgba(0,0,0,0.5);
    animation: titleFloat 3s ease-in-out infinite;
    white-space: nowrap;
}

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

.game-subtitle {
    text-align: center;
    font-size: clamp(12px, 1.6vw, 18px);
    letter-spacing: clamp(4px, 0.8vw, 10px);
    color: rgba(255,220,150,0.6);
    margin-top: 5px;
}

/* --- 标题叙事文字 --- */
.title-narrative {
    text-align: center;
    font-size: clamp(12px, 1.4vw, 16px);
    line-height: 1.8;
    color: rgba(255,220,150,0.5);
    letter-spacing: 2px;
    margin: 1vh 2vw 0;
    max-width: 600px;
}

.title-geometry {
    width: clamp(80px, 12vw, 160px);
    height: 3px;
    margin: 2vh 0 3vh;
    background: linear-gradient(90deg, transparent, #ffcc44, transparent);
    border-radius: 2px;
}

/* --- 按钮 --- */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 1.5vh;
    margin-bottom: 2vh;
}

.neon-btn {
    position: relative;
    padding: clamp(10px, 1.5vh, 16px) clamp(32px, 5vw, 56px);
    font-size: clamp(14px, 1.6vw, 18px);
    font-family: inherit;
    letter-spacing: clamp(2px, 0.4vw, 6px);
    color: #ccddff;
    background: rgba(10,20,40,0.88);
    border: 1px solid rgba(100,140,180,0.5);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.25s ease;
    backdrop-filter: blur(5px);
    white-space: nowrap;
}

.neon-btn-cyan    { border-color: rgba(100,150,200,0.5); }
.neon-btn-cyan:hover,
.neon-btn-cyan:active {
    border-color: #6699cc;
    background: rgba(20,40,70,0.92);
    color: #fff;
    box-shadow: 0 0 24px rgba(80,120,180,0.35);
}

.neon-btn-magenta { border-color: rgba(180,140,100,0.5); }
.neon-btn-magenta:hover,
.neon-btn-magenta:active {
    border-color: #cc9966;
    background: rgba(40,25,10,0.92);
    color: #fff;
    box-shadow: 0 0 24px rgba(180,120,60,0.35);
}

.neon-btn-gold { border-color: rgba(220,180,60,0.6); color: #ffcc44; }
.neon-btn-gold:hover,
.neon-btn-gold:active {
    border-color: #ffcc44;
    background: rgba(50,35,10,0.92);
    color: #ffdd66;
    box-shadow: 0 0 28px rgba(220,180,40,0.45);
}

.neon-btn:active { transform: scale(0.96); }

/* --- 最高分 --- */
.high-score-display {
    display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 1.5vh;
}
.hs-label {
    font-size: clamp(10px, 1vw, 13px);
    letter-spacing: 3px;
    color: rgba(180,200,230,0.4);
    text-transform: uppercase;
}
.hs-value {
    font-size: clamp(22px, 2.6vw, 30px);
    color: #ffaa44;
    text-shadow: 0 0 10px rgba(255,170,68,0.3);
}
.controls-hint {
    font-size: clamp(11px, 1.1vw, 14px);
    color: rgba(180,200,230,0.35);
    letter-spacing: 1px;
}

/* --- 暂停面板 --- */
.pause-panel {
    text-align: center;
    background: rgba(5,10,25,0.93);
    border: 1px solid rgba(100,140,180,0.4);
    border-radius: 6px;
    padding: clamp(24px, 5vh, 48px) clamp(36px, 7vw, 72px);
    backdrop-filter: blur(12px);
    display: flex; flex-direction: column; gap: 2vh;
}
.pause-title {
    font-size: clamp(24px, 3.5vw, 40px);
    letter-spacing: clamp(4px, 0.8vw, 10px);
    color: #ccddff;
    text-shadow: 0 0 15px rgba(100,140,200,0.4);
}

/* --- 游戏结束面板 — 玻璃质感 --- */
.gameover-panel {
    text-align: center;
    background: rgba(8,16,32,0.35);
    border: 1px solid rgba(200,180,140,0.15);
    border-radius: clamp(12px, 1.2vw, 18px);
    padding: clamp(20px, 3.5vh, 40px) clamp(28px, 4vw, 48px);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1.2vh, 16px);
    min-width: min(380px, 82vw);
    max-width: 480px;
    box-shadow:
        0 0 40px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.06);
    position: relative;
    overflow: hidden;
}
/* 顶部微弱光晕 */
.gameover-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        ellipse at 50% 0%,
        rgba(255,160,60,0.04) 0%,
        transparent 60%
    );
    pointer-events: none;
}

.gameover-title {
    font-size: clamp(22px, 3.2vw, 36px);
    font-weight: 700;
    letter-spacing: clamp(4px, 0.8vw, 10px);
    color: #ff9966;
    text-shadow: 0 0 20px rgba(255,120,60,0.3), 0 0 40px rgba(255,80,40,0.1);
    margin-bottom: 2px;
}
.final-score {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.fs-label {
    font-size: clamp(10px, 1vw, 13px);
    letter-spacing: 4px;
    color: rgba(200,210,230,0.35);
    text-transform: uppercase;
}
.fs-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 2px;
}
.fs-value {
    font-size: clamp(34px, 4.2vw, 50px);
    font-weight: 700;
    color: #ffcc44;
    text-shadow: 0 0 20px rgba(255,200,68,0.35), 0 0 60px rgba(255,180,40,0.1);
    letter-spacing: 1px;
}
.fs-rating {
    font-size: clamp(22px, 2.8vw, 34px);
    font-weight: 700;
    letter-spacing: 2px;
    padding: 3px 12px;
    border-radius: 6px;
    border: 2px solid;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(4px);
}
.fs-rating.rating-S {
    color: #ffdd44;
    border-color: rgba(255,221,68,0.5);
    text-shadow: 0 0 20px rgba(255,221,68,0.5);
    box-shadow: 0 0 15px rgba(255,221,68,0.1);
}
.fs-rating.rating-A {
    color: #66dd88;
    border-color: rgba(102,221,136,0.4);
    text-shadow: 0 0 15px rgba(102,221,136,0.3);
}
.fs-rating.rating-B {
    color: #66aaff;
    border-color: rgba(102,170,255,0.35);
    text-shadow: 0 0 10px rgba(102,170,255,0.2);
}
.fs-rating.rating-C {
    color: #cc8844;
    border-color: rgba(204,136,68,0.35);
}
.fs-rating.rating-D {
    color: #887766;
    border-color: rgba(136,119,102,0.3);
}
.new-highscore {
    font-size: clamp(15px, 1.6vw, 20px);
    color: #ffcc44;
    text-shadow: 0 0 15px rgba(255,200,68,0.4);
    animation: scoreBounce 0.6s ease-in-out infinite alternate;
    letter-spacing: 2px;
}
@keyframes scoreBounce {
    from { transform: scale(1); }
    to { transform: scale(1.06); }
}

/* — 统计面板 2×2 网格 — */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(6px, 0.6vh, 10px);
    padding: clamp(6px, 0.8vh, 12px) 0;
    border-top: 1px solid rgba(200,180,140,0.08);
    border-bottom: 1px solid rgba(200,180,140,0.08);
}
.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: clamp(6px, 0.8vh, 12px) 4px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    border: 1px solid rgba(200,200,220,0.05);
    transition: background 0.2s;
}
.stat-item:hover {
    background: rgba(255,255,255,0.06);
}
.stat-icon {
    font-size: clamp(16px, 1.6vw, 20px);
    filter: drop-shadow(0 0 4px rgba(200,200,255,0.15));
}
.stat-label {
    font-size: clamp(9px, 0.8vw, 11px);
    color: rgba(180,200,230,0.3);
    letter-spacing: 2px;
}
.stat-value {
    font-size: clamp(17px, 1.8vw, 24px);
    font-weight: 600;
    color: #dde4f0;
    text-shadow: 0 0 8px rgba(200,220,255,0.15);
}

/* — 勋章 — */
.medals-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(4px, 0.5vh, 8px);
    padding: 2px 0;
}
.medals-label {
    font-size: clamp(9px, 0.9vw, 11px);
    color: rgba(180,200,230,0.3);
    letter-spacing: 3px;
    text-transform: uppercase;
}
.medals-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}
.medal {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: clamp(11px, 1vw, 13px);
    color: #ffdd77;
    padding: 4px 12px;
    background: rgba(255,220,100,0.06);
    border: 1px solid rgba(255,220,100,0.15);
    border-radius: 14px;
    letter-spacing: 1px;
    backdrop-filter: blur(4px);
    box-shadow: 0 0 8px rgba(255,220,100,0.04);
}

/* — 按钮区 — */
.go-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(6px, 0.8vh, 10px);
    margin-top: 2px;
}

/* — 分享提示 Toast — */
.share-toast {
    position: absolute;
    bottom: 12%;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 24px;
    background: rgba(10,30,20,0.5);
    border: 1px solid rgba(100,220,140,0.2);
    border-radius: 8px;
    color: #88dd99;
    font-size: clamp(12px, 1.1vw, 14px);
    letter-spacing: 2px;
    transition: opacity 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
    backdrop-filter: blur(8px);
    box-shadow: 0 0 20px rgba(100,220,140,0.05);
}
.share-toast.hidden { opacity: 0; }

/* --- HUD — 简洁上下分区布局 --- */
.hud {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 40;
    pointer-events: none;
}
.hud.hidden { display: none; }

/* 顶部行：左/波次/右 三等分 */
.hud-top-row {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.2vh 1.8vw 0;
}

/* 左下：得分 + 生命 */
.hud-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
}

/* 波次 — 顶中 */
.hud-wave {
    position: absolute;
    top: 1.2vh;
    left: 50%;
    transform: translateX(-50%);
}
.wave-value {
    font-size: clamp(13px, 1.4vw, 17px);
    color: rgba(255,220,150,0.35);
    letter-spacing: 3px;
}

/* 右上 */
.hud-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}
.hud-right-item { line-height: 1.3; }

.hud-label {
    font-size: clamp(9px, 0.9vw, 11px);
    letter-spacing: 2px;
    color: rgba(255,220,150,0.35);
    text-transform: uppercase;
}
.hud-value {
    font-size: clamp(20px, 2.5vw, 30px);
    color: #ffdd77;
    text-shadow: 0 0 8px rgba(255,200,80,0.3);
    transition: transform 0.1s ease;
}
.score-value {
    transition: transform 0.08s ease, color 0.1s ease;
}
.score-value.doubled {
    color: #ffdd44;
    animation: scorePulse 0.3s ease-out;
}
@keyframes scorePulse {
    0%   { transform: scale(1.3); color: #ffdd44; }
    50%  { transform: scale(1.15); color: #ffee88; }
    100% { transform: scale(1); color: #ffdd77; }
}

.hud-lives {
    display: flex;
    flex-direction: row;
    gap: 2px;
}
.hud-lives .life-icon {
    color: #dd5544;
    font-size: clamp(16px, 1.8vw, 22px);
    margin-right: 3px;
    transition: opacity 0.3s;
}
.life-icon.lost { opacity: 0.2; }

.hud-weapon { display: flex; align-items: center; gap: 6px; }
.weapon-label {
    font-size: clamp(10px, 1.1vw, 13px);
    color: rgba(255,220,150,0.5);
}
.weapon-level {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: clamp(12px, 1.3vw, 15px);
    color: #ffaa44;
}
.weapon-bar {
    display: inline-flex;
    width: clamp(40px, 4vw, 52px);
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
}
.wb-fill {
    height: 100%;
    width: 20%;
    background: linear-gradient(90deg, #ff8844, #ffcc44);
    border-radius: 3px;
    transition: width 0.2s ease;
    box-shadow: 0 0 6px rgba(255,200,68,0.4);
}
.weapon-text {
    font-size: clamp(11px, 1.2vw, 14px);
    color: #ccddff;
}
.weapon-text.maxed { color: #ffaa44; text-shadow: 0 0 8px rgba(255,170,68,0.5); }

.hud-bombs {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: clamp(14px, 1.6vw, 19px);
    color: #ff8844;
}

/* BGM 开关按钮 */
.bgm-toggle {
    cursor: pointer;
    font-size: clamp(16px, 1.8vw, 22px);
    transition: opacity 0.3s, transform 0.2s;
    user-select: none;
    opacity: 0.6;
    line-height: 1;
}
.bgm-toggle:hover { opacity: 1; transform: scale(1.15); }
.bgm-toggle.muted { opacity: 0.3; }
/* — 底部 Powerup 区域（横排居中） — */
.hud-powerups-bottom {
    position: absolute;
    bottom: 3vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 10px;
    z-index: 40;
    flex-wrap: wrap;
}
.powerup-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: clamp(11px, 1vw, 14px);
    color: #ccddff;
    padding: 5px 12px;
    background: rgba(5,10,25,0.75);
    border: 1px solid rgba(100,140,180,0.3);
    border-radius: 4px;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}
.powerup-timer .pu-icon { font-size: clamp(13px, 1.2vw, 16px); }
.powerup-timer .pu-label { color: rgba(200,220,255,0.7); }

/* 进度条样式 */
.pu-bar {
    display: inline-flex;
    width: clamp(36px, 3vw, 48px);
    height: 5px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
}
.pu-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s linear;
}
.pu-bar-fill.type-speed { background: linear-gradient(90deg, #44cc44, #66ff66); box-shadow: 0 0 6px rgba(68,204,68,0.4); }
.pu-bar-fill.type-double { background: linear-gradient(90deg, #cc8800, #ffcc00); box-shadow: 0 0 6px rgba(255,204,0,0.4); }
.pu-bar-fill.type-shield { background: linear-gradient(90deg, #4488ff, #66aaff); box-shadow: 0 0 6px rgba(68,136,255,0.4); }

.pu-time {
    font-size: clamp(10px, 0.9vw, 12px);
    color: rgba(200,220,255,0.5);
    min-width: 20px;
    text-align: right;
}

.shield-indicator {
    font-size: clamp(11px, 1vw, 14px);
    color: #88bbff;
    padding: 5px 12px;
    background: rgba(5,10,25,0.75);
    border: 1px solid rgba(68,136,255,0.3);
    border-radius: 4px;
    backdrop-filter: blur(4px);
    animation: shieldPulse 2s ease-in-out infinite;
}
@keyframes shieldPulse {
    0%, 100% { border-color: rgba(68,136,255,0.2); box-shadow: 0 0 0 rgba(68,136,255,0); }
    50% { border-color: rgba(68,136,255,0.5); box-shadow: 0 0 12px rgba(68,136,255,0.2); }
}

/* — 全屏双倍分金色闪烁 — */
.double-flash {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 30;
    background: radial-gradient(ellipse at center, rgba(255,200,50,0.08), transparent 70%);
    animation: doubleFlashFade 0.8s ease-out forwards;
}
@keyframes doubleFlashFade {
    0%   { opacity: 1; }
    100% { opacity: 0; }
}

/* --- 波次提示 --- */
.wave-announce {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 45;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.wave-announce.hidden { opacity: 0; }
.wave-text {
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 700;
    letter-spacing: 4px;
    color: #ffdd77;
    text-shadow: 0 0 20px rgba(255,200,80,0.5);
    animation: wavePopIn 0.4s ease-out, wavePopOut 0.4s ease-in 1.6s forwards;
}
@keyframes wavePopIn {
    from { transform: scale(2); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
@keyframes wavePopOut {
    from { transform: scale(1.5); opacity: 1; }
    to { transform: scale(0.5); opacity: 0; }
}

/* --- Boss 警告 --- */
.boss-warning {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 45;
    pointer-events: none;
    text-align: center;
    transition: opacity 0.3s ease;
}
.boss-warning.hidden { opacity: 0; }
.warning-text {
    display: block;
    font-size: clamp(20px, 2.8vw, 30px);
    letter-spacing: 5px;
    font-weight: 700;
    color: #ff3355;
    text-shadow: 0 0 15px rgba(255,40,60,0.6);
    animation: warningBlink 0.5s ease-in-out infinite alternate;
}
.boss-text {
    display: block;
    font-size: clamp(14px, 1.6vw, 20px);
    letter-spacing: 3px;
    color: #ffdd77;
    margin-top: 8px;
}
.warning-flash {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    animation: warningFlash 0.3s ease-in-out infinite alternate;
    pointer-events: none;
}
@keyframes warningBlink { from { opacity:1; } to { opacity:0.3; } }
@keyframes warningFlash {
    from { background: rgba(255,40,0,0.02); }
    to { background: rgba(255,40,0,0.06); }
}

.hidden { display: none !important; }

/* --- 移动端触屏优化 --- */
@media (max-width: 768px) {
    .neon-btn {
        padding: 12px 28px;
        min-height: 44px; /* Apple 建议最小触控目标 */
    }
    .controls-hint {
        font-size: 11px;
    }
}

/* ========== 竖屏模式(9:16) 布局适配 ========== */
.portrait-mode {
    /* 选船面板：减少左右 padding，充分利用窄屏宽度 */
}
.portrait-mode .ship-select-panel {
    padding: clamp(12px, 2vh, 20px) clamp(12px, 2vw, 20px);
    width: min(92vw, 420px);
}
.portrait-mode .ship-select-title {
    font-size: clamp(20px, 3.6vh, 28px);
}
.portrait-mode .ship-cards {
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.portrait-mode .ship-card {
    width: min(85vw, 360px);
    flex-direction: row;
    padding: clamp(8px, 1.5vh, 14px) clamp(12px, 2vw, 18px);
    text-align: left;
}
.portrait-mode .ship-card-visual {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    margin-bottom: 0;
}
.portrait-mode .ship-card-info {
    flex: 1;
    min-width: 0;
}
.portrait-mode .ship-card-stats {
    justify-content: flex-start;
    gap: 6px;
}
.portrait-mode .ship-buttons {
    flex-direction: column;
    gap: 6px;
    width: 100%;
}
.portrait-mode .ship-buttons .neon-btn {
    width: 100%;
    text-align: center;
}
.portrait-mode .gameover-panel {
    min-width: unset;
    max-width: min(90vw, 380px);
    padding: clamp(14px, 2vh, 24px) clamp(16px, 3vw, 28px);
}
.portrait-mode .menu-buttons .neon-btn {
    padding: 12px 28px;
    font-size: clamp(13px, 2.4vh, 16px);
}
.portrait-mode .title-container {
    gap: 3vw;
}
.portrait-mode .title-narrative {
    max-width: 90vw;
    font-size: clamp(11px, 1.8vh, 14px);
}
