/* ==========================================
   GEO-SPACERACE: SPACE RACE
========================================== */
:root {
    --bg: #020617;
    --panel: rgba(15, 23, 42, 0.88);
    --line: rgba(56, 189, 248, 0.35);
    --cyan: #38bdf8;
    --cyan-glow: rgba(56, 189, 248, 0.55);
    --gold: #fbbf24;
    --text: #f8fafc;
    --muted: #94a3b8;
    --good: #22c55e;
    --bad: #ef4444;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    background: radial-gradient(ellipse at 50% -20%, #1e1b4b 0%, #0b1026 40%, var(--bg) 100%);
    color: var(--text);
    font-family: 'Rajdhani', system-ui, sans-serif;
    font-size: 17px;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}
#sr-app { position: relative; height: 100dvh; width: 100%; }
.hidden { display: none !important; }

/* ---------- screens ---------- */
.sr-screen { position: absolute; inset: 0; display: none; }
.sr-screen.active { display: flex; }

/* ---------- buttons ---------- */
.sr-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font-family: 'Orbitron', sans-serif; font-weight: 700; letter-spacing: 1.5px;
    border-radius: 12px; cursor: pointer; text-decoration: none;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.sr-btn:active { transform: scale(0.97); }
.sr-btn-main {
    width: 100%; padding: 16px 18px; font-size: 1.05rem; border: none; color: #04111f;
    background: linear-gradient(135deg, #67e8f9, #38bdf8 45%, #818cf8);
    box-shadow: 0 0 24px var(--cyan-glow), inset 0 -3px 0 rgba(0,0,0,.18);
}
.sr-btn-main:hover:not(:disabled) { box-shadow: 0 0 36px var(--cyan-glow), inset 0 -3px 0 rgba(0,0,0,.18); }
.sr-btn-main:disabled { opacity: .55; cursor: default; }
.sr-btn-ghost {
    padding: 11px 12px; font-size: .78rem; color: var(--text); flex: 1;
    background: rgba(15, 23, 42, .9); border: 1px solid var(--line);
}
.sr-btn-ghost:hover { border-color: var(--cyan); box-shadow: 0 0 14px rgba(56,189,248,.25); }

/* ---------- lobby ---------- */
#sr-lobby { align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.sr-lobby-card {
    position: relative; width: 100%; max-width: 520px; margin: auto;
    background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
    padding: 30px 24px 22px; text-align: center;
    box-shadow: 0 0 60px rgba(56,189,248,.18), inset 0 0 40px rgba(56,189,248,.05);
    backdrop-filter: blur(6px);
}
.sr-home-link { position: absolute; top: 14px; left: 16px; color: var(--muted); text-decoration: none; font-weight: 700; }
.sr-home-link:hover { color: var(--cyan); }
.sr-logo {
    font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: 2.1rem; letter-spacing: 3px;
    background: linear-gradient(90deg, #a5f3fc, #38bdf8, #c4b5fd, #f0abfc);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 0 14px rgba(56,189,248,.45));
    margin-top: 10px;
}
.sr-date { color: var(--gold); font-family: 'Orbitron', sans-serif; font-size: .78rem; letter-spacing: 2px; margin: 6px 0 14px; }
.sr-intro { color: #cbd5e1; font-size: 1.08rem; line-height: 1.4; margin-bottom: 12px; }
.sr-rules { list-style: none; text-align: left; display: grid; gap: 6px; margin: 0 auto 18px; max-width: 380px; color: #e2e8f0; font-size: 1rem; }
.sr-lineup-title { font-family: 'Orbitron', sans-serif; font-size: .72rem; letter-spacing: 3px; color: var(--muted); margin-bottom: 8px; }
.sr-lineup { display: grid; gap: 6px; margin-bottom: 18px; }
.sr-lineup-loading { color: var(--muted); }
.sr-lane-chip {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px;
    background: rgba(2, 6, 23, .6); border: 1px solid rgba(148,163,184,.18); text-align: left;
    animation: srChipIn .45s ease both;
}
.sr-lane-chip .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 10px currentColor; }
.sr-lane-chip .nm { font-weight: 700; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-lane-chip .tag { font-family: 'Orbitron', sans-serif; font-size: .62rem; letter-spacing: 1.5px; padding: 3px 7px; border-radius: 6px; }
.tag-you { background: rgba(56,189,248,.18); color: #7dd3fc; }
.tag-ghost { background: rgba(167,139,250,.18); color: #c4b5fd; }
.tag-bot { background: rgba(251,191,36,.15); color: #fcd34d; }
@keyframes srChipIn { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.sr-lobby-row { display: flex; gap: 8px; margin-top: 10px; }
.sr-callsign { margin-top: 12px; color: var(--muted); font-size: .95rem; }
.sr-callsign a { color: var(--cyan); cursor: pointer; }

/* ---------- race ---------- */
#sr-race { flex-direction: column; }
.sr-track-wrap { position: relative; flex: none; height: clamp(170px, 34vh, 290px); border-bottom: 1px solid var(--line); }
#sr-track { width: 100%; height: 100%; display: block; }
.sr-hud {
    position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 8px; align-items: center; pointer-events: none;
}
.sr-hud { transition: opacity .6s ease; }
.sr-hud.fade { opacity: 0; }
.sr-hud-item {
    display: flex; flex-direction: column; align-items: center; min-width: 86px;
    padding: 4px 10px; border-radius: 10px; background: rgba(2,6,23,.6); border: 1px solid rgba(56,189,248,.25);
    font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 1rem; backdrop-filter: blur(3px);
}
.sr-hud-label { font-size: .55rem; letter-spacing: 2px; color: var(--muted); }
#sr-streak.hot { color: var(--gold); text-shadow: 0 0 10px rgba(251,191,36,.8); }
.sr-abort {
    pointer-events: auto; width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(239,68,68,.5);
    background: rgba(2,6,23,.6); color: #fca5a5; font-size: 1rem; cursor: pointer;
}
.sr-abort:hover { background: rgba(239,68,68,.25); }

.sr-question-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 10px 12px 12px; gap: 8px; max-width: 900px; width: 100%; margin: 0 auto; }
.sr-prompt {
    text-align: center; font-family: 'Orbitron', sans-serif; font-weight: 700; letter-spacing: 1px;
    font-size: clamp(1rem, 2.6vw, 1.35rem); min-height: 1.6em;
    text-shadow: 0 0 14px rgba(56,189,248,.4);
}
.sr-prompt.pop { animation: srPromptPop .45s cubic-bezier(.2,1.6,.4,1); }
@keyframes srPromptPop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.sr-prompt b { color: var(--gold); }
.sr-prompt .sr-kw { color: #67e8f9; text-transform: uppercase; font-weight: 800; letter-spacing: .04em; text-shadow: 0 0 12px rgba(103,232,249,.45); }

.sr-map-wrap {
    position: relative; flex: 1; min-height: 120px; border-radius: 16px; overflow: hidden;
    border: 1px solid var(--line); box-shadow: inset 0 0 40px rgba(2,6,23,.9), 0 0 24px rgba(56,189,248,.12);
}
#sr-map { width: 100%; height: 100%; display: block; }
.sr-map-tag {
    position: absolute; top: 8px; left: 10px; font-family: 'Orbitron', sans-serif; font-size: .6rem; letter-spacing: 2px;
    color: #7dd3fc; background: rgba(2,6,23,.7); padding: 4px 8px; border-radius: 6px; border: 1px solid rgba(56,189,248,.3);
}
.sr-feedback {
    position: absolute; left: 50%; bottom: 14px; transform: translate(-50%, 20px); opacity: 0;
    font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: clamp(1rem, 3vw, 1.4rem); letter-spacing: 1px;
    padding: 8px 16px; border-radius: 12px; white-space: nowrap; pointer-events: none;
    transition: opacity .2s ease, transform .35s cubic-bezier(.2,1.5,.4,1);
}
.sr-feedback.show { opacity: 1; transform: translate(-50%, 0); }
.sr-feedback.good { background: rgba(22,163,74,.85); box-shadow: 0 0 24px rgba(34,197,94,.7); }
.sr-feedback.bad { background: rgba(185,28,28,.88); box-shadow: 0 0 24px rgba(239,68,68,.7); }
.sr-feedback.rare { background: linear-gradient(135deg, rgba(202,138,4,.92), rgba(147,51,234,.88)); box-shadow: 0 0 28px rgba(250,204,21,.75); }

.sr-answer { position: relative; flex: none; }
.sr-suggest { display: flex; gap: 6px; flex-wrap: wrap; min-height: 34px; margin-bottom: 6px; justify-content: center; }
.sr-chip {
    font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 1rem; color: #e0f2fe;
    padding: 5px 12px; border-radius: 999px; cursor: pointer;
    background: rgba(14, 116, 144, .25); border: 1px solid rgba(56,189,248,.4);
    animation: srChipPop .18s ease both;
}
.sr-chip.hi { background: var(--cyan); color: #04111f; box-shadow: 0 0 14px var(--cyan-glow); }
@keyframes srChipPop { from { transform: scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
.sr-input-row { display: flex; gap: 8px; }
.sr-skip-hint { font-family: 'Orbitron', sans-serif; font-size: .75rem; letter-spacing: 1px; color: #fcd34d; align-self: center; }
#sr-input {
    flex: 1; min-width: 0; padding: 14px 16px; border-radius: 14px; outline: none;
    font-family: 'Rajdhani', sans-serif; font-size: 1.35rem; font-weight: 700; letter-spacing: .5px;
    color: var(--text); background: #020617; border: 2px solid rgba(56,189,248,.45);
    box-shadow: 0 0 0 0 rgba(56,189,248,0); transition: border-color .15s, box-shadow .2s;
}
#sr-input:focus { border-color: var(--cyan); box-shadow: 0 0 22px rgba(56,189,248,.35); }
#sr-input.good { border-color: var(--good); box-shadow: 0 0 26px rgba(34,197,94,.6); }
#sr-input.bad { border-color: var(--bad); box-shadow: 0 0 26px rgba(239,68,68,.6); }
#sr-input.shake { animation: srShake .35s ease; }
#sr-input:disabled, #sr-input.locked { opacity: .6; }
@keyframes srShake { 20%,60% { transform: translateX(-7px); } 40%,80% { transform: translateX(7px); } }
.sr-go, .sr-skip {
    font-family: 'Orbitron', sans-serif; font-weight: 900; letter-spacing: 1px; border-radius: 14px; cursor: pointer; flex: none;
}
.sr-go { padding: 0 20px; border: none; color: #04111f; background: linear-gradient(135deg, #67e8f9, #38bdf8); box-shadow: 0 0 16px var(--cyan-glow); }
.sr-skip { padding: 0 12px; background: transparent; color: var(--muted); border: 1px solid rgba(148,163,184,.35); font-size: .72rem; }
.sr-go:disabled, .sr-skip:disabled { opacity: .45; cursor: default; }

/* ---------- callouts (countdown, BOOST, etc) ---------- */
.sr-callout {
    position: fixed; left: 50%; top: 22%; transform: translate(-50%, -50%) scale(.6); opacity: 0; pointer-events: none;
    font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: clamp(3rem, 12vw, 7rem); letter-spacing: 4px;
    color: #fff; text-shadow: 0 0 30px var(--cyan), 0 0 60px rgba(129,140,248,.8); z-index: 50; white-space: nowrap;
}
.sr-callout.go { animation: srCallout .9s cubic-bezier(.2,1.4,.4,1) both; }
.sr-callout.small { font-size: clamp(1.6rem, 6vw, 3rem); }
.sr-callout.gold { text-shadow: 0 0 30px var(--gold), 0 0 60px rgba(249,115,22,.9); }
@keyframes srCallout {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); }
    25% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
    70% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.35); }
}

/* ---------- overlays ---------- */
.sr-overlay {
    position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 16px;
    background: radial-gradient(circle at 50% 30%, rgba(30,27,75,.75), rgba(2,6,23,.92));
    animation: srFade .5s ease both; overflow-y: auto;
}
@keyframes srFade { from { opacity: 0; } to { opacity: 1; } }
.sr-res-card {
    width: 100%; max-width: 480px; margin: auto; text-align: center;
    background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 26px 22px 20px;
    box-shadow: 0 0 70px rgba(56,189,248,.25); animation: srCardUp .6s cubic-bezier(.2,1.3,.4,1) both;
}
@keyframes srCardUp { from { transform: translateY(40px) scale(.95); opacity: 0; } to { transform: none; opacity: 1; } }
.sr-res-medal { font-size: 4rem; line-height: 1; filter: drop-shadow(0 0 20px rgba(251,191,36,.7)); animation: srMedal 1.2s ease both; }
@keyframes srMedal { 0% { transform: scale(0) rotate(-40deg); } 60% { transform: scale(1.25) rotate(10deg); } 100% { transform: none; } }
.sr-res-title { font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: 1.6rem; letter-spacing: 2px; margin-top: 8px; }
.sr-res-sub { color: var(--muted); margin: 6px 0 14px; line-height: 1.35; }
.sr-res-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.sr-res-stats div { background: rgba(2,6,23,.6); border: 1px solid rgba(56,189,248,.2); border-radius: 12px; padding: 10px 4px; }
.sr-res-stats span { display: block; font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: 1.15rem; color: #7dd3fc; }
.sr-res-stats label { font-size: .8rem; color: var(--muted); }
.sr-res-section { font-family: 'Orbitron', sans-serif; font-size: .68rem; letter-spacing: 3px; color: var(--muted); margin: 6px 0 8px; text-align: left; }
.sr-standings, .sr-leaderboard { list-style: none; display: grid; gap: 5px; margin-bottom: 14px; text-align: left; }
.sr-standings li, .sr-leaderboard li {
    display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 10px;
    background: rgba(2,6,23,.55); border: 1px solid rgba(148,163,184,.14); font-weight: 600;
}
.sr-standings li.me, .sr-leaderboard li.me { border-color: var(--cyan); background: rgba(14,116,144,.25); }
.sr-standings .pl, .sr-leaderboard .pl { font-family: 'Orbitron', sans-serif; width: 28px; color: var(--gold); }
.sr-standings .nm, .sr-leaderboard .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-standings .tm, .sr-leaderboard .tm { font-family: 'Orbitron', sans-serif; font-size: .9rem; color: #e2e8f0; }
.sr-muted { color: var(--muted); justify-content: center; }
.sr-res-btns { display: grid; gap: 8px; margin-top: 6px; }
.sr-res-btns .sr-btn-ghost { padding: 14px; font-size: .9rem; }

/* ---------- callsign box ---------- */
.sr-name-box input {
    width: 100%; padding: 12px 14px; font-size: 1.15rem; border-radius: 10px; border: 1px solid var(--cyan);
    background: #020617; color: var(--text); outline: none; font-family: inherit; font-weight: 700; margin: 10px 0 6px;
}
.sr-name-err { color: #f87171; min-height: 1.2em; font-size: .9rem; margin-bottom: 8px; }

@media (max-width: 560px) {
    body { font-size: 16px; }
    .sr-hud { top: 6px; gap: 5px; }
    .sr-hud-item { min-width: 64px; padding: 3px 6px; font-size: .85rem; }
    .sr-hud-label { font-size: .48rem; letter-spacing: 1px; }
    .sr-logo { font-size: 1.7rem; }
    #sr-input { font-size: 1.2rem; padding: 12px; }
    .sr-go { padding: 0 14px; }
    .sr-question-panel { padding: 8px; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- online: quick match + private rooms ---------- */
.sr-mp { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(56,189,248,.18); }
.sr-join-row { display: flex; gap: 8px; margin-top: 8px; }
#sr-join-code {
    flex: 1; min-width: 0; padding: 10px 14px; border-radius: 12px; outline: none; text-align: center;
    font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: 1.05rem; letter-spacing: 6px;
    color: var(--text); background: #020617; border: 1px solid var(--line);
}
#sr-join-code:focus { border-color: var(--cyan); box-shadow: 0 0 16px rgba(56,189,248,.3); }
#sr-join-code.shake { animation: srShake .35s ease; }
.sr-join-row .sr-btn-ghost { flex: none; padding: 10px 18px; }
#sr-room { align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.sr-room-title { font-size: 1.5rem; margin-top: 0; }
.sr-room-code-label { margin-top: 14px; font-family: 'Orbitron', sans-serif; font-size: .62rem; letter-spacing: 3px; color: var(--muted); }
.sr-room-code {
    font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: 3.2rem; letter-spacing: 14px; padding-left: 14px;
    color: #fde68a; text-shadow: 0 0 22px rgba(251,191,36,.6); margin: 2px 0 8px;
}
.sr-room-share { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.sr-room-link {
    flex: 1; min-width: 0; font-size: .9rem; color: #7dd3fc; background: rgba(2,6,23,.6); border: 1px dashed rgba(56,189,248,.35);
    border-radius: 10px; padding: 9px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; user-select: all;
}
.sr-room-share .sr-btn-ghost { flex: none; }
.sr-room-status { color: #e2e8f0; min-height: 1.4em; margin: 6px 0 14px; line-height: 1.35; }
.sr-room-settings { display: grid; gap: 8px; margin: 4px 0 16px; }
.sr-set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sr-set-row > span { color: var(--muted); font-weight: 700; }
.sr-seg { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: rgba(2,6,23,.7); border: 1px solid rgba(56,189,248,.25); }
.sr-seg button {
    border: none; background: transparent; color: var(--muted); padding: 7px 10px; border-radius: 9px; cursor: pointer;
    font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: .95rem;
}
.sr-seg button.active { background: var(--cyan); color: #04111f; box-shadow: 0 0 12px var(--cyan-glow); }
.sr-seg button:disabled { cursor: default; }
.sr-seg button:disabled:not(.active) { opacity: .5; }
#sr-room-btns { margin-top: 0; }
@media (max-width: 560px) {
    .sr-room-code { font-size: 2.6rem; letter-spacing: 10px; }
    .sr-set-row { flex-direction: column; align-items: stretch; }
    .sr-seg button { flex: 1; }
}

/* ---------- compact lobby (smaller card, nothing to scroll) ---------- */
#sr-lobby .sr-lobby-card { max-width: 440px; padding: 20px 20px 14px; }
#sr-lobby .sr-home-link { top: 12px; left: 14px; font-size: .9rem; }
#sr-lobby .sr-logo { font-size: 1.7rem; margin-top: 4px; }
#sr-lobby .sr-date { margin: 4px 0 8px; font-size: .7rem; }
#sr-lobby .sr-intro { font-size: .98rem; margin-bottom: 8px; }
#sr-lobby .sr-rules { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: none; margin: 0 0 10px; font-size: .7rem; line-height: 1.2; text-align: center; }
#sr-lobby .sr-rules li { padding: 2px 7px; border-radius: 999px; background: rgba(2,6,23,.55); border: 1px solid rgba(148,163,184,.2); color: #cbd5e1; white-space: nowrap; }
#sr-lobby .sr-lineup-title { font-size: .62rem; margin-bottom: 6px; }
#sr-lobby .sr-lineup { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-bottom: 4px; }
#sr-lobby .sr-lineup-note { font-size: .66rem; color: var(--muted); text-align: center; margin: 0 0 12px; }
#sr-lobby .sr-lane-chip { padding: 2px 8px; gap: 5px; font-size: .74rem; border-radius: 999px; }
#sr-lobby .sr-lane-chip .nm { flex: none; max-width: 110px; }
#sr-lobby .sr-lane-chip .dot { width: 8px; height: 8px; }
#sr-lobby .sr-lane-chip .tag { font-size: .5rem; letter-spacing: 1px; padding: 1px 5px; }
#sr-lobby .sr-btn-main { padding: 13px 16px; font-size: .98rem; }
#sr-lobby .sr-lobby-row { margin-top: 8px; }
#sr-lobby .sr-btn-ghost { padding: 8px 10px; font-size: .7rem; }
#sr-lobby .sr-mp { margin-top: 12px; padding-top: 10px; }
.sr-mp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sr-mp-grid .sr-join-row { grid-column: 1 / -1; margin-top: 0; gap: 6px; }
#sr-lobby #sr-join-code { padding: 7px 10px; font-size: .95rem; }
#sr-lobby .sr-join-row .sr-btn-ghost { padding: 8px 18px; }
#sr-lobby .sr-callsign { margin-top: 8px; font-size: .85rem; }
.tag-racer { background: rgba(148,163,184,.14); color: #cbd5e1; }
@media (max-width: 560px) {
    #sr-lobby .sr-logo { font-size: 1.45rem; margin-top: 20px; }
}
/* "Ethan landed 1st!" notice */
#sr-map-tag.alert { font-size: .9rem; letter-spacing: 1.5px; padding: 6px 12px; background: rgba(120, 53, 15, .85); border-color: #fcd34d; box-shadow: 0 0 22px rgba(250, 204, 21, .55); animation: srAlert .5s ease 3; z-index: 3; }
@keyframes srAlert { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* ---------- answer review on the results screen ---------- */
.sr-review-btn { width: 100%; margin: 0 0 12px; padding: 10px 12px; font-size: .78rem; }
.sr-review { list-style: none; display: grid; gap: 6px; margin: -4px 0 14px; text-align: left; max-height: 46vh; overflow-y: auto; padding-right: 4px; }
.sr-review.hidden { display: none; }
.sr-review li { padding: 8px 10px; border-radius: 10px; background: rgba(2,6,23,.6); border: 1px solid rgba(148,163,184,.18); }
.sr-review li.ok { border-left: 3px solid #22c55e; }
.sr-review li.bad { border-left: 3px solid #ef4444; }
.sr-rv-top { display: flex; align-items: flex-start; gap: 8px; }
.sr-rv-n { font-family: 'Orbitron', sans-serif; font-size: .62rem; color: var(--muted); min-width: 16px; padding-top: 3px; }
.sr-rv-icon { font-size: 1rem; line-height: 1.2; }
.sr-rv-q { flex: 1; min-width: 0; }
.sr-rv-tag { font-family: 'Orbitron', sans-serif; font-size: .52rem; letter-spacing: 1.5px; color: var(--muted); }
.sr-rv-prompt { font-weight: 700; line-height: 1.25; }
.sr-rv-prompt b { color: var(--gold); }
.sr-rv-you { font-size: .88rem; color: #cbd5e1; }
.sr-rv-pts { font-family: 'Orbitron', sans-serif; font-size: .65rem; font-weight: 700; white-space: nowrap; color: #86efac; padding-top: 3px; }
.sr-rv-pts.rare { color: #fde047; }
.sr-rv-pts.miss { color: #fca5a5; }
.sr-rv-all { margin: 6px 0 0 24px; font-size: .8rem; line-height: 1.7; color: #cbd5e1; }
.sr-rv-lbl { color: var(--muted); margin-right: 2px; }
.sr-rv-ans { display: inline-block; padding: 0 7px; margin: 0 3px 3px 0; border-radius: 999px; background: rgba(148,163,184,.12); line-height: 1.6; }
.sr-rv-ans.rare { background: rgba(202,138,4,.18); color: #fde68a; }
.sr-rv-ans.you { outline: 2px solid #38bdf8; color: #fff; font-weight: 700; }

/* ---------- your stats (lobby) + personal best badge ---------- */
.sr-mystats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-bottom: 12px; }
.sr-mystats div { background: rgba(2,6,23,.6); border: 1px solid rgba(56,189,248,.18); border-radius: 10px; padding: 5px 2px; }
.sr-mystats b { display: block; font-family: 'Orbitron', sans-serif; font-size: .82rem; color: #7dd3fc; }
.sr-mystats span { font-size: .66rem; color: var(--muted); }
.sr-ms-empty { grid-column: 1 / -1; color: var(--muted); font-size: .85rem; padding: 4px; }
.sr-res-pb { display: inline-block; margin-top: 8px; padding: 4px 12px; border-radius: 999px; font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: .75rem; letter-spacing: 1.5px;
    color: #1c1917; background: linear-gradient(90deg, #fde047, #f59e0b); box-shadow: 0 0 22px rgba(250,204,21,.6); animation: srAlert .6s ease 3; }
.sr-res-pb.hidden { display: none; }

/* quick match: MATCH FOUND! 3-2-1 in the room card */
#sr-room-code.mf-small { font-size: clamp(1.6rem, 6vw, 2.6rem); letter-spacing: 3px; }
#sr-room-code.mf-pop { animation: srMfPop .6s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes srMfPop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }

/* inline US flag (Windows doesn't draw flag emoji) */
.sr-flag { width: 1.35em; height: .72em; vertical-align: -0.05em; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255,255,255,.25); }

/* ================= GARAGE: wallet, boosts, shop & hangar ================= */
.sr-garage-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
    margin: 2px 0 14px; padding: 8px 10px; border-radius: 14px; background: rgba(2,6,23,.55); border: 1px solid rgba(251,191,36,.3); }
.sr-wallet { font-family: 'Rajdhani', sans-serif; font-size: 1.1rem; color: var(--text); white-space: nowrap; }
.sr-wallet b { color: var(--gold); }
.sr-wallet-sep { color: var(--muted); margin: 0 4px; }
.sr-garage-btns { display: flex; gap: 6px; }
.sr-garage-btns .sr-btn { flex: none; padding: 8px 10px; font-size: .72rem; letter-spacing: 1px; }

.sr-boost { padding: 0 12px; border-radius: 14px; cursor: pointer; flex: none; font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: 1rem;
    color: #1c1003; background: linear-gradient(135deg, #fde68a, #f59e0b); border: none; box-shadow: 0 0 16px rgba(251,191,36,.55); }
.sr-boost span { font-size: .8rem; margin-left: 3px; }
.sr-boost.none { background: transparent; color: var(--muted); border: 1px solid rgba(148,163,184,.35); box-shadow: none; }
.sr-boost:disabled { opacity: .45; cursor: default; }

.sr-res-cash { margin: 10px 0 4px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.sr-res-cash.pop { animation: srMfPop .6s cubic-bezier(.2,1.4,.4,1) both; animation-delay: .5s; }
.sr-cash-earn { font-family: 'Orbitron', sans-serif; font-weight: 900; color: var(--gold); font-size: 1.15rem; padding: 6px 12px; border-radius: 12px;
    background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.4); text-shadow: 0 0 12px rgba(251,191,36,.5); }
.sr-cash-earn span { display: block; font-family: 'Rajdhani', sans-serif; font-size: .72rem; color: var(--muted); letter-spacing: 1px; text-shadow: none; font-weight: 700; }
.sr-cash-earn.bonus { color: #86efac; border-color: rgba(134,239,172,.4); background: rgba(34,197,94,.08); }
.sr-cash-total { width: 100%; color: var(--muted); font-size: .95rem; }
.sr-cash-total b { color: var(--text); }
.sr-cash-unlock { width: 100%; color: #fde68a; font-weight: 700; }
.sr-cash-unlock a { color: var(--cyan); margin-left: 4px; }

#sr-garage { z-index: 45; align-items: flex-start; }
.sr-gar-card { position: relative; width: min(820px, 100%); margin: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
    padding: 16px; box-shadow: 0 0 60px rgba(56,189,248,.15); }
.sr-gar-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sr-gar-modes { display: flex; gap: 6px; }
.sr-gar-modes button, .sr-gar-tabs button { font-family: 'Orbitron', sans-serif; font-weight: 700; letter-spacing: 1px; cursor: pointer;
    padding: 9px 14px; border-radius: 12px; color: var(--muted); background: rgba(2,6,23,.6); border: 1px solid rgba(148,163,184,.25); font-size: .8rem; }
.sr-gar-modes button.on { color: #04111f; background: linear-gradient(135deg, #67e8f9, #38bdf8); border-color: transparent; box-shadow: 0 0 16px var(--cyan-glow); }
.sr-gar-tabs { display: flex; gap: 6px; margin: 12px 0 10px; flex-wrap: wrap; }
.sr-gar-tabs button { font-size: .72rem; padding: 7px 12px; }
.sr-gar-tabs button.on { color: var(--text); border-color: var(--cyan); box-shadow: 0 0 12px rgba(56,189,248,.3); }
.sr-gar-wallet { margin-left: auto; display: flex; gap: 12px; font-family: 'Rajdhani', sans-serif; font-size: 1.15rem; }
.sr-gar-wallet b { color: var(--gold); }
.sr-gar-x { background: none; border: 1px solid rgba(148,163,184,.3); color: var(--muted); border-radius: 10px; width: 36px; height: 36px; cursor: pointer; font-size: 1rem; }
.sr-gar-x:hover { color: var(--text); border-color: var(--cyan); }
.sr-gar-hint { color: var(--muted); font-size: .92rem; margin-bottom: 10px; text-align: left; }
.sr-gar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.sr-gar-item { background: rgba(2,6,23,.6); border: 1px solid rgba(148,163,184,.2); border-radius: 14px; padding: 8px; display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.sr-gar-item.eq { border-color: var(--gold); box-shadow: 0 0 16px rgba(251,191,36,.25); }
.sr-gar-item.locked .sr-gar-prev { filter: saturate(.55) brightness(.8); }
.sr-gar-prev { width: 100%; height: auto; aspect-ratio: 2 / 1; border-radius: 10px; background: radial-gradient(ellipse at 30% 50%, #1e1b4b, #020617); }
.sr-gar-prev.sm { width: 110px; flex: none; }
.sr-gar-name { font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: .78rem; letter-spacing: 1px; color: var(--text); }
.sr-gar-tag { white-space: nowrap; font-size: .55rem; color: var(--gold); border: 1px solid rgba(251,191,36,.5); border-radius: 6px; padding: 1px 4px; margin-left: 4px; vertical-align: middle; }
.sr-gar-btn { width: 100%; padding: 8px; font-size: .78rem; }
.sr-gar-eq { font-family: 'Orbitron', sans-serif; font-size: .72rem; color: var(--gold); padding: 8px 0; letter-spacing: 1px; }
.sr-gar-lock { font-size: .82rem; color: var(--muted); line-height: 1.2; }
.sr-gar-bar { height: 6px; border-radius: 4px; background: rgba(148,163,184,.18); overflow: hidden; }
.sr-gar-bar i { display: block; height: 100%; background: linear-gradient(90deg, #38bdf8, #a78bfa); border-radius: 4px; }
.sr-gar-prog { font-size: .75rem; color: var(--muted); }
.sr-gar-boost { display: grid; gap: 12px; justify-items: center; padding: 10px; }
.sr-gar-boost-icon { font-size: 3.4rem; filter: drop-shadow(0 0 16px rgba(251,191,36,.8)); }
.sr-gar-boost-txt { max-width: 520px; color: var(--text); font-size: 1.02rem; line-height: 1.35; }
.sr-gar-boost-txt b { color: var(--gold); }
.sr-gar-have { font-size: 1.1rem; color: var(--muted); }
.sr-gar-have b { color: var(--gold); font-size: 1.4rem; }
.sr-gar-boost-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; width: 100%; max-width: 520px; }
.sr-gar-boost-btns .sr-btn { flex: 1; min-width: 200px; }
.sr-gar-boost-btns small { opacity: .75; }
.sr-gar-list { display: grid; gap: 8px; }
.sr-gar-ch { display: flex; align-items: center; gap: 12px; background: rgba(2,6,23,.6); border: 1px solid rgba(148,163,184,.2); border-radius: 14px; padding: 8px 12px; text-align: left; }
.sr-gar-ch.done { border-color: rgba(34,197,94,.5); }
.sr-gar-ch-txt { flex: 1; display: grid; gap: 4px; }
.sr-gar-ch-txt span { font-size: .85rem; color: var(--muted); }
.sr-gar-ch-n { font-family: 'Orbitron', sans-serif; font-size: .75rem; color: var(--text); white-space: nowrap; }
.sr-gar-toast { position: absolute; left: 50%; bottom: 14px; transform: translate(-50%, 20px); opacity: 0; transition: .25s; pointer-events: none;
    padding: 10px 16px; border-radius: 12px; background: #450a0a; border: 1px solid var(--bad); color: #fecaca; font-weight: 700; white-space: nowrap; }
.sr-gar-toast.good { background: #052e16; border-color: var(--good); color: #bbf7d0; }
.sr-gar-toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 520px) { .sr-gar-grid { grid-template-columns: repeat(2, 1fr); } .sr-gar-prev.sm { width: 80px; } }

/* ★ legendary cards */
.sr-gar-tag.lg { color: #1c1003; border: none; background: linear-gradient(90deg, #fde68a, #f59e0b, #f472b6, #a78bfa, #fde68a); background-size: 200% 100%; animation: srLgShine 3s linear infinite; font-weight: 900; }
.sr-gar-item.legend, .sr-gar-ch.legend { position: relative; border-color: transparent;
    background: linear-gradient(rgba(10,12,30,.95), rgba(10,12,30,.95)) padding-box, linear-gradient(120deg, #fde68a, #f472b6, #818cf8, #22d3ee, #fde68a) border-box;
    background-size: 100% 100%, 300% 300%; animation: srLgBorder 6s linear infinite; border: 1.5px solid transparent; box-shadow: 0 0 18px rgba(244,114,182,.18); }
.sr-gar-item.legend .sr-gar-prev { background: radial-gradient(ellipse at 50% 50%, #2e1065, #020617 75%); }
.sr-gar-item.legend.locked .sr-gar-prev { filter: saturate(.75) brightness(.85); }
@keyframes srLgShine { to { background-position: 200% 0; } }
@keyframes srLgBorder { to { background-position: 0 0, 300% 0; } }

.sr-gar-tag.an { color: #a5f3fc; border-color: rgba(103,232,249,.5); }
.sr-gar-item.anim { border-color: rgba(103,232,249,.35); }
.sr-gar-item.anim .sr-gar-prev { background: radial-gradient(ellipse at 50% 50%, #172554, #020617 75%); }

/* launch pad: racers' rockets waiting in the room */
.sr-room-pad { display: block; width: 100%; height: clamp(210px, 34vh, 290px); margin: 10px 0 12px; border-radius: 14px;
    background: radial-gradient(ellipse at 20% 50%, rgba(30,27,75,.9), rgba(2,6,23,.95) 70%); border: 1px solid rgba(56,189,248,.25); }

/* 🔥 daily deals */
.sr-deals { margin: 0 0 12px; padding: 10px 12px; border-radius: 14px; text-align: left;
    background: linear-gradient(135deg, rgba(234,88,12,.18), rgba(219,39,119,.14)); border: 1px solid rgba(251,146,60,.45); }
.sr-deals-head { font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: .8rem; letter-spacing: 2px; color: #fdba74; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.sr-deals-timer { font-family: 'Rajdhani', sans-serif; letter-spacing: .5px; color: var(--muted); font-size: .9rem; font-weight: 600; }
.sr-deals-timer b { color: var(--text); }
.sr-deals-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sr-deal-chip { cursor: pointer; font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: .95rem; padding: 5px 10px; border-radius: 10px;
    color: var(--text); background: rgba(2,6,23,.6); border: 1px solid rgba(251,146,60,.35); }
.sr-deal-chip b { color: #fb923c; }
.sr-deal-chip.star { border-color: var(--gold); box-shadow: 0 0 12px rgba(251,191,36,.3); }
.sr-deal-chip.star b { color: var(--gold); }
.sr-deal-chip.boost b { color: #fde047; }
.sr-deal-chip:hover { border-color: #fb923c; }
.sr-gar-item { position: relative; }
.sr-gar-item.sale { border-color: rgba(251,146,60,.55); }
.sr-gar-item.dotd { border-color: var(--gold); box-shadow: 0 0 18px rgba(251,191,36,.3); }
.sr-gar-ribbon { position: absolute; top: 6px; right: 6px; z-index: 2; font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: .7rem; letter-spacing: 1px;
    padding: 4px 8px; border-radius: 8px; color: #1c0a00; background: linear-gradient(135deg, #fdba74, #f97316); box-shadow: 0 0 12px rgba(249,115,22,.5); }
.sr-gar-item.dotd .sr-gar-ribbon { background: linear-gradient(135deg, #fde68a, #f59e0b); }
.sr-gar-btn s, .sr-gar-boost-btns s { opacity: .6; font-weight: 600; margin-right: 2px; }
.sr-gar-item.flash { animation: srDealFlash 1.2s ease 2; }
@keyframes srDealFlash { 50% { box-shadow: 0 0 0 3px #fb923c, 0 0 30px rgba(251,146,60,.6); } }
.sr-sale-tag { display: inline-block; margin-left: 4px; padding: 1px 5px; border-radius: 6px; font-size: .6rem; color: #1c0a00; background: #fb923c; letter-spacing: .5px; }

.sr-boost-buy { flex-direction: column; gap: 2px; padding: 12px 14px; line-height: 1.15; white-space: nowrap; }
.sr-boost-buy .bb-n { font-size: .82rem; letter-spacing: 1.5px; }
.sr-boost-buy .bb-p { font-size: 1.15rem; }
.sr-boost-buy small { font-size: .7rem; opacity: .75; letter-spacing: .5px; }

/* 🟢 easy mode button */
.sr-easy-btn { width: 100%; margin-top: 8px; border-color: rgba(74,222,128,.45); color: #bbf7d0; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sr-easy-btn small { font-family: 'Rajdhani', sans-serif; letter-spacing: .5px; font-size: .8rem; color: var(--muted); text-transform: none; font-weight: 600; }
.sr-easy-btn:hover:not(:disabled) { border-color: #4ade80; box-shadow: 0 0 14px rgba(74,222,128,.3); }
#sr-quick-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
#sr-quick-btn small { font-family: 'Rajdhani', sans-serif; letter-spacing: .5px; font-size: .78rem; color: #fde68a; text-transform: none; font-weight: 700; }

/* 🎵 victory sounds in the shop / hangar */
.sr-gar-sound { position: relative; }
.sr-snd-play { position: relative; width: 100%; aspect-ratio: 2 / 1; border-radius: 10px; border: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
    background: radial-gradient(ellipse at 30% 50%, #312e81, #020617); color: var(--text); transition: transform .12s, box-shadow .2s; }
.sr-snd-play:hover { transform: translateY(-1px); box-shadow: 0 0 18px rgba(129,140,248,.45); }
.sr-snd-play:active { transform: scale(.97); }
.sr-snd-icon { font-size: 2.2rem; filter: drop-shadow(0 0 10px rgba(255,255,255,.25)); }
.sr-snd-btn { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .9rem; padding-left: 2px;
    background: rgba(56,189,248,.2); border: 1px solid rgba(56,189,248,.6); color: #e0f2fe; }
.sr-snd-play.playing .sr-snd-btn { background: rgba(251,191,36,.25); border-color: var(--gold); animation: srSndPulse .6s ease-in-out infinite alternate; }
@keyframes srSndPulse { to { box-shadow: 0 0 14px rgba(251,191,36,.7); } }
.sr-snd-desc { font-size: .72rem; color: var(--muted); line-height: 1.3; min-height: 2.6em; }
.sr-gar-item.sr-gar-sound.locked .sr-snd-icon { filter: saturate(.6); }
.sr-snd-credit { font-size: .62rem; color: var(--muted); opacity: .8; margin-top: -2px; }

/* 🔀 shuffle toggle in the hangar */
.sr-shuffle { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; padding: 10px 14px; border-radius: 12px;
    border: 1px solid rgba(148,163,184,.25); background: rgba(15,23,42,.6); text-align: left; }
.sr-shuffle.on { border-color: rgba(56,189,248,.6); background: rgba(14,116,144,.18); }
.sr-shuffle b { display: block; font-size: .95rem; }
.sr-shuffle span { display: block; font-size: .74rem; color: var(--muted); margin-top: 2px; }
.sr-shuffle-tog { flex: none; width: 50px; height: 28px; border-radius: 999px; border: 1px solid rgba(148,163,184,.4); background: #1e293b; position: relative; cursor: pointer; transition: background .2s; }
.sr-shuffle-tog i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #cbd5e1; transition: transform .2s, background .2s; }
.sr-shuffle.on .sr-shuffle-tog { background: #0ea5e9; border-color: #38bdf8; }
.sr-shuffle.on .sr-shuffle-tog i { transform: translateX(22px); background: #fff; }
.sr-shuffle-tog:disabled { opacity: .4; cursor: not-allowed; }

/* practice options (All / USA / Global · 15 / 25) under the practice button */
.sr-practice-opts { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: -2px 0 8px; }
.sr-practice-opts .sr-seg { gap: 2px; padding: 2px; border-radius: 8px; }
.sr-practice-opts .sr-seg button { flex: none; padding: 2px 8px; font-size: .74rem; line-height: 1.3; border-radius: 6px; }
.sr-practice-opts .sr-seg button.active { box-shadow: none; }
.sr-practice-opts.hidden { display: none; }

/* about text and links at the bottom of the lobby */
.sr-about { margin-top: 14px; text-align: left; font-size: .92rem; line-height: 1.45; color: #cbd5e1; border-top: 1px solid rgba(148,163,184,.25); padding-top: 10px; }
.sr-about summary { cursor: pointer; font-weight: 700; color: #e2e8f0; }
.sr-about p { margin: 8px 0; }
.sr-about a, .mini-foot a { color: #7dd3fc; }
.mini-foot { margin-top: 10px; font-size: .82rem; text-align: center; color: #94a3b8; }

/* ✦ mythic: faster, brighter rainbow border with a pulsing glow */
.sr-gar-tag.my { color: #fff; border: none; font-weight: 900; text-shadow: 0 0 6px rgba(0,0,0,.6); background: linear-gradient(90deg, #f43f5e, #f59e0b, #facc15, #22c55e, #06b6d4, #6366f1, #d946ef, #f43f5e); background-size: 300% 100%; animation: srLgShine 1.6s linear infinite; box-shadow: 0 0 10px rgba(217,70,239,.6); }
.sr-gar-item.mythic, .sr-gar-ch.mythic { background: linear-gradient(rgba(8,6,24,.96), rgba(8,6,24,.96)) padding-box, conic-gradient(from var(--my-a, 0deg), #f43f5e, #f59e0b, #facc15, #22c55e, #06b6d4, #6366f1, #d946ef, #f43f5e) border-box;
    border: 2px solid transparent; animation: srMyGlow 2.4s ease-in-out infinite, srMySpin 4s linear infinite; }
.sr-gar-item.mythic .sr-gar-prev { background: radial-gradient(ellipse at 50% 50%, #4c1d95, #0b0420 60%, #000 100%); }
@property --my-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes srMySpin { to { --my-a: 360deg; } }
@keyframes srMyGlow { 0%, 100% { box-shadow: 0 0 14px rgba(217,70,239,.35), 0 0 2px rgba(255,255,255,.4) inset; } 50% { box-shadow: 0 0 30px rgba(34,211,238,.55), 0 0 6px rgba(255,255,255,.6) inset; } }
