:root {
  --tension: 0;
  /* Lilac, from Joe's mockup (2026-09-26); the first palette was amber on purple-black. */
  --bg: #131215;
  --panel: #1d1c20;
  --panel-2: #252329;
  --line: #38353e;
  --text: #f4f1ee;
  --muted: #a19ca6; /* 6.9:1 on --bg, 5.8:1 on --panel-2 */
  --accent: #bba4ff;
  --accent-deep: #7a5fd6;
  --accent-ink: #170f2a; /* text on --accent */
  --accent-glow: rgb(187 164 255 / 0.35);
  --stop: #ff4d5e; /* the STOP button: white text on it is 3.2:1, large text only */
  --stop-deep: #b3142a;
  --vocal: #7ee8c6;
  --stamp-red: #d62839; /* --stop darkened so small white text on it reads (5:1) */
  --well: #0b0a0d; /* recessed displays: the countdown */
  --field: #6e6a75; /* form field edges: 3.5:1 on --bg */
  --guess: var(--accent);
  /* accuracy tiers as flat colors (the emoji stay in the share text) */
  --tier-bullseye: #ff5cd6; /* magenta, so a bullseye jumps out; runner-up was electric blue */
  --bullseye-ink: #2b0a24; /* text on --tier-bullseye, 6:1 */
  --bullseye-glow: rgb(255 92 214 / 0.55);
  --tier-great: var(--vocal);
  --tier-good: #ffd166;
  --tier-close: #ff9f5e;
  --tier-off: #ff6b5e;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --num: 'Inter', system-ui, sans-serif; /* big numbers: tabular, plain zero */
  --lyric: 'Fredoka', 'Arial Rounded MT Bold', system-ui, sans-serif; /* karaoke line */
  --lyric-edge: #3a1f6e; /* karaoke outline, unsung */
  --lyric-edge-sung: #0b3d2a;
  /* corner radii: one scale for everything */
  --r-xs: 3px; /* bars, keycaps, tier squares */
  --r-sm: 6px; /* round markers, close */
  --r-md: 8px; /* buttons (icon ones too), fields, boxes inside a panel */
  --r-lg: 12px; /* cards, panels, sheets, anything that sits on the page */
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(900px 520px at 50% -180px, rgb(187 164 255 / 0.08), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 500px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px 32px;
}

[hidden] { display: none !important; }

/* one focus ring for everything reached by keyboard */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.action:focus-visible { outline-color: var(--text); }
.visually-hidden {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  margin: 0;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* stats sheet */

.sheet {
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 22px 20px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  color: var(--text);
  box-shadow: 0 24px 80px rgb(0 0 0 / 0.6);
}
.sheet::backdrop { background: rgb(8 6 12 / 0.7); backdrop-filter: blur(3px); }
.sheet[open] { animation: rise 0.25s ease-out; }
.sheet h2 { margin: 0 0 14px; font: 800 1.5rem var(--display); }
.sheet .close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
}
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat-grid div { display: grid; gap: 2px; padding: 10px 4px; background: var(--bg); border-radius: var(--r-md); text-align: center; }
.stat-grid strong { font: 900 1.6rem/1 var(--num); font-variant-numeric: tabular-nums; }
.stat-grid span { color: var(--muted); font-size: 0.72rem; }
.tiers { display: grid; gap: 6px; margin: 16px 0 0; padding: 0; list-style: none; }
.tiers li { display: grid; grid-template-columns: 1.6em 6.2em 1fr 2.2em; gap: 8px; align-items: center; }
.tier-label { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.tiers .bar { height: 14px; border-radius: var(--r-xs); background: var(--bg); overflow: hidden; }
.tiers .bar i { display: block; height: 100%; width: max(4px, var(--w)); background: var(--accent); border-radius: var(--r-xs); }
.tiers b { font: 700 0.9rem var(--mono); text-align: right; }
.tiers li.t-bullseye .bar i { background: var(--tier-bullseye); }
.tiers li.t-great .bar i { background: var(--tier-great); }
.tiers li.t-good .bar i { background: var(--tier-good); }
.tiers li.t-close .bar i { background: var(--tier-close); }
.tiers li.t-off .bar i { background: var(--tier-off); }

/* accuracy tiers as flat squares: the game's version of the share emoji */
.tier-dot { display: inline-block; flex: none; width: 14px; height: 14px; border-radius: var(--r-xs); background: var(--line); vertical-align: -2px; }
/* a bullseye is a round target (two rings and a dot), not another square; a
   single ring read as a camera lens */
.tier-dot.t-bullseye {
  border-radius: 50%;
  background: radial-gradient(circle closest-side, var(--tier-bullseye) 0 26%, var(--bg) 27% 45%, var(--tier-bullseye) 46% 64%, var(--bg) 65% 82%, var(--tier-bullseye) 83%);
  box-shadow: 0 0 8px var(--bullseye-glow);
}
.tier-dot.t-great { background: var(--tier-great); }
.tier-dot.t-good { background: var(--tier-good); }
.tier-dot.t-close { background: var(--tier-close); }
.tier-dot.t-off { background: var(--tier-off); }
.tier-dot.t-skipped { background: none; box-shadow: inset 0 0 0 1.5px var(--muted); }
.tendency { margin: 14px 0 0; font-weight: 600; }
.best { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }
.best:empty { display: none; }

.account { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.account h3 { margin: 0; font: 800 1.1rem var(--display); }
.account p { margin: 4px 0 12px; color: var(--muted); font-size: 0.92rem; }
.account strong { color: var(--text); }
.email-form { display: grid; gap: 8px; }
.email-form input {
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--field);
  border-radius: var(--r-md);
  background: var(--bg);
  color: var(--text);
}
.email-form input:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
.email-form .action { padding: 13px; font-size: 1.05rem; }
.google { width: 100%; margin-top: 8px; }
.account-status { min-height: 1.2em; }
.account-status.error { color: var(--stop); }
.feedback-form { display: grid; gap: 6px; }
.feedback-form label { margin-top: 6px; font-weight: 600; font-size: 0.92rem; }
.feedback-form label small { color: var(--muted); font-weight: 400; }
.feedback-form textarea, .feedback-form input:not(.visually-hidden) {
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--field);
  border-radius: var(--r-md);
  background: var(--bg);
  color: var(--text);
}
.feedback-form textarea { min-height: 7.5em; resize: vertical; }
@media (max-height: 600px) { .feedback-form textarea { min-height: 5em; } }
.feedback-form :is(textarea, input):focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
.feedback-form .action { margin-top: 10px; padding: 13px; font-size: 1.05rem; }
.feedback-form .account-status { margin: 4px 0 0; text-align: center; }
.local-note { margin: 16px 0 0; color: var(--muted); font-size: 0.85rem; text-align: center; }

/* how to play */

.help-lede { margin: -8px 0 16px; color: var(--muted); }
.timeline { margin: 0 0 16px; }
.tl-bar { display: flex; align-items: center; gap: 6px; height: 34px; }
.tl-music {
  flex: 1;
  height: 100%;
  border-radius: var(--r-xs);
  background: repeating-linear-gradient(90deg, var(--accent) 0 3px, transparent 3px 6px);
  /* the last layer tapers it off to the right: the fade out */
  mask: linear-gradient(90deg, #000 45%, transparent),
    linear-gradient(transparent 0 20%, #000 20% 80%, transparent 80%),
    repeating-linear-gradient(90deg, #000 0 12px, rgb(0 0 0 / 0.55) 12px 18px, #000 18px 27px);
  mask-composite: intersect, add;
}
.tl-gap { flex: 0.8; border-top: 2px dashed var(--muted); opacity: 0.6; }
.tl-stop {
  padding: 5px 10px;
  border-radius: var(--r-sm);
  background: var(--stamp-red);
  color: #fff;
  font: 800 0.8rem var(--display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.tl-labels {
  display: grid;
  grid-template-columns: 1fr 0.8fr auto;
  gap: 6px;
  margin-top: 6px;
  color: var(--muted);
  font: 700 0.68rem var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tl-labels span:last-child { color: var(--vocal); }
.steps { display: grid; gap: 10px; margin: 0; padding: 0 0 0 1.4em; }
.steps li::marker { color: var(--accent); font: 800 1rem var(--mono); }
.steps strong { color: var(--text); }
.help-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin: 14px 0 16px; color: var(--muted); font-size: 0.9rem; }
.help .action { padding: 15px; }

/* past days */

.archive-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.archive-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
}
.archive-list a:hover { border-color: var(--muted); }
.archive-list a[aria-current='page'] { border-color: var(--accent); }
.archive-day { font-weight: 600; white-space: nowrap; }
.archive-day b { display: inline-block; min-width: 2.6em; color: var(--muted); font: 700 0.85rem var(--mono); }
.archive-dots { display: flex; gap: 4px; }
.archive-points { font: 800 0.95rem var(--mono); white-space: nowrap; }
.archive-points small { color: var(--muted); font-weight: 500; }
.archive-go { color: var(--accent); font: 800 1rem var(--display); white-space: nowrap; }
.archive-go small { color: var(--muted); font: 500 0.8rem system-ui, sans-serif; }
.archive-go::after { content: ' ›'; }
.archive-state { display: flex; align-items: center; gap: 10px; }

.nudge { margin: 14px 0 0; text-align: center; color: var(--muted); font-size: 0.92rem; }
.link { padding: 0; background: none; color: var(--accent); font-weight: 700; text-decoration: underline; }

/* header */

/* The date spans under the points too, so a four-digit score doesn't squeeze
   it onto two lines; only the round markers sit beside it. */
.top {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 18px;
}
.brand { grid-column: 1; }
.top-right { grid-column: 2 / 4; }
.top .date { grid-column: 1 / 3; }
.rounds { grid-column: 3; }
.logo {
  margin: 0;
  font: 800 1.75rem/1 var(--display);
  letter-spacing: -0.03em;
}
.logo span { color: var(--accent); }
.tagline {
  margin: 3px 0 0;
  color: var(--accent);
  font: 700 0.7rem var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.85;
}
.points {
  margin: 0;
  font: 700 1rem var(--mono);
  color: var(--accent);
  text-align: right;
}
.date { margin: 0; color: var(--muted); font-size: 0.85rem; }
/* the date opens Past days, like a date picker */
.date-button {
  margin: -5px 0;
  padding: 5px 0;
  background: none;
  color: inherit;
  text-align: left;
}
.date-button:disabled { cursor: default; opacity: 1; }
.date-button:not(:disabled)::after { content: ' ▾'; color: var(--accent); }
.date-button:not(:disabled):hover { color: var(--text); }
/* The icon buttons and the round markers under them share one size, gap,
   border and radius, so the buttons line up over markers 2 and 3. */
.top { --chip: 32px; --chip-gap: 8px; }
.top-right { display: flex; align-items: center; justify-content: flex-end; gap: var(--chip-gap); }
.points { margin-right: 4px; }
.icon-button {
  display: grid;
  place-items: center;
  width: var(--chip);
  height: var(--chip);
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel);
}
.icon-button svg { width: 18px; height: 18px; fill: var(--text); color: var(--text); }
.icon-button:hover { border-color: var(--muted); }
.rounds {
  display: flex;
  justify-content: flex-end;
  gap: var(--chip-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
.rounds li {
  width: var(--chip);
  height: var(--chip);
  display: grid;
  place-items: center;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  color: var(--muted);
  font: 700 0.8rem var(--mono);
  transition: border-color 0.2s, background 0.2s;
}
.rounds li.current { border-color: var(--accent); color: var(--accent); }
.rounds li.current { border-width: 2px; }
.rounds .tier-dot { width: 16px; height: 16px; }

/* song card */

.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.35);
}
/* YouTube requires the player to stay visible and at least 200x200. */
.player-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 200px;
  background: #000;
  pointer-events: none; /* stray taps would unpause the video */
}
.player-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

.song { padding: 14px 16px 16px; }
.kicker {
  margin: 0;
  color: var(--accent);
  font: 700 0.72rem var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.song h2 {
  margin: 4px 0 0;
  font: 800 1.7rem/1.1 var(--display);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.artist { margin: 3px 0 0; font-size: 1.05rem; font-weight: 600; }
.meta { color: var(--muted); font-size: 0.88rem; font-weight: 400; }
.meta::before { content: '· '; }

/* scoreboard clock */

.stage { position: relative; margin-top: 16px; }
.display {
  position: relative;
  padding: 10px 0 6px;
  text-align: center;
}
.clock {
  position: relative;
  display: inline-block;
  font: 900 clamp(4rem, 22vw, 6.8rem) / 1 var(--num);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: var(--muted);
  transition: color 0.2s, font-size 0.3s;
}
.stage.done .clock { font-size: 3.2rem; }
.clock.running, .clock.stopped { color: var(--text); }
.clock.silent { color: var(--accent); text-shadow: 0 0 28px var(--accent-glow); }

.status:empty { display: none; }

/* The first words, karaoke style: lead-in dots light up with the music and
   pulse through the silence, and the words fill in when the vocals really
   come in during the reveal (never before the guess). */
.karaoke {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin: 2px 0 12px;
  text-align: center;
  transition: opacity 0.3s;
}
.karaoke[data-phase='ready'], .karaoke[data-phase='starting'] { opacity: 0.7; }
.lead-in { display: flex; gap: 8px; }
.lead-in i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); transition: background 0.3s, opacity 0.4s, scale 0.4s; }
.karaoke:is([data-phase='playing'], [data-phase='hold'], [data-phase='revealing']) .lead-in i { background: var(--vocal); }
.karaoke[data-phase='silent'] .lead-in i { background: var(--accent); animation: lead-in 1.2s ease-in-out infinite; }
.karaoke[data-phase='silent'] .lead-in i:nth-child(2) { animation-delay: 0.2s; }
.karaoke[data-phase='silent'] .lead-in i:nth-child(3) { animation-delay: 0.4s; }
@keyframes lead-in { 50% { scale: 1.45; box-shadow: 0 0 12px var(--accent-glow); } }
.karaoke.sung .lead-in i { opacity: 0; scale: 0.4; animation: none; }
/* Karaoke-screen type: chunky rounded letters, white with a thick outline,
   and a ♪ like sung lines in captions. The stroke is painted under the fill,
   so it only thickens the letters outward. */
.lyric {
  position: relative;
  max-width: 18ch;
  font: 700 clamp(1.6rem, 8vw, 2.4rem) / 1.15 var(--lyric);
  letter-spacing: 0.01em;
  text-wrap: balance;
  color: #fff;
  -webkit-text-stroke: 0.2em var(--lyric-edge);
  paint-order: stroke fill;
}
.lyric-note { margin-right: 0.3em; color: var(--accent); font-size: 0.8em; }
.karaoke[data-phase='silent'] .lyric { text-shadow: 0 0 18px var(--accent-glow); }
/* Solid text, never transparent-with-a-gradient: dark-mode tools and high
   contrast modes recolor backgrounds and made that version invisible. The
   green copy sits on top and is uncovered left to right when it's sung. */
.lyric-fill {
  position: absolute;
  inset: 0;
  color: var(--vocal);
  -webkit-text-stroke-color: var(--lyric-edge-sung);
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.4s linear;
}
.karaoke.sung .lyric-fill { clip-path: inset(0); }
.karaoke.instant .lyric-fill { transition: none; }
.stage.done .karaoke { display: none; } /* the result needs the room */

.status {
  min-height: 2.9em;
  margin: 2px 0 14px;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  text-wrap: balance;
}

/* buttons */

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button:disabled { cursor: default; opacity: 0.55; }

.action {
  --face: var(--accent);
  --edge: var(--accent-deep);
  display: block;
  width: 100%;
  padding: 18px;
  border-radius: var(--r-md);
  background: var(--face);
  color: var(--accent-ink);
  font: 800 1.25rem var(--display);
  letter-spacing: 0.01em;
  box-shadow: 0 6px 0 var(--edge), 0 12px 24px rgb(0 0 0 / 0.35);
  transform: translateY(0);
  transition: transform 0.06s, box-shadow 0.06s;
  user-select: none;
}
.stop-tip {
  margin: 12px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  text-wrap: balance;
}

.action:active:not(:disabled) {
  transform: translateY(5px);
  box-shadow: 0 1px 0 var(--edge), 0 4px 10px rgb(0 0 0 / 0.35);
}
.action.stop {
  --face: var(--stop);
  --edge: var(--stop-deep);
  padding: 30px 18px;
  color: #fff;
  font-size: 1.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.secondary {
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel-2);
  color: var(--text);
  font-weight: 600;
}
.secondary:hover:not(:disabled) { border-color: var(--muted); }

/* reveal: --tension (0 to 1) builds as the replay approaches your stop */

.clock.revealing {
  color: color-mix(in oklab, var(--text), var(--stop) calc(var(--tension) * 100%));
  scale: calc(1 + var(--tension) * 0.14);
  text-shadow: 0 0 calc(var(--tension) * 48px) rgb(255 77 94 / 0.7);
}
.tense .clock.revealing { animation: shake 0.09s infinite; }
@keyframes shake {
  0% { translate: 0 0; }
  25% { translate: calc(var(--tension) * -3px) calc(var(--tension) * 2px); }
  50% { translate: calc(var(--tension) * 3px) calc(var(--tension) * -1px); }
  75% { translate: calc(var(--tension) * -2px) calc(var(--tension) * -3px); }
  100% { translate: 0 0; }
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 calc(var(--tension) * 180px) rgb(255 77 94 / calc(var(--tension) * 0.6));
}
.tense body::after { animation: throb 0.45s ease-in-out infinite; }
@keyframes throb { 50% { opacity: 0.45; } }

.hit-vocal .clock { animation: vocal-flash 0.8s ease-out; }
@keyframes vocal-flash { from { color: var(--vocal); text-shadow: 0 0 40px rgb(126 232 198 / 0.8); } }

.waves {
  display: block;
  width: 100%;
  height: 150px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: rgb(0 0 0 / 0.25);
}

.result {
  margin: 12px 0 18px;
  padding: 18px 16px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  text-align: center;
  animation: rise 0.35s ease-out;
}
@keyframes rise { from { opacity: 0; translate: 0 12px; } }
.score {
  margin: 0;
  font: 900 3.4rem/1 var(--num);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}
.score small { margin-left: 6px; font-size: 1rem; color: var(--muted); letter-spacing: 0; }
.bonus {
  display: inline-block;
  margin: 10px 0 0;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--tier-bullseye);
  color: var(--bullseye-ink);
  box-shadow: 0 0 18px var(--bullseye-glow);
  font: 800 0.95rem var(--display);
  rotate: -3deg;
  animation: stamp 0.35s ease-out;
}
@keyframes stamp { from { scale: 1.8; opacity: 0; } }
.stamps { margin: 0; }
.stamps:has(.bonus:not([hidden])) { margin-top: 10px; }
.stamps .bonus { margin: 0 3px; }
.verdict-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 10px; margin-top: 8px; }
.verdict { margin: 0; font: 700 1.15rem var(--display); color: var(--muted); }
.verdict .nice { color: var(--vocal); }
/* the best comparison with other players (moments.js), once the score has counted up */
.moment { margin: 0; animation: rise 0.35s 0.7s ease-out both; }
.moment.m-first-bullseye { background: rgb(255 92 214 / 0.13); color: var(--tier-bullseye); }
.moment.m-top, .moment.m-beat { background: rgb(187 164 255 / 0.14); color: var(--accent); }
.result .secondary { margin-top: 14px; }

/* summary */

.summary .kicker { text-align: center; }
.headline { margin: 0; text-align: center; font: 800 2rem/1.05 var(--display); letter-spacing: -0.02em; }
.total {
  margin: 6px 0 0;
  text-align: center;
  font: 900 3.6rem/1 var(--num);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}
.total small { margin-left: 8px; font-size: 1.1rem; color: var(--muted); letter-spacing: 0; }
/* badges under the total, one per fact, so they read as separate things */
.summary-context { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 10px 0 0; }
.fact { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; line-height: 1; border-radius: 999px; background: var(--panel-2); font: 700 0.9rem var(--display); white-space: nowrap; }
.fact.best { background: rgb(187 164 255 / 0.14); color: var(--accent); }
.fact.bullseye { background: rgb(255 92 214 / 0.13); color: var(--tier-bullseye); }
.fact .tier-dot { width: 12px; height: 12px; }
@media (max-width: 480px) {
  .summary-context { gap: 6px; }
  .fact { gap: 5px; height: 27px; padding: 0 10px; font-size: 0.82rem; }
}
.summary-list {
  display: grid;
  gap: 8px;
  margin: 16px 0 14px;
  padding: 0;
  list-style: none;
}
.summary-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px 12px;
  align-items: center;
  padding: 10px 14px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  animation: rise 0.4s ease-out backwards;
  animation-delay: calc(var(--i) * 0.12s);
}
/* how the song went: music fading (amber), silence, vocals (green), your flag,
   and the gap between flag and vocals in the tier's color */
.strip { position: relative; grid-column: 1 / -1; height: 28px; }
.strip svg { display: block; width: 100%; height: 100%; overflow: visible; clip-path: inset(0 100% 0 0); animation: draw 0.9s ease-out forwards; animation-delay: calc(var(--i) * 0.12s + 0.2s); }
@keyframes draw { to { clip-path: inset(0); } }
.strip line { stroke-width: 3; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.strip .m { stroke: var(--accent); }
.strip .v { stroke: var(--vocal); }
.strip .s { stroke: var(--muted); stroke-width: 2; stroke-dasharray: 2 5; opacity: 0.6; }
.strip .gap { opacity: 0.22; }
.strip .gap.t-bullseye { fill: var(--tier-bullseye); opacity: 0.4; }
.strip .gap.t-great { fill: var(--tier-great); }
.strip .gap.t-good { fill: var(--tier-good); }
.strip .gap.t-close { fill: var(--tier-close); }
.strip .gap.t-off { fill: var(--tier-off); }
.strip-you { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--text); animation: stamp 0.3s ease-out backwards; animation-delay: calc(var(--i) * 0.12s + 0.9s); }
.strip-you::before { content: ''; position: absolute; top: 0; left: 2px; width: 11px; height: 9px; background: var(--text); clip-path: polygon(0 0, 100% 0, 70% 50%, 100% 100%, 0 100%); }
.strip-you.off-left::before { left: auto; right: 2px; clip-path: polygon(100% 0, 0 0, 30% 50%, 0 100%, 100% 100%); }
.summary-list .tier-dot { width: 20px; height: 20px; }
.summary-song { font-weight: 700; }
.summary-song small { display: block; color: var(--muted); font-weight: 400; }
.summary-points { font: 800 1.15rem var(--mono); }
/* the right-hand column: a panel (share, then the countdown at its foot) with
   the small links under it */
.summary-side { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.summary-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.share {
  margin: 0;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font: 0.92rem/1.6 var(--mono);
  white-space: pre-wrap;
}
.share-head { font-weight: 700; }
.share-link { color: var(--muted); }
.summary-more { display: flex; gap: 12px; }
.summary-more > * { flex: 1; }
.summary-panel .nudge { margin: 0; }
.up-next { margin-top: auto; padding-top: 2px; text-align: center; }
.summary .up-next .kicker { text-align: center; }
.back-today { display: block; text-align: center; text-decoration: none; }
/* the countdown as a lit display: lilac digits glowing in a recessed well,
   units under each pair (colons steady: Joe didn't like them blinking) */
.scoreboard {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 2px;
  margin-top: 6px;
  padding: 12px 12px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--well);
  box-shadow: inset 0 2px 14px rgb(0 0 0 / 0.6);
}
.scoreboard .unit { display: grid; justify-items: center; gap: 6px; }
.scoreboard b, .scoreboard .colon { font: 800 2.7rem/1 var(--mono); font-style: normal; font-variant-numeric: tabular-nums; color: var(--accent); text-shadow: 0 0 14px var(--accent-glow); }
.scoreboard small { color: var(--muted); font: 700 0.62rem var(--mono); letter-spacing: 0.14em; text-transform: uppercase; }
.summary-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin: 0; font-size: 0.88rem; }
.summary-links .link { color: var(--muted); font-weight: 600; text-decoration-color: var(--line); text-underline-offset: 3px; }
.summary-links .link:hover { color: var(--text); text-decoration-color: currentColor; }

.hint { margin-top: 22px; text-align: center; color: var(--muted); font-size: 0.8rem; }
kbd {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: var(--r-xs);
  font: 600 0.75rem var(--mono);
}
@media (hover: none) { .hint { display: none; } }

/* phones: in a browser the toolbars leave far less than the full screen, so
   tighten everything, and pin the button to the bottom edge if it still
   doesn't fit (the result after a reveal, or a very small phone) */

@media (max-width: 899px) {
  .action { position: sticky; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 1; }
}
@media (max-width: 899px) and (max-height: 780px) {
  .app { padding-bottom: 0; }
  .tagline { display: none; }
  .top { margin-bottom: 10px; }
  .song { padding: 10px 14px 12px; }
  .song .kicker { display: none; }
  .song h2 { margin: 0; font-size: 1.4rem; }
  .artist { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .stage { margin-top: 6px; }
  .display { padding: 2px 0; }
  .clock { font-size: clamp(3rem, min(22vw, 10dvh), 6.8rem); }
  .stage.done .clock { font-size: 2.6rem; }
  .karaoke { gap: 4px; margin-bottom: 8px; }
  .lead-in i { width: 7px; height: 7px; }
  .lyric { font-size: clamp(1.3rem, min(7vw, 4.4dvh), 2rem); transition: font-size 0.3s; }
  .karaoke.long .lyric { max-width: none; font-size: clamp(1.1rem, min(5.2vw, 3.4dvh), 1.6rem); }
  /* the dots only while the music plays and through the silence */
  .karaoke:not([data-phase='playing'], [data-phase='silent']) .lead-in { display: none; }
  .stage:has(.karaoke:not([hidden])) .waves { height: 76px; }
  .status { margin-bottom: 8px; font-size: 0.9rem; }
  .action { padding: 14px; }
  .action.stop { padding: 20px 18px; }
  .stop-tip { margin-top: 10px; font-size: 0.9rem; }
  .waves { height: 110px; }
  .result { padding: 12px 16px; }
  .score { font-size: 2.8rem; }
  .result .secondary { margin-top: 10px; padding: 8px 16px; }
}

/* desktop: song card on the left, the clock and everything it drives on the
   right, so a whole round fits without scrolling */

@media (min-width: 900px) {
  .app { max-width: 1120px; padding: 24px 32px 28px; }
  .top { margin-bottom: 22px; }
  .round {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 36px;
    align-items: start;
  }
  .round > * { grid-column: 2; }
  .round > .card { grid-column: 1; grid-row: 1 / span 7; }
  .stage { margin-top: 0; }
  .display { padding-top: 0; }
  .status { margin-bottom: 12px; }
  .result { margin-top: 4px; }
  /* the badge sits beside the verdict without making the row taller */
  .verdict-row .moment { margin-block: -4px; }
  .action.stop { padding: 42px 18px; }

  .summary {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    column-gap: 36px;
    align-items: stretch;
  }
  .summary .kicker, .headline, .total { text-align: left; }
  .summary-context { justify-content: flex-start; }
  .summary-side { margin-top: 0; }
  .hint { margin-top: 18px; }
}

/* Windows high contrast and other forced-color modes drop backgrounds, so give
   buttons edges and keep the dots and bars drawn in system colors. */
@media (forced-colors: active) {
  button { border: 1px solid ButtonText; }
  .action { border-width: 3px; }
  .lead-in i, .tiers .bar i { forced-color-adjust: none; background: CanvasText; }
  .strip line { stroke: CanvasText; }
  .strip .gap { fill: Highlight; }
  .strip-you, .strip-you::before { forced-color-adjust: none; background: Highlight; }
  .tier-dot { forced-color-adjust: none; }
  .lyric { -webkit-text-stroke: 0; }
  .lyric-fill { color: Highlight; }
}

@media (prefers-reduced-motion: reduce) {
  .clock.revealing { scale: none; }
  .tense .clock.revealing, .tense body::after, .hit-vocal .clock, .bonus, .result, .moment, .lead-in i { animation: none; }
  .summary-list li, .strip-you { animation: none; }
  .strip svg { animation: none; clip-path: none; }
  .lyric, .lyric-fill { transition: none; }
  .sheet[open] { animation: none; }
  .action { transition: none; }
}
