@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@500;600;700&display=swap');

:root {
    --sky: #5dade2;
    --text: #e8f4ff;
    --muted: #7a9bb8;
    --neon-blue: #38bdf8;
    --neon-cyan: #22d3ee;
    --neon-gold: #fbbf24;
    --neon-red: #f87171;
    --panel-bg: rgba(6, 12, 24, 0.72);
    --panel-border: rgba(56, 189, 248, 0.25);
    --panel-glow: rgba(56, 189, 248, 0.12);
    --safe-pad: clamp(0.5rem, 2vmin, 1rem);
    --font-display: 'Orbitron', sans-serif;
    --font-ui: 'Rajdhani', sans-serif;
}

/* ── Base ── */
body {
    margin: 0;
    overflow: hidden;
    background: var(--sky);
    font-family: var(--font-ui);
    touch-action: none;
    user-select: none;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

#game-canvas {
    position: absolute;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

.hidden {
    display: none !important;
}

.opacity-0 {
    opacity: 0;
}

.opacity-100 {
    opacity: 1;
}

.pointer-events-auto {
    pointer-events: auto;
}

/* ── UI layer scanlines ── */
#ui-layer {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: var(--safe-pad);
    box-sizing: border-box;
}

#ui-layer::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.03) 2px,
            rgba(0, 0, 0, 0.03) 4px);
    pointer-events: none;
    z-index: 0;
}

#ui-layer>*:not(.btn-home) {
    position: relative;
    z-index: 1;
}

/* ── Home button (top-left, does not affect HUD layout) ── */
#ui-layer > .btn-home {
    position: absolute;
    top: var(--safe-pad);
    left: var(--safe-pad);
    z-index: 5;
    width: clamp(2.25rem, 7vmin, 2.75rem);
    height: clamp(2.25rem, 7vmin, 2.75rem);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    cursor: pointer;
    pointer-events: auto;
    color: var(--neon-cyan);
    transform: skewX(-6deg);
    box-shadow:
        0 0 18px var(--panel-glow),
        0 6px 20px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-home__frame {
    position: absolute;
    inset: 3px;
    border: 1px solid rgba(56, 189, 248, 0.12);
    pointer-events: none;
}

.btn-home__frame::before,
.btn-home__frame::after {
    content: '';
    position: absolute;
    width: 7px;
    height: 7px;
    border-color: var(--neon-blue);
    border-style: solid;
    opacity: 0.65;
}

.btn-home__frame::before {
    top: -1px;
    left: -1px;
    border-width: 2px 0 0 2px;
}

.btn-home__frame::after {
    bottom: -1px;
    right: -1px;
    border-width: 0 2px 2px 0;
}

.btn-home__icon {
    position: relative;
    font-size: clamp(0.75rem, 2.4vmin, 0.9rem);
    transform: skewX(6deg);
    filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.6));
    transition: filter 0.2s ease;
}

.btn-home:hover {
    transform: skewX(-6deg) scale(1.06);
    border-color: rgba(56, 189, 248, 0.55);
    color: #fff;
    box-shadow:
        0 0 28px rgba(56, 189, 248, 0.35),
        0 8px 24px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-home:hover .btn-home__icon {
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.9));
}

.btn-home:active {
    transform: skewX(-6deg) scale(0.96);
}

.btn-home:focus-visible {
    outline: 2px solid var(--neon-cyan);
    outline-offset: 3px;
}

/* ══════════════════════════════════════
   IN-GAME HUD — Cockpit frame
   ══════════════════════════════════════ */
#hud {
    width: 100%;
    transition: opacity 0.4s ease;
}

.hud-frame {
    position: relative;
    max-width: 34rem;
    margin: 0 auto;
    padding: 1px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.5), rgba(56, 189, 248, 0.05) 40%, rgba(251, 191, 36, 0.3));
    border-radius: 2px;
    box-shadow:
        0 0 24px var(--panel-glow),
        0 8px 32px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.hud-frame::before,
.hud-frame::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-color: var(--neon-blue);
    border-style: solid;
    opacity: 0.7;
    z-index: 2;
}

.hud-frame::before {
    top: -1px;
    left: -1px;
    border-width: 2px 0 0 2px;
}

.hud-frame::after {
    bottom: -1px;
    right: -1px;
    border-width: 0 2px 2px 0;
}

.hud-top {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: clamp(0.4rem, 1.5vmin, 0.55rem) clamp(0.5rem, 2vmin, 0.75rem);
}

.hud-stat {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 0 0 auto;
    min-width: clamp(3.5rem, 12vw, 5rem);
    padding: 0 0.5rem;
}

.hud-stat--right {
    align-items: flex-end;
    text-align: right;
}

.hud-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-family: var(--font-ui);
    font-size: clamp(0.5rem, 1.6vmin, 0.6rem);
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    line-height: 1;
    white-space: nowrap;
}

.hud-stat--right .hud-label {
    flex-direction: row-reverse;
}

.hud-dot {
    display: inline-block;
    width: 4px;
    height: 4px;
    background: var(--neon-cyan);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--neon-cyan);
    animation: dotPulse 2s ease-in-out infinite;
}

.hud-value {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 3.5vmin, 1.6rem);
    font-weight: 900;
    font-style: italic;
    line-height: 1;
    margin-top: 0.2rem;
    color: #fff;
    text-shadow: 0 0 12px rgba(56, 189, 248, 0.5), 0 2px 4px rgba(0, 0, 0, 0.8);
}

.hud-unit {
    font-size: 0.45em;
    font-weight: 700;
    font-style: normal;
    color: var(--neon-cyan);
    letter-spacing: 0.05em;
    text-shadow: 0 0 8px rgba(34, 211, 238, 0.6);
}

/* Energy core */
.energy-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0;
    padding: 0 0.75rem;
    border-left: 1px solid rgba(56, 189, 248, 0.15);
    border-right: 1px solid rgba(56, 189, 248, 0.15);
}

.energy-panel .hud-label {
    justify-content: center;
    margin-bottom: 0.3rem;
    color: var(--neon-cyan);
    letter-spacing: 0.18em;
}

.energy-track {
    position: relative;
    width: 100%;
    height: clamp(0.45rem, 1.4vmin, 0.6rem);
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(56, 189, 248, 0.2);
    overflow: hidden;
}

.energy-track::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg,
            transparent,
            transparent 8px,
            rgba(0, 0, 0, 0.3) 8px,
            rgba(0, 0, 0, 0.3) 9px);
    z-index: 1;
    pointer-events: none;
}

#energy-bar {
    position: relative;
    height: 100%;
    width: 100%;
    transition: width 80ms linear, background 200ms, box-shadow 200ms;
    z-index: 0;
}

#energy-bar[data-pct="0"] {
    width: 0%;
}

#energy-bar[data-pct="5"] {
    width: 5%;
}

#energy-bar[data-pct="10"] {
    width: 10%;
}

#energy-bar[data-pct="15"] {
    width: 15%;
}

#energy-bar[data-pct="20"] {
    width: 20%;
}

#energy-bar[data-pct="25"] {
    width: 25%;
}

#energy-bar[data-pct="30"] {
    width: 30%;
}

#energy-bar[data-pct="35"] {
    width: 35%;
}

#energy-bar[data-pct="40"] {
    width: 40%;
}

#energy-bar[data-pct="45"] {
    width: 45%;
}

#energy-bar[data-pct="50"] {
    width: 50%;
}

#energy-bar[data-pct="55"] {
    width: 55%;
}

#energy-bar[data-pct="60"] {
    width: 60%;
}

#energy-bar[data-pct="65"] {
    width: 65%;
}

#energy-bar[data-pct="70"] {
    width: 70%;
}

#energy-bar[data-pct="75"] {
    width: 75%;
}

#energy-bar[data-pct="80"] {
    width: 80%;
}

#energy-bar[data-pct="85"] {
    width: 85%;
}

#energy-bar[data-pct="90"] {
    width: 90%;
}

#energy-bar[data-pct="95"] {
    width: 95%;
}

#energy-bar[data-pct="100"] {
    width: 100%;
}

#energy-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.35) 50%, transparent 100%);
    animation: energyShine 2.5s ease-in-out infinite;
}

#energy-bar.energy-bar--blue {
    background: linear-gradient(90deg, #1d4ed8, #38bdf8, #22d3ee);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

#energy-bar.energy-bar--yellow {
    background: linear-gradient(90deg, #b45309, #fbbf24, #f59e0b);
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

#energy-bar.energy-bar--critical {
    background: linear-gradient(90deg, #991b1b, #ef4444, #f87171);
    box-shadow: 0 0 12px rgba(248, 113, 113, 0.8);
    animation: criticalPulse 0.8s ease-in-out infinite;
}

/* Center alert */
#center-msg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    text-align: center;
    pointer-events: none;
    transition: opacity 0.25s;
}

.alert-frame {
    display: inline-block;
    padding: 0.5rem 2rem;
    border-top: 2px solid var(--neon-red);
    border-bottom: 2px solid var(--neon-red);
    background: rgba(127, 29, 29, 0.3);
    backdrop-filter: blur(8px);
}

#center-msg-text {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 7vmin, 3rem);
    font-weight: 900;
    font-style: italic;
    color: var(--neon-red);
    transform: skewX(-8deg);
    margin: 0;
    letter-spacing: 0.05em;
    text-shadow: 0 0 30px rgba(248, 113, 113, 0.9), 0 0 60px rgba(239, 68, 68, 0.4);
    animation: alertFlicker 3s ease-in-out infinite;
}

/* PC controls readout */
#pc-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 0 auto;
    padding: 0.35rem 1rem;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(12px);
    font-size: clamp(0.55rem, 1.7vmin, 0.68rem);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

#pc-hint kbd {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    margin-right: 0.15rem;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 3px;
    color: var(--neon-cyan);
    font-family: var(--font-display);
    font-size: 0.85em;
    font-weight: 700;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.2);
}

.hint-sep {
    width: 1px;
    height: 1rem;
    background: rgba(56, 189, 248, 0.25);
}

.key-group {
    white-space: nowrap;
}

/* Touch controls — hidden on desktop; shown only when JS enables on touch desktop */
#touch-controls {
    display: none;
    width: 100%;
    max-width: 26rem;
    margin: 0 auto;
}

#touch-controls:not(.hidden) {
    display: flex;
    flex-direction: column;
}

.touch-panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(14px);
    padding: 0.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.touch-hints {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.4rem;
    padding: 0 0.25rem;
}

.touch-hint {
    font-size: clamp(0.5rem, 1.6vmin, 0.62rem);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.touch-row {
    display: flex;
    gap: 0.5rem;
    height: clamp(4.5rem, 13vmin, 5.5rem);
}

#touch-steer {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    background: rgba(56, 189, 248, 0.05);
    border: 1px solid rgba(56, 189, 248, 0.2);
    transition: background 0.15s, border-color 0.15s;
}

#touch-steer:active {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.5);
}

#touch-steer i {
    font-size: clamp(1.1rem, 3.5vmin, 1.4rem);
    color: var(--neon-cyan);
    filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.5));
}

#touch-steer span {
    font-size: clamp(0.45rem, 1.4vmin, 0.55rem);
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--muted);
    text-transform: uppercase;
}

.touch-shields {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: clamp(4.5rem, 13vw, 5.5rem);
    flex-shrink: 0;
}

.btn-action {
    flex: 1;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(0.65rem, 2vmin, 0.8rem);
    font-style: italic;
    letter-spacing: 0.05em;
    color: #fff;
    cursor: pointer;
    border: none;
    transform: skewX(-8deg);
    transition: filter 0.15s, transform 0.15s, box-shadow 0.15s;
}

.btn-blue {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #1d4ed8 100%);
    border: 1px solid rgba(96, 165, 250, 0.6);
    box-shadow: 0 0 16px rgba(37, 99, 235, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-yellow {
    background: linear-gradient(135deg, #92400e 0%, #d97706 50%, #b45309 100%);
    border: 1px solid rgba(251, 191, 36, 0.6);
    box-shadow: 0 0 16px rgba(217, 119, 6, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-action:active {
    transform: skewX(-8deg) scale(0.96);
    filter: brightness(1.2);
}

/* ══════════════════════════════════════
   SCREENS — Start & Game Over
   ══════════════════════════════════════ */
.screen {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    transition: opacity 0.5s ease;
    padding: var(--safe-pad);
    box-sizing: border-box;
    overflow-y: auto;
}

.screen-vignette {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center, transparent 30%, rgba(4, 8, 18, 0.75) 100%),
        linear-gradient(180deg, rgba(4, 8, 18, 0.6) 0%, transparent 30%, transparent 70%, rgba(4, 8, 18, 0.7) 100%);
    pointer-events: none;
}

.screen-vignette--red {
    background:
        radial-gradient(ellipse at center, transparent 20%, rgba(40, 0, 0, 0.8) 100%),
        linear-gradient(180deg, rgba(20, 0, 0, 0.7) 0%, transparent 40%, rgba(20, 0, 0, 0.8) 100%);
}

#start-screen {
    background: rgba(4, 8, 18, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow: hidden;
}

.screen--start {
    padding: clamp(0.5rem, 2vmin, 1rem);
}

/* ── Start background atmosphere ── */
.start-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.start-bg__aurora {
    position: absolute;
    inset: -20%;
    background:
        radial-gradient(ellipse 55% 40% at 20% 30%, rgba(56, 189, 248, 0.18) 0%, transparent 70%),
        radial-gradient(ellipse 45% 35% at 80% 25%, rgba(251, 191, 36, 0.12) 0%, transparent 65%),
        radial-gradient(ellipse 60% 50% at 50% 100%, rgba(30, 58, 138, 0.25) 0%, transparent 70%);
    animation: startAurora 10s ease-in-out infinite alternate;
}

.start-bg__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(56, 189, 248, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 20%, transparent 75%);
    opacity: 0.7;
}

/* ── Unified start modal ── */
.start-modal {
    position: relative;
    z-index: 1;
    width: min(100%, 28rem);
    max-height: min(calc(100dvh - 1.5rem), 100%);
    margin: auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    animation: startModalIn 0.65s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.start-modal__glow {
    position: absolute;
    inset: -8%;
    background: radial-gradient(ellipse at 50% 30%, rgba(56, 189, 248, 0.22) 0%, transparent 65%);
    pointer-events: none;
    animation: startGlowPulse 4s ease-in-out infinite alternate;
}

.start-modal__frame {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: min(calc(100dvh - 1.5rem), 100%);
    border-radius: 4px;
    background: linear-gradient(165deg, rgba(8, 16, 32, 0.96) 0%, rgba(4, 10, 22, 0.98) 100%);
    border: 1px solid rgba(56, 189, 248, 0.32);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 0 48px rgba(56, 189, 248, 0.12),
        0 24px 64px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    overflow: hidden;
}

.start-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    border-color: var(--neon-cyan);
    border-style: solid;
    opacity: 0.75;
    z-index: 2;
    pointer-events: none;
}

.start-corner--tl { top: 8px; left: 8px; border-width: 2px 0 0 2px; }
.start-corner--tr { top: 8px; right: 8px; border-width: 2px 2px 0 0; }
.start-corner--bl { bottom: 8px; left: 8px; border-width: 0 0 2px 2px; }
.start-corner--br { bottom: 8px; right: 8px; border-width: 0 2px 2px 0; }

.start-header {
    flex-shrink: 0;
    text-align: center;
    padding: clamp(1rem, 3vh, 1.35rem) clamp(1rem, 4vw, 1.5rem) clamp(0.85rem, 2.5vh, 1.1rem);
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.1) 0%, transparent 100%);
    border-bottom: 1px solid rgba(56, 189, 248, 0.15);
}

.start-header__status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.65rem;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.22);
    font-size: clamp(0.48rem, 1.4vmin, 0.58rem);
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--neon-cyan);
}

.start-header__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--neon-cyan);
    box-shadow: 0 0 8px var(--neon-cyan);
    animation: dotPulse 2s ease-in-out infinite;
}

.start-header__title {
    margin: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.start-header__logo {
    display: block;
    width: min(100%, clamp(11rem, 78vw, 22rem));
    max-height: clamp(2.6rem, 13vmin, 5.25rem);
    height: auto;
    object-fit: contain;
    object-position: center;
    filter: drop-shadow(0 4px 20px rgba(56, 189, 248, 0.22));
    user-select: none;
    -webkit-user-drag: none;
}

.start-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: clamp(0.75rem, 2.5vh, 1rem) clamp(0.85rem, 3vw, 1.15rem);
    display: flex;
    flex-direction: column;
    gap: clamp(0.65rem, 2vh, 0.85rem);
}

.start-label {
    display: block;
    margin-bottom: 0.4rem;
    font-family: var(--font-display);
    font-size: clamp(0.5rem, 1.4vmin, 0.6rem);
    font-weight: 700;
    font-style: italic;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(122, 155, 184, 0.95);
}

.start-mission {
    padding: 0.65rem 0.75rem;
    border-radius: 2px;
    background: rgba(56, 189, 248, 0.06);
    border: 1px solid rgba(56, 189, 248, 0.14);
}

.start-mission p {
    margin: 0;
    font-size: clamp(0.72rem, 2vmin, 0.82rem);
    font-weight: 500;
    line-height: 1.5;
    color: rgba(232, 244, 255, 0.88);
}

.start-guide__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
}

.guide-card {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0.55rem;
    min-width: 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(56, 189, 248, 0.1);
    border-radius: 2px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.guide-card:hover {
    background: rgba(56, 189, 248, 0.06);
    border-color: rgba(56, 189, 248, 0.25);
}

.guide-card--blue { border-left: 2px solid #38bdf8; }
.guide-card--gold { border-left: 2px solid #fbbf24; }
.guide-card--split { border-left: 2px solid #a78bfa; }
.guide-card--hazard { border-left: 2px solid #9ca3af; }

.guide-card__icon {
    flex-shrink: 0;
    width: 1.35rem;
    height: 1.35rem;
    margin-top: 0.1rem;
    border-radius: 50%;
    border: 2px solid transparent;
}

.guide-card__icon--blue {
    background: radial-gradient(circle at 35% 35%, #93c5fd, #2563eb);
    border-color: rgba(147, 197, 253, 0.5);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.55);
}

.guide-card__icon--gold {
    background: radial-gradient(circle at 35% 35%, #fde68a, #d97706);
    border-color: rgba(253, 230, 138, 0.5);
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.55);
}

.guide-card__icon--split {
    background: linear-gradient(90deg, #2563eb 50%, #d97706 50%);
    border-color: rgba(255, 255, 255, 0.35);
}

.guide-card__icon--hazard {
    border-radius: 3px;
    background: #4b5563;
    border-color: #9ca3af;
    position: relative;
    overflow: hidden;
}

.guide-card__icon--hazard::after {
    content: '';
    position: absolute;
    inset: 18%;
    background: repeating-linear-gradient(-45deg, #374151, #374151 3px, #fbbf24 3px, #fbbf24 6px);
    opacity: 0.9;
}

.guide-card__copy {
    flex: 1;
    min-width: 0;
}

.guide-card__copy h3 {
    margin: 0 0 0.1rem;
    font-family: var(--font-ui);
    font-size: clamp(0.62rem, 1.8vmin, 0.72rem);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    line-height: 1.2;
}

.guide-card__copy p {
    margin: 0;
    font-size: clamp(0.58rem, 1.6vmin, 0.66rem);
    line-height: 1.35;
    color: rgba(232, 244, 255, 0.65);
}

.guide-card__copy strong {
    color: var(--neon-cyan);
    font-weight: 700;
}

.guide-card--gold .guide-card__copy strong {
    color: var(--neon-gold);
}

.start-keys {
    padding: 0.55rem 0.65rem;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(251, 191, 36, 0.15);
}

.start-keys__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.45rem 0.65rem;
}

.key-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: clamp(0.58rem, 1.6vmin, 0.68rem);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(232, 244, 255, 0.8);
}

.key-chip kbd {
    display: inline-block;
    min-width: 1.35rem;
    padding: 0.12rem 0.35rem;
    border-radius: 2px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.28);
    font-family: var(--font-ui);
    font-size: 0.9em;
    font-weight: 700;
    color: var(--neon-cyan);
    text-align: center;
    line-height: 1.2;
}

.start-footer {
    flex-shrink: 0;
    padding: clamp(0.65rem, 2vh, 0.85rem) clamp(0.85rem, 3vw, 1.15rem) clamp(0.85rem, 2.5vh, 1.1rem);
    border-top: 1px solid rgba(56, 189, 248, 0.12);
    background: linear-gradient(180deg, transparent 0%, rgba(56, 189, 248, 0.04) 100%);
}

#game-over-screen {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
}

.screen-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(0.65rem, 2vh, 1rem);
    width: min(100%, 23rem);
    margin: auto;
    position: relative;
    z-index: 1;
}

.screen-inner--compact {
    width: min(100%, 20rem);
}

/* Title card (game over) */
.screen-card {
    position: relative;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    overflow: hidden;
}

/* Start button */
.start-footer .btn-start {
    position: relative;
    width: 100%;
    padding: clamp(0.7rem, 2.4vh, 0.9rem) 1.25rem;
    border-radius: 2px;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #1d4ed8 100%);
    border: 1px solid rgba(96, 165, 250, 0.65);
    cursor: pointer;
    overflow: hidden;
    box-shadow:
        0 0 24px rgba(37, 99, 235, 0.4),
        0 6px 20px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
    animation: btnIdle 3s ease-in-out infinite;
}

.btn-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.15) 50%, transparent 60%);
    animation: btnShine 3s ease-in-out infinite;
}

.btn-text {
    position: relative;
    display: block;
    font-family: var(--font-display);
    font-size: clamp(0.82rem, 2.6vmin, 0.98rem);
    font-weight: 900;
    font-style: italic;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.35);
}

.start-footer .btn-start:hover {
    transform: scale(1.02);
    filter: brightness(1.12);
    box-shadow: 0 0 32px rgba(37, 99, 235, 0.55), 0 8px 28px rgba(0, 0, 0, 0.45);
}

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

/* Game over */
.screen-card--gameover {
    padding: clamp(1.25rem, 3.5vh, 1.75rem);
    background: rgba(20, 4, 4, 0.75);
    border: 1px solid rgba(248, 113, 113, 0.35);
    backdrop-filter: blur(20px);
    box-shadow: 0 0 50px rgba(220, 38, 38, 0.2), 0 20px 60px rgba(0, 0, 0, 0.6);
}

.gameover-title {
    margin: 0 0 0.75rem;
    font-family: var(--font-display);
    font-size: clamp(2rem, 8vmin, 3rem);
    font-weight: 900;
    font-style: italic;
    color: var(--neon-red);
    transform: skewX(-6deg);
    text-shadow: 0 0 30px rgba(248, 113, 113, 0.9);
}

.gameover-score-label {
    margin: 0;
    font-size: clamp(0.6rem, 1.8vmin, 0.72rem);
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
}

.gameover-score {
    margin: 0.25rem 0 1.25rem;
    font-family: var(--font-display);
    font-size: clamp(2rem, 7vmin, 2.75rem);
    font-weight: 900;
    font-style: italic;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.btn-restart {
    width: 100%;
    padding: clamp(0.6rem, 2vh, 0.75rem) 1.5rem;
    background: linear-gradient(135deg, #1f2937, #374151);
    border: 1px solid rgba(156, 163, 175, 0.5);
    font-family: var(--font-display);
    font-size: clamp(0.75rem, 2.5vmin, 0.9rem);
    font-weight: 900;
    font-style: italic;
    letter-spacing: 0.1em;
    color: #fff;
    cursor: pointer;
    transform: skewX(-6deg);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: transform 0.2s, filter 0.2s;
}

.btn-restart:hover {
    transform: skewX(-6deg) scale(1.03);
    filter: brightness(1.15);
}

/* Screen FX */
.screen-fx {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    transition: opacity 0.2s ease-out;
}

#damage-fx {
    background: radial-gradient(ellipse at center, transparent 20%, rgba(185, 28, 28, 0.55) 100%);
    mix-blend-mode: multiply;
}

#pass-fx {
    mix-blend-mode: overlay;
}

#pass-fx.pass-fx--blue {
    background: rgba(56, 189, 248, 0.25);
}

#pass-fx.pass-fx--yellow {
    background: rgba(251, 191, 36, 0.25);
}

.wind-lines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(to bottom,
            transparent,
            transparent 20px,
            rgba(255, 255, 255, 0.025) 20px,
            rgba(255, 255, 255, 0.025) 25px);
    z-index: 3;
    pointer-events: none;
    animation: windMove 0.1s linear infinite;
}

/* ── Animations ── */
@keyframes windMove {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 0 45px;
    }
}

@keyframes dotPulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 6px var(--neon-cyan);
    }

    50% {
        opacity: 0.4;
        box-shadow: 0 0 2px var(--neon-cyan);
    }
}

@keyframes energyShine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(200%);
    }
}

@keyframes criticalPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

@keyframes alertFlicker {

    0%,
    100% {
        opacity: 1;
    }

    92% {
        opacity: 1;
    }

    93% {
        opacity: 0.7;
    }

    94% {
        opacity: 1;
    }

    96% {
        opacity: 0.8;
    }

    97% {
        opacity: 1;
    }
}

@keyframes btnIdle {

    0%,
    100% {
        box-shadow: 0 0 30px rgba(37, 99, 235, 0.5), 0 8px 24px rgba(0, 0, 0, 0.4);
    }

    50% {
        box-shadow: 0 0 45px rgba(37, 99, 235, 0.7), 0 8px 24px rgba(0, 0, 0, 0.4);
    }
}

@keyframes btnShine {
    0% {
        transform: translateX(-100%) skewX(-20deg);
    }

    100% {
        transform: translateX(200%) skewX(-20deg);
    }
}

@keyframes startAurora {
    from { transform: scale(1) translateY(0); opacity: 0.85; }
    to { transform: scale(1.05) translateY(-2%); opacity: 1; }
}

@keyframes startGlowPulse {
    from { opacity: 0.7; }
    to { opacity: 1; }
}

@keyframes startModalIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ══════════════════════════════════════
   MOBILE BLOCKER — Desktop-only gate
   ══════════════════════════════════════ */
.mobile-blocker {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--safe-pad);
    box-sizing: border-box;
    background: rgba(4, 8, 18, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow-y: auto;
}

.mobile-blocker__vignette {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center, rgba(56, 189, 248, 0.08) 0%, transparent 55%),
        radial-gradient(ellipse at center, transparent 25%, rgba(4, 8, 18, 0.85) 100%);
    pointer-events: none;
}

.mobile-blocker__card {
    position: relative;
    z-index: 1;
    width: min(100%, 22rem);
    margin: auto;
    padding: clamp(1.25rem, 4vw, 1.75rem);
    text-align: center;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    box-shadow:
        0 0 50px var(--panel-glow),
        0 24px 64px rgba(0, 0, 0, 0.6);
}

.mobile-blocker__card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-blue), var(--neon-gold), transparent);
}

.mobile-blocker__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(3rem, 12vw, 3.75rem);
    height: clamp(3rem, 12vw, 3.75rem);
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: var(--neon-cyan);
    font-size: clamp(1.25rem, 5vw, 1.6rem);
    box-shadow: 0 0 24px rgba(56, 189, 248, 0.25);
}

.mobile-blocker__title {
    margin: 0 0 0.75rem;
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 4.5vw, 1.5rem);
    font-weight: 900;
    font-style: italic;
    letter-spacing: 0.08em;
    color: var(--neon-blue);
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.6);
    transform: skewX(-6deg);
}

.mobile-blocker__message {
    margin: 0 0 1rem;
    font-size: clamp(0.8rem, 2.8vw, 0.95rem);
    font-weight: 500;
    line-height: 1.55;
    color: rgba(232, 244, 255, 0.85);
}

.mobile-blocker__specs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1rem;
    margin-bottom: 1rem;
    font-size: clamp(0.65rem, 2.2vw, 0.75rem);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.mobile-blocker__specs span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.mobile-blocker__specs i {
    color: var(--neon-cyan);
}

.mobile-blocker__footer {
    margin: 0;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(56, 189, 248, 0.15);
    font-size: clamp(0.6rem, 2vw, 0.7rem);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

body.mobile-blocked {
    overflow: hidden;
}

body.mobile-blocked #ui-layer,
body.mobile-blocked .screen,
body.mobile-blocked .wind-lines,
body.mobile-blocked .screen-fx {
    visibility: hidden;
    pointer-events: none;
}

body.mobile-blocked #game-canvas {
    filter: blur(6px) brightness(0.35);
    pointer-events: none;
}

/* CSS fallback if JS is delayed — phones only */
@media (max-width: 640px) {
    #mobile-blocker:not(.hidden) {
        display: flex;
    }
}

@media (orientation: landscape) and (max-height: 500px) and (max-width: 932px) {
    #mobile-blocker:not(.hidden) {
        display: flex;
    }
}

/* ══════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ══════════════════════════════════════ */

/* ── Desktop (≥1025px) — base styles ── */
@media (min-width: 1025px) {
    :root {
        --safe-pad: clamp(0.75rem, 2vmin, 1.25rem);
    }

    .hud-frame {
        max-width: 38rem;
    }

    .screen-inner {
        width: min(100%, 26rem);
    }

    .screen-inner--compact {
        width: min(100%, 22rem);
    }

    .start-modal {
        width: min(100%, 30rem);
    }

    #pc-hint {
        display: flex;
    }

    #touch-controls {
        display: none !important;
    }
}

/* ── Tablet Landscape (769px – 1024px) ── */
@media (max-width: 1024px) and (min-width: 769px) {
    :root {
        --safe-pad: clamp(0.55rem, 1.8vmin, 0.85rem);
    }

    .hud-frame {
        max-width: 30rem;
    }

    .hud-top {
        padding: 0.4rem 0.6rem;
    }

    .hud-value {
        font-size: clamp(1rem, 3vmin, 1.35rem);
    }

    .hud-label {
        font-size: clamp(0.48rem, 1.4vmin, 0.55rem);
    }

    .screen-inner {
        width: min(100%, 22rem);
        gap: 0.55rem;
    }

    .start-modal {
        width: min(100%, 24rem);
    }

    #pc-hint {
        display: none;
    }

    #center-msg-text {
        font-size: clamp(1.5rem, 6vmin, 2.25rem);
    }

    .mobile-blocker__card {
        width: min(100%, 24rem);
    }
}

/* ── Tablet Portrait (641px – 768px) ── */
@media (max-width: 768px) and (min-width: 641px) {
    :root {
        --safe-pad: clamp(0.5rem, 1.6vmin, 0.75rem);
    }

    .hud-frame {
        max-width: 26rem;
    }

    .hud-stat {
        min-width: clamp(3rem, 10vw, 4rem);
        padding: 0 0.35rem;
    }

    .energy-panel {
        padding: 0 0.5rem;
    }

    .hud-value {
        font-size: clamp(0.95rem, 2.8vmin, 1.2rem);
    }

    .screen-inner {
        width: min(100%, 20rem);
    }

    .start-modal {
        width: min(100%, 22rem);
    }

    .alert-frame {
        padding: 0.4rem 1.25rem;
    }

    #center-msg-text {
        font-size: clamp(1.35rem, 5.5vmin, 2rem);
    }

    .gameover-title {
        font-size: clamp(1.75rem, 7vmin, 2.5rem);
    }

    .gameover-score {
        font-size: clamp(1.75rem, 6vmin, 2.25rem);
    }

    .mobile-blocker__card {
        width: min(100%, 21rem);
    }
}

/* ── Mobile (≤640px) ── */
@media (max-width: 640px) {
    :root {
        --safe-pad: clamp(0.45rem, 1.4vmin, 0.65rem);
    }

    .hud-frame {
        max-width: 100%;
    }

    .hud-frame::before,
    .hud-frame::after {
        width: 8px;
        height: 8px;
    }

    .hud-top {
        padding: 0.35rem 0.45rem;
        gap: 0;
    }

    .hud-stat {
        min-width: clamp(2.75rem, 14vw, 3.5rem);
        padding: 0 0.25rem;
    }

    .hud-label {
        font-size: clamp(0.42rem, 1.2vmin, 0.5rem);
        letter-spacing: 0.1em;
    }

    .hud-value {
        font-size: clamp(0.85rem, 2.6vmin, 1.05rem);
    }

    .hud-unit {
        font-size: 0.4em;
    }

    .energy-panel {
        padding: 0 0.35rem;
    }

    .energy-panel .hud-label {
        letter-spacing: 0.12em;
        margin-bottom: 0.2rem;
    }

    .energy-track {
        height: clamp(0.35rem, 1.2vmin, 0.5rem);
    }

    .screen {
        padding: 0.5rem;
    }

    .screen-inner {
        width: min(100%, 18rem);
        gap: 0.5rem;
    }

    .screen-inner--compact {
        width: min(100%, 17rem);
    }

    .start-modal {
        width: min(100%, 20rem);
    }

    .start-header__logo {
        width: min(100%, clamp(9.5rem, 72vw, 18rem));
        max-height: clamp(2.25rem, 11vmin, 4.25rem);
    }

    .btn-home {
        width: 2.1rem;
        height: 2.1rem;
    }

    .start-footer .btn-start {
        padding: 0.55rem 1rem;
    }

    .btn-text {
        font-size: clamp(0.7rem, 2.4vmin, 0.85rem);
        letter-spacing: 0.08em;
    }

    .gameover-title {
        font-size: clamp(1.5rem, 8vmin, 2rem);
    }

    .gameover-score {
        font-size: clamp(1.5rem, 6.5vmin, 2rem);
        margin-bottom: 1rem;
    }

    .btn-restart {
        padding: 0.55rem 1rem;
        font-size: clamp(0.68rem, 2.2vmin, 0.8rem);
    }

    #pc-hint {
        display: none;
    }

    #center-msg-text {
        font-size: clamp(1.15rem, 6vmin, 1.75rem);
    }

    .alert-frame {
        padding: 0.35rem 1rem;
    }

    #touch-controls {
        max-width: 100%;
    }

    .touch-row {
        height: clamp(3.75rem, 11vmin, 4.5rem);
    }

    .touch-shields {
        width: clamp(3.75rem, 14vw, 4.5rem);
    }

    .btn-action {
        font-size: clamp(0.58rem, 1.8vmin, 0.7rem);
    }

    .mobile-blocker__card {
        width: min(100%, 19rem);
        padding: 1.1rem 1rem;
    }

    .mobile-blocker__specs {
        flex-direction: column;
        gap: 0.4rem;
    }
}

/* ── Small Mobile (≤480px) ── */
@media (max-width: 480px) {
    :root {
        --safe-pad: 0.4rem;
    }

    .hud-dot {
        width: 3px;
        height: 3px;
    }

    .hud-stat {
        min-width: 2.5rem;
    }

    .hud-label {
        font-size: 0.4rem;
        letter-spacing: 0.08em;
    }

    .hud-value {
        font-size: 0.8rem;
    }

    .start-modal {
        width: 100%;
    }

    .start-header__logo {
        width: min(100%, clamp(8.5rem, 68vw, 14rem));
        max-height: clamp(2rem, 10vmin, 3.5rem);
    }

    .start-footer .btn-start {
        padding: 0.5rem 0.75rem;
    }

    .btn-text {
        font-size: 0.65rem;
    }

    .gameover-title {
        font-size: 1.5rem;
    }

    .gameover-score-label {
        font-size: 0.55rem;
    }

    .gameover-score {
        font-size: 1.5rem;
    }

    .mobile-blocker__icon {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.1rem;
    }

    .mobile-blocker__title {
        font-size: 1rem;
    }

    .mobile-blocker__message {
        font-size: 0.78rem;
    }

    .mobile-blocker__footer {
        font-size: 0.55rem;
    }
}

/* ── Landscape Mobile (orientation: landscape) ── */
@media (orientation: landscape) and (max-height: 500px) {
    :root {
        --safe-pad: 0.35rem;
    }

    .screen--start {
        align-items: flex-start;
        padding: 0.35rem 0.5rem;
    }

    .start-modal {
        width: min(100%, 34rem);
        max-height: calc(100dvh - 0.7rem);
    }

    .start-header {
        padding: 0.5rem 0.65rem 0.45rem;
    }

    .start-header__status {
        margin-bottom: 0.35rem;
        font-size: 0.34rem;
    }

    .start-header__logo {
        width: min(100%, clamp(7.5rem, 52vw, 12rem));
        max-height: clamp(1.65rem, 9vh, 2.5rem);
    }

    .start-body {
        padding: 0.45rem 0.55rem;
        gap: 0.4rem;
    }

    .start-mission {
        display: none;
    }

    .start-keys {
        display: none;
    }

    .start-guide__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.25rem;
    }

    .guide-card {
        padding: 0.3rem 0.35rem;
        gap: 0.3rem;
    }

    .guide-card__icon {
        width: 0.85rem;
        height: 0.85rem;
    }

    .guide-card__copy h3 {
        font-size: 0.42rem;
    }

    .guide-card__copy p {
        font-size: 0.36rem;
    }

    .start-footer {
        padding: 0.4rem 0.55rem 0.5rem;
    }

    .start-footer .btn-start {
        padding: 0.4rem 0.65rem;
    }

    .btn-text {
        font-size: 0.58rem;
    }

    .hud-frame {
        max-width: 28rem;
    }

    .hud-top {
        padding: 0.25rem 0.4rem;
    }

    .hud-value {
        font-size: 0.85rem;
    }

    .energy-track {
        height: 0.35rem;
    }

    #pc-hint {
        display: none;
    }

    .touch-row {
        height: 3.25rem;
    }

    .screen-inner--compact {
        flex-direction: column;
        width: min(100%, 16rem);
    }

    .gameover-title {
        font-size: 1.35rem;
        margin-bottom: 0.4rem;
    }

    .gameover-score {
        font-size: 1.35rem;
        margin-bottom: 0.65rem;
    }

    .screen-card--gameover {
        padding: 0.75rem 1rem;
    }

    .mobile-blocker {
        align-items: flex-start;
        padding: 0.5rem;
    }

    .mobile-blocker__card {
        width: min(100%, 28rem);
        padding: 0.75rem 1rem;
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto auto;
        column-gap: 0.75rem;
        text-align: left;
    }

    .mobile-blocker__icon {
        grid-row: 1 / 3;
        margin: 0;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }

    .mobile-blocker__title {
        grid-column: 2;
        margin-bottom: 0.35rem;
        font-size: 0.95rem;
    }

    .mobile-blocker__message {
        grid-column: 1 / -1;
        margin-bottom: 0.5rem;
        font-size: 0.72rem;
        line-height: 1.4;
    }

    .mobile-blocker__specs {
        grid-column: 1 / -1;
        justify-content: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.35rem 0.75rem;
        margin-bottom: 0.5rem;
        font-size: 0.58rem;
    }

    .mobile-blocker__footer {
        grid-column: 1 / -1;
        padding-top: 0.5rem;
        font-size: 0.52rem;
    }
}

/* ── Short viewport compaction (all sizes) ── */
@media (max-height: 520px) and (min-width: 1025px) {
    .start-body {
        padding: 0.55rem 0.75rem;
        gap: 0.45rem;
    }

    .start-header {
        padding: 0.75rem 1rem 0.6rem;
    }

    .start-header__logo {
        max-height: clamp(2.2rem, 10vmin, 4rem);
    }

    .guide-card {
        padding: 0.4rem 0.45rem;
    }
}