:root {
    --panel: rgba(15, 23, 42, 0.78);
    --text: #e5e7eb;
    --soft: #cbd5f5;
    --muted: #94a3b8;
    --cyan: #38bdf8;
    --green: #22c55e;
    --purple: #a78bfa;
    --amber: #f59e0b;
    --red: #ef4444;
    --border: rgba(56, 189, 248, 0.28);
    --shadow: rgba(56, 189, 248, 0.18);
    --flappy-accent-glow: rgba(245, 158, 11, 0.28);
}

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

.visually-hidden {
    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 16% 12%, rgba(56, 189, 248, 0.13), transparent 28%),
        radial-gradient(circle at 84% 16%, rgba(167, 139, 250, 0.13), transparent 26%),
        radial-gradient(circle at 50% 92%, rgba(245, 158, 11, 0.12), transparent 30%),
        linear-gradient(180deg, #020617 0%, #050816 52%, #020617 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: 620px;
    overflow: hidden;
    padding: clamp(8px, 2.2vh, 24px);
    width: 100%;
}

.game-panel {
    background: var(--panel);
    border: 1px solid rgba(245, 158, 11, 0.32);
    border-radius: 10px;
    box-shadow: 0 0 42px var(--shadow), 0 0 24px var(--flappy-accent-glow), inset 0 0 36px rgba(2, 6, 23, 0.42);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    margin: 0 auto;
    max-height: calc(100dvh - clamp(16px, 4.4vh, 48px));
    max-width: 1040px;
    min-width: 0;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.game-topbar {
    align-items: center;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(2, 6, 23, 0.86)), linear-gradient(90deg, rgba(245, 158, 11, 0.15), transparent 42%, rgba(56, 189, 248, 0.1));
    border-bottom: 1px solid rgba(245, 158, 11, 0.28);
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(220px, 0.82fr) minmax(360px, 1.18fr);
    min-width: 0;
    padding: 14px 18px;
}

.game-topbar.milestone-highlight,
.game-topbar.charge-highlight,
.game-topbar.best-highlight {
    animation: milestone-topbar 0.95s ease both;
}

.game-topbar.charge-highlight {
    animation-name: charge-topbar;
}

.game-topbar.best-highlight {
    animation-duration: 1.15s;
    animation-name: best-topbar;
}

.controls button,
.overlay-card button {
    background: rgba(2, 6, 23, 0.78);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--cyan);
    cursor: pointer;
    font: 700 12px/1 Inter, "Segoe UI", system-ui, sans-serif;
    letter-spacing: 0;
    padding: 10px 12px;
    text-decoration: none;
}

.controls button:hover,
.overlay-card button:hover,
.controls button:focus-visible,
.overlay-card button:focus-visible {
    box-shadow: 0 0 16px var(--shadow), 0 0 12px var(--flappy-accent-glow);
    outline: 1px solid var(--cyan);
}

.overlay-card button:focus-visible,
.controls button:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 3px;
}

.mission-readout {
    background:
        radial-gradient(circle at 14% 0%, rgba(56, 189, 248, 0.14), transparent 58%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.52), rgba(2, 6, 23, 0.46));
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 8px;
    box-shadow: inset 0 0 18px rgba(2, 6, 23, 0.6), 0 0 16px rgba(56, 189, 248, 0.08);
    display: grid;
    gap: 5px;
    min-width: 0;
    overflow: hidden;
    padding: 10px 12px 11px;
    position: relative;
}

.mission-readout::before {
    background: var(--cyan);
    border-radius: 999px;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
    content: "";
    height: 5px;
    left: 10px;
    position: absolute;
    top: 10px;
    width: 5px;
}

.mission-readout span {
    color: rgba(203, 213, 245, 0.78);
    display: block;
    font: 800 9px/1 "SFMono-Regular", Consolas, monospace;
    letter-spacing: 0;
    padding-left: 14px;
    text-transform: uppercase;
}

.mission-readout strong {
    color: #e0f2fe;
    display: block;
    font: 900 15px/1.05 "SFMono-Regular", Consolas, monospace;
    overflow: hidden;
    padding-left: 14px;
    text-overflow: ellipsis;
    text-shadow: 0 0 12px rgba(56, 189, 248, 0.28);
    text-transform: uppercase;
    white-space: nowrap;
}

.mission-progress-row {
    align-items: center;
    display: grid;
    gap: 9px;
    grid-template-columns: auto minmax(0, 1fr);
}

.mission-progress-row small {
    color: #d9f99d;
    font: 900 12px/1 "SFMono-Regular", Consolas, monospace;
    min-width: 44px;
    text-align: right;
}

.mission-track {
    background: rgba(2, 6, 23, 0.82);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 999px;
    box-shadow: inset 0 0 10px rgba(2, 6, 23, 0.75);
    height: 6px;
    overflow: hidden;
}

.mission-track i {
    background: linear-gradient(90deg, var(--cyan), var(--green));
    border-radius: inherit;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.44);
    display: block;
    height: 100%;
    transition: width 0.2s ease;
    width: 0%;
}

.mission-readout[data-status="clear"] .mission-track i {
    background: linear-gradient(90deg, var(--amber), #facc15);
}

.mission-readout[data-status="missed"] .mission-track i,
.mission-readout[data-status="missed"]::before {
    background: var(--red);
}

.mission-readout.mission-pulse {
    box-shadow: inset 0 0 18px rgba(2, 6, 23, 0.6), 0 0 20px rgba(245, 158, 11, 0.13);
}

.scoreboard {
    align-items: stretch;
    background:
        linear-gradient(180deg, rgba(2, 6, 23, 0.78), rgba(15, 23, 42, 0.54)),
        repeating-linear-gradient(90deg, rgba(56, 189, 248, 0.09) 0 1px, transparent 1px 9px);
    border: 1px solid rgba(56, 189, 248, 0.24);
    border-radius: 8px;
    box-shadow: inset 0 0 18px rgba(2, 6, 23, 0.62), 0 0 18px rgba(56, 189, 248, 0.08);
    display: grid;
    grid-template-columns: minmax(120px, 1.08fr) minmax(120px, 1fr) repeat(2, minmax(78px, 0.82fr));
    min-width: 0;
    overflow: hidden;
    padding: 3px;
    position: relative;
}

.scoreboard::before {
    background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.56), rgba(56, 189, 248, 0.3), transparent);
    content: "";
    height: 1px;
    left: 8px;
    opacity: 0.72;
    position: absolute;
    right: 8px;
    top: 0;
}

.scoreboard::after {
    content: none;
}

.scoreboard div {
    background:
        radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.11), transparent 58%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.48), rgba(2, 6, 23, 0.44));
    border: 1px solid transparent;
    min-width: 92px;
    padding: 8px 12px 9px;
    position: relative;
    text-align: left;
}

.scoreboard div + div {
    border-left: 1px solid rgba(2, 6, 23, 0.92);
    box-shadow: inset 1px 0 0 rgba(148, 163, 184, 0.08);
}

.difficulty-readout {
    background:
        radial-gradient(circle at 12% 0%, rgba(56, 189, 248, 0.15), transparent 58%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.52), rgba(2, 6, 23, 0.46));
    border: 1px solid transparent;
    display: grid;
    gap: 4px;
    min-width: 132px;
    padding: 8px 12px 9px;
    position: relative;
}

.difficulty-readout::before {
    background: var(--cyan);
    border-radius: 999px;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
    content: "";
    height: 5px;
    left: 10px;
    position: absolute;
    top: 10px;
    width: 5px;
}

.difficulty-readout span,
.difficulty-readout strong,
.challenge-readout span,
.challenge-readout strong,
.score-readout span,
.score-readout strong {
    padding-left: 14px;
}

.difficulty-readout strong {
    color: #e0f2fe;
    font: 900 15px/1 "SFMono-Regular", Consolas, monospace;
    text-align: left;
    text-shadow: 0 0 12px rgba(56, 189, 248, 0.28);
}

.score-readout::before {
    background: rgba(56, 189, 248, 0.62);
    border-radius: 999px;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.38);
    content: "";
    height: 5px;
    left: 10px;
    position: absolute;
    top: 10px;
    width: 5px;
}

.challenge-readout::before {
    background: var(--purple);
    border-radius: 999px;
    box-shadow: 0 0 10px rgba(167, 139, 250, 0.46);
    content: "";
    height: 5px;
    left: 10px;
    position: absolute;
    top: 10px;
    width: 5px;
}

.score-current::before {
    background: var(--green);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.score-best::before {
    background: var(--amber);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.scoreboard div.score-pulse-gate {
    animation: score-pulse-gate 0.34s ease both;
}

.scoreboard div.score-pulse-battery {
    animation: score-pulse-battery 0.38s ease both;
}

.scoreboard div.score-pulse-charge {
    animation: score-pulse-charge 0.62s ease both;
}

.scoreboard div.score-pulse-near {
    animation: score-pulse-near 0.46s ease both;
}

.scoreboard div.score-pulse-milestone {
    animation: score-pulse-milestone 0.72s ease both;
}

.scoreboard div.score-pulse-best {
    animation: score-pulse-best 0.82s ease both;
}

.scoreboard span {
    color: rgba(203, 213, 245, 0.78);
    display: block;
    font: 800 9px/1 "SFMono-Regular", Consolas, monospace;
    letter-spacing: 0;
    text-transform: uppercase;
}

.scoreboard strong {
    color: #d9f99d;
    display: block;
    font: 900 24px/1.05 "SFMono-Regular", Consolas, monospace;
    margin-top: 4px;
    text-shadow: 0 0 14px rgba(34, 197, 94, 0.26);
}

.score-best strong {
    color: #fde68a;
    text-shadow: 0 0 14px rgba(245, 158, 11, 0.22);
}

.challenge-readout strong {
    color: #ddd6fe;
    text-shadow: 0 0 14px rgba(167, 139, 250, 0.24);
}

.arena-wrap {
    background:
        linear-gradient(rgba(56, 189, 248, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.08) 1px, transparent 1px),
        radial-gradient(circle at 50% 45%, rgba(56, 189, 248, 0.13), transparent 42%),
        radial-gradient(circle at 50% 78%, rgba(245, 158, 11, 0.1), transparent 38%),
        #030712;
    background-size: 54px 54px, 54px 54px, auto, auto;
    height: clamp(390px, calc(100dvh - 190px), 660px);
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.arena-wrap:focus {
    outline: none;
}

.arena-wrap:focus-visible {
    box-shadow:
        0 0 0 2px rgba(245, 158, 11, 0.95),
        0 0 0 6px rgba(56, 189, 248, 0.18),
        inset 0 0 0 2px rgba(245, 158, 11, 0.46),
        inset 0 0 34px rgba(245, 158, 11, 0.12);
}

.arena-wrap:focus-visible::before {
    border: 1px solid rgba(245, 158, 11, 0.72);
    border-radius: 10px;
    box-shadow: 0 0 24px rgba(245, 158, 11, 0.24);
    content: "";
    inset: 10px;
    pointer-events: none;
    position: absolute;
    z-index: 6;
}

.arena-wrap.arena-impact-gate {
    animation: arena-impact-shake 0.26s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    box-shadow:
        0 0 0 2px rgba(239, 68, 68, 0.72),
        0 0 32px rgba(239, 68, 68, 0.24),
        inset 0 0 36px rgba(239, 68, 68, 0.16);
}

.arena-wrap.arena-impact-bounds {
    animation: arena-impact-shake 0.26s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    box-shadow:
        0 0 0 2px rgba(245, 158, 11, 0.78),
        0 0 32px rgba(245, 158, 11, 0.24),
        inset 0 0 36px rgba(245, 158, 11, 0.16);
}

.game-canvas {
    display: block;
    height: 100%;
    position: relative;
    width: 100%;
    z-index: 1;
}

.animated-layer {
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    position: absolute;
    z-index: 2;
}

.animated-layer img,
.animated-layer object {
    border: 0;
    display: block;
    position: absolute;
    transform-origin: center;
    will-change: transform;
}

.animated-layer .animated-gate {
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.28));
    object-fit: fill;
}

.animated-layer .animated-gate[data-signal-tier="0"][data-light-tone="1"] {
    filter: drop-shadow(0 0 9px rgba(250, 204, 21, 0.22)) drop-shadow(0 0 8px rgba(56, 189, 248, 0.18));
}

.animated-layer .animated-gate[data-signal-tier="0"][data-light-tone="2"] {
    filter: drop-shadow(0 0 9px rgba(167, 139, 250, 0.22)) drop-shadow(0 0 8px rgba(56, 189, 248, 0.18));
}

.animated-layer .animated-gate[data-signal-tier="1"] {
    filter: hue-rotate(42deg) saturate(1.18) drop-shadow(0 0 9px rgba(34, 197, 94, 0.3));
}

.animated-layer .animated-gate[data-signal-tier="2"] {
    filter: hue-rotate(84deg) saturate(1.24) drop-shadow(0 0 11px rgba(245, 158, 11, 0.32));
}

.animated-layer .animated-gate[data-signal-tier="3"] {
    filter: hue-rotate(126deg) saturate(1.34) drop-shadow(0 0 12px rgba(251, 113, 133, 0.34));
}

.animated-layer .animated-gate[data-signal-tier="4"] {
    filter: hue-rotate(164deg) saturate(1.42) drop-shadow(0 0 14px rgba(232, 121, 249, 0.36));
}

.animated-layer .animated-gate.signal-pulse {
    animation: signal-gate-pulse 1.1s ease both;
}

.animated-layer .animated-drone {
    object-fit: contain;
}

.animated-layer .animated-drone.drone-flap-pulse {
    filter: drop-shadow(0 0 16px rgba(56, 189, 248, 0.58)) drop-shadow(0 0 8px rgba(245, 158, 11, 0.28));
}

.animated-layer .animated-drone.drone-rush {
    filter: drop-shadow(-16px 0 18px rgba(245, 158, 11, 0.72)) drop-shadow(-34px 0 22px rgba(56, 189, 248, 0.42)) saturate(1.24);
}

.animated-layer .animated-drone.drone-impact {
    animation: drone-impact-flicker 0.26s steps(2, end) both;
    filter: drop-shadow(0 0 18px rgba(239, 68, 68, 0.84)) drop-shadow(0 0 10px rgba(245, 158, 11, 0.36));
}

.animated-layer .animated-drone.drone-impact[data-impact="bounds"] {
    filter: drop-shadow(0 0 18px rgba(245, 158, 11, 0.84)) drop-shadow(0 0 10px rgba(239, 68, 68, 0.32));
}

.countdown-overlay {
    align-items: center;
    background: radial-gradient(circle at center, rgba(2, 6, 23, 0.28), rgba(2, 6, 23, 0.58));
    display: flex;
    flex-direction: column;
    gap: 14px;
    inset: 0;
    justify-content: center;
    pointer-events: none;
    position: absolute;
    z-index: 4;
}

.countdown-overlay.hidden {
    display: none;
}

.countdown-ring {
    --countdown-accent: var(--cyan);
    align-items: center;
    aspect-ratio: 1;
    background:
        radial-gradient(circle, rgba(15, 23, 42, 0.5) 0 46%, transparent 47%),
        conic-gradient(from -90deg, var(--countdown-accent), var(--green), var(--countdown-accent));
    border: 1px solid rgba(226, 232, 240, 0.28);
    border-radius: 999px;
    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;
    min-width: 122px;
    padding: 10px;
    width: clamp(122px, 23vw, 178px);
}

.countdown-ring span {
    align-items: center;
    background: radial-gradient(circle at 34% 24%, rgba(226, 232, 240, 0.24), rgba(2, 6, 23, 0.94) 62%);
    border: 1px solid rgba(56, 189, 248, 0.34);
    border-radius: inherit;
    color: #f8fafc;
    display: grid;
    font: 900 clamp(54px, 12vw, 94px)/1 Inter, "Segoe UI", system-ui, sans-serif;
    height: 100%;
    justify-items: center;
    text-shadow: 0 0 16px var(--countdown-accent), 0 4px 0 rgba(2, 6, 23, 0.72);
    width: 100%;
}

.countdown-overlay small {
    background: rgba(2, 6, 23, 0.72);
    border: 1px solid rgba(56, 189, 248, 0.26);
    border-radius: 999px;
    color: var(--soft);
    font: 800 10px/1 "SFMono-Regular", Consolas, monospace;
    letter-spacing: 0;
    padding: 8px 12px;
    text-transform: uppercase;
}

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

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

.countdown-overlay.go .countdown-ring span {
    font-size: clamp(42px, 8vw, 72px);
}

@keyframes countdown-pop {
    0% {
        opacity: 0;
        transform: scale(0.72);
    }

    42% {
        opacity: 1;
        transform: scale(1.08);
    }

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

@keyframes arena-impact-shake {
    0%,
    100% {
        transform: translate3d(0, 0, 0);
    }

    18% {
        transform: translate3d(-7px, 3px, 0);
    }

    38% {
        transform: translate3d(6px, -3px, 0);
    }

    58% {
        transform: translate3d(-4px, 2px, 0);
    }

    76% {
        transform: translate3d(3px, -1px, 0);
    }
}

@keyframes drone-impact-flicker {
    0%,
    100% {
        opacity: 1;
    }

    35% {
        opacity: 0.34;
    }

    68% {
        opacity: 0.86;
    }
}

@keyframes score-pulse-gate {
    0%,
    100% {
        box-shadow: none;
        transform: translateY(0);
    }

    45% {
        border-color: rgba(56, 189, 248, 0.72);
        box-shadow: 0 0 18px rgba(56, 189, 248, 0.22), inset 0 0 14px rgba(56, 189, 248, 0.1);
        transform: translateY(-1px);
    }
}

@keyframes score-pulse-battery {
    0%,
    100% {
        box-shadow: none;
        transform: translateY(0);
    }

    45% {
        border-color: rgba(34, 197, 94, 0.74);
        box-shadow: 0 0 18px rgba(34, 197, 94, 0.24), inset 0 0 14px rgba(34, 197, 94, 0.12);
        transform: translateY(-1px);
    }
}

@keyframes score-pulse-charge {
    0%,
    100% {
        box-shadow: none;
        transform: translateY(0);
    }

    36% {
        border-color: rgba(245, 158, 11, 0.86);
        box-shadow: 0 0 24px rgba(245, 158, 11, 0.36), inset 0 0 18px rgba(245, 158, 11, 0.16);
        transform: translateY(-2px) scale(1.03);
    }
}

@keyframes score-pulse-near {
    0%,
    100% {
        box-shadow: none;
        transform: translateY(0);
    }

    42% {
        border-color: rgba(167, 139, 250, 0.82);
        box-shadow:
            0 0 18px rgba(167, 139, 250, 0.28),
            0 0 14px rgba(56, 189, 248, 0.16),
            inset 0 0 14px rgba(167, 139, 250, 0.12);
        transform: translateY(-1px) skewX(-1deg);
    }
}

@keyframes score-pulse-milestone {
    0%,
    100% {
        box-shadow: none;
        transform: translateY(0);
    }

    38% {
        border-color: rgba(245, 158, 11, 0.9);
        box-shadow:
            0 0 22px rgba(245, 158, 11, 0.34),
            0 0 12px rgba(250, 204, 21, 0.2),
            inset 0 0 18px rgba(245, 158, 11, 0.14);
        transform: translateY(-1px) scale(1.02);
    }
}

@keyframes milestone-topbar {
    0%,
    100% {
        box-shadow: none;
    }

    42% {
        box-shadow:
            inset 0 -1px 0 rgba(250, 204, 21, 0.58),
            inset 0 0 22px rgba(245, 158, 11, 0.14),
            0 8px 24px rgba(245, 158, 11, 0.12);
    }
}

@keyframes charge-topbar {
    0%,
    100% {
        box-shadow: none;
    }

    42% {
        box-shadow:
            inset 0 -1px 0 rgba(250, 204, 21, 0.72),
            inset 0 0 26px rgba(245, 158, 11, 0.18),
            0 8px 28px rgba(245, 158, 11, 0.16);
    }
}

@keyframes best-topbar {
    0%,
    100% {
        box-shadow: none;
    }

    34% {
        box-shadow:
            inset 0 -1px 0 rgba(250, 204, 21, 0.8),
            inset 0 0 32px rgba(245, 158, 11, 0.2),
            0 0 26px rgba(250, 204, 21, 0.14);
    }
}

@keyframes score-pulse-best {
    0%,
    100% {
        box-shadow: none;
        transform: translateY(0);
    }

    36% {
        border-color: rgba(250, 204, 21, 0.92);
        box-shadow:
            0 0 22px rgba(250, 204, 21, 0.3),
            0 0 14px rgba(245, 158, 11, 0.18),
            inset 0 0 18px rgba(245, 158, 11, 0.14);
        transform: translateY(-1px) scale(1.02);
    }
}

@keyframes signal-gate-pulse {
    0%,
    100% {
        opacity: 1;
    }

    42% {
        opacity: 0.86;
    }
}

.controls {
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(3, 7, 18, 0.94)),
        repeating-linear-gradient(90deg, rgba(56, 189, 248, 0.04) 0 1px, transparent 1px 18px),
        radial-gradient(circle at 50% 0%, rgba(245, 158, 11, 0.15), transparent 62%);
    border-top: 1px solid rgba(245, 158, 11, 0.32);
    box-shadow: inset 0 1px 0 rgba(236, 254, 255, 0.08), inset 0 10px 26px rgba(56, 189, 248, 0.04);
    display: grid;
    gap: 9px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: hidden;
    padding: 10px clamp(12px, 2.4vw, 24px);
}

.controls button {
    align-items: center;
    background:
        radial-gradient(circle at 50% 16%, rgba(236, 254, 255, 0.24), transparent 26%),
        linear-gradient(180deg, rgba(22, 78, 99, 0.96) 0%, rgba(14, 116, 144, 0.9) 46%, rgba(8, 47, 73, 0.96) 48%, rgba(2, 6, 23, 0.98) 100%);
    border-color: rgba(56, 189, 248, 0.34);
    border-radius: 11px;
    box-shadow:
        0 6px 0 rgba(1, 4, 12, 0.95),
        0 9px 16px rgba(0, 0, 0, 0.32),
        0 0 0 1px rgba(56, 189, 248, 0.1),
        inset 0 2px 0 rgba(236, 254, 255, 0.32),
        inset 0 -10px 18px rgba(2, 6, 23, 0.48);
    display: flex;
    gap: 7px;
    justify-content: center;
    min-height: 44px;
    min-width: 0;
    overflow: hidden;
    padding: 8px 8px;
    position: relative;
    text-transform: uppercase;
    touch-action: manipulation;
    transform: translateY(0);
    transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.14s ease;
    user-select: none;
    white-space: nowrap;
}

.controls button::after {
    background:
        radial-gradient(ellipse at 50% 12%, rgba(255, 255, 255, 0.32), transparent 42%),
        linear-gradient(90deg, transparent, rgba(236, 254, 255, 0.16), transparent);
    content: "";
    inset: 0 auto 0 -55%;
    pointer-events: none;
    position: absolute;
    transform: skewX(-18deg);
    transition: transform 0.28s ease;
    width: 46%;
}

.controls button::before {
    align-items: center;
    aspect-ratio: 1;
    background:
        radial-gradient(circle at 34% 25%, rgba(255, 255, 255, 0.58), transparent 29%),
        radial-gradient(circle at 50% 62%, rgba(2, 6, 23, 0.34), transparent 62%),
        linear-gradient(180deg, rgba(125, 211, 252, 0.96), rgba(14, 116, 144, 0.96) 58%, rgba(8, 47, 73, 0.98));
    border: 1px solid rgba(125, 211, 252, 0.68);
    border-radius: 50%;
    box-shadow:
        0 3px 0 rgba(8, 47, 73, 0.95),
        0 0 12px rgba(56, 189, 248, 0.22),
        inset 0 2px 0 rgba(255, 255, 255, 0.34),
        inset 0 -5px 9px rgba(2, 6, 23, 0.38);
    color: #ecfeff;
    content: "SP";
    display: grid;
    flex: 0 0 24px;
    font: 900 9px/1 "SFMono-Regular", Consolas, monospace;
    justify-items: center;
    min-width: 24px;
    position: relative;
    text-shadow: 0 1px 2px rgba(2, 6, 23, 0.72);
    width: 24px;
}

.controls button[data-action="pause"]::before {
    color: var(--purple);
    content: "P";
}

.controls button[data-action="dash"]::before {
    color: var(--purple);
    content: "D";
}

.controls button[data-action="boost"]::before {
    border-color: rgba(245, 158, 11, 0.58);
    background:
        radial-gradient(circle at 34% 25%, rgba(255, 255, 255, 0.58), transparent 29%),
        radial-gradient(circle at 50% 62%, rgba(2, 6, 23, 0.28), transparent 62%),
        linear-gradient(180deg, rgba(250, 204, 21, 0.98), rgba(245, 158, 11, 0.95) 58%, rgba(146, 64, 14, 0.98));
    box-shadow:
        0 3px 0 rgba(120, 53, 15, 0.98),
        0 0 14px rgba(245, 158, 11, 0.28),
        inset 0 2px 0 rgba(255, 255, 255, 0.34),
        inset 0 -5px 9px rgba(2, 6, 23, 0.32);
    color: var(--amber);
    content: "A";
}

.controls button[data-action="dash"][data-ready="false"],
.controls button[data-action="boost"][data-ready="false"] {
    border-color: rgba(100, 116, 139, 0.42);
    color: rgba(148, 163, 184, 0.92);
}

.controls button[data-action="dash"][data-ready="false"]::before,
.controls button[data-action="boost"][data-ready="false"]::before {
    border-color: rgba(100, 116, 139, 0.44);
    box-shadow: inset 0 0 12px rgba(2, 6, 23, 0.54);
    color: rgba(148, 163, 184, 0.92);
}

.controls button[data-action="restart"]::before {
    color: var(--amber);
    content: "R";
}

.controls button:hover,
.controls button:focus-visible {
    filter: saturate(1.12) brightness(1.05);
    transform: translateY(-2px);
}

.controls button:hover::after,
.controls button:focus-visible::after {
    transform: translateX(330%) skewX(-18deg);
}

.controls button:active,
.controls button.pressed {
    animation: arcade-button-press 0.18s cubic-bezier(0.2, 0.9, 0.2, 1) both;
    box-shadow:
        0 2px 0 rgba(1, 4, 12, 0.95),
        0 4px 9px rgba(0, 0, 0, 0.34),
        0 0 18px rgba(245, 158, 11, 0.22),
        inset 0 3px 10px rgba(2, 6, 23, 0.72),
        inset 0 -3px 8px rgba(236, 254, 255, 0.08);
    filter: brightness(0.96) saturate(1.18);
    transform: translateY(4px) scale(0.985);
}

.controls button:active::before,
.controls button.pressed::before {
    box-shadow:
        0 1px 0 rgba(8, 47, 73, 0.95),
        0 0 16px rgba(245, 158, 11, 0.22),
        inset 0 4px 8px rgba(2, 6, 23, 0.42);
    transform: translateY(2px) scale(0.94);
}

.controls button[aria-pressed="true"] {
    border-color: rgba(245, 158, 11, 0.72);
    box-shadow:
        0 3px 0 rgba(1, 4, 12, 0.92),
        0 0 18px rgba(245, 158, 11, 0.28),
        inset 0 0 18px rgba(245, 158, 11, 0.16);
}

@keyframes arcade-button-press {
    0% {
        transform: translateY(0) scale(1);
    }

    48% {
        transform: translateY(4px) scale(0.985);
    }

    100% {
        transform: translateY(3px) scale(0.99);
    }
}

.overlay {
    align-items: center;
    background:
        radial-gradient(circle at 28% 28%, rgba(56, 189, 248, 0.19), transparent 30%),
        radial-gradient(circle at 72% 64%, rgba(167, 139, 250, 0.16), transparent 28%),
        linear-gradient(135deg, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.64));
    border-radius: inherit;
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 18px;
    position: absolute;
    z-index: 10;
}

.overlay.hidden {
    display: none;
}

.overlay::before,
.overlay::after {
    content: "";
    pointer-events: none;
    position: absolute;
}

.overlay::before {
    background:
        linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.24), transparent),
        repeating-linear-gradient(180deg, rgba(226, 232, 240, 0.06) 0 1px, transparent 1px 7px);
    inset: 0;
    opacity: 0.5;
}

.overlay::after {
    border: 1px solid rgba(56, 189, 248, 0.24);
    border-radius: 14px;
    box-shadow: inset 0 0 36px rgba(56, 189, 248, 0.13);
    inset: 18px;
}

.overlay-card {
    align-items: center;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.82)),
        radial-gradient(circle at 12% 16%, rgba(56, 189, 248, 0.16), transparent 34%);
    border: 1px solid rgba(245, 158, 11, 0.38);
    border-radius: 10px;
    box-shadow: 0 0 34px rgba(56, 189, 248, 0.18), 0 0 24px var(--flappy-accent-glow), inset 0 0 28px rgba(2, 6, 23, 0.62);
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(150px, 0.58fr) minmax(300px, 1fr);
    max-height: calc(100% - 36px);
    max-width: 720px;
    overflow: hidden;
    padding: 22px;
    position: relative;
    width: min(92vw, 720px);
    z-index: 1;
}

.overlay-end .overlay-card {
    border-color: rgba(245, 158, 11, 0.42);
    box-shadow: 0 0 36px rgba(245, 158, 11, 0.2), inset 0 0 30px rgba(127, 29, 29, 0.16);
}

.overlay-pause .overlay-card {
    border-color: rgba(167, 139, 250, 0.48);
    box-shadow: 0 0 36px rgba(167, 139, 250, 0.22), inset 0 0 30px rgba(56, 189, 248, 0.1);
}

.overlay-card::before {
    background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.76), rgba(56, 189, 248, 0.36), transparent);
    content: "";
    height: 1px;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.overlay-end .overlay-card::before {
    background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.82), transparent);
}

.overlay-pause .overlay-card::before {
    background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.78), rgba(56, 189, 248, 0.36), transparent);
}

.overlay-visual {
    aspect-ratio: 1;
    min-width: 0;
    position: relative;
}

.overlay-preview {
    animation: hoverDrone 1.4s ease-in-out infinite;
    display: block;
    height: min(100%, 220px);
    left: 50%;
    object-fit: contain;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(100%, 220px);
}

.overlay-content {
    min-width: 0;
}

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

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

.overlay-pause .overlay-mode {
    color: var(--purple);
}

.overlay-card h2 {
    color: var(--cyan);
    font-size: clamp(30px, 5vw, 52px);
    line-height: 1.1;
    margin: 0 0 10px;
}

.overlay-card p {
    color: var(--soft);
    line-height: 1.55;
    margin: 0 0 18px;
    max-width: 470px;
}

.overlay-stats {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0 0 18px;
}

.overlay-stats div {
    background: rgba(2, 6, 23, 0.62);
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 7px;
    padding: 10px;
}

.overlay-end .overlay-stats div {
    border-color: rgba(245, 158, 11, 0.24);
}

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

.overlay-stats strong {
    color: var(--green);
    display: block;
    font: 800 18px/1.1 "SFMono-Regular", Consolas, monospace;
    margin-top: 6px;
}

.overlay-stat-extra {
    display: none;
}

.overlay-end .overlay-stat-extra {
    display: block;
}

.run-badges {
    display: none;
}

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

.run-badge {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.82), rgba(2, 6, 23, 0.68));
    border: 1px solid rgba(56, 189, 248, 0.24);
    border-radius: 7px;
    box-shadow: inset 0 0 14px rgba(2, 6, 23, 0.32);
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 8px 9px;
}

.run-badge strong {
    color: var(--cyan);
    font: 900 10px/1 "SFMono-Regular", Consolas, monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.run-badge small {
    color: var(--soft);
    font: 700 10px/1.15 Inter, "Segoe UI", system-ui, sans-serif;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.run-badge-clean {
    border-color: rgba(34, 197, 94, 0.38);
}

.run-badge-clean strong,
.run-badge-battery strong {
    color: var(--green);
}

.run-badge-near {
    border-color: rgba(167, 139, 250, 0.42);
}

.run-badge-near strong {
    color: var(--purple);
}

.run-badge-long,
.run-badge-battery {
    border-color: rgba(245, 158, 11, 0.42);
}

.run-badge-long strong,
.run-badge-empty {
    color: var(--amber);
}

.run-badge-empty {
    grid-column: 1 / -1;
    text-align: center;
}

.how-to-overlay {
    align-items: center;
    background: rgba(2, 6, 23, 0.74);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 18px;
    position: absolute;
    z-index: 12;
}

.how-to-overlay.hidden {
    display: none;
}

.how-to-card {
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.96)),
        repeating-linear-gradient(90deg, rgba(56, 189, 248, 0.07) 0 1px, transparent 1px 10px);
    border: 1px solid rgba(245, 158, 11, 0.42);
    border-radius: 10px;
    box-shadow:
        0 0 42px rgba(56, 189, 248, 0.22),
        0 0 28px rgba(245, 158, 11, 0.18),
        inset 0 0 30px rgba(2, 6, 23, 0.7);
    display: grid;
    gap: 14px;
    max-height: calc(100dvh - 52px);
    max-width: 820px;
    overflow: hidden;
    padding: 18px;
    position: relative;
    width: min(100%, 820px);
}

.how-to-card::before {
    background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.78), rgba(56, 189, 248, 0.38), transparent);
    content: "";
    height: 1px;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.how-to-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.how-to-head span {
    color: var(--amber);
    font: 900 10px/1 "SFMono-Regular", Consolas, monospace;
    text-transform: uppercase;
}

.how-to-head button {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(2, 6, 23, 0.88));
    border: 1px solid rgba(245, 158, 11, 0.36);
    border-radius: 7px;
    color: var(--amber);
    cursor: pointer;
    font: 800 11px/1 Inter, "Segoe UI", system-ui, sans-serif;
    padding: 9px 11px;
}

.how-to-head button:focus-visible,
.how-to-footer button:focus-visible,
.how-to-dots button:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 3px;
}

.how-to-title-row {
    align-items: end;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.how-to-card h3 {
    color: var(--cyan);
    font-size: clamp(24px, 4vw, 34px);
    line-height: 1;
    margin: 0 0 8px;
    text-shadow: 0 0 16px rgba(56, 189, 248, 0.28);
}

.how-to-title-row p {
    color: var(--soft);
    font: 700 13px/1.45 Inter, "Segoe UI", system-ui, sans-serif;
    margin: 0;
    max-width: 560px;
}

.how-to-dots {
    align-items: center;
    display: flex;
    gap: 8px;
    padding-bottom: 3px;
}

.how-to-dots button {
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(56, 189, 248, 0.34);
    border-radius: 999px;
    cursor: pointer;
    height: 12px;
    padding: 0;
    width: 26px;
}

.how-to-dots button[aria-current="true"] {
    background: linear-gradient(90deg, var(--amber), var(--cyan));
    border-color: rgba(250, 204, 21, 0.72);
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.34);
}

.how-to-slides {
    min-height: 328px;
    position: relative;
}

.how-to-slide {
    display: none;
    gap: 16px;
    grid-template-columns: minmax(260px, 1.02fr) minmax(260px, 0.98fr);
    min-height: 328px;
}

.how-to-slide.is-active {
    display: grid;
}

.slide-visual,
.slide-panel {
    background:
        radial-gradient(circle at 18% 0%, rgba(56, 189, 248, 0.16), transparent 44%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.76), rgba(2, 6, 23, 0.78));
    border: 1px solid rgba(56, 189, 248, 0.24);
    border-radius: 8px;
    min-width: 0;
    overflow: hidden;
    position: relative;
}

.slide-visual {
    box-shadow: inset 0 0 26px rgba(2, 6, 23, 0.72);
    min-height: 328px;
}

.slide-visual::before {
    background:
        linear-gradient(rgba(56, 189, 248, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.08) 1px, transparent 1px);
    background-size: 30px 30px;
    content: "";
    inset: 0;
    opacity: 0.72;
    position: absolute;
}

.slide-panel {
    align-content: center;
    display: grid;
    gap: 14px;
    padding: 18px;
}

.slide-kicker {
    color: var(--amber);
    font: 900 10px/1 "SFMono-Regular", Consolas, monospace;
    text-transform: uppercase;
}

.slide-panel h4 {
    color: #e0f2fe;
    font: 900 clamp(20px, 3vw, 30px)/1.08 Inter, "Segoe UI", system-ui, sans-serif;
    margin: 0;
    text-shadow: 0 0 18px rgba(56, 189, 248, 0.22);
}

.mini-gate {
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.72), rgba(15, 23, 42, 0.92));
    border: 1px solid rgba(56, 189, 248, 0.58);
    box-shadow: inset 0 0 16px rgba(2, 6, 23, 0.68), 0 0 18px rgba(56, 189, 248, 0.28);
    position: absolute;
    width: 68px;
}

.mini-gate-top {
    height: 92px;
    right: 40px;
    top: 0;
}

.mini-gate-bottom {
    bottom: 0;
    height: 104px;
    right: 40px;
}

.mini-drone {
    filter: drop-shadow(0 0 18px rgba(56, 189, 248, 0.5));
    left: 30%;
    position: absolute;
    top: 47%;
    transform: translate(-50%, -50%) rotate(-6deg);
    width: clamp(76px, 16vw, 118px);
}

.flight-arc {
    border: 2px solid rgba(245, 158, 11, 0.58);
    border-bottom: 0;
    border-left: 0;
    border-radius: 0 999px 0 0;
    height: 68px;
    left: 24%;
    position: absolute;
    top: 30%;
    transform: rotate(-12deg);
    width: 142px;
}

.arc-two {
    border-color: rgba(56, 189, 248, 0.46);
    height: 118px;
    left: 19%;
    top: 36%;
    width: 214px;
}

.dash-streak {
    background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.72), transparent);
    border-radius: 999px;
    height: 8px;
    left: 16%;
    position: absolute;
    top: 59%;
    width: 220px;
}

.control-bank,
.mechanic-list,
.route-stack,
.hazard-stack {
    display: grid;
    gap: 9px;
}

.control-bank div,
.mechanic-list div,
.route-stack div,
.hazard-stack div {
    align-items: center;
    background: rgba(2, 6, 23, 0.58);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 7px;
    display: flex;
    gap: 7px;
    min-width: 0;
    padding: 10px;
}

.control-bank kbd {
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.26), rgba(2, 6, 23, 0.9));
    border: 1px solid rgba(245, 158, 11, 0.44);
    border-radius: 6px;
    color: #fde68a;
    font: 900 11px/1 "SFMono-Regular", Consolas, monospace;
    min-width: 32px;
    padding: 7px 8px;
    text-align: center;
}

.control-bank span,
.mechanic-list span,
.route-stack span,
.hazard-stack span {
    color: var(--soft);
    font: 700 12px/1.3 Inter, "Segoe UI", system-ui, sans-serif;
}

.mechanic-list div,
.route-stack div,
.hazard-stack div {
    align-items: start;
    display: grid;
    gap: 4px;
}

.mechanic-list strong,
.route-stack strong,
.hazard-stack strong {
    color: var(--green);
    font: 900 11px/1 "SFMono-Regular", Consolas, monospace;
    text-transform: uppercase;
}

.power-visual {
    display: grid;
    place-items: center;
}

.mini-battery {
    filter: drop-shadow(0 0 18px rgba(34, 197, 94, 0.44));
    position: relative;
    width: clamp(110px, 22vw, 170px);
    z-index: 1;
}

.battery-meter-demo {
    border: 1px solid rgba(245, 158, 11, 0.48);
    border-radius: 999px;
    bottom: 42px;
    box-shadow: inset 0 0 16px rgba(2, 6, 23, 0.72), 0 0 18px rgba(245, 158, 11, 0.18);
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(3, 1fr);
    left: 50%;
    padding: 7px;
    position: absolute;
    transform: translateX(-50%);
    width: min(74%, 250px);
}

.battery-meter-demo i {
    background: linear-gradient(90deg, var(--green), var(--amber));
    border-radius: 999px;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.32);
    height: 10px;
}

.score-chip {
    background: rgba(2, 6, 23, 0.78);
    border: 1px solid rgba(56, 189, 248, 0.34);
    border-radius: 999px;
    color: #e0f2fe;
    font: 900 11px/1 "SFMono-Regular", Consolas, monospace;
    padding: 8px 10px;
    position: absolute;
    text-transform: uppercase;
}

.chip-gate {
    right: 30px;
    top: 42px;
}

.chip-cell {
    left: 28px;
    top: 72px;
}

.chip-rush {
    bottom: 96px;
    right: 52px;
    border-color: rgba(245, 158, 11, 0.48);
    color: #fde68a;
}

.hazard-visual {
    background:
        radial-gradient(circle at 28% 34%, rgba(245, 158, 11, 0.12), transparent 24%),
        radial-gradient(circle at 76% 46%, rgba(56, 189, 248, 0.16), transparent 34%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.76), rgba(2, 6, 23, 0.78));
}

.hazard-gate {
    background:
        linear-gradient(90deg, rgba(56, 189, 248, 0.22), transparent 18%, transparent 82%, rgba(56, 189, 248, 0.22)),
        linear-gradient(180deg, rgba(56, 189, 248, 0.78), rgba(15, 23, 42, 0.94));
    border: 1px solid rgba(56, 189, 248, 0.58);
    box-shadow: inset 0 0 16px rgba(2, 6, 23, 0.68), 0 0 18px rgba(56, 189, 248, 0.28);
    left: 58%;
    position: absolute;
    width: 74px;
}

.hazard-gate-top {
    height: 100px;
    top: 0;
}

.hazard-gate-bottom {
    bottom: 0;
    height: 108px;
}

.vertical-zap {
    background:
        linear-gradient(180deg, transparent 0 8%, #fef3c7 11%, rgba(250, 204, 21, 0.92) 18%, rgba(56, 189, 248, 0.82) 31%, rgba(250, 204, 21, 0.92) 44%, #fef3c7 51%, rgba(56, 189, 248, 0.82) 63%, rgba(250, 204, 21, 0.92) 78%, transparent 92%),
        repeating-linear-gradient(180deg, transparent 0 14px, rgba(255, 255, 255, 0.86) 14px 18px, transparent 18px 31px);
    border-radius: 999px;
    box-shadow: 0 0 24px rgba(245, 158, 11, 0.58), 0 0 14px rgba(56, 189, 248, 0.38);
    height: 118px;
    left: calc(58% + 33px);
    position: absolute;
    top: 105px;
    width: 10px;
}

.electric-orb {
    background:
        radial-gradient(circle, #fef3c7 0 10%, var(--amber) 18%, rgba(56, 189, 248, 0.84) 48%, transparent 70%),
        conic-gradient(from 40deg, transparent, rgba(250, 204, 21, 0.75), transparent, rgba(56, 189, 248, 0.7), transparent);
    border-radius: 50%;
    box-shadow: 0 0 34px rgba(245, 158, 11, 0.62), 0 0 20px rgba(56, 189, 248, 0.32);
    height: 66px;
    left: 23%;
    position: absolute;
    top: 32%;
    width: 66px;
}

.hazard-drone-dot {
    background:
        radial-gradient(circle at 36% 30%, rgba(255, 255, 255, 0.72), transparent 20%),
        radial-gradient(circle, var(--cyan) 0 42%, rgba(14, 116, 144, 0.92) 56%, rgba(2, 6, 23, 0.9) 70%);
    border: 1px solid rgba(125, 211, 252, 0.78);
    border-radius: 50%;
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.5);
    height: 32px;
    left: 37%;
    position: absolute;
    top: 58%;
    width: 32px;
}

.hazard-dash-path {
    background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.76), rgba(56, 189, 248, 0.52), transparent);
    border-radius: 999px;
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.28);
    height: 9px;
    left: 30%;
    position: absolute;
    top: calc(58% + 12px);
    width: 210px;
}

.hazard-label {
    background: rgba(2, 6, 23, 0.78);
    border: 1px solid rgba(245, 158, 11, 0.34);
    border-radius: 999px;
    color: #fde68a;
    font: 900 10px/1 "SFMono-Regular", Consolas, monospace;
    padding: 7px 9px;
    position: absolute;
    text-transform: uppercase;
}

.label-zip {
    left: calc(58% - 18px);
    top: 74px;
}

.label-ball {
    left: 15%;
    top: calc(32% - 38px);
}

.label-dash {
    left: 43%;
    top: calc(58% + 28px);
}

.hazard-stack div:nth-child(1) {
    border-color: rgba(245, 158, 11, 0.34);
}

.hazard-stack div:nth-child(2) {
    border-color: rgba(56, 189, 248, 0.32);
}

.hazard-stack div:nth-child(3) {
    border-color: rgba(167, 139, 250, 0.34);
}

.hazard-stack div:nth-child(1) strong {
    color: var(--amber);
}

.hazard-stack div:nth-child(2) strong {
    color: var(--cyan);
}

.hazard-stack div:nth-child(3) strong {
    color: var(--purple);
}

.how-to-footer {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: 110px 1fr 110px;
}

.how-to-footer button {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(2, 6, 23, 0.88));
    border: 1px solid rgba(56, 189, 248, 0.34);
    border-radius: 7px;
    color: var(--cyan);
    cursor: pointer;
    font: 900 11px/1 "SFMono-Regular", Consolas, monospace;
    padding: 11px 12px;
    text-transform: uppercase;
}

.how-to-footer span {
    background: rgba(2, 6, 23, 0.64);
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 999px;
    color: var(--amber);
    font: 900 11px/1 "SFMono-Regular", Consolas, monospace;
    justify-self: center;
    padding: 9px 14px;
    text-align: center;
}

.asset-mode,
.route-mode {
    border: 0;
    display: grid;
    gap: 8px;
    margin: -4px 0 14px;
    min-width: 0;
    padding: 0;
}

.asset-mode {
    grid-template-columns: 1fr 1fr;
}

.route-mode {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 12px;
}

.asset-mode legend,
.route-mode legend {
    color: var(--muted);
    font: 800 10px/1 "SFMono-Regular", Consolas, monospace;
    margin: 0 0 8px;
    padding: 0;
    text-transform: uppercase;
}

.asset-mode label,
.route-mode label {
    cursor: pointer;
    min-width: 0;
}

.asset-mode input,
.route-mode input {
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

.asset-mode span,
.route-mode span {
    background: rgba(2, 6, 23, 0.58);
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 7px;
    display: grid;
    gap: 4px;
    min-height: 54px;
    padding: 10px;
}

.asset-mode span {
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.58), rgba(2, 6, 23, 0.72)),
        radial-gradient(circle at 12% 0%, rgba(56, 189, 248, 0.1), transparent 48%);
    overflow: hidden;
    padding-right: 42px;
    position: relative;
}

.asset-mode span::before {
    background: rgba(71, 85, 105, 0.62);
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 50%;
    box-shadow: inset 0 0 8px rgba(2, 6, 23, 0.5);
    content: "";
    height: 11px;
    position: absolute;
    right: 13px;
    top: 12px;
    width: 11px;
}

.asset-mode span::after {
    color: rgba(203, 213, 225, 0.72);
    content: "READY";
    font: 900 8px/1 "SFMono-Regular", Consolas, monospace;
    position: absolute;
    right: 10px;
    top: 30px;
    transform: rotate(90deg);
    transform-origin: right center;
}

.route-mode span {
    min-height: 50px;
    padding: 9px 8px;
}

.asset-mode label:focus-within span,
.route-mode label:focus-within span {
    border-color: rgba(245, 158, 11, 0.78);
    box-shadow:
        0 0 0 2px rgba(245, 158, 11, 0.24),
        0 0 18px rgba(56, 189, 248, 0.18),
        inset 0 0 16px rgba(245, 158, 11, 0.1);
}

.asset-mode label:focus-within strong,
.route-mode label:focus-within strong {
    color: var(--amber);
}

.asset-mode strong,
.route-mode strong {
    color: var(--cyan);
    font: 800 12px/1 "SFMono-Regular", Consolas, monospace;
}

.asset-mode small,
.route-mode small {
    color: var(--muted);
    font: 600 11px/1.2 Inter, "Segoe UI", system-ui, sans-serif;
}

.route-mode small {
    font-size: 10px;
}

.asset-mode input:checked + span,
.route-mode input:checked + span {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(56, 189, 248, 0.14), rgba(2, 6, 23, 0.76));
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: inset 0 0 18px rgba(245, 158, 11, 0.12), 0 0 14px var(--flappy-accent-glow);
}

.asset-mode input:checked + span {
    background:
        linear-gradient(135deg, rgba(245, 158, 11, 0.24), rgba(56, 189, 248, 0.18), rgba(2, 6, 23, 0.84)),
        repeating-linear-gradient(90deg, rgba(250, 204, 21, 0.08) 0 1px, transparent 1px 9px);
    border-color: rgba(245, 158, 11, 0.72);
    box-shadow:
        inset 0 0 18px rgba(245, 158, 11, 0.16),
        inset 0 0 0 1px rgba(250, 204, 21, 0.1),
        0 0 20px rgba(245, 158, 11, 0.2);
}

.asset-mode input:checked + span::before {
    background: var(--amber);
    border-color: rgba(250, 204, 21, 0.84);
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.74), inset 0 0 6px rgba(255, 255, 255, 0.35);
}

.asset-mode input:checked + span::after {
    color: var(--amber);
    content: "ACTIVE";
}

.asset-mode input:checked + span strong,
.route-mode input:checked + span strong {
    color: var(--amber);
}

.overlay-actions {
    align-items: stretch;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    margin-top: 2px;
}

.overlay-actions .how-to-button,
.overlay-actions .settings-button {
    justify-self: stretch;
    min-width: 0;
}

.overlay-start .settings-button {
    display: none;
}

.overlay-actions #startButton {
    background:
        linear-gradient(135deg, rgba(245, 158, 11, 0.32), rgba(56, 189, 248, 0.16), rgba(2, 6, 23, 0.88));
    border-color: rgba(245, 158, 11, 0.58);
    box-shadow: 0 0 22px rgba(245, 158, 11, 0.24), inset 0 0 18px rgba(245, 158, 11, 0.1);
    color: #fde68a;
    justify-self: stretch;
    min-width: 0;
}

.overlay-end .how-to-button,
.overlay-end .asset-mode,
.overlay-end .route-mode,
.overlay-pause .asset-mode,
.overlay-pause .route-mode {
    display: none;
}

.overlay-end .overlay-card h2,
.overlay-end .overlay-stats strong {
    color: var(--amber);
}

.overlay-pause .overlay-card h2,
.overlay-pause .overlay-stats strong {
    color: var(--purple);
}

.overlay-card button {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(56, 189, 248, 0.12), rgba(2, 6, 23, 0.88));
    border-color: rgba(245, 158, 11, 0.36);
    box-shadow: 0 0 18px var(--flappy-accent-glow);
    min-width: 132px;
}

.overlay-card button:disabled {
    cursor: wait;
    opacity: 0.82;
}

.overlay-card button[data-loading="true"] {
    animation: qualityLoadingPulse 1s ease-in-out infinite;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.26), rgba(245, 158, 11, 0.18), rgba(2, 6, 23, 0.9));
    border-color: rgba(56, 189, 248, 0.5);
    color: #e0f2fe;
}

.asset-mode input:disabled + span,
.route-mode input:disabled + span {
    cursor: wait;
    opacity: 0.68;
}

@keyframes qualityLoadingPulse {
    0%,
    100% {
        box-shadow: 0 0 14px rgba(56, 189, 248, 0.22);
    }

    50% {
        box-shadow: 0 0 24px rgba(245, 158, 11, 0.36);
    }
}

.overlay-end .overlay-card button {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(2, 6, 23, 0.9));
    border-color: rgba(245, 158, 11, 0.44);
    color: var(--amber);
}

.overlay-pause .overlay-card button,
.controls button[data-action="pause"][aria-pressed="true"] {
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.22), rgba(2, 6, 23, 0.9));
    border-color: rgba(167, 139, 250, 0.5);
    color: var(--purple);
}

@keyframes hoverDrone {
    0%,
    100% {
        transform: translate(-50%, calc(-50% - 8px)) rotate(-4deg);
    }

    50% {
        transform: translate(-50%, calc(-50% + 8px)) rotate(4deg);
    }
}

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

    .overlay-preview {
        animation: none !important;
        transform: translate(-50%, -50%) rotate(0deg);
    }

    .arena-wrap.arena-impact-gate,
    .arena-wrap.arena-impact-bounds {
        animation: none !important;
        transform: none !important;
    }

    .arena-wrap.arena-impact-gate {
        box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.62), inset 0 0 28px rgba(239, 68, 68, 0.24);
    }

    .arena-wrap.arena-impact-bounds {
        box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.7), inset 0 0 28px rgba(245, 158, 11, 0.24);
    }

    .countdown-overlay.pulse .countdown-ring {
        animation: none !important;
        opacity: 1;
        transform: scale(1);
    }

    .countdown-ring {
        box-shadow: 0 0 18px color-mix(in srgb, var(--countdown-accent) 36%, transparent), inset 0 0 18px rgba(2, 6, 23, 0.9);
    }

    .scoreboard div.score-pulse-gate,
    .scoreboard div.score-pulse-battery,
    .scoreboard div.score-pulse-charge,
    .scoreboard div.score-pulse-near,
    .scoreboard div.score-pulse-milestone,
    .scoreboard div.score-pulse-best {
        animation: none !important;
        transform: none !important;
    }

    .scoreboard div.score-pulse-gate {
        border-color: rgba(56, 189, 248, 0.72);
        box-shadow: 0 0 16px rgba(56, 189, 248, 0.18), inset 0 0 12px rgba(56, 189, 248, 0.1);
    }

    .scoreboard div.score-pulse-battery {
        border-color: rgba(34, 197, 94, 0.72);
        box-shadow: 0 0 16px rgba(34, 197, 94, 0.2), inset 0 0 12px rgba(34, 197, 94, 0.1);
    }

    .scoreboard div.score-pulse-charge,
    .scoreboard div.score-pulse-milestone,
    .scoreboard div.score-pulse-best {
        border-color: rgba(245, 158, 11, 0.82);
        box-shadow: 0 0 18px rgba(245, 158, 11, 0.24), inset 0 0 14px rgba(245, 158, 11, 0.12);
    }

    .scoreboard div.score-pulse-near {
        border-color: rgba(167, 139, 250, 0.74);
        box-shadow: 0 0 16px rgba(167, 139, 250, 0.2), inset 0 0 12px rgba(167, 139, 250, 0.1);
    }

    .game-topbar.milestone-highlight,
    .game-topbar.charge-highlight,
    .game-topbar.best-highlight {
        animation: none !important;
        box-shadow: inset 0 -1px 0 rgba(250, 204, 21, 0.62), inset 0 0 18px rgba(245, 158, 11, 0.12);
    }

    .animated-drone.drone-impact,
    .animated-drone.drone-rush,
    .animated-gate.signal-pulse {
        animation: none !important;
    }

    .controls button:active,
    .controls button.pressed {
        animation: none !important;
    }
}
