@font-face {
    font-family: spaceFont;
    src: url("src/fonts/nasalization-rg.ttf");
}

:root {
    --bg: #040712;
    --panel: rgba(5, 10, 24, 0.78);
    --panel-strong: rgba(8, 14, 32, 0.92);
    --text: #f4fbff;
    --muted: #95a9c7;
    --cyan: #00f5ff;
    --magenta: #ff3df2;
    --gold: #ffc857;
    --red: #ff355e;
    --green: #52ff9f;
    --line: rgba(148, 233, 255, 0.34);
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    margin: 0;
    overflow: hidden;
    font-family: spaceFont, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
}

body.is-playing,
body.is-playing * {
    cursor: none !important;
}

canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
}

button,
a {
    font: inherit;
}

button {
    border: 0;
}

a {
    color: var(--text);
    text-decoration: none;
}

.app-shell {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    pointer-events: none;
}

.hud-strip {
    position: fixed;
    top: 18px;
    left: 50%;
    display: flex;
    gap: 10px;
    align-items: center;
    transform: translateX(-50%);
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 0 24px rgba(0, 245, 255, 0.18);
    pointer-events: none;
}

.hud-stat {
    display: grid;
    min-width: 88px;
    gap: 3px;
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.045);
}

.hud-stat.accent {
    border: 1px solid rgba(255, 200, 87, 0.52);
    background: linear-gradient(180deg, rgba(255, 200, 87, 0.14), rgba(6, 8, 18, 0.9));
    box-shadow:
        inset 0 0 18px rgba(255, 200, 87, 0.16),
        0 0 18px rgba(4, 7, 18, 0.72);
}

.hud-stat.accent .hud-label {
    color: #ffe6a8;
}

.hud-stat.accent strong {
    color: #fff0bc;
    text-shadow:
        0 1px 0 rgba(2, 4, 10, 0.95),
        0 0 14px rgba(255, 200, 87, 0.78);
}

.hud-label {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
}

.hud-stat strong {
    color: var(--cyan);
    font-size: 22px;
    line-height: 1;
    text-shadow: 0 0 12px rgba(0, 245, 255, 0.65);
}

.start-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    display: grid;
    width: min(560px, calc(100vw - 36px));
    gap: 14px;
    justify-items: center;
    transform: translate(-50%, -52%);
    padding: 30px 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-strong);
    box-shadow: 0 0 42px rgba(255, 61, 242, 0.16);
    isolation: isolate;
    overflow: visible;
    pointer-events: auto;
    transition:
        border-color 900ms ease-out,
        background 900ms ease-out,
        box-shadow 900ms ease-out;
}

.panel-orbit {
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: 8px;
    opacity: 1;
    pointer-events: none;
}

.panel-orbit::before,
.panel-orbit::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
}

.start-panel.panel-ready .panel-orbit::before {
    background:
        linear-gradient(90deg, var(--cyan), rgba(244, 251, 255, 0.94), var(--magenta)) 0 0 / 100% 1px no-repeat,
        linear-gradient(180deg, var(--magenta), rgba(244, 251, 255, 0.78), var(--cyan)) 100% 0 / 1px 100% no-repeat,
        linear-gradient(270deg, var(--cyan), rgba(244, 251, 255, 0.92), var(--magenta)) 100% 100% / 100% 1px no-repeat,
        linear-gradient(0deg, var(--magenta), rgba(244, 251, 255, 0.72), var(--cyan)) 0 100% / 1px 100% no-repeat;
    filter:
        drop-shadow(0 0 10px rgba(0, 245, 255, 0.68))
        drop-shadow(0 0 14px rgba(255, 61, 242, 0.34));
    animation: panelBorderHandoffFade 2400ms ease-out both;
}

.start-panel.panel-ready .panel-orbit::after {
    background:
        linear-gradient(90deg, transparent 0%, rgba(0, 245, 255, 0.08) 24%, rgba(244, 251, 255, 0.9) 48%, rgba(255, 61, 242, 0.18) 62%, transparent 82%) 180% 0 / 220% 1px no-repeat,
        linear-gradient(180deg, transparent 0%, rgba(255, 61, 242, 0.1) 22%, rgba(244, 251, 255, 0.74) 48%, rgba(0, 245, 255, 0.18) 64%, transparent 84%) 100% 180% / 1px 220% no-repeat,
        linear-gradient(270deg, transparent 0%, rgba(0, 245, 255, 0.08) 24%, rgba(244, 251, 255, 0.82) 48%, rgba(255, 61, 242, 0.18) 62%, transparent 82%) -80% 100% / 220% 1px no-repeat,
        linear-gradient(0deg, transparent 0%, rgba(255, 61, 242, 0.1) 22%, rgba(244, 251, 255, 0.68) 48%, rgba(0, 245, 255, 0.18) 64%, transparent 84%) 0 -80% / 1px 220% no-repeat;
    filter:
        drop-shadow(0 0 8px rgba(0, 245, 255, 0.34))
        drop-shadow(0 0 10px rgba(255, 61, 242, 0.18));
    animation:
        panelBorderOrbit 6200ms linear infinite,
        panelBorderOrbitEaseIn 1400ms ease-out both;
}

.start-panel.panel-ready::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border: 1px solid rgba(255, 200, 87, 0.18);
    border-radius: 8px;
    box-shadow:
        inset 0 0 22px rgba(0, 245, 255, 0.08),
        0 0 18px rgba(0, 245, 255, 0.14),
        0 0 24px rgba(255, 61, 242, 0.1);
    opacity: 0.72;
    pointer-events: none;
    animation: panelBorderReadyGlow 1000ms ease-out both;
}

.start-panel > * {
    position: relative;
    z-index: 3;
}

.start-panel > .panel-orbit {
    position: absolute;
    z-index: 2;
}

.start-panel.intro-panel {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    pointer-events: none;
}

.start-panel.intro-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 8px;
    pointer-events: none;
}

.start-panel.intro-panel::before {
    z-index: 1;
    background: var(--panel-strong);
    opacity: 0;
    animation: panelChromeGlow 860ms ease-out 3040ms both;
}

.start-panel.intro-panel .panel-orbit::before {
    background:
        linear-gradient(90deg, var(--cyan), rgba(244, 251, 255, 0.94), var(--magenta)) 0 0 / 0 1px no-repeat,
        linear-gradient(180deg, var(--magenta), rgba(244, 251, 255, 0.78), var(--cyan)) 100% 0 / 1px 0 no-repeat,
        linear-gradient(270deg, var(--cyan), rgba(244, 251, 255, 0.92), var(--magenta)) 100% 100% / 0 1px no-repeat,
        linear-gradient(0deg, var(--magenta), rgba(244, 251, 255, 0.72), var(--cyan)) 0 100% / 1px 0 no-repeat;
    filter:
        drop-shadow(0 0 10px rgba(0, 245, 255, 0.68))
        drop-shadow(0 0 14px rgba(255, 61, 242, 0.34));
    opacity: 0;
    animation: panelBorderDraw 860ms ease-out 3040ms both;
}

.start-panel.intro-panel > :not(#title):not(.panel-orbit) {
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    animation: panelCopyReveal 700ms ease-out 3920ms both;
}

.start-panel.intro-panel .primary-action {
    pointer-events: none;
}

.start-panel.intro-panel.panel-ready {
    border-color: var(--line);
    background: var(--panel-strong);
    box-shadow: 0 0 42px rgba(255, 61, 242, 0.16);
    pointer-events: auto;
}

.start-panel.intro-panel.panel-ready::before {
    z-index: 1;
    background: var(--panel-strong);
    opacity: 1;
    animation: panelChromeHandoff 900ms ease-out both;
}

.start-panel.intro-panel.panel-ready .panel-orbit::before {
    background:
        linear-gradient(90deg, var(--cyan), rgba(244, 251, 255, 0.94), var(--magenta)) 0 0 / 100% 1px no-repeat,
        linear-gradient(180deg, var(--magenta), rgba(244, 251, 255, 0.78), var(--cyan)) 100% 0 / 1px 100% no-repeat,
        linear-gradient(270deg, var(--cyan), rgba(244, 251, 255, 0.92), var(--magenta)) 100% 100% / 100% 1px no-repeat,
        linear-gradient(0deg, var(--magenta), rgba(244, 251, 255, 0.72), var(--cyan)) 0 100% / 1px 100% no-repeat;
    filter:
        drop-shadow(0 0 10px rgba(0, 245, 255, 0.68))
        drop-shadow(0 0 14px rgba(255, 61, 242, 0.34));
    opacity: 1;
    animation: panelBorderHandoffFade 2400ms ease-out both;
}

.start-panel.intro-panel.panel-ready > :not(#title):not(.panel-orbit) {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    animation: none;
}

.start-panel.intro-panel.panel-ready .primary-action {
    pointer-events: auto;
}

#title {
    margin: 0;
    position: relative;
    display: inline-grid;
    place-items: center;
    color: var(--text);
    font-size: 52px;
    line-height: 0.95;
    text-align: center;
    max-width: 100%;
    isolation: isolate;
    perspective: 620px;
    transform-style: preserve-3d;
    text-shadow:
        0 0 18px rgba(0, 245, 255, 0.76),
        0 0 34px rgba(255, 61, 242, 0.35);
    transform-origin: center;
}

.start-panel.intro-panel #title {
    animation: logoZoomIn 1900ms cubic-bezier(0.16, 0.78, 0.28, 1) 1000ms both;
}

.title-text {
    position: relative;
    z-index: 4;
    transform-origin: center;
    animation: titleIdlePulse 3200ms ease-in-out infinite;
}

.start-panel.intro-panel .title-text {
    animation: titleIdlePulse 3200ms ease-in-out 4300ms infinite;
}

#title::before,
#title::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    pointer-events: none;
}

#title::before {
    z-index: 2;
    color: rgba(0, 245, 255, 0.2);
    -webkit-text-stroke: 1px rgba(244, 251, 255, 0.38);
    text-shadow:
        0 14px rgba(0, 245, 255, 0.28),
        0 31px rgba(255, 61, 242, 0.18),
        0 52px rgba(0, 245, 255, 0.1);
    opacity: 0;
    visibility: hidden;
    transform-origin: 50% 96%;
}

.start-panel.intro-panel #title::before {
    visibility: visible;
    animation: titleTextExtrude 1900ms cubic-bezier(0.16, 0.78, 0.28, 1) 1000ms both;
}

#title::after {
    z-index: 5;
    color: transparent;
    background:
        linear-gradient(
            110deg,
            transparent 0%,
            transparent 39%,
            rgba(0, 245, 255, 0.48) 46%,
            rgba(255, 255, 255, 0.98) 51%,
            rgba(255, 61, 242, 0.58) 56%,
            transparent 66%,
            transparent 100%
        );
    background-size: 230% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.52));
    opacity: 0;
}

.start-panel.intro-panel #title::after {
    animation: logoShine 1250ms ease-out 2920ms both;
}

.title-depth {
    position: absolute;
    top: 54%;
    left: 50%;
    z-index: 1;
    width: 156%;
    height: 220px;
    opacity: 0;
    clip-path: polygon(5% 0, 95% 0, 50% 100%);
    background:
        radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.95) 0 4%, rgba(0, 245, 255, 0.7) 10%, rgba(255, 61, 242, 0) 36%),
        repeating-linear-gradient(92deg, rgba(0, 245, 255, 0.48) 0 1px, transparent 1px 15px),
        linear-gradient(90deg, transparent 0%, rgba(0, 245, 255, 0.22) 10%, transparent 18%, rgba(244, 251, 255, 0.3) 44%, rgba(255, 61, 242, 0.24) 61%, transparent 88%),
        linear-gradient(180deg, rgba(0, 245, 255, 0.2), rgba(255, 61, 242, 0.28) 48%, rgba(0, 245, 255, 0) 100%);
    filter:
        blur(0.2px)
        drop-shadow(0 0 24px rgba(0, 245, 255, 0.34))
        drop-shadow(0 0 18px rgba(255, 61, 242, 0.22));
    pointer-events: none;
    transform: translateX(-50%) translateY(110px) scaleX(0.22) scaleY(0.12);
    transform-origin: 50% 0;
    visibility: hidden;
}

.start-panel.intro-panel .title-depth {
    visibility: visible;
    animation: titleDepthRush 1900ms cubic-bezier(0.16, 0.78, 0.28, 1) 1000ms both;
}

.title-depth::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -8px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 1) 0 12%, rgba(0, 245, 255, 0.82) 28%, rgba(255, 61, 242, 0) 68%);
    filter:
        drop-shadow(0 0 18px rgba(0, 245, 255, 0.72))
        drop-shadow(0 0 16px rgba(255, 61, 242, 0.35));
    transform: translateX(-50%);
}

.title-depth::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(103deg, transparent 17%, rgba(255, 255, 255, 0.34) 49%, rgba(0, 245, 255, 0.14) 58%, transparent 82%);
    opacity: 0.65;
}

.title-star {
    position: absolute;
    top: -10px;
    right: -18px;
    z-index: 6;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(255, 255, 255, 1) 0 14%, rgba(0, 245, 255, 0.95) 15% 29%, rgba(255, 61, 242, 0) 62%);
    filter:
        drop-shadow(0 0 7px rgba(255, 255, 255, 0.9))
        drop-shadow(0 0 18px rgba(0, 245, 255, 0.55))
        drop-shadow(0 0 14px rgba(255, 61, 242, 0.32));
    opacity: 0;
    pointer-events: none;
    transform: scale(0.25) rotate(0deg);
}

.start-panel.intro-panel .title-star {
    animation: titleStarGlitter 1150ms ease-out 3060ms both;
}

.title-star::before,
.title-star::after {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    width: 34px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.98), transparent);
    transform: translate(-50%, -50%);
}

.title-star::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

@keyframes logoZoomIn {
    0% {
        opacity: 0;
        transform: perspective(700px) translateY(96px) translateZ(-240px) scale(0.42);
        filter: blur(9px);
    }

    48% {
        opacity: 1;
        transform: perspective(700px) translateY(18px) translateZ(-48px) scale(0.88);
        filter: blur(2px);
    }

    76% {
        opacity: 1;
        transform: perspective(700px) translateY(-2px) translateZ(18px) scale(1.04);
        filter: blur(0);
    }

    100% {
        opacity: 1;
        transform: perspective(700px) translateY(0) translateZ(0) scale(1);
        filter: none;
    }
}

@keyframes titleTextExtrude {
    0% {
        opacity: 0;
        transform: perspective(420px) rotateX(68deg) translateY(142px) scaleX(0.52) scaleY(4.6);
        filter: blur(10px);
    }

    34% {
        opacity: 0.86;
        transform: perspective(420px) rotateX(61deg) translateY(78px) scaleX(0.78) scaleY(3.1);
        filter: blur(3px);
    }

    72% {
        opacity: 0.54;
        transform: perspective(420px) rotateX(44deg) translateY(22px) scaleX(1.02) scaleY(1.72);
        filter: blur(0.8px);
    }

    100% {
        opacity: 0;
        visibility: hidden;
        transform: perspective(420px) rotateX(0deg) translateY(0) scaleX(1) scaleY(1);
        filter: blur(0);
    }
}

@keyframes titleDepthRush {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(118px) scaleX(0.22) scaleY(0.12);
        filter:
            blur(12px)
            drop-shadow(0 0 12px rgba(0, 245, 255, 0.16))
            drop-shadow(0 0 10px rgba(255, 61, 242, 0.12));
    }

    28% {
        opacity: 0.95;
        transform: translateX(-50%) translateY(64px) scaleX(0.58) scaleY(0.7);
        filter:
            blur(4px)
            drop-shadow(0 0 18px rgba(0, 245, 255, 0.3))
            drop-shadow(0 0 12px rgba(255, 61, 242, 0.2));
    }

    66% {
        opacity: 0.72;
        transform: translateX(-50%) translateY(8px) scaleX(1.04) scaleY(1);
        filter:
            blur(0.6px)
            drop-shadow(0 0 20px rgba(0, 245, 255, 0.34))
            drop-shadow(0 0 14px rgba(255, 61, 242, 0.22));
    }

    100% {
        opacity: 0;
        visibility: hidden;
        transform: translateX(-50%) translateY(-6px) scaleX(1.16) scaleY(0.78);
        filter:
            blur(0)
            drop-shadow(0 0 0 rgba(0, 245, 255, 0))
            drop-shadow(0 0 0 rgba(255, 61, 242, 0));
    }
}

@keyframes logoShine {
    0% {
        opacity: 0;
        background-position: 160% 0;
    }

    32% {
        opacity: 0;
    }

    54% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        background-position: -140% 0;
    }
}

@keyframes panelChromeGlow {
    0% {
        opacity: 0;
        box-shadow: 0 0 0 rgba(0, 245, 255, 0);
    }

    62% {
        opacity: 0.92;
        box-shadow:
            0 0 36px rgba(0, 245, 255, 0.22),
            0 0 50px rgba(255, 61, 242, 0.16);
    }

    100% {
        opacity: 1;
        box-shadow:
            0 0 30px rgba(0, 245, 255, 0.16),
            0 0 42px rgba(255, 61, 242, 0.14);
    }
}

@keyframes panelChromeHandoff {
    0% {
        opacity: 1;
        box-shadow:
            0 0 30px rgba(0, 245, 255, 0.16),
            0 0 42px rgba(255, 61, 242, 0.14);
    }

    56% {
        opacity: 0.84;
        box-shadow:
            inset 0 0 18px rgba(0, 245, 255, 0.06),
            0 0 22px rgba(0, 245, 255, 0.13),
            0 0 30px rgba(255, 61, 242, 0.1);
    }

    100% {
        opacity: 0.72;
        box-shadow:
            inset 0 0 22px rgba(0, 245, 255, 0.08),
            0 0 18px rgba(0, 245, 255, 0.14),
            0 0 24px rgba(255, 61, 242, 0.1);
    }
}

@keyframes panelBorderDraw {
    0% {
        opacity: 0;
        background-size: 0 1px, 1px 0, 0 1px, 1px 0;
    }

    18% {
        opacity: 1;
        background-size: 100% 1px, 1px 0, 0 1px, 1px 0;
    }

    46% {
        opacity: 1;
        background-size: 100% 1px, 1px 100%, 0 1px, 1px 0;
    }

    74% {
        opacity: 1;
        background-size: 100% 1px, 1px 100%, 100% 1px, 1px 0;
    }

    100% {
        opacity: 1;
        background-size: 100% 1px, 1px 100%, 100% 1px, 1px 100%;
    }
}

@keyframes panelBorderOrbit {
    0% {
        background-position: 180% 0, 100% 180%, -80% 100%, 0 -80%;
    }

    100% {
        background-position: -80% 0, 100% -80%, 180% 100%, 0 180%;
    }
}

@keyframes panelBorderOrbitEaseIn {
    0% {
        opacity: 0.28;
    }

    100% {
        opacity: 0.96;
    }
}

@keyframes panelBorderHandoffFade {
    0% {
        opacity: 1;
        filter:
            drop-shadow(0 0 10px rgba(0, 245, 255, 0.68))
            drop-shadow(0 0 14px rgba(255, 61, 242, 0.34));
    }

    42% {
        opacity: 0.96;
    }

    76% {
        opacity: 0.62;
    }

    100% {
        opacity: 0.42;
        filter:
            drop-shadow(0 0 5px rgba(0, 245, 255, 0.22))
            drop-shadow(0 0 6px rgba(255, 61, 242, 0.14));
    }
}

@keyframes panelBorderReadyGlow {
    0% {
        opacity: 0.72;
        box-shadow:
            inset 0 0 22px rgba(0, 245, 255, 0.08),
            0 0 18px rgba(0, 245, 255, 0.14),
            0 0 24px rgba(255, 61, 242, 0.1);
    }

    100% {
        opacity: 0.72;
        box-shadow:
            inset 0 0 22px rgba(0, 245, 255, 0.08),
            0 0 18px rgba(0, 245, 255, 0.14),
            0 0 24px rgba(255, 61, 242, 0.1);
    }
}

@keyframes panelCopyReveal {
    0% {
        opacity: 0;
        transform: translateY(8px);
        filter: blur(5px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

@keyframes titleIdlePulse {
    0%,
    100% {
        transform: scale(1);
        filter:
            drop-shadow(0 0 12px rgba(0, 245, 255, 0.22))
            drop-shadow(0 0 10px rgba(255, 61, 242, 0.1));
    }

    50% {
        transform: scale(1.012);
        filter:
            drop-shadow(0 0 18px rgba(0, 245, 255, 0.38))
            drop-shadow(0 0 14px rgba(255, 61, 242, 0.18));
    }
}

@keyframes titleStarGlitter {
    0% {
        opacity: 0;
        transform: translate(-18px, 10px) scale(0.18) rotate(-24deg);
    }

    22% {
        opacity: 1;
        transform: translate(-5px, 3px) scale(1.15) rotate(18deg);
    }

    44% {
        opacity: 0.45;
        transform: translate(0, 0) scale(0.72) rotate(58deg);
    }

    64% {
        opacity: 1;
        transform: translate(2px, -1px) scale(1.02) rotate(105deg);
    }

    100% {
        opacity: 0;
        transform: translate(9px, -7px) scale(0.24) rotate(160deg);
    }
}

.tagline,
.run-mantra {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    letter-spacing: 0;
    text-align: center;
}

.run-mantra {
    color: var(--gold);
    text-shadow: 0 0 14px rgba(255, 200, 87, 0.36);
}

.leaderboard-panel {
    display: grid;
    width: min(360px, 100%);
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(148, 233, 255, 0.2);
    border-radius: 8px;
    background: rgba(2, 6, 18, 0.42);
    box-shadow: inset 0 0 18px rgba(0, 245, 255, 0.06);
}

.leaderboard-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--cyan);
    font-size: 13px;
    text-transform: uppercase;
}

.leaderboard-heading small,
.leaderboard-empty,
.leaderboard-message,
.leaderboard-form label {
    color: var(--muted);
    font-size: 11px;
}

.leaderboard-list {
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(5, 22px);
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow: hidden;
}

.leaderboard-list:empty {
    display: none;
}

.leaderboard-row {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
    min-height: 22px;
    min-width: 0;
    padding: 0 6px;
    border-left: 1px solid rgba(148, 233, 255, 0.12);
    color: rgba(244, 251, 255, 0.86);
    font-size: 12px;
}

.leaderboard-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-podium {
    border-left-color: rgba(255, 200, 87, 0.38);
    background: rgba(255, 200, 87, 0.035);
}

.leaderboard-champion {
    border-left-color: var(--gold);
    color: #fff6c9;
    background: linear-gradient(90deg, rgba(255, 200, 87, 0.13), rgba(255, 200, 87, 0));
    text-shadow: 0 0 10px rgba(255, 200, 87, 0.24);
}

.leaderboard-champion .leaderboard-score {
    color: var(--gold);
}

.leaderboard-rank {
    color: var(--gold);
}

.leaderboard-score {
    color: var(--cyan);
}

.leaderboard-empty,
.leaderboard-message {
    margin: 0;
}

.leaderboard-profile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.leaderboard-profile small {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-form {
    display: grid;
    gap: 6px;
}

.leaderboard-input-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.leaderboard-input-row input {
    min-width: 0;
    min-height: 38px;
    border: 1px solid rgba(148, 233, 255, 0.36);
    border-radius: 8px;
    padding: 0 10px;
    color: var(--text);
    background: rgba(0, 245, 255, 0.06);
    outline: none;
}

.leaderboard-input-row input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 14px rgba(0, 245, 255, 0.22);
}

.auth-panel {
    display: grid;
    width: min(360px, 100%);
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(255, 61, 242, 0.2);
    border-radius: 8px;
    background: rgba(2, 6, 18, 0.34);
    box-shadow: inset 0 0 18px rgba(255, 61, 242, 0.055);
}

.auth-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--magenta);
    font-size: 13px;
    text-transform: uppercase;
}

.auth-heading small,
.auth-message {
    color: var(--muted);
    font-size: 11px;
}

.auth-email-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.auth-email-row input {
    min-width: 0;
    min-height: 38px;
    border: 1px solid rgba(255, 61, 242, 0.32);
    border-radius: 8px;
    padding: 0 10px;
    color: var(--text);
    background: rgba(255, 61, 242, 0.055);
    outline: none;
}

.auth-email-row input:focus {
    border-color: var(--magenta);
    box-shadow: 0 0 14px rgba(255, 61, 242, 0.18);
}

.auth-provider,
.auth-link {
    min-height: 38px;
    border: 1px solid rgba(148, 233, 255, 0.28);
    border-radius: 8px;
    padding: 0 12px;
    color: var(--text);
    background: rgba(148, 233, 255, 0.08);
    cursor: pointer;
}

.auth-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.google-provider-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.auth-provider.compact {
    min-width: 68px;
}

.auth-link {
    justify-self: start;
    min-height: 0;
    border: 0;
    padding: 0;
    color: var(--cyan);
    background: transparent;
}

.auth-provider:disabled,
.auth-email-row input:disabled {
    cursor: default;
    opacity: 0.42;
}

.auth-message {
    margin: 0;
}

.state-title {
    margin: 0;
    position: relative;
    color: var(--red);
    font-size: 28px;
    line-height: 1;
    text-shadow: 0 0 18px rgba(255, 53, 94, 0.72);
}

.high-score-title {
    color: #fff0bc;
    text-shadow:
        0 1px 0 rgba(2, 4, 10, 0.96),
        0 0 14px rgba(255, 200, 87, 0.92),
        0 0 28px rgba(255, 200, 87, 0.42);
    animation: highScoreGoldShine 1800ms ease-in-out infinite;
}

.high-score-title::before,
.high-score-title::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(255, 255, 255, 1) 0 13%, rgba(255, 200, 87, 0.95) 18% 31%, rgba(255, 200, 87, 0) 66%);
    filter:
        drop-shadow(0 0 8px rgba(255, 255, 255, 0.82))
        drop-shadow(0 0 16px rgba(255, 200, 87, 0.52));
    opacity: 0;
    transform: translateY(-50%) scale(0.3) rotate(0deg);
    animation: highScoreTwinkle 1800ms ease-in-out infinite;
}

.high-score-title::before {
    left: -24px;
}

.high-score-title::after {
    right: -24px;
    animation-delay: 620ms;
}

.all-time-score-title {
    max-width: 100%;
    color: #fff7d8;
    font-size: 32px;
    background: linear-gradient(90deg, #fff7d8 0%, #ffc857 28%, #ffffff 50%, #00f5ff 72%, #fff7d8 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow:
        0 0 12px rgba(255, 255, 255, 0.9),
        0 0 26px rgba(255, 200, 87, 0.88),
        0 0 52px rgba(0, 245, 255, 0.52);
    animation: allTimeTitlePulse 1200ms ease-in-out infinite;
}

.combo-callouts {
    position: fixed;
    inset: 0;
    z-index: 4;
    pointer-events: none;
}

.launch-countdown {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 5;
    min-width: 128px;
    transform: translate(-50%, -50%);
    color: #f6fdff;
    font-size: 88px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0;
    text-align: center;
    -webkit-text-stroke: 2px rgba(2, 6, 18, 0.72);
    text-stroke: 2px rgba(2, 6, 18, 0.72);
    text-shadow:
        0 0 14px rgba(255, 255, 255, 0.82),
        0 0 22px rgba(0, 245, 255, 0.48),
        0 0 36px rgba(255, 61, 242, 0.24);
    isolation: isolate;
    pointer-events: none;
}

.launch-countdown.countdown-pop {
    animation: launchCountdownPulse 820ms ease-out both;
}

.launch-countdown::before {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    z-index: -1;
    width: 148px;
    height: 148px;
    border-radius: 999px;
    background:
        radial-gradient(circle,
            rgba(2, 6, 18, 0.76) 0%,
            rgba(2, 6, 18, 0.58) 48%,
            rgba(2, 6, 18, 0) 73%);
    opacity: 0.94;
    transform: translate(-50%, -50%);
}

.launch-countdown::after {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    z-index: -1;
    width: 124px;
    height: 124px;
    border: 1px solid rgba(218, 248, 255, 0.42);
    border-radius: 999px;
    box-shadow:
        0 0 20px rgba(0, 245, 255, 0.18),
        inset 0 0 18px rgba(255, 61, 242, 0.12);
    opacity: 0.62;
    transform: translate(-50%, -50%);
}

.launch-countdown[data-count="1"] {
    color: #fff0bc;
    text-shadow:
        0 0 14px rgba(255, 255, 255, 0.9),
        0 0 28px rgba(255, 200, 87, 0.68),
        0 0 44px rgba(0, 245, 255, 0.28);
}

.combo-callout {
    position: absolute;
    top: 30%;
    min-width: 120px;
    padding: 12px 20px;
    border: 1px solid rgba(255, 232, 166, 0.82);
    border-radius: 8px;
    color: #fff4c7;
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.3), rgba(255, 200, 87, 0.16) 42%, rgba(6, 8, 18, 0.02) 72%),
        rgba(6, 8, 18, 0.34);
    box-shadow:
        inset 0 0 18px rgba(255, 200, 87, 0.22),
        0 0 18px rgba(255, 200, 87, 0.46),
        0 0 42px rgba(255, 200, 87, 0.18);
    font-size: 44px;
    line-height: 1;
    text-align: center;
    text-shadow:
        0 1px 0 rgba(2, 4, 10, 0.95),
        0 0 14px rgba(255, 200, 87, 0.95);
    animation: comboMilestonePop 2200ms ease-out forwards;
}

.combo-callout::before,
.combo-callout::after {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    width: 74px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
    opacity: 0.86;
    transform: translate(-50%, -50%);
}

.combo-callout::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

.combo-callout-left {
    left: 16%;
}

.combo-callout-right {
    right: 16%;
}

.neon-firework {
    position: absolute;
    top: 44%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    box-shadow:
        0 0 10px rgba(255, 255, 255, 0.92),
        0 0 20px rgba(0, 245, 255, 0.62),
        0 0 30px rgba(255, 61, 242, 0.38);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.2);
    animation: neonFireworkBurst 1550ms ease-out forwards;
}

.neon-firework::before,
.neon-firework::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    box-shadow:
        0 -46px var(--cyan),
        32px -32px var(--magenta),
        46px 0 var(--gold),
        32px 32px var(--cyan),
        0 46px var(--magenta),
        -32px 32px var(--gold),
        -46px 0 var(--cyan),
        -32px -32px var(--magenta);
    transform: translate(-50%, -50%);
}

.neon-firework::after {
    box-shadow:
        0 -34px var(--gold),
        24px -24px var(--cyan),
        34px 0 var(--magenta),
        24px 24px var(--gold),
        0 34px var(--cyan),
        -24px 24px var(--magenta),
        -34px 0 var(--gold),
        -24px -24px var(--cyan);
    transform: translate(-50%, -50%) rotate(22deg);
}

.neon-firework-left {
    left: 18%;
    top: 42%;
}

.neon-firework-upper-left {
    left: 32%;
    top: 28%;
    animation-delay: 140ms;
}

.neon-firework-center {
    left: 50%;
    top: 36%;
    animation-delay: 260ms;
}

.neon-firework-upper-right {
    left: 68%;
    top: 28%;
    animation-delay: 90ms;
}

.neon-firework-right {
    left: 82%;
    top: 42%;
    animation-delay: 210ms;
}

.record-trophy-stage {
    position: fixed;
    top: 50%;
    left: max(16px, calc(50% - 500px));
    z-index: 6;
    width: 190px;
    height: 240px;
    perspective: 780px;
    pointer-events: none;
}

.record-trophy-aura {
    position: absolute;
    inset: 12px 0 0;
    border: 1px solid rgba(255, 225, 135, 0.52);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.24), rgba(255, 200, 87, 0.12) 34%, rgba(0, 245, 255, 0.08) 52%, transparent 72%);
    box-shadow:
        0 0 28px rgba(255, 200, 87, 0.5),
        inset 0 0 30px rgba(0, 245, 255, 0.2);
    animation: recordTrophyAura 1600ms ease-in-out infinite;
}

.record-trophy {
    position: absolute;
    top: 12px;
    left: 20px;
    width: 150px;
    height: 210px;
    transform: rotateX(-8deg) rotateY(-18deg);
    transform-style: preserve-3d;
    filter:
        drop-shadow(0 0 12px rgba(255, 244, 202, 0.96))
        drop-shadow(0 0 28px rgba(255, 200, 87, 0.78))
        drop-shadow(0 0 42px rgba(0, 245, 255, 0.38));
    will-change: transform;
    animation: recordTrophySpin 4200ms cubic-bezier(0.42, 0, 0.58, 1) infinite;
}

.record-trophy span {
    position: absolute;
    display: block;
    pointer-events: none;
}

.trophy-cup,
.trophy-depth {
    top: 25px;
    left: 27px;
    width: 96px;
    height: 82px;
    border: 1px solid rgba(255, 248, 213, 0.96);
    clip-path: polygon(4% 0, 96% 0, 83% 68%, 65% 94%, 35% 94%, 17% 68%);
}

.trophy-cup {
    z-index: 3;
    background:
        linear-gradient(105deg, #6f3d00 0%, #ffbd31 24%, #fff9d9 48%, #ffce55 62%, #8a4c00 100%);
    box-shadow:
        inset 0 0 20px rgba(255, 255, 255, 0.5),
        0 0 18px rgba(255, 200, 87, 0.86);
    transform: translateZ(18px);
}

.trophy-depth {
    z-index: 1;
    background: linear-gradient(100deg, #2d2a16, #a86800 46%, #043d50);
    opacity: 0.86;
    transform: translateZ(-18px) rotateY(180deg);
}

.trophy-lip {
    top: 19px;
    left: 20px;
    z-index: 4;
    width: 110px;
    height: 14px;
    border: 1px solid rgba(255, 255, 255, 0.94);
    border-radius: 50%;
    background: linear-gradient(90deg, #8a4c00, #ffe59a 38%, #ffffff 52%, #ffc857 72%, #6f3d00);
    box-shadow: 0 0 16px rgba(255, 200, 87, 0.94);
    transform: translateZ(20px);
}

.trophy-handle {
    top: 32px;
    z-index: 2;
    width: 52px;
    height: 58px;
    border: 9px solid #ffc857;
    border-radius: 50%;
    box-shadow:
        inset 0 0 10px rgba(255, 255, 255, 0.68),
        0 0 14px rgba(255, 200, 87, 0.82);
    transform: translateZ(2px);
}

.trophy-handle-left {
    left: 1px;
}

.trophy-handle-right {
    right: 1px;
}

.trophy-star {
    top: 48px;
    left: 61px;
    z-index: 5;
    width: 28px;
    height: 28px;
    background: #fff7d8;
    clip-path: polygon(50% 0, 61% 37%, 100% 50%, 61% 62%, 50% 100%, 39% 62%, 0 50%, 39% 37%);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.96);
    transform: translateZ(25px) rotate(18deg);
}

.trophy-stem {
    top: 101px;
    left: 65px;
    z-index: 2;
    width: 20px;
    height: 60px;
    border: 1px solid rgba(255, 247, 210, 0.88);
    background: linear-gradient(90deg, #7b4300, #fff1ae 48%, #a45f00);
    box-shadow: 0 0 15px rgba(255, 200, 87, 0.72);
    transform: translateZ(12px);
}

.trophy-base {
    top: 156px;
    left: 31px;
    z-index: 3;
    width: 88px;
    height: 25px;
    border: 1px solid rgba(255, 248, 220, 0.92);
    border-radius: 4px;
    background: linear-gradient(105deg, #603400, #ffcb58 30%, #fff8d2 50%, #a45b00 84%);
    box-shadow: 0 0 18px rgba(255, 200, 87, 0.84);
    transform: translateZ(16px) rotateX(5deg);
}

.trophy-base-lower {
    top: 180px;
    left: 20px;
    width: 110px;
    height: 24px;
    background: linear-gradient(105deg, #063747, #00c4cf 24%, #fff0ad 50%, #0094a4 74%, #041f2b);
    box-shadow:
        0 0 18px rgba(0, 245, 255, 0.82),
        0 0 30px rgba(255, 200, 87, 0.48);
    transform: translateZ(12px) rotateX(5deg);
}

@keyframes comboMilestonePop {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.62);
        filter: blur(6px);
    }

    18% {
        opacity: 1;
        transform: translateY(0) scale(1.14);
        filter: blur(0);
    }

    48% {
        opacity: 1;
        transform: translateY(-6px) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-30px) scale(0.86);
        filter: blur(2px);
    }
}

@keyframes highScoreGoldShine {
    0%,
    100% {
        filter: brightness(1);
        transform: scale(1);
    }

    50% {
        filter: brightness(1.28);
        transform: scale(1.035);
    }
}

@keyframes highScoreTwinkle {
    0%,
    100% {
        opacity: 0;
        transform: translateY(-50%) scale(0.3) rotate(0deg);
    }

    35% {
        opacity: 1;
        transform: translateY(-50%) scale(1.1) rotate(65deg);
    }

    62% {
        opacity: 0.46;
        transform: translateY(-50%) scale(0.72) rotate(122deg);
    }
}

@keyframes allTimeTitlePulse {
    0%,
    100% {
        background-position: 0% 50%;
        filter: brightness(1);
        transform: scale(1);
    }

    50% {
        background-position: 100% 50%;
        filter: brightness(1.45);
        transform: scale(1.06);
    }
}

@keyframes recordTrophySpin {
    0% {
        transform: rotateX(-8deg) rotateY(-18deg) translateY(0);
    }

    50% {
        transform: rotateX(7deg) rotateY(162deg) translateY(-10px);
    }

    100% {
        transform: rotateX(-8deg) rotateY(342deg) translateY(0);
    }
}

@keyframes recordTrophyAura {
    0%,
    100% {
        opacity: 0.54;
        transform: rotate(0deg) scale(0.9);
    }

    50% {
        opacity: 1;
        transform: rotate(180deg) scale(1.08);
    }
}

@keyframes neonFireworkBurst {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.16);
        filter: blur(4px);
    }

    22% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.92);
        filter: blur(0);
    }

    70% {
        opacity: 0.72;
        transform: translate(-50%, -50%) scale(1.28);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.7);
        filter: blur(2px);
    }
}

@keyframes launchCountdownPulse {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.38);
        filter: blur(8px);
    }

    24% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.14);
        filter: blur(0);
    }

    68% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        opacity: 0.72;
        transform: translate(-50%, -50%) scale(0.92);
    }
}

.menu-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    width: 100%;
    margin-top: 8px;
}

.primary-action,
.sound-toggle {
    min-height: 44px;
    border: 1px solid var(--cyan);
    border-radius: 8px;
    color: var(--text);
    background: rgba(0, 245, 255, 0.08);
    box-shadow: 0 0 18px rgba(0, 245, 255, 0.22);
    cursor: pointer;
    pointer-events: auto;
}

.primary-action {
    min-width: 168px;
    padding: 0 20px;
    font-size: 20px;
}

.primary-action.compact {
    min-width: 78px;
    min-height: 38px;
    padding: 0 12px;
    font-size: 14px;
}

.primary-action:hover,
.sound-toggle:hover,
.profile-links a:hover {
    color: var(--cyan);
    text-shadow: 0 0 12px rgba(0, 245, 255, 0.75);
}

.primary-action.danger {
    border-color: var(--red);
    background: rgba(255, 53, 94, 0.1);
    box-shadow: 0 0 18px rgba(255, 53, 94, 0.28);
}

.profile-links {
    position: fixed;
    right: 24px;
    bottom: 22px;
    display: flex;
    gap: 16px;
    align-items: center;
    font-size: 13px;
    pointer-events: auto;
}

.profile-links a {
    color: var(--muted);
}

.sound-toggle {
    position: fixed;
    left: 24px;
    bottom: 20px;
    min-width: 118px;
    padding: 0 14px;
    color: var(--muted);
    font-size: 13px;
}

.hidden {
    display: none !important;
}

@media (max-width: 640px) {
    .hud-strip {
        top: 12px;
        width: calc(100vw - 24px);
        justify-content: space-between;
    }

    .hud-stat {
        min-width: 0;
        width: 25%;
        padding: 7px 8px;
    }

    .hud-stat strong {
        font-size: 18px;
    }

    #title {
        font-size: 42px;
    }

    .start-panel {
        padding: 24px 18px;
    }

    .leaderboard-panel {
        width: 100%;
        padding: 10px;
    }

    .combo-callout {
        top: 36%;
        min-width: 96px;
        padding: 10px 14px;
        font-size: 32px;
    }

    .combo-callout-left {
        left: 7%;
    }

    .combo-callout-right {
        right: 7%;
    }

    .launch-countdown {
        min-width: 96px;
        font-size: 64px;
    }

    .launch-countdown::before,
    .launch-countdown::after {
        width: 96px;
        height: 96px;
    }

    .all-time-score-title {
        font-size: 25px;
    }

    .record-trophy-stage {
        top: 14%;
        left: auto;
        right: 4px;
        transform: scale(0.28);
        transform-origin: top right;
    }

    .profile-links {
        right: 14px;
        bottom: 14px;
        gap: 10px;
        font-size: 11px;
    }

    .sound-toggle {
        left: 14px;
        bottom: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #title,
    #title::before,
    #title::after,
    .title-text,
    .title-depth,
    .title-star,
    .combo-callout,
    .launch-countdown,
    .neon-firework,
    .panel-orbit,
    .panel-orbit::before,
    .panel-orbit::after,
    .high-score-title,
    .high-score-title::before,
    .high-score-title::after,
    .all-time-score-title,
    .record-trophy,
    .record-trophy-aura,
    .start-panel.panel-ready::before,
    .start-panel.intro-panel::before,
    .start-panel.intro-panel > :not(#title):not(.panel-orbit) {
        animation: none;
        filter: none;
        transform: none;
    }

    #title::before,
    #title::after,
    .title-depth,
    .title-star {
        opacity: 0;
    }

    .start-panel.intro-panel {
        border-color: var(--line);
        background: var(--panel-strong);
        box-shadow: 0 0 42px rgba(255, 61, 242, 0.16);
        pointer-events: auto;
    }

    .start-panel.intro-panel::before {
        display: none;
    }

    .start-panel.panel-ready::before {
        animation: none;
    }

    .start-panel.intro-panel > :not(#title):not(.panel-orbit) {
        opacity: 1;
        pointer-events: auto;
    }

    .start-panel.intro-panel .primary-action {
        pointer-events: auto;
    }
}
