/**
 * Rocks & Lasers © 2026 ArpeggioLoop. All rights reserved.
 */
body {
    margin: 0;
    padding: 0;
    background-color: #000;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    flex-direction: column;
    height: 100vh;
    touch-action: none;
}

#game-viewport {
    position: relative;
    flex-grow: 1;
    overflow: hidden;
    background: radial-gradient(circle at center, #0b1026 0%, #000000 100%);
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 60%, rgba(0, 0, 0, 0.8) 100%);
    pointer-events: none;
    z-index: 6;
}


#ui-layer {
    position: relative;
    width: 100%;
    height: 80px;
    background-color: #050508;
    border-bottom: 2px solid #333;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 12px;
    box-sizing: border-box;
    z-index: 20;
    box-shadow: 0 0 20px rgba(0, 200, 255, 0.1);
}

/* Mobile HUD: center Score+Bonus, right-align Sector/Best/Lives */
#ui-layer>.hud-group:first-child {
    grid-column: 2;
    justify-self: center;
}

#ui-layer>.hud-group:last-child {
    grid-column: 3;
    justify-self: end;
}


/* Desktop-only HUD (new style). Hidden by default, enabled via body.desktop. */
#ui-layer-desktop {
    display: none;
}

body.desktop #ui-layer {
    display: none;
}

body.desktop #ui-layer-desktop {
    display: flex;
    position: relative;
    width: 100%;
    height: 88px;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    box-sizing: border-box;
    z-index: 20;
    background: linear-gradient(180deg, rgba(10, 18, 34, 0.98), rgba(6, 10, 18, 0.98));
    border-bottom: 2px solid rgba(0, 220, 255, 0.18);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), 0 0 24px rgba(0, 200, 255, 0.10);
}

body.desktop #pause-btn.mobile-control {
    display: none !important;
}

body.desktop #pause-btn-desktop.hud-pause {
    width: 62px;
    height: 62px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(120, 140, 170, 0.32), rgba(30, 40, 60, 0.42));
    border: 2px solid rgba(200, 220, 255, 0.32);
    box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.55), 0 0 18px rgba(0, 0, 0, 0.5);
    color: rgba(240, 248, 255, 0.92);
    font-weight: 900;
    font-size: 26px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.35);
}

body.desktop #pause-btn-desktop.hud-pause:active {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.18);
}

body.desktop .hud-cluster {
    display: flex;
    align-items: center;
    gap: 16px;
}

body.desktop .hud-left {
    justify-content: flex-start;
}

body.desktop .hud-right {
    justify-content: flex-end;
}

body.desktop .hud-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(18, 54, 92, 0.62), rgba(8, 26, 48, 0.78));
    border: 2px solid rgba(0, 220, 255, 0.22);
    box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.55), 0 0 18px rgba(0, 200, 255, 0.12);
}

body.desktop .hud-pill.hud-best {
    border-color: rgba(255, 215, 0, 0.22);
}

body.desktop .hud-label {
    color: #3ff6ff;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.35);
    line-height: 1;
}

body.desktop .hud-main {
    color: #e9ffff;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.25);
    line-height: 1;
}

body.desktop .hud-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

body.desktop .hud-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
}

body.desktop .hud-svg {
    width: 42px;
    height: 42px;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.6));
}

body.desktop .hud-bonus-value {
    color: #ffd35a;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.35);
}

body.desktop .hud-lives {
    padding: 12px 18px;
}

body.desktop .hud-hearts {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

body.desktop .hud-heart {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    color: #ff3b3b;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.35);
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.6));
}

/* Compact desktop HUD for small game frames (CrazyGames checks down to 800x450). */
@media (max-width: 1100px), (max-height: 620px) {
    body.desktop #ui-layer-desktop {
        height: 64px;
        padding: 0 10px;
    }

    body.desktop #pause-btn-desktop.hud-pause {
        width: 46px;
        height: 46px;
        border-radius: 12px;
        font-size: 20px;
    }

    body.desktop .hud-cluster {
        gap: 8px;
    }

    body.desktop .hud-pill,
    body.desktop .hud-lives {
        gap: 8px;
        padding: 6px 10px;
        border-radius: 14px;
    }

    body.desktop .hud-label {
        font-size: 11px;
        letter-spacing: 1px;
    }

    body.desktop .hud-main {
        font-size: 19px;
    }

    body.desktop .hud-icon,
    body.desktop .hud-svg {
        width: 30px;
        height: 30px;
    }

    body.desktop .hud-hearts {
        gap: 4px;
        margin-top: 4px;
    }

    body.desktop .hud-heart {
        width: 14px;
        height: 14px;
        font-size: 14px;
    }
}

.hud-group {
    display: flex;
    gap: 20px;
}

.hud-panel {
    display: flex;
    align-items: center;
    background: rgba(0, 20, 40, 0.8);
    border: 1px solid rgba(0, 200, 255, 0.3);
    border-radius: 12px;
    padding: 8px 20px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.hud-panel.highscore {
    border-color: rgba(255, 215, 0, 0.3);
}

.hud-text {
    color: #00ffff;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.6);
}

.hud-value {
    color: #ffffff;
    margin-left: 10px;
    font-size: 20px;
    font-weight: 600;
}

.bonus-active {
    border-color: #ffd700 !important;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3) !important;
}

.bonus-text-active {
    color: #ffd700 !important;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.8) !important;
}

/* --- JOYSTICK STYLES --- */
#joystick-zone {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    z-index: 40;
    touch-action: none;
}

#joystick-base {
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(0, 255, 255, 0.5);
    border-radius: 50%;
    position: absolute;
    display: none;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
    pointer-events: none;
    transform: translate(-50%, -50%);
}

#joystick-base::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#joystick-stick {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle at 30% 30%, #00ffff, #005577);
    border-radius: 50%;
    position: absolute;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.6);
    transform: translate(0, 0);
    pointer-events: none;
}

#shield-btn {
    position: absolute;
    bottom: 150px;
    left: 30px;
    width: 66px;
    height: 76px;
    z-index: 50;
    touch-action: none;
    background: linear-gradient(135deg, rgba(0, 200, 255, 0.3), rgba(0, 100, 200, 0.5));
    border: 2px solid rgba(0, 255, 255, 0.8);
    border-radius: 6px 6px 30px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
    cursor: pointer;
    transition: transform 0.1s, background 0.1s, box-shadow 0.1s;
}

#shield-btn:active {
    transform: scale(0.95);
    background: rgba(0, 255, 255, 0.6);
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.8);
}

#shield-count-mobile {
    font-size: 28px;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 0 10px #00ffff;
    font-family: 'Segoe UI', monospace;
}

#pause-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    z-index: 50;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    color: #fff;
    font-weight: bold;
    font-size: 20px;
    font-family: monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    touch-action: none;
    text-shadow: 0 0 5px #fff;
    transition: all 0.1s;
}

#pause-btn:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.95);
}

#center-screen-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 10, 15, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 80;
    pointer-events: auto;
}

#pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 60;
    pointer-events: auto;
}

#pause-text {
    color: #fff;
    font-size: 48px;
    font-weight: bold;
    letter-spacing: 10px;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    margin-bottom: 40px;
}

.pause-menu-btn {
    margin: 10px;
    padding: 15px 50px;
    font-size: 24px;
    width: 280px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    font-weight: bold;
    color: white;
}

#resume-btn {
    background: linear-gradient(45deg, #0044cc, #0088ff);
    box-shadow: 0 0 15px rgba(0, 136, 255, 0.4);
}

#quit-btn {
    background: linear-gradient(45deg, #880000, #cc0000);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.4);
}

#dev-menu {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #00ff00;
    padding: 20px;
    border-radius: 10px;
    display: none;
    flex-direction: column;
    align-items: center;
    z-index: 40;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

#dev-menu h3 {
    color: #00ff00;
    margin: 0 0 15px 0;
    text-transform: uppercase;
}

#dev-level-input {
    background: #111;
    border: 1px solid #00ff00;
    color: #00ff00;
    padding: 5px;
    font-size: 16px;
    width: 60px;
    text-align: center;
    margin-bottom: 10px;
}

.dev-btn {
    background: #004400;
    color: #00ff00;
    border: 1px solid #00ff00;
    padding: 5px 15px;
    cursor: pointer;
    text-transform: uppercase;
    font-weight: bold;
}

.dev-btn:hover {
    background: #006600;
}

body.desktop .mobile-control {
    display: none !important;
}

/* Desktop joystick: keep the floating joystick enabled even when other mobile controls are hidden */
body.desktop #joystick-zone.mobile-control {
    display: block !important;
}

/* Desktop: keep shield button visible */
body.desktop #shield-btn.mobile-control {
    display: flex !important;
}

h1 {
    color: #fff;
    background: -webkit-linear-gradient(#fff, #00ffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(0, 255, 255, 0.4));
    font-size: 72px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 4px;
    text-align: center;
    font-weight: 900;
}

h2 {
    color: #00ffff;
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
    font-size: 36px;
    margin-bottom: 20px;
    text-transform: uppercase;
    font-weight: 600;
}

p {
    color: #aaa;
    font-size: 16px;
    line-height: 1.6;
    text-align: center;
    max-width: 600px;
}

button {
    margin-top: 40px;
    padding: 18px 60px;
    font-size: 20px;
    background: linear-gradient(45deg, #0044cc, #0088ff);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s, background 0.3s;
    box-shadow: 0 0 20px rgba(0, 100, 255, 0.4);
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 2px;
    touch-action: manipulation;
}

@media (hover: hover) {
    button:hover {
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(0, 150, 255, 0.6);
        background: linear-gradient(45deg, #0055ee, #00aaff);
    }
}

button:active {
    transform: scale(0.95);
    box-shadow: 0 0 10px rgba(0, 100, 255, 0.8);
    background: linear-gradient(45deg, #003399, #0066cc);
}

@media (max-width: 768px) {
    button {
        padding: 15px 30px;
        font-size: 18px;
        margin-top: 20px;
        width: auto;
    }

    #start-content>div {
        flex-wrap: wrap;
        justify-content: center;
    }
}

.title-perfect {
    color: #44ff44 !important;
    text-shadow: 0 0 20px rgba(0, 255, 0, 0.6);
    background: none;
    -webkit-text-fill-color: #44ff44;
}

.title-poor {
    color: #ffaa00 !important;
    text-shadow: 0 0 15px rgba(255, 170, 0, 0.5);
    background: none;
    -webkit-text-fill-color: #ffaa00;
}

.controls-info {
    margin-top: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 20px 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.key {
    color: #00aaff;
    font-weight: bold;
}

#start-content,
#game-over-content,
#level-complete-content,
#game-complete-content {
    display: none;
    flex-direction: column;
    align-items: center;
}

/* Between-rounds: bonus multiplier feedback (uses the same medal-style icon as the BONUS HUD) */
.level-bonus-row {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

.level-bonus-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(136, 255, 255, 0.22);
    box-shadow: 0 0 24px rgba(0, 255, 255, 0.18);
}

.level-bonus-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
}

.level-bonus-label {
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
}

.level-bonus-value {
    font-size: 28px;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 18px rgba(255, 215, 0, 0.25);
    margin-top: 4px;
}

.level-bonus-note {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.68);
    margin-top: 4px;
}

@media (max-width: 768px) {
    .level-bonus-pill {
        padding: 10px 14px;
        border-radius: 14px;
    }

    .level-bonus-value {
        font-size: 24px;
    }
}

.glitch-hud {
    animation: glitch-anim 0.2s infinite;
}

@keyframes glitch-anim {
    0% {
        transform: translate(0);
        text-shadow: 2px 0 #ff0000, -2px 0 #0000ff;
    }

    25% {
        transform: translate(2px, 2px);
        text-shadow: -2px 0 #ff0000, 2px 0 #0000ff;
    }

    50% {
        transform: translate(-2px, -2px);
        text-shadow: 2px 0 #00ff00, -2px 0 #ff00ff;
    }

    75% {
        transform: translate(0);
        text-shadow: none;
    }

    100% {
        transform: translate(0);
    }
}

#leaderboard-view {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 600px;
}

/* ---------- SETTINGS VIEW ---------- */
#settings-view {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 480px;
}

.settings-container {
    width: 100%;
    padding: 10px 20px;
    box-sizing: border-box;
}

.settings-group {
    margin-bottom: 20px;
}

.settings-label {
    display: block;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 2px;
    color: #88ffff;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.settings-slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.15);
    outline: none;
    cursor: pointer;
}

.settings-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00ddff, #0088cc);
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 10px rgba(0, 200, 255, 0.5);
    cursor: pointer;
}

.settings-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00ddff, #0088cc);
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 10px rgba(0, 200, 255, 0.5);
    cursor: pointer;
}

.settings-val {
    font-family: 'Segoe UI', monospace;
    font-weight: 900;
    font-size: 16px;
    color: #ffffff;
    min-width: 48px;
    text-align: right;
}

.settings-check-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.5px;
}

.settings-check-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #00ddff;
    cursor: pointer;
}

/* Overlay scroll mode (used for Hangar/Leaderboard so you can scroll on mobile) */
#center-screen-overlay.overlay-scroll {
    justify-content: flex-start;
    /* iOS/iPad scrolling: make the overlay a real scroll container */
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    overflow: auto;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-top: 14px;
    padding-bottom: 14px;
    touch-action: pan-y;
}

/* Disable the mobile transform scaling for scrollable views (it breaks scrolling). */
body:not(.desktop) #center-screen-overlay.overlay-scroll>div {
    transform: none !important;
}

/* Hangar (ship selection) */
#hangar-view {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 920px;
    box-sizing: border-box;
}

/* Give the last button breathing room, especially on iPad (safe-area). */
#hangar-back-btn {
    margin-bottom: calc(24px + env(safe-area-inset-bottom));
}

/* One ship per line, scrolls vertically */
.hangar-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: stretch;
    width: 100%;
    max-width: 680px;
    padding: 6px 10px 18px;
    box-sizing: border-box;
}

.ship-card {
    width: 100%;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
}

.ship-card.is-active-ship {
    border-color: rgba(0, 255, 255, 0.35);
    box-shadow: 0 0 26px rgba(0, 200, 255, 0.14), 0 0 24px rgba(0, 0, 0, 0.35);
}

.ship-card.is-locked-card {
    opacity: 0.85;
}

.ship-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.ship-card-title {
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 2px;
    font-size: 16px;
    color: #e8fbff;
}

.ship-card-badge {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1px;
    padding: 6px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    white-space: nowrap;
}

.ship-card-badge-locked {
    background: rgba(255, 80, 0, 0.18);
    border: 1px solid rgba(255, 80, 0, 0.45);
    color: rgba(255, 200, 180, 0.95);
}

.ship-card-badge-unlocked {
    background: rgba(68, 255, 68, 0.14);
    border: 1px solid rgba(68, 255, 68, 0.45);
    color: #44ff44;
}

.ship-card-imgwrap {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 140px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 12px;
    overflow: hidden;
}

.ship-card-imgwrap img {
    max-width: 100%;
    max-height: 100%;
}

.ship-card-desc {
    margin-top: 10px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    text-align: center;
    min-height: 38px;
}

.ship-card-stats {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ship-stat-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ship-stat-label {
    width: 66px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(0, 255, 255, 0.85);
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.18);
}

.ship-stat-bar {
    flex: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.55);
}

.ship-stat-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(0, 200, 255, 0.85), rgba(0, 255, 213, 0.85));
    box-shadow: 0 0 16px rgba(0, 200, 255, 0.18);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.75s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#hangar-view.stats-animate .ship-stat-fill {
    transform: scaleX(1);
}

.ship-stat-val {
    width: 52px;
    text-align: right;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.75);
}

.ship-traits {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.ship-trait {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    padding: 6px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.35);
    color: rgba(255, 255, 255, 0.78);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.45);
}

.ship-trait-pro {
    border-color: rgba(68, 255, 68, 0.28);
    background: rgba(68, 255, 68, 0.06);
    color: rgba(120, 255, 160, 0.95);
}

.ship-trait-con {
    border-color: rgba(255, 80, 0, 0.30);
    background: rgba(255, 80, 0, 0.06);
    color: rgba(255, 190, 160, 0.95);
}

/* Override global button spacing for card buttons */
.ship-card .ship-action-btn {
    margin-top: 14px;
    width: 100%;
    padding: 12px 0;
    font-size: 16px;
    border-radius: 10px;
}

.ship-card .ship-action-btn:disabled {
    cursor: default;
    box-shadow: none;
    opacity: 0.85;
}

.ship-card .ship-action-btn.is-active {
    background: linear-gradient(45deg, #00c8ff, #00ffd5);
    color: #001018;
}

.ship-card .ship-action-btn.is-locked {
    background: linear-gradient(45deg, #444, #777);
}

.leaderboard-container {
    background: rgba(5, 10, 20, 0.95);
    border: 2px solid #00ffff;
    border-radius: 12px;
    padding: 10px 20px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 20px;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.15);
    min-height: 100px;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

#leaderboard-entries {
    touch-action: pan-y;
}

.score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 10px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    font-family: 'Segoe UI', sans-serif;
}

.score-row:last-child {
    border-bottom: none;
}

.score-rank {
    color: #ffd700;
    width: 40px;
    font-weight: 800;
    font-size: 20px;
    text-align: left;
}

.score-name {
    flex-grow: 1;
    text-align: left;
    padding-left: 10px;
    color: #ffffff;
    font-size: 20px;
    font-weight: 600;
    text-transform: uppercase;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.8);
}

.score-value {
    color: #44ff44;
    font-weight: bold;
    font-family: monospace;
    font-size: 24px;
    text-align: right;
    text-shadow: 0 0 8px rgba(68, 255, 68, 0.5);
}

.score-row:nth-child(1) .score-name {
    color: #ffd700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
}

.score-row:nth-child(2) .score-name {
    color: #e0e0e0;
}

.score-row:nth-child(3) .score-name {
    color: #cd7f32;
}

.loading-text {
    color: #00ffff;
    margin: 20px 0;
    font-style: italic;
}

.no-scores {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

#high-score-input {
    display: none;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
    animation: pulse-gold 2s infinite;
}

@keyframes pulse-gold {
    0% {
        filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.3));
    }

    50% {
        filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.8));
    }

    100% {
        filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.3));
    }
}

#player-name-input {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #ffd700;
    color: #ffd700;
    padding: 10px 20px;
    font-size: 24px;
    text-align: center;
    text-transform: uppercase;
    border-radius: 4px;
    width: 150px;
    font-family: 'Segoe UI', sans-serif;
    font-weight: bold;
    outline: none;
    margin-bottom: 10px;
    user-select: text;
    -webkit-user-select: text;
    touch-action: manipulation;
    z-index: 90;
}

#submit-score-btn {
    background: linear-gradient(45deg, #aa8800, #ffdd00);
    color: #000;
    border: none;
    padding: 10px 30px;
    font-weight: 900;
    cursor: pointer;
    text-transform: uppercase;
    border-radius: 4px;
    font-size: 16px;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

@media (max-width: 768px) {
    body:not(.desktop) #ui-layer {
        height: 56px;
        padding: 0 8px;
    }

    body:not(.desktop) .hud-group {
        gap: 8px;
    }

    body:not(.desktop) .hud-panel {
        padding: 4px 8px;
        border-radius: 8px;
    }

    /* 15% smaller top HUD text on mobile (base before scaling) */
    body:not(.desktop) .hud-text {
        font-size: 9px;
        letter-spacing: 0.5px;
    }

    body:not(.desktop) .hud-value {
        font-size: 12px;
        margin-left: 6px;
    }

    /* Mobile: scale top HUD to match menus (same 0.6 as overlay) */
    body:not(.desktop) #ui-layer {
        transform: scale(0.6);
        transform-origin: top left;
        width: calc(100% / 0.6);
    }

    body:not(.desktop) #pause-overlay {
        padding: 10px;
    }

    body:not(.desktop) .pause-menu-btn {
        padding: 8px 20px;
        font-size: 14px;
        margin-top: 10px;
    }

    body:not(.desktop) #start-content h1 {
        font-size: 32px;
        letter-spacing: 1px;
        margin-bottom: 4px;
    }

    body:not(.desktop) #start-content h2 {
        font-size: 16px;
        margin-bottom: 12px;
    }

    body:not(.desktop) #start-content p {
        font-size: 13px;
        max-width: 320px;
    }

    body:not(.desktop) #start-content button {
        font-size: 14px;
        padding: 10px 22px;
        margin-top: 10px;
    }

    body:not(.desktop) #center-screen-overlay>div {
        transform: scale(0.6);
        transform-origin: center center;
    }

    body:not(.desktop) #level-complete-content,
    body:not(.desktop) #victory-content {
        transform: scale(0.6);
    }

    body:not(.desktop) #game-over-content,
    body:not(.desktop) #game-complete-content {
        transform: scale(0.6);
    }
}

/* ---------- SECTOR CLEARED: mobile compact layout ---------- */
/* The 0.6 scale transform keeps the full layout box, so tighten internal spacing. */
@media (hover: none) and (pointer: coarse) {
    body:not(.desktop) #level-complete-content h1 {
        font-size: 36px !important;
        margin-bottom: 4px !important;
    }

    body:not(.desktop) #level-complete-content h2 {
        font-size: 18px !important;
        margin-bottom: 6px !important;
    }

    body:not(.desktop) #level-complete-content p {
        font-size: 13px !important;
        margin: 4px 0 !important;
    }

    body:not(.desktop) #level-complete-content button {
        margin-top: 8px !important;
        padding: 12px 24px !important;
    }

    body:not(.desktop) #level-complete-content .level-bonus-row {
        margin-top: 8px !important;
    }

    /* Reduce the overall gap the scaled box occupies */
    body:not(.desktop) #level-complete-content {
        margin-top: -40px;
    }
}

/* ---------- SPLASH SCREEN ---------- */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    flex-direction: column;
    z-index: 120;
    padding: 0;
    box-sizing: border-box;
    text-align: left;
    overflow: hidden;
    background:
        url("../assets/menubackground.webp?v=6251") center center / cover no-repeat,
        #02030a;
    opacity: 1;
    transition: opacity 0.30s ease-out;
}

#splash-screen.splash-hide {
    opacity: 0;
    pointer-events: none;
}

/* Soft vignette for readability without hiding the art */
#splash-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.10) 0%, rgba(0, 0, 0, 0.55) 78%);
    pointer-events: none;
}

/* New splash layout (instruction panel + launch button) */
#splash-screen .splash-panel {
    position: absolute;
    top: 12%;
    right: 6%;
    width: 52vw;
    max-width: 820px;
    min-width: 340px;
    padding: 28px 34px 26px;
    box-sizing: border-box;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.40);
    border: 1px solid rgba(0, 200, 255, 0.22);
    box-shadow: 0 0 48px rgba(0, 0, 0, 0.75), 0 0 24px rgba(0, 160, 255, 0.12);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    z-index: 1;
}

.splash-panel-title {
    font-size: 34px;
    font-weight: 900;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-align: center;
    color: #ffffff;
    text-shadow: 0 0 18px rgba(0, 0, 0, 0.85);
    margin: 2px 0 18px 0;
}

.splash-panel-list {
    list-style: none;
    padding: 0;
    margin: 0 0 26px 0;
}

.splash-panel-list li {
    position: relative;
    padding-left: 20px;
    margin: 10px 0;
    color: rgba(120, 220, 255, 0.95);
    font-size: 16px;
    line-height: 1.35;
    font-weight: 700;
    text-shadow: 0 0 12px rgba(0, 0, 0, 0.85);
}

.splash-panel-list li::before {
    content: "–";
    position: absolute;
    left: 0;
    top: 0;
    color: rgba(0, 200, 255, 0.95);
}

#splash-play-btn.splash-launch-btn {
    width: 320px;
    height: 86px;
    display: block;
    margin: 0 auto;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background:
        url("../assets/bluebutton.png?v=4022") center center / 100% 100% no-repeat,
        linear-gradient(180deg, rgba(18, 78, 120, 0.92), rgba(5, 18, 32, 0.92));
    color: #ffd34a;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-shadow: 0 0 12px rgba(0, 0, 0, 0.85), 0 0 18px rgba(255, 210, 80, 0.25);
    box-shadow: 0 0 26px rgba(0, 200, 255, 0.22), inset 0 0 26px rgba(0, 0, 0, 0.55);
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

#splash-play-btn.splash-launch-btn:active {
    transform: scale(0.98);
}

#splash-play-btn.splash-launch-btn:focus-visible {
    outline: 3px solid rgba(0, 200, 255, 0.65);
    outline-offset: 4px;
}

.splash-inner {
    background: radial-gradient(circle at top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.6) 55%, transparent 100%);
    padding: 40px 30px;
    border-radius: 20px;
    border: 1px solid rgba(0, 255, 255, 0.25);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.9);
}

.splash-title {
    font-size: 40px;
    letter-spacing: 8px;
    font-weight: 900;
    text-transform: uppercase;
    background: -webkit-linear-gradient(#ffffff, #00ffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(0, 255, 255, 0.6);
    margin-bottom: 10px;
}

.splash-subtitle {
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    margin-bottom: 30px;
}

.splash-hint {
    font-size: 14px;
    color: #ffffff;
    opacity: 0.8;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

@media (max-width: 600px) {
    .splash-inner {
        padding: 25px 18px;
    }

    .splash-title {
        font-size: 28px;
        letter-spacing: 5px;
    }

    .splash-subtitle {
        font-size: 14px;
        letter-spacing: 3px;
    }

    .splash-hint {
        font-size: 12px;
    }
}

@media (max-width: 900px) {
    #splash-screen .splash-panel {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: min(92vw, 680px);
        top: 8%;
        padding: 22px 22px 20px;
    }

    .splash-panel-title {
        font-size: 28px;
        letter-spacing: 3px;
        margin-bottom: 14px;
    }

    .splash-panel-list li {
        font-size: 14px;
        margin: 8px 0;
    }

    #splash-play-btn.splash-launch-btn {
        width: 270px;
        height: 76px;
        font-size: 24px;
        letter-spacing: 3px;
    }
}

@media (max-width: 520px) {
    #splash-screen .splash-panel {
        top: 6%;
    }

    .splash-panel-title {
        font-size: 24px;
    }

    #splash-play-btn.splash-launch-btn {
        width: 240px;
        height: 68px;
        font-size: 22px;
        letter-spacing: 2px;
    }
}

/* Small spacing tweaks */
.leaderboard-container {
    padding: 18px 22px;
}

.score-row {
    padding: 14px 10px;
}

.score-row span[style*="min-width:64px"] {
    margin-left: 12px;
    margin-right: 10px;
}

.score-value {
    min-width: 96px;
}

/* Touch devices (iPad landscape etc.): apply the same scaling as "mobile" */
@media (hover: none) and (pointer: coarse) {
    body:not(.desktop) #center-screen-overlay>div {
        transform: scale(0.6);
        transform-origin: center center;
    }

    body:not(.desktop) #ui-layer {
        transform: scale(0.6);
        transform-origin: top left;
        width: calc(100% / 0.6);
    }
}

/* --- Mobile/tablet landscape: make start menu fit, avoid cut-off buttons --- */
@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-width: 900px) {

    /* Allow content to start higher and scroll if needed */
    body:not(.desktop) #center-screen-overlay {
        justify-content: flex-start;
        padding-top: 8px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Tighten the start menu specifically */
    body:not(.desktop) #start-content {
        margin-top: 0;
        padding-top: 6px;
    }

    body:not(.desktop) #start-content h1 {
        font-size: 22px;
        letter-spacing: 1px;
        margin: 0 0 2px 0;
    }

    body:not(.desktop) #start-content h2 {
        font-size: 12px;
        margin: 0 0 8px 0;
    }

    body:not(.desktop) #start-content .controls-info {
        margin-top: 8px;
        padding: 10px 14px;
    }

    body:not(.desktop) #start-content .controls-info p {
        font-size: 12px;
        line-height: 1.3;
        max-width: 520px;
    }

    body:not(.desktop) #start-content>div {
        gap: 10px;
    }

    body:not(.desktop) #start-content button {
        margin-top: 8px;
        padding: 8px 16px;
        font-size: 12px;
    }
}

/* Large tablets (e.g. iPad 11") landscape: don't shrink start/menu overlay */
@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (min-width: 901px) {

    /* Large tablets: keep the start menu centered, but NEVER block scroll views like Hangar/Leaderboard */
    body:not(.desktop) #center-screen-overlay:not(.overlay-scroll) {
        justify-content: center !important;
        padding-top: env(safe-area-inset-top) !important;
        padding-bottom: env(safe-area-inset-bottom) !important;
        overflow-y: hidden;
    }

    body:not(.desktop) #center-screen-overlay.overlay-scroll {
        justify-content: flex-start !important;
        overflow-y: scroll !important;
        -webkit-overflow-scrolling: touch;
    }

    body:not(.desktop) #center-screen-overlay>div {
        transform: scale(0.95) !important;
        transform-origin: center center;
    }
}

/* Installed iOS status-bar blur can extend below a reported zero safe area.
   Reserve real layout space so the canvas and HUD remain aligned. */
body.ios-standalone:not(.desktop) #ui-layer {
    --hud-top-clearance: max(32px, env(safe-area-inset-top, 0px));
    min-height: calc(34px + var(--hud-top-clearance));
    height: auto;
    padding-top: var(--hud-top-clearance);
    flex-shrink: 0;
    transform: none !important;
    width: 100% !important;
}

/* iPhone/iPad safe-area + fix HUD black band (no transform scaling on ui-layer) */
@media (hover: none) and (pointer: coarse) {

    /* Stop using transform-scaling for the top HUD (it creates extra empty space) */
    body:not(.desktop) #ui-layer {
        transform: none !important;
        width: 100% !important;

        /* Make it small like your menus, but via real sizes (no layout gap) */
        height: calc(34px + env(safe-area-inset-top));
        padding-top: env(safe-area-inset-top);
        padding-left: calc(8px + env(safe-area-inset-left));
        padding-right: calc(8px + env(safe-area-inset-right));
        box-sizing: border-box;
    }

    body:not(.desktop) .hud-group {
        gap: 6px;
    }

    body:not(.desktop) .hud-panel {
        padding: 2px 6px;
        border-radius: 7px;
    }

    body:not(.desktop) .hud-text {
        font-size: 9px;
        letter-spacing: 0.3px;
    }

    body:not(.desktop) .hud-value {
        font-size: 12px;
        margin-left: 5px;
    }

    /* Keep the gameplay buttons out of the notch / Dynamic Island area */
    body:not(.desktop) #pause-btn {
        top: calc(10px + env(safe-area-inset-top));
        left: calc(10px + env(safe-area-inset-left));
    }

    body:not(.desktop) #shield-btn {
        left: calc(12px + env(safe-area-inset-left));
        bottom: calc(150px + env(safe-area-inset-bottom));
    }

    /* Optional: avoid joystick being too close to right notch area */
    body:not(.desktop) #joystick-zone {
        right: env(safe-area-inset-right);
    }
}

/* Shield button: force into bottom-left safe corner on iPhone/iPad touch */
@media (hover: none) and (pointer: coarse) {
    body:not(.desktop) #shield-btn {
        left: calc(10px + env(safe-area-inset-left)) !important;
        top: 50% !important;
        bottom: auto !important;
        transform: translateY(-50%) !important;
    }

    body:not(.desktop) #shield-btn:active {
        transform: translateY(-50%) scale(0.95) !important;
    }
}

/* Menu background (all menus): use the new theme image */
#center-screen-overlay.menu-bg {
    /* Use the new theme image as-is (no tint/overlay filters) */
    background: #02030a url("../assets/menubackground.webp?v=6251") center center / cover no-repeat;

    /* Keep the background art sharp in menus */
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

/* Give each menu view a consistent panel so text stays readable on the themed background */
#center-screen-overlay.menu-bg>div {
    background: rgba(0, 0, 0, 0.42);
    border: 1px solid rgba(120, 220, 255, 0.20);
    border-radius: 18px;
    padding: 26px 30px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
    /* Keep the menu background crisp (the previous blur made the whole page look soft) */
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

/* Themed menu buttons (main menu, hangar, leaderboard, game over, victory, pause menu) */
#center-screen-overlay.menu-bg button,
#pause-overlay button {
    background:
        radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.00) 55%),
        url("../assets/bluebutton.png?v=4022") center center / 100% 100% no-repeat;
    color: #eaf7ff;
    border: none;
    border-radius: 14px;
    padding: 16px 58px;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 0 18px rgba(0, 120, 255, 0.32);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

@media (hover: hover) {

    #center-screen-overlay.menu-bg button:hover,
    #pause-overlay button:hover {
        transform: translateY(-1px) scale(1.03);
        box-shadow: 0 0 26px rgba(0, 160, 255, 0.45);
        filter: brightness(1.08);
    }
}

#center-screen-overlay.menu-bg button:active,
#pause-overlay button:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 0 14px rgba(0, 120, 255, 0.28);
    filter: brightness(0.96);
}

#center-screen-overlay.menu-bg button:disabled {
    cursor: default;
    opacity: 0.65;
    box-shadow: none;
    filter: grayscale(0.2);
}

/* Card action buttons should keep their compact spacing */
#center-screen-overlay.menu-bg .ship-card .ship-action-btn {
    padding: 12px 0;
    font-size: 16px;
}

/* Tutorial overlay */
#tutorial-ui {
    position: absolute;
    inset: 0;
    display: none;
    /* Stack tutorial box + skip button together so they don't overlap other UI
	   elements that live in the top-right corner (eg. Sector 1 radio chatter button). */
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
    pointer-events: none;
    z-index: 9000;
    padding-bottom: 140px;
}

#tutorial-box {
    pointer-events: none;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(0, 255, 255, 0.35);
    box-shadow: 0 0 26px rgba(0, 255, 255, 0.12);
    border-radius: 14px;
    padding: 18px 22px;
    min-width: 280px;
    max-width: 520px;
    text-align: center;
    backdrop-filter: blur(6px);
}

#tutorial-label {
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 3px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 10px;
}

#tutorial-step-text {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 1px;
    color: #e8fbff;
    text-shadow: 0 0 12px rgba(0, 255, 255, 0.18), 0 0 10px rgba(0, 0, 0, 0.9);
    margin-bottom: 12px;
}

#tutorial-hint-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.tutorial-keygroup {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 900;
    letter-spacing: 2px;
    font-size: 12px;
}

.tutorial-keygroup.is-done {
    border-color: rgba(68, 255, 68, 0.75);
    box-shadow: 0 0 18px rgba(68, 255, 68, 0.22);
    color: #44ff44;
}


#tutorial-skip-btn {
    /* Place this right under the tutorial box (instead of top-right), so it
	   never overlaps other UI like the Sector 1 radio chatter button. */
    position: relative;
    top: auto;
    right: auto;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.85);
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 800;
    letter-spacing: 2px;
    cursor: pointer;
}

#tutorial-skip-btn:hover {
    filter: brightness(1.1);
}

/* === WORLD RECORD CELEBRATION === */

#world-record-celebration {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.78);
    z-index: 999999;
    pointer-events: none;
}

#world-record-celebration .wr-wrap {
    width: min(720px, 92vw);
    padding: 26px 22px;
    border-radius: 18px;
    background: rgba(10, 14, 22, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 16px 60px rgba(0, 0, 0, 0.55);
    text-align: center;
    transform: scale(0.96);
    opacity: 0;
    animation: wrPop 900ms ease-out forwards;
}

#world-record-celebration .wr-title {
    font-size: clamp(28px, 5.5vw, 44px);
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffffff;
    text-shadow: 0 0 18px rgba(255, 255, 255, 0.18), 0 0 34px rgba(0, 200, 255, 0.22);
    margin: 0 0 10px 0;
}

#world-record-celebration .wr-sub {
    font-size: clamp(14px, 2.6vw, 18px);
    color: rgba(205, 230, 255, 0.92);
    margin: 0;
}

#world-record-celebration .wr-sub b {
    color: #ffffff;
}

#world-record-celebration .wr-confetti {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 0;
}

#world-record-celebration .wr-piece {
    position: absolute;
    top: -12vh;
    width: 10px;
    height: 18px;
    border-radius: 3px;
    opacity: 0.95;
    transform: translateY(0) rotate(0deg);
    animation: wrFall 1500ms linear forwards;
}

@keyframes wrPop {
    0% {
        transform: scale(0.92);
        opacity: 0;
    }

    35% {
        transform: scale(1.03);
        opacity: 1;
    }

    70% {
        transform: scale(0.995);
        opacity: 1;
    }

    100% {
        transform: scale(1.0);
        opacity: 1;
    }
}

@keyframes wrFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.95;
    }

    85% {
        opacity: 0.95;
    }

    100% {
        transform: translateY(120vh) rotate(520deg);
        opacity: 0;
    }
}

/* ========== CONTROLS TUTORIAL OVERLAY ========== */
#controls-tutorial {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
    touch-action: manipulation;
}

#controls-tutorial.is-visible {
    display: flex;
}

.controls-tutorial-inner {
    max-width: 600px;
    width: 90%;
    padding: 30px 40px;
    background: linear-gradient(180deg, rgba(10, 30, 50, 0.95), rgba(5, 15, 30, 0.98));
    border: 2px solid rgba(0, 200, 255, 0.35);
    border-radius: 20px;
    box-shadow: 0 0 60px rgba(0, 200, 255, 0.15), 0 0 100px rgba(0, 0, 0, 0.8);
    text-align: center;
}

.controls-tutorial-title {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #00ffff;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    margin-bottom: 30px;
    padding: 10px 20px;
    background: rgba(0, 200, 255, 0.1);
    border-radius: 8px;
    display: inline-block;
}

.controls-row {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 40px;
    margin-bottom: 25px;
}

.controls-row-actions {
    margin-top: 10px;
}

.controls-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.controls-or {
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
    font-style: italic;
    align-self: center;
    margin-top: 20px;
}

.key-row {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.key-cap {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #f8f8f8 0%, #d0d0d0 100%);
    border: 2px solid #999;
    border-radius: 8px;
    box-shadow:
        0 4px 0 #888,
        0 6px 10px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    color: #222;
    font-size: 18px;
    font-weight: 900;
    font-family: 'Segoe UI', system-ui, sans-serif;
    text-transform: uppercase;
}

.key-cap.arrow-key {
    font-size: 20px;
}

.key-cap.wide-key {
    width: auto;
    min-width: 100px;
    padding: 0 16px;
    font-size: 14px;
    letter-spacing: 1px;
}

.key-label {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 8px;
}

/* Touch controls visuals */
.touch-joystick {
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.touch-joystick-base {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(0, 255, 255, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}

.touch-joystick-stick {
    width: 36px;
    height: 36px;
    background: radial-gradient(circle at 30% 30%, #00ffff, #005577);
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.6);
}

.touch-button {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    background: linear-gradient(135deg, rgba(0, 200, 255, 0.3), rgba(0, 100, 200, 0.5));
    border: 2px solid rgba(0, 255, 255, 0.8);
    border-radius: 16px;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.controls-tutorial-hint {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #ffd700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    margin-top: 30px;
    animation: pulse-hint 1.5s ease-in-out infinite;
}

@keyframes pulse-hint {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Image-based controls for tutorial */
.controls-image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
}

.controls-hero-image {
    max-width: 100%;
    max-height: 320px;
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
}

.controls-note {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #88ffff;
    text-shadow: 0 0 12px rgba(136, 255, 255, 0.4);
    margin-top: 10px;
}

.controls-joystick-image {
    width: 120px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Shield button visual for mobile tutorial (matches actual in-game button with red ring) */
.controls-shield-btn-visual {
    width: 70px;
    height: 85px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, rgba(0, 200, 255, 0.3), rgba(0, 100, 200, 0.5));
    border: 3px solid rgba(255, 80, 80, 0.9);
    border-radius: 8px 8px 35px 35px;
    box-shadow: 0 0 20px rgba(255, 80, 80, 0.5), 0 0 15px rgba(0, 255, 255, 0.3);
    position: relative;
}

.controls-shield-btn-visual::before {
    content: 'SHIELD';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 1px;
    color: rgba(0, 255, 255, 0.9);
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
}

.shield-count-visual {
    font-size: 32px;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 0 12px #00ffff;
    font-family: 'Segoe UI', monospace;
    margin-top: 12px;
}

/* Short game frames (e.g. 800x450): keep the whole card, incl. the "tap to start" hint, on screen. */
@media (max-height: 700px) {
    .controls-tutorial-inner {
        padding: 12px 24px;
    }

    .controls-tutorial-title {
        font-size: 22px;
        margin-bottom: 10px;
        padding: 6px 14px;
    }

    .controls-image-wrapper {
        margin-bottom: 6px;
    }

    .controls-hero-image {
        max-height: 38vh;
    }

    .controls-note {
        font-size: 14px;
        margin-top: 4px;
    }

    .controls-tutorial-hint {
        font-size: 15px;
        margin-top: 10px;
    }
}

/* Responsive adjustments for tutorial images */
@media (max-width: 500px) {
    .controls-hero-image {
        max-height: 220px;
    }

    .controls-joystick-image {
        width: 90px;
    }

    .controls-shield-btn-visual {
        width: 55px;
        height: 70px;
    }

    .shield-count-visual {
        font-size: 26px;
    }

    .controls-note {
        font-size: 13px;
    }
}

/* Desktop shows keyboard, hides touch */
.controls-desktop-section {
    display: block;
}

.controls-mobile-section {
    display: none;
}

/* Mobile/touch shows touch, hides keyboard */
body:not(.desktop) .controls-desktop-section {
    display: none;
}

body:not(.desktop) .controls-mobile-section {
    display: block;
}

/* Responsive adjustments */
@media (max-width: 500px) {
    .controls-tutorial-inner {
        padding: 20px 20px;
    }

    .controls-tutorial-title {
        font-size: 24px;
        letter-spacing: 2px;
        margin-bottom: 20px;
    }

    .controls-row {
        gap: 20px;
        margin-bottom: 15px;
    }

    .key-cap {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }

    .key-cap.wide-key {
        min-width: 80px;
        font-size: 12px;
    }

    .touch-joystick-base {
        width: 60px;
        height: 60px;
    }

    .touch-joystick-stick {
        width: 28px;
        height: 28px;
    }

    .touch-button {
        width: 55px;
        height: 55px;
        font-size: 28px;
    }

    .key-label {
        font-size: 12px;
    }

    .controls-tutorial-hint {
        font-size: 14px;
        letter-spacing: 2px;
    }
}

/* Green pulsing style for ship unlock progress text */
.ship-progress-pulse {
    color: #44ff44 !important;
    text-shadow: 0 0 12px rgba(68, 255, 68, 0.6), 0 0 24px rgba(68, 255, 68, 0.25);
    animation: pulse 2s ease-in-out infinite;
}

/* Pulse animation for "Tap to Start" prompt */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ===== Difficulty Segmented Control ===== */
.menu-difficulty-row {
    text-align: center;
}

.planetary-score-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.planetary-mission-filters {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.planetary-score-filters .mars-score-filter {
    border-color: #ab6d47;
    background: #38231d;
}
.planetary-score-filters .mars-score-filter .diff-seg-btn,
.planetary-score-filters .triton-score-filter .diff-seg-btn {
    min-height: 36px !important;
}
.planetary-score-filters .mars-score-filter .diff-seg-btn {
    color: #ffc298 !important;
}
.planetary-score-filters .mars-score-filter button[aria-pressed="true"] {
    background: linear-gradient(150deg, #ffd1a1, #d78350 72%, #b66a41) !important;
    color: #291710 !important;
}
.planetary-score-filters .triton-score-filter {
    border-color: #5488b9;
    background: #152b43;
}
.planetary-score-filters .triton-score-filter .diff-seg-btn {
    color: #c2e9ff !important;
}
.planetary-score-filters .triton-score-filter button[aria-pressed="true"] {
    background: linear-gradient(150deg, #dcf6ff, #8ccefa 72%, #70afe9) !important;
    color: #0e2740 !important;
}
.planetary-score-filters button:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}
@media (max-width: 540px) {
    .planetary-score-filters .diff-seg .diff-seg-btn {
        padding: 8px 10px !important;
        min-height: 36px !important;
        letter-spacing: 0.6px !important;
    }
}

.diff-seg {
    display: inline-flex;
    align-items: center;
    background: rgba(8, 14, 26, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
}

.diff-seg .diff-seg-btn {
    all: unset;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px 22px !important;
    margin: 0 !important;
    margin-top: 0 !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: 1.8px !important;
    text-transform: uppercase !important;
    color: rgba(255, 255, 255, 0.35) !important;
    background: transparent !important;
    border: none !important;
    border-radius: 999px !important;
    box-shadow: none !important;
    cursor: pointer !important;
    transition: color 0.18s, background 0.18s, box-shadow 0.18s !important;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    white-space: nowrap;
    box-sizing: border-box !important;
    width: auto !important;
    min-width: 0 !important;
    text-shadow: none !important;
    filter: none !important;
    transform: none !important;
}

.diff-seg .diff-seg-btn:hover {
    color: rgba(255, 255, 255, 0.6) !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
}

.diff-seg .diff-seg-btn:active {
    transform: none !important;
    box-shadow: none !important;
}

.diff-seg .diff-seg-btn.is-active {
    color: #fff !important;
}

.diff-seg .diff-seg-btn[data-diff="EASY"].is-active {
    background: rgba(40, 200, 120, 0.85) !important;
    box-shadow: 0 2px 10px rgba(40, 200, 120, 0.3) !important;
}

.diff-seg .diff-seg-btn[data-diff="NORMAL"].is-active {
    background: rgba(230, 170, 0, 0.9) !important;
    color: #1a1a1a !important;
    box-shadow: 0 2px 10px rgba(230, 170, 0, 0.3) !important;
}

.diff-seg .diff-seg-btn[data-diff="HARD"].is-active {
    background: rgba(220, 50, 50, 0.9) !important;
    box-shadow: 0 2px 10px rgba(220, 50, 50, 0.3) !important;
}

.diff-seg .diff-seg-btn.is-active:hover {
    filter: brightness(1.1) !important;
    transform: none !important;
}

@media (max-width: 480px) {
    .diff-seg .diff-seg-btn {
        padding: 7px 16px !important;
        font-size: 11px !important;
        letter-spacing: 1.2px !important;
    }
}

/* ============================================================
   MENU REDESIGN — Ship Quick-Select Grid & Layout
   ============================================================ */

/* Top bar: leaderboard + career score */
#menu-top-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 700px;
    margin: 0 auto 12px auto;
    gap: 12px;
}

.menu-career-badge {
    font-family: 'Segoe UI', sans-serif;
    font-weight: 900;
    font-size: 14px;
    letter-spacing: 1px;
    color: #ffd700;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-radius: 8px;
    padding: 8px 16px;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

.menu-util-btn {
    font-family: 'Segoe UI', sans-serif;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.menu-util-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

/* Ship quick-select grid */
#menu-ship-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 700px;
    margin: 0 auto 16px auto;
}

.menu-ship-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px;
    border-radius: 12px;
    background: rgba(0, 40, 80, 0.5);
    border: 2px solid rgba(0, 200, 100, 0.5);
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 0 12px rgba(0, 200, 100, 0.15);
}

.menu-ship-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(0, 200, 100, 0.3);
}

.menu-ship-card.is-selected {
    border-color: #00ff88;
    background: rgba(0, 60, 30, 0.6);
    box-shadow: 0 0 25px rgba(0, 255, 136, 0.35), inset 0 0 15px rgba(0, 255, 136, 0.08);
}

.menu-ship-card.is-locked {
    border-color: rgba(200, 50, 50, 0.5);
    background: rgba(40, 10, 10, 0.5);
    cursor: default;
    box-shadow: 0 0 12px rgba(200, 50, 50, 0.15);
    opacity: 0.7;
}

.menu-ship-card.is-locked:hover {
    transform: none;
    box-shadow: 0 0 12px rgba(200, 50, 50, 0.15);
}

.menu-ship-name {
    font-family: 'Segoe UI', sans-serif;
    font-weight: 900;
    font-size: 13px;
    letter-spacing: 2px;
    color: #fff;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.menu-ship-imgwrap {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-ship-imgwrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(136, 255, 255, 0.3));
}

.menu-ship-card.is-locked .menu-ship-imgwrap img {
    filter: brightness(0.4) saturate(0.3);
}

.menu-ship-lock {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.8));
}

.menu-ship-badge {
    font-family: 'Segoe UI', sans-serif;
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.5px;
    margin-top: 6px;
    padding: 3px 8px;
    border-radius: 4px;
}

.menu-ship-unlocked {
    color: #44ff88;
    background: rgba(0, 255, 100, 0.1);
}

.menu-ship-locked {
    color: #ff6666;
    background: rgba(255, 50, 50, 0.1);
    font-size: 10px;
}

/* Big PLAY button */
.menu-play-btn {
    display: block;
    width: 100%;
    max-width: 340px;
    margin: 0 auto 12px auto;
    padding: 16px 0;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 900;
    font-size: 28px;
    letter-spacing: 4px;
    color: #fff;
    background: linear-gradient(180deg, #22aa44 0%, #116622 100%);
    border: 2px solid #44ff66;
    border-radius: 14px;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 0 30px rgba(0, 255, 100, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
    animation: menu-play-glow 2s ease-in-out infinite;
}

.menu-play-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 0 40px rgba(0, 255, 100, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

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

@keyframes menu-play-glow {
    0%, 100% { box-shadow: 0 0 25px rgba(0, 255, 100, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
    50%      { box-shadow: 0 0 40px rgba(0, 255, 100, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
}

/* Bottom bar: ship details + settings */
#menu-bottom-bar {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
}

/* ---- Responsive: mobile/portrait ---- */
@media (max-width: 600px) {
    #menu-ship-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        max-width: 320px;
    }

    .menu-ship-imgwrap {
        width: 60px;
        height: 60px;
    }

    .menu-ship-name {
        font-size: 11px;
    }

    .menu-play-btn {
        font-size: 22px;
        padding: 14px 0;
        max-width: 280px;
    }

    #menu-top-bar {
        flex-direction: column;
        gap: 6px;
    }

    .menu-util-btn {
        font-size: 12px;
        padding: 7px 12px;
    }

    .menu-career-badge {
        font-size: 12px;
    }
}

/* ---- Compact landscape: very short viewports (phones in landscape) ---- */
@media (max-height: 760px) and (orientation: landscape) {
    #center-screen-overlay {
        justify-content: flex-start;
        padding-top: 8px;
        overflow-y: auto;
    }

    #start-content h1 {
        font-size: 28px !important;
        margin-bottom: 4px !important;
        margin-top: 0 !important;
    }

    #menu-top-bar {
        margin: 0 auto 4px auto;
        gap: 8px;
    }

    .menu-util-btn {
        padding: 4px 10px;
        font-size: 11px;
    }

    .menu-career-badge {
        padding: 4px 10px;
        font-size: 11px;
    }

    #menu-ship-grid {
        gap: 6px;
        margin: 0 auto 6px auto;
    }

    .menu-ship-card {
        padding: 4px 4px;
    }

    .menu-ship-imgwrap {
        width: 48px;
        height: 48px;
    }

    .menu-ship-name {
        font-size: 10px;
        margin-bottom: 2px;
        letter-spacing: 1px;
    }

    .menu-ship-badge {
        font-size: 9px;
        margin-top: 2px;
        padding: 2px 6px;
    }

    .menu-play-btn {
        font-size: 18px;
        padding: 8px 0;
        margin: 0 auto 4px auto;
        max-width: 260px;
    }

    .menu-difficulty-row {
        margin: 0;
    }

    .diff-seg .diff-seg-btn {
        padding: 4px 14px !important;
        font-size: 11px !important;
    }

    #menu-bottom-bar {
        margin-top: 4px;
    }

    /* The generic "#center-screen-overlay.menu-bg button" style (16px/58px padding) outranks the
       compact rules above, so restate the compact sizes with matching specificity. */
    #center-screen-overlay.menu-bg .menu-play-btn {
        padding: 10px 0;
        font-size: 18px;
    }

    #center-screen-overlay.menu-bg .menu-util-btn {
        padding: 9px 22px;
        font-size: 13px;
    }
}
/* First-session flight controls and restrained objective hierarchy. */
.flight-controls { display: flex; justify-content: center; gap: 24px; margin: 20px 0; }
.flight-controls > div { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.flight-keys { font: 800 25px 'Segoe UI', sans-serif; color: #88ffff; }
.flight-controls strong { font-size: 14px; color: #fff; }
.flight-controls small { font-size: 12px; color: #bed1da; }
.flight-tip { font-size: 16px; color: #fff; }
#sector-progress { display: none; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 12; pointer-events: none; padding: 5px 12px; border-radius: 7px; background: rgba(0,6,14,.72); color: #3ff6ff; font: 800 14px 'Segoe UI', sans-serif; letter-spacing: 1px; text-transform: uppercase; text-shadow: 0 0 8px rgba(0,255,255,.35); white-space: nowrap; }
@media (max-height: 550px) {
    #sector-progress { font-size: 13px; }
    .flight-controls { gap: 12px; margin: 10px 0; }
    .flight-keys { font-size: 20px; }
    .flight-tip { font-size: 14px; }
}

@media (min-height: 501px) and (max-height: 760px) and (orientation: landscape) {
    #center-screen-overlay { justify-content: center; padding-top: 0; }
}

.menu-ship-strength {
    white-space: pre-line;
    color: #e8f4f8;
    font: 500 12px/1.35 'Segoe UI', sans-serif;
    text-align: center;
    min-height: 0;
    margin-bottom: 5px;
}
@media (max-height: 760px) and (orientation: landscape) {
    .menu-ship-strength { font-size: 11px; min-height: 0; margin-bottom: 3px; }
}

/* Match the score-panel material while retaining a clear two-line menu label. */
#pause-btn,
body.desktop #pause-btn-desktop.hud-pause {
    width: 72px;
    height: 62px;
    box-sizing: border-box;
    flex-direction: column;
    gap: 2px;
    border-radius: 20px;
    border: 2px solid rgba(0, 220, 255, 0.22);
    background: linear-gradient(180deg, rgba(28, 75, 119, 0.82), rgba(15, 43, 74, 0.90));
    box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.55), 0 0 18px rgba(0, 200, 255, 0.12);
    color: #e9ffff;
    font-family: 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: 0.035em;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.25);
}
@media (hover: hover) and (pointer: fine) {
    #pause-btn:hover,
    body.desktop #pause-btn-desktop.hud-pause:hover {
        background: linear-gradient(180deg, rgba(36, 90, 138, 0.90), rgba(21, 58, 94, 0.95));
    }
}
#pause-btn:active,
body.desktop #pause-btn-desktop.hud-pause:active {
    background: linear-gradient(180deg, rgba(18, 52, 88, 0.95), rgba(10, 33, 59, 0.98));
}
@media (max-width: 1100px) {
    #pause-btn,
    body.desktop #pause-btn-desktop.hud-pause {
        width: 62px;
        height: 46px;
        border-radius: 14px;
        font-size: 12px;
    }
}
/* Play once on objective transition: enter, hold, retreat above the playfield. */
#sector-progress.is-clearance {
    animation: sector-objective-cue 3.8s cubic-bezier(0.22, 0.75, 0.3, 1) both;
}
@keyframes sector-objective-cue {
    0% { transform: translate(-50%, -80px); opacity: 0; }
    12%, 82% { transform: translate(-50%, 0); opacity: 1; }
    100% { transform: translate(-50%, -80px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    #sector-progress.is-clearance { animation-name: sector-objective-fade; }
}
@keyframes sector-objective-fade {
    0%, 100% { opacity: 0; }
    12%, 82% { opacity: 1; }
}
/* Utility buttons must not inherit the global 40px button-top margin. */
#menu-bottom-bar > button { margin-top: 0; }
@media (max-height: 550px) {
    #menu-player-stats { margin-top: 4px !important; padding: 4px 10px !important; }
}

/* Main-menu hierarchy: one primary action and the ship cards. */
#center-screen-overlay #start-content {
    box-sizing: border-box;
    width: min(760px, calc(100vw - 32px)) !important;
    padding: 28px;
}
#center-screen-overlay #start-content > h1 {
    font-size: 48px;
    line-height: 1.12;
    letter-spacing: 3px;
    margin: 0 0 24px;
    filter: drop-shadow(0 0 14px rgba(0,255,255,.2));
}
#start-content #menu-top-bar { display: none; }
#start-content .menu-career-badge { background: none; border: 0; padding: 0; color: #a9c5d1; font-size: 12px; text-shadow: none; }
#start-content #menu-ship-grid { width: 100%; max-width: none; margin: 0; gap: 12px; }
#start-content .menu-ship-card { padding: 12px 8px; background: rgba(8,28,42,.55); border-color: rgba(114,178,197,.22); box-shadow: none; }
#start-content .menu-ship-card.is-locked { background: rgba(8,22,32,.55); border-color: rgba(114,178,197,.16); opacity: .8; }
#start-content .menu-ship-card.is-selected { background: rgba(0,65,49,.4); border-color: rgba(0,235,160,.7); box-shadow: 0 0 14px rgba(0,220,150,.12); }
#start-content .menu-ship-card.is-locked:hover { border-color: rgba(114,178,197,.16); box-shadow: none; }
#center-screen-overlay.menu-bg #start-content .menu-play-btn {
    width: min(340px,100%);
    margin: 24px auto 0;
    min-height: 48px;
    padding: 12px 0;
    font-size: 22px;
    animation: none;
    box-shadow: 0 0 16px rgba(0,120,255,.22);
}
#start-content .menu-difficulty-row { margin: 12px 0 0; }
#start-content #menu-bottom-bar { width: 100%; margin-top: 22px; gap: 12px; }
#center-screen-overlay.menu-bg #start-content .menu-util-btn {
    min-height: 44px;
    margin: 0;
    padding: 10px 18px;
    background: rgba(10,35,53,.32);
    border: 1px solid rgba(110,180,202,.25);
    border-radius: 9px;
    color: #bdd7e2;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .8px;
    box-shadow: none;
}
#center-screen-overlay.menu-bg #start-content .menu-util-btn:hover {
    background: rgba(22,60,83,.5);
    border-color: rgba(110,210,232,.5);
    color: #fff;
    transform: none;
    box-shadow: none;
}
#start-content #menu-player-stats {
    margin: 18px auto 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    border: 0 !important;
    background: none !important;
    color: #9bb6c4 !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    letter-spacing: .25px !important;
}
#start-content #menu-player-stats span { color: inherit !important; font-weight: 600 !important; }

@media (max-height: 760px), (max-width: 600px) {
    #center-screen-overlay #start-content { padding: 16px 18px; }
    #center-screen-overlay #start-content > h1 { font-size: 28px !important; margin: 0 0 12px !important; letter-spacing: 2px; }
    #start-content #menu-top-bar { margin-bottom: 10px; }
    #start-content #menu-ship-grid { gap: 8px; }
    #start-content .menu-ship-card { padding: 6px 4px; }
    #start-content .menu-ship-name { font-size: 11px; letter-spacing: 1px; }
    #start-content .menu-ship-strength { font-size: 11px; min-height: 0; }
    #center-screen-overlay.menu-bg #start-content .menu-play-btn { margin-top: 14px; padding: 10px 0; font-size: 18px; min-height: 44px; }
    #start-content .menu-difficulty-row { margin-top: 8px; }
    #start-content #menu-bottom-bar { margin-top: 14px; gap: 8px; }
    #center-screen-overlay.menu-bg #start-content .menu-util-btn { padding: 8px 12px; font-size: 12px; }
    #start-content #menu-player-stats { margin-top: 10px !important; font-size: 11px !important; }
}
@media (max-height: 420px) and (orientation: landscape) {
    #center-screen-overlay #start-content { padding: 8px 16px; }
    #center-screen-overlay #start-content > h1 { font-size: 22px !important; margin-bottom: 8px !important; }
    #start-content .menu-ship-card { padding: 4px; }
    #start-content .menu-ship-name { font-size: 10px; }
    #start-content .menu-ship-strength { font-size: 10px; min-height: 0; margin-bottom: 2px; }
    #start-content .menu-ship-imgwrap { width: 34px; height: 34px; }
    #center-screen-overlay.menu-bg #start-content .menu-play-btn { margin-top: 8px; min-height: 40px; padding: 8px 0; }
    #start-content .menu-difficulty-row { margin-top: 6px; }
    #start-content #menu-bottom-bar { margin-top: 8px; }
    #center-screen-overlay.menu-bg #start-content .menu-util-btn { min-height: 40px; padding: 6px 10px; }
    #start-content #menu-player-stats { margin-top: 8px !important; }
}
/* Reserve space on short phones without shrinking controls or text. */
@media (max-height: 760px) {
    #center-screen-overlay #menu-difficulty { margin: 0 !important; width: auto !important; }
    #start-content #menu-player-stats { margin-top: 8px !important; }
}
@media (max-height: 420px) and (orientation: landscape) {
    #center-screen-overlay #start-content { padding-top: 6px; padding-bottom: 6px; }
}
/* Do not animate responsive card dimensions during viewport changes. */
#start-content .menu-ship-card { transition: border-color 160ms, background-color 160ms, box-shadow 160ms, transform 160ms; }

/* Challenge Friends: explicit private context and isolated score controls. */
#game-update-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    margin-bottom: 12px;
    border: 1px solid #50c9c2;
    border-radius: 9px;
    background: rgba(2, 18, 28, .96);
    color: #d7fffc;
    font: 12px/1.35 'Segoe UI', sans-serif;
    text-align: left;
}
#game-update-title { color: #82fff1; font-size: 13px; letter-spacing: .5px; }
#game-update-message { margin: 3px 0 0; }
#center-screen-overlay.menu-bg #game-update-button {
    flex: 0 0 auto;
    min-height: 44px;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid #82fff1;
    border-radius: 7px;
    color: #e8fffc;
    font-size: 12px;
    letter-spacing: .5px;
}
#game-update-button:focus-visible { outline: 3px solid #ffd700; outline-offset: 3px; }
/* Keep every control reachable when an update adds a row to a short menu. */
#center-screen-overlay.has-game-update,
body:not(.desktop) #center-screen-overlay.has-game-update {
    overflow-y: auto !important;
    justify-content: flex-start !important;
}
#center-screen-overlay.has-game-update #start-content { flex-shrink: 0; margin: auto 0; }
@media (max-width: 420px) {
    #game-update-panel { gap: 8px; padding: 8px; }
    #game-update-message { font-size: 11px; }
}
[hidden] { display: none !important; }
#start-content #menu-bottom-bar { flex-wrap: wrap; }
.challenge-menu-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; text-align: center; box-sizing: border-box; }
#challenge-panel { position: absolute; z-index: 120; top: 4px; left: 50%; transform: translateX(-50%); max-width: min(94%, 760px); width: max-content; padding: 6px 12px; border: 1px solid #50c9c2; border-radius: 8px; background: rgba(2,18,28,.96); color: #d7fffc; font: 12px/1.35 Arial,sans-serif; text-align: center; }
#challenge-panel strong, #challenge-panel span { display: block; overflow-wrap: anywhere; }
#challenge-panel a, .challenge-result a { color: #82fff1; }
#challenge-panel button { font-size: 11px; padding: 3px 9px; margin: 3px 8px; min-height: 28px; }
.challenge-result { max-width: 420px; padding: 10px; color: #d7fffc; font-size: 14px; text-align: center; }
.challenge-result p { margin: 4px 0 10px; }
.challenge-result button { font-size: 14px; padding: 10px 16px; }
body.challenge-mode #high-score-input, body.challenge-mode #high-score-input-victory,
body.challenge-mode #menu-player-stats, body.challenge-mode #leaderboard-btn,
body.challenge-mode #sector-success-leaderboard-btn,
body.challenge-mode #gameover-leaderboard-btn, body.challenge-mode #victory-leaderboard-btn { display: none !important; }
body.challenge-mode #menu-difficulty button { cursor: default; opacity: .4; }
body.challenge-mode #menu-difficulty button.is-active { opacity: 1; }
body.challenge-mode #center-screen-overlay { --challenge-overlay-top: 94px; padding-top: var(--challenge-overlay-top); box-sizing: border-box; }
@media (max-height: 560px) {
    #challenge-panel { padding: 3px 8px; font-size: 10px; }
    body.challenge-mode #center-screen-overlay { --challenge-overlay-top: 78px; }
    #start-content #menu-bottom-bar { gap: 6px; }
    #center-screen-overlay.menu-bg #start-content .challenge-menu-link { font-size: 10px; padding: 6px 8px; min-height: 32px; }
}
/* Reserve the banner's actual height without pushing the private menu off short screens. */
@media (max-height: 560px) and (orientation: landscape) {
    body.challenge-mode #center-screen-overlay { --challenge-overlay-top: 60px; padding-bottom: 6px; }
    body.challenge-mode #center-screen-overlay #start-content { padding: 8px 16px; }
    body.challenge-mode #center-screen-overlay #start-content > h1 { font-size: 24px !important; margin-bottom: 8px !important; }
    body.challenge-mode #start-content .menu-ship-card { padding: 4px; }
    body.challenge-mode #start-content .menu-ship-imgwrap { width: 48px; height: 48px; }
    body.challenge-mode #center-screen-overlay.menu-bg #start-content .menu-play-btn { margin-top: 8px; min-height: 44px; padding: 8px 0; }
    body.challenge-mode #start-content .menu-difficulty-row { margin-top: 6px; }
    body.challenge-mode #start-content #menu-bottom-bar { margin-top: 8px; }
}
@media (max-height: 420px) and (orientation: landscape) {
    body.challenge-mode #center-screen-overlay #start-content { padding-top: 4px; padding-bottom: 4px; }
    body.challenge-mode #center-screen-overlay #start-content > h1 { font-size: 20px !important; margin-bottom: 6px !important; }
    body.challenge-mode #start-content .menu-ship-card { padding: 3px; }
    body.challenge-mode #start-content .menu-ship-imgwrap { width: 30px; height: 30px; }
    body.challenge-mode #start-content #menu-bottom-bar { margin-top: 6px; }
}

/* A saved active competition must be visible before ordinary free play. */
#menu-active-challenge{width:100%;box-sizing:border-box;text-align:center;margin:0 0 14px;padding:10px 16px;border:1px solid #5be4cf66;border-radius:12px;background:linear-gradient(120deg,rgba(5,51,47,.96),rgba(4,27,42,.98));box-shadow:none;color:#e4fffc}
#start-content #menu-active-challenge-heading{max-width:none;margin:0 0 4px;font:800 11px/1.3 'Segoe UI',sans-serif;letter-spacing:1.3px;color:#81ffe8}
#menu-active-challenge-name{display:block;font:800 20px/1.2 'Segoe UI',sans-serif;overflow-wrap:anywhere}
#start-content #menu-active-challenge-details{max-width:none;margin:4px 0 0;font:700 12px/1.35 'Segoe UI',sans-serif;color:#c9f4ef;overflow-wrap:anywhere}
#menu-active-challenge-picker{width:100%;min-height:44px;margin:8px 0 4px;padding:8px;background:#071a29;color:#e4fffc;border:1px solid #5be4cf;border-radius:6px;font:700 14px 'Segoe UI',sans-serif}
.active-challenge-actions{display:flex;align-items:center;justify-content:center;gap:8px 14px;flex-wrap:wrap}
#menu-active-challenge-play{display:flex;align-items:center;justify-content:center;min-height:46px;padding:0 18px;border:1px solid #b7fff1;border-radius:8px;background:#55e6cb;color:#031f25;text-decoration:none;font:900 15px/1.2 'Segoe UI',sans-serif;letter-spacing:.6px;box-sizing:border-box}
#menu-active-challenge-play.is-disabled{opacity:.45;pointer-events:none}
#menu-active-challenge-room{display:inline-flex;align-items:center;min-height:44px;justify-content:center;text-align:center;color:#b0dbd4;text-decoration:underline;font:700 10px/1.3 'Segoe UI',sans-serif;letter-spacing:.3px}
#menu-active-challenge a:focus-visible,#menu-active-challenge select:focus-visible{outline:3px solid #ffd700;outline-offset:3px}
#center-screen-overlay.menu-bg #start-btn.is-free-play{background:rgba(28,68,109,.45);box-shadow:none;border:1px solid #5985a2;color:#c6ddef}
#center-screen-overlay.has-active-challenge,body:not(.desktop) #center-screen-overlay.has-active-challenge{overflow-y:auto!important;justify-content:flex-start!important}
#center-screen-overlay.has-active-challenge #start-content{flex-shrink:0;margin:auto 0}
@media(max-height:560px) and (orientation:landscape){#menu-active-challenge{padding:8px 12px;margin-bottom:8px}#menu-active-challenge-name{font-size:17px}#start-content #menu-active-challenge-details{margin:3px 0 0}.active-challenge-actions{gap:10px}#start-content #menu-active-challenge-heading{font-size:10px}}
@media(max-width:420px){#menu-active-challenge{padding:11px 12px}#menu-active-challenge-play{width:100%}.active-challenge-actions{gap:2px}#menu-active-challenge-name{font-size:18px}}
/* Sector results use real responsive dimensions, not the legacy touch-menu scale. */
body #center-screen-overlay.sector-complete:not(.overlay-scroll) {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: max(56px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)) !important;
    justify-content: flex-start !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}
body #center-screen-overlay.sector-complete #level-complete-content {
    transform: none !important;
    margin: auto 0 !important;
    flex-shrink: 0;
    width: min(760px, 100%);
    box-sizing: border-box;
    padding: 16px 0;
    text-align: center;
}
body #center-screen-overlay.sector-complete #level-complete-content h1 {
    font-size: clamp(28px, 4vw, 42px) !important;
    margin: 0 0 12px !important;
    line-height: 1.15;
}
body #center-screen-overlay.sector-complete #level-complete-content h2 {
    font-size: clamp(16px, 2.5vw, 22px) !important;
    margin: 0 0 10px !important;
    line-height: 1.3;
}
body #center-screen-overlay.sector-complete #level-complete-content p {
    font-size: 15px !important;
    max-width: 100%;
    margin: 5px 0 !important;
}
body #center-screen-overlay.sector-complete .sector-complete-actions {
    width: 100%;
    margin-top: 18px !important;
}
body #center-screen-overlay.sector-complete #level-complete-content button {
    min-height: 48px;
    margin: 0 !important;
    padding: 12px 18px !important;
    font-size: 16px;
}
@media (max-width: 520px) {
    body #center-screen-overlay.sector-complete .sector-complete-actions {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    body #center-screen-overlay.sector-complete #level-complete-content button {
        width: 100%;
        padding: 10px 8px !important;
        font-size: 13px;
    }
}
/* Give the start menu its real width on tablets; never shrink touch targets. */
body #center-screen-overlay.start-menu-visible:not(.overlay-scroll) {
    justify-content: flex-start !important;
    overflow-y: auto !important;
    box-sizing: border-box;
    padding: max(20px, env(safe-area-inset-top)) 0 max(20px, env(safe-area-inset-bottom)) !important;
}
body.challenge-mode #center-screen-overlay.start-menu-visible:not(.overlay-scroll) {
    padding-top: max(94px, env(safe-area-inset-top)) !important;
}
body #center-screen-overlay #start-content {
    transform: none !important;
    flex-shrink: 0;
    margin: auto 0 !important;
}
#start-content #menu-active-challenge {
    padding: 20px 24px;
    margin-bottom: 22px;
}
#start-content #menu-active-challenge-heading { margin-bottom: 8px; }
#start-content #menu-active-challenge-details { margin-top: 8px; }
#start-content .active-challenge-actions {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 4px;
    margin-top: 16px;
}
#start-content #menu-active-challenge-play {
    width: min(300px, 100%);
    min-height: 48px;
    font-size: 16px;
}
#start-content #menu-active-challenge-room { font-size: 12px; }
@media (min-height: 561px) and (max-height: 850px) and (orientation: landscape) {
    body #center-screen-overlay #start-content { padding: 20px; }
    body #center-screen-overlay #start-content > h1 { font-size: 40px !important; margin-bottom: 18px !important; }
    #start-content #menu-active-challenge { padding: 12px 16px; margin-bottom: 14px; }
    #start-content .active-challenge-actions { margin-top: 10px; }
    #start-content #menu-active-challenge-heading { margin-bottom: 6px; }
    #start-content #menu-active-challenge-details { margin-top: 6px; }
}
@media (max-width: 420px) {
    #start-content #menu-active-challenge { padding: 16px 12px; }
}

.orbit-touch-help { display: none; }
body:not(.desktop) .orbit-touch-help {
    display: block; max-width: 32ch; margin: 0 12px 8px;
    text-align: center; font-size: 14px; line-height: 1.35; color: #d7f4fc;
}

/* The campaign title pairs the cockpit cyan with the copper of the Martian surface. */
#start-content .campaign-wordmark {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: .55em;
    margin-top: .24em;
    font-size: .63em;
    line-height: 1.14;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.campaign-wordmark strong {
    display: inline-block;
    padding: 0 .02em;
    font-weight: 900;
    transform: skewX(-9deg);
    color: #ffc378;
    -webkit-text-fill-color: #ffc378;
    filter: drop-shadow(0 2px 0 #713719) drop-shadow(0 0 9px rgb(255 142 51 / 26%));
}
@supports (background-clip: text) or (-webkit-background-clip: text) {
    .campaign-wordmark strong {
        background: linear-gradient(175deg, #fff1cf 8%, #ffc87f 41%, #ff9b4a 65%, #e46939 95%);
        background-clip: text;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }
}
.campaign-wordmark::before, .campaign-wordmark::after {
    content: '';
    width: clamp(15px, 4vw, 50px);
    height: 2px;
    background: linear-gradient(90deg, transparent, #dd8050);
}
.campaign-wordmark::after { transform: rotate(180deg); }
@media (forced-colors: active) {
    .campaign-wordmark strong { background: none; -webkit-text-fill-color: CanvasText; filter: none; }
}

.mars-chapter-loading {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 1rem;
    padding: 1.5rem;
    text-align: center;
    color: white;
    background: #101c26;
}

.planetary-interview {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0 8px;
    max-width: calc(100% - 24px);
    margin: 8px auto 0;
    color: #e1efff;
    font: 600 14px/1.4 "Segoe UI", sans-serif;
    text-align: center;
}
#planetary-interview { display: none; }
#center-screen-overlay.start-menu-visible #planetary-interview:not([hidden]) {
    display: flex;
    margin-bottom: auto;
}
body #center-screen-overlay.start-menu-visible:has(> #planetary-interview:not([hidden])) #start-content {
    margin-bottom: 0 !important;
}
.planetary-interview a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 6px;
    color: #88ffff;
    text-underline-offset: 3px;
}
.planetary-interview a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

body #center-screen-overlay.round-results-visible:not(.overlay-scroll) {
    box-sizing: border-box;
    justify-content: flex-start !important;
    overflow-y: auto !important;
    padding-inline: 12px;
    padding-bottom: max(16px, env(safe-area-inset-bottom)) !important;
    touch-action: pan-y;
}
body:not(.challenge-mode) #center-screen-overlay.round-results-visible:not(.overlay-scroll) {
    padding-top: max(16px, env(safe-area-inset-top)) !important;
}
body.challenge-mode #center-screen-overlay.round-results-visible:not(.overlay-scroll) {
    padding-top: max(var(--challenge-overlay-top), env(safe-area-inset-top)) !important;
}
body #center-screen-overlay.round-results-visible > :is(#game-over-content, #game-complete-content) {
    flex-shrink: 0;
    max-width: 100%;
    margin: auto 0;
    transform: none !important;
    text-align: center;
}
.round-results-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: min(100%, 480px);
    margin: 10px auto 0;
}
#center-screen-overlay .round-results-actions button {
    min-height: 44px;
    margin: 0;
    padding: 12px clamp(8px, 3vw, 26px);
    font-size: clamp(13px, 2vw, 18px);
}
