/* ============================================================
   BLITZ — Reaction Game
   Design system + screens + animations
   ============================================================ */

:root {
  /* Palette */
  --bg:        #050A18;
  --bg-2:      #0A1228;
  --accent:    #00F5C4;   /* cyan-mint */
  --accent-2:  #8B5CF6;   /* violet    */
  --danger:    #FF4757;
  --success:   #2ED573;
  --text:      #E8EAF0;
  --text-dim:  #6B7280;

  --accent-glow: 0 0 24px rgba(0, 245, 196, .55), 0 0 60px rgba(0, 245, 196, .25);

  /* Surfaces */
  --surface:   rgba(255, 255, 255, .04);
  --surface-2: rgba(255, 255, 255, .07);
  --border:    rgba(255, 255, 255, .09);
  --border-lit: rgba(0, 245, 196, .45);

  --radius:    20px;
  --radius-sm: 14px;

  /* Safe areas */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);

  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out:    cubic-bezier(.16, 1, .3, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  position: fixed;
  inset: 0;
}

button { font-family: inherit; color: inherit; cursor: pointer; border: none; background: none; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ============================================================
   Ambient background
   ============================================================ */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(0,245,196,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,245,196,.05) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 35%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 90% 70% at 50% 35%, #000 30%, transparent 75%);
  opacity: .5;
  animation: gridDrift 24s linear infinite;
}
@keyframes gridDrift { to { background-position: 44px 44px, 44px 44px; } }

.bg-glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 50% at 50% 0%,  rgba(0,245,196,.14), transparent 70%),
    radial-gradient(50% 50% at 85% 100%, rgba(139,92,246,.16), transparent 70%),
    radial-gradient(40% 40% at 10% 90%,  rgba(0,245,196,.08),  transparent 70%);
  animation: glowBreathe 9s ease-in-out infinite alternate;
}
@keyframes glowBreathe { from { opacity: .7; } to { opacity: 1; } }

/* FX canvas (particles) */
#fx {
  position: fixed; inset: 0; z-index: 40; pointer-events: none;
  width: 100%; height: 100%;
}

/* Flash overlay */
#flash {
  position: fixed; inset: 0; z-index: 35; pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at center, rgba(0,245,196,.35), transparent 65%);
}
#flash.flash-go   { animation: flashPop .28s ease-out; }
#flash.flash-bad  { background: radial-gradient(circle at center, rgba(255,71,87,.4), transparent 70%); animation: flashPop .3s ease-out; }
#flash.flash-combo{ background: radial-gradient(circle at center, rgba(139,92,246,.4), transparent 70%); animation: flashPop .4s ease-out; }
@keyframes flashPop { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }

/* Confetti */
#confetti {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  width: 100%; height: 100%;
}

/* ============================================================
   App + screens
   ============================================================ */
#app {
  position: relative; z-index: 10;
  height: 100%; width: 100%;
  max-width: 540px; margin: 0 auto;
}

.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  padding:
    calc(env(safe-area-inset-top, 0px)  + 18px)
    calc(env(safe-area-inset-right, 0px) + 22px)
    calc(env(safe-area-inset-bottom,0px) + 18px)
    calc(env(safe-area-inset-left, 0px)  + 22px);
  opacity: 0;
  transform: translateY(14px) scale(.99);
  pointer-events: none;
  transition: opacity .35s var(--ease-out), transform .35s var(--ease-out);
  will-change: opacity, transform;
}
.screen.is-active {
  opacity: 1; transform: none; pointer-events: auto;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 0 30px;
  border-radius: var(--radius);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700; font-size: 1.05rem; letter-spacing: .12em;
  color: var(--bg);
  background: linear-gradient(135deg, var(--accent), #4df0d8);
  box-shadow: var(--accent-glow);
  overflow: hidden;
  transition: transform .12s var(--ease-bounce), box-shadow .2s, filter .2s;
}
.btn span { position: relative; z-index: 1; }
.btn::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.5) 50%, transparent 70%);
  transform: translateX(-120%);
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.96); }
.btn-sm { min-height: 48px; padding: 0 22px; font-size: .95rem; }

.btn-primary.btn-pulse { animation: btnPulse 2.4s var(--ease-out) infinite; }
@keyframes btnPulse {
  0%, 100% { box-shadow: 0 0 24px rgba(0,245,196,.5), 0 0 60px rgba(0,245,196,.2); }
  50%      { box-shadow: 0 0 34px rgba(0,245,196,.8), 0 0 90px rgba(0,245,196,.4); }
}

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 8px 18px;
  font-weight: 600; font-size: .92rem; letter-spacing: .04em;
  color: var(--text-dim);
  border-radius: 12px;
  transition: color .2s, background .2s;
}
.btn-ghost:hover { color: var(--text); background: var(--surface); }
.btn-danger:hover { color: var(--danger); }

/* ============================================================
   START SCREEN
   ============================================================ */
.start-inner {
  margin: auto 0;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  width: 100%;
}
.logo-wrap { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }

.logo-mark {
  filter: drop-shadow(0 0 16px rgba(0,245,196,.6));
  animation: floatY 4s ease-in-out infinite;
}
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

.logo {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700; font-size: clamp(3.4rem, 17vw, 5rem);
  letter-spacing: .14em; line-height: 1;
  background: linear-gradient(135deg, #fff 0%, var(--accent) 55%, var(--accent-2) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 40px rgba(0,245,196,.25);
  animation: logoIn .7s var(--ease-bounce) both;
}
@keyframes logoIn { from { opacity: 0; transform: translateY(16px) scale(.92); } }

.tagline { color: var(--text-dim); font-size: 1rem; letter-spacing: .05em; }

.best-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 18px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: .85rem;
}
.best-label { color: var(--text-dim); }
.best-value { font-family: "Space Grotesk"; font-weight: 700; color: var(--accent); }

.difficulty { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 10px; }
.field-label {
  font-size: .72rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--text-dim); text-align: center;
}
.seg {
  position: relative;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 5px;
}
.seg-btn {
  position: relative; z-index: 1;
  min-height: 46px; border-radius: 11px;
  font-family: "Space Grotesk"; font-weight: 600; font-size: .95rem;
  color: var(--text-dim);
  transition: color .25s;
}
.seg-btn.is-selected { color: var(--bg); }
.seg-glide {
  position: absolute; z-index: 0; top: 5px; bottom: 5px;
  width: calc((100% - 10px) / 3);
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), #4df0d8);
  box-shadow: 0 0 18px rgba(0,245,196,.45);
  transition: transform .32s var(--ease-bounce);
  transform: translateX(100%); /* normal default */
}

#btn-play { width: 100%; max-width: 360px; font-size: 1.3rem; min-height: 64px; }

.start-links { display: flex; align-items: center; gap: 8px; }
.btn-icon { gap: 6px; }
.btn-icon.is-muted { color: var(--danger); opacity: .85; }

/* ============================================================
   GAME SCREEN
   ============================================================ */
#screen-game { padding-top: calc(env(safe-area-inset-top,0px) + 14px); }

.hud {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}
.hud-cell { display: flex; flex-direction: column; gap: 2px; }
.hud-center { align-items: center; }
.hud-right { align-items: flex-end; }
.hud-label { font-size: .64rem; letter-spacing: .2em; text-transform: uppercase; color: var(--text-dim); }
.hud-value { font-family: "Space Grotesk"; font-weight: 700; font-size: 1.25rem; line-height: 1; }
.hud-sep { color: var(--text-dim); margin: 0 1px; font-weight: 500; }
.hud-score { color: var(--accent); }
.hud-value.bump { animation: bump .3s var(--ease-bounce); }
@keyframes bump { 0%,100% { transform: scale(1); } 40% { transform: scale(1.25); } }

/* Lives + multiplier */
.lives { display: flex; gap: 5px; align-items: center; height: 24px; }
.life { width: 18px; height: 18px; filter: drop-shadow(0 0 6px rgba(0,245,196,.6)); transition: opacity .3s, filter .3s, transform .3s; }
.life.lost { opacity: .16; filter: none; transform: scale(.78); }
.hud-mult { color: var(--accent-2); transition: color .2s; }
.hud-mult.hot { color: #FFD54A; text-shadow: 0 0 16px rgba(255,213,74,.5); }
.hud-value.bump { animation: bump .3s var(--ease-bounce); }

/* Level row + streak bar */
.levelrow { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.level-tag {
  font-family: "Space Grotesk"; font-weight: 700; font-size: .72rem;
  letter-spacing: .14em; color: var(--text-dim); white-space: nowrap;
}
.level-tag b { color: var(--accent); font-size: 1.05rem; }
.level-tag.up { animation: bump .42s var(--ease-bounce); }
.levelrow .streak-bar { flex: 1; }
.streak-bar { height: 7px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.streak-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px rgba(0,245,196,.6);
  transition: width .18s var(--ease-out);
}

/* Arena */
.arena {
  position: relative; flex: 1; margin-top: 14px;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 45%, rgba(255,255,255,.035), transparent 70%),
    var(--bg-2);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.arena.shake { animation: shake .32s ease-in-out; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}
.arena.miss-flash { box-shadow: inset 0 0 60px rgba(255,71,87,.4); }

.arena-msg {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  text-align: center; padding: 24px; pointer-events: none;
}
.msg-big {
  font-family: "Space Grotesk"; font-weight: 700; font-size: clamp(1.6rem, 6vw, 2.2rem);
  letter-spacing: .02em;
}
.msg-big.is-wait { animation: waitPulse 1.3s ease-in-out infinite; }
@keyframes waitPulse { 0%,100% { opacity: .5; transform: scale(.98); } 50% { opacity: 1; transform: scale(1); } }
.msg-small { color: var(--text-dim); font-size: .92rem; max-width: 260px; }

/* Target = transparent hit area holding the disc + countdown ring */
.target {
  position: absolute;
  display: none; align-items: center; justify-content: center;
  background: none;
  touch-action: manipulation;
  will-change: transform;
  z-index: 5;
}
.target.show { display: flex; }
.target.pop { animation: targetIn .12s var(--ease-bounce); }
@keyframes targetIn { from { transform: scale(.3); } to { transform: scale(1); } }

/* Visible core disc */
.target-core {
  position: relative; z-index: 1;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #5ffce6, var(--accent) 55%, #06c9a6 100%);
  box-shadow:
    0 0 0 5px rgba(0,245,196,.16),
    0 0 26px 5px rgba(0,245,196,.55),
    0 0 60px 12px rgba(0,245,196,.30);
}
.target-bolt { width: 46%; height: 46%; }

/* Collapsing countdown ring (its radius = remaining time) */
.target-ring {
  position: absolute; left: 50%; top: 50%; z-index: 0;
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 3px solid rgba(0,245,196,.85);
  box-shadow: 0 0 16px rgba(0,245,196,.5);
  transform: translate(-50%, -50%) scale(2.6);
  will-change: transform;
}

/* Bonus (golden) target */
.target.bonus .target-core {
  background: radial-gradient(circle at 38% 32%, #fff0b8, #FFC93C 55%, #f0a500 100%);
  box-shadow: 0 0 0 5px rgba(255,201,60,.18), 0 0 30px 6px rgba(255,201,60,.6), 0 0 70px 14px rgba(255,201,60,.35);
}
.target.bonus .target-ring { border-color: rgba(255,201,60,.9); box-shadow: 0 0 16px rgba(255,201,60,.5); }

/* 3-2-1-GO countdown */
.go-count {
  font-family: "Space Grotesk"; font-weight: 700;
  font-size: clamp(3.4rem, 18vw, 5.4rem);
  color: var(--accent);
  text-shadow: 0 0 44px rgba(0,245,196,.5);
}
.go-count.tick { animation: goTick .42s var(--ease-out); }
@keyframes goTick {
  0% { opacity: 0; transform: scale(.4); }
  35% { opacity: 1; transform: scale(1.12); }
  100% { opacity: 0; transform: scale(.95); }
}

/* Level-up banner (overlays the arena, never blocks taps) */
.level-banner {
  position: absolute; left: 50%; top: 36%; z-index: 6;
  transform: translate(-50%, -50%);
  font-family: "Space Grotesk"; font-weight: 700;
  font-size: clamp(2rem, 9vw, 3rem); letter-spacing: .08em;
  color: var(--accent-2); text-shadow: 0 0 32px rgba(139,92,246,.7);
  opacity: 0; pointer-events: none; white-space: nowrap; text-align: center;
}
.level-banner.show { animation: levelBanner 1.05s var(--ease-out); }
@keyframes levelBanner {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(.55); }
  22%  { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
  68%  { opacity: 1; transform: translate(-50%, -58%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -78%) scale(1); }
}

/* Floating +points */
.floats { position: absolute; inset: 0; pointer-events: none; z-index: 7; }
.float {
  position: absolute;
  font-family: "Space Grotesk"; font-weight: 700; font-size: 1.5rem;
  color: var(--accent); text-shadow: 0 0 16px rgba(0,245,196,.6);
  transform: translate(-50%, -50%);
  animation: floatUp .72s var(--ease-out) forwards;
  white-space: nowrap;
}
.float.combo { color: var(--accent-2); text-shadow: 0 0 16px rgba(139,92,246,.6); }
.float.bonus { color: #FFD54A; text-shadow: 0 0 18px rgba(255,213,74,.6); }
@keyframes floatUp {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(.6); }
  20%  { opacity: 1; transform: translate(-50%, -95%) scale(1.06); }
  100% { opacity: 0; transform: translate(-50%, -220%) scale(1); }
}

/* Round result flash text */
.round-result {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-family: "Space Grotesk"; font-weight: 700;
  text-align: center; pointer-events: none; z-index: 6;
  opacity: 0;
}
.round-result.show { animation: resultPop .7s var(--ease-out); }
@keyframes resultPop {
  0%   { opacity: 0; transform: translate(-50%, -40%) scale(.6); }
  25%  { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  80%  { opacity: 1; transform: translate(-50%, -52%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(1); }
}
.round-result .rr-ms { display: block; font-size: clamp(2.6rem, 13vw, 3.8rem); line-height: 1; }
.round-result .rr-tag { display: block; font-size: .9rem; letter-spacing: .18em; margin-top: 8px; }
.round-result.good { color: var(--accent); text-shadow: 0 0 30px rgba(0,245,196,.6); }
.round-result.great { color: var(--accent-2); text-shadow: 0 0 30px rgba(139,92,246,.7); }
.round-result.bad  { color: var(--danger); text-shadow: 0 0 30px rgba(255,71,87,.6); }

/* Ripple at tap point */
.ripple {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: 4;
  border: 2.5px solid var(--accent);
  transform: translate(-50%, -50%) scale(0);
  animation: rippleOut .55s var(--ease-out) forwards;
}
@keyframes rippleOut {
  to { transform: translate(-50%, -50%) scale(1); opacity: 0; border-width: 0; }
}

.btn-quit { align-self: center; margin-top: 12px; }

/* ============================================================
   RESULTS SCREEN
   ============================================================ */
.results-inner {
  margin: auto 0; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-align: center;
}
.results-eyebrow {
  font-family: "Space Grotesk"; font-weight: 700; font-size: 1.5rem; letter-spacing: .12em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: logoIn .5s var(--ease-bounce) both;
}
.score-hero { display: flex; align-items: baseline; gap: 8px; }
.score-big {
  font-family: "Space Grotesk"; font-weight: 700; font-size: clamp(4rem, 22vw, 6rem); line-height: .9;
  color: var(--text); text-shadow: 0 0 50px rgba(0,245,196,.3);
}
.score-unit { color: var(--text-dim); font-size: 1.1rem; }
.results-rating { font-size: 2rem; }

.results-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%;
}
.results-sub {
  display: flex; gap: 10px; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: .9rem;
}
.results-sub b { color: var(--text); font-family: "Space Grotesk"; font-weight: 700; }
.results-sub .dot { opacity: .45; }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 8px;
  display: flex; flex-direction: column; gap: 5px;
}
.stat-label { font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text-dim); }
.stat-value { font-family: "Space Grotesk"; font-weight: 700; font-size: 1.4rem; }
.stat-value small { font-size: .65em; color: var(--text-dim); font-weight: 500; }

.rounds-list {
  list-style: none; width: 100%;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
}
.rounds-list li {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 4px;
  display: flex; flex-direction: column; gap: 4px; align-items: center;
  font-size: .82rem;
}
.rounds-list li .r-n { font-size: .6rem; color: var(--text-dim); letter-spacing: .1em; }
.rounds-list li .r-v { font-family: "Space Grotesk"; font-weight: 700; }
.rounds-list li.best { border-color: var(--border-lit); box-shadow: 0 0 16px rgba(0,245,196,.18); }
.rounds-list li.best .r-v { color: var(--accent); }
.rounds-list li.early .r-v { color: var(--danger); font-size: .9rem; }

.newhs {
  width: 100%; padding: 16px;
  background: linear-gradient(135deg, rgba(0,245,196,.1), rgba(139,92,246,.1));
  border: 1px solid var(--border-lit); border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 12px; align-items: center;
}
.newhs[hidden] { display: none; }
.newhs-title {
  font-family: "Space Grotesk"; font-weight: 700; letter-spacing: .08em; color: var(--accent);
  animation: btnPulse 1.6s infinite;
}
.newhs-form { display: flex; gap: 8px; width: 100%; }
.name-input {
  flex: 1; min-height: 48px; padding: 0 16px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-family: "Space Grotesk"; font-weight: 600; font-size: 1rem; letter-spacing: .12em;
  text-transform: uppercase; text-align: center;
}
.name-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,245,196,.2); }

.results-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
#btn-again { width: 100%; max-width: 360px; }

/* ============================================================
   HIGHSCORES SCREEN
   ============================================================ */
.scores-inner { margin: auto 0; width: 100%; display: flex; flex-direction: column; gap: 16px; min-height: 0; flex: 1; padding-top: 8px; }
.screen-title {
  font-family: "Space Grotesk"; font-weight: 700; font-size: 1.8rem; letter-spacing: .04em; text-align: center;
}
.scores-list {
  list-style: none; display: flex; flex-direction: column; gap: 8px;
  overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}
.scores-list li {
  display: grid; grid-template-columns: 30px 1fr auto;
  align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
}
.scores-list li.me { border-color: var(--border-lit); box-shadow: 0 0 18px rgba(0,245,196,.2); background: rgba(0,245,196,.06); }
.sc-rank { font-family: "Space Grotesk"; font-weight: 700; font-size: 1.05rem; color: var(--text-dim); text-align: center; }
.scores-list li:nth-child(1) .sc-rank { color: var(--accent); }
.scores-list li:nth-child(2) .sc-rank { color: var(--accent-2); }
.sc-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sc-name { font-family: "Space Grotesk"; font-weight: 600; font-size: 1rem; letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-meta { font-size: .72rem; color: var(--text-dim); display: flex; gap: 8px; }
.sc-diff { text-transform: uppercase; letter-spacing: .1em; }
.sc-diff.easy { color: var(--success); }
.sc-diff.normal { color: var(--accent); }
.sc-diff.hard { color: var(--danger); }
.sc-right { text-align: right; }
.sc-score { font-family: "Space Grotesk"; font-weight: 700; font-size: 1.2rem; color: var(--accent); }
.sc-avg { font-size: .7rem; color: var(--text-dim); }

.scores-empty { text-align: center; color: var(--text-dim); margin: auto 0; font-size: 1.05rem; line-height: 1.6; }
.scores-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; }
#btn-back { width: 100%; max-width: 360px; }

/* ============================================================
   Landscape hint
   ============================================================ */
#landscape-hint {
  position: fixed; inset: 0; z-index: 100; display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: var(--bg); text-align: center; padding: 32px;
}
.rotate-ico { font-size: 3.4rem; color: var(--accent); animation: spinHint 2.6s ease-in-out infinite; }
@keyframes spinHint { 0%,70%,100% { transform: rotate(0); } 85% { transform: rotate(90deg); } }
#landscape-hint p { color: var(--text-dim); line-height: 1.6; font-size: 1.05rem; }

@media (max-height: 470px) and (orientation: landscape) {
  #landscape-hint { display: flex; }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .05ms !important; }
  .bg-grid, .bg-glow { animation: none; }
}

/* Small phones (iPhone SE width 375) */
@media (max-width: 380px) {
  .screen { padding-left: calc(env(safe-area-inset-left,0px) + 16px); padding-right: calc(env(safe-area-inset-right,0px) + 16px); }
  .results-stats { gap: 7px; }
  .stat-value { font-size: 1.2rem; }
}
