:root {
  --ground: #0D0E12;
  --surface: #171920;
  --raised: #22252E;
  --line: #30343F;
  --ink: #F4F2EC;
  --muted: #A2A5B0;
  --accent: #FFB52E;
  --accent-edge: #A86F0A;
  --on-accent: #1C1303;
  --coral: #FF7A59;
  --answer: #6CC6FF;
  --radius: 22px;
  --font: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* No double-tap zoom. iOS Safari ignores the viewport's user-scalable=no and only honors
   touch-action on the element that's tapped, so every element gets it, not just the page. It has
   to be manipulation: WebKit only turns double-tap zoom off for manipulation or none, not for
   pan-x pan-y. (Pinch zoom is cancelled by the gesturestart handler in app.js and archive.js.)
   Elements that need it, like the waveform, set touch-action: none instead. */
*, *::before, *::after { box-sizing: border-box; touch-action: manipulation; }

html {
  color-scheme: dark;
  scrollbar-color: var(--line) var(--ground);
}

html, body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.sprite { display: none; }
.icon { width: 20px; height: 20px; flex: none; display: block; }

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: max(16px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

p { margin: 0; }
.muted { color: var(--muted); }

.screen { display: none; flex-direction: column; gap: 14px; flex: 1; }
.screen.active { display: flex; }

/* Past games: sepia instead of amber */
body.past, .track.past {
  --accent: #CDB98F;
  --accent-edge: #84754F;
  --on-accent: #1A160C;
}
body.past .btn.primary:hover { background: #DCCBA3; }

/* Buttons */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: var(--raised);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
  padding: 12px 16px;
  min-height: 48px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.12s var(--ease-out), box-shadow 0.12s var(--ease-out), background 0.15s;
}
.btn:hover { background: #2B2F3A; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.big { font-size: 1.15rem; padding: 16px 20px; min-height: 60px; }
/* The primary action sits on a solid edge and presses down onto it */
.btn.primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 5px 0 var(--accent-edge);
  margin-bottom: 5px;
}
.btn.primary:hover { background: #FFC558; }
.btn.primary:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--accent-edge); }
.btn.round { width: 48px; height: 48px; padding: 0; flex: none; }
.text-btn {
  appearance: none;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  min-height: 44px;
  cursor: pointer;
}
.text-btn:hover { color: var(--ink); }
/* Copy Results, Home and play again are spaced like the home page's buttons: 14px from one to the
   next (Copy Results' 4px edge sits inside that, as on home). play again's box is taller than its
   text, so it's pulled up until the text starts 14px under Home. */
#btn-again { margin: -12px 0 16px; }

/* Vinyl: sized by its parent or by a modifier class */
.vinyl {
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    conic-gradient(from 35deg, rgba(255,255,255,0) 0 8%, rgba(255,255,255,0.16) 13%, rgba(255,255,255,0) 19% 50%, rgba(255,255,255,0) 58%, rgba(255,255,255,0.12) 63%, rgba(255,255,255,0) 69%),
    repeating-radial-gradient(circle, #15161B 0 2px, #1E2027 2px 3.5px);
  display: grid;
  place-items: center;
}
.vinyl-label {
  width: 40%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--label, var(--accent));
  color: var(--on-accent);
  display: grid;
  place-items: center;
  position: relative;
}
.vinyl-label::after {
  content: "";
  position: absolute;
  width: 10%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ground);
}

/* Home */
.home {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  padding: 16px 0;
}
.home-disc { width: 112px; margin-bottom: 10px; }
.wordmark {
  font-size: clamp(5rem, 25vw, 7rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin: 0;
}
.wordmark.small { font-size: 1.5rem; color: var(--ink); text-decoration: none; letter-spacing: -0.03em; }
.tagline { font-size: 1.3rem; font-weight: 700; margin-top: 6px; }
.home-meta { margin-top: 36px; font-weight: 600; font-size: 1.05rem; line-height: 1.4; }
.home-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(100%, 270px);
  margin-top: 22px;
}
/* Home's three buttons are a size down from .big elsewhere, on a 4px edge */
.home-actions .btn.big { font-size: 1.05rem; padding: 11px 18px; min-height: 50px; margin-bottom: 4px; }
.home-actions .btn.primary, .home-actions .btn.solid-tan, .home-actions .btn.solid-amber, .home-actions .btn.solid-blue { box-shadow: 0 4px 0 var(--edge, var(--accent-edge)); }
.home-actions .btn.primary:active, .home-actions .btn.solid-tan:active, .home-actions .btn.solid-amber:active, .home-actions .btn.solid-blue:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge, var(--accent-edge)); }
.home-actions .how-to-steps { margin-top: 8px; }
/* Home's Play Past (solid tan, the past-game sepia) and How to Play (solid blue): filled like
   the primary button, on a darker 5px edge that they press down onto */
.btn.solid-tan, .btn.solid-amber, .btn.solid-blue {
  margin-bottom: 5px;
  background: var(--fill);
  color: var(--on-fill);
  box-shadow: 0 5px 0 var(--edge);
}
.btn.solid-tan { --fill: #CDB98F; --edge: #84754F; --on-fill: #1A160C; }
/* Today's amber, fixed: a past puzzle's Home button keeps it although body.past turns --accent sepia */
.btn.solid-amber { --fill: #FFB52E; --edge: #A86F0A; --on-fill: #1C1303; }
.btn.solid-blue { --fill: var(--answer); --edge: #3B6D8C; --on-fill: #04192B; }
.btn.solid-tan:hover, .btn.solid-amber:hover, .btn.solid-blue:hover { background: color-mix(in srgb, var(--fill) 85%, white); }
.btn.solid-tan:active, .btn.solid-amber:active, .btn.solid-blue:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--edge); }
.how-to summary { display: flex; list-style: none; }
.how-to summary::-webkit-details-marker { display: none; }
.how-to-chevron { transition: transform 0.2s var(--ease-out); }
.how-to[open] .how-to-chevron { transform: rotate(180deg); }
.how-to-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 0;
  padding: 14px 14px 14px 34px;
  background: var(--surface);
  border-radius: var(--radius);
  text-align: left;
  line-height: 1.4;
}

/* Listen */
.listen-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
}
.deck { position: relative; width: min(82vw, 330px); aspect-ratio: 1; }
.deck-disc, .deck-halo { position: absolute; top: 7%; left: 3%; width: 86%; height: 86%; }
.deck-disc { animation: spin 2.4s linear infinite; }
/* The AudID name sits above the center hole and the puzzle number below it, so they spin together */
.deck-disc .vinyl-label span { grid-area: 1 / 1; font-weight: 800; font-size: 0.95rem; letter-spacing: -0.02em; transform: translateY(-150%); }
.deck-disc .vinyl-label .deck-num { transform: translateY(150%); }
.deck-halo {
  border-radius: 50%;
  background: var(--raised);
  transform: scale(1);
  will-change: transform;
}
.tonearm {
  position: absolute;
  top: 6%;
  right: 5%;
  width: 0;
  height: 60%;
  transform-origin: 50% 0;
  transform: rotate(22deg);
  transition: transform 0.7s var(--ease-out);
}
.tonearm-rod {
  position: absolute;
  left: -2.5px;
  top: 0;
  width: 5px;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #6B6F7B, #D8DAE0 45%, #8A8E99);
}
.tonearm-head {
  position: absolute;
  left: -9px;
  bottom: -26px;
  width: 18px;
  height: 34px;
  border-radius: 5px;
  background: var(--ink);
}
.tonearm-pivot {
  position: absolute;
  top: 6%;
  right: 5%;
  width: 36px;
  height: 36px;
  margin: -18px -18px 0 0;
  border-radius: 50%;
  background: var(--line);
  box-shadow: inset 0 0 0 9px var(--raised);
}
/* The instruction wraps onto two lines under the record */
/* Two lines, each kept whole. A line wider than the record's span overflows evenly, so it stays centered. */
.listen-text { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: min(1.15rem, 4.8vw); line-height: 1.35; font-weight: 700; text-align: center; white-space: nowrap; }
.listen-sub { font-size: min(0.95rem, 4.3vw); font-weight: 600; color: var(--muted); }
/* The words and button share the deck's width, padded to the record's span (3%–89%), so they
   center under the record rather than the record plus tonearm. */
/* The deck leaves 7% of its width empty below the record, so pulling this up by that much puts the
   text 22px under the record (the gap above); Play clip sits a little closer, 14px under the text. */
.listen-below { width: min(82vw, 330px); margin-top: calc(min(82vw, 330px) * -0.07); padding: 0 11% 0 3%; display: flex; flex-direction: column; align-items: center; gap: 14px; }
/* Play clip starts the first listen, then fills as the clip's loading bar while it plays */
/* As tall as Submit Guess on the game screen (52px on a 5px edge; 44px on short screens) and a
   little wider than "Memorize the clip!" above it (10 times that line's font size, where the line
   is 8.79), so the width scales with it on narrow phones. */
.listen-play { position: relative; overflow: hidden; width: calc(min(1.15rem, 4.8vw) * 10); min-height: 52px; padding: 10px 18px; font-size: 1.05rem; }
.listen-play:disabled { opacity: 1; cursor: default; }
.listen-play > * { position: relative; z-index: 1; }
.listen-play::before {
  content: "";
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, white 35%, transparent);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}
.listen-play.clip-playing::before { animation: clip-fill var(--clip-ms) linear forwards; }
.listen-play.clip-playing .replay-label > span:first-child { visibility: hidden; }
.listen-play.clip-playing .replay-label > span + span { visibility: visible; }

/* Before the clip the record is still and the arm is parked; it lifts again when the clip ends */
#screen-listen.ready .deck-disc,
#screen-listen.done .deck-disc { animation-play-state: paused; }
#screen-listen.ready .tonearm,
#screen-listen.done .tonearm { transform: rotate(4deg); }

@keyframes spin { to { transform: rotate(360deg); } }

/* Game */
.game-title { text-align: center; margin: 2px 0 0; font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats-row.four { grid-template-columns: repeat(4, 1fr); }
.stat { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.stat-label { font-size: 0.85rem; color: var(--muted); }
/* A small ↺ beside "Replays", matching the Hear clip again button */
.stat-label.with-icon { display: inline-flex; align-items: center; gap: 4px; }
.stat-label.with-icon .icon { width: 0.95em; height: 0.95em; }
.stat-value { font-size: 1.35rem; font-weight: 700; }
/* Misses left, as small records: amber while available, an empty ring once used */
.miss-pips { display: flex; align-items: center; gap: 3px; min-height: 1.5em; }
.miss-pips i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--ground) 0 2px, var(--accent) 2.5px);
  transition: background 0.2s var(--ease-out);
}
.miss-pips i.used { background: none; box-shadow: inset 0 0 0 1.5px var(--line); }

.wave-card, .range-card, .result-wave, .credits { background: var(--surface); border-radius: var(--radius); }
.wave-card { padding: 12px 12px 10px; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
/* The waveform takes up whatever height is left, so the page fits any phone without scrolling */
.wave-wrap {
  position: relative;
  flex: 1 1 150px;
  min-height: 70px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.ruler { flex: none; }
#wave, #res-wave { width: 100%; display: block; }
/* The track area is inset by half a grip's width on each side; the canvas overhangs into that
   gutter, so grips at either end of the track stay centered on their lines (GRIP_PAD in app.js). */
.wave-wrap, .ruler, .wave-head { margin-inline: 9px; }
#wave { position: absolute; top: 0; bottom: 0; left: -9px; width: calc(100% + 18px); height: 100%; }

html.game-lock, html.game-lock body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.game-lock #app {
  height: 100dvh;
  min-height: 0;
  padding-block: env(safe-area-inset-top) env(safe-area-inset-bottom);
}
/* Spare height: half goes to the waveform, a quarter each to the top and bottom margins */
html.game-lock #app::before, html.game-lock #app::after { content: ""; flex: 1 1 0; min-height: 8px; }
/* Nothing here is selectable, so dragging the range can't highlight the text around it */
#screen-game { flex: 2 1 auto; min-height: 0; gap: 10px; touch-action: none; user-select: none; -webkit-user-select: none; }
#screen-game .game-title { margin: 0; }
#screen-game > :not(.wave-card) { flex: none; }
/* Replay Clip and Submit share one row, so the waveform gets the height a second row took */
#btn-submit { min-height: 52px; padding-block: 10px; font-size: 1.05rem; }
/* "Track" at the top left of the waveform card, and the playhead's time at the top right, in the
   same type. The row is inset like the waveform and ruler, so both line up with the track's edges. */
.wave-head { flex: none; display: flex; justify-content: space-between; align-items: center; min-height: 20px; margin: 0 9px 9px; }
.track-label, .track-time { font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
/* Under the ruler: Play range then Play track at the left, Hear clip again at the right. The pill
   grows leftward over the row when opened; there isn't room for all three on a phone, so the Play
   buttons fade out while it's open or the clip is playing, and come back when it closes. */
.wave-foot { flex: none; position: relative; display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.wave-foot .replay-pill { position: absolute; top: 0; right: 0; }
.wave-foot:has(.replay-pill.open, .replay-pill.clip-playing) .play-btn { opacity: 0; pointer-events: none; }

.ruler { position: relative; height: 20px; margin-top: 8px; font-size: 0.75rem; color: var(--muted); }
.ruler span { position: absolute; transform: translateX(-50%); top: 3px; }
.ruler span:first-child { transform: none; }
.ruler span:last-child { transform: translateX(-100%); }

/* Fixed-width digits only where numbers tick, so they don't jitter */
#timer, .track-time, .range-value { font-variant-numeric: tabular-nums; }

.range-card { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 10px 12px 12px; }
.range-edge { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.range-row { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; width: 100%; }
.range-value { text-align: center; font-size: 1rem; font-weight: 700; }
.btn.nudge { padding: 0; min-height: 44px; }

/* The clip's solid blue button on the listen screen. It sits on a 5px edge like Submit Guess, but
   pressing sinks it all the way (flat), where it stays while the clip plays, so releasing your
   finger doesn't move it again. The edge keeps one color throughout, so only its height changes. */
.btn.clip-solid {
  --edge: #3B6D8C;
  color: #04192B;
  background: var(--answer);
  box-shadow: 0 5px 0 var(--edge);
  margin-bottom: 5px;
}
.btn.clip-solid:hover { background: color-mix(in srgb, var(--answer) 85%, white); }
.btn.clip-solid:active,
.btn.clip-solid.pressing,
.btn.clip-solid:disabled { transform: translateY(5px); box-shadow: 0 0 0 var(--edge); }
.replay-label { display: grid; }
.replay-label > span { grid-area: 1 / 1; }
.replay-label > span + span { visibility: hidden; }

/* Play range (washed amber) and Play track (gray, outlined icon): pill buttons with the label
   inside, the same height as Hear clip again */
.play-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px 0 11px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s var(--ease-out), opacity 0.2s;
}
.play-btn .icon { width: 14px; height: 14px; flex: none; }
.play-btn:active { transform: scale(0.96); }
.play-btn .replay-label { justify-items: start; } /* "Stop" sits by the icon, not centered */
/* While playing, the label swaps to "Stop" in the same space, so the button keeps its width */
.play-btn.clip-playing .replay-label > span:first-child { visibility: hidden; }
.play-btn.clip-playing .replay-label > span + span { visibility: visible; }
.range-btn { color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.range-btn:hover { background: color-mix(in srgb, var(--accent) 26%, var(--surface)); }
.track-btn { color: var(--ink); background: var(--raised); }
.track-btn:hover { background: #2B2F3A; }

/* Hear clip again: a washed-blue ↺ circle. Tapping it shows a separate solid blue "Hear clip
   again?" button to its left and turns the ↺ into ✕, which closes it again (as does a tap anywhere
   else). Tapping the button plays the clip: it stays shown as "Stop clip" and fills left to right
   over the clip's length, then everything closes when the clip ends. */
/* The row is as wide as the hidden button even while it's closed, and that space sits over Play
   track, so the row itself lets taps through; only the circle (and the button, once shown) take them. */
.replay-pill { display: flex; align-items: flex-start; gap: 8px; pointer-events: none; }
.pill-dot { pointer-events: auto; }
.pill-dot {
  appearance: none;
  width: 34px;
  height: 34px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--answer);
  background: color-mix(in srgb, var(--answer) 16%, var(--surface));
  cursor: pointer;
  transition: background 0.15s, transform 0.12s var(--ease-out);
}
.pill-dot:hover { background: color-mix(in srgb, var(--answer) 26%, var(--surface)); }
.pill-dot:active { transform: scale(0.92); }
.pill-dot .icon { grid-area: 1 / 1; width: 16px; height: 16px; transition: transform 0.2s var(--ease-out), opacity 0.2s; }
.pill-dot .icon-close { opacity: 0; transform: rotate(-90deg); }
.replay-pill.open .icon-open, .replay-pill.clip-playing .icon-open { opacity: 0; transform: rotate(90deg); }
.replay-pill.open .icon-close, .replay-pill.clip-playing .icon-close { opacity: 1; transform: none; }
/* Solid blue like Play clip on the listen screen, at the height of the Play pills, on a 3px edge */
.btn.replay-btn {
  position: relative;
  overflow: hidden;
  gap: 6px;
  height: 34px;
  min-height: 0;
  padding: 0 14px 0 11px;
  margin-bottom: 0;
  font-size: 0.85rem;
  white-space: nowrap;
  box-shadow: 0 3px 0 var(--edge);
  visibility: hidden;
  opacity: 0;
  transform: translateX(8px);
  pointer-events: none;
  transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out), visibility 0s 0.2s, background 0.15s;
}
.replay-btn .icon { width: 14px; height: 14px; flex: none; }
.replay-btn > * { position: relative; z-index: 1; }
.replay-btn .replay-label { justify-items: start; }
.replay-pill.open .replay-btn, .replay-pill.clip-playing .replay-btn {
  visibility: visible;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out), visibility 0s, background 0.15s;
}
.replay-pill.open .btn.replay-btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--edge); }
/* While the clip plays the button stays pressed down (like Play clip on the listen screen) and the ✕
   dims: neither can be used until the clip ends. */
.replay-pill.clip-playing .btn.replay-btn { opacity: 1; cursor: default; transform: translateY(3px); box-shadow: 0 0 0 var(--edge); }
.replay-pill.clip-playing .btn.replay-btn:hover { background: var(--answer); }
.pill-dot:disabled { opacity: 0.4; cursor: default; }
.pill-dot:disabled:hover { background: color-mix(in srgb, var(--answer) 16%, var(--surface)); }
.pill-dot:disabled:active { transform: none; }
.replay-pill.clip-playing .replay-label > span:first-child { visibility: hidden; }
.replay-pill.clip-playing .replay-label > span + span { visibility: visible; }
.replay-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, white 35%, transparent);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}
.replay-pill.clip-playing .replay-btn::before { animation: clip-fill var(--clip-ms) linear forwards; }

@keyframes clip-fill { to { transform: scaleX(1); } }

/* Short screens, like a small phone with the browser's toolbars showing */
@media (max-height: 720px) {
  #screen-game { gap: 6px; }
  #screen-game .game-title { margin: 0; font-size: 1.25rem; }
  #screen-game .stat-label { font-size: 0.75rem; }
  #screen-game .stat-value { font-size: 1.1rem; }
  .wave-card { padding: 8px 10px 8px; }
  .wave-wrap { min-height: 60px; }
  .wave-foot { margin-top: 12px; }
  .ruler { margin-top: 4px; }
  .wave-head { margin-bottom: 6px; }
  .play-btn { height: 30px; }
  .btn.replay-btn { height: 30px; }
  .pill-dot { width: 30px; height: 30px; }
  .range-card { gap: 6px; padding: 6px 10px 8px; }
  .range-edge { gap: 0; }
  .btn.nudge { min-height: 40px; }
  .range-row { grid-template-columns: 40px 1fr 40px; }
  #btn-submit, .listen-play { min-height: 44px; padding-block: 6px; }
}

/* A phone on its side can't fit the controls, so it has to scroll to reach Submit. */
@media (max-height: 500px) {
  html.game-lock, html.game-lock body { height: auto; overflow: auto; }
  html.game-lock #app { height: auto; }
  #screen-game { touch-action: manipulation; }
  .wave-wrap { flex: none; height: 120px; }
}

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions .btn { padding-inline: 8px; white-space: nowrap; }
.feedback { min-height: 1.4em; text-align: center; font-weight: 700; }
.feedback.miss { color: var(--coral); }
.feedback.repeat { color: var(--accent); }
.shake { animation: shake 0.4s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* Result */
.navbar { display: flex; align-items: center; justify-content: space-between; min-height: 40px; }
.result-hero { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 4px 0 6px; }
.result-disc { width: min(54vw, 216px); animation: drop-in 0.9s var(--ease-out); }
.result-disc .vinyl-label { width: 58%; align-content: center; }
.result-disc .vinyl-label::after { display: none; }
.score { font-size: clamp(2.5rem, 12vw, 3.1rem); font-weight: 800; letter-spacing: -0.04em; line-height: 0.95; text-align: center; }
/* ✗ for a revealed answer: a lighter glyph that sits clear of the caption */
.score.missed { font-size: clamp(2rem, 9vw, 2.4rem); font-weight: 700; line-height: 1.1; }
.score-caption { font-size: 0.8rem; font-weight: 600; text-align: center; }
.verdict { font-size: 1.3rem; font-weight: 700; text-align: center; }
@keyframes drop-in {
  from { transform: rotate(-120deg) scale(0.82); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.credits { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.credits[hidden], .credit-link[hidden] { display: none; }
.credit-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; overflow-wrap: anywhere; }
.credit-title { font-size: 1.1rem; font-weight: 700; overflow-wrap: anywhere; }

.result-wave { padding: 14px 12px 12px; }
#res-wave { height: 96px; }
.legend { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 0.85rem; color: var(--muted); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.sw.guess { background: var(--accent); }
.sw.answer { background: var(--answer); }
.compare-actions { margin-top: 12px; }
/* Tinted with the You and Answer dot colors, so solid amber stays reserved for the main action */
/* Copy Results is the home buttons' size: 50px on a 4px edge */
#btn-share { font-size: 1.05rem; padding: 11px 18px; min-height: 50px; margin-bottom: 0; box-shadow: 0 4px 0 var(--accent-edge); }
#btn-share:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--accent-edge); }
/* Your Guess and Play Clip are shorter than the default button */
.compare-actions .btn { min-height: 38px; padding-block: 6px; }
.btn.guess { color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.btn.clip { color: var(--answer); background: color-mix(in srgb, var(--answer) 16%, var(--surface)); }
.btn.guess:hover { background: color-mix(in srgb, var(--accent) 26%, var(--surface)); }
.btn.clip:hover { background: color-mix(in srgb, var(--answer) 26%, var(--surface)); }

/* Archive */
.archive-head { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; margin-bottom: 8px; }
.archive-head h1 { margin: 0; text-align: center; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.playlist { list-style: none; margin: 0; padding: 8px; background: var(--surface); border-radius: var(--radius); }
.track {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px;
  border-radius: 16px;
  color: inherit;
  text-decoration: none;
  transition: background 0.15s;
}
.track:hover { background: var(--raised); }
.cover {
  position: relative;
  flex: none;
  width: 68px;
  height: 68px;
  border-radius: 16px;
  background: var(--raised);
  display: grid;
  place-items: center;
}
.cover .vinyl { width: 56px; background: repeating-radial-gradient(circle, #101116 0 1.5px, #1B1D23 1.5px 3px); }
.cover .icon { position: absolute; width: 26px; height: 26px; color: var(--ink); filter: drop-shadow(0 1px 3px rgba(0,0,0,0.7)); transition: transform 0.2s var(--ease-out); }
.track:hover .cover .icon { transform: scale(1.15); }
.track-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.track-name { font-size: 1.1rem; font-weight: 700; overflow-wrap: anywhere; }
.track-sub { color: var(--muted); font-size: 0.95rem; }
.track-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; font-weight: 700; }
.track-side.played { font-size: 1.25rem; }
.track-side.fresh { color: var(--accent); }
.track-side small { color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .deck-disc, .result-disc, .shake { animation: none; }
  .tonearm, .how-to-chevron, .replay-btn, .pill-dot .icon { transition: none; }
  #deck-halo { transform: none !important; }
}
