:root {
    --bg: #050816;
    --panel: rgba(13, 18, 39, 0.86);
    --text: #f5fbff;
    --soft: #c8d7ff;
    --muted: #93a4c6;
    --cyan: #47e7ff;
    --pink: #ff5ec4;
    --amber: #ffd166;
    --green: #5dffb1;
    --violet: #8d73ff;
    --border: rgba(71, 231, 255, 0.28);
    --shadow: rgba(71, 231, 255, 0.2);
}

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

.sr-only {
    border: 0;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

body {
    background:
        radial-gradient(circle at 18% 10%, rgba(71, 231, 255, 0.14), transparent 30%),
        radial-gradient(circle at 82% 16%, rgba(255, 94, 196, 0.13), transparent 28%),
        radial-gradient(circle at 48% 86%, rgba(141, 115, 255, 0.12), transparent 36%),
        linear-gradient(180deg, #030614 0%, #10132a 55%, #050816 100%);
    color: var(--text);
    font-family: Inter, "Segoe UI", system-ui, sans-serif;
    margin: 0;
    min-height: 100vh;
    overflow: hidden;
}

.game-shell {
    align-items: center;
    display: flex;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    padding: clamp(8px, 2.2vh, 24px);
    width: 100%;
}

.game-panel {
    --controls-panel-height: 128px;
    --stage-height-reserve: calc(var(--controls-panel-height) + clamp(164px, 18vh, 218px));
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 0 42px var(--shadow), inset 0 0 36px rgba(2, 6, 23, 0.42);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100%;
    margin: 0 auto;
    max-height: calc(100dvh - clamp(16px, 4.4vh, 48px));
    max-width: min(1500px, calc(100dvw - clamp(16px, 4.4vh, 48px)));
    min-width: 0;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.game-topbar {
    align-items: center;
    background: linear-gradient(180deg, rgba(13, 18, 39, 0.96), rgba(4, 7, 18, 0.9));
    border-bottom: 1px solid var(--border);
    display: grid;
    gap: 12px;
    grid-template-columns: auto 1fr auto;
    min-width: 0;
    padding: 8px 14px;
}

.back-link,
.controls button,
.stage-hud button,
.overlay-card button {
    background: rgba(4, 7, 18, 0.78);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--cyan);
    cursor: pointer;
    font: 800 12px/1 Inter, "Segoe UI", system-ui, sans-serif;
    letter-spacing: 0;
    padding: 10px 12px;
    text-decoration: none;
    text-transform: uppercase;
}

.back-link:hover,
.controls button:hover,
.stage-hud button:hover,
.overlay-card button:hover,
.back-link:focus-visible,
.controls button:focus-visible,
.stage-hud button:focus-visible,
.overlay-card button:focus-visible {
    box-shadow: 0 0 16px var(--shadow);
    outline: 1px solid var(--cyan);
}

.back-link:focus-visible,
.stage-hud button:focus-visible,
.overlay-card button:focus-visible {
    box-shadow: 0 0 0 3px rgba(4, 7, 18, 0.95), 0 0 0 5px rgba(255, 209, 102, 0.85), 0 0 24px rgba(255, 209, 102, 0.22);
    outline: 0;
}

.game-title {
    min-width: 0;
    text-align: center;
}

.game-title h1 {
    color: var(--text);
    font-size: 21px;
    line-height: 1.05;
    margin: 0;
    text-shadow: 0 0 16px rgba(71, 231, 255, 0.42), 0 0 22px rgba(255, 94, 196, 0.28);
    text-transform: uppercase;
}

.game-title p {
    color: var(--muted);
    font: 700 10px/1.2 "SFMono-Regular", Consolas, monospace;
    margin: 3px 0 0;
    text-transform: uppercase;
}

.scoreboard {
    align-items: stretch;
    background:
        linear-gradient(90deg, rgba(71, 231, 255, 0.1), transparent 18%, transparent 82%, rgba(255, 209, 102, 0.1)),
        rgba(4, 7, 18, 0.42);
    border: 1px solid rgba(71, 231, 255, 0.16);
    border-radius: 10px;
    box-shadow:
        inset 0 0 22px rgba(2, 6, 23, 0.54),
        0 0 18px rgba(71, 231, 255, 0.08);
    display: flex;
    gap: 6px;
    min-width: 0;
    padding: 5px;
    position: relative;
}

.scoreboard::before {
    background:
        linear-gradient(90deg, transparent, rgba(255, 209, 102, 0.68), transparent),
        repeating-linear-gradient(90deg, transparent 0 15px, rgba(71, 231, 255, 0.2) 15px 16px);
    content: "";
    height: 1px;
    inset: 0 12%;
    opacity: 0.8;
    position: absolute;
}

.scoreboard div,
.run-stat {
    border: 1px solid rgba(71, 231, 255, 0.24);
    border-radius: 7px;
    padding: 6px 9px;
}

.scoreboard div {
    --score-rgb: 71, 231, 255;
    background:
        radial-gradient(circle at 90% 12%, rgba(var(--score-rgb), 0.18), transparent 38%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.055), transparent 26%),
        linear-gradient(180deg, rgba(18, 27, 62, 0.92), rgba(4, 7, 18, 0.88) 58%, rgba(2, 5, 14, 0.98));
    border-color: rgba(var(--score-rgb), 0.36);
    box-shadow:
        0 5px 0 rgba(2, 5, 14, 0.88),
        0 9px 15px rgba(2, 6, 23, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -10px 14px rgba(0, 0, 0, 0.22),
        0 0 16px rgba(var(--score-rgb), 0.1);
    min-width: 100px;
    overflow: hidden;
    position: relative;
    text-align: right;
}

.scoreboard div::before {
    background:
        radial-gradient(circle, rgba(var(--score-rgb), 0.95), rgba(var(--score-rgb), 0.32) 45%, transparent 55%);
    border: 1px solid rgba(var(--score-rgb), 0.48);
    border-radius: 999px;
    box-shadow: 0 0 10px rgba(var(--score-rgb), 0.52);
    content: "";
    height: 7px;
    left: 8px;
    position: absolute;
    top: 8px;
    width: 7px;
}

.scoreboard div::after {
    background: linear-gradient(90deg, transparent, rgba(var(--score-rgb), 0.72), transparent);
    bottom: 5px;
    content: "";
    height: 2px;
    left: 10px;
    opacity: 0.72;
    position: absolute;
    right: 10px;
}

.score-tile--score {
    --score-rgb: 71, 231, 255;
}

.score-tile--best {
    --score-rgb: 255, 209, 102;
}

.score-tile--earned {
    --score-rgb: 93, 255, 177;
}

.scoreboard span,
.run-stat span {
    color: var(--muted);
    display: block;
    font: 800 10px/1 "SFMono-Regular", Consolas, monospace;
    text-transform: uppercase;
}

.scoreboard span {
    color: rgba(200, 215, 255, 0.76);
    font-size: 9px;
    padding-left: 12px;
    position: relative;
    z-index: 1;
}

.scoreboard strong,
.run-stat strong {
    color: var(--amber);
    display: block;
    font: 900 22px/1.1 "SFMono-Regular", Consolas, monospace;
    margin-top: 4px;
}

.scoreboard strong {
    color: rgb(var(--score-rgb));
    font-size: 20px;
    letter-spacing: 0;
    position: relative;
    text-shadow:
        0 0 14px rgba(var(--score-rgb), 0.42),
        0 2px 0 rgba(2, 5, 14, 0.82);
    z-index: 1;
}

.scoreboard div.best-celebrate {
    animation: bestHudPulse 0.78s ease both;
    border-color: rgba(255, 209, 102, 0.72);
}

.arena-wrap {
    align-items: center;
    background:
        linear-gradient(rgba(71, 231, 255, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(141, 115, 255, 0.08) 1px, transparent 1px),
        radial-gradient(circle at 50% 48%, rgba(71, 231, 255, 0.12), transparent 40%),
        #040716;
    background-size: 54px 54px, 54px 54px, auto, auto;
    display: flex;
    justify-content: center;
    min-height: 0;
    overflow: hidden;
    padding: clamp(8px, 1.5vh, 14px);
}

.play-layout {
    align-items: stretch;
    display: grid;
    gap: clamp(12px, 2vw, 18px);
    grid-template-columns: minmax(0, 1fr) minmax(128px, 164px);
    height: 100%;
    justify-content: center;
    max-width: 1340px;
    min-width: 0;
    outline: none;
    width: 100%;
}

.play-layout:focus-visible,
.play-layout:focus-within {
    filter: drop-shadow(0 0 20px rgba(71, 231, 255, 0.18));
}

.play-layout:focus-visible .stage-frame {
    border-color: rgba(255, 209, 102, 0.78);
    box-shadow:
        0 0 0 2px rgba(4, 7, 18, 0.95),
        0 0 0 5px rgba(255, 209, 102, 0.58),
        0 0 34px rgba(255, 209, 102, 0.2),
        inset 0 0 28px rgba(2, 6, 23, 0.62);
}

.stage-column {
    display: grid;
    gap: clamp(8px, 1.5vh, 14px);
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    overflow: visible;
}

.stage-hud {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr auto auto;
}

.stage-hud span {
    background: rgba(4, 7, 18, 0.72);
    border: 1px solid rgba(71, 231, 255, 0.24);
    border-radius: 999px;
    color: var(--soft);
    font: 900 11px/1 "SFMono-Regular", Consolas, monospace;
    padding: clamp(8px, 1.4vh, 10px) 13px;
    text-transform: uppercase;
}

#newGameButton:focus-visible {
    background: linear-gradient(135deg, rgba(255, 209, 102, 0.18), rgba(4, 7, 18, 0.86));
    border-color: rgba(255, 209, 102, 0.72);
    color: var(--amber);
}

.stage-frame {
    aspect-ratio: 126 / 62;
    border: 1px solid rgba(71, 231, 255, 0.38);
    border-radius: 10px;
    box-shadow: 0 0 34px rgba(71, 231, 255, 0.16), inset 0 0 28px rgba(2, 6, 23, 0.62);
    height: min(100%, calc(100dvh - var(--stage-height-reserve)));
    justify-self: center;
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    overflow: hidden;
    position: relative;
    transition: height 180ms ease, width 180ms ease;
    width: auto;
}

.stage {
    background:
        radial-gradient(circle at 50% 52%, rgba(71, 231, 255, 0.08), transparent 56%),
        linear-gradient(180deg, rgba(8, 11, 29, 0.94), rgba(4, 7, 18, 0.98));
    display: block;
    height: 100%;
    position: relative;
    width: 100%;
    z-index: 1;
}

.player-ship-sprite {
    height: var(--ship-height, 15%);
    left: var(--ship-x, 50%);
    pointer-events: none;
    position: absolute;
    top: var(--ship-y, 50%);
    transform: translate(var(--ship-offset-x, -50%), var(--ship-offset-y, -53.571%)) rotate(var(--ship-rotation, 0rad));
    transform-origin: var(--ship-anchor-x, 50%) var(--ship-anchor-y, 53.571%);
    width: var(--ship-width, 6.43%);
    z-index: 2;
}

.player-ship-sprite.is-hidden {
    opacity: 0;
}

.side-panel {
    align-content: start;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 28%),
        linear-gradient(180deg, rgba(71, 231, 255, 0.08), transparent 28%),
        rgba(4, 7, 18, 0.4);
    border: 1px solid rgba(71, 231, 255, 0.2);
    border-radius: 10px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        inset 0 -18px 24px rgba(2, 6, 23, 0.34),
        inset 0 0 22px rgba(2, 6, 23, 0.42),
        0 0 20px rgba(71, 231, 255, 0.08);
    display: grid;
    gap: 9px;
    grid-auto-rows: max-content;
    min-width: 0;
    padding: 11px 10px 12px;
    position: relative;
}

.side-panel::before {
    background: linear-gradient(180deg, rgba(255, 209, 102, 0.7), rgba(71, 231, 255, 0.08), transparent);
    content: "";
    inset: 8px auto 12px 8px;
    opacity: 0.72;
    position: absolute;
    width: 2px;
}

.side-panel__header {
    color: var(--cyan);
    font: 950 10px/1 "SFMono-Regular", Consolas, monospace;
    letter-spacing: 0;
    padding: 2px 0 3px 12px;
    text-transform: uppercase;
}

.run-stat {
    --stat-rgb: 71, 231, 255;
    background:
        radial-gradient(circle at 102% 4%, rgba(var(--stat-rgb), 0.2), transparent 38%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.055), transparent 25%),
        linear-gradient(180deg, rgba(17, 25, 56, 0.9), rgba(4, 7, 18, 0.82) 58%, rgba(2, 5, 14, 0.92));
    border-color: rgba(var(--stat-rgb), 0.34);
    box-shadow:
        0 5px 0 rgba(2, 5, 14, 0.86),
        0 9px 16px rgba(2, 6, 23, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -13px 18px rgba(0, 0, 0, 0.22),
        0 0 16px rgba(var(--stat-rgb), 0.1);
    display: grid;
    gap: 5px;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(30px, 1fr) auto;
    min-height: 92px;
    overflow: hidden;
    padding: 11px 12px 12px 14px;
    position: relative;
}

.run-stat::before {
    background:
        radial-gradient(circle at 50% 50%, rgba(var(--stat-rgb), 0.96), rgba(var(--stat-rgb), 0.34) 46%, transparent 54%);
    border: 1px solid rgba(var(--stat-rgb), 0.54);
    border-radius: 999px;
    box-shadow: 0 0 12px rgba(var(--stat-rgb), 0.62), inset 0 0 8px rgba(255, 255, 255, 0.08);
    content: "";
    height: 10px;
    position: absolute;
    right: 11px;
    top: 11px;
    width: 10px;
    z-index: 1;
}

.run-stat::after {
    background:
        linear-gradient(90deg, rgba(var(--stat-rgb), 0.86), rgba(var(--stat-rgb), 0.26), transparent),
        linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent);
    bottom: 8px;
    content: "";
    height: 4px;
    left: 14px;
    position: absolute;
    right: 12px;
    z-index: 0;
}

.run-stat--lives {
    --stat-rgb: 93, 255, 177;
}

.run-stat--wave {
    --stat-rgb: 255, 209, 102;
}

.run-stat--rocks {
    --stat-rgb: 255, 94, 196;
}

.run-stat--special {
    --stat-rgb: 255, 209, 102;
}

.run-stat--special[data-threat="blackhole"] {
    --stat-rgb: 141, 115, 255;
}

.run-stat--special[data-threat="ice"] {
    --stat-rgb: 71, 231, 255;
}

.run-stat--special[data-threat="starlight"] {
    --stat-rgb: 255, 209, 102;
}

.run-stat--special[data-threat="volatile"] {
    --stat-rgb: 255, 119, 48;
}

.run-stat--special[data-threat="crystal"] {
    --stat-rgb: 93, 255, 177;
}

.run-stat--special[data-threat="mine"] {
    --stat-rgb: 141, 115, 255;
}

.run-stat--special[data-threat="clear"] {
    --stat-rgb: 147, 164, 198;
}

.run-stat span {
    align-self: start;
    color: rgba(200, 215, 255, 0.78);
    font-size: 9px;
    letter-spacing: 0;
    min-width: 0;
    padding: 0 16px 0 0;
    position: relative;
    z-index: 2;
}

.run-stat strong {
    align-self: center;
    color: rgb(var(--stat-rgb));
    font-size: clamp(27px, 2.8vw, 35px);
    justify-self: start;
    letter-spacing: 0;
    margin: 0;
    min-width: 0;
    position: relative;
    text-shadow: 0 0 16px rgba(var(--stat-rgb), 0.5), 0 3px 0 rgba(2, 5, 14, 0.78);
    z-index: 2;
}

.run-stat--special strong {
    font-size: clamp(18px, 2vw, 24px);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.run-stat small {
    color: rgba(147, 164, 198, 0.82);
    font: 850 9px/1 "SFMono-Regular", Consolas, monospace;
    margin: 0;
    min-width: 0;
    position: relative;
    text-transform: uppercase;
    z-index: 2;
}

.countdown-overlay {
    align-items: center;
    background: radial-gradient(circle at center, rgba(71, 231, 255, 0.2), transparent 42%), rgba(4, 7, 18, 0.28);
    display: flex;
    flex-direction: column;
    gap: 12px;
    inset: 0;
    justify-content: center;
    pointer-events: none;
    position: absolute;
    z-index: 9;
}

.countdown-overlay.hidden,
.overlay.hidden,
.overlay-summary.hidden,
.ship-dock-overlay.hidden,
.help-overlay.hidden,
.help-slide.hidden {
    display: none;
}

.countdown-ring {
    --countdown-accent: var(--pink);
    align-items: center;
    aspect-ratio: 1;
    background: linear-gradient(#050816, #050816) padding-box, conic-gradient(from -90deg, var(--countdown-accent), var(--cyan), var(--amber), var(--countdown-accent)) border-box;
    border: 4px solid transparent;
    border-radius: 50%;
    box-shadow: 0 0 34px color-mix(in srgb, var(--countdown-accent) 45%, transparent), inset 0 0 24px rgba(2, 6, 23, 0.9);
    display: grid;
    justify-items: center;
    width: clamp(118px, 20vw, 178px);
}

.countdown-ring span {
    color: var(--text);
    font: 950 clamp(48px, 9vw, 86px)/1 "SFMono-Regular", Consolas, monospace;
    text-shadow: 0 0 16px var(--countdown-accent), 0 4px 0 rgba(2, 6, 23, 0.72);
}

.countdown-overlay small {
    background: rgba(4, 7, 18, 0.72);
    border: 1px solid rgba(71, 231, 255, 0.28);
    border-radius: 999px;
    color: var(--soft);
    font: 900 11px/1 "SFMono-Regular", Consolas, monospace;
    padding: 9px 13px;
    text-transform: uppercase;
}

.countdown-overlay.pulse .countdown-ring {
    animation: countdownPop 0.7s ease both;
}

.countdown-overlay.go .countdown-ring {
    --countdown-accent: var(--green);
}

.controls {
    background:
        linear-gradient(90deg, rgba(71, 231, 255, 0.1), transparent 18%, transparent 82%, rgba(255, 94, 196, 0.12)),
        radial-gradient(circle at 50% 0, rgba(255, 209, 102, 0.1), transparent 42%),
        linear-gradient(180deg, rgba(23, 30, 64, 0.98), rgba(6, 10, 27, 0.96) 58%, rgba(2, 5, 15, 0.98));
    border-top: 1px solid rgba(255, 209, 102, 0.22);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 12px 28px rgba(71, 231, 255, 0.05),
        0 -14px 38px rgba(2, 6, 23, 0.42);
    display: grid;
    gap: clamp(12px, 1.8vw, 20px);
    grid-template-columns: minmax(0, 650px) minmax(92px, 124px);
    justify-content: center;
    padding: clamp(12px, 1.9vh, 16px) 18px clamp(14px, 2vh, 18px);
    position: relative;
}

.controls::before {
    background:
        linear-gradient(90deg, transparent, rgba(255, 209, 102, 0.68), transparent),
        repeating-linear-gradient(90deg, transparent 0 18px, rgba(71, 231, 255, 0.18) 18px 19px);
    content: "";
    height: 2px;
    inset: 0 18%;
    opacity: 0.72;
    position: absolute;
    top: 0;
}

.controls::after {
    background: linear-gradient(90deg, transparent, rgba(71, 231, 255, 0.22), rgba(255, 94, 196, 0.16), transparent);
    bottom: 7px;
    content: "";
    height: 1px;
    left: 14%;
    position: absolute;
    right: 14%;
}

.controls-toggle {
    align-items: center;
    background:
        linear-gradient(180deg, rgba(21, 28, 58, 0.98), rgba(4, 7, 18, 0.98)),
        radial-gradient(circle at 50% 0, rgba(255, 209, 102, 0.22), transparent 62%);
    border: 1px solid rgba(255, 209, 102, 0.42);
    border-radius: 999px;
    box-shadow:
        0 4px 0 rgba(2, 5, 14, 0.92),
        0 8px 18px rgba(2, 6, 23, 0.44),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -8px 14px rgba(0, 0, 0, 0.22),
        0 0 18px rgba(255, 209, 102, 0.12);
    color: var(--amber);
    display: inline-grid;
    gap: 6px;
    grid-template-columns: auto auto;
    height: 26px;
    justify-content: center;
    justify-items: center;
    min-height: 0;
    min-width: 86px;
    padding: 0 11px;
    position: absolute;
    right: auto;
    left: 50%;
    top: -13px;
    transform: translateX(-50%);
    width: auto;
    z-index: 3;
}

.controls-toggle::before {
    background: linear-gradient(90deg, transparent, rgba(255, 209, 102, 0.58), transparent);
    bottom: 4px;
    content: "";
    height: 1px;
    left: 14px;
    opacity: 0.72;
    position: absolute;
    right: 14px;
}

.controls-toggle::after {
    background: none;
    border: 0;
    border-radius: 0;
    color: rgba(255, 209, 102, 0.9);
    content: "CONTROLS";
    font: 900 7px/1 "SFMono-Regular", Consolas, monospace;
    grid-column: 1;
    grid-row: 1;
    letter-spacing: 0;
    padding: 0;
    position: static;
    transform: none;
}

.controls-toggle span {
    grid-column: 2;
    grid-row: 1;
    height: 10px;
    position: relative;
    width: 12px;
}

.controls-toggle span::before,
.controls-toggle span::after {
    background: currentColor;
    border-radius: 999px;
    box-shadow: 0 0 8px rgba(255, 209, 102, 0.62);
    content: "";
    height: 2px;
    left: 1px;
    position: absolute;
    top: 5px;
    transform-origin: center;
    width: 8px;
}

.controls-toggle span::before {
    transform: translateX(-2px) rotate(35deg);
}

.controls-toggle span::after {
    transform: translateX(3px) rotate(-35deg);
}

.controls-toggle:hover,
.controls-toggle:focus-visible {
    box-shadow:
        0 5px 0 rgba(2, 5, 14, 0.94),
        0 0 0 3px rgba(4, 7, 18, 0.95),
        0 0 0 5px rgba(255, 209, 102, 0.46),
        0 0 24px rgba(255, 209, 102, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    outline: 0;
    transform: translateX(-50%) translateY(-1px);
}

.controls-toggle:active {
    box-shadow:
        0 2px 0 rgba(2, 5, 14, 0.94),
        0 5px 10px rgba(2, 6, 23, 0.4),
        inset 0 2px 8px rgba(0, 0, 0, 0.36);
    transform: translateX(-50%) translateY(3px);
}

.controls.is-collapsed {
    grid-template-columns: 1fr;
    min-height: 42px;
    padding: 15px 18px 10px;
}

.controls.is-collapsed .flight-controls,
.controls.is-collapsed .system-controls {
    display: none;
}

.controls.is-collapsed .controls-toggle {
    background:
        linear-gradient(180deg, rgba(255, 209, 102, 0.22), rgba(4, 7, 18, 0.98)),
        radial-gradient(circle at 50% 0, rgba(71, 231, 255, 0.18), transparent 62%);
    border-color: rgba(255, 209, 102, 0.58);
    left: 50%;
    right: auto;
    top: 8px;
    transform: translateX(-50%);
}

.controls.is-collapsed .controls-toggle::after {
    content: "SHOW CONTROLS";
}

.controls.is-collapsed .controls-toggle:active {
    transform: translateX(-50%) translateY(3px);
}

.controls.is-collapsed .controls-toggle:hover,
.controls.is-collapsed .controls-toggle:focus-visible {
    transform: translateX(-50%) translateY(-1px);
}

.controls.is-collapsed .controls-toggle span::before {
    transform: translateX(-2px) rotate(-35deg);
}

.controls.is-collapsed .controls-toggle span::after {
    transform: translateX(3px) rotate(35deg);
}

.controls button {
    min-height: clamp(72px, 9.2vh, 86px);
}

.controls .controls-toggle {
    min-height: 0;
}

.flight-controls {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 28%),
        rgba(4, 7, 18, 0.34);
    border: 1px solid rgba(71, 231, 255, 0.16);
    border-radius: 14px;
    box-shadow: inset 0 0 22px rgba(2, 6, 23, 0.58), 0 0 20px rgba(71, 231, 255, 0.08);
    display: grid;
    gap: clamp(8px, 1vw, 12px);
    grid-template-columns: repeat(6, minmax(68px, 112px));
    justify-content: end;
    min-width: 0;
    padding: 8px;
}

.system-controls {
    background:
        linear-gradient(180deg, rgba(255, 94, 196, 0.08), transparent 46%),
        rgba(4, 7, 18, 0.36);
    border: 1px solid rgba(255, 94, 196, 0.2);
    border-radius: 14px;
    box-shadow: inset 0 0 18px rgba(2, 6, 23, 0.58), 0 0 18px rgba(255, 94, 196, 0.08);
    display: grid;
    justify-content: stretch;
    min-width: 0;
    padding: 8px;
    position: relative;
}

.system-controls::before {
    background: rgba(4, 7, 18, 0.9);
    border: 1px solid rgba(255, 94, 196, 0.32);
    border-radius: 999px;
    color: rgba(255, 94, 196, 0.86);
    content: "RESET BAY";
    font: 900 8px/1 "SFMono-Regular", Consolas, monospace;
    left: 50%;
    letter-spacing: 0;
    padding: 4px 6px;
    position: absolute;
    top: -9px;
    transform: translateX(-50%);
    white-space: nowrap;
}

.control-button {
    --control-rgb: 71, 231, 255;
    align-items: center;
    background:
        radial-gradient(circle at 50% 0, rgba(var(--control-rgb), 0.22), transparent 42%),
        linear-gradient(180deg, rgba(22, 31, 67, 0.96), rgba(6, 10, 26, 0.94) 58%, rgba(2, 5, 14, 0.98));
    border-color: rgba(var(--control-rgb), 0.42);
    border-radius: 12px;
    box-shadow:
        0 6px 0 rgba(2, 5, 14, 0.98),
        0 12px 18px rgba(2, 6, 23, 0.52),
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -10px 18px rgba(0, 0, 0, 0.28),
        0 0 18px rgba(var(--control-rgb), 0.12);
    color: rgb(var(--control-rgb));
    display: grid;
    gap: 4px;
    grid-template-rows: 44px auto auto;
    justify-items: center;
    overflow: hidden;
    padding: 8px 7px 9px;
    position: relative;
    text-shadow: 0 0 12px rgba(var(--control-rgb), 0.56);
    touch-action: none;
}

.control-button::before {
    background:
        linear-gradient(90deg, transparent, rgba(var(--control-rgb), 0.54), transparent),
        radial-gradient(circle at 50% 50%, rgba(var(--control-rgb), 0.18), transparent 64%);
    border-radius: 50%;
    content: "";
    height: 54px;
    left: 50%;
    opacity: 0.82;
    position: absolute;
    top: 2px;
    transform: translateX(-50%);
    width: 54px;
}

.control-button:hover,
.control-button:focus-visible {
    box-shadow:
        0 6px 0 rgba(2, 5, 14, 0.98),
        0 14px 20px rgba(2, 6, 23, 0.56),
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        inset 0 -10px 18px rgba(0, 0, 0, 0.22),
        0 0 24px rgba(var(--control-rgb), 0.42);
    outline-color: rgb(var(--control-rgb));
    transform: translateY(-1px);
}

.control-button:focus-visible {
    box-shadow:
        0 6px 0 rgba(2, 5, 14, 0.98),
        0 0 0 3px rgba(4, 7, 18, 0.96),
        0 0 0 6px rgba(var(--control-rgb), 0.78),
        0 0 28px rgba(var(--control-rgb), 0.46),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    outline: 0;
}

.control-button:active,
.control-button.is-pressed {
    box-shadow:
        0 2px 0 rgba(2, 5, 14, 0.98),
        0 5px 10px rgba(2, 6, 23, 0.46),
        inset 0 2px 10px rgba(0, 0, 0, 0.36),
        0 0 20px rgba(var(--control-rgb), 0.34);
    transform: translateY(4px);
}

.control-button.is-pressed {
    background:
        radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.22), transparent 34%),
        linear-gradient(180deg, rgba(var(--control-rgb), 0.38), rgba(4, 7, 18, 0.84) 58%, rgba(2, 5, 14, 0.96));
    border-color: rgba(var(--control-rgb), 0.8);
}

.control-button[data-action="ability"]::after {
    background: linear-gradient(90deg, rgba(var(--control-rgb), 0.9), rgba(255, 255, 255, 0.78));
    border-radius: 999px;
    bottom: 5px;
    box-shadow: 0 0 10px rgba(var(--control-rgb), 0.42);
    content: "";
    height: 3px;
    left: 8px;
    position: absolute;
    transform: scaleX(var(--ability-charge, 1));
    transform-origin: left center;
    width: calc(100% - 16px);
    z-index: 2;
}

.control-button.is-ready {
    border-color: rgba(var(--control-rgb), 0.86);
    box-shadow:
        0 6px 0 rgba(2, 5, 14, 0.98),
        0 12px 18px rgba(2, 6, 23, 0.52),
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        inset 0 -10px 18px rgba(0, 0, 0, 0.22),
        0 0 26px rgba(var(--control-rgb), 0.38);
}

.control-button.is-cooling {
    filter: saturate(0.78);
}

.control-button.is-disabled,
.control-button:disabled {
    cursor: default;
    filter: grayscale(0.28) saturate(0.58);
    opacity: 0.58;
    transform: none;
}

.control-button--amber {
    --control-rgb: 255, 209, 102;
}

.control-button--pink {
    --control-rgb: 255, 94, 196;
}

.control-button--violet {
    --control-rgb: 141, 115, 255;
}

.control-button--danger {
    --control-rgb: 255, 94, 196;
}

.control-label {
    color: var(--text);
    font: 950 11px/1 "SFMono-Regular", Consolas, monospace;
    position: relative;
    z-index: 2;
    text-transform: uppercase;
}

.control-sub {
    color: rgba(200, 215, 255, 0.72);
    font: 850 8px/1 "SFMono-Regular", Consolas, monospace;
    position: relative;
    z-index: 2;
    text-transform: uppercase;
}

.control-icon {
    align-items: center;
    background:
        radial-gradient(circle at 36% 24%, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.2) 18%, transparent 28%),
        radial-gradient(circle at 50% 40%, rgba(var(--control-rgb), 0.72), rgba(var(--control-rgb), 0.38) 44%, rgba(4, 7, 18, 0.96) 72%);
    border: 1px solid rgba(var(--control-rgb), 0.72);
    border-radius: 50%;
    box-shadow:
        inset 0 4px 8px rgba(255, 255, 255, 0.12),
        inset 0 -9px 10px rgba(0, 0, 0, 0.42),
        0 7px 0 rgba(2, 5, 14, 0.92),
        0 10px 16px rgba(2, 6, 23, 0.5),
        0 0 18px rgba(var(--control-rgb), 0.28);
    display: grid;
    height: 42px;
    justify-items: center;
    position: relative;
    width: 42px;
    z-index: 2;
}

.control-button:active .control-icon,
.control-button.is-pressed .control-icon {
    box-shadow:
        inset 0 6px 10px rgba(0, 0, 0, 0.34),
        inset 0 -4px 8px rgba(255, 255, 255, 0.08),
        0 3px 0 rgba(2, 5, 14, 0.92),
        0 6px 10px rgba(2, 6, 23, 0.44),
        0 0 20px rgba(var(--control-rgb), 0.34);
    transform: translateY(3px);
}

.control-icon--left::before,
.control-icon--right::before {
    border-bottom: 8px solid transparent;
    border-top: 8px solid transparent;
    content: "";
    filter: drop-shadow(0 0 8px rgba(var(--control-rgb), 0.8));
}

.control-icon--left::before {
    border-right: 15px solid currentColor;
}

.control-icon--right::before {
    border-left: 15px solid currentColor;
}

.control-icon--thrust::before {
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-bottom: 18px solid currentColor;
    content: "";
    filter: drop-shadow(0 0 10px rgba(var(--control-rgb), 0.82));
}

.control-icon--fire::before {
    background: currentColor;
    border-radius: 50%;
    box-shadow: 0 0 0 5px rgba(var(--control-rgb), 0.14), 0 0 16px rgba(var(--control-rgb), 0.86);
    content: "";
    height: 13px;
    width: 13px;
}

.control-icon--ability::before,
.control-icon--ability::after {
    border: 2px solid currentColor;
    border-radius: 50%;
    content: "";
    filter: drop-shadow(0 0 8px rgba(var(--control-rgb), 0.78));
    position: absolute;
}

.control-icon--ability::before {
    height: 24px;
    width: 24px;
}

.control-icon--ability::after {
    border-color: rgba(255, 255, 255, 0.86);
    height: 10px;
    width: 10px;
}

.control-icon--pause::before,
.control-icon--pause::after {
    background: currentColor;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(var(--control-rgb), 0.78);
    content: "";
    height: 18px;
    position: absolute;
    top: 12px;
    width: 5px;
}

.control-icon--pause::before {
    left: 14px;
}

.control-icon--pause::after {
    right: 14px;
}

.control-icon--restart::before {
    border: 3px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(var(--control-rgb), 0.72);
    content: "";
    height: 20px;
    width: 20px;
}

.control-icon--restart::after {
    border-left: 7px solid currentColor;
    border-bottom: 5px solid transparent;
    border-top: 5px solid transparent;
    content: "";
    position: absolute;
    right: 9px;
    top: 9px;
}

.overlay {
    align-items: center;
    background:
        radial-gradient(circle at 24% 20%, rgba(71, 231, 255, 0.2), transparent 29%),
        radial-gradient(circle at 78% 72%, rgba(255, 94, 196, 0.16), transparent 30%),
        linear-gradient(135deg, rgba(4, 7, 18, 0.97), rgba(4, 7, 18, 0.8));
    display: flex;
    inset: 0;
    justify-content: center;
    overflow: hidden;
    padding: clamp(14px, 2.6vh, 26px);
    position: absolute;
    z-index: 10;
}

.overlay-card {
    align-items: stretch;
    background:
        linear-gradient(135deg, rgba(13, 18, 39, 0.98), rgba(4, 7, 18, 0.92)),
        radial-gradient(circle at 14% 16%, rgba(71, 231, 255, 0.16), transparent 34%);
    border: 1px solid rgba(71, 231, 255, 0.38);
    border-radius: 10px;
    box-shadow:
        0 0 0 1px rgba(255, 209, 102, 0.08),
        0 0 44px rgba(71, 231, 255, 0.2),
        inset 0 0 30px rgba(2, 6, 23, 0.66);
    display: grid;
    gap: clamp(16px, 2vw, 24px);
    grid-template-columns: minmax(170px, 0.42fr) minmax(0, 1fr);
    max-height: calc(100% - 8px);
    max-width: 1000px;
    overflow: hidden;
    padding: clamp(18px, 2.4vh, 24px);
    position: relative;
    width: min(100%, 1000px);
}

.overlay-card::before {
    background: linear-gradient(90deg, transparent, rgba(255, 209, 102, 0.62), transparent);
    content: "";
    height: 1px;
    left: 8%;
    opacity: 0.78;
    position: absolute;
    right: 8%;
    top: 0;
}

.overlay-content {
    align-content: center;
    display: grid;
    min-width: 0;
}

.overlay-preview {
    display: block;
    filter: drop-shadow(0 0 24px rgba(71, 231, 255, 0.28));
    height: 100%;
    object-fit: contain;
    width: 100%;
}

.overlay-visual {
    aspect-ratio: 1;
    align-self: center;
    background:
        radial-gradient(circle at center, rgba(71, 231, 255, 0.09), transparent 58%),
        linear-gradient(180deg, rgba(71, 231, 255, 0.06), rgba(255, 94, 196, 0.04));
    border: 1px solid rgba(71, 231, 255, 0.2);
    border-radius: 10px;
    display: grid;
    max-height: 320px;
    min-width: 0;
    padding: clamp(12px, 2vw, 18px);
}

.overlay-mode {
    color: var(--pink);
    display: block;
    font: 900 11px/1.2 "SFMono-Regular", Consolas, monospace;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.overlay-card h2 {
    color: var(--cyan);
    font-size: clamp(30px, 4.4vw, 48px);
    line-height: 1.05;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.overlay-card p {
    color: var(--soft);
    line-height: 1.45;
    margin: 0 0 14px;
    max-width: 620px;
}

.overlay-stats,
.difficulty-select,
.mode-select {
    display: grid;
    gap: 7px;
    margin: 0 0 12px;
}

.overlay-stats {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.overlay-start .overlay-stats {
    display: none;
}

.difficulty-select {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mode-select {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.overlay-stats div,
.overlay-summary div,
.difficulty-select span,
.mode-select span {
    background:
        linear-gradient(180deg, rgba(71, 231, 255, 0.05), transparent),
        rgba(4, 7, 18, 0.66);
    border: 1px solid rgba(71, 231, 255, 0.24);
    border-radius: 7px;
    box-sizing: border-box;
    display: grid;
    height: 100%;
    min-height: 58px;
    min-width: 0;
    padding: 9px 8px;
}

.overlay-stats span,
.overlay-summary span,
.difficulty-select legend,
.mode-select legend {
    color: var(--muted);
    display: block;
    font: 900 10px/1 "SFMono-Regular", Consolas, monospace;
    text-transform: uppercase;
}

.overlay-stats strong,
.overlay-summary strong {
    color: var(--amber);
    display: block;
    font: 900 clamp(13px, 1.7vw, 18px)/1.1 "SFMono-Regular", Consolas, monospace;
    margin-top: 5px;
    overflow-wrap: anywhere;
}

.overlay-summary {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0 0 14px;
}

.overlay-summary div {
    border-color: rgba(255, 209, 102, 0.3);
}

.overlay-summary strong {
    color: var(--text);
}

.difficulty-select,
.mode-select {
    background:
        linear-gradient(180deg, rgba(71, 231, 255, 0.06), rgba(4, 7, 18, 0.2)),
        rgba(4, 7, 18, 0.24);
    border: 1px solid rgba(71, 231, 255, 0.16);
    border-radius: 9px;
    padding: 9px;
    position: relative;
}

.difficulty-select::before,
.mode-select::before {
    background: linear-gradient(90deg, rgba(255, 209, 102, 0.62), transparent);
    content: "";
    height: 1px;
    left: 9px;
    opacity: 0.72;
    position: absolute;
    right: 62%;
    top: 0;
}

.difficulty-select {
    margin-top: 2px;
}

.mode-select {
    margin-bottom: 14px;
}

.difficulty-select legend,
.mode-select legend {
    background: rgba(4, 7, 18, 0.86);
    border: 1px solid rgba(255, 209, 102, 0.24);
    border-radius: 999px;
    color: var(--amber);
    grid-column: 1 / -1;
    margin-bottom: 8px;
    padding: 4px 8px;
    width: fit-content;
}

.difficulty-select label,
.mode-select label {
    cursor: pointer;
    display: block;
    min-width: 0;
}

.difficulty-select input,
.mode-select input {
    inline-size: 1px;
    opacity: 0;
    position: absolute;
}

.difficulty-select input:checked + span,
.mode-select input:checked + span {
    background:
        linear-gradient(180deg, rgba(255, 209, 102, 0.24), rgba(255, 94, 196, 0.12) 44%, rgba(4, 7, 18, 0.92)),
        rgba(4, 7, 18, 0.9);
    border-color: rgba(255, 209, 102, 0.7);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.04),
        inset 0 -8px 18px rgba(255, 209, 102, 0.08),
        0 0 18px rgba(255, 209, 102, 0.18),
        0 0 22px rgba(255, 94, 196, 0.12);
    color: var(--amber);
}

.difficulty-select input:focus-visible + span,
.mode-select input:focus-visible + span {
    border-color: rgba(255, 209, 102, 0.82);
    box-shadow:
        0 0 0 2px rgba(4, 7, 18, 0.94),
        0 0 0 5px rgba(255, 209, 102, 0.52),
        0 0 22px rgba(255, 209, 102, 0.24);
}

.difficulty-select input:focus-visible:checked + span,
.mode-select input:focus-visible:checked + span {
    background: linear-gradient(135deg, rgba(255, 209, 102, 0.2), rgba(255, 94, 196, 0.14), rgba(4, 7, 18, 0.88));
}

.difficulty-select strong,
.mode-select strong {
    align-self: end;
    color: var(--text);
    display: block;
    font-size: 12px;
    line-height: 1.1;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.difficulty-select small,
.mode-select small {
    align-self: start;
    color: var(--muted);
    display: block;
    font: 800 9px/1.2 "SFMono-Regular", Consolas, monospace;
    margin-top: 4px;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.difficulty-select input:checked + span strong,
.mode-select input:checked + span strong {
    color: var(--amber);
    text-shadow: 0 0 12px rgba(255, 209, 102, 0.34);
}

.overlay-actions {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.overlay-card button {
    background: linear-gradient(135deg, rgba(255, 94, 196, 0.22), rgba(4, 7, 18, 0.88));
    border-color: rgba(255, 94, 196, 0.42);
    min-height: 44px;
    min-width: 132px;
}

.overlay-card button.button-secondary {
    background: linear-gradient(135deg, rgba(71, 231, 255, 0.14), rgba(4, 7, 18, 0.88));
    border-color: rgba(71, 231, 255, 0.38);
    color: var(--cyan);
}

.ship-dock-overlay {
    align-items: center;
    background:
        linear-gradient(rgba(71, 231, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 209, 102, 0.03) 1px, transparent 1px),
        radial-gradient(circle at 18% 14%, rgba(255, 209, 102, 0.18), transparent 30%),
        radial-gradient(circle at 82% 78%, rgba(71, 231, 255, 0.18), transparent 32%),
        linear-gradient(135deg, rgba(4, 7, 18, 0.95), rgba(4, 7, 18, 0.76));
    background-size: 42px 42px, 42px 42px, auto, auto, auto;
    display: flex;
    inset: 0;
    justify-content: center;
    padding: clamp(14px, 2.6vh, 24px);
    position: absolute;
    z-index: 13;
}

.ship-dock-card {
    background:
        linear-gradient(90deg, rgba(255, 209, 102, 0.1), transparent 18%, transparent 82%, rgba(71, 231, 255, 0.1)),
        linear-gradient(180deg, rgba(13, 18, 39, 0.98), rgba(4, 7, 18, 0.94)),
        radial-gradient(circle at 12% 12%, rgba(255, 209, 102, 0.12), transparent 34%);
    border: 1px solid rgba(255, 209, 102, 0.34);
    border-radius: 10px;
    box-shadow: 0 0 42px rgba(255, 209, 102, 0.15), inset 0 0 34px rgba(2, 6, 23, 0.72);
    display: grid;
    gap: 14px;
    max-height: calc(100% - 8px);
    max-width: 1080px;
    overflow: hidden;
    padding: clamp(14px, 2.2vh, 20px);
    position: relative;
    width: min(100%, 1080px);
}

.ship-dock-card::before {
    background: linear-gradient(90deg, transparent, rgba(255, 209, 102, 0.76), rgba(71, 231, 255, 0.46), transparent);
    content: "";
    height: 1px;
    left: 7%;
    opacity: 0.86;
    position: absolute;
    right: 7%;
    top: 0;
}

.ship-dock-header {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.ship-dock-header span,
.ship-dock-currency span,
.ship-card__meta span {
    color: var(--muted);
    display: block;
    font: 900 10px/1 "SFMono-Regular", Consolas, monospace;
    text-transform: uppercase;
}

.ship-dock-header h2 {
    color: var(--amber);
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1;
    margin: 4px 0 0;
    text-transform: uppercase;
}

.ship-dock-currency {
    background: linear-gradient(180deg, rgba(255, 209, 102, 0.12), rgba(4, 7, 18, 0.86));
    border: 1px solid rgba(255, 209, 102, 0.38);
    border-radius: 8px;
    min-width: 112px;
    padding: 10px 12px;
    text-align: right;
}

.ship-dock-currency strong {
    color: var(--amber);
    display: block;
    font: 900 20px/1 "SFMono-Regular", Consolas, monospace;
    margin-top: 5px;
}

.ship-dock-close {
    align-items: center;
    background:
        radial-gradient(circle at 34% 18%, rgba(255, 255, 255, 0.22), transparent 32%),
        linear-gradient(180deg, rgba(255, 94, 196, 0.26), rgba(4, 7, 18, 0.88) 58%, rgba(2, 5, 14, 0.98));
    border: 1px solid rgba(255, 94, 196, 0.48);
    border-radius: 999px;
    box-shadow:
        0 4px 0 rgba(2, 5, 14, 0.96),
        0 9px 16px rgba(2, 6, 23, 0.44),
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        inset 0 -9px 14px rgba(0, 0, 0, 0.24),
        0 0 18px rgba(255, 94, 196, 0.14);
    color: var(--pink);
    display: inline-grid;
    gap: 7px;
    grid-template-columns: 18px auto;
    min-height: 44px;
    min-width: 96px;
    padding: 10px 13px;
    text-transform: uppercase;
    transform: translateY(0);
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.ship-dock-close span {
    border: 1px solid rgba(255, 94, 196, 0.78);
    border-radius: 50%;
    box-shadow: inset 0 0 8px rgba(255, 94, 196, 0.18), 0 0 10px rgba(255, 94, 196, 0.24);
    display: block;
    height: 18px;
    position: relative;
    width: 18px;
}

.ship-dock-close span::before,
.ship-dock-close span::after {
    background: currentColor;
    border-radius: 999px;
    content: "";
    height: 2px;
    left: 4px;
    position: absolute;
    top: 7px;
    width: 8px;
}

.ship-dock-close span::before {
    transform: rotate(45deg);
}

.ship-dock-close span::after {
    transform: rotate(-45deg);
}

.ship-dock-close b {
    font: 950 10px/1 "SFMono-Regular", Consolas, monospace;
}

.ship-dock-close:hover,
.ship-dock-close:focus-visible {
    border-color: rgba(255, 209, 102, 0.72);
    box-shadow:
        0 5px 0 rgba(2, 5, 14, 0.96),
        0 0 0 2px rgba(4, 7, 18, 0.96),
        0 0 0 4px rgba(255, 209, 102, 0.34),
        0 0 22px rgba(255, 209, 102, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
    color: var(--amber);
    outline: 0;
    transform: translateY(-1px);
}

.ship-dock-close:active {
    box-shadow:
        0 2px 0 rgba(2, 5, 14, 0.96),
        0 4px 10px rgba(2, 6, 23, 0.42),
        inset 0 2px 8px rgba(0, 0, 0, 0.3);
    transform: translateY(3px);
}

.ship-dock-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-height: 0;
    overflow: auto;
    padding: 2px;
}

.ship-card {
    background:
        radial-gradient(circle at 16% 8%, rgba(255, 255, 255, 0.055), transparent 20%),
        linear-gradient(180deg, rgba(71, 231, 255, 0.08), transparent 38%),
        rgba(4, 7, 18, 0.76);
    border: 1px solid rgba(71, 231, 255, 0.26);
    border-radius: 8px;
    box-shadow:
        0 8px 0 rgba(2, 5, 14, 0.6),
        0 12px 22px rgba(2, 6, 23, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.055),
        inset 0 -18px 24px rgba(0, 0, 0, 0.16);
    display: block;
    min-width: 0;
    overflow: visible;
    padding: 0;
    perspective: 1200px;
    position: relative;
}

.ship-card::before {
    background:
        linear-gradient(180deg, rgba(255, 209, 102, 0.76), rgba(71, 231, 255, 0.18), transparent),
        radial-gradient(circle, rgba(255, 209, 102, 0.9), transparent 60%);
    content: "";
    inset: 10px auto 14px 9px;
    opacity: 0.58;
    position: absolute;
    width: 2px;
    z-index: 3;
}

.ship-card:focus-visible {
    border-color: rgba(255, 209, 102, 0.82);
    box-shadow:
        0 0 0 2px rgba(4, 7, 18, 0.96),
        0 0 0 5px rgba(255, 209, 102, 0.52),
        0 0 24px rgba(255, 209, 102, 0.22),
        inset 0 0 18px rgba(255, 209, 102, 0.08);
    outline: 0;
}

.ship-card.is-selected {
    border-color: rgba(255, 209, 102, 0.78);
    box-shadow:
        0 8px 0 rgba(2, 5, 14, 0.68),
        0 0 28px rgba(255, 209, 102, 0.22),
        inset 0 0 18px rgba(255, 209, 102, 0.1);
}

.ship-card.is-locked {
    border-color: rgba(255, 94, 196, 0.3);
}

.ship-card.is-expanded {
    border-color: rgba(255, 209, 102, 0.58);
}

.ship-card__status {
    background: linear-gradient(180deg, rgba(255, 209, 102, 0.16), rgba(4, 7, 18, 0.78));
    border: 1px solid rgba(255, 209, 102, 0.34);
    border-radius: 999px;
    color: var(--amber);
    font: 900 8px/1 "SFMono-Regular", Consolas, monospace;
    padding: 5px 8px;
    position: absolute;
    right: 10px;
    text-transform: uppercase;
    top: 10px;
    z-index: 2;
}

.ship-card.is-locked .ship-card__status {
    background: linear-gradient(180deg, rgba(255, 94, 196, 0.18), rgba(4, 7, 18, 0.82));
    border-color: rgba(255, 94, 196, 0.42);
    color: var(--pink);
}

.ship-card__flipper {
    min-height: 438px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 420ms cubic-bezier(0.2, 0.72, 0.22, 1);
}

.ship-card.is-expanded .ship-card__flipper {
    transform: rotateY(180deg);
}

.ship-card__face {
    backface-visibility: hidden;
    background:
        radial-gradient(circle at 16% 8%, rgba(255, 255, 255, 0.055), transparent 20%),
        linear-gradient(180deg, rgba(71, 231, 255, 0.08), transparent 38%),
        rgba(4, 7, 18, 0.76);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    inset: 0;
    overflow: hidden;
    padding: 12px;
    pointer-events: none;
    position: absolute;
    transform-style: preserve-3d;
}

.ship-card__face--front {
    pointer-events: auto;
}

.ship-card__face--back {
    background:
        radial-gradient(circle at 82% 12%, rgba(255, 209, 102, 0.12), transparent 32%),
        linear-gradient(180deg, rgba(255, 209, 102, 0.08), rgba(4, 7, 18, 0.88) 46%, rgba(2, 5, 14, 0.96));
    grid-template-rows: auto minmax(0, 1fr) auto;
    transform: rotateY(180deg);
}

.ship-card.is-expanded .ship-card__face--front {
    pointer-events: none;
}

.ship-card.is-expanded .ship-card__face--back {
    pointer-events: auto;
}

.ship-card__lock-plate {
    align-items: center;
    background:
        linear-gradient(180deg, rgba(255, 94, 196, 0.28), rgba(4, 7, 18, 0.82)),
        radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.16), transparent 44%);
    border: 1px solid rgba(255, 94, 196, 0.52);
    border-radius: 8px;
    box-shadow:
        0 4px 0 rgba(2, 5, 14, 0.84),
        0 0 18px rgba(255, 94, 196, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    color: var(--pink);
    display: inline-grid;
    gap: 5px;
    grid-template-columns: auto auto;
    left: 19px;
    padding: 6px 8px;
    position: absolute;
    top: 19px;
    z-index: 3;
}

.ship-card__lock-plate i {
    border: 2px solid currentColor;
    border-radius: 4px;
    display: block;
    height: 11px;
    position: relative;
    width: 12px;
}

.ship-card__lock-plate i::before {
    border: 2px solid currentColor;
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    content: "";
    height: 8px;
    left: 50%;
    position: absolute;
    top: -9px;
    transform: translateX(-50%);
    width: 10px;
}

.ship-card__lock-plate b {
    font: 900 8px/1 "SFMono-Regular", Consolas, monospace;
    text-transform: uppercase;
}

.ship-card__preview {
    align-items: center;
    aspect-ratio: 1.2;
    background:
        radial-gradient(circle at 50% 52%, rgba(71, 231, 255, 0.14), transparent 56%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(4, 7, 18, 0.72));
    border: 1px solid rgba(71, 231, 255, 0.18);
    border-radius: 8px;
    box-shadow:
        inset 0 0 20px rgba(2, 6, 23, 0.62),
        0 0 18px rgba(71, 231, 255, 0.08);
    display: grid;
    justify-items: center;
    overflow: hidden;
}

.ship-card__preview img {
    filter: drop-shadow(0 0 16px rgba(71, 231, 255, 0.28));
    height: 86%;
    max-width: 86%;
    object-fit: contain;
}

.ship-card h3 {
    color: var(--text);
    font: 900 15px/1.05 "SFMono-Regular", Consolas, monospace;
    margin: 0;
    padding-right: 52px;
    position: relative;
    text-transform: uppercase;
    z-index: 1;
}

.ship-card p {
    color: var(--soft);
    font-size: 12px;
    line-height: 1.35;
    margin: 0;
    position: relative;
    z-index: 1;
}

.ship-card__meta {
    display: grid;
    gap: 7px;
    grid-template-columns: 1fr 0.72fr;
    position: relative;
    z-index: 1;
}

.ship-card__meta div {
    background: rgba(4, 7, 18, 0.62);
    border: 1px solid rgba(71, 231, 255, 0.18);
    border-radius: 7px;
    min-width: 0;
    padding: 8px;
}

.ship-card__meta strong {
    color: var(--amber);
    display: block;
    font: 900 12px/1.15 "SFMono-Regular", Consolas, monospace;
    margin-top: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.ship-card__actions {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) minmax(72px, 0.48fr);
    position: relative;
    z-index: 1;
}

.ship-card__action {
    align-items: center;
    background:
        radial-gradient(circle at 34% 20%, rgba(255, 255, 255, 0.2), transparent 34%),
        linear-gradient(180deg, rgba(71, 231, 255, 0.28), rgba(4, 7, 18, 0.86) 58%, rgba(2, 5, 14, 0.96));
    border: 1px solid rgba(71, 231, 255, 0.46);
    border-radius: 999px;
    box-shadow:
        0 4px 0 rgba(2, 5, 14, 0.96),
        0 9px 16px rgba(2, 6, 23, 0.44),
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        inset 0 -9px 14px rgba(0, 0, 0, 0.24),
        0 0 18px rgba(71, 231, 255, 0.14);
    color: var(--cyan);
    display: inline-grid;
    font: 950 10px/1 "SFMono-Regular", Consolas, monospace;
    justify-content: center;
    min-height: 44px;
    min-width: 0;
    padding: 9px 11px;
    position: relative;
    text-transform: uppercase;
    transform: translateY(0);
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
    width: 100%;
}

.ship-card__action:hover,
.ship-card__action:focus-visible {
    border-color: rgba(255, 209, 102, 0.74);
    box-shadow:
        0 5px 0 rgba(2, 5, 14, 0.96),
        0 0 0 2px rgba(4, 7, 18, 0.96),
        0 0 0 4px rgba(255, 209, 102, 0.34),
        0 0 22px rgba(255, 209, 102, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
    outline: 0;
    transform: translateY(-1px);
}

.ship-card__action:active {
    box-shadow:
        0 2px 0 rgba(2, 5, 14, 0.96),
        0 4px 10px rgba(2, 6, 23, 0.42),
        inset 0 2px 8px rgba(0, 0, 0, 0.3);
    transform: translateY(3px);
}

.ship-card__primary {
    background:
        radial-gradient(circle at 34% 20%, rgba(255, 255, 255, 0.24), transparent 34%),
        linear-gradient(180deg, rgba(255, 209, 102, 0.34), rgba(255, 94, 196, 0.16) 46%, rgba(4, 7, 18, 0.92));
    border-color: rgba(255, 209, 102, 0.54);
    color: var(--amber);
}

.ship-card__primary--unlock {
    background:
        radial-gradient(circle at 34% 20%, rgba(255, 255, 255, 0.2), transparent 34%),
        linear-gradient(180deg, rgba(255, 94, 196, 0.32), rgba(141, 115, 255, 0.18) 52%, rgba(4, 7, 18, 0.92));
    border-color: rgba(255, 94, 196, 0.54);
    color: var(--pink);
}

.ship-card__details-button {
    background:
        radial-gradient(circle at 34% 20%, rgba(255, 255, 255, 0.14), transparent 34%),
        linear-gradient(180deg, rgba(71, 231, 255, 0.16), rgba(4, 7, 18, 0.88));
}

.ship-card__face--back .ship-card__actions {
    grid-template-columns: minmax(72px, 0.48fr) minmax(0, 1fr);
}

.ship-card__action[disabled] {
    cursor: default;
    opacity: 0.74;
}

.ship-card__action[disabled]:hover,
.ship-card__action[disabled]:focus-visible {
    box-shadow:
        0 4px 0 rgba(2, 5, 14, 0.96),
        0 9px 16px rgba(2, 6, 23, 0.44),
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        inset 0 -9px 14px rgba(0, 0, 0, 0.24),
        0 0 18px rgba(255, 209, 102, 0.14);
    outline: 0;
    transform: none;
}

.ship-card__details {
    background:
        linear-gradient(180deg, rgba(255, 209, 102, 0.075), rgba(4, 7, 18, 0.74)),
        rgba(4, 7, 18, 0.62);
    border: 1px solid rgba(255, 209, 102, 0.24);
    border-radius: 8px;
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 9px;
    position: relative;
    z-index: 1;
}

.ship-card__details-head {
    background:
        linear-gradient(90deg, rgba(255, 209, 102, 0.16), transparent),
        rgba(4, 7, 18, 0.58);
    border: 1px solid rgba(255, 209, 102, 0.24);
    border-radius: 8px;
    padding: 9px 10px;
    position: relative;
    z-index: 1;
}

.ship-card__details-head span {
    color: rgba(255, 209, 102, 0.86);
    display: block;
    font: 900 9px/1 "SFMono-Regular", Consolas, monospace;
    text-transform: uppercase;
}

.ship-card__details-head strong {
    color: var(--text);
    display: block;
    font: 950 15px/1.1 "SFMono-Regular", Consolas, monospace;
    margin-top: 6px;
    text-transform: uppercase;
}

.ship-card__details.hidden {
    display: none;
}

.ship-card__details div {
    background: rgba(2, 5, 14, 0.44);
    border: 1px solid rgba(71, 231, 255, 0.14);
    border-radius: 7px;
    min-width: 0;
    padding: 7px;
}

.ship-card__details .ship-card__details-wide {
    grid-column: 1 / -1;
}

.ship-card__details .ship-card__details-wide strong {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

.ship-card__details span {
    color: rgba(147, 164, 198, 0.88);
    display: block;
    font: 900 8px/1 "SFMono-Regular", Consolas, monospace;
    text-transform: uppercase;
}

.ship-card__details strong {
    color: var(--text);
    display: block;
    font: 900 10px/1.15 "SFMono-Regular", Consolas, monospace;
    margin-top: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.ship-card__details small {
    color: rgba(200, 215, 255, 0.72);
    display: -webkit-box;
    font: 800 9px/1.25 Inter, "Segoe UI", system-ui, sans-serif;
    margin-top: 5px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.help-overlay {
    align-items: center;
    background:
        radial-gradient(circle at 18% 16%, rgba(255, 209, 102, 0.18), transparent 28%),
        radial-gradient(circle at 82% 72%, rgba(255, 94, 196, 0.16), transparent 32%),
        linear-gradient(135deg, rgba(4, 7, 18, 0.94), rgba(4, 7, 18, 0.72));
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 18px;
    position: absolute;
    z-index: 12;
}

.help-card {
    background:
        linear-gradient(180deg, rgba(13, 18, 39, 0.98), rgba(4, 7, 18, 0.92)),
        linear-gradient(90deg, rgba(71, 231, 255, 0.12), rgba(255, 209, 102, 0.08));
    border: 1px solid rgba(255, 209, 102, 0.36);
    border-radius: 10px;
    box-shadow: 0 0 38px rgba(255, 209, 102, 0.16), inset 0 0 34px rgba(2, 6, 23, 0.62);
    display: grid;
    gap: 16px;
    max-width: 840px;
    overflow: hidden;
    padding: clamp(16px, 2.7vw, 24px);
    position: relative;
    width: min(94vw, 840px);
}

.help-card::before {
    background: linear-gradient(90deg, transparent, rgba(255, 209, 102, 0.75), transparent);
    content: "";
    height: 1px;
    left: 12%;
    position: absolute;
    right: 12%;
    top: 0;
}

.help-header,
.help-controls {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.help-header span {
    color: var(--amber);
    font: 950 11px/1 "SFMono-Regular", Consolas, monospace;
    text-transform: uppercase;
}

.help-header button,
.help-controls button {
    background: rgba(4, 7, 18, 0.82);
    border: 1px solid rgba(71, 231, 255, 0.32);
    border-radius: 7px;
    color: var(--cyan);
    cursor: pointer;
    font: 900 11px/1 "SFMono-Regular", Consolas, monospace;
    min-height: 44px;
    min-width: 44px;
    padding: 10px 12px;
    text-transform: uppercase;
}

.help-controls button:disabled {
    cursor: default;
    opacity: 0.42;
}

.help-slide {
    animation: helpSlideIn 0.32s ease both;
    display: grid;
    gap: clamp(16px, 3vw, 26px);
    grid-template-columns: minmax(210px, 0.78fr) minmax(270px, 1fr);
    min-height: 328px;
}

.help-visual {
    align-items: center;
    background:
        linear-gradient(rgba(71, 231, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(141, 115, 255, 0.08) 1px, transparent 1px),
        radial-gradient(circle at center, rgba(71, 231, 255, 0.14), transparent 58%),
        rgba(4, 7, 18, 0.62);
    background-size: 28px 28px, 28px 28px, auto, auto;
    border: 1px solid rgba(71, 231, 255, 0.28);
    border-radius: 10px;
    box-shadow: inset 0 0 24px rgba(2, 6, 23, 0.76);
    display: grid;
    justify-items: center;
    min-height: 278px;
    overflow: hidden;
    position: relative;
}

.help-visual::before {
    background: linear-gradient(90deg, transparent, rgba(255, 209, 102, 0.42), transparent);
    content: "";
    height: 1px;
    left: 12%;
    opacity: 0.72;
    position: absolute;
    right: 12%;
    top: 18px;
}

.help-visual::after {
    background: radial-gradient(circle, rgba(71, 231, 255, 0.42), transparent 62%);
    border: 1px solid rgba(71, 231, 255, 0.32);
    border-radius: 50%;
    content: "";
    height: 8px;
    position: absolute;
    right: 18px;
    top: 15px;
    width: 8px;
}

.help-ship {
    border-left: 22px solid transparent;
    border-right: 22px solid transparent;
    border-bottom: 58px solid var(--cyan);
    filter: drop-shadow(0 0 18px rgba(71, 231, 255, 0.88)) drop-shadow(0 8px 14px rgba(2, 6, 23, 0.68));
    transform: rotate(25deg);
    z-index: 1;
}

.help-ring {
    border: 2px solid rgba(255, 209, 102, 0.6);
    border-radius: 50%;
    box-shadow: 0 0 18px rgba(255, 209, 102, 0.32);
    height: 138px;
    position: absolute;
    width: 138px;
}

.help-vector {
    align-items: center;
    background: rgba(4, 7, 18, 0.86);
    border: 1px solid rgba(255, 209, 102, 0.46);
    border-radius: 999px;
    color: var(--amber);
    display: grid;
    font: 950 11px/1 "SFMono-Regular", Consolas, monospace;
    height: 32px;
    justify-items: center;
    position: absolute;
    top: 48px;
    width: 32px;
}

.help-vector--left {
    left: 48px;
}

.help-vector--right {
    right: 48px;
}

.help-thrust-flame {
    background: linear-gradient(180deg, rgba(255, 209, 102, 0.95), rgba(255, 94, 196, 0.18), transparent);
    border-radius: 999px;
    filter: blur(0.2px) drop-shadow(0 0 14px rgba(255, 209, 102, 0.72));
    height: 78px;
    position: absolute;
    transform: translate(24px, 66px) rotate(25deg);
    width: 18px;
}

.help-shot {
    background: var(--pink);
    border-radius: 999px;
    box-shadow: 0 0 14px rgba(255, 94, 196, 0.82);
    height: 7px;
    position: absolute;
    transform: rotate(25deg);
    width: 42px;
}

.help-shot--one {
    right: 54px;
    top: 78px;
}

.help-shot--two {
    right: 86px;
    top: 114px;
    width: 28px;
}

.help-visual--touch {
    align-content: center;
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(3, minmax(58px, 72px));
    justify-content: center;
}

.touch-pad,
.help-visual--modes span {
    align-items: center;
    background: linear-gradient(180deg, rgba(71, 231, 255, 0.24), rgba(4, 7, 18, 0.9));
    border: 1px solid rgba(71, 231, 255, 0.48);
    border-radius: 10px;
    box-shadow: 0 7px 0 rgba(2, 5, 14, 0.9), 0 0 18px rgba(71, 231, 255, 0.16);
    color: var(--text);
    display: grid;
    gap: 4px;
    height: 66px;
    justify-items: center;
    padding: 8px 6px;
}

.touch-pad i {
    display: block;
    height: 20px;
    position: relative;
    width: 26px;
}

.touch-pad b,
.obstacle-node b,
.help-visual--modes b,
.help-visual--modes small {
    font-family: "SFMono-Regular", Consolas, monospace;
    line-height: 1;
    text-transform: uppercase;
}

.touch-pad b {
    color: rgba(245, 251, 255, 0.9);
    font-size: 8px;
}

.touch-pad--left i::before,
.touch-pad--right i::before {
    border-bottom: 10px solid transparent;
    border-top: 10px solid transparent;
    content: "";
    filter: drop-shadow(0 0 10px rgba(71, 231, 255, 0.74));
    position: absolute;
    top: 0;
}

.touch-pad--left i::before {
    border-right: 18px solid var(--cyan);
    left: 2px;
}

.touch-pad--right i::before {
    border-left: 18px solid var(--cyan);
    right: 2px;
}

.touch-pad--thrust {
    border-color: rgba(255, 209, 102, 0.56);
    box-shadow: 0 7px 0 rgba(2, 5, 14, 0.9), 0 0 18px rgba(255, 209, 102, 0.18);
}

.touch-pad--thrust i::before {
    border-left: 11px solid transparent;
    border-right: 11px solid transparent;
    border-bottom: 21px solid var(--amber);
    content: "";
    filter: drop-shadow(0 0 10px rgba(255, 209, 102, 0.82));
    position: absolute;
}

.touch-pad--fire i::before {
    background: var(--pink);
    border-radius: 50%;
    box-shadow: 0 0 0 6px rgba(255, 94, 196, 0.16), 0 0 16px rgba(255, 94, 196, 0.86);
    content: "";
    height: 17px;
    left: 5px;
    position: absolute;
    top: 2px;
    width: 17px;
}

.touch-pad--ability {
    border-color: rgba(255, 209, 102, 0.58);
    box-shadow: 0 7px 0 rgba(2, 5, 14, 0.9), 0 0 18px rgba(255, 209, 102, 0.18);
}

.touch-pad--ability i::before {
    background: conic-gradient(from -90deg, var(--amber) 0 76%, rgba(255, 255, 255, 0.14) 0);
    border: 1px solid rgba(255, 244, 190, 0.8);
    border-radius: 50%;
    box-shadow: 0 0 0 5px rgba(255, 209, 102, 0.14), 0 0 16px rgba(255, 209, 102, 0.74);
    content: "";
    height: 19px;
    left: 4px;
    position: absolute;
    top: 1px;
    width: 19px;
}

.touch-pad--pause i::before,
.touch-pad--pause i::after {
    background: var(--violet);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(141, 115, 255, 0.78);
    content: "";
    height: 20px;
    position: absolute;
    top: 0;
    width: 6px;
}

.touch-pad--pause i::before {
    left: 6px;
}

.touch-pad--pause i::after {
    right: 6px;
}

.touch-pad--fire,
.touch-pad--pause {
    grid-column: span 1;
}

.help-visual--threats .rock {
    background:
        radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.24), transparent 16%),
        radial-gradient(circle at 70% 62%, rgba(71, 231, 255, 0.2), transparent 34%),
        rgba(71, 231, 255, 0.14);
    border: 2px solid rgba(71, 231, 255, 0.74);
    border-radius: 44% 56% 48% 52%;
    box-shadow: 0 0 18px rgba(71, 231, 255, 0.28);
    position: absolute;
}

.threat-path {
    border: 1px dashed rgba(255, 209, 102, 0.42);
    border-radius: 50%;
    height: 178px;
    position: absolute;
    transform: rotate(-18deg);
    width: 220px;
}

.rock-large {
    height: 96px;
    left: 28%;
    top: 26%;
    width: 96px;
}

.rock-small {
    height: 50px;
    right: 22%;
    top: 52%;
    width: 50px;
}

.power-node {
    align-items: center;
    background: rgba(4, 7, 18, 0.9);
    border: 2px solid var(--amber);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(255, 209, 102, 0.5);
    color: var(--amber);
    display: grid;
    font: 950 28px/1 "SFMono-Regular", Consolas, monospace;
    height: 52px;
    justify-items: center;
    position: absolute;
    right: 28%;
    top: 28%;
    width: 52px;
}

.split-line {
    background: linear-gradient(90deg, transparent, rgba(255, 209, 102, 0.85), transparent);
    height: 2px;
    position: absolute;
    transform-origin: left center;
    width: 86px;
}

.split-line--one {
    left: 44%;
    top: 45%;
    transform: rotate(26deg);
}

.split-line--two {
    left: 43%;
    top: 50%;
    transform: rotate(-18deg);
}

.help-visual--obstacles {
    align-content: center;
    display: grid;
    justify-content: center;
}

.obstacle-orbit {
    border: 1px dashed rgba(255, 209, 102, 0.4);
    border-radius: 50%;
    height: 188px;
    position: absolute;
    width: 188px;
}

.obstacle-node {
    align-items: center;
    background:
        radial-gradient(circle at 50% 24%, rgba(255, 255, 255, 0.14), transparent 36%),
        rgba(4, 7, 18, 0.88);
    border: 1px solid rgba(71, 231, 255, 0.28);
    border-radius: 11px;
    box-shadow: 0 8px 0 rgba(2, 5, 14, 0.88), 0 0 18px rgba(71, 231, 255, 0.14);
    display: grid;
    gap: 6px;
    justify-items: center;
    min-height: 68px;
    padding: 8px;
    position: absolute;
    width: 78px;
}

.obstacle-node img {
    display: block;
    height: 34px;
    object-fit: contain;
    width: 46px;
}

.obstacle-node b {
    color: rgba(245, 251, 255, 0.86);
    font-size: 8px;
}

.obstacle-node--blackhole {
    border-color: rgba(141, 115, 255, 0.62);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.obstacle-node--blackhole img {
    filter: drop-shadow(0 0 14px rgba(141, 115, 255, 0.86));
}

.obstacle-node--starlight {
    right: 24px;
    top: 38px;
}

.obstacle-node--starlight img {
    filter: drop-shadow(0 0 12px rgba(255, 209, 102, 0.82));
}

.obstacle-node--ice {
    left: 24px;
    top: 48px;
}

.obstacle-node--ice img {
    filter: drop-shadow(0 0 12px rgba(71, 231, 255, 0.78));
}

.obstacle-node--crystal {
    bottom: 34px;
    left: 38px;
}

.obstacle-node--crystal img {
    filter: drop-shadow(0 0 12px rgba(93, 255, 177, 0.78));
}

.obstacle-node--volatile {
    bottom: 34px;
    right: 38px;
}

.obstacle-node--volatile img {
    filter: drop-shadow(0 0 13px rgba(255, 94, 48, 0.84));
}

.help-visual--modes {
    align-content: center;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, 82px);
    justify-content: center;
}

.help-visual--modes span {
    align-items: center;
    color: var(--amber);
    display: grid;
    gap: 5px;
    grid-template-rows: 1fr auto;
    height: 66px;
    justify-items: center;
    width: 82px;
}

.help-visual--modes b {
    color: var(--amber);
    font-size: 17px;
}

.help-visual--modes small {
    color: rgba(200, 215, 255, 0.72);
    font-size: 8px;
}

.help-visual--dock {
    align-content: center;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, 92px);
    justify-content: center;
}

.dock-rail {
    background:
        linear-gradient(90deg, transparent, rgba(255, 209, 102, 0.68), transparent),
        linear-gradient(180deg, rgba(71, 231, 255, 0.18), rgba(4, 7, 18, 0.82));
    border: 1px solid rgba(255, 209, 102, 0.34);
    border-radius: 999px;
    grid-column: 1 / -1;
    height: 12px;
    justify-self: stretch;
}

.dock-card {
    background: linear-gradient(180deg, rgba(71, 231, 255, 0.12), rgba(4, 7, 18, 0.84));
    border: 1px solid rgba(71, 231, 255, 0.32);
    border-radius: 8px;
    box-shadow: inset 0 0 16px rgba(2, 6, 23, 0.62);
    display: grid;
    gap: 6px;
    height: 78px;
    justify-items: center;
    padding: 10px;
}

.dock-card--active {
    border-color: rgba(255, 209, 102, 0.72);
    box-shadow: 0 0 18px rgba(255, 209, 102, 0.18), inset 0 0 16px rgba(2, 6, 23, 0.62);
}

.dock-card--locked {
    border-color: rgba(255, 94, 196, 0.42);
    opacity: 0.82;
}

.dock-card b,
.dock-credit,
.dock-ability {
    color: var(--amber);
    font: 950 13px/1 "SFMono-Regular", Consolas, monospace;
    text-transform: uppercase;
}

.dock-card small {
    color: rgba(200, 215, 255, 0.72);
    font: 850 9px/1 "SFMono-Regular", Consolas, monospace;
    text-transform: uppercase;
}

.dock-credit,
.dock-ability {
    align-items: center;
    background: rgba(4, 7, 18, 0.82);
    border: 1px solid rgba(255, 209, 102, 0.46);
    border-radius: 50%;
    bottom: 32px;
    display: grid;
    height: 42px;
    justify-items: center;
    position: absolute;
    width: 42px;
}

.dock-credit {
    left: 38px;
}

.dock-ability {
    box-shadow: 0 0 18px rgba(255, 209, 102, 0.28);
    right: 38px;
}

.help-copy h2 {
    color: var(--cyan);
    font-size: clamp(28px, 4.4vw, 44px);
    line-height: 1;
    margin: 0 0 16px;
    text-transform: uppercase;
}

.help-grid {
    display: grid;
    gap: 10px;
}

.help-grid div {
    background: linear-gradient(90deg, rgba(71, 231, 255, 0.1), rgba(4, 7, 18, 0.72));
    border: 1px solid rgba(71, 231, 255, 0.24);
    border-radius: 8px;
    padding: 12px;
}

.help-grid span {
    color: var(--amber);
    display: block;
    font: 950 10px/1 "SFMono-Regular", Consolas, monospace;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.help-grid strong {
    color: var(--text);
    font-size: 14px;
    line-height: 1.25;
}

.help-dots {
    display: flex;
    gap: 7px;
}

.help-dots button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    height: 44px;
    justify-items: center;
    min-height: 44px;
    min-width: 44px;
    padding: 0;
    width: 44px;
}

.help-dots button::before {
    background: rgba(71, 231, 255, 0.24);
    border-radius: 50%;
    content: "";
    height: 9px;
    width: 9px;
}

.help-dots button[aria-current="true"] {
    background: transparent;
    box-shadow: none;
}

.help-dots button[aria-current="true"]::before {
    background: var(--amber);
    box-shadow: 0 0 12px rgba(255, 209, 102, 0.72);
}

.overlay-paused .overlay-card {
    border-color: rgba(255, 209, 102, 0.55);
    box-shadow: 0 0 42px rgba(255, 209, 102, 0.18), inset 0 0 28px rgba(2, 6, 23, 0.72);
    max-width: 760px;
}

.overlay-paused .difficulty-select,
.overlay-paused .mode-select {
    display: none;
}

.overlay-paused .overlay-mode {
    color: var(--amber);
}

.overlay-paused .overlay-stats div {
    border-color: rgba(255, 209, 102, 0.32);
}

.overlay-end .overlay-summary {
    display: grid;
}

.overlay-end .overlay-card {
    border-color: rgba(255, 94, 196, 0.56);
    box-shadow: 0 0 44px rgba(255, 94, 196, 0.2), inset 0 0 34px rgba(2, 6, 23, 0.72);
}

.overlay-end .overlay-mode {
    color: var(--amber);
}

.overlay-end .overlay-card h2 {
    color: var(--pink);
    text-shadow: 0 0 18px rgba(255, 94, 196, 0.42);
}

.overlay-end .overlay-card {
    height: min(100%, 640px);
}

.overlay-end .overlay-content {
    align-content: stretch;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(0, 1fr);
    min-height: 0;
}

.overlay-end .overlay-mode,
.overlay-end .overlay-card h2,
.overlay-end .overlay-card p,
.overlay-end .overlay-actions,
.overlay-end .overlay-summary {
    grid-column: 1;
}

.overlay-end .overlay-stats,
.overlay-end .difficulty-select,
.overlay-end .mode-select,
.overlay-end .overlay-card p {
    display: none;
}

.overlay-end .overlay-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 0 8px;
}

.overlay-end .overlay-summary {
    align-content: start;
    border: 1px solid rgba(255, 209, 102, 0.18);
    border-radius: 9px;
    box-shadow: inset 0 0 18px rgba(2, 6, 23, 0.5);
    margin: 0;
    min-height: 0;
    overflow-y: auto;
    padding: 6px;
    scrollbar-color: rgba(255, 209, 102, 0.52) rgba(4, 7, 18, 0.62);
    scrollbar-width: thin;
}

.overlay-end .overlay-summary {
    gap: 5px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.overlay-end .overlay-summary div {
    min-height: 44px;
    padding: 6px;
}

.overlay-end .overlay-summary span {
    font-size: 8px;
}

.overlay-end .overlay-summary strong {
    font-size: clamp(11px, 1.2vw, 14px);
    margin-top: 4px;
}

.overlay-end .overlay-summary::-webkit-scrollbar {
    width: 8px;
}

.overlay-end .overlay-summary::-webkit-scrollbar-track {
    background: rgba(4, 7, 18, 0.62);
    border-radius: 999px;
}

.overlay-end .overlay-summary::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(255, 209, 102, 0.78), rgba(255, 94, 196, 0.58));
    border-radius: 999px;
}

@keyframes countdownPop {
    0% { opacity: 0; transform: scale(0.72) rotate(-5deg); }
    55% { opacity: 1; transform: scale(1.08) rotate(2deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes bestHudPulse {
    0% { box-shadow: 0 0 0 rgba(255, 209, 102, 0); transform: translateY(0); }
    40% { box-shadow: 0 0 24px rgba(255, 209, 102, 0.46); transform: translateY(-1px); }
    100% { box-shadow: 0 0 10px rgba(255, 209, 102, 0.12); transform: translateY(0); }
}

@keyframes helpSlideIn {
    0% { opacity: 0; transform: translateX(18px) scale(0.98); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}

@media (max-width: 780px) {
    .game-shell { padding: 8px; }
    .game-topbar { gap: 8px; grid-template-columns: auto 1fr; padding: 7px 10px; }
    .back-link, .game-title { grid-row: 1; }
    .scoreboard { grid-column: 1 / -1; justify-content: space-between; }
    .scoreboard div { flex: 1; min-width: 0; padding: 5px 7px; }
    .play-layout { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
    .side-panel { grid-template-columns: repeat(4, minmax(0, 1fr)); order: 2; padding: 8px; }
    .side-panel::before { inset: 8px 12px auto; height: 2px; width: auto; }
    .side-panel__header { grid-column: 1 / -1; padding-left: 0; text-align: center; }
    .run-stat { min-height: 76px; padding: 9px 9px 10px; }
    .run-stat::before { height: 8px; right: 8px; top: 8px; width: 8px; }
    .run-stat::after { bottom: 6px; left: 9px; right: 9px; }
    .stage-frame { height: auto; max-height: calc(100dvh - 340px); }
    .controls { gap: 8px; grid-template-columns: minmax(0, 5fr) minmax(66px, 0.9fr); padding: 10px 10px 14px; }
    .flight-controls { gap: 6px; grid-template-columns: repeat(6, minmax(0, 1fr)); padding: 6px; }
    .system-controls { padding: 6px; }
    .system-controls::before { display: none; }
    .control-button { grid-template-rows: 36px auto; min-height: 68px; min-width: 0; padding: 7px 5px 8px; }
    .control-icon { height: 36px; width: 36px; }
    .overlay-card { grid-template-columns: 1fr; max-height: calc(100% - 8px); max-width: 560px; overflow-y: auto; text-align: center; }
    .overlay-content { align-content: start; }
    .overlay-visual { display: none; }
    .help-slide { grid-template-columns: 1fr; min-height: 0; }
    .help-visual { min-height: 160px; }
}

@media (max-height: 660px) {
    .overlay {
        padding: 10px;
    }

    .overlay-card {
        gap: 14px;
        padding: 14px;
    }

    .overlay-card h2 {
        font-size: clamp(28px, 4vw, 38px);
        margin-bottom: 6px;
    }

    .overlay-card p {
        line-height: 1.35;
        margin-bottom: 10px;
    }

    .overlay-mode,
    .difficulty-select legend,
    .mode-select legend {
        margin-bottom: 6px;
    }

    .overlay-stats,
    .difficulty-select,
    .mode-select,
    .overlay-summary {
        gap: 6px;
        margin-bottom: 9px;
    }

    .overlay-stats div,
    .overlay-summary div,
    .difficulty-select span,
    .mode-select span {
        padding: 6px;
    }

    .difficulty-select small,
    .mode-select small {
        display: none;
    }

    .difficulty-select,
    .mode-select {
        padding: 7px;
    }

    .difficulty-select strong,
    .mode-select strong {
        font-size: 10px;
    }

    .overlay-card button {
        padding-block: 9px;
    }
}

@media (max-width: 780px) and (max-height: 660px) {
    .overlay-content {
        align-content: center;
        column-gap: 10px;
        display: grid;
        grid-template-columns: minmax(142px, 0.55fr) minmax(0, 1fr);
    }

    .overlay-mode,
    .overlay-card h2,
    .overlay-card p,
    .overlay-actions {
        grid-column: 1;
    }

    .difficulty-select,
    .mode-select {
        grid-column: 2;
    }

    .difficulty-select {
        grid-row: 1 / span 3;
    }

    .mode-select {
        grid-row: 4 / span 3;
        margin-bottom: 0;
    }

    .overlay-card h2 {
        font-size: 27px;
    }

    .overlay-card p {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .overlay-actions {
        align-self: end;
        gap: 7px;
    }
}

@media (max-width: 560px) {
    .game-shell { padding: 6px; }
    .game-panel { border-radius: 8px; max-width: min(430px, calc(100dvw - 12px)); width: min(430px, calc(100dvw - 12px)); }
    .game-title h1 { font-size: 18px; }
    .game-title p { font-size: 10px; }
    .scoreboard strong { font-size: 17px; }
    .arena-wrap { padding: 8px; }
    .stage-frame { max-height: calc(100dvh - 380px); }
    .controls { grid-template-columns: minmax(0, 5fr) minmax(56px, 0.8fr); gap: 6px; padding: 8px 7px 12px; }
    .controls .controls-toggle { height: 24px; min-width: 76px; padding: 0 9px; top: -12px; }
    .controls.is-collapsed { min-height: 40px; padding: 14px 7px 9px; }
    .controls.is-collapsed .controls-toggle { top: 8px; }
    .flight-controls { gap: 5px; padding: 5px; }
    .system-controls { padding: 5px; }
    .controls button { font-size: 10px; padding: 7px 4px; }
    .control-button { border-radius: 10px; grid-template-rows: 32px auto; min-height: 62px; }
    .control-icon { height: 32px; transform: none; width: 32px; }
    .control-label { font-size: 9px; }
    .control-sub { display: none; }
    .control-icon--left::before { border-bottom-width: 7px; border-right-width: 13px; border-top-width: 7px; }
    .control-icon--right::before { border-bottom-width: 7px; border-left-width: 13px; border-top-width: 7px; }
    .control-icon--thrust::before { border-bottom-width: 15px; border-left-width: 8px; border-right-width: 8px; }
    .control-icon--pause::before,
    .control-icon--pause::after { height: 15px; top: 8px; width: 4px; }
    .control-icon--pause::before { left: 10px; }
    .control-icon--pause::after { right: 10px; }
    .side-panel { gap: 6px; }
    .side-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .side-panel__header { display: none; }
    .run-stat { gap: 3px; min-height: 66px; padding: 8px 7px 9px; }
    .run-stat span, .run-stat small { font-size: 8px; }
    .run-stat span { padding-right: 12px; }
    .run-stat strong { font-size: 21px; margin: 0; }
    .run-stat--special strong { font-size: 16px; }
    .overlay { padding: 10px; }
    .overlay-card { gap: 12px; max-height: calc(100% - 8px); max-width: min(382px, calc(100dvw - 32px)); padding: 14px; width: min(382px, calc(100dvw - 32px)); }
    .overlay-card h2 { font-size: 30px; margin-bottom: 8px; }
    .overlay-card p { font-size: 14px; line-height: 1.35; margin-bottom: 12px; }
    .overlay-stats, .overlay-summary, .mode-select { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 10px; }
    .difficulty-select { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 10px; }
    .overlay-stats div, .overlay-summary div, .difficulty-select span, .mode-select span { padding: 8px 6px; }
    .difficulty-select small, .mode-select small { display: none; }
    .overlay-actions { grid-template-columns: 1fr; }
    .help-overlay { padding: 10px; }
    .help-card { gap: 12px; max-height: calc(100dvh - 26px); overflow-y: auto; padding: 14px; width: min(360px, calc(100dvw - 20px)); }
    .help-copy h2 { font-size: 26px; margin-bottom: 10px; }
    .help-grid { gap: 7px; }
    .help-grid div { padding: 9px; }
    .help-visual { min-height: 120px; }
    .help-controls button, .help-header button { padding: 9px 10px; }
}

.overlay-end .overlay-card {
    overflow: hidden;
}

@media (max-width: 780px) {
    .overlay-end .overlay-card {
        height: min(100%, 620px);
        overflow: hidden;
        text-align: left;
    }

    .overlay-end .overlay-content {
        align-content: stretch;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto minmax(0, 1fr);
        min-height: 0;
    }

    .overlay-end .overlay-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .overlay-end .overlay-card {
        height: calc(100% - 8px);
    }

    .overlay-end .overlay-actions {
        gap: 7px;
        grid-template-columns: 1fr;
    }

    .overlay-end .overlay-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
