
/* Website colors */

:root {
    --background: #f6f3eb;
    --text: #262620;
    --secondary-text: #77746b;
    --accent: #f3a34e;
    --border: #dedbd2;
    --white: #fffdf7;
}

/* Basic reset */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--background);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* Navigation */

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 30px;
    font-weight: 900;
    letter-spacing: -2px;
}

.nav-buttons {
    display: flex;
    gap: 10px;
}

.nav-buttons button {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: bold;
}

/* Screen management */

main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
}

.screen {
    display: none;
    width: 100%;
    max-width: 520px;
    text-align: center;
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Home screen */

.eye-logo {
    width: 160px;
    margin-bottom: 24px;
}

.eye-logo svg {
    width: 100%;
    display: block;
}

h1 {
    font-size: clamp(42px, 8vw, 64px);
    font-weight: 900;
    letter-spacing: -3px;
    line-height: 1.05;
}

.subtitle {
    color: var(--secondary-text);
    font-size: 17px;
    line-height: 1.6;
    margin-top: 20px;
    margin-bottom: 26px;
}

.daily-label {
    background: #e8e4db;
    border-radius: 30px;
    padding: 9px 16px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
}

/* Buttons */

.primary-button {
    background: var(--accent);
    color: var(--text);
    border: 2px solid var(--text);
    border-radius: 12px;
    box-shadow: 0 4px 0 var(--text);
    padding: 17px 30px;
    font-size: 17px;
    font-weight: bold;
    transition: transform 0.15s, box-shadow 0.15s;
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 var(--text);
}

.primary-button:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 var(--text);
}

.text-button {
    background: transparent;
    border: none;
    color: var(--secondary-text);
    font-size: 14px;
    text-decoration: underline;
    padding: 12px;
    margin-top: 15px;
}

.text-button:hover {
    color: var(--text);
}

/* Game screen */

.game-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 18px;
    font-weight: bold;
}

#timer {
    font-variant-numeric: tabular-nums;
}

#progress-bar {
    width: 100%;
    height: 7px;
    background: var(--border);
    border-radius: 20px;
    margin: 18px 0 40px;
    overflow: hidden;
}

#progress-fill {
    width: 14.285%;
    height: 100%;
    background: var(--accent);
    border-radius: 20px;
}

#question-title {
    font-size: 28px;
    margin-bottom: 25px;
}

#game-content {
    width: 100%;
    min-height: 280px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* Footer */

footer {
    text-align: center;
    color: var(--secondary-text);
    font-size: 12px;
    padding: 24px;
}

/* ========================================
   MINIGAME COMPONENTS
======================================== */

#game-content {
    flex-direction: column;
    gap: 20px;
}

/* Grace period */

.grace-container {
    width: 100%;
    text-align: center;
}

#grace-label {
    font-size: 13px;
    font-weight: bold;
    color: var(--secondary-text);
    margin-bottom: 10px;
}

.grace-track {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 20px;
    overflow: hidden;
}

#grace-fill {
    width: 100%;
    height: 100%;
    background: #65a77c;
    border-radius: 20px;
}

/* Timer states */

#timer {
    transition: color 0.2s;
}

#timer.grace {
    color: #529268;
}

#timer.running {
    color: #d65b4c;
}

/* Fill minigame */

.fill-circle {
    width: 100%;
    max-width: 240px;
    margin: 10px auto;
}

.fill-circle svg {
    width: 100%;
    display: block;
}

/* Answer controls */

.answer-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.answer-input-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.answer-input {
    width: 100px;
    background: transparent;
    color: var(--text);
    font-size: 40px;
    font-weight: 900;
    text-align: center;
    border: none;
    border-bottom: 2px solid var(--border);
    outline: none;
    font-variant-numeric: tabular-nums;
}

.answer-input:focus {
    border-color: var(--accent);
}

.answer-unit {
    font-size: 28px;
    font-weight: bold;
}

.answer-slider {
    width: 100%;
    max-width: 300px;
    cursor: pointer;
    accent-color: var(--accent);
}

.answer-controls .primary-button {
    width: 100%;
    max-width: 300px;
}

.primary-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Answer results */

.round-result {
    width: 100%;
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.result-heading {
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 18px;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
}

.result-row span {
    color: var(--secondary-text);
}

.penalty-value {
    color: #d65b4c;
}

.total-result {
    border-top: 1px solid var(--border);
    margin-top: 10px;
    padding-top: 16px;
}

.total-result strong {
    font-size: 30px;
}

.round-result .primary-button {
    width: 100%;
    margin-top: 20px;
}

/* ========================================
   MINIGAME 02: FLASH COUNT
======================================== */

.flash-arena {
    position: relative;
    width: 100%;
    max-width: 340px;
    aspect-ratio: 1 / 1;
    background: #eeeae1;
    border: 2px solid var(--border);
    border-radius: 18px;
    overflow: hidden;

    display: flex;
    align-items: center;
    justify-content: center;
}

/* Preparation countdown */

.flash-countdown {
    font-size: 100px;
    font-weight: 900;
    color: var(--accent);
    line-height: 1;

    animation: countdown-pop 0.35s ease-out;
}

@keyframes countdown-pop {
    0% {
        transform: scale(0.65);
        opacity: 0;
    }

    65% {
        transform: scale(1.12);
        opacity: 1;
    }

    100% {
        transform: scale(1);
    }
}

/* Flashing blocks */

.flash-block {
    position: absolute;
    width: 10%;
    height: 10%;

    background: var(--accent);
    border: 2px solid var(--text);
    border-radius: 5px;
}

/* Hidden block screen */

.flash-question-mark {
    font-size: 100px;
    font-weight: 900;
    color: var(--secondary-text);
    opacity: 0.3;
}

.flash-instruction {
    color: var(--secondary-text);
    font-size: 15px;
    font-weight: bold;
    text-align: center;
}

#flash-answer {
    width: 130px;
}

#flash-controls[hidden] {
    display: none;
}
/* ========================================
   RESPONSIVE GAME LAYOUT
======================================== */

body {
    min-height: 100dvh;
}

body.game-playing .navbar {
    padding: 10px 24px;
}

body.game-playing main {
    padding: 10px 16px;
}

body.game-playing footer {
    padding: 8px;
    font-size: 11px;
}

#game-screen {
    max-width: 520px;
}

#game-screen #progress-bar {
    margin: 10px 0 14px;
}

#game-screen #question-title {
    font-size: clamp(18px, 3vh, 26px);
    margin-bottom: 12px;
}

#game-screen #game-content {
    min-height: 0;
    padding: 14px;
    gap: 10px;
}

/* Responsive minigame sizes */

.fill-circle {
    width: min(100%, 26dvh, 220px);
    margin: 4px auto;
}

.flash-arena {
    width: min(100%, 30dvh, 280px);
    flex-shrink: 0;
}

/* More compact answer controls */

.answer-controls {
    gap: 10px;
}

.answer-input {
    font-size: 32px;
}

.answer-unit {
    font-size: 24px;
}

#game-screen .primary-button {
    padding: 10px 24px;
    font-size: 15px;
}

#game-screen .text-button {
    margin-top: 4px;
    padding: 8px;
}

#grace-label {
    margin-bottom: 6px;
}

/* Compact feedback */

#round-feedback:empty {
    display: none;
}

.round-result {
    padding-top: 10px;
}

.result-heading {
    font-size: 20px;
    margin-bottom: 6px;
}

.result-row {
    padding: 4px 0;
}

.total-result {
    margin-top: 6px;
    padding-top: 8px;
}

.total-result strong {
    font-size: 24px;
}

.round-result .primary-button {
    margin-top: 10px;
}

/* Free up space after submitting an answer */

#game-content.round-finished .answer-controls {
    display: none;
}

#game-content.round-finished .grace-container {
    display: none;
}

#game-content.round-finished .fill-circle,
#game-content.round-finished .flash-arena {
    width: min(100%, 18dvh, 150px);
}

/* Smaller browser windows */

@media (max-height: 700px) {

    body.game-playing footer {
        display: none;
    }

    body.game-playing .navbar {
        padding: 8px 16px;
    }

    body.game-playing .logo {
        font-size: 24px;
    }

    #game-screen #game-content {
        padding: 10px;
        gap: 8px;
    }

    .fill-circle,
    .flash-arena {
        width: min(100%, 24dvh, 200px);
    }

    .flash-countdown,
    .flash-question-mark {
        font-size: 65px;
    }
}

/* ========================================
   MINIGAME 03: ANGLE
======================================== */

.angle-arena {
    width: min(100%, 30dvh, 280px);
    aspect-ratio: 1 / 1;
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #eeeae1;
    border: 2px solid var(--border);
    border-radius: 18px;

    overflow: hidden;
}

.angle-arena svg {
    width: 100%;
    height: 100%;
    display: block;
}

.angle-line {
    stroke: var(--text);
    stroke-width: 5;
    stroke-linecap: round;
}

.angle-arc {
    stroke: var(--accent);
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
}

.angle-sector {
    fill: var(--accent);
    opacity: 0.18;
}

.angle-origin {
    fill: var(--text);
}

.angle-reveal {
    font-size: 22px;
    font-weight: 900;
    fill: var(--text);
    text-anchor: middle;
}

#game-content.round-finished .angle-arena {
    width: min(100%, 18dvh, 150px);
}

@media (max-height: 700px) {

    .angle-arena {
        width: min(100%, 24dvh, 200px);
    }

}

/* ========================================
   MINIGAME 04: CENTERPOINT
======================================== */

.center-arena {
    width: min(100%, 36dvh, 340px);
    aspect-ratio: 1 / 1;
    flex-shrink: 0;

    background: #eeeae1;
    border: 2px solid var(--border);
    border-radius: 18px;

    overflow: hidden;
}

.center-arena svg {
    width: 100%;
    height: 100%;
    display: block;

    cursor: crosshair;
    touch-action: manipulation;
    user-select: none;
}

.center-shape {
    fill: var(--accent);
    fill-opacity: 0.65;

    stroke: var(--text);
    stroke-width: 2.5;
    stroke-linejoin: round;
}

.center-guess {
    fill: #d65b4c;
    stroke: white;
    stroke-width: 2;
}

.center-correct {
    fill: #529268;
    stroke: white;
    stroke-width: 2;
}

.center-error-line {
    stroke: #d65b4c;
    stroke-width: 2;
    stroke-dasharray: 5 4;
}

.center-instruction {
    color: var(--secondary-text);
    font-size: 14px;
    font-weight: bold;
}

.center-legend {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    font-size: 12px;
}

.center-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.center-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.center-legend-dot.guess {
    background: #d65b4c;
}

.center-legend-dot.correct {
    background: #529268;
}

#game-content.round-finished .center-arena {
    width: min(100%, 23dvh, 180px);
}

#game-content.round-finished .center-arena svg {
    cursor: default;
}

@media (max-height: 700px) {

    .center-arena {
        width: min(100%, 30dvh, 240px);
    }

}

/* ========================================
   MINIGAME 05: ODD SHADE
======================================== */

.shade-arena {
    width: min(100%, 36dvh, 340px);
    aspect-ratio: 1 / 1;

    display: grid;
    gap: 6px;

    padding: 10px;

    background: #eeeae1;
    border: 2px solid var(--border);
    border-radius: 18px;

    flex-shrink: 0;
}

.shade-tile {
    position: relative;

    width: 100%;
    height: 100%;

    min-width: 0;
    min-height: 0;

    border: none;
    border-radius: 7px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: clamp(12px, 3dvh, 26px);
    font-weight: 900;
    color: white;

    cursor: pointer;

    transition: transform 0.12s;
    touch-action: manipulation;
}

.shade-tile:not(:disabled):active {
    transform: scale(0.90);
}

.shade-tile:focus-visible {
    outline: 3px solid var(--text);
    outline-offset: 2px;
}

.shade-tile.wrong {
    cursor: default;

    animation: shade-shake 0.25s ease-out;
}

.shade-tile.correct {
    outline: 3px solid #529268;
    outline-offset: 2px;

    animation: shade-pop 0.3s ease-out;
}

.shade-tile:disabled {
    cursor: default;
}

.shade-instruction {
    font-size: 14px;
    font-weight: bold;
    color: var(--secondary-text);
}

.shade-penalty {
    color: #d65b4c;
}

.shade-success {
    color: #529268;
}

@keyframes shade-shake {

    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    75% {
        transform: translateX(4px);
    }
}

@keyframes shade-pop {

    0% {
        transform: scale(0.85);
    }

    60% {
        transform: scale(1.10);
    }

    100% {
        transform: scale(1);
    }
}

#game-content.round-finished .shade-arena {
    width: min(100%, 23dvh, 180px);
    gap: 4px;
    padding: 6px;
}

@media (max-height: 700px) {

    .shade-arena {
        width: min(100%, 30dvh, 240px);
    }

}

/* ========================================
   MINIGAME 06: SNAPSHOT
======================================== */

.snapshot-arena {
    position: relative;

    width: min(100%, 36dvh, 340px);
    aspect-ratio: 1 / 1;

    display: grid;
    gap: 6px;

    padding: 10px;

    background: #eeeae1;
    border: 2px solid var(--border);
    border-radius: 18px;

    flex-shrink: 0;
    overflow: hidden;
}

/* Individual memory tiles */

.snapshot-tile {
    width: 100%;
    height: 100%;

    min-width: 0;
    min-height: 0;

    background: #dcd8ce;

    border: 2px solid transparent;
    border-radius: 8px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: clamp(12px, 3dvh, 26px);
    font-weight: 900;
    color: white;

    cursor: pointer;

    transition:
        background 0.12s,
        transform 0.12s;

    touch-action: manipulation;
}

.snapshot-tile:disabled {
    cursor: default;
}

.snapshot-tile:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 2px;
}

/* Highlighted memorization tiles */

.snapshot-tile.highlighted {
    background: var(--accent);
    border-color: var(--text);
}

/* Player-selected tiles */

.snapshot-tile.selected {
    background: var(--accent);
    border-color: var(--text);

    animation: shade-pop 0.2s ease-out;
}

.snapshot-tile:not(:disabled):active {
    transform: scale(0.90);
}

/* Result colors */

.snapshot-tile.correct {
    background: #529268;
}

.snapshot-tile.incorrect {
    background: #d65b4c;
}

.snapshot-tile.missed {
    background: #d9ad60;
}

/* Countdown overlay */

.snapshot-countdown {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #eeeae1;

    font-size: 100px;
    font-weight: 900;
    color: var(--accent);

    z-index: 2;

    pointer-events: none;
}

.snapshot-countdown[hidden] {
    display: none;
}

.snapshot-countdown span {
    animation: countdown-pop 0.35s ease-out;
}

/* Instructions */

.snapshot-instruction {
    font-size: 14px;
    font-weight: bold;
    color: var(--secondary-text);
}

#snapshot-controls[hidden] {
    display: none;
}

/* Results legend */

.snapshot-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;

    gap: 12px;
    font-size: 12px;
}

.snapshot-legend-correct {
    color: #529268;
}

.snapshot-legend-incorrect {
    color: #d65b4c;
}

.snapshot-legend-missed {
    color: #a47a32;
}

/* Responsive results */

#game-content.round-finished .snapshot-arena {
    width: min(100%, 23dvh, 180px);

    gap: 4px;
    padding: 6px;
}

#game-content.round-finished .snapshot-tile {
    border-radius: 5px;
    font-size: 14px;
}

@media (max-height: 700px) {

    .snapshot-arena {
        width: min(100%, 30dvh, 240px);
    }

    .snapshot-countdown {
        font-size: 65px;
    }

}
/* Compact Snapshot results */

#game-content.round-finished .snapshot-arena {
    width: min(100%, 18dvh, 140px);
}

#game-content.round-finished:has(.snapshot-arena) {
    gap: 6px;
}

#game-content.round-finished:has(.snapshot-arena)
.result-row {
    padding: 2px 0;
}

#game-content.round-finished:has(.snapshot-arena)
.result-heading {
    margin-bottom: 4px;
}

#game-content.round-finished:has(.snapshot-arena)
.round-result {
    padding-top: 6px;
}

/* ========================================
   MINIGAME 07: INTERNAL CLOCK
======================================== */

.clock-arena {
    width: min(100%, 32dvh, 280px);
    aspect-ratio: 1 / 1;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #eeeae1;
    border: 2px solid var(--border);
    border-radius: 18px;

    flex-shrink: 0;
    overflow: hidden;
}

.clock-arena svg {
    width: 100%;
    height: 100%;
    display: block;
}

.clock-body {
    fill: var(--white);
    stroke: var(--text);
    stroke-width: 4;
}

.clock-top {
    fill: var(--text);
}

.clock-tick {
    stroke: var(--text);
    stroke-width: 3;
    stroke-linecap: round;
}

.clock-display {
    font-size: 34px;
    font-weight: 900;

    fill: var(--text);
    text-anchor: middle;

    font-variant-numeric: tabular-nums;
}

.clock-instruction {
    color: var(--secondary-text);
    font-size: 14px;
    font-weight: bold;
}

.clock-target {
    color: var(--text);
    font-size: 18px;
    font-weight: 900;
}

.clock-running .clock-display {
    fill: var(--accent);
}

.clock-stop-button {
    background: #d65b4c;
    color: white;
}

/* Stopwatch button feedback */

.clock-stop-button:active {
    transform: scale(0.95);
}

/* Correct and incorrect timing */

.clock-perfect .clock-display {
    fill: #529268;
}

.clock-inaccurate .clock-display {
    fill: #d65b4c;
}

/* Compact results */

#game-content.round-finished .clock-arena {
    width: min(100%, 20dvh, 160px);
}

@media (max-height: 700px) {

    .clock-arena {
        width: min(100%, 26dvh, 220px);
    }

}

/* ========================================
   OBSERVATION PERIOD CONTROL LOCK
======================================== */

#game-content.controls-locked .answer-controls {
    opacity: 0.45;
    transition: opacity 0.2s ease;
}

#game-content.controls-locked button,
#game-content.controls-locked input,
#game-content.controls-locked svg {
    cursor: not-allowed;
}

/* Make the observation countdown noticeable */

#game-content.controls-locked #grace-label {
    color: #b58036;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 1px;
}

#game-content.controls-locked #grace-fill {
    background: var(--accent);
}

#game-content.controls-locked .grace-track {
    height: 8px;
}

/* Active response period */

#timer.running {
    color: #d65b4c;
}

/* ========================================
   EYEBALL V2 — DEEP SEA ARCADE
======================================== */

:root {
    --background: #060e1c;
    --text: #edf6ff;
    --secondary-text: #91a9c7;
    --accent: #8de6f2;
    --border: #304969;
    --white: #101e36;

    --panel: #152740;
    --panel-dark: #0a1528;
    --gold: #ffcc78;
    --purple: #c4adff;
    --success: #6ef0c2;
    --danger: #ff748e;

    --game-font: "Fredoka", Arial, sans-serif;
    --number-font: "Space Mono", monospace;
}


/* ========================================
   BACKGROUND AND SCREEN
======================================== */

body {
    font-family: var(--game-font);

    background:
        radial-gradient(
            ellipse at 50% 0%,
            #203b60 0%,
            transparent 55%
        ),
        radial-gradient(
            ellipse at 10% 90%,
            #142c47 0%,
            transparent 45%
        ),
        var(--background);

    color: var(--text);

    overflow-x: hidden;
}


/* Subtle CRT scanlines.
   Do not place them over the puzzles. */

.navbar,
footer,
#home-screen,
.challenge-card {
    position: relative;
}

.navbar::after,
footer::after,
#home-screen::after,
.challenge-card::after {

    content: "";

    position: absolute;
    inset: 0;

    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 3px,
        rgba(0, 0, 0, 0.07) 3px,
        rgba(0, 0, 0, 0.07) 4px
    );

    border-radius: inherit;

    pointer-events: none;
}


/* ========================================
   NAVIGATION
======================================== */

.navbar {
    max-width: 760px;

    border-bottom:
        2px solid var(--border);
}

.logo {
    font-family: var(--game-font);
    font-weight: 700;
    font-size: 34px;
    letter-spacing: -1.5px;
    color: var(--accent);

    text-shadow: 0 3px 0 #315a80;
}

.nav-buttons button {
    background: var(--panel);
    color: var(--text);

    border: 2px solid var(--border);
    border-radius: 12px;

    box-shadow: 0 3px 0 #050b15;

    transition:
        transform 0.15s,
        background 0.15s;
}

.nav-buttons button:hover {
    background: #233d5d;
    transform: translateY(-2px);
}


/* ========================================
   HOME SCREEN
======================================== */

#home-screen {
    padding: 30px 20px;

    background: linear-gradient(
        155deg,
        #182d48,
        #0e1a30
    );

    border: 3px solid var(--border);
    border-radius: 32px;

    box-shadow:
        0 10px 0 #030912,
        inset 0 0 35px rgba(0, 0, 0, 0.2),
        0 0 60px rgba(74, 166, 232, 0.07);
}

h1 {
    font-weight: 700;
    letter-spacing: -1.5px;
    line-height: 1.05;

    text-shadow: 0 4px 0 #070e1a;
}

.subtitle {
    color: var(--secondary-text);
    font-weight: 400;
}

.daily-label {
    background: #203954;
    color: var(--accent);

    border: 1px solid #395c7a;

    font-family: var(--number-font);
    font-size: 11px;
}


/* Recolor our original eye logo. */

.eye-logo svg path {
    fill: #dceeff;
    stroke: #060e1c;
}

.eye-logo svg circle:nth-of-type(1) {
    fill: var(--accent);
    stroke: #060e1c;
}

.eye-logo svg circle:nth-of-type(2) {
    fill: #060e1c;
}

.eye-logo {
    filter: drop-shadow(
        0 0 18px rgba(141, 230, 242, 0.22)
    );

    animation: eye-float 4s ease-in-out infinite;
}

@keyframes eye-float {

    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }

}


/* ========================================
   BUTTONS
======================================== */

.primary-button {
    background: var(--accent);
    color: #102039;

    border: 2px solid #07101e;
    border-radius: 15px;

    box-shadow:
        0 5px 0 #315a80;

    font-family: var(--game-font);
    font-size: 19px;
    font-weight: 600;

    transition:
        transform 0.2s,
        box-shadow 0.2s,
        background 0.2s;
}

.primary-button:hover {
    background: #b5f5ff;

    transform: translateY(-3px);

    box-shadow:
        0 8px 0 #315a80;
}

.primary-button:active {
    transform: translateY(4px);

    box-shadow:
        0 1px 0 #315a80;
}

.primary-button:disabled {
    transform: none;
}

.text-button {
    color: var(--secondary-text);
    font-weight: 500;
}

.text-button:hover {
    color: var(--accent);
}

#practice-button {
    background: var(--panel);
    color: var(--text);

    width: 230px;
    max-width: 100%;

    border: 2px solid var(--border);
    border-radius: 12px;

    text-decoration: none;
}

button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 4px;
}


/* ========================================
   GAME SCREEN
======================================== */

#game-screen {
    max-width: 560px;
}

.game-header {
    font-family: var(--number-font);
    font-size: 15px;
    font-weight: 700;
    align-items: center;
}

#question-counter {
    color: var(--secondary-text);
}

#timer {
    background: #080f1e;

    border: 2px solid var(--border);
    border-radius: 12px;

    padding: 7px 15px;

    color: var(--accent);
    font-size: 23px;

    text-shadow: 0 0 12px rgba(
        141, 230, 242, 0.15
    );
}

#timer.grace {
    color: var(--gold);
}

#timer.running {
    color: var(--accent);
}

#progress-bar {
    background: #172940;
    height: 7px;
}

#progress-fill {
    background: linear-gradient(
        90deg,
        #568bff,
        var(--accent)
    );

    transition: width 0.45s ease;
}

#game-screen #question-title {
    font-weight: 600;
    font-size: clamp(20px, 3.5dvh, 30px);
    letter-spacing: -0.4px;
}

#question-title:empty {
    display: none;
}

#game-screen #game-content {

    background: linear-gradient(
        155deg,
        #182d48,
        #101d33
    );

    border: 2px solid var(--border);
    border-radius: 26px;

    box-shadow:
        0 7px 0 #030913,
        inset 0 1px 0 rgba(255, 255, 255, 0.06);

    padding: 16px;

    gap: 12px;
}


/* ========================================
   MINIGAME ARENAS
======================================== */

.flash-arena,
.angle-arena,
.center-arena,
.shade-arena,
.snapshot-arena,
.clock-arena {

    background: #0b172a;

    border: 2px solid #395573;
    border-radius: 22px;
}


/* Fill colors */

.fill-circle svg circle:first-of-type {
    fill: #0b172a;
}

.fill-circle svg rect {
    fill: var(--accent);
}

.fill-circle svg circle:last-of-type {
    stroke: #bdd9ed;
}


/* Flash Count */

.flash-block {
    background: var(--gold);
    border-color: #d5a35c;
    border-radius: 6px;
}

.flash-countdown {
    color: var(--gold);
}


/* Angle */

.angle-line {
    stroke: var(--purple);
}

.angle-arc {
    stroke: var(--purple);
}

.angle-sector {
    fill: var(--purple);
}


/* Centerpoint */

.center-shape {
    fill: var(--accent);
    stroke: #b6e7ff;
    fill-opacity: 0.8;
}


/* Snapshot */

.snapshot-tile {
    background: #243c58;
}

.snapshot-tile.highlighted,
.snapshot-tile.selected {
    background: var(--gold);
    border-color: #ffe3b2;
}

.snapshot-countdown {
    background: #0b172a;
    color: var(--gold);
}


/* Internal Clock */

.clock-body {
    fill: #152740;
    stroke: var(--accent);
}

.clock-top,
.clock-display {
    fill: var(--accent);
}

.clock-tick {
    stroke: var(--secondary-text);
}

.clock-stop-button {
    background: var(--danger);
    color: #10182a;
}

.clock-stop-button:hover {
    background: #ff9caf;
}


/* ========================================
   ANSWERS AND COUNTDOWN
======================================== */

.answer-input {
    font-family: var(--number-font);
    font-weight: 700;
    color: var(--accent);

    background: #0a1528;

    border: 2px solid var(--border);
    border-radius: 12px;

    padding: 3px;
}

.answer-unit {
    color: var(--accent);
}

.answer-slider {
    accent-color: var(--accent);
}

#grace-label {
    font-family: var(--number-font);
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--success);
}

.grace-track {
    background: #081323;
}

#grace-fill {
    background: var(--accent);
}

#game-content.controls-locked #grace-label {
    color: var(--gold);
    font-size: 20px;
}

#game-content.controls-locked #grace-fill {
    background: var(--gold);
}


/* ========================================
   RESULTS
======================================== */

.result-heading {
    color: var(--accent);
    font-size: 24px;
    font-weight: 700;
}

.result-row {
    font-size: 15px;
}

.result-row strong {
    font-family: var(--number-font);
    font-size: 13px;
}

.total-result strong {
    color: var(--accent);
    font-size: 26px;
}

.penalty-value,
.shade-penalty {
    color: var(--danger);
}

.shade-success,
.snapshot-legend-correct {
    color: var(--success);
}

.snapshot-legend-incorrect {
    color: var(--danger);
}

.snapshot-legend-missed {
    color: var(--gold);
}

.snapshot-tile.correct,
.center-correct,
.center-legend-dot.correct {
    background: #26896d;
}

.center-correct {
    fill: var(--success);
}

.snapshot-tile.incorrect {
    background: #be4f68;
}

.snapshot-tile.missed {
    background: #bb914f;
}


/* ========================================
   TITLE CARDS
======================================== */

.challenge-card {
    width: 100%;
    min-height: min(350px, 45dvh);

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 12px;

    padding: 24px 12px;

    overflow: hidden;
}

.challenge-number {
    font-family: var(--number-font);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 4px;

    color: var(--secondary-text);
}

.challenge-name {
    font-family: var(--game-font);
    font-size: clamp(34px, 8vw, 64px);
    font-weight: 700;
    letter-spacing: -2px;
    line-height: 1;

    color: var(--challenge-color, var(--accent));

    text-shadow:
        0 5px 0 #07101e,
        0 0 24px rgba(141, 230, 242, 0.12);
}

.challenge-subtitle {
    color: var(--secondary-text);
    font-size: 17px;
}

.challenge-decoration {
    width: 64px;
    height: 6px;

    border-radius: 20px;

    background:
        var(--challenge-color, var(--accent));
}


/* ========================================
   SCENE ANIMATIONS
======================================== */

.scene-enter {
    animation:
        scene-enter 0.6s
        cubic-bezier(0.18, 0.85, 0.32, 1.15)
        both;
}

.scene-exit {
    animation:
        scene-exit 0.35s ease-in both;
}

@keyframes scene-enter {

    from {
        transform:
            translateX(110%)
            rotate(5deg)
            scale(0.94);

        opacity: 0;
    }

    to {
        transform:
            translateX(0)
            rotate(0)
            scale(1);

        opacity: 1;
    }

}

@keyframes scene-exit {

    from {
        transform: translateX(0) rotate(0);
        opacity: 1;
    }

    to {
        transform:
            translateX(-110%)
            rotate(-5deg);

        opacity: 0;
    }

}


/* ========================================
   FILL INTRO ANIMATION
======================================== */

.fill-intro .fill-circle {
    animation:
        puzzle-pop 0.45s
        cubic-bezier(0.2, 0.8, 0.3, 1.3)
        both;
}

.fill-intro .fill-circle svg rect {
    animation:
        liquid-rise 0.8s 0.3s
        cubic-bezier(0.2, 0.8, 0.3, 1)
        both;
}

.fill-intro .grace-container,
.fill-intro .answer-controls {
    visibility: hidden;
}

#game-screen:has(.fill-intro)
#question-title {
    visibility: hidden;
}

@keyframes puzzle-pop {

    from {
        transform: scale(0.25);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }

}

@keyframes liquid-rise {

    from {
        y: 210px;
        height: 0px;
    }

}


/* Animated countdown numbers */

.countdown-bounce {
    animation:
        countdown-pop 0.35s ease-out;
}


/* ========================================
   RESPONSIVE POLISH
======================================== */

@media (max-height: 700px) {

    #game-screen #game-content {
        padding: 10px;
        gap: 8px;
    }

    #home-screen {
        padding: 18px;
    }

    .eye-logo {
        width: 110px;
        margin-bottom: 12px;
    }

    #timer {
        font-size: 19px;
        padding: 5px 12px;
    }

    .result-heading {
        font-size: 20px;
    }

}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0ms !important;
        transition-duration: 0.01ms !important;
    }

}

/* ========================================
   ENHANCED PLAY BUTTON
======================================== */

:is(#play-button, #username-submit) {

    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 12px;

    padding: 17px 28px;

    background: var(--accent);
    color: #102039;

    border: 3px solid #a5eff9;
    border-radius: 17px;

    font-size: 20px;
    font-weight: 600;

    box-shadow:
        0 6px 0 #315a80,
        0 0 0 0 rgba(141, 230, 242, 0);

    transition:

        transform 0.25s
        cubic-bezier(0.2, 0.8, 0.3, 1.5),

        background 0.25s ease,

        border-color 0.25s ease,

        box-shadow 0.25s ease;

}


/* Hover effect */

#play-button:hover,
#play-button:focus-visible {

    transform: scale(1.065);

    background: #a9f1fa;

    border-color: #efffff;

    box-shadow:

        0 7px 0 #315a80,

        0 0 0 4px rgba(
            141, 230, 242, 0.17
        ),

        0 0 28px rgba(
            141, 230, 242, 0.30
        );

    outline: none;

}


/* Click compression */

#play-button:active {

    transform:
        scale(0.96)
        translateY(4px);

    box-shadow:

        0 2px 0 #315a80,

        0 0 18px rgba(
            141, 230, 242, 0.30
        );

}


/* Animated play arrow */

.play-button-arrow {

    display: inline-block;

    font-size: 25px;
    line-height: 1;

    transition:
        transform 0.25s
        cubic-bezier(0.2, 0.8, 0.3, 1.5);

}

#play-button:hover .play-button-arrow,
#play-button:focus-visible .play-button-arrow {

    transform: translateX(4px);

}

#play-button:active .play-button-arrow {

    transform: translateX(0);

}

/* ========================================
   EYEBALL — UNDERWATER ENVIRONMENT
======================================== */

:root {

    --ocean-far-x: 0px;
    --ocean-far-y: 0px;

    --ocean-near-x: 0px;
    --ocean-near-y: 0px;

    --ocean-darkness: 1;

    --ocean-hue: 0deg;

}


/* ========================================
   ENVIRONMENT CONTAINER
======================================== */

body {
    isolation: isolate;
}

#ocean-environment {

    position: fixed;
    inset: 0;

    z-index: -1;

    pointer-events: none;

    overflow: hidden;

    background: #060e1c;

}


/* ========================================
   OCEAN DEPTH AND LIGHTING
======================================== */

.ocean-depth {

    position: absolute;

    inset: -15%;

    background:

        radial-gradient(
            ellipse at 45% -15%,
            #355a83 0%,
            transparent 65%
        ),

        radial-gradient(
            ellipse at 10% 75%,
            #183c55 0%,
            transparent 50%
        ),

        linear-gradient(
            160deg,
            #142b48,
            #060e1c
        );

    filter:

        brightness(var(--ocean-darkness))

        hue-rotate(var(--ocean-hue));

    transition:

        filter 1.8s ease,

        transform 1.5s ease;

    transform: translate(

        var(--ocean-far-x),

        var(--ocean-far-y)

    );

}


/* ========================================
   PARALLAX CAMERA LAYERS
======================================== */

.ocean-layer {

    position: absolute;

    inset: -25%;

    pointer-events: none;

    will-change: transform;

    transition:

        transform 1.2s

        cubic-bezier(0.2, 0.7, 0.2, 1);

}


.ocean-far {

    transform: translate(

        var(--ocean-far-x),

        var(--ocean-far-y)

    );

}


.ocean-near {

    transform: translate(

        var(--ocean-near-x),

        var(--ocean-near-y)

    );

}


/* ========================================
   DISTANT SHARK
======================================== */

.ocean-shark {

    position: absolute;

    top: 28%;

    left: -340px;

    width: clamp(180px, 28vw, 380px);

    opacity: 0;

    filter: blur(3px);

    animation:

        shark-swim 38s linear infinite;

    animation-delay: 5s;

}


.ocean-shark svg {

    display: block;

    width: 100%;

    fill: #050c19;

}


@keyframes shark-swim {

    0% {

        transform: translate(0, 0);

        opacity: 0;

    }

    12% {

        opacity: 0.38;

    }

    35% {

        opacity: 0.38;

    }

    48% {

        transform: translate(
            calc(150vw + 400px),
            90px
        );

        opacity: 0;

    }

    100% {

        transform: translate(
            calc(150vw + 400px),
            90px
        );

        opacity: 0;

    }

}


/* ========================================
   DISTANT FISH
======================================== */

.ocean-fish-school {

    position: absolute;

    top: 65%;

    right: -240px;

    width: clamp(100px, 16vw, 220px);

    opacity: 0;

    filter: blur(2px);

    animation:

        fish-swim 29s linear infinite;

    animation-delay: 12s;

}


.ocean-fish-school svg {

    width: 100%;

    display: block;

    fill: #040c19;

    transform: scaleX(-1);

}


@keyframes fish-swim {

    0% {

        transform: translate(0, 0);

        opacity: 0;

    }

    15% {

        opacity: 0.28;

    }

    50% {

        opacity: 0.28;

    }

    65% {

        transform: translate(
            calc(-150vw - 300px),
            -100px
        );

        opacity: 0;

    }

    100% {

        transform: translate(
            calc(-150vw - 300px),
            -100px
        );

        opacity: 0;

    }

}


/* ========================================
   FLOATING BUBBLES
======================================== */

.ocean-bubble {

    position: absolute;

    bottom: -40px;

    width: var(--bubble-size);

    height: var(--bubble-size);

    left: var(--bubble-x);

    border: 1px solid rgba(
        141, 205, 239, 0.25
    );

    border-radius: 50%;

    background: rgba(
        141, 205, 239, 0.025
    );

    box-shadow:

        inset 0 0 4px rgba(
            141, 205, 239, 0.08
        );

    animation:

        bubble-rise

        var(--bubble-duration)

        linear infinite;

    animation-delay:

        var(--bubble-delay);

}


@keyframes bubble-rise {

    0% {

        transform: translate(0, 0);

        opacity: 0;

    }

    15% {

        opacity: 0.8;

    }

    80% {

        opacity: 0.6;

    }

    100% {

        transform: translate(

            var(--bubble-drift),

            -165dvh

        );

        opacity: 0;

    }

}


/* ========================================
   TINY UNDERWATER PARTICLES
======================================== */

.ocean-dust {

    position: absolute;

    bottom: -20px;

    left: var(--bubble-x);

    width: var(--bubble-size);

    height: var(--bubble-size);

    background: #a1c8e1;

    border-radius: 50%;

    filter: blur(0.8px);

    opacity: 0.15;

    animation:

        dust-float

        var(--bubble-duration)

        linear infinite;

    animation-delay:

        var(--bubble-delay);

}


@keyframes dust-float {

    0% {

        transform: translate(0, 0);

        opacity: 0;

    }

    20%, 70% {

        opacity: 0.18;

    }

    100% {

        transform: translate(

            var(--bubble-drift),

            -165dvh

        );

        opacity: 0;

    }

}


/* ========================================
   DARK OCEAN EDGES
======================================== */

.ocean-vignette {

    position: absolute;

    inset: 0;

    background:

        radial-gradient(

            ellipse at center,

            transparent 30%,

            rgba(2, 6, 15, 0.20) 65%,

            rgba(2, 6, 15, 0.65) 100%

        );

}


/* ========================================
   ENVIRONMENT ACCESSIBILITY
======================================== */

@media (prefers-reduced-motion: reduce) {

    .ocean-shark,
    .ocean-fish-school,
    .ocean-bubble,
    .ocean-dust {

        animation: none !important;

        display: none;

    }

    .ocean-layer,
    .ocean-depth {

        transition: none !important;

        transform: none !important;

    }

}

/* ========================================
   EYEBALL — OPENING INTRO
======================================== */

/* Preserve the individual eye colors. */

#eye-logo svg .eye-white {
    fill: #dceeff;
    stroke: none;
}

#eye-logo svg .eye-outline {
    fill: none;
    stroke: #060e1c;
    stroke-width: 5;
}


/* ========================================
   EYE MOVEMENT
======================================== */

#eye-pupil {

    transform: translate(0, 0);

    transition:

        transform 0.45s

        cubic-bezier(0.25, 0.8, 0.25, 1);

}

#eye-blink {

    transform-box: view-box;

    transform-origin: 100px 62px;

}

#eye-blink.is-blinking {

    animation: eye-blink 0.23s ease-in-out;

}

@keyframes eye-blink {

    0%, 100% {

        transform: scaleY(1);

    }

    50% {

        transform: scaleY(0.025);

    }

}


/* ========================================
   INTRO OVERLAY
======================================== */

#intro-overlay {

    position: fixed;

    inset: 0;

    z-index: 1000;

    display: flex;

    align-items: center;

    justify-content: center;

    overflow: hidden;

}


/* Hide the menu while the intro plays. */

body.intro-playing .navbar,
body.intro-playing main,
body.intro-playing footer {

    opacity: 0;

    pointer-events: none;

}


/* The large introductory eyeball. */

#intro-overlay #eye-logo {

    position: fixed;

    top: 50%;
    left: 50%;

    width: min(230px, 60vw);

    margin: 0;

    transform: translate(-50%, -50%);

    animation: none;

    filter:

        drop-shadow(
            0 0 30px rgba(
                141, 230, 242, 0.18
            )
        );

    transition:

        top 0.85s
        cubic-bezier(0.2, 0.8, 0.2, 1),

        left 0.85s
        cubic-bezier(0.2, 0.8, 0.2, 1),

        width 0.85s
        cubic-bezier(0.2, 0.8, 0.2, 1);

}


/* ========================================
   MENU REVEAL
======================================== */

body.intro-revealing .navbar,
body.intro-revealing main,
body.intro-revealing footer {

    opacity: 1;

    transition: opacity 0.85s ease;

}


/* Holds the original eyeball position
   while the intro eyeball moves. */

.eye-placeholder {

    flex-shrink: 0;

    visibility: hidden;

}


/* ========================================
   ACCESSIBILITY
======================================== */

@media (prefers-reduced-motion: reduce) {

    #eye-pupil,
    #intro-overlay #eye-logo {

        transition: none;

    }

    #eye-blink.is-blinking {

        animation: none;

    }

}

/* ========================================
   ENHANCED UNDERWATER CAMERA
======================================== */

/* Expand the environment so we don't
   run out of particles as we travel. */

.ocean-layer {

    inset: -30% -100%;

    transition:

        transform 1.05s

        cubic-bezier(0.15, 0.75, 0.25, 1);

}


.ocean-depth {

    inset: -45%;

    transition:

        filter 1.8s ease,

        transform 1.3s

        cubic-bezier(0.15, 0.75, 0.25, 1);

}


/* Nearby objects settle more quickly. */

.ocean-near {

    transition:

        transform 0.95s

        cubic-bezier(0.12, 0.8, 0.25, 1);

}


/* Distant objects have more inertia. */

.ocean-far {

    transition:

        transform 1.4s

        cubic-bezier(0.2, 0.65, 0.25, 1);

}


/* ========================================
   IMPROVED SHARK
======================================== */

.ocean-shark {

    top: 28%;

    left: calc(100vw - 420px);

    width: clamp(220px, 32vw, 460px);

    filter: blur(4px);

    animation:

        shark-swim 38s linear infinite;

    animation-delay: 5s;

}


.ocean-shark svg {

    fill: #040c18;

    animation:

        shark-glide 3s

        ease-in-out infinite;

}


@keyframes shark-glide {

    0%, 100% {

        transform:

            translateY(0)

            rotate(-1deg);

    }

    50% {

        transform:

            translateY(8px)

            rotate(1deg);

    }

}


@keyframes shark-swim {

    0% {

        transform: translate(0, 0);

        opacity: 0;

    }

    10% {

        opacity: 0.32;

    }

    36% {

        opacity: 0.32;

    }

    55% {

        transform: translate(

            calc(100vw + 850px),

            65px

        );

        opacity: 0;

    }

    100% {

        transform: translate(

            calc(100vw + 850px),

            65px

        );

        opacity: 0;

    }

}


/* Reposition the fish school inside
   our expanded environment. */

.ocean-fish-school {

    right: calc(100vw - 240px);

    filter: blur(3px);

}


/* Slightly soften nearby bubbles. */

.ocean-bubble {

    filter: blur(0.4px);

}


@media (prefers-reduced-motion: reduce) {

    .ocean-shark svg {

        animation: none;

    }

}

/* ========================================
   UNDERWATER CAMERA MOTION BLUR
======================================== */

.ocean-bubble,
.ocean-dust {

    transition:

        scale 0.4s ease,

        filter 0.4s ease;

}

body.ocean-moving .ocean-bubble {
    scale: 1;
    filter: blur(0.4px);
}

body.ocean-moving .ocean-dust {
    scale: 1;
    filter: blur(0.8px);
}

@media (prefers-reduced-motion: reduce) {

    body.ocean-moving .ocean-bubble,
    body.ocean-moving .ocean-dust {

        scale: 1;

        filter: none;

    }

}
/* ========================================
   VERTICAL SCREEN CENTERING
======================================== */

body {
    min-height: 100dvh;
}

main {
    flex: 1;

    display: flex;
    align-items: center;
    justify-content: center;
}

/* Center the main screens slightly higher. */

#home-screen,
#game-screen {
    position: relative;
    top: -25px;
}

/* Preserve space on smaller screens. */

@media (max-height: 700px) {

    #home-screen,
    #game-screen {
        top: -20px;
    }

}
/* ========================================
   ROUND TIMEOUT WARNING
======================================== */

#timer.time-warning {

    color: var(--danger);

    border-color: var(--danger);

    box-shadow:
        0 0 18px rgba(255, 116, 142, 0.25);

    animation: timer-warning-pulse 0.8s
        ease-in-out infinite;

}

@keyframes timer-warning-pulse {

    0%, 100% {
        box-shadow:
            0 0 8px rgba(255, 116, 142, 0.10);
    }

    50% {
        box-shadow:
            0 0 22px rgba(255, 116, 142, 0.35);
    }

}

/* ========================================
   EYEBALL — FINAL RESULTS SCREEN
======================================== */

.final-score-container {

    width: 100%;

    text-align: center;

    animation: final-score-entrance 0.65s

        cubic-bezier(0.2, 0.8, 0.3, 1.2)

        both;

}

.final-score-label {

    font-family: var(--number-font);

    color: var(--secondary-text);

    font-size: 11px;

    letter-spacing: 3px;

    font-weight: 700;

}

.final-score-value {

    font-family: var(--number-font);

    font-size: clamp(36px, 7dvh, 68px);

    font-weight: 700;

    letter-spacing: -3px;

    line-height: 1.25;

    color: var(--accent);

    text-shadow:

        0 4px 0 #07101e,

        0 0 30px rgba(
            141, 230, 242, 0.2
        );

}

.final-score-subtitle {

    font-size: 14px;

    color: var(--secondary-text);

}

@keyframes final-score-entrance {

    from {

        opacity: 0;

        transform: scale(0.65);

    }

    to {

        opacity: 1;

        transform: scale(1);

    }

}


/* ========================================
   PERFORMANCE GRAPH CONTAINER
======================================== */

.performance-section {

    width: 100%;

    padding-top: 12px;

    border-top: 1px solid var(--border);

}

.performance-heading {

    font-family: var(--number-font);

    font-size: 12px;

    font-weight: 700;

    letter-spacing: 2px;

    color: var(--secondary-text);

    margin-bottom: 8px;

}

.performance-graph {

    width: 100%;

    max-width: 500px;

    margin: 0 auto;

}

.performance-graph svg {

    display: block;

    width: 100%;

    max-height: 30dvh;

    overflow: visible;

}


/* ========================================
   GRAPH AXES
======================================== */

.graph-grid-line {

    stroke: #395573;

    stroke-width: 1;

    stroke-dasharray: 4 6;

    opacity: 0.65;

}

.graph-axis-label {

    fill: var(--secondary-text);

    font-family: var(--number-font);

    font-size: 11px;

}

.graph-axis-title {

    fill: var(--secondary-text);

    font-family: var(--number-font);

    font-size: 10px;

    letter-spacing: 3px;

}


/* ========================================
   GRAPH LINE AND ANIMATED FILL
======================================== */

.performance-line {

    fill: none;

    stroke: var(--accent);

    stroke-width: 3;

    stroke-linecap: round;

    stroke-linejoin: round;

    filter: drop-shadow(

        0 0 5px rgba(
            141, 230, 242, 0.35
        )

    );

}

.graph-reveal {

    transform-box: view-box;

    animation: performance-graph-reveal

        1.8s

        linear both;

}

@keyframes performance-graph-reveal {

    from {

        clip-path: inset(0 100% 0 48px);

    }

    to {

        clip-path: inset(0);

    }

}


/* ========================================
   INTERACTIVE GRAPH DOTS
======================================== */

.performance-dot {

    cursor: pointer;

    outline: none;

    opacity: 0;

    animation: performance-dot-appear

        0.25s

        ease-out

        var(--dot-delay)

        forwards;

}

.graph-dot-hitbox {

    fill: transparent;

    pointer-events: all;

}

.graph-dot-circle {

    fill: #101d33;

    stroke: var(--accent);

    stroke-width: 2.5;

    transition:

        r 0.2s ease,

        fill 0.2s ease,

        stroke 0.2s ease;

}

.performance-dot:hover .graph-dot-circle,

.performance-dot.selected .graph-dot-circle,

.performance-dot:focus-visible .graph-dot-circle {

    r: 7;

    fill: var(--accent);

    stroke: #edf6ff;

    stroke-width: 2.5;

    filter: drop-shadow(

        0 0 6px rgba(
            141, 230, 242, 0.6
        )

    );

}

@keyframes performance-dot-appear {

    from {

        opacity: 0;

    }

    to {

        opacity: 1;

    }

}


/* ========================================
   ROUND INFORMATION PANEL
======================================== */

.performance-details {

    width: 100%;

    min-height: 76px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

    text-align: left;

    background: #091527;

    border: 1px solid #395573;

    border-radius: 14px;

    padding: 10px 12px;

    margin-top: 10px;

}

.performance-hint {

    width: 100%;

    text-align: center;

    font-size: 13px;

    color: var(--secondary-text);

}

.performance-round-number {

    color: var(--secondary-text);

    font-family: var(--number-font);

    font-size: 10px;

    letter-spacing: 2px;

}

.performance-round-name {

    color: var(--text);

    font-weight: 600;

    font-size: 18px;

    margin-top: 3px;

}

.performance-breakdown {

    color: var(--secondary-text);

    font-size: 11px;

    margin-top: 4px;

}

.performance-round-score {

    text-align: right;

    flex-shrink: 0;

}

.performance-time-added {

    color: var(--accent);

    font-family: var(--number-font);

    font-size: clamp(16px, 4vw, 23px);

    font-weight: 700;

}

.performance-total {

    color: var(--secondary-text);

    font-size: 11px;

    margin-top: 4px;

}


/* ========================================
   FINAL SCREEN BUTTON
======================================== */

#game-content.final-results #restart-game {

    width: 100%;

    margin-top: 2px;

}


/* ========================================
   SMALL SCREEN SUPPORT
======================================== */

@media (max-height: 700px) {

    .performance-graph svg {

        max-height: 25dvh;

    }

    .final-score-value {

        font-size: 38px;

    }

    .performance-details {

        min-height: 65px;

        padding: 8px 10px;

    }

    .performance-section {

        padding-top: 6px;

    }

    .performance-heading {

        margin-bottom: 4px;

    }

}


/* ========================================
   REDUCED MOTION SUPPORT
======================================== */

@media (prefers-reduced-motion: reduce) {

    .graph-reveal {

        animation: none !important;

        clip-path: none;

    }

    .performance-dot {

        animation: none !important;

        opacity: 1;

    }

    .final-score-container {

        animation: none !important;

    }

}
/* ========================================
   LEADERBOARD BUTTON
======================================== */

#leaderboard-button {
    width: 230px;
    max-width: 100%;

    background: var(--panel);
    color: var(--gold);

    border: 2px solid var(--border);
    border-radius: 12px;

    font-family: var(--game-font);
    font-size: 16px;
    font-weight: 600;

    text-decoration: none;

    box-shadow: 0 4px 0 #07101e;

    transition:
        transform 0.25s
        cubic-bezier(0.2, 0.8, 0.3, 1.5),
        border-color 0.25s,
        box-shadow 0.25s;
}

#leaderboard-button:hover {
    transform: scale(1.05);

    border-color: var(--gold);

    box-shadow:
        0 4px 0 #07101e,
        0 0 18px rgba(255, 204, 120, 0.15);
}

#leaderboard-button:active {
    transform: scale(0.96);
}

/* ========================================
   EYEBALL — USERNAME POPUP
======================================== */

#username-overlay {

    position: fixed;
    inset: 0;
    margin: auto;

    width: min(92vw, 410px);
    max-height: 90dvh;

    padding: 0;
    border: none;
    background: transparent;
    color: var(--text);

    overflow: auto;

    animation: username-enter 0.55s
        cubic-bezier(0.18, 0.85, 0.32, 1.15)
        both;

}

#username-overlay::backdrop {

    background: rgba(3, 9, 19, 0.75);

    backdrop-filter: blur(9px);

}


.username-panel {

    position: relative;

    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 16px;
    padding: 30px 24px;

    background: linear-gradient(
        155deg,
        #203954,
        #101d33
    );

    border: 3px solid var(--border);
    border-radius: 28px;

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.08);

    text-align: center;

    font-family: var(--game-font);

}


.username-eye {

    width: 115px;

    filter: drop-shadow(
        0 0 18px rgba(141, 230, 242, 0.25)
    );

    animation: eye-float 4s ease-in-out infinite;

}

.username-eye svg {

    width: 100%;
    display: block;

}


.username-title {

    font-size: clamp(28px, 7vw, 38px);
    font-weight: 700;
    letter-spacing: -1px;

    color: var(--text);

    text-shadow: 0 4px 0 #070e1a;

}


.username-description {

    font-size: 16px;
    line-height: 1.5;

    color: var(--secondary-text);

}


#username-input {

    width: 100%;

    padding: 15px 12px;

    background: #0a1528;
    color: var(--accent);

    border: 2px solid var(--border);
    border-radius: 13px;

    font-family: var(--game-font);
    font-size: 21px;
    font-weight: 500;

    text-align: center;

    outline: none;

    transition:
        border-color 0.2s,
        box-shadow 0.2s;

}


#username-input::placeholder {

    color: #627b99;

}


#username-input:focus {

    border-color: var(--accent);

    box-shadow:
        0 0 0 4px rgba(141,230,242,0.1);

}


.username-requirements {

    color: var(--secondary-text);

    font-size: 11px;
    font-family: var(--number-font);

}


#username-error {

    color: var(--danger);

    font-size: 14px;
    font-weight: 500;

}

#username-error:empty {

    display: none;

}


#username-submit {

    width: 100%;

}


.username-footer {

    color: var(--secondary-text);

    font-size: 11px;
    line-height: 1.5;

    margin-top: 5px;

}


/* Popup animations */

@keyframes username-enter {

    from {

        opacity: 0;
        transform: translateY(60px) scale(0.8);

    }

    to {

        opacity: 1;
        transform: translateY(0) scale(1);

    }

}


#username-overlay.username-closing {

    animation: username-exit 0.3s ease-in both;

}


@keyframes username-exit {

    to {

        opacity: 0;
        transform: translateY(-25px) scale(0.9);

    }

}

/* ========================================
   OFFICIAL SCORE STATUS
======================================== */

.score-save-status {

    width: 100%;

    padding: 10px 12px;

    background: #0a1528;

    border: 1px solid var(--border);

    border-radius: 10px;

    color: var(--gold);

    font-family: var(--number-font);

    font-size: 12px;

    text-align: center;

}


.score-save-status.saved {

    color: var(--success);

    border-color: rgba(110, 240, 194, 0.3);

    background: rgba(110, 240, 194, 0.06);

}


.score-save-status.failed {

    color: var(--danger);

    border-color: var(--danger);

}


.score-save-status .text-button {

    color: var(--accent);

    margin: 0;

    padding: 4px 8px;

}

/* ========================================
   UNOFFICIAL REPLAY RESULTS
======================================== */

.score-save-status.replay {

    background: rgba(196, 173, 255, 0.06);

    border-color: rgba(196, 173, 255, 0.3);

    color: var(--purple);

}


.replay-comparison {

    margin-top: 8px;

    font-family: var(--game-font);

    font-size: 16px;

    font-weight: 600;

    color: var(--secondary-text);

}


.replay-comparison.faster {

    color: var(--success);

}


.replay-official-time {

    margin-top: 6px;

    color: var(--secondary-text);

    font-size: 11px;

}

/* ========================================
   EYEBALL — GLOBAL LEADERBOARDS
======================================== */

#leaderboard-overlay {

    position: fixed;
    inset: 0;
    margin: auto;

    width: min(94vw, 520px);
    max-height: 94dvh;

    padding: 0;

    background: transparent;

    border: none;

    color: var(--text);

    overflow: auto;

    animation: username-enter 0.5s
        cubic-bezier(0.18, 0.85, 0.32, 1.15)
        both;

}


#leaderboard-overlay::backdrop {

    background: rgba(3, 9, 19, 0.8);

    backdrop-filter: blur(9px);

}


.leaderboard-panel {

    display: flex;
    flex-direction: column;

    gap: 14px;

    padding: 24px;

    background: linear-gradient(
        155deg,
        #203954,
        #101d33
    );

    border: 3px solid var(--border);

    border-radius: 28px;

    font-family: var(--game-font);

    text-align: center;

}


.leaderboard-trophy {

    font-size: 44px;

    line-height: 1;

    filter: drop-shadow(
        0 0 18px rgba(255, 204, 120, 0.3)
    );

    animation: eye-float 4s ease-in-out infinite;

}


#leaderboard-title {

    color: var(--gold);

    font-size: clamp(28px, 7vw, 38px);

    font-weight: 700;

    letter-spacing: -1px;

    text-shadow: 0 4px 0 #070e1a;

}


.leaderboard-subtitle {

    color: var(--secondary-text);

    font-size: 15px;

}


/* ========================================
   LEADERBOARD TABS
======================================== */

.leaderboard-tabs {

    display: flex;

    gap: 6px;

    padding: 5px;

    background: #0a1528;

    border: 2px solid var(--border);

    border-radius: 15px;

}


.leaderboard-tab {

    flex: 1;

    padding: 12px 8px;

    border: 2px solid transparent;

    border-radius: 10px;

    background: transparent;

    color: var(--secondary-text);

    font-family: var(--game-font);

    font-size: 17px;

    font-weight: 600;

    transition:

        background 0.2s,

        color 0.2s,

        transform 0.2s;

}


.leaderboard-tab:hover {

    background: #203954;

    color: var(--text);

}


.leaderboard-tab.active {

    background: var(--accent);

    color: #102039;

    border-color: #b5f5ff;

    box-shadow: 0 3px 0 #315a80;

}


.leaderboard-tab:active {

    transform: scale(0.95);

}


/* ========================================
   LEADERBOARD LIST
======================================== */

.leaderboard-columns {

    display: flex;

    justify-content: space-between;

    padding: 0 10px;

    color: var(--secondary-text);

    font-family: var(--number-font);

    font-size: 10px;

    letter-spacing: 0.5px;

}


#leaderboard-list {

    display: flex;

    flex-direction: column;

    gap: 7px;

    height: min(38dvh, 380px);

    overflow-y: auto;

    overscroll-behavior: contain;

    padding: 2px 6px 4px 2px;

    scrollbar-width: thin;

    scrollbar-color: #395573 #0a1528;

}


.leaderboard-row {

    display: flex;

    align-items: center;

    flex-shrink: 0;

    gap: 10px;

    min-height: 54px;

    padding: 12px 10px;

    background: #101d33;

    border: 1px solid var(--border);

    border-radius: 11px;

    text-align: left;

    animation: leaderboard-row-enter

        0.35s var(--row-delay) ease-out both;

    transition:

        background 0.2s,

        border-color 0.2s;

}


.leaderboard-row:hover {

    background: #203954;

}


.leaderboard-rank {

    flex-shrink: 0;

    min-width: 38px;

    color: var(--secondary-text);

    font-family: var(--number-font);

    font-size: 13px;

    font-weight: 700;

}


.leaderboard-name {

    display: flex;

    align-items: center;

    flex-wrap: wrap;

    flex: 1;

    min-width: 0;

    gap: 6px;

    color: var(--text);

    font-size: 15px;

    font-weight: 500;

    overflow-wrap: anywhere;

}


.leaderboard-time {

    flex-shrink: 0;

    color: var(--accent);

    font-family: var(--number-font);

    font-size: 14px;

    font-weight: 700;

    font-variant-numeric: tabular-nums;

}


/* ========================================
   TOP THREE PLAYERS
======================================== */

.leaderboard-row.rank-gold {

    background: linear-gradient(

        90deg,

        rgba(255, 204, 120, 0.14),

        #101d33

    );

    border-color: rgba(255, 204, 120, 0.5);

}


.rank-gold .leaderboard-rank {

    color: var(--gold);

}


.leaderboard-row.rank-silver {

    border-color: rgba(220, 238, 255, 0.35);

}


.rank-silver .leaderboard-rank {

    color: #dceeff;

}


.leaderboard-row.rank-bronze {

    border-color: rgba(219, 164, 122, 0.4);

}


.rank-bronze .leaderboard-rank {

    color: #dba47a;

}


/* Highlight your own score. */

.leaderboard-row.your-score {

    background: #203d55;

    border: 1px solid var(--accent);

}


.leaderboard-you {

    padding: 3px 5px;

    background: rgba(141, 230, 242, 0.12);

    border-radius: 5px;

    color: var(--accent);

    font-family: var(--number-font);

    font-size: 9px;

}


/* ========================================
   LOADING AND EMPTY STATES
======================================== */

.leaderboard-loading,
.leaderboard-empty {

    display: flex;

    flex: 1;

    flex-direction: column;

    justify-content: center;

    align-items: center;

    gap: 14px;

    min-height: 140px;

    color: var(--secondary-text);

    font-size: 16px;

}


.leaderboard-spinner {

    width: 30px;
    height: 30px;

    border: 3px solid var(--border);

    border-top-color: var(--accent);

    border-radius: 50%;

    animation: leaderboard-spin 0.8s linear infinite;

}


.leaderboard-footer {

    color: var(--secondary-text);

    font-family: var(--number-font);

    font-size: 10px;

    letter-spacing: 0.5px;

}


#leaderboard-close {

    width: 100%;

    background: var(--panel);

    color: var(--text);

    border: 2px solid var(--border);

    box-shadow: 0 4px 0 #050b15;

}


#leaderboard-close:hover {

    background: #233d5d;

    border-color: var(--accent);

}


/* ========================================
   LEADERBOARD ANIMATIONS
======================================== */

@keyframes leaderboard-spin {

    to {

        transform: rotate(360deg);

    }

}


@keyframes leaderboard-row-enter {

    from {

        opacity: 0;

        transform: translateX(-18px);

    }

    to {

        opacity: 1;

        transform: translateX(0);

    }

}


#leaderboard-overlay.leaderboard-closing {

    animation: username-exit 0.25s ease-in both;

}


/* Smaller browser windows */

@media (max-height: 700px) {

    .leaderboard-panel {

        gap: 9px;

        padding: 16px;

    }

    .leaderboard-trophy {

        font-size: 32px;

    }

    #leaderboard-title {

        font-size: 28px;

    }

    #leaderboard-list {

        height: 30dvh;

    }

    .leaderboard-row {

        min-height: 45px;

        padding: 8px;

    }

}


@media (max-width: 420px) {

    .leaderboard-panel {

        padding: 14px;

    }

    .leaderboard-name {

        font-size: 13px;

    }

    .leaderboard-time {

        font-size: 12px;

    }

}

/* ========================================
   PERSONAL LEADERBOARD RANKING
======================================== */

#leaderboard-personal[hidden] {

    display: none;

}


#leaderboard-personal {

    display: flex;

    flex-direction: column;

    gap: 8px;

    padding-top: 12px;

    border-top: 2px dashed var(--border);

}


.personal-ranking-heading {

    color: var(--secondary-text);

    font-family: var(--number-font);

    font-size: 10px;

    letter-spacing: 1px;

    text-align: center;

}


.personal-ranking-row {

    animation: leaderboard-row-enter
        0.4s ease-out both;

    box-shadow:
        0 0 16px rgba(141, 230, 242, 0.08);

}


.personal-ranking-row .leaderboard-rank {

    min-width: 55px;

    color: var(--accent);

}


.personal-ranking-row .leaderboard-time {

    font-size: 13px;

}

/* ========================================
   EYEBALL — SHARED MENU POPUPS
======================================== */

.eyeball-popup {

    position: fixed;
    inset: 0;
    margin: auto;

    width: min(94vw, 460px);
    max-height: 94dvh;

    padding: 0;

    border: none;

    background: transparent;

    color: var(--text);

    overflow: auto;

    animation: username-enter 0.5s
        cubic-bezier(0.18, 0.85, 0.32, 1.15)
        both;

}


.eyeball-popup::backdrop {

    background: rgba(3, 9, 19, 0.8);

    backdrop-filter: blur(9px);

}


.eyeball-popup-panel {

    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 14px;

    padding: 26px 22px;

    background: linear-gradient(

        155deg,

        #203954,

        #101d33

    );

    border: 3px solid var(--border);

    border-radius: 28px;

    font-family: var(--game-font);

    text-align: center;

}


.eyeball-popup.popup-closing {

    animation: username-exit
        0.25s ease-in both;

}


.popup-icon {

    width: 52px;
    height: 52px;

    animation: eye-float
        4s ease-in-out infinite;

}


.popup-icon svg {

    width: 100%;
    height: 100%;

    display: block;

}


.stats-icon {

    color: var(--accent);

    fill: currentColor;

    filter: drop-shadow(
        0 0 14px rgba(141, 230, 242, 0.3)
    );

}


.help-icon {

    color: var(--purple);

    filter: drop-shadow(
        0 0 14px rgba(196, 173, 255, 0.3)
    );

}


.popup-title {

    font-size: clamp(28px, 7vw, 38px);

    font-weight: 700;

    letter-spacing: -1px;

    text-shadow: 0 4px 0 #070e1a;

}


.stats-title {

    color: var(--accent);

}


.help-title {

    color: var(--purple);

}


.popup-subtitle {

    color: var(--secondary-text);

    font-size: 16px;

}


.popup-footer {

    color: var(--secondary-text);

    font-family: var(--number-font);

    font-size: 10px;

    line-height: 1.6;

}


.popup-close-button {

    width: 100%;

    background: var(--panel);

    color: var(--text);

    border: 2px solid var(--border);

    box-shadow: 0 4px 0 #050b15;

}


.popup-close-button:hover {

    background: #233d5d;

    border-color: var(--accent);

}


/* ========================================
   PLAYER STATISTICS
======================================== */

#stats-content {

    width: 100%;

    display: flex;

    flex-direction: column;

    gap: 12px;

}


.stats-personal-best {

    width: 100%;

    padding: 22px 12px;

    background: radial-gradient(

        ellipse at 50% 30%,

        #183c55,

        #0a1528 85%

    );

    border: 2px solid #395573;

    border-radius: 18px;

}


.stats-record-label {

    color: var(--gold);

    font-family: var(--number-font);

    font-size: 11px;

    font-weight: 700;

    letter-spacing: 1px;

}


.stats-record-value {

    margin: 9px 0;

    color: var(--accent);

    font-family: var(--number-font);

    font-size: clamp(28px, 9vw, 44px);

    font-weight: 700;

    text-shadow:
        0 0 24px rgba(141, 230, 242, 0.2);

    animation: countdown-pop
        0.45s ease-out;

}


.stats-record-caption {

    color: var(--secondary-text);

    font-size: 13px;

}


.stats-grid {

    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 9px;

}


.stats-card {

    min-width: 0;

    display: flex;

    flex-direction: column;

    justify-content: center;

    gap: 8px;

    padding: 16px 8px;

    background: #101d33;

    border: 1px solid var(--border);

    border-radius: 13px;

    animation: leaderboard-row-enter
        0.35s ease-out both;

}


.stats-card:nth-child(2) {

    animation-delay: 60ms;

}


.stats-card:nth-child(3) {

    animation-delay: 120ms;

}


.stats-card:nth-child(4) {

    animation-delay: 180ms;

}


.stats-label {

    color: var(--secondary-text);

    font-size: 13px;

}


.stats-value {

    color: var(--accent);

    font-family: var(--number-font);

    font-size: clamp(15px, 4.5vw, 22px);

    font-weight: 700;

    overflow-wrap: anywhere;

}


.stats-rank-value {

    color: var(--gold);

}


/* ========================================
   HOW TO PLAY
======================================== */

.help-rules {

    width: 100%;

    display: flex;

    flex-direction: column;

    gap: 8px;

}


.help-rule {

    display: flex;

    align-items: flex-start;

    gap: 12px;

    padding: 13px;

    background: #101d33;

    border: 1px solid var(--border);

    border-radius: 13px;

    text-align: left;

}


.help-rule-icon {

    width: 42px;
    height: 42px;

    flex-shrink: 0;

    display: flex;

    align-items: center;

    justify-content: center;

    background: #0a1528;

    border: 1px solid var(--border);

    border-radius: 11px;

    color: var(--rule-color);

    font-size: 27px;

    font-weight: 700;

}


.help-rule-content {

    flex: 1;

}


.help-rule-content h3 {

    margin-bottom: 5px;

    font-size: 18px;

    font-weight: 600;

}


.help-rule-content p {

    color: var(--secondary-text);

    font-size: 13px;

    line-height: 1.5;

}


.help-reset-info {

    width: 100%;

    display: flex;

    flex-direction: column;

    gap: 6px;

    padding: 12px;

    border: 1px dashed var(--border);

    border-radius: 12px;

    font-family: var(--number-font);

}


.help-reset-info span {

    color: var(--secondary-text);

    font-size: 10px;

    letter-spacing: 1px;

}


.help-reset-info strong {

    color: var(--gold);

    font-size: 15px;

}


/* Matching animated Play button. */

.popup-action-button {

    width: 100%;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 12px;

    border: 3px solid #a5eff9;

    border-radius: 17px;

    padding: 14px 24px;

    transition:
        transform 0.25s
            cubic-bezier(0.2, 0.8, 0.3, 1.5),
        background 0.25s,
        box-shadow 0.25s;

}


.popup-action-button:hover {

    transform: scale(1.04);

    background: #a9f1fa;

    border-color: #efffff;

    box-shadow:
        0 6px 0 #315a80,
        0 0 24px rgba(141, 230, 242, 0.3);

}


.popup-action-button:hover .play-button-arrow {

    transform: translateX(4px);

}


.popup-action-button:active {

    transform: scale(0.96);

    box-shadow: 0 2px 0 #315a80;

}


/* ========================================
   SMALLER SCREENS
======================================== */

@media (max-height: 750px) {

    .eyeball-popup-panel {

        padding: 16px;

        gap: 10px;

    }

    .popup-icon {

        width: 38px;
        height: 38px;

    }

    .popup-title {

        font-size: 28px;

    }

    .stats-personal-best {

        padding: 14px 10px;

    }

    .stats-card {

        padding: 12px 8px;

    }

    .help-rule {

        padding: 9px;

    }

    .help-rule-content p {

        font-size: 12px;

    }

}

/* ========================================
   EYEBALL — GLOBAL PERFORMANCE COMPARISON
======================================== */

#global-comparison[hidden] {

    display: none;

}


#global-comparison {

    width: 100%;

    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 8px;

    padding: 14px 12px;

    background: linear-gradient(

        155deg,

        #132b40,

        #0a1528

    );

    border: 2px solid var(--border);

    border-radius: 17px;

    text-align: center;

}


/* ========================================
   PERCENTILE DISPLAY
======================================== */

.comparison-heading {

    color: var(--secondary-text);

    font-family: var(--number-font);

    font-size: 10px;

    font-weight: 700;

    letter-spacing: 1.5px;

}


.comparison-description {

    color: var(--secondary-text);

    font-family: var(--game-font);

    font-size: 15px;

}


.comparison-percentile {

    color: var(--success);

    font-family: var(--game-font);

    font-size: clamp(24px, 6vw, 36px);

    font-weight: 700;

    line-height: 1.1;

    text-shadow:

        0 3px 0 #07101e,

        0 0 20px rgba(110, 240, 194, 0.18);

}


#comparison-percent-value {

    display: inline-block;

    font-family: var(--number-font);

    font-variant-numeric: tabular-nums;

}


/* ========================================
   ANIMATED PERCENTILE BAR
======================================== */

.comparison-track {

    width: 100%;

    height: 9px;

    margin: 3px 0;

    background: #081323;

    border: 1px solid var(--border);

    border-radius: 20px;

    overflow: hidden;

}


#comparison-fill {

    width: 0%;

    height: 100%;

    background: linear-gradient(

        90deg,

        #26896d,

        var(--success)

    );

    border-radius: 20px;

    box-shadow:

        0 0 14px rgba(110, 240, 194, 0.3);

}


/* ========================================
   GLOBAL STATISTICS
======================================== */

.comparison-stats {

    width: 100%;

    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 8px;

}


.comparison-stat {

    display: flex;

    flex-direction: column;

    justify-content: center;

    gap: 5px;

    padding: 10px 6px;

    background: #101d33;

    border: 1px solid var(--border);

    border-radius: 11px;

}


.comparison-stat span {

    color: var(--secondary-text);

    font-size: 12px;

}


.comparison-stat strong {

    color: var(--accent);

    font-family: var(--number-font);

    font-size: clamp(16px, 4vw, 22px);

    font-weight: 700;

}


.comparison-stat .comparison-average {

    color: var(--gold);

}


.comparison-message {

    color: var(--secondary-text);

    font-size: 13px;

    font-weight: 500;

}


.comparison-message.comparison-faster {

    color: var(--success);

}


/* ========================================
   FIRST PLAYER MESSAGE
======================================== */

.comparison-first-player {

    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 5px;

    color: var(--gold);

    font-size: 26px;

}


.comparison-first-player strong {

    font-size: 21px;

}


.comparison-first-player span {

    color: var(--secondary-text);

    font-size: 12px;

    line-height: 1.4;

}


/* ========================================
   LOADING STATE
======================================== */

.comparison-loading {

    display: flex;

    align-items: center;

    justify-content: center;

    flex-wrap: wrap;

    gap: 10px;

    padding: 8px;

    color: var(--secondary-text);

    font-size: 13px;

}


.comparison-loading .leaderboard-spinner {

    width: 20px;

    height: 20px;

}


/* ========================================
   REVEAL ANIMATIONS
======================================== */

.comparison-reveal {

    animation: comparison-enter

        0.45s ease-out both;

}


@keyframes comparison-enter {

    from {

        opacity: 0;

        transform: translateY(12px);

    }

    to {

        opacity: 1;

        transform: translateY(0);

    }

}


.comparison-number-pop {

    animation: comparison-pop

        0.4s ease-out;

}


@keyframes comparison-pop {

    0%, 100% {

        transform: scale(1);

    }

    50% {

        transform: scale(1.15);

    }

}


/* ========================================
   COMPACT FINAL RESULTS
======================================== */

#game-content.final-results {

    gap: 9px;

}


#game-content.final-results
.performance-graph svg {

    max-height: 23dvh;

}


@media (max-height: 800px) {

    #global-comparison {

        padding: 9px;

        gap: 5px;

    }

    .comparison-heading {

        font-size: 9px;

    }

    .comparison-percentile {

        font-size: 25px;

    }

    .comparison-stat {

        padding: 6px;

    }

    .comparison-stat strong {

        font-size: 17px;

    }

    .comparison-message {

        font-size: 11px;

    }

    #game-content.final-results
    .performance-graph svg {

        max-height: 18dvh;

    }

}
