/* MIXTAPE — styles
   Palette: deep purple-black base, violet + pink accents, cyan sparingly.
   Type: Unbounded (wordmark, headings), DM Sans (everything else). */

:root {
  --bg: #0D0912;
  --surface: #150F1E;
  --surface-2: #1C1428;
  --line: #2C2140;
  --line-strong: #3D2F57;
  --violet: #8A5CFF;
  --violet-deep: #5B3BB8;
  --pink: #FF4FA3;
  --cyan: #45D9FF;
  --text: #F4EFFA;
  --gold: #FFC857;
  --muted: #9D92B0;
  --ok: #5CE0A0;
  --bad: #FF5C7A;
  --r-sm: 3px;
  --r-md: 6px;
  --col: 720px;
  --col-wide: 960px;
  --font-ui: "Space Grotesk", "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Unbounded", "DM Sans", system-ui, sans-serif;
  --font-marker: "Caveat", "Segoe Print", "Bradley Hand", cursive;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before {
  /* restrained grain */
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
#app { position: relative; z-index: 1; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; margin: 0; }
h2 { font-size: 15px; }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.icon { display: inline-flex; width: 1.25em; height: 1.25em; flex: none; }
.icon svg { width: 100%; height: 100%; }

/* ---------- Layout ---------- */
.screen {
  width: min(100% - 32px, var(--col));
  margin: 0 auto;
  padding: 20px 0 48px;
}
.screen-play { width: min(100% - 32px, var(--col-wide)); }

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  margin-bottom: 20px;
}
.topbar > :first-child { justify-self: start; }
.topbar > :last-child { justify-self: end; }
.topbar-meta { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.meta { color: var(--muted); font-size: 14px; }
.meta b { color: var(--text); font-weight: 600; }
.chip {
  font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  padding: 5px 9px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  color: var(--text);
}

.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 12px;
}

/* ---------- Wordmark ---------- */
.wordmark { display: inline-block; line-height: 1; }
.wordmark-text {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.03em;
  display: inline-block;
  transform: skewX(-7deg);
  color: var(--text);
  /* screen-print misregistration: pink then violet underneath */
  text-shadow: 3px 3px 0 var(--pink), 6px 6px 0 var(--violet-deep);
}
.wordmark-sm .wordmark-text { font-size: 18px; text-shadow: 1.5px 1.5px 0 var(--pink), 3px 3px 0 var(--violet-deep); }
.wordmark-md .wordmark-text { font-size: 32px; }
.wordmark-xl .wordmark-text { font-size: clamp(56px, 12vw, 112px); text-shadow: 5px 5px 0 var(--pink), 10px 10px 0 var(--violet-deep); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--r-md);
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text);
  font-weight: 600; font-size: 15px; line-height: 1;
  transition: background .15s, border-color .15s, transform .08s;
  text-decoration: none;
}
.btn:hover:not(:disabled) { background: #241a33; border-color: #4a3a6b; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; }
.btn-primary { background: var(--pink); border-color: var(--pink); color: #1A0510; }
.btn-primary:hover:not(:disabled) { background: #ff6cb2; border-color: #ff6cb2; }
.btn-ghost { background: transparent; }
.btn-lg { padding: 14px 22px; font-size: 16px; }
.btn-icon { padding: 0; width: 40px; height: 40px; }
.btn-round { width: 52px; height: 52px; border-radius: 50%; }
.btn-round .icon { width: 1.5em; height: 1.5em; }
.link {
  background: none; border: 0; padding: 0; color: var(--cyan); font-weight: 500; font-size: 14px;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(69,217,255,.4);
}
.link:hover { text-decoration-color: var(--cyan); }
.link-dim { color: var(--muted); text-decoration-color: rgba(157,146,176,.35); font-size: 13px; }

/* ---------- Skewed primary (echoes the wordmark) ---------- */
.btn-skew { transform: skewX(-8deg); border-radius: var(--r-sm); }
.btn-skew .btn-inner { display: inline-flex; align-items: center; gap: 8px; transform: skewX(8deg); }
.btn-skew:active:not(:disabled) { transform: skewX(-8deg) translateY(1px); }
.btn-primary.btn-skew { box-shadow: 4px 4px 0 var(--violet-deep); }
.btn-primary.btn-skew:hover:not(:disabled) { box-shadow: 5px 5px 0 var(--violet-deep); }
.btn-primary.btn-skew:disabled { box-shadow: none; }

/* ---------- Home ---------- */
.screen-home { padding-top: 40px; overflow-x: clip; }
.hero {
  position: relative; padding: 40px 0 44px;
  display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 8px 32px; align-items: center;
  grid-template-areas: "mark mark" "copy object";
}
.hero-mark { grid-area: mark; position: relative; z-index: 1; margin-bottom: 8px; }
.hero-copy { grid-area: copy; }
.hero-object { grid-area: object; }
.hero::before {
  content: ""; position: absolute; z-index: 0; left: -160px; top: -120px;
  width: 560px; height: 560px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(138,92,255,.22), transparent 70%);
}
.hero-wave {
  position: absolute !important; inset: 0 -40px; z-index: 0; pointer-events: none; opacity: .5;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}
.hero-copy { position: relative; z-index: 1; }
.hero-object {
  position: relative; z-index: 1; justify-self: end; align-self: start;
  transform: rotate(-6deg);
  filter: drop-shadow(0 18px 30px rgba(138,92,255,.22));
}

/* cassette */
.cassette svg { display: block; width: 100%; height: auto; }
.cassette-lg { width: 300px; }
.cassette-sm { width: 124px; }
.cassette .reel { animation: reel 2.4s linear infinite; animation-play-state: paused; }
.cassette.is-spinning .reel { animation-play-state: running; }
.hero .cassette .reel { animation-duration: 6s; }
@keyframes reel { to { transform: rotate(360deg); } }
.tagline {
  margin-top: 0;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(20px, 3.2vw, 28px); letter-spacing: -0.01em;
}
.tagline-mark { position: relative; display: inline-block; }
.tagline-mark::after {
  /* one hand-drawn stroke, the only graffiti allowed in */
  content: ""; position: absolute; left: -2%; right: -4%; bottom: -6px; height: 10px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'><path d='M2 8 C 40 2, 90 11, 130 5 S 190 4, 198 7' fill='none' stroke='%23FF4FA3' stroke-width='3.2' stroke-linecap='round'/></svg>") no-repeat center / 100% 100%;
}
.lede { margin-top: 18px; max-width: 46ch; color: var(--muted); font-size: 17px; }
.hero-actions { margin-top: 28px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.hero-cat { display: flex; align-items: baseline; gap: 8px; }
.hero-cat-label { color: var(--muted); font-size: 14px; }
.hero-cat-name { font-family: var(--font-display); font-weight: 700; font-size: 14px; letter-spacing: .06em; }

.tiles-section { padding: 28px 0; border-top: 1px solid var(--line); }
.tiles { display: grid; gap: 10px; }
.tiles-compact { grid-template-columns: repeat(4, 1fr); }
.tiles-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tile {
  position: relative; width: 100%; text-align: left;
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface);
  transition: border-color .15s, background .15s;
}
.tile:hover:not(:disabled) { border-color: var(--line-strong); background: var(--surface-2); }
.tile.is-selected { border-color: var(--pink); box-shadow: inset 0 0 0 1px var(--pink); }
.tile.is-soon { opacity: .55; }
.tile-swatch {
  display: grid; place-items: center; height: 56px; border-radius: var(--r-sm);
  color: var(--tile-accent);
  background: color-mix(in srgb, var(--tile-accent) 12%, var(--surface));
}
.genre-icon { display: block; width: 30px; height: 30px; }
.genre-icon svg { width: 100%; height: 100%; }
.tile.is-selected .tile-swatch { background: linear-gradient(135deg, var(--tile-accent), var(--violet-deep)); color: #fff; }
.tile-name { font-weight: 600; font-size: 14px; line-height: 1.2; }
.tile-status { font-size: 12px; color: var(--muted); }
.tile.is-selected .tile-status { color: var(--ok); }
.tile-wrap .tile-blurb { margin-top: 8px; font-size: 13px; color: var(--muted); }

.howto { padding: 28px 0 8px; border-top: 1px solid var(--line); }
.howto h2 { margin-bottom: 16px; }
.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; }
.step { display: flex; gap: 12px; }
.step-icon {
  flex: none; width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); color: var(--pink);
}
.step strong { display: block; font-weight: 600; font-size: 15px; }
.step p { color: var(--muted); font-size: 14px; margin-top: 2px; }

.foot { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* ---------- Mixes ---------- */
.mixes-head { margin-bottom: 20px; }
.mixes-head h1 { font-size: 26px; }
.mixes-head p { margin-top: 6px; }

/* ---------- Play ---------- */
/* ---------- Reveal band (centrepiece) ---------- */
.mixer.mixer-reveal {
  height: auto; padding: 16px 16px 12px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: linear-gradient(180deg, #120C1B 0%, #0F0A16 100%);
  position: relative; overflow: visible;
}
.mixer-reveal.is-playing { border-color: var(--line-strong); }
.reveal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.unlock-line { display: flex; align-items: baseline; gap: 6px; line-height: 1; }
.unlock-value { font-family: var(--font-display); font-weight: 900; font-size: 44px; letter-spacing: -0.03em; color: var(--text); font-variant-numeric: tabular-nums; }
.unlock-of { color: var(--muted); font-size: 14px; }
.unlock-bonus { display: block; margin-top: 6px; font-size: 13px; color: var(--cyan); }
.reveal-actions { display: flex; align-items: center; gap: 16px; }
.btn-reveal { border-color: var(--pink); color: var(--pink); background: rgba(255,79,163,.06); }
.btn-reveal:hover:not(:disabled) { background: rgba(255,79,163,.14); border-color: var(--pink); }
.btn-reveal:disabled { color: var(--muted); border-color: var(--line); background: transparent; }
.mixer-cassette { opacity: .55; transition: opacity .3s; transform: rotate(4deg); }
.mixer-reveal.is-playing .mixer-cassette { opacity: 1; }

.reveal-band { position: relative; height: 236px; padding-bottom: 36px; user-select: none; touch-action: none; }
.reveal-band canvas { display: block; width: 100%; height: 200px; border-radius: var(--r-sm); background: rgba(0,0,0,.25); }
.reveal-handle {
  position: absolute; top: 0; height: 200px; width: 26px; transform: translateX(-50%);
  padding: 0; border: 0; background: transparent; cursor: ew-resize; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: left .18s cubic-bezier(.2,.8,.2,1);
}
.reveal-band.is-dragging .reveal-handle { transition: none; }
.reveal-grip {
  width: 18px; height: 44px; border-radius: 9px; background: var(--pink); color: #1A0510;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  box-shadow: 0 0 0 3px rgba(13,9,18,.85), 0 0 18px rgba(255,79,163,.6);
  transition: transform .15s;
}
.reveal-grip i { width: 8px; height: 1.5px; background: rgba(26,5,16,.7); border-radius: 1px; }
.reveal-handle:hover .reveal-grip, .reveal-band.is-dragging .reveal-grip { transform: scaleX(1.12) scaleY(1.06); }
.reveal-handle:focus-visible { outline: 0; }
.reveal-handle:focus-visible .reveal-grip { box-shadow: 0 0 0 3px rgba(13,9,18,.85), 0 0 0 5px var(--cyan); }
.reveal-handle-label {
  position: absolute; top: 8px; left: 50%; transform: translate(-50%, 0);
  font-family: var(--font-display); font-size: 11px; font-weight: 700; color: var(--pink);
  background: var(--bg); padding: 2px 6px; border-radius: var(--r-sm); border: 1px solid rgba(255,79,163,.35);
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .15s;
}
.reveal-band:hover .reveal-handle-label, .reveal-band.is-dragging .reveal-handle-label, .reveal-handle:focus-visible .reveal-handle-label { opacity: 1; }
.reveal-band.is-bump canvas { animation: bump .26s ease-out; }
@keyframes bump { 30% { transform: scaleY(1.03); } }

.reveal-ticks { position: absolute; left: 0; right: 0; top: 206px; height: 30px; }
.reveal-tick {
  position: absolute; top: 0; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 0 4px; border: 0; background: transparent; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums;
}
.reveal-tick i { display: block; width: 1px; height: 8px; background: var(--line-strong); }
.reveal-tick.is-unlocked { color: var(--text); }
.reveal-tick.is-unlocked i { background: var(--pink); }
.reveal-tick.is-current { color: var(--pink); font-weight: 600; }
.reveal-tick:hover { color: var(--pink); }
.reveal-tick:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 2px; }

.mix-legend {
  display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); margin-top: 2px;
}
.mix-dots { display: inline-flex; gap: 4px; }
.mix-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--dot); opacity: .5; }
.mix-legend.is-live .mix-dots i { opacity: 1; animation: pulse 1.6s ease-in-out infinite; }
.mix-dots i:nth-child(2) { animation-delay: .15s; }
.mix-dots i:nth-child(3) { animation-delay: .3s; }
.mix-dots i:nth-child(4) { animation-delay: .45s; }
.mix-dots i:nth-child(5) { animation-delay: .6s; }
@keyframes pulse { 50% { transform: scale(1.45); } }
.mix-legend.is-live .mix-legend-text { color: var(--text); }

.transport-hint { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }

.mixer {
  position: relative;
  height: 220px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, #120C1B 0%, #0F0A16 100%);
  overflow: hidden;
}
.mixer.is-playing { border-color: var(--line-strong); }
.wave { position: absolute; inset: 0; }
.wave canvas { display: block; }
.wave-loading, .wave-error {
  position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: rgba(13,9,18,.7); color: var(--muted); font-size: 14px; border-radius: var(--r-md);
}
.wave-loading[hidden] { display: none; }
.wave-error { flex-direction: column; color: var(--text); }
.spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--line-strong); border-top-color: var(--pink);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.controls { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.progress {
  flex: 1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden;
}
.progress-fill { height: 100%; width: 0; background: var(--violet); }
.time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; min-width: 92px; text-align: right; }

.notice {
  margin-top: 12px; font-size: 13px; color: var(--muted);
  padding-left: 10px; border-left: 2px solid var(--line-strong);
}
.notice-warn { border-left-color: var(--pink); color: var(--text); }

.answers { margin-top: 32px; }
.slots { display: grid; gap: 10px; }
.slot {
  display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: start;
}
.slot-num {
  height: 48px; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  border: 1px solid var(--line); border-radius: var(--r-md); color: var(--muted);
}
.slot.is-filled .slot-num { color: var(--text); border-color: var(--line-strong); }
.slot-body { position: relative; min-width: 0; }

.search { position: relative; }
.search-input {
  display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  transition: border-color .15s;
}
.search-input:focus-within { border-color: var(--violet); }
.search-icon { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search-input input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
  color: var(--text); font: inherit; font-size: 15px;
}
.search-input input::placeholder { color: var(--muted); }
.search-clear {
  width: 28px; height: 28px; border: 0; background: transparent; color: var(--muted);
  display: grid; place-items: center; border-radius: var(--r-sm);
}
.search-clear svg { width: 16px; height: 16px; }
.search-clear:hover { color: var(--text); background: var(--surface-2); }
.search-clear[hidden] { display: none; }

.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20;
  max-height: 320px; overflow-y: auto;
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--surface-2); box-shadow: 0 16px 40px rgba(0,0,0,.5);
}
.search-results[hidden] { display: none; }
.search-item {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px; cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.search-item:last-child { border-bottom: 0; }
.search-item.is-active, .search-item:hover { background: #26193a; }
.search-item.is-taken { opacity: .45; cursor: default; }
.search-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.search-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-artist { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-tag { font-size: 12px; color: var(--muted); white-space: nowrap; }
.search-empty { padding: 14px 12px; color: var(--muted); font-size: 14px; }

.artwork { flex: none; border-radius: var(--r-sm); background: var(--surface); object-fit: cover; }

.slot-pick {
  display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 6px 0 2px;
  border: 1px solid var(--violet-deep); border-radius: var(--r-md);
  background: linear-gradient(90deg, rgba(138,92,255,.14), rgba(138,92,255,.03));
  animation: pop .18s ease-out;
}
@keyframes pop { from { transform: scale(.985); opacity: .6; } }
.slot-pick .artwork { width: 42px; height: 42px; }
.slot-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.slot-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-artist { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-remove {
  width: 34px; height: 34px; border: 0; background: transparent; color: var(--muted);
  display: grid; place-items: center; border-radius: var(--r-sm);
}
.slot-remove svg { width: 16px; height: 16px; }
.slot-remove:hover { color: var(--text); background: rgba(255,255,255,.06); }

.submit-row { display: flex; align-items: center; gap: 16px; margin-top: 20px; flex-wrap: wrap; }
.submit-hint { color: var(--muted); font-size: 14px; }

.reveal-list { margin-top: 8px; font-size: 13px; color: var(--muted); }
.reveal-list[hidden] { display: none; }
.reveal-list li { padding: 2px 0; }

/* ---------- Results ---------- */
.result-card {
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  padding: 32px 28px;
}
.result-card.is-perfect { border-color: var(--pink); animation: glow 2.4s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 1px var(--pink), 0 0 48px rgba(255,79,163,.28); } }
.result-row { animation: rise .4s ease-out both; animation-delay: calc(.25s + var(--i, 0) * 90ms); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.result-title { font-size: 22px; color: var(--pink); }
.result-score { margin-top: 10px; line-height: 1; }
.result-big { font-family: var(--font-display); font-weight: 900; font-size: 88px; letter-spacing: -0.04em; }
.result-of { font-family: var(--font-display); font-weight: 700; font-size: 28px; color: var(--muted); }
.result-sub { color: var(--muted); margin-top: 4px; }
.result-headline { margin-top: 14px; font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--cyan); }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 12px;
  margin: 24px 0 0; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.stats dt { font-size: 12px; color: var(--muted); }
.stats dd { margin: 2px 0 0; font-family: var(--font-display); font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.breakdown { margin-top: 10px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.result-list { margin-top: 20px; display: grid; gap: 6px; }
.result-row {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 8px;
  border: 1px solid var(--line); border-radius: var(--r-md);
}
.result-row.is-hit { border-color: rgba(92,224,160,.35); }
.result-row.is-miss { border-color: rgba(255,92,122,.3); }
.result-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.result-song { font-weight: 600; }
.result-artist { font-size: 13px; color: var(--muted); }
.result-mark { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; }
.is-hit .result-mark { background: rgba(92,224,160,.15); color: var(--ok); }
.is-miss .result-mark { background: rgba(255,92,122,.15); color: var(--bad); }
.wrong-picks { margin-top: 14px; font-size: 14px; color: var(--muted); }
.wrong-picks b { color: var(--text); font-weight: 600; }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .screen { padding-top: 14px; }
  .screen-home { padding-top: 24px; }
  .hero { grid-template-columns: 1fr; grid-template-areas: "mark" "copy" "object"; padding: 24px 0 32px; gap: 20px; }
  .hero-object { justify-self: center; transform: rotate(-5deg); }
  .cassette-lg { width: 220px; }
  .sparkle-b { right: 6%; top: 10px; }
  .mixer-cassette { display: none; }
  .reveal-head { flex-direction: column; gap: 10px; }
  .unlock-value { font-size: 34px; }
  .reveal-band { height: 196px; }
  .reveal-band canvas, .reveal-handle { height: 160px; }
  .reveal-ticks { top: 166px; }
  .reveal-tick:nth-child(2), .reveal-tick:nth-child(4) { display: none; }
  .mixer-reveal { padding: 12px 10px 10px; }
  .wordmark-xl .wordmark-text { text-shadow: 3px 3px 0 var(--pink), 6px 6px 0 var(--violet-deep); }
  .tiles-compact { grid-template-columns: repeat(2, 1fr); }
  .tiles-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .mixer { height: 140px; }
  .topbar { grid-template-columns: auto 1fr; }
  .topbar > :nth-child(2) { justify-self: start; }
  .topbar-meta { grid-column: 1 / -1; justify-self: start; gap: 10px; }
  .topbar .meta { font-size: 13px; }
  .time { min-width: 80px; font-size: 13px; }
  .slot { grid-template-columns: 36px 1fr; gap: 8px; }
  .slot-num { font-size: 12px; }
  .result-card { padding: 24px 18px; }
  .result-big { font-size: 68px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .result-actions .btn { flex: 1 1 auto; }
}
@media (max-width: 420px) {
  .tiles-compact { grid-template-columns: repeat(2, 1fr); }
  .tiles-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001s !important; transition-duration: .001s !important; }
}

/* ---------- Starting / provider ---------- */
.screen-starting { display: grid; place-items: center; min-height: 60vh; }
.starting { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.starting .spinner { width: 22px; height: 22px; }
.starting-text { color: var(--muted); font-size: 15px; max-width: 48ch; }
.notice-provider { border-left-color: var(--violet); color: var(--text); }
.notice-provider a { color: var(--cyan); }
.small { font-size: 13px; margin-top: 14px; }

/* ---------- Lock-in states ---------- */
.btn-lock { padding: 7px 12px; font-size: 13px; border-color: var(--pink); color: var(--pink); background: rgba(255,79,163,.08); flex: none; }
.btn-lock:hover:not(:disabled) { background: var(--pink); color: #1A0510; }
.slot-verdict { font-size: 13px; font-weight: 600; white-space: nowrap; }
.slot-mark { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; flex: none; margin-right: 4px; }
.slot-mark svg { width: 16px; height: 16px; }
.slot.is-correct .slot-pick { border-color: rgba(92,224,160,.55); background: linear-gradient(90deg, rgba(92,224,160,.14), rgba(92,224,160,.03)); }
.slot.is-correct .slot-num { color: var(--ok); border-color: rgba(92,224,160,.55); }
.slot.is-correct .slot-verdict { color: var(--ok); }
.slot.is-correct .slot-mark { background: rgba(92,224,160,.15); color: var(--ok); }
.slot.is-wrong .slot-pick { border-color: rgba(255,92,122,.6); background: linear-gradient(90deg, rgba(255,92,122,.16), rgba(255,92,122,.03)); animation: shake .32s ease-out; }
.slot.is-wrong .slot-verdict { color: var(--bad); }
.slot.is-wrong .slot-mark { background: rgba(255,92,122,.15); color: var(--bad); }
@keyframes shake { 20% { transform: translateX(-4px); } 45% { transform: translateX(4px); } 70% { transform: translateX(-2px); } }
.btn-submit[hidden] { display: none; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } .btn-lock { padding: 6px 9px; } }


/* ---------- Human touches: marker notes, tape, doodles, stickers ---------- */
.marker { font-family: var(--font-marker); font-weight: 700; }
.marker-note {
  font-family: var(--font-marker); font-weight: 700; font-size: 22px; line-height: 1;
  color: var(--pink); display: inline-block; transform: rotate(var(--rot, -3deg));
  white-space: nowrap; pointer-events: none;
}
.note-vol { position: absolute; right: -4px; top: -18px; font-size: 24px; color: var(--cyan); opacity: .9; }
.hero-mark { justify-self: start; }
.hero-mark { position: relative; display: inline-block; }
.note-cassette { position: absolute; left: 8px; bottom: -34px; font-size: 20px; color: var(--muted); }
.note-aside { font-size: 22px; margin-right: 6px; }
.note-verdict { position: absolute; right: 28px; top: 26px; font-size: 30px; color: var(--cyan); }

.start-here { position: relative; display: inline-flex; align-items: center; gap: 6px; margin-left: 18px; color: var(--cyan); pointer-events: none; }
.note-start { font-size: 22px; color: var(--cyan); }
.doodle-arrow { width: 64px; height: 22px; display: block; }
.doodle svg { width: 100%; height: 100%; display: block; }
.hero-actions { position: relative; }

.doodle-star { position: absolute; z-index: 1; width: 22px; height: 22px; color: var(--pink); pointer-events: none; }
.star-a { top: 6px; left: 56%; color: var(--cyan); transform: rotate(14deg); width: 18px; height: 18px; }
.star-b { top: 54px; right: 3%; transform: rotate(-9deg); width: 26px; height: 26px; }
.star-c { bottom: 54px; right: 44%; color: var(--violet); transform: rotate(22deg); width: 16px; height: 16px; }

.tape {
  position: absolute; z-index: 3; display: block; width: 92px; height: 24px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.06) 0 2px, transparent 2px 5px),
    rgba(232, 214, 170, .62); /* masking tape */
  transform: rotate(var(--rot, -6deg));
  pointer-events: none; opacity: .95;
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6px, #000 calc(100% - 6px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 6px, #000 calc(100% - 6px), transparent 100%);
}
.tape-cassette { right: 18px; top: -8px; width: 100px; --rot: 9deg !important; }
.tape-mini { left: -14px; top: -8px; width: 56px; height: 16px; }
.tape-card { left: 50%; top: -12px; margin-left: -56px; width: 112px; }
.tape-tile { left: 50%; top: -10px; margin-left: -34px; width: 68px; height: 18px; }

/* tiles as crooked stickers */
.tile { transform: rotate(var(--rot, 0deg)); position: relative; }
.tile:hover:not(:disabled) { transform: rotate(0deg) translateY(-2px); }
.tiles { padding-top: 6px; }

/* how-to-play: handwritten numbers, slightly off the grid */
.step { position: relative; transform: rotate(var(--rot, 0deg)); padding-left: 34px; }
.step .step-icon { display: none; }
.step-num { position: absolute; left: 0; top: -2px; font-size: 28px; color: var(--pink); line-height: 1; }

/* J-card tracklist labels */
.slot-num.marker { font-size: 24px; color: var(--pink); border-style: dashed; border-color: var(--line-strong); }
.slot.is-filled .slot-num.marker { color: var(--text); }
.slot.is-correct .slot-num.marker { color: var(--ok); }

/* result card: a little crooked, like a stuck-on sticker */
.result-card { position: relative; transform: rotate(-.35deg); }
.result-card > *:not(.tape) { transform: rotate(.35deg); }

@media (max-width: 720px) {
  .start-here { display: none; }
  .tape-cassette { right: 16px; }
  .note-vol { display: none; }
  .star-a { display: none; }
  .note-verdict { position: static; display: block; margin-top: 6px; font-size: 26px; }
  .note-cassette { bottom: -30px; left: 50%; transform: translateX(-50%) rotate(var(--rot)); }
  .tile { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .tile:hover:not(:disabled) { transform: rotate(var(--rot, 0deg)); } }


/* ---------- Results sheet v2 ---------- */
.result-card { padding: 34px 32px 30px; border-color: var(--line-strong); background: linear-gradient(180deg, #171022 0%, #120C1B 100%); }
.result-card.is-perfect { border-color: var(--line-strong); animation: none; }
.result-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px 36px; align-items: center; }
.result-score { position: relative; }
.result-title { font-size: 18px; color: var(--pink); }
.result-count { margin-top: 6px; line-height: 1; }
.result-big { font-family: var(--font-display); font-weight: 900; font-size: 96px; letter-spacing: -0.05em; }
.result-of { font-family: var(--font-display); font-weight: 700; font-size: 26px; color: var(--muted); }
.result-headline { margin-top: 10px; font-family: var(--font-ui); font-weight: 500; font-size: 15px; color: var(--text); max-width: 26ch; }
.note-verdict { position: static; display: inline-block; margin-top: 14px; font-size: 30px; color: var(--cyan); }

.stamp {
  position: absolute; left: 190px; top: 34px; z-index: 2;
  font-family: var(--font-marker); font-weight: 700; font-size: 34px; line-height: 1; letter-spacing: .02em;
  color: var(--pink); padding: 4px 14px; border: 3px solid var(--pink); border-radius: 6px;
  transform: rotate(9deg); opacity: .9;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.9'/><rect width='100%' height='100%' fill='white' opacity='.55'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.9'/><rect width='100%' height='100%' fill='white' opacity='.55'/></svg>");
}

.result-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 0; min-width: 0; }
.result-tile {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 44px 8px 8px; min-height: 64px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(255,255,255,.025);
  animation: rise .4s ease-out both; animation-delay: calc(.2s + var(--i, 0) * 90ms);
}
.result-tile .artwork { width: 48px; height: 48px; flex: none; border-radius: var(--r-sm); }
.result-tile.is-hit { border-color: rgba(92,224,160,.4); }
.result-tile.is-miss { border-color: rgba(255,92,122,.35); }
.result-tile .result-mark { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); width: 28px; height: 28px; }
.result-tile .result-text { line-height: 1.2; min-width: 0; }
.result-tile .result-song { font-weight: 600; font-size: 14px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-tile .result-artist { font-size: 12px; color: var(--muted); }

.receipt-wrap { margin-top: 28px; padding-top: 18px; border-top: 1px dashed var(--line-strong); }
.receipt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.receipt-head h2 { font-family: var(--font-marker); font-weight: 700; font-size: 26px; }
.receipt-head .muted { font-size: 13px; }
.receipt { display: grid; gap: 6px; font-variant-numeric: tabular-nums; }
.receipt-line { display: flex; align-items: baseline; gap: 8px; font-size: 15px; }
.receipt-label small { display: block; font-size: 12px; color: var(--muted); }
.receipt-dots { flex: 1; border-bottom: 1px dotted var(--line-strong); transform: translateY(-5px); min-width: 24px; }
.receipt-value { font-family: var(--font-display); font-weight: 700; font-size: 15px; min-width: 56px; text-align: right; }
.receipt-line.is-zero .receipt-value { color: var(--muted); }
.receipt-line.is-penalty .receipt-value { color: var(--bad); }
.receipt-total {
  display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; padding-top: 12px;
  border-top: 2px solid var(--text); font-weight: 600;
}
.receipt-total-num { font-family: var(--font-display); font-weight: 900; font-size: 34px; letter-spacing: -0.03em; color: var(--pink); }
.receipt-total-num small { font-family: var(--font-ui); font-weight: 500; font-size: 14px; color: var(--muted); letter-spacing: 0; }
.receipt-session { display: flex; justify-content: space-between; margin-top: 4px; color: var(--muted); font-size: 14px; }

@media (max-width: 720px) {
  .result-top { grid-template-columns: 1fr; }
  .result-big { font-size: 72px; }
  .stamp { font-size: 26px; left: auto; right: 10px; top: 10px; }
  .result-tile .result-mark { top: 50%; right: 10px; width: 26px; height: 26px; }
  .result-card { padding: 26px 18px 22px; }
  .result-tile .result-mark { top: 14px; right: 14px; width: 26px; height: 26px; }
}


/* ---------- How to play: sketch panels ---------- */
.howto { padding: 32px 0 8px; border-top: 1px solid var(--line); }
.howto .section-head { margin-bottom: 18px; align-items: center; }
.howto h2 { font-size: 22px; margin: 0; }
.note-howto { font-size: 22px; color: var(--muted); }
.steps { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding: 10px 0 6px; }
.steps-connector { position: absolute; left: 4%; right: 4%; top: 44px; height: 60px; color: var(--violet); opacity: .55; pointer-events: none; z-index: 0; }
.steps-connector svg { width: 100%; height: 100%; }
.step {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 18px 16px 16px; min-height: 230px;
  border: 1.5px dashed var(--line-strong); border-radius: 6px;
  background: linear-gradient(180deg, rgba(23,16,34,.92), rgba(18,12,27,.92));
  transform: rotate(var(--rot, 0deg));
  transition: transform .18s, border-color .18s;
}
.step:hover { transform: rotate(0deg) translateY(-3px); border-color: var(--pink); }
.step .step-icon { display: none; }
.step-num {
  position: absolute; top: -14px; left: 12px; width: 32px; height: 32px; display: grid; place-items: center;
  font-size: 24px; line-height: 1; color: #1A0510; background: var(--pink); border-radius: 50%;
  box-shadow: 0 0 0 3px var(--bg); transform: rotate(-8deg);
}
.step-art { display: block; width: 64px; height: 64px; color: var(--text); opacity: .92; margin: 4px 0 2px; }
.step-art svg { width: 100%; height: 100%; display: block; }
.step:nth-child(odd) .step-art { color: var(--text); }
.step-title { font-family: var(--font-marker); font-weight: 700; font-size: 30px; line-height: 1; color: var(--pink); margin: 0; letter-spacing: 0; }
.step-body { font-size: 14px; line-height: 1.5; color: var(--text); opacity: .85; margin: 0; }
.step-tag { margin-top: auto; padding-top: 8px; font-family: var(--font-marker); font-weight: 700; font-size: 17px; color: var(--cyan); }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .steps-connector { display: none; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } .step { transform: none; min-height: 0; } }


/* ---------- Listener rank ---------- */
.rank {
  margin-top: 22px; padding: 16px 18px; display: flex; gap: 18px; align-items: center;
  border: 1px dashed var(--pink); border-radius: var(--r-md);
  background: linear-gradient(90deg, rgba(255,79,163,.10), rgba(138,92,255,.06));
}
.rank-meter { display: grid; grid-template-rows: repeat(6, 1fr); gap: 3px; height: 72px; width: 14px; flex: none; }
.rank-meter i { display: block; border-radius: 2px; background: var(--line-strong); order: 0; }
.rank-meter i.is-on { background: var(--pink); box-shadow: 0 0 8px rgba(255,79,163,.5); }
.rank-meter { direction: rtl; transform: scaleY(-1); } /* fill from the bottom */
.rank-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rank-label { font-size: 12px; color: var(--muted); }
.rank-title { font-family: var(--font-marker); font-weight: 700; font-size: 34px; line-height: 1; color: var(--pink); }
.rank-blurb { font-size: 15px; color: var(--text); }
.rank-next { font-size: 13px; color: var(--cyan); margin-top: 2px; }
.slot-num.marker { font-size: 26px; }


/* ---------- Front page: straight to the point ---------- */
.lede { font-size: 19px; color: var(--text); font-weight: 500; max-width: none; }
.step { min-height: 0; padding: 20px 18px 18px; gap: 10px; }
.step-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -0.01em; color: var(--text); margin: 2px 0 0; }
.step-body { font-size: 15px; line-height: 1.4; color: var(--muted); opacity: 1; }
.step-art { width: 56px; height: 56px; margin: 0; }
.step-tag { display: none; }
.note-howto { font-size: 20px; margin-right: 10px; }
.btn { font-weight: 600; }
.chip, .meta b { font-weight: 600; }

/* ---------- Rank reveal overlay ---------- */
.rank-reveal {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; cursor: pointer;
  background: radial-gradient(circle at 50% 45%, rgba(138,92,255,.35), rgba(13,9,18,.94) 60%);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: rr-in .45s ease-out both;
}
.rank-reveal.is-leaving { animation: rr-out .6s ease-in forwards; }
@keyframes rr-in { from { opacity: 0; } }
@keyframes rr-out { to { opacity: 0; transform: scale(1.04); } }
.rr-inner { position: relative; text-align: center; padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.rr-kicker { font-family: var(--font-marker); font-weight: 700; font-size: 28px; color: var(--cyan); animation: rr-up .5s .1s ease-out both; }
.rr-title {
  font-family: var(--font-marker); font-weight: 700; font-size: clamp(56px, 10vw, 110px); line-height: .95; margin: 0;
  color: #FFE3F1; letter-spacing: 0;
  text-shadow: 0 0 12px rgba(255,79,163,.95), 0 0 34px rgba(255,79,163,.7), 0 0 80px rgba(138,92,255,.6);
  animation: rr-pop .7s .2s cubic-bezier(.2,1.4,.4,1) both, rr-flicker 2.4s .9s ease-in-out infinite;
}
.rr-blurb { font-size: 18px; color: var(--text); margin: 0; animation: rr-up .5s .45s ease-out both; }
.rr-meter { display: flex; gap: 6px; margin-top: 8px; }
.rr-meter i { width: 26px; height: 8px; border-radius: 4px; background: var(--line-strong); }
.rr-meter i.is-on { background: var(--pink); box-shadow: 0 0 10px rgba(255,79,163,.8); animation: rr-seg .3s calc(.6s + var(--d)) ease-out both; }
.rr-points { font-family: var(--font-display); font-weight: 900; font-size: 34px; margin: 4px 0 0; color: var(--text); animation: rr-up .5s .5s ease-out both; }
.rr-points small { font-family: var(--font-ui); font-weight: 500; font-size: 15px; color: var(--muted); }
.rr-skip { font-size: 12px; color: var(--muted); margin-top: 14px; animation: rr-up .5s 1.2s ease-out both; }
.rr-star { position: absolute; color: var(--pink); width: 28px; height: 28px; animation: rr-twinkle 1.6s ease-in-out infinite; }
.rr-star-a { left: -30px; top: 30px; color: var(--cyan); }
.rr-star-b { right: -26px; top: 70px; animation-delay: .4s; width: 34px; height: 34px; }
.rr-star-c { left: 12%; bottom: 10px; color: var(--violet); animation-delay: .8s; width: 20px; height: 20px; }
@keyframes rr-up { from { opacity: 0; transform: translateY(10px); } }
@keyframes rr-pop { from { opacity: 0; transform: scale(.6) rotate(-6deg); filter: blur(6px); } }
@keyframes rr-seg { from { opacity: 0; transform: scaleX(.2); } }
@keyframes rr-flicker { 0%, 100% { opacity: 1; } 48% { opacity: .92; } 50% { opacity: .75; } 52% { opacity: .95; } }
@keyframes rr-twinkle { 50% { transform: scale(.7) rotate(20deg); opacity: .6; } }

/* sheet waits behind the overlay, then slides in */
.screen-results.is-waiting .rs { opacity: 0; transform: translateY(16px); }
.screen-results.is-in .rs { animation: rs-in .5s ease-out both; }
@keyframes rs-in { from { opacity: 0; transform: translateY(16px); } }

/* ---------- Results sheet v3 ---------- */
.rs { position: relative; border: 1px solid var(--line-strong); border-radius: 10px; background: #130D1C; padding: 0 0 26px; }
.rs-hero { border-radius: 10px 10px 0 0; overflow: hidden; }
.rs > .tape { z-index: 4; }
.rs-hero {
  position: relative; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: end;
  padding: 34px 30px 26px;
  background:
    radial-gradient(circle at 85% 20%, rgba(69,217,255,.18), transparent 45%),
    linear-gradient(120deg, #3A1450 0%, #2A1240 45%, #1A1030 100%);
  border-bottom: 1px solid var(--line-strong);
}
.rs-hero.is-perfect { background:
    radial-gradient(circle at 85% 20%, rgba(69,217,255,.22), transparent 45%),
    linear-gradient(120deg, #6A1550 0%, #3A1450 50%, #1F1236 100%); }
.rs-hero::after { /* subtle grooves, like a record */
  content: ""; position: absolute; right: -120px; top: -120px; width: 320px; height: 320px; border-radius: 50%;
  background: repeating-radial-gradient(circle, rgba(255,255,255,.05) 0 1px, transparent 1px 7px);
  pointer-events: none;
}
.rs-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--pink); letter-spacing: .02em; }
.rs-hero .result-count { margin-top: 4px; line-height: .9; }
.rs-hero .result-big { font-size: 110px; }
.rs-hero .result-of { font-size: 30px; color: rgba(244,239,250,.55); }
.rs-headline { margin: 10px 0 0; font-size: 16px; font-weight: 500; color: var(--text); }
.rs-hero-right { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.rank-badge {
  display: flex; flex-direction: column; align-items: flex-end; padding: 12px 16px; border-radius: 10px;
  background: rgba(13,9,18,.55); border: 1px solid rgba(255,79,163,.55);
  box-shadow: 0 0 24px rgba(255,79,163,.25), inset 0 0 18px rgba(255,79,163,.12);
}
.rb-label { font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.rb-title { font-family: var(--font-marker); font-weight: 700; font-size: 32px; line-height: 1; color: #FFE3F1; text-shadow: 0 0 10px rgba(255,79,163,.7); }
.rb-next { font-size: 12px; color: var(--cyan); margin-top: 2px; }
.rs-verdict { font-size: 26px; color: var(--cyan); }
.rs-hero .stamp { left: 210px; right: auto; top: 54px; font-size: 30px; }

.tracklist { list-style: none; margin: 0; padding: 18px 26px 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.track {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; min-width: 0;
  border-radius: 8px; background: rgba(255,255,255,.035); border: 1px solid var(--line);
  animation: rise .4s ease-out both; animation-delay: calc(.15s + var(--i) * 80ms);
}
.track::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--c); box-shadow: 0 0 8px var(--c); }
.track.is-miss { opacity: .8; border-color: rgba(255,92,122,.35); }
.track-n { font-family: var(--font-marker); font-weight: 700; font-size: 22px; color: var(--c); width: 14px; text-align: center; }
.track .artwork { width: 52px; height: 52px; border-radius: 6px; flex: none; }
.track-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.track-title { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-artist { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-time { font-family: var(--font-marker); font-weight: 700; font-size: 18px; color: var(--muted); white-space: nowrap; }
.track.is-miss .track-time { color: var(--bad); }
.track .result-mark { width: 26px; height: 26px; flex: none; }
.track.is-hit .result-mark { background: rgba(92,224,160,.15); color: var(--ok); }
.track.is-miss .result-mark { background: rgba(255,92,122,.15); color: var(--bad); }

.sb { margin: 18px 26px 0; padding: 18px 20px; border-radius: 10px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.sb-head { display: flex; justify-content: space-between; align-items: center; }
.sb-label { font-family: var(--font-marker); font-weight: 700; font-size: 24px; }
.sb-total-num { font-family: var(--font-display); font-weight: 900; font-size: 44px; letter-spacing: -0.03em; color: var(--pink); text-shadow: 0 0 18px rgba(255,79,163,.35); }
.sb-total small { font-size: 14px; color: var(--muted); }
.score-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin: 12px 0 14px; background: var(--line); }
.score-seg { width: var(--w); background: var(--c); transform-origin: left; animation: seg-in .6s ease-out both; animation-delay: calc(.4s + var(--i) * 120ms); }
.score-seg + .score-seg { border-left: 2px solid #130D1C; }
@keyframes seg-in { from { transform: scaleX(0); } }
.score-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.score-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px; background: rgba(255,255,255,.05); border: 1px solid var(--line-strong); font-size: 13px; }
.score-chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.score-chip b { font-family: var(--font-display); font-weight: 700; font-size: 13px; }
.score-chip.is-zero { opacity: .45; }
.score-chip.is-penalty i { background: var(--bad); }
.score-chip.is-penalty b { color: var(--bad); }
.sb-meta { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }
.rs > .small, .rs > .result-actions { margin-left: 26px; margin-right: 26px; }

@media (max-width: 760px) {
  .rs-hero { grid-template-columns: 1fr; padding: 28px 18px 20px; }
  .rs-hero-right { align-items: flex-start; }
  .rank-badge { align-items: flex-start; }
  .rs-hero .result-big { font-size: 84px; }
  .rs-hero .stamp { right: 14px; top: 14px; }
  .tracklist { grid-template-columns: 1fr; padding: 16px 14px 4px; }
  .sb { margin: 16px 14px 0; }
  .rs > .small, .rs > .result-actions { margin-left: 14px; margin-right: 14px; }
}
@media (prefers-reduced-motion: reduce) { .rr-title { animation: none; } }


/* ---------- Listen back ---------- */
.listen-back { margin: 18px 26px 0; padding: 16px 18px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: linear-gradient(90deg, rgba(138,92,255,.12), rgba(69,217,255,.06)); }
.listen-back.is-playing { border-color: var(--violet); box-shadow: 0 0 22px rgba(138,92,255,.25); }
.lb-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.lb-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.lb-note { font-size: 20px; color: var(--cyan); }
.lb-row { display: flex; align-items: center; gap: 14px; }
.lb-play { width: 46px; height: 46px; }
.lb-progress { flex: 1; }
.lb-hint { display: block; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.track { cursor: pointer; transition: opacity .2s, border-color .2s, transform .15s; }
.track:hover { border-color: var(--c); }
.track:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.track.is-solo { border-color: var(--c); box-shadow: 0 0 18px color-mix(in srgb, var(--c) 35%, transparent); transform: translateY(-1px); }
.track.is-solo .track-time::after { content: " · on"; color: var(--c); }
.track.is-muted { opacity: .4; }
@media (max-width: 760px) { .listen-back { margin: 16px 14px 0; } .lb-head { flex-direction: column; gap: 2px; } }

/* ---------- Louder lock-in feedback ---------- */
.slot.is-correct .slot-pick {
  border: 2px solid #3DF29A;
  background: linear-gradient(90deg, rgba(61,242,154,.32), rgba(61,242,154,.10));
  box-shadow: 0 0 0 1px rgba(61,242,154,.25), 0 0 22px rgba(61,242,154,.35);
  animation: lock-ok .45s cubic-bezier(.2,1.5,.4,1);
}
.slot.is-correct .slot-num.marker { color: #0D0912; background: #3DF29A; border: 0; box-shadow: 0 0 14px rgba(61,242,154,.6); }
.slot.is-correct .slot-verdict { color: #3DF29A; font-size: 15px; }
.slot.is-correct .slot-mark { background: #3DF29A; color: #0D0912; box-shadow: 0 0 12px rgba(61,242,154,.7); }
.slot.is-wrong .slot-pick {
  border: 2px solid #FF3B5C;
  background: linear-gradient(90deg, rgba(255,59,92,.38), rgba(255,59,92,.12));
  box-shadow: 0 0 0 1px rgba(255,59,92,.25), 0 0 22px rgba(255,59,92,.4);
  animation: shake .36s ease-out;
}
.slot.is-wrong .slot-num.marker { color: #0D0912; background: #FF3B5C; border: 0; box-shadow: 0 0 14px rgba(255,59,92,.6); }
.slot.is-wrong .slot-verdict { color: #FF6B83; font-size: 15px; }
.slot.is-wrong .slot-mark { background: #FF3B5C; color: #0D0912; box-shadow: 0 0 12px rgba(255,59,92,.7); }
@keyframes lock-ok { 0% { transform: scale(.97); } 55% { transform: scale(1.015); } 100% { transform: none; } }

/* listen-back waveform: same band, read-only */
.reveal-band.is-static { height: 170px; padding-bottom: 0; margin: 4px 0 12px; }
.reveal-band.is-static canvas { height: 170px; }
.reveal-band.is-static .reveal-handle, .reveal-band.is-static .reveal-ticks { display: none; }
.slot.is-wrong .slot-verdict { white-space: nowrap; }
@media (max-width: 720px) { .reveal-band.is-static, .reveal-band.is-static canvas { height: 120px; } .slot.is-wrong .slot-verdict { white-space: normal; font-size: 13px; text-align: right; } }

/* ---------- High score ---------- */
.meta-best b { color: var(--gold); }
.best-line { margin: 8px 0 0; font-size: 14px; color: rgba(244,239,250,.75); }
.best-line b { color: var(--gold); font-weight: 600; }
.best-line.is-record { color: var(--text); }
.best-badge {
  display: inline-block; margin-right: 6px; padding: 3px 10px; border-radius: 999px;
  font-family: var(--font-display); font-weight: 700; font-size: 13px; color: #1A1206;
  background: var(--gold); box-shadow: 0 0 16px rgba(255,200,87,.6);
  animation: best-pulse 1.6s ease-in-out infinite;
}
@keyframes best-pulse { 50% { box-shadow: 0 0 26px rgba(255,200,87,.9); transform: scale(1.04); } }
.rr-record {
  font-family: var(--font-marker); font-weight: 700; font-size: 30px; color: var(--gold);
  text-shadow: 0 0 14px rgba(255,200,87,.8); animation: rr-pop .6s 1s cubic-bezier(.2,1.4,.4,1) both;
}
@media (prefers-reduced-motion: reduce) { .best-badge { animation: none; } }


/* ---------- SquirmyWorms ---------- */
.wordmark-stack { display: inline-flex; flex-direction: column; line-height: .86; }
.wordmark-stack > span:last-child { margin-left: .9em; }
.wordmark-xl .wordmark-text { font-size: clamp(54px, 10vw, 104px); }
.wordmark-sm .wordmark-text { font-size: 17px; letter-spacing: -0.02em; }

/* crawling worms behind the hero */
.hero-worms { position: absolute; inset: 0 -40px; z-index: 0; pointer-events: none; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.crawl { position: absolute; display: block; width: 130px; animation: crawl linear infinite; }
.crawl .worm svg { display: block; width: 100%; height: auto; overflow: visible; }
.crawl-1 { top: 89%; width: 150px; animation-duration: 26s; animation-delay: -4s; }
.crawl-2 { top: 0; width: 128px; animation-duration: 32s; animation-delay: -12s; }
.crawl-3 { top: 0; width: 118px; animation-duration: 38s; animation-delay: -27s; }
.crawl-4 { top: 86%; width: 140px; animation-duration: 29s; animation-delay: -9s; }
@keyframes crawl { from { transform: translateX(-180px); } to { transform: translateX(calc(100vw + 40px)); } }

/* mascot peeking over the cassette */
.hero-object { position: relative; }
.mascot { position: absolute; z-index: 2; right: -6px; top: 40px; width: 104px; display: block; transform: rotate(8deg); }
.mascot svg { display: block; width: 100%; height: auto; overflow: visible; }
.mascot-body { transform-origin: 60px 140px; animation: bob .9s ease-in-out infinite alternate; }
.mascot-notes { animation: notes 2.2s ease-in-out infinite; }
.hero-object .cassette { position: relative; z-index: 1; }
@keyframes bob { from { transform: rotate(-4deg) translateY(2px); } to { transform: rotate(5deg) translateY(-3px); } }
@keyframes notes { 0% { opacity: 0; transform: translateY(6px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }

@media (max-width: 720px) {
  .mascot { width: 80px; right: -12px; top: 22px; }
  .crawl { width: 96px !important; }
  .crawl-2, .crawl-3 { top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .crawl { animation: none; left: 10%; }
  .crawl-2 { left: 55%; } .crawl-3 { left: 30%; } .crawl-4 { left: 70%; }
  .mascot-body, .mascot-notes { animation: none; }
}

/* ---------- Rank looks: each rank glows its own colour, with its own worm ---------- */
.rank-reveal {
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rk, #8A5CFF) 40%, transparent), rgba(13,9,18,.95) 62%);
}
.rr-inner { gap: 6px; }
.rr-worm { width: 140px; margin-bottom: -6px; animation: rr-drop .8s .05s cubic-bezier(.2,1.5,.4,1) both; filter: drop-shadow(0 0 22px color-mix(in srgb, var(--rk) 60%, transparent)); }
.rr-worm svg, .rb-worm svg { display: block; width: 100%; height: auto; overflow: visible; }
@keyframes rr-drop { from { opacity: 0; transform: translateY(-60px) scale(.6) rotate(-10deg); } }
.rr-kicker {
  font-family: 'Neonderthaw', var(--font-marker); font-weight: 400; font-size: 54px; line-height: 1; color: #fff;
  text-shadow: 0 0 6px var(--rk), 0 0 18px var(--rk), 0 0 36px var(--rk);
}
.rr-title {
  font-family: 'Tilt Neon', var(--font-display); font-weight: 400; font-size: clamp(46px, 9vw, 100px); line-height: 1;
  color: color-mix(in srgb, var(--rk) 22%, #fff); max-width: 14ch; text-wrap: balance;
  text-shadow: 0 0 3px #fff, 0 0 10px var(--rk), 0 0 22px var(--rk), 0 0 46px var(--rk), 0 0 90px var(--rk), 0 0 140px var(--rk);
  animation: rr-pop .7s .25s cubic-bezier(.2,1.4,.4,1) both, rr-flicker 2.4s 1s ease-in-out infinite, rr-tilt 3.2s 1s ease-in-out infinite alternate;
}
@keyframes rr-tilt { from { font-variation-settings: "XROT" -25, "YROT" 0; } to { font-variation-settings: "XROT" 25, "YROT" 10; } }
.rr-blurb { font-size: 17px; color: rgba(244,239,250,.85); }
.rr-meter i.is-on { background: var(--rk); box-shadow: 0 0 10px var(--rk), 0 0 2px #fff; }
.rr-points { font-family: 'Tilt Neon', var(--font-display); font-weight: 400; font-size: 40px; color: #fff; text-shadow: 0 0 10px var(--rk); }
.rr-star { color: var(--rk) !important; }

/* results hero picks up the rank colour */
.rs-hero {
  background:
    radial-gradient(circle at 82% 40%, color-mix(in srgb, var(--rk) 34%, transparent), transparent 52%),
    linear-gradient(120deg, color-mix(in srgb, var(--rk) 26%, #1A1030) 0%, #22123A 55%, #160E26 100%);
}
.rs-hero.is-perfect { background:
    radial-gradient(circle at 82% 40%, color-mix(in srgb, var(--rk) 45%, transparent), transparent 55%),
    linear-gradient(120deg, color-mix(in srgb, var(--rk) 40%, #1A1030) 0%, #2A1240 55%, #160E26 100%); }
.rs-title { color: var(--rk); }
.rs-verdict { color: var(--rk); }
.rank-badge {
  display: grid; grid-template-columns: 74px auto; grid-template-rows: auto auto auto; column-gap: 12px; align-items: center;
  text-align: left; padding: 12px 18px 12px 10px; border-radius: 14px;
  background: rgba(13,9,18,.6); border: 2px solid var(--rk);
  box-shadow: 0 0 6px var(--rk), 0 0 26px color-mix(in srgb, var(--rk) 55%, transparent), inset 0 0 18px color-mix(in srgb, var(--rk) 30%, transparent);
  animation: badge-buzz 3s 1s ease-in-out infinite;
}
@keyframes badge-buzz { 0%, 100% { box-shadow: 0 0 6px var(--rk), 0 0 26px color-mix(in srgb, var(--rk) 55%, transparent), inset 0 0 18px color-mix(in srgb, var(--rk) 30%, transparent); }
  50% { box-shadow: 0 0 10px var(--rk), 0 0 40px color-mix(in srgb, var(--rk) 70%, transparent), inset 0 0 24px color-mix(in srgb, var(--rk) 40%, transparent); } }
.rb-worm { grid-row: 1 / 4; width: 74px; margin: -34px 0 -8px; }
.rb-label { color: rgba(244,239,250,.7); }
.rb-title {
  font-family: 'Tilt Neon', var(--font-display); font-weight: 400; font-size: 30px; line-height: 1.05;
  color: color-mix(in srgb, var(--rk) 20%, #fff); max-width: 11ch;
  text-shadow: 0 0 2px #fff, 0 0 8px var(--rk), 0 0 20px var(--rk), 0 0 40px var(--rk);
}
.rb-next { color: var(--rk); }

/* tracklist: a little worm head per song, dizzy if missed */
.track::before { display: none; }
.track-n { width: 40px; flex: none; }
.worm-head-mini { display: block; width: 40px; }
.worm-head-mini svg { display: block; width: 100%; height: auto; overflow: visible; }
.track.is-miss .worm-head-mini { filter: saturate(.6); }

/* score bar is a worm: ringed body, head at the end */
.score-worm { display: flex; align-items: center; margin: 12px 0 14px; }
.score-worm .score-bar { position: relative; flex: 1; height: 22px; margin: 0; border-radius: 11px; border: 2.5px solid #22122E; box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
.score-worm .score-bar::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 15px, rgba(34,18,46,.45) 15px 17px),
              linear-gradient(180deg, rgba(255,255,255,.35), transparent 45%); }
.score-worm .score-seg + .score-seg { border-left: 0; }
.score-worm-head { width: 50px; margin-left: -14px; position: relative; z-index: 1; transform-origin: 30% 80%; animation: head-wag 1.4s ease-in-out infinite alternate; }
@keyframes head-wag { from { transform: rotate(-6deg); } to { transform: rotate(8deg) translateY(-2px); } }
.wk-twinkle { animation: rr-twinkle 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.wk-float { animation: wk-float 2.4s ease-in-out infinite alternate; }
@keyframes wk-float { to { transform: translateY(-6px); } }

@media (max-width: 760px) {
  .rank-badge { grid-template-columns: 62px auto; }
  .rb-worm { width: 62px; }
  .rb-title { font-size: 26px; }
  .rr-worm { width: 110px; }
  .rr-kicker { font-size: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  .rr-worm, .rank-badge, .score-worm-head, .wk-twinkle, .wk-float { animation: none; }
}
/* results tweaks: bigger worms, neon totals */
.rank-badge { grid-template-columns: 92px auto; transform: rotate(-1.5deg); }
.rb-worm { width: 92px; margin: -46px 0 -10px; filter: drop-shadow(0 0 12px color-mix(in srgb, var(--rk) 50%, transparent)); }
.rs-verdict.note, .rs-verdict { font-family: 'Neonderthaw', var(--font-marker); font-size: 44px; line-height: 1; color: #fff;
  text-shadow: 0 0 6px var(--rk), 0 0 16px var(--rk); }
.track-n, .worm-head-mini { width: 46px; }
.sb-total-num { font-family: 'Tilt Neon', var(--font-display); font-weight: 400; font-size: 54px; letter-spacing: 0;
  color: color-mix(in srgb, var(--rk) 22%, #fff); text-shadow: 0 0 3px #fff, 0 0 12px var(--rk), 0 0 30px var(--rk); }
.score-worm-head { width: 66px; margin-left: -18px; margin-top: -14px; }
@media (max-width: 760px) {
  .rank-badge { grid-template-columns: 74px auto; }
  .rb-worm { width: 74px; margin-top: -36px; }
}

/* ---------- Play screen: neon readout, bonus meter, scrubbable playhead ---------- */
.unlock-line { align-items: baseline; gap: 10px; }
.unlock-value {
  font-family: 'Tilt Neon', var(--font-display); font-weight: 400; font-size: 66px; line-height: .95; letter-spacing: 0;
  color: #FFE3F1; font-variant-numeric: tabular-nums;
  text-shadow: 0 0 2px #fff, 0 0 10px var(--pink), 0 0 26px var(--pink), 0 0 54px rgba(255,79,163,.6);
}
.unlock-s { font-size: .48em; margin-left: 3px; color: var(--pink); text-shadow: 0 0 10px var(--pink); }
.unlock-of { font-family: var(--font-marker); font-weight: 700; font-size: 22px; color: var(--muted); }
.reveal-band.is-bump ~ * .unlock-value, .mixer.is-bump .unlock-value { animation: rr-flicker .4s; }

.bonus {
  position: relative; display: inline-flex; align-items: center; gap: 10px; margin-top: 12px; max-width: 100%;
  padding: 7px 16px 7px 8px; border-radius: 16px;
  background: linear-gradient(100deg, rgba(255,200,87,.14), rgba(255,200,87,.03));
  border: 1.5px solid rgba(255,200,87,.5); box-shadow: 0 0 18px rgba(255,200,87,.15);
  transition: border-color .3s, box-shadow .3s, background .3s;
}
.bonus-worm { width: 44px; flex: none; margin-top: -10px; }
.bonus-worm .worm-head-mini { width: 44px; }
.bonus-text { display: flex; flex-direction: column; min-width: 0; }
.bonus-line { display: flex; align-items: baseline; gap: 2px; white-space: nowrap; }
.bonus-pts { font-family: 'Tilt Neon', var(--font-display); font-weight: 400; font-size: 28px; line-height: 1; color: #FFF1CF;
  text-shadow: 0 0 2px #fff, 0 0 10px var(--gold), 0 0 22px var(--gold); }
.bonus-label { font-size: 13px; color: rgba(244,239,250,.85); }
.bonus-pips { display: flex; gap: 3px; margin: 6px 0 4px; }
.bonus-pips i { width: 16px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.12); transition: background .3s, box-shadow .3s; }
.bonus-pips i.is-on { background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.bonus-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bonus.is-low { border-color: rgba(255,92,122,.55); background: linear-gradient(100deg, rgba(255,92,122,.14), rgba(255,92,122,.03)); box-shadow: 0 0 18px rgba(255,92,122,.15); }
.bonus.is-low .bonus-pips i.is-on { background: var(--bad); box-shadow: 0 0 6px var(--bad); }
.bonus.is-drop { animation: bonus-drop .45s ease-out; }
@keyframes bonus-drop { 20% { transform: translateX(-4px) rotate(-1deg); } 45% { transform: translateX(4px) rotate(1deg); } 70% { transform: translateX(-2px); } }
.bonus-ghost { position: absolute; right: 12px; top: -4px; font-family: 'Tilt Neon', var(--font-display); font-size: 20px; color: var(--bad);
  text-shadow: 0 0 10px var(--bad); pointer-events: none; animation: ghost-up .9s ease-out forwards; }
@keyframes ghost-up { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-22px); } }

.reveal-band.can-scrub canvas { cursor: grab; }
.reveal-band.is-scrubbing canvas { cursor: grabbing; }
.reveal-band.is-static canvas { cursor: pointer; }

@media (max-width: 720px) {
  .unlock-value { font-size: 50px; }
  .unlock-of { font-size: 19px; }
  .bonus-label { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { .bonus.is-drop, .bonus-ghost { animation: none; } }

/* ---------- How to play: four worms acting out each step ---------- */
.steps-worms { gap: 18px; padding-top: 6px; }
.steps-worms .step {
  position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 0;
  padding: 0 0 20px; border-radius: 16px; overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--c) 55%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 20%, #150F1E) 0%, #150F1E 72%);
  box-shadow: 0 0 22px color-mix(in srgb, var(--c) 14%, transparent);
  transform: rotate(var(--rot, 0deg)); transition: transform .2s, box-shadow .2s;
}
.steps-worms .step:hover { transform: rotate(0deg) translateY(-4px); border-color: var(--c); box-shadow: 0 0 30px color-mix(in srgb, var(--c) 30%, transparent); }
.step-stage { position: relative; height: 138px; display: grid; place-items: end center; padding-bottom: 6px;
  background: radial-gradient(ellipse 60% 70% at 50% 100%, color-mix(in srgb, var(--c) 32%, transparent), transparent 70%); }
.step-worm { display: block; width: 92px; }
.step-worm svg { display: block; width: 100%; height: auto; overflow: visible; }
.steps-worms .step-num {
  position: absolute; left: 16px; top: 8px; padding: 0; background: none; border: 0; box-shadow: none; width: auto; height: auto;
  font-family: 'Tilt Neon', var(--font-display); font-weight: 400; font-size: 44px; line-height: 1; color: #fff;
  text-shadow: 0 0 2px #fff, 0 0 10px var(--c), 0 0 22px var(--c);
}
.steps-worms .step-title { padding: 0 18px; margin: 4px 0 0; font-family: var(--font-display); font-weight: 700; font-size: 19px; color: var(--c); }
.steps-worms .step-body { padding: 0 18px; margin: 0; font-size: 14.5px; line-height: 1.4; color: rgba(244,239,250,.82); }
.wk-shake { animation: wk-shake 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 0; }
@keyframes wk-shake { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(-10deg); } 84% { transform: rotate(9deg); } 92% { transform: rotate(-4deg); } }
.wk-zzz text { animation: zzz 2.6s ease-in-out infinite; }
.wk-zzz text:nth-child(2) { animation-delay: .35s; } .wk-zzz text:nth-child(3) { animation-delay: .7s; }
@keyframes zzz { 0% { opacity: 0; transform: translateY(4px); } 30%, 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-6px); } }

/* ---------- Mix tiles: little cassettes ---------- */
.tiles { padding-top: 34px; gap: 18px; }
.tile, .tile:hover:not(:disabled), .tile.is-selected {
  display: flex; flex-direction: column; gap: 10px; padding: 0; overflow: visible; text-align: left;
  background: none; border: 0; box-shadow: none; opacity: 1;
}
.tile.is-soon { opacity: 1; cursor: default; }
.tile:hover:not(:disabled) { transform: rotate(0deg) translateY(-4px); }
.cas {
  position: relative; display: block; aspect-ratio: 1.58; border-radius: 12px; padding: 9% 7% 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(255,255,255,.28), transparent 50%),
    linear-gradient(160deg, var(--tile-accent), color-mix(in srgb, var(--tile-accent) 55%, #1A1030));
  border: 2.5px solid #22122E; box-shadow: 0 5px 0 #22122E;
  transition: box-shadow .25s, filter .25s;
}
.tile.is-selected .cas { box-shadow: 0 5px 0 #22122E, 0 0 0 3px color-mix(in srgb, var(--tile-accent) 60%, #fff), 0 0 30px var(--tile-accent); }
.tile.is-soon .cas { filter: saturate(.3) brightness(.62); }
.cas-label {
  display: flex; align-items: center; gap: 8px; height: 36%; padding: 10% 10px 0; border-radius: 6px; transform: rotate(-1deg);
  background:
    linear-gradient(var(--tile-accent), var(--tile-accent)) top / 100% 18% no-repeat,
    #FFF4DE;
  border: 2px solid #22122E; color: #22122E; overflow: hidden;
}
.cas-icon { display: grid; place-items: center; width: 22px; height: 22px; flex: none; color: #22122E; }
.cas-icon svg { width: 100%; height: 100%; }
.cas-name { font-family: 'Permanent Marker', var(--font-marker); font-size: clamp(14px, 1.5vw, 19px); line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cas-window {
  display: flex; align-items: center; gap: 4px; width: 66%; height: 28%; margin: 7% auto 0; padding: 0 5px;
  border-radius: 999px; background: #1A1026; border: 2px solid #22122E; box-shadow: inset 0 0 0 2px rgba(255,255,255,.06);
}
.cas-reel { width: 24%; aspect-ratio: 1; max-width: 26px; color: #F4EFFA; flex: none; }
.cas-reel svg { display: block; width: 100%; height: 100%; }
.tile.is-selected .cas-reel svg, .tile:hover:not(:disabled) .cas-reel svg { animation: spin 2.4s linear infinite; }
.cas-tape { flex: 1; height: 46%; border-radius: 6px; background: linear-gradient(90deg, #5A3B2C, #3E2A22 50%, #5A3B2C); }
.cas-foot { position: absolute; left: 24%; right: 24%; bottom: 0; height: 13%; background: rgba(13,9,18,.35);
  border: 2px solid #22122E; border-bottom: 0; clip-path: polygon(9% 0, 91% 0, 100% 100%, 0 100%); }
.cas-screw { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #22122E; box-shadow: inset 1px 1px 0 rgba(255,255,255,.3); }
.cas-screw-tl { left: 6px; top: 6px; } .cas-screw-tr { right: 6px; top: 6px; }
.cas-screw-bl { left: 6px; bottom: 6px; } .cas-screw-br { right: 6px; bottom: 6px; }
.tile-worm { position: absolute; right: 8%; top: -50px; width: 50px; z-index: 2; pointer-events: none; }
.tile-worm svg { display: block; width: 100%; height: auto; overflow: visible; }
.tile.is-soon .tile-worm { filter: saturate(.55); }
.tile.is-soon .tile-worm .mascot-body { animation: none; }
.tile-meta { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 4px 0; }
.tile-status { font-family: var(--font-marker); font-weight: 700; font-size: 18px; color: var(--muted); }
.tile.is-selected .tile-status { color: var(--tile-accent); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .wk-shake, .wk-zzz text, .tile .cas-reel svg { animation: none !important; }
}
.tiles-compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tiles-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { min-width: 0; }
@media (max-width: 900px) { .tiles-compact, .tiles-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.step-stage { justify-items: start; padding-left: 30%; }
.step-worm { margin-left: -14px; }
/* fifth worm: green, in the top lane */
.crawl-5 { top: 0; width: 112px; animation-duration: 35s; animation-delay: -20s; }
@media (max-width: 720px) { .crawl-5 { top: 88%; } }
@media (prefers-reduced-motion: reduce) { .crawl-5 { left: 85%; } }

/* ---------- Wordmark: rounder, smaller, squirmy ---------- */
.wordmark-text { font-family: 'Chewy', var(--font-display); font-weight: 400; letter-spacing: .01em; text-transform: none; }
.wordmark-sm .wordmark-text { font-size: 22px; letter-spacing: .02em; text-shadow: 1.5px 1.5px 0 var(--pink), 3px 3px 0 var(--violet-deep); }
.wordmark-xl .wordmark-text { font-size: clamp(50px, 8.4vw, 92px); line-height: 1; text-shadow: 3px 3px 0 var(--pink), 6px 6px 0 var(--violet-deep); }
.wordmark-wiggle { display: inline-flex; }
.wordmark-wiggle > span { display: inline-block; animation: letter-wiggle 2.6s ease-in-out infinite; animation-delay: calc(var(--i) * -0.18s); }
@keyframes letter-wiggle { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-5px) rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { .wordmark-wiggle > span { animation: none; } }

/* ---------- Play screen: full mix + round timer ---------- */
.timer-line { display: flex; align-items: baseline; gap: 12px; line-height: 1; }
.timer-num {
  font-family: 'Tilt Neon', var(--font-display); font-weight: 400; font-size: 66px; line-height: .95; letter-spacing: 0;
  color: #FFE3F1; font-variant-numeric: tabular-nums; min-width: 3.1ch;
  text-shadow: 0 0 2px #fff, 0 0 10px var(--pink), 0 0 26px var(--pink), 0 0 54px rgba(255,79,163,.6);
}
.timer-num.is-tick { animation: rr-flicker .5s; }
.timer-label { font-family: var(--font-marker); font-weight: 700; font-size: 22px; color: var(--muted); }
.reveal-band.is-full { height: 200px; padding-bottom: 0; }
.reveal-band.is-full .reveal-handle, .reveal-band.is-full .reveal-ticks { display: none; }
.mix-axis { display: flex; justify-content: space-between; padding: 6px 14px 0; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .timer-num { font-size: 50px; } .timer-label { font-size: 19px; } }
.wordmark-text { transform: none; }

/* ---------- Hero: friendlier type, worms kept clear of the title ---------- */
.hero { padding-top: 78px; padding-bottom: 64px; }
.hero-worms .crawl-2, .hero-worms .crawl-3, .hero-worms .crawl-5 { top: 8px !important; }
.hero-worms .crawl-1, .hero-worms .crawl-4 { top: auto !important; bottom: 6px; }
.tagline {
  font-family: 'Fredoka', var(--font-display); font-weight: 800; letter-spacing: 0; font-size: clamp(28px, 4vw, 42px); line-height: 1.1;
}
.lede {
  font-family: 'Fredoka', var(--font-ui); font-weight: 500;
  font-size: clamp(17px, 1.8vw, 21px); color: rgba(244,239,250,.85);
}
.section-head h2 {
  font-family: 'Fredoka', var(--font-display); font-weight: 800; letter-spacing: 0; font-size: clamp(24px, 3vw, 32px);
}

/* ---------- Mix cards: Pop (bubblegum) and K-pop (holographic concert) ---------- */
.tiles-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; padding-top: 6px; }
.mix-card {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 20px;
  min-height: 270px; padding: 64px 26px 28px; border-radius: 24px; overflow: hidden; text-align: left;
  border: 2.5px solid #22122E; box-shadow: 0 6px 0 #22122E; color: #fff; cursor: pointer;
  transition: transform .2s, box-shadow .25s;
}
.mix-card:hover:not(:disabled) { transform: translateY(-4px) rotate(-.5deg); }
.mix-card.is-selected { box-shadow: 0 6px 0 #22122E, 0 0 0 3px #fff, 0 0 40px var(--tile-accent); }
.mix-card:disabled { cursor: default; }
.mix-card:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.mix-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.mix-art { position: relative; z-index: 1; }
.mix-art .cas { width: 100%; }
.mix-card .tile-worm { position: absolute; right: 12%; top: -56px; width: 58px; z-index: 2; }
.mix-card .tile-worm svg { display: block; width: 100%; height: auto; overflow: visible; }
.mix-card.is-selected .cas-reel svg, .mix-card:hover:not(:disabled) .cas-reel svg { animation: spin 2.4s linear infinite; }
.mix-text { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; }
.mix-name { line-height: .95; }
.mix-blurb { font-family: 'Fredoka', var(--font-ui); font-weight: 600; font-size: 15.5px; line-height: 1.35; }
.mix-status { align-self: flex-start; margin-top: 4px; padding: 6px 13px; border-radius: 999px;
  font-family: 'Fredoka', var(--font-ui); font-weight: 700; font-size: 14px; }
.sticker { position: absolute; z-index: 3; display: grid; place-items: center; line-height: 1; pointer-events: none; }

/* Pop: glossy bubblegum, floating bubbles, stickers */
.theme-pop {
  background:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.45), transparent 28%),
    linear-gradient(135deg, #FF4FA3 0%, #FF7F7F 55%, #FFC857 100%);
}
.theme-pop .cas { background: linear-gradient(160deg, #3A1430, #22102E); }
.theme-pop .mix-name { font-family: 'Chewy', var(--font-display); font-size: clamp(48px, 5.6vw, 72px); color: #fff;
  text-shadow: 3px 3px 0 #22122E, 6px 6px 0 rgba(34,18,46,.35); }
.theme-pop .mix-blurb { color: #2A0E22; }
.theme-pop .mix-status { background: #22122E; color: #fff; }
.mix-bubbles i {
  position: absolute; bottom: -50px; left: calc(var(--i) * 14% + 2%); width: calc(14px + var(--i) * 6px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, rgba(255,255,255,.95), rgba(255,255,255,.25) 30%, rgba(255,255,255,.06) 70%);
  border: 1.5px solid rgba(255,255,255,.65);
  animation: bubble-up calc(7s + var(--i) * 1.1s) linear infinite; animation-delay: calc(var(--i) * -1.9s);
}
@keyframes bubble-up { 0% { transform: translate(0, 0); opacity: 0; } 10% { opacity: 1; } 100% { transform: translate(24px, -360px); opacity: 0; } }
.sticker-heart { left: -6px; top: -14px; width: 40px; height: 40px; border-radius: 50%; background: #fff; color: #FF2E7E;
  font-size: 24px; border: 2.5px solid #22122E; transform: rotate(-14deg); }
.sticker-star { left: 30%; bottom: -14px; width: 36px; height: 36px; border-radius: 50%; background: #FFC857; color: #22122E;
  font-size: 20px; border: 2.5px solid #22122E; transform: rotate(10deg); }

/* K-pop: holographic card, shimmer sweep, a crowd of lightsticks */
.theme-kpop {
  background: linear-gradient(125deg, #2A1556 0%, #1B2A5E 38%, #3A1557 70%, #12233F 100%);
}
.theme-kpop .mix-bg::after {
  content: ""; position: absolute; inset: 0; mix-blend-mode: screen; opacity: .9;
  background: linear-gradient(115deg, transparent 18%, rgba(255,140,220,.28) 32%, rgba(140,220,255,.28) 44%, rgba(190,255,200,.2) 56%, transparent 72%);
  background-size: 260% 100%; animation: holo 7s ease-in-out infinite alternate;
}
@keyframes holo { from { background-position: 100% 0; } to { background-position: 0 0; } }
.theme-kpop .cas { background: linear-gradient(135deg, #C3B0FF, #96E3FF 50%, #FFB8E8); }
.theme-kpop .mix-name { font-family: 'Tilt Neon', var(--font-display); font-size: clamp(46px, 5.4vw, 68px); color: #F3EAFF;
  text-shadow: 0 0 2px #fff, 0 0 10px #A98CFF, 0 0 24px #A98CFF, 0 0 46px #8A5CFF; }
.theme-kpop .mix-blurb { color: #DCD2F0; }
.theme-kpop .mix-status { border: 1.5px solid #C9A8FF; color: #F3EAFF; box-shadow: 0 0 12px rgba(169,140,255,.5); }
.mix-crowd { position: absolute; left: 0; right: 0; bottom: 0; height: 56px; }
.mix-crowd i {
  position: absolute; left: calc(var(--i) * 4.6% + 1%); bottom: 10px; width: 7px; height: 7px; border-radius: 50%;
  background: #E3C8FF; box-shadow: 0 0 6px #C08BFF, 0 0 14px #8A5CFF;
  animation: crowd-wave 1.4s ease-in-out infinite; animation-delay: calc(var(--i) * -0.11s);
}
.mix-crowd i:nth-child(3n) { bottom: 22px; } .mix-crowd i:nth-child(4n) { bottom: 4px; background: #FFC2E6; box-shadow: 0 0 6px #FF8AD0, 0 0 14px #FF4FA3; }
.mix-crowd i:nth-child(5n) { bottom: 30px; background: #C6F2FF; box-shadow: 0 0 6px #8CE0FF, 0 0 14px #45D9FF; }
@keyframes crowd-wave { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(3px, -8px); } }
.sticker-spark { left: -4px; top: -16px; font-size: 34px; color: #fff; text-shadow: 0 0 10px #C9A8FF, 0 0 20px #8A5CFF; }
.sticker-spark2 { right: -6px; bottom: -10px; font-size: 26px; color: #C6F2FF; text-shadow: 0 0 10px #45D9FF; }
.wk-wave { animation: wk-wave 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 30% 100%; }
@keyframes wk-wave { 0%, 100% { transform: rotate(-12deg); } 50% { transform: rotate(12deg); } }

@media (max-width: 860px) {
  .tiles-duo { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .mix-card { padding: 58px 18px 24px; gap: 14px; min-height: 0; }
  .mix-card .tile-worm { width: 48px; top: -48px; }
  .mix-blurb { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .mix-bubbles i, .mix-crowd i, .theme-kpop .mix-bg::after, .wk-wave { animation: none; }
}
/* cards: art on top, words underneath, so nothing wraps awkwardly */
.mix-card { grid-template-columns: 1fr; gap: 18px; padding: 70px 26px 26px; align-items: start; }
.mix-art { width: 72%; justify-self: center; }
.mix-card .tile-worm { width: 70px; top: -66px; right: 14%; }
.mix-text { display: grid; grid-template-columns: 1fr auto; align-items: end; column-gap: 14px; row-gap: 6px; }
.mix-name { grid-column: 1 / -1; white-space: nowrap; }
.theme-pop .mix-name { font-size: clamp(40px, 4.4vw, 56px); }
.theme-kpop .mix-name { font-size: clamp(38px, 4.2vw, 52px); }
.mix-blurb { align-self: center; }
.mix-status { white-space: nowrap; margin-top: 0; align-self: center; }
.theme-kpop .mix-crowd { height: 46px; }
.theme-kpop .mix-text { margin-bottom: 26px; }
.tagline { font-size: clamp(24px, 3vw, 34px); }
.lede { font-size: clamp(16px, 1.6vw, 19px); }
@media (max-width: 460px) { .mix-art { width: 84%; } .mix-text { grid-template-columns: 1fr; } }
.mix-status { justify-self: start; }
/* Fredoka weights for the hero copy and headings */
.tagline { font-weight: 650; letter-spacing: -0.005em; }
.lede { font-weight: 500; }
.section-head h2 { font-weight: 650; }
.mix-blurb { font-weight: 500; }
.mix-status { font-weight: 600; }

/* ---------- Boomboxes (flat retro) ---------- */
.boombox { display: block; }
.boombox svg { display: block; width: 100%; height: auto; overflow: visible; }
.boombox .bb-cone, .boombox .bb-reel { transform-box: view-box; }
.boombox.is-playing .bb-cone { animation: bb-thump .45s ease-in-out infinite alternate; }
.boombox.is-playing .bb-speaker:last-of-type .bb-cone { animation-delay: -.22s; }
.boombox.is-playing .bb-reel { animation: spin 2.2s linear infinite; }
.boombox.is-playing .bb-led { animation: bb-blink 1s steps(2) infinite; }
.boombox.is-playing .bb-needle { animation: bb-needle 3s ease-in-out infinite alternate; }
@keyframes bb-thump { from { transform: scale(1); } to { transform: scale(1.09); } }
@keyframes bb-blink { 50% { opacity: .35; } }
@keyframes bb-needle { to { transform: translateX(40px); } }
@media (prefers-reduced-motion: reduce) { .boombox * { animation: none !important; } }

/* hero */
.hero-object { position: relative; }
.hero-boombox { width: 300px; transform: rotate(-3deg); }
.hero .mascot { right: -18px; top: -38px; width: 92px; transform: rotate(6deg); }
.play-boombox { width: 150px; transform: rotate(3deg); }
@media (max-width: 720px) { .hero-boombox { width: 240px; } .hero .mascot { width: 74px; right: -12px; top: -30px; } }

/* ---------- Mix cards: flat colours, no gradients ---------- */
.mix-card { padding: 78px 26px 24px; gap: 16px; }
.theme-pop { background: #FF9CC8; }
.theme-kpop { background: #7FD6CC; }
.theme-kpop .mix-bg::after { display: none; }
.mix-art { width: 78%; }
.mix-card .tile-worm { width: 66px; top: -64px; right: 6%; }
.mix-text { grid-template-columns: 1fr auto; align-items: center; }
.mix-name { grid-column: auto; }
.theme-pop .mix-name, .theme-kpop .mix-name {
  font-family: 'Chewy', var(--font-display); font-size: clamp(40px, 4.4vw, 56px); color: #fff;
  text-shadow: 3px 3px 0 #2A1B2E; }
.theme-pop .mix-status, .theme-kpop .mix-status { background: #2A1B2E; color: #fff; border: 0; box-shadow: none; }
.mix-card.is-selected { box-shadow: 0 6px 0 #22122E, 0 0 0 3px #fff, 0 0 30px rgba(255,156,200,.6); }
.sticker-heart { left: -4px; top: 6px; }
.sticker-star { left: auto; right: -6px; bottom: 6px; }
.sticker-spark { left: -2px; top: 0; color: #fff; text-shadow: 2px 2px 0 #2A1B2E; }
.sticker-spark2 { right: -4px; bottom: 4px; color: #FFE066; text-shadow: 2px 2px 0 #2A1B2E; }
@media (max-width: 460px) { .mix-art { width: 88%; } .mix-text { grid-template-columns: 1fr auto; } }

/* ---------- Mix cards: dark, matching the page; accent edge + retro dots ---------- */
.mix-card { border-width: 2px; box-shadow: 0 6px 0 #0A0710; }
.theme-pop {
  --mc: #FF4FA3;
  background-color: #1F1029;
  border-color: rgba(255,79,163,.55);
}
.theme-kpop {
  --mc: #7FD6CC;
  background-color: #0F1F2A;
  border-color: rgba(127,214,204,.5);
}
.mix-card .mix-bg { display: block; }
.mix-card .mix-bg::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(color-mix(in srgb, var(--mc) 28%, transparent) 1.6px, transparent 1.8px);
  background-size: 16px 16px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 38%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 38%, #000 30%, transparent 75%);
}
.theme-pop .mix-name, .theme-kpop .mix-name { color: #F4EFFA; }
.theme-pop .mix-name { text-shadow: 3px 3px 0 #FF4FA3, 6px 6px 0 #5B2BB5; }
.theme-kpop .mix-name { text-shadow: 3px 3px 0 #3FC1B5, 6px 6px 0 #5B2BB5; }
.theme-pop .mix-status { background: #FF4FA3; color: #1F1029; }
.theme-kpop .mix-status { background: transparent; color: #BFF1EA; border: 1.5px solid #7FD6CC; }
.mix-card:hover:not(:disabled) { border-color: var(--mc); }
.mix-card.is-selected { border-color: var(--mc); box-shadow: 0 6px 0 #0A0710, 0 0 0 1px var(--mc), 0 0 32px color-mix(in srgb, var(--mc) 45%, transparent); }
.sticker-spark { color: #BFF1EA; }

/* ---------- Hero worms: one peeker, one occasional wanderer ---------- */
.hero-worms { position: absolute; inset: 0; pointer-events: none; overflow: visible; z-index: 0; }
.peek { position: absolute; bottom: -3px; width: 64px; height: 74px; overflow: hidden; }
.peek::after { /* the hole */
  content: ""; position: absolute; left: 4px; right: 4px; bottom: 0; height: 12px; border-radius: 50%;
  background: #05030A; box-shadow: inset 0 2px 0 rgba(255,255,255,.12), 0 0 0 2px rgba(169,140,255,.25);
  transform: scaleX(0); transition: transform .25s;
}
.peek.is-out::after, .peek.is-still::after { transform: scaleX(1); }
.peek-worm { position: absolute; left: 2px; right: 2px; bottom: -34px; transform: translateY(110%); }
.peek-worm .peek-svg svg { display: block; width: 100%; height: auto; overflow: visible; }
.peek.is-out .peek-worm { animation: peek-pop 3.2s ease-in-out forwards; }
.peek.is-still .peek-worm { transform: translateY(0); }
@keyframes peek-pop {
  0% { transform: translateY(110%); }
  14% { transform: translateY(-4%); }
  20% { transform: translateY(0); }
  35% { transform: translateY(0) rotate(-10deg); }
  55% { transform: translateY(0) rotate(10deg); }
  70% { transform: translateY(0) rotate(0); }
  86% { transform: translateY(0); }
  100% { transform: translateY(110%); }
}
.wanderer { position: absolute; width: 120px; left: 0; animation: wander var(--dur) linear forwards; }
.wanderer .worm svg { display: block; width: 100%; height: auto; }
.wanderer.lane-top { top: 8px; }
.wanderer.lane-bottom { bottom: 6px; }
.wanderer.is-left { animation-name: wander-left; }
.wanderer.is-left .worm { display: block; transform: scaleX(-1); }
@keyframes wander { from { transform: translateX(-140px); } to { transform: translateX(calc(100vw)); } }
@keyframes wander-left { from { transform: translateX(calc(100vw)); } to { transform: translateX(-140px); } }
.hero { overflow: hidden; }
@media (max-width: 720px) { .wanderer { width: 92px; } .peek { width: 52px; height: 60px; } .peek-worm { bottom: -28px; } }
/* peeker v2: head + neck */
.peek { width: 70px; height: 96px; overflow: visible; }
.peek-clip { }
.peek-worm { left: 0; right: 0; bottom: 6px; display: flex; flex-direction: column; align-items: center; transform: translateY(110%);
  clip-path: inset(-60px -40px 0 -40px); }
.peek-worm .worm-head-mini { width: 52px; position: relative; z-index: 1; margin-bottom: -16px; }
.peek-neck { width: 30px; height: 56px; border: 2.4px solid #22122E; border-bottom: 0; border-radius: 14px 14px 0 0;
  background: repeating-linear-gradient(180deg, var(--wc) 0 10px, color-mix(in srgb, var(--wc) 70%, #22122E) 10px 12px); }
.peek::after { left: 6px; right: 6px; height: 14px; bottom: 0; z-index: 2; }
.peek { clip-path: inset(-80px -40px 6px -40px); }
/* wanderer crosses the hero's own width, not the whole viewport */
@keyframes wander { from { left: -130px; } to { left: 100%; } }
@keyframes wander-left { from { left: 100%; } to { left: -130px; } }
.wanderer { transform: none; }

/* ---------- Hero boombox: drifting notes, tap to hype ---------- */
.boombox-btn { position: relative; display: block; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 24px; }
.boombox-btn:focus-visible { outline: 3px solid var(--cyan); outline-offset: 8px; }
.boombox-btn:hover .hero-boombox { transform: rotate(-3deg) scale(1.02); }
.hero-boombox { transition: transform .2s; }
.note-fx-layer { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.note-fx {
  position: absolute; font-weight: 700; line-height: 1; text-shadow: 2px 2px 0 #22122E;
  animation: note-drift var(--dur) ease-out forwards;
}
@keyframes note-drift {
  0% { opacity: 0; transform: translate(0, 0) rotate(0) scale(.6); }
  15% { opacity: 1; transform: translate(calc(var(--dx) * .15), calc(var(--dy) * .15)) rotate(calc(var(--rot) * .3)) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(.9); }
}
.mascot.is-hop { animation: worm-hop .7s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes worm-hop { 0% { transform: rotate(6deg); } 35% { transform: translateY(-34px) rotate(-14deg); } 70% { transform: translateY(0) rotate(10deg); } 100% { transform: rotate(6deg); } }
.hero-boombox.is-boom { animation: boom .5s ease-out; }
@keyframes boom { 0% { transform: rotate(-3deg) scale(1); } 30% { transform: rotate(-5deg) scale(1.08); } 100% { transform: rotate(-3deg) scale(1); } }
.hero { overflow: clip; overflow-clip-margin: 0; }
.note-fx-layer { z-index: 4; }
.note-fx { font-size: inherit; text-shadow: 2px 2px 0 #22122E, 0 0 10px currentColor; }
.note-fx { text-shadow: none; }
.note-fx svg { display: block; width: 100%; height: auto; overflow: visible; }
.hero { overflow: visible; }
html, body { overflow-x: clip; }
@keyframes note-drift {
  0% { opacity: 0; transform: translate(0, 0) rotate(0) scale(.5); }
  12% { opacity: 1; transform: translate(calc(var(--dx) * .12), calc(var(--dy) * .12)) rotate(calc(var(--rot) * .3)) scale(1); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(.9); }
}
.screen-home { overflow-x: visible; }

/* ---------- Radio ticker across the top ---------- */
.ticker {
  position: relative; z-index: 2; width: 100vw; margin-left: calc(50% - 50vw); margin-top: -18px;
  overflow: hidden; background: #6BE38A; color: #14301E;
  border-top: 2.5px solid #22122E; border-bottom: 2.5px solid #22122E;
  transform: rotate(-1.4deg); box-shadow: 0 5px 0 rgba(10,7,16,.6);
}
.ticker-track { display: flex; width: max-content; animation: ticker 32s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-run { display: flex; align-items: center; flex: none; }
.ticker-item { padding: 9px 18px; font-family: 'Fredoka', var(--font-ui); font-weight: 600; font-size: 17px; white-space: nowrap; }
.ticker-dot { color: #22122E; font-size: 14px; }
@keyframes ticker { to { transform: translateX(-50%); } }
.screen-home .hero { padding-top: 54px; }
@media (max-width: 720px) { .ticker-item { font-size: 15px; padding: 8px 14px; } .ticker { margin-top: -10px; } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }
.ticker { margin-top: 2px; } @media (max-width: 720px) { .ticker { margin-top: 4px; } }

/* ---------- Leafy vine across the top ---------- */
.ticker { display: none; }
.screen-home { position: relative; }
.vine { position: absolute; top: -14px; left: calc(50% - 50vw); width: 100vw; height: 170px; pointer-events: none; z-index: 1; }
.vine svg { display: block; width: 100%; height: 100%; overflow: visible; }
.vine-leaf { animation: leaf-sway 4.2s ease-in-out infinite alternate; animation-delay: calc(var(--d) * -1); transform-box: view-box; }
.vine-strand { animation: strand-sway 5.5s ease-in-out infinite alternate; animation-delay: calc(var(--d) * -1); transform-box: view-box; }
@keyframes leaf-sway { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
@keyframes strand-sway { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
.screen-home .hero { padding-top: 96px; }
@media (max-width: 720px) { .vine { height: 110px; } .screen-home .hero { padding-top: 70px; } }
@media (prefers-reduced-motion: reduce) { .vine-leaf, .vine-strand { animation: none; } }
.screen-home .hero { padding-top: 112px; } @media (max-width: 720px) { .vine { height: 120px; } .screen-home .hero { padding-top: 80px; } }

/* ---------- String lights across the top (replaces the vine) ---------- */
.vine { display: none; }
.lights { position: absolute; top: -4px; left: calc(50% - 50vw); width: 100vw; height: 110px; pointer-events: none; z-index: 1; }
.lights svg { display: block; width: 100%; height: 100%; overflow: visible; }
.bulb-glow { opacity: .22; filter: blur(6px); }
.bulb .bulb-glass { filter: drop-shadow(0 0 6px var(--c)); }
.bulb { animation: bulb-twinkle 4s ease-in-out infinite; animation-delay: calc(var(--d) * -1); }
@keyframes bulb-twinkle {
  0%, 62%, 100% { opacity: 1; }
  70% { opacity: .35; }
  78% { opacity: 1; }
}
.screen-home .hero { padding-top: 84px; }
@media (max-width: 720px) { .lights { height: 80px; } .screen-home .hero { padding-top: 60px; } }
@media (prefers-reduced-motion: reduce) { .bulb { animation: none; } }

/* ---------- Play now: neon sign ---------- */
.hero .btn-primary.btn-lg {
  position: relative; background: #1A0B22; color: #FFE3F1;
  border: 2.5px solid #FF4FA3; border-radius: 14px; padding: 16px 30px;
  font-family: 'Tilt Neon', var(--font-display); font-weight: 400; font-size: 24px; letter-spacing: .02em;
  text-shadow: 0 0 2px #fff, 0 0 8px #FF4FA3, 0 0 18px #FF4FA3;
  box-shadow: 0 0 6px #FF4FA3, 0 0 18px rgba(255,79,163,.7), 0 0 42px rgba(255,79,163,.35), inset 0 0 12px rgba(255,79,163,.45);
  animation: neon-hum 2.8s ease-in-out infinite;
  transition: background .2s, color .2s, transform .15s;
}
.hero .btn-primary.btn-lg::before, .hero .btn-primary.btn-lg::after { display: none; }
.hero .btn-primary.btn-lg .icon, .hero .btn-primary.btn-lg svg { filter: drop-shadow(0 0 4px #FF4FA3) drop-shadow(0 0 10px #FF4FA3); }
.hero .btn-primary.btn-lg:hover {
  background: #FF4FA3; color: #1A0B22; text-shadow: none; transform: translateY(-2px);
  box-shadow: 0 0 10px #FF4FA3, 0 0 30px #FF4FA3, 0 0 70px rgba(255,79,163,.6);
}
.hero .btn-primary.btn-lg:hover svg { filter: none; }
.hero .btn-primary.btn-lg:active { transform: translateY(0) scale(.98); }
.hero .btn-primary.btn-lg:focus-visible { outline: 3px solid #45D9FF; outline-offset: 5px; }
@keyframes neon-hum {
  0%, 100% { box-shadow: 0 0 6px #FF4FA3, 0 0 18px rgba(255,79,163,.7), 0 0 42px rgba(255,79,163,.35), inset 0 0 12px rgba(255,79,163,.45); }
  50% { box-shadow: 0 0 8px #FF4FA3, 0 0 26px rgba(255,79,163,.85), 0 0 60px rgba(255,79,163,.5), inset 0 0 16px rgba(255,79,163,.6); }
  92% { opacity: 1; } 94% { opacity: .82; } 96% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .hero .btn-primary.btn-lg { animation: none; } }
.hero .btn-primary.btn-lg.btn-skew:hover { transform: skewX(-8deg) translateY(-2px); }
.hero .btn-primary.btn-lg.btn-skew:active { transform: skewX(-8deg) scale(.98); }
/* whiter neon: white-hot tube and text, pink halo */
.hero .btn-primary.btn-lg {
  border-color: #FFF0F7; color: #FFF8FB;
  text-shadow: 0 0 1px #fff, 0 0 4px #fff, 0 0 10px #FF7FC0, 0 0 22px #FF4FA3, 0 0 40px #FF4FA3;
}
@keyframes neon-hum {
  0%, 100% { box-shadow: 0 0 2px #fff, 0 0 6px #FFD1E8, 0 0 16px #FF4FA3, 0 0 36px rgba(255,79,163,.6), inset 0 0 6px #FFD1E8, inset 0 0 18px rgba(255,79,163,.55); }
  50% { box-shadow: 0 0 3px #fff, 0 0 9px #FFD1E8, 0 0 24px #FF4FA3, 0 0 54px rgba(255,79,163,.75), inset 0 0 8px #FFD1E8, inset 0 0 24px rgba(255,79,163,.7); }
  92% { opacity: 1; } 94% { opacity: .85; } 96% { opacity: 1; }
}
.hero .btn-primary.btn-lg svg { filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 8px #FF4FA3); }
.hero .btn-primary.btn-lg:hover { background: #FFE3F1; color: #3A0F2A; border-color: #fff;
  box-shadow: 0 0 4px #fff, 0 0 16px #FF7FC0, 0 0 40px #FF4FA3, 0 0 80px rgba(255,79,163,.6); }

/* =====================================================================
   DUEL MODE
   ===================================================================== */

/* home: second neon sign, cyan */
.hero .btn-duel {
  position: relative; background: #0B1A22; color: #F2FCFF;
  border: 2.5px solid #E8FBFF; border-radius: 14px; padding: 16px 26px;
  font-family: 'Tilt Neon', var(--font-display); font-weight: 400; font-size: 22px; letter-spacing: .02em;
  text-shadow: 0 0 1px #fff, 0 0 4px #fff, 0 0 10px #7FE6FF, 0 0 22px #45D9FF;
  box-shadow: 0 0 2px #fff, 0 0 6px #C9F4FF, 0 0 16px #45D9FF, 0 0 34px rgba(69,217,255,.5), inset 0 0 6px #C9F4FF, inset 0 0 16px rgba(69,217,255,.5);
  transition: background .2s, color .2s, transform .15s;
}
.hero .btn-duel svg { filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 8px #45D9FF); }
.hero .btn-duel:hover { background: #D8F7FF; color: #08303A; text-shadow: none; transform: skewX(-8deg) translateY(-2px); }
.hero .btn-duel:hover svg { filter: none; }
.hero .btn-duel:focus-visible { outline: 3px solid #FF4FA3; outline-offset: 5px; }
.hero-actions { gap: 16px 18px; }

/* ---------- lobby ---------- */
.screen-duel.is-busy { cursor: progress; }
.screen-duel.is-busy button { pointer-events: none; opacity: .7; }
.duel-intro { max-width: 760px; margin: 18px auto 0; text-align: center; }
.duel-faceoff { display: flex; align-items: flex-end; justify-content: center; gap: 18px; margin-bottom: 6px; }
.duel-face-worm { width: 92px; display: block; }
.duel-face-worm svg, .duel-player-worm svg { display: block; width: 100%; height: auto; overflow: visible; }
.duel-face-worm-r { transform: scaleX(-1); }
.duel-vs { font-family: 'Chewy', var(--font-display); font-size: 40px; color: #F4EFFA; text-shadow: 3px 3px 0 #FF4FA3, 6px 6px 0 #45D9FF; margin-bottom: 26px; transform: rotate(-8deg); }
.duel-vs-sm { font-size: 30px; margin: 0; align-self: center; }
.duel-title { font-family: 'Chewy', var(--font-display); font-weight: 400; font-size: clamp(48px, 7vw, 72px); line-height: 1; color: #F4EFFA;
  text-shadow: 3px 3px 0 #FF4FA3, 6px 6px 0 #5B2BB5; margin: 0; }
.duel-lede { font-family: 'Fredoka', var(--font-ui); font-weight: 500; font-size: 18px; color: rgba(244,239,250,.85); margin: 10px auto 22px; max-width: 46ch; }
.duel-invite { margin: 0 auto 16px; padding: 10px 16px; border-radius: 12px; display: inline-block;
  background: rgba(107,227,138,.12); border: 1.5px solid #6BE38A; color: #CFF7DA; font-family: 'Fredoka', var(--font-ui); font-weight: 600; }
.duel-name { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 22px; font-family: 'Fredoka', var(--font-ui); font-weight: 600; color: var(--muted); }
.duel-name-input, .duel-code-input {
  background: #150F1E; color: #F4EFFA; border: 2px solid #3A2A50; border-radius: 12px; padding: 10px 14px;
  font-family: 'Fredoka', var(--font-ui); font-weight: 600; font-size: 18px; width: 12em; text-align: center;
}
.duel-name-input:focus, .duel-code-input:focus { outline: none; border-color: #FF4FA3; box-shadow: 0 0 0 3px rgba(255,79,163,.25); }
.duel-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; text-align: left; }
.duel-opt {
  display: flex; flex-direction: column; gap: 6px; padding: 20px 18px; border-radius: 18px; cursor: pointer; color: #F4EFFA;
  background: #1A1226; border: 2px solid #3A2A50; box-shadow: 0 5px 0 #0A0710; transition: transform .15s, border-color .2s, box-shadow .2s;
  font: inherit;
}
.duel-opt:hover { transform: translateY(-3px); }
.duel-opt-create { --oc: #FF4FA3; } .duel-opt-join { --oc: #6BE38A; cursor: default; } .duel-opt-quick { --oc: #45D9FF; }
.duel-opt:hover, .duel-opt-join:focus-within { border-color: var(--oc); box-shadow: 0 5px 0 #0A0710, 0 0 22px color-mix(in srgb, var(--oc) 35%, transparent); }
.duel-opt-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--oc) 18%, transparent); color: var(--oc); }
.duel-opt-icon .icon svg { width: 24px; height: 24px; }
.duel-opt-title { font-family: 'Fredoka', var(--font-ui); font-weight: 650; font-size: 19px; }
.duel-opt-sub { font-family: 'Fredoka', var(--font-ui); font-size: 14.5px; color: var(--muted); }
.duel-join-row { display: flex; gap: 8px; margin-top: 4px; }
.duel-code-input { width: 6.4em; letter-spacing: .18em; text-transform: uppercase; font-size: 17px; padding: 8px 10px; }
.duel-error { margin: 16px auto 0; color: #FF8AA0; font-family: 'Fredoka', var(--font-ui); font-weight: 600; }

/* waiting room */
.duel-room { max-width: 760px; margin: 18px auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.duel-code-label { font-family: 'Fredoka', var(--font-ui); font-weight: 600; color: var(--muted); font-size: 16px; }
.duel-code { display: flex; gap: 10px; justify-content: center; margin: 8px 0 14px; }
.duel-code span {
  width: 64px; height: 76px; display: grid; place-items: center; border-radius: 14px; background: #150B1E;
  font-family: 'Tilt Neon', var(--font-display); font-size: 46px; color: #FFF6FB; border: 2px solid #FFE3F1;
  text-shadow: 0 0 4px #fff, 0 0 14px #FF4FA3; box-shadow: 0 0 10px rgba(255,79,163,.55), inset 0 0 12px rgba(255,79,163,.35);
}
.duel-share-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.duel-hint { margin: 12px auto 0; max-width: 44ch; font-size: 14px; color: var(--muted); font-family: 'Fredoka', var(--font-ui); }
.duel-players { display: flex; align-items: stretch; justify-content: center; gap: 18px; width: 100%; }
.duel-player {
  flex: 1; max-width: 260px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 14px 16px;
  border-radius: 18px; background: #1A1226; border: 2px solid color-mix(in srgb, var(--pc) 45%, #2A2038);
}
.duel-player.is-ready { border-color: var(--pc); box-shadow: 0 0 24px color-mix(in srgb, var(--pc) 40%, transparent); }
.duel-player-worm { width: 78px; display: block; }
.duel-player-name { font-family: 'Fredoka', var(--font-ui); font-weight: 650; font-size: 19px; color: #F4EFFA; }
.duel-player-status { font-family: 'Fredoka', var(--font-ui); font-size: 14px; color: var(--muted); }
.duel-player.is-ready .duel-player-status { color: var(--pc); font-weight: 600; }
.duel-player.is-empty { border-style: dashed; }
.duel-player-wait { height: 98px; display: flex; align-items: center; gap: 8px; }
.duel-player-wait i { width: 12px; height: 12px; border-radius: 50%; background: #5A4A6A; animation: wait-dot 1.2s ease-in-out infinite; }
.duel-player-wait i:nth-child(2) { animation-delay: .15s; } .duel-player-wait i:nth-child(3) { animation-delay: .3s; }
@keyframes wait-dot { 0%, 100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(-8px); opacity: 1; } }
.duel-ready { min-width: 240px; }
.duel-ready.is-on { background: #6BE38A; color: #12301C; }
.duel-loading { display: flex; align-items: center; gap: 10px; color: var(--muted); font-family: 'Fredoka', var(--font-ui); }
.duel-searching .duel-lede { margin-bottom: 0; }

/* ---------- play ---------- */
.duel-scoreboard { display: grid; grid-template-columns: auto 1fr auto 1fr; align-items: center; gap: 14px; margin: 4px 0 18px; }
.ds-side { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: 10px;
  padding: 10px 14px; border-radius: 16px; background: #1A1226; border: 2px solid color-mix(in srgb, var(--pc) 50%, #2A2038); }
.ds-side.is-them { grid-template-columns: auto 1fr auto; }
.ds-head { grid-row: 1 / 3; width: 44px; }
.ds-head .worm-head-mini { width: 44px; }
.ds-name { font-family: 'Fredoka', var(--font-ui); font-weight: 650; font-size: 17px; color: #F4EFFA; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-num { grid-row: 1 / 3; grid-column: 3; font-family: 'Tilt Neon', var(--font-display); font-weight: 400; font-size: 48px; line-height: 1; color: #fff;
  text-shadow: 0 0 2px #fff, 0 0 10px var(--pc), 0 0 24px var(--pc); }
.ds-pips { display: flex; gap: 5px; }
.ds-pips i { width: 22px; height: 7px; border-radius: 4px; background: rgba(255,255,255,.12); transition: background .3s, box-shadow .3s; }
.ds-pips i.is-on { background: var(--pc); box-shadow: 0 0 8px var(--pc); }
.ds-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0 6px; }
.ds-clock { font-family: 'Tilt Neon', var(--font-display); font-size: 34px; color: #FFF4D6; text-shadow: 0 0 10px #FFC857; font-variant-numeric: tabular-nums; }
.ds-clock.is-low { color: #FFD6DE; text-shadow: 0 0 10px #FF5C7A; animation: rr-flicker 1s infinite; }
.ds-goal { font-family: 'Fredoka', var(--font-ui); font-size: 13px; color: var(--muted); }
.duel-banner { margin: -6px 0 14px; padding: 10px 14px; border-radius: 12px; background: rgba(255,200,87,.1); border: 1.5px solid #FFC857; color: #FFE8B0; font-family: 'Fredoka', var(--font-ui); font-weight: 600; }
.duel-mix-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.duel-mix-label { font-family: 'Fredoka', var(--font-ui); font-weight: 600; color: var(--muted); margin: 0; }

.duel-answers { margin-top: 22px; }
.duel-guess { position: relative; }
.duel-guess.is-frozen .search-input { border-color: #FF5C7A; box-shadow: 0 0 0 3px rgba(255,92,122,.25); }
.duel-guess.is-frozen input { pointer-events: none; opacity: .5; }
.duel-freeze { position: absolute; left: 0; right: 0; bottom: -6px; height: 4px; border-radius: 2px; background: rgba(255,92,122,.2); overflow: hidden; }
.duel-freeze i { display: block; height: 100%; background: #FF5C7A; transform-origin: left; }
.duel-freeze i.is-run { animation: freeze-drain linear forwards; }
@keyframes freeze-drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.duel-feedback { min-height: 30px; margin: 14px 2px 10px; font-family: 'Fredoka', var(--font-ui); font-weight: 650; font-size: 18px; }
.duel-feedback.is-good { color: #3DF29A; text-shadow: 0 0 12px rgba(61,242,154,.5); }
.duel-feedback.is-bad { color: #FF3B5C; text-shadow: 0 0 12px rgba(255,59,92,.45); }
.duel-feedback.is-slow { color: #FFC857; }
.duel-feedback.is-them { color: #9FEAFF; }
.duel-feedback.is-pop { animation: fb-pop .35s ease-out; }
@keyframes fb-pop { from { transform: scale(.94); opacity: .4; } to { transform: scale(1); opacity: 1; } }

.claims { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.claim { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px;
  background: #160F20; border: 2px dashed #3A2A50; transition: background .3s, border-color .3s, box-shadow .3s; }
.claim-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 8px var(--dot); }
.claim-title { font-family: 'Fredoka', var(--font-ui); font-weight: 600; font-size: 17px; color: #CFC4DE; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.claim-who { font-family: 'Fredoka', var(--font-ui); font-size: 14px; color: var(--muted); white-space: nowrap; }
.claim.is-claimed { border-style: solid; border-color: var(--pc); background: color-mix(in srgb, var(--pc) 12%, #160F20); animation: claim-in .45s ease-out; }
.claim.is-claimed .claim-title { color: #F4EFFA; }
.claim.is-claimed .claim-who { color: var(--pc); font-weight: 650; }
.claim.by-me { box-shadow: 0 0 18px color-mix(in srgb, var(--pc) 35%, transparent); }
.claim.is-missed { border-color: #3A2A50; background: #160F20; }
.claim.is-missed .claim-who { color: var(--muted); }
@keyframes claim-in { 0% { transform: scale(.97); } 50% { transform: scale(1.02); } 100% { transform: scale(1); } }

/* 3-2-1 */
.duel-countdown { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(13,9,18,.82); }
.dc-num { font-family: 'Tilt Neon', var(--font-display); font-size: clamp(120px, 22vw, 240px); line-height: 1; color: #FFF6FB;
  text-shadow: 0 0 4px #fff, 0 0 20px #FF4FA3, 0 0 60px #FF4FA3, 0 0 120px #FF4FA3; }
.dc-num.is-pop { animation: dc-pop .8s ease-out; }
.duel-countdown.is-go .dc-num { color: #EFFFF3; text-shadow: 0 0 4px #fff, 0 0 20px #6BE38A, 0 0 60px #6BE38A, 0 0 120px #6BE38A; }
@keyframes dc-pop { from { transform: scale(1.5); opacity: 0; } 30% { opacity: 1; } to { transform: scale(1); } }

/* ---------- end: neon reveal ---------- */
.duel-reveal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; cursor: pointer;
  background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--dg) 34%, transparent), rgba(13,9,18,.96) 62%);
  animation: rr-in .45s ease-out; }
.duel-reveal.is-leaving { animation: rr-out .6s ease-in forwards; }
.dr-inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 20px; }
.dr-inner .rr-star { color: var(--dg) !important; }
.dr-worms { display: flex; align-items: flex-end; gap: 10px; margin-bottom: -4px; filter: drop-shadow(0 0 22px color-mix(in srgb, var(--dg) 55%, transparent)); }
.dr-worm { width: 128px; display: block; animation: rr-drop .8s .05s cubic-bezier(.2,1.5,.4,1) both; }
.dr-worm svg { display: block; width: 100%; height: auto; overflow: visible; }
.dr-worm-r { transform: scaleX(-1); animation-delay: .15s; }
.is-lose .dr-worm { animation: dr-sag .9s .1s ease-out both; }
@keyframes dr-sag { from { opacity: 0; transform: translateY(-30px); } 60% { transform: translateY(6px) rotate(-6deg); } to { opacity: 1; transform: rotate(-10deg); } }
.dr-kicker { font-family: 'Neonderthaw', var(--font-marker); font-size: 54px; line-height: 1; color: #fff;
  text-shadow: 0 0 6px var(--dg), 0 0 18px var(--dg), 0 0 36px var(--dg); }
.dr-title { margin: 0; font-family: 'Tilt Neon', var(--font-display); font-weight: 400; font-size: clamp(64px, 12vw, 132px); line-height: 1;
  color: color-mix(in srgb, var(--dg) 20%, #fff);
  text-shadow: 0 0 3px #fff, 0 0 12px var(--dg), 0 0 28px var(--dg), 0 0 60px var(--dg), 0 0 110px var(--dg);
  animation: rr-pop .7s .25s cubic-bezier(.2,1.4,.4,1) both, rr-flicker 2.4s 1s ease-in-out infinite; }
.dr-score { display: flex; align-items: baseline; gap: 14px; margin: 8px 0 0; font-family: 'Tilt Neon', var(--font-display); font-size: 54px; color: #fff; }
.dr-score b { font-weight: 400; text-shadow: 0 0 12px currentColor; }

/* ---------- end: results page ---------- */
.dres-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 28px 28px; border-radius: 22px; margin-top: 6px;
  background: radial-gradient(circle at 85% 50%, color-mix(in srgb, var(--dg) 28%, transparent), transparent 55%), #1A1226;
  border: 2px solid color-mix(in srgb, var(--dg) 60%, transparent); box-shadow: 0 0 30px color-mix(in srgb, var(--dg) 25%, transparent); }
.dres-kicker { font-family: 'Neonderthaw', var(--font-marker); font-size: 40px; line-height: 1; color: #fff; text-shadow: 0 0 6px var(--dg), 0 0 16px var(--dg); }
.dres-title { margin: 0; font-family: 'Tilt Neon', var(--font-display); font-weight: 400; font-size: clamp(48px, 7vw, 76px); line-height: 1;
  color: color-mix(in srgb, var(--dg) 20%, #fff); text-shadow: 0 0 2px #fff, 0 0 10px var(--dg), 0 0 26px var(--dg); }
.dres-line { margin: 8px 0 0; font-family: 'Fredoka', var(--font-ui); font-weight: 500; color: rgba(244,239,250,.85); font-size: 17px; }
.dres-board { display: flex; align-items: center; gap: 14px; }
.dres-side { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.dres-side .worm-head-mini { width: 50px; }
.dres-side b { font-family: 'Tilt Neon', var(--font-display); font-weight: 400; font-size: 60px; line-height: 1; color: #fff; text-shadow: 0 0 12px var(--pc), 0 0 26px var(--pc); }
.dres-side span { font-family: 'Fredoka', var(--font-ui); font-weight: 600; color: var(--muted); font-size: 14px; max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dres-dash { font-family: 'Tilt Neon', var(--font-display); font-size: 40px; color: var(--muted); }
.dres-series { margin: 14px 2px 0; font-family: 'Fredoka', var(--font-ui); font-weight: 650; color: #FFE8B0; min-height: 1em; }
.dres-block { margin-top: 18px; }
.dres-block .section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dres-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 24px; }
.dres-note { font-family: 'Fredoka', var(--font-ui); font-weight: 600; color: #6BE38A; }

@media (max-width: 760px) {
  .duel-options { grid-template-columns: 1fr; }
  .duel-code span { width: 50px; height: 62px; font-size: 36px; }
  .duel-scoreboard { grid-template-columns: auto 1fr 1fr; grid-template-areas: "q mid mid" "a a b"; }
  .ds-quit { grid-area: q; } .ds-mid { grid-area: mid; align-items: flex-end; }
  .ds-side.is-me { grid-area: a; } .ds-side.is-them { grid-area: b; }
  .duel-scoreboard { grid-template-areas: "q mid mid" "me me them"; }
  .ds-side.is-me { grid-area: me; } .ds-side.is-them { grid-area: them; }
  .ds-num { font-size: 38px; } .ds-head, .ds-head .worm-head-mini { width: 36px; }
  .claim { grid-template-columns: auto 1fr; } .claim-who { grid-column: 2; }
  .dres-hero { flex-direction: column; align-items: flex-start; }
  .dr-worm { width: 100px; }
}
@media (prefers-reduced-motion: reduce) {
  .dc-num, .claim.is-claimed, .duel-reveal, .dr-title, .dr-worm, .duel-player-wait i { animation: none !important; }
}

/* ---------- duel rounds ---------- */
.ds-round { font-family: 'Fredoka', var(--font-ui); font-weight: 600; font-size: 13px; color: var(--muted); white-space: nowrap; }
.ds-stars { margin-left: 6px; color: #FFC857; text-shadow: 0 0 8px #FFC857; letter-spacing: 1px; }
.ds-stars i { font-style: normal; }
.ds-pips i { width: 16px; }
.dc-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.dc-round { font-family: 'Neonderthaw', var(--font-marker); font-size: clamp(56px, 9vw, 96px); line-height: 1; color: #fff;
  text-shadow: 0 0 6px #A98CFF, 0 0 18px #A98CFF, 0 0 40px #8A5CFF; animation: rr-pop .7s cubic-bezier(.2,1.4,.4,1) both; }
.duel-countdown.is-go .dc-round { opacity: 0; transition: opacity .2s; }
.duel-countdown.is-go .dc-num { font-size: clamp(80px, 15vw, 170px); white-space: nowrap; }
.duel-between { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--dg) 28%, transparent), rgba(13,9,18,.92) 60%); animation: rr-in .4s ease-out; }
.db-inner { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 20px; }
.db-kicker { font-family: 'Neonderthaw', var(--font-marker); font-size: 52px; line-height: 1; color: #fff; text-shadow: 0 0 6px var(--dg), 0 0 18px var(--dg); }
.db-title { margin: 0; font-family: 'Tilt Neon', var(--font-display); font-weight: 400; font-size: clamp(64px, 11vw, 120px); line-height: 1;
  color: color-mix(in srgb, var(--dg) 20%, #fff); text-shadow: 0 0 3px #fff, 0 0 12px var(--dg), 0 0 30px var(--dg), 0 0 70px var(--dg);
  animation: rr-pop .6s .1s cubic-bezier(.2,1.4,.4,1) both; }
.db-score { display: flex; gap: 12px; align-items: baseline; margin: 6px 0 0; font-family: 'Tilt Neon', var(--font-display); font-size: 48px; color: #fff; }
.db-score b { font-weight: 400; text-shadow: 0 0 12px currentColor; }
.db-tally { margin: 6px 0 0; font-family: 'Fredoka', var(--font-ui); font-weight: 650; color: #FFE8B0; font-size: 18px; }
.db-next { margin: 4px 0 0; font-family: 'Fredoka', var(--font-ui); color: var(--muted); }
.dr-sub { font-family: 'Fredoka', var(--font-ui); font-weight: 600; color: var(--muted); margin-top: -4px; }
.dres-rounds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.dres-round { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px; border-radius: 14px; background: #1A1226; border: 2px solid #2E2240; }
.dres-round.is-win { border-color: #FFC857; box-shadow: 0 0 14px rgba(255,200,87,.25); }
.dres-round.is-lose { border-color: #45D9FF; }
.dres-round.is-draw { border-color: #6BE38A; }
.dres-round-n { font-family: 'Fredoka', var(--font-ui); font-weight: 600; font-size: 13px; color: var(--muted); }
.dres-round-score { font-family: 'Tilt Neon', var(--font-display); font-size: 30px; color: #8C7FA0; }
.dres-round-score b { font-weight: 400; text-shadow: 0 0 8px currentColor; }
.dres-round-tag { font-family: 'Fredoka', var(--font-ui); font-weight: 650; font-size: 14px; color: #F4EFFA; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dres-round-total { background: #150F1E; border-style: dashed; }
@media (max-width: 760px) { .dres-rounds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .dc-round, .db-title, .duel-between { animation: none; } }
.duel-countdown[hidden], .duel-between[hidden], .duel-freeze[hidden], .duel-banner[hidden], .duel-room[hidden], .duel-intro[hidden] { display: none !important; }
.ds-side { min-width: 0; }
.ds-name { display: flex; align-items: center; min-width: 0; }
@media (max-width: 760px) {
  .ds-side { padding: 8px 10px; column-gap: 8px; }
  .ds-num { font-size: 34px; }
  .ds-pips i { width: 12px; }
  .ds-name { font-size: 15px; }
}
.duel-between { background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--dg) 26%, #0D0912), rgba(13,9,18,.97) 60%); }
.duel-reveal { background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--dg) 30%, #0D0912), #0D0912 62%); }
/* longer round words: allow two lines on small screens */
.duel-countdown.is-go .dc-num { white-space: normal; max-width: 92vw; text-wrap: balance; font-size: clamp(64px, 12vw, 150px); line-height: 1.02; text-align: center; }
@keyframes dc-pop { from { transform: scale(1.18); opacity: 0; } 30% { opacity: 1; } to { transform: scale(1); } }

/* countdown: quicker, chunkier, softer glow (same bubbly face as the title) */
.dc-round {
  font-family: 'Chewy', var(--font-display); font-size: clamp(44px, 7vw, 72px); color: #F4EFFA;
  text-shadow: 3px 3px 0 #8A5CFF, 0 0 18px rgba(169,140,255,.45);
  animation: rr-pop .45s cubic-bezier(.2,1.4,.4,1) both;
}
.dc-num {
  font-family: 'Chewy', var(--font-display); font-size: clamp(120px, 20vw, 210px); color: #FFF4FA;
  text-shadow: 5px 5px 0 #FF4FA3, 10px 10px 0 #5B2BB5, 0 0 30px rgba(255,79,163,.4);
}
.dc-num.is-pop { animation: dc-pop .5s ease-out; }
.duel-countdown.is-go .dc-num {
  color: #F2FFF5; font-size: clamp(60px, 11vw, 130px);
  text-shadow: 4px 4px 0 #2FA36B, 8px 8px 0 #5B2BB5, 0 0 28px rgba(107,227,138,.45);
}

/* duel answers reuse the solo slots; opponent's songs show their name */
.duel-answers { margin-top: 26px; }
.slot.is-taken .slot-pick { border-color: color-mix(in srgb, var(--pc) 65%, transparent);
  background: linear-gradient(90deg, color-mix(in srgb, var(--pc) 16%, transparent), transparent); animation: claim-in .45s ease-out; }
.slot.is-taken .slot-num.marker { color: #0D0912; background: var(--pc); border: 0; box-shadow: 0 0 12px color-mix(in srgb, var(--pc) 60%, transparent); }
.slot.is-taken .slot-title, .slot.is-taken .slot-artist { opacity: .75; }
.slot-taker { flex: none; padding: 5px 12px; border-radius: 999px; background: var(--pc); color: #0D0912;
  font-family: 'Fredoka', var(--font-ui); font-weight: 650; font-size: 14px; max-width: 10em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  box-shadow: 0 0 12px color-mix(in srgb, var(--pc) 50%, transparent); }
.screen-duel-play.is-frozen .slot:not(.is-correct):not(.is-taken) { opacity: .55; }
.duel-hint-row { margin-top: 10px; }
.screen-duel-play.is-frozen .submit-hint { color: #FF6B83; font-weight: 600; }

/* ---------- lobby options: bold coloured cards with worms ---------- */
.duel-options { gap: 20px; margin-top: 46px; }
.duel-opt {
  position: relative; overflow: visible; isolation: isolate; align-items: flex-start;
  padding: 26px 22px 22px; border-radius: 22px; gap: 8px; min-height: 178px;
  background: color-mix(in srgb, var(--oc) 13%, #120C1A);
  border: 2px solid color-mix(in srgb, var(--oc) 65%, transparent);
  box-shadow: 0 6px 0 #0A0710, 0 0 26px color-mix(in srgb, var(--oc) 22%, transparent), inset 0 0 22px color-mix(in srgb, var(--oc) 10%, transparent);
}
.duel-opt-dots { position: absolute; inset: 0; border-radius: inherit; z-index: -1; overflow: hidden;
  background-image: radial-gradient(color-mix(in srgb, var(--oc) 30%, transparent) 1.5px, transparent 1.8px); background-size: 15px 15px;
  -webkit-mask-image: linear-gradient(135deg, transparent 35%, #000 100%); mask-image: linear-gradient(135deg, transparent 35%, #000 100%); }
.duel-opt-worm { position: absolute; right: 14px; top: -52px; width: 66px; display: block; transition: transform .25s cubic-bezier(.3,1.6,.5,1); }
.duel-opt-worm svg { display: block; width: 100%; height: auto; overflow: visible; }
.duel-opt:hover .duel-opt-worm, .duel-opt-join:focus-within .duel-opt-worm { transform: translateY(-8px) rotate(-6deg); }
.duel-opt:hover { transform: translateY(-4px) rotate(-.6deg); border-color: var(--oc);
  box-shadow: 0 8px 0 #0A0710, 0 0 34px color-mix(in srgb, var(--oc) 45%, transparent), inset 0 0 26px color-mix(in srgb, var(--oc) 16%, transparent); }
.duel-opt-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--oc); color: #0D0912; box-shadow: 0 0 16px color-mix(in srgb, var(--oc) 55%, transparent); }
.duel-opt-icon .icon svg { width: 26px; height: 26px; }
.duel-opt-title { font-family: 'Chewy', var(--font-display); font-weight: 400; font-size: 30px; line-height: 1.05; color: #F4EFFA; margin-top: 6px;
  text-shadow: 2px 2px 0 color-mix(in srgb, var(--oc) 70%, #000); }
.duel-opt-sub { font-size: 15.5px; color: rgba(244,239,250,.75); }
.duel-opt-join .btn-primary { background: #6BE38A; color: #0D2A16; }
.duel-opt-join .duel-code-input { border-color: color-mix(in srgb, #6BE38A 50%, transparent); background: #0E1A12; }
@media (max-width: 760px) { .duel-options { gap: 52px; } .duel-opt { min-height: 0; } }
@media (prefers-reduced-motion: reduce) { .duel-opt-worm { transition: none; } }

/* ---------- Ready button glows ---------- */
.duel-ready {
  background: #1A0B22; color: #FFF8FB; border: 2.5px solid #FFF0F7; border-radius: 14px;
  font-family: 'Fredoka', var(--font-ui); font-weight: 650; font-size: 19px;
  text-shadow: 0 0 2px #fff, 0 0 10px #FF4FA3;
  box-shadow: 0 0 2px #fff, 0 0 8px #FFD1E8, 0 0 20px #FF4FA3, 0 0 40px rgba(255,79,163,.45), inset 0 0 10px rgba(255,79,163,.5);
  animation: neon-hum 2.8s ease-in-out infinite;
}
.duel-ready:hover:not(:disabled) { background: #FFE3F1; color: #3A0F2A; text-shadow: none; }
.duel-ready:disabled { animation: none; opacity: .55; box-shadow: none; border-color: #5A4A6A; text-shadow: none; }
.duel-ready.is-on {
  background: #0F2A18; color: #F2FFF5; border-color: #EAFFF0; animation: ready-hum 2.4s ease-in-out infinite;
  text-shadow: 0 0 2px #fff, 0 0 10px #6BE38A;
}
.duel-ready.is-on:hover { background: #DFFBE7; color: #0F2A18; text-shadow: none; }
@keyframes ready-hum {
  0%, 100% { box-shadow: 0 0 2px #fff, 0 0 8px #CFF7DA, 0 0 20px #6BE38A, 0 0 40px rgba(107,227,138,.45), inset 0 0 10px rgba(107,227,138,.5); }
  50% { box-shadow: 0 0 3px #fff, 0 0 12px #CFF7DA, 0 0 30px #6BE38A, 0 0 60px rgba(107,227,138,.6), inset 0 0 14px rgba(107,227,138,.65); }
}

/* ---------- Countdown back to neon (kept quick) ---------- */
.dc-round {
  font-family: 'Neonderthaw', var(--font-marker); font-size: clamp(56px, 9vw, 92px); color: #fff;
  text-shadow: 0 0 4px #A98CFF, 0 0 14px #A98CFF, 0 0 30px #8A5CFF;
}
.dc-num {
  font-family: 'Tilt Neon', var(--font-display); font-size: clamp(120px, 22vw, 230px); color: #FFF6FB;
  text-shadow: 0 0 3px #fff, 0 0 14px #FF4FA3, 0 0 40px #FF4FA3;
}
.duel-countdown.is-go .dc-num {
  font-family: 'Tilt Neon', var(--font-display); color: #F2FFF5; font-size: clamp(60px, 11vw, 140px);
  text-shadow: 0 0 3px #fff, 0 0 14px #6BE38A, 0 0 40px #6BE38A;
}

/* ---------- Duel results (solo layout) ---------- */
.dres-hero.is-win { --rk: #FFC857; } .dres-hero.is-lose { --rk: #45D9FF; } .dres-hero.is-draw { --rk: #6BE38A; }
.dres-hero .result-of { font-size: .55em; }
.dres-hero .rb-title { font-size: 26px; max-width: 12ch; }
.dres-hero .rb-worm svg, .rb-worm-svg svg { display: block; width: 100%; height: auto; overflow: visible; }
.track.is-theirs { opacity: .9; }
.track.is-theirs .track-title { color: #E4DCEF; }
.track-who { flex: none; padding: 5px 12px; border-radius: 999px; background: var(--pc); color: #0D0912;
  font-family: 'Fredoka', var(--font-ui); font-weight: 650; font-size: 14px; max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  box-shadow: 0 0 12px color-mix(in srgb, var(--pc) 50%, transparent); }
.duel-tug { display: flex; height: 22px; margin: 12px 0 14px; border-radius: 11px; overflow: hidden; border: 2.5px solid #22122E; background: rgba(255,255,255,.06); }
.duel-tug span { width: var(--w); background: var(--c); box-shadow: inset 0 6px 0 rgba(255,255,255,.25); transition: width .6s; }
.duel-tug span.is-empty { background: transparent; box-shadow: none; }
.dr-title.is-long { font-size: clamp(44px, 8vw, 96px); max-width: 14ch; text-wrap: balance; }
.screen-duel-results .sb-total-num { letter-spacing: .02em; }
.dres-hero .result-of { font-size: .62em; color: var(--rk); opacity: .9; margin-left: 4px; }
.rs-hero.dres-hero .result-of { font-size: 56px; line-height: 1; color: var(--rk); opacity: .9; margin-left: 6px; }

/* readable handwritten verdict (solo + duel) */
.rs-verdict.note, .rs-verdict {
  font-family: 'Caveat', var(--font-marker); font-weight: 700; font-size: 34px; line-height: 1.05; color: #fff;
  text-shadow: 0 0 2px #fff, 0 0 10px var(--rk), 0 0 22px color-mix(in srgb, var(--rk) 60%, transparent);
}

/* ---------- Rematch bar, fixed to the bottom ---------- */
.screen-duel-results { padding-bottom: 120px; }
.rematch-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(16,10,24,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 2px solid #3A2A50; box-shadow: 0 -8px 30px rgba(0,0,0,.45);
  animation: rm-up .4s ease-out; transition: border-color .3s, box-shadow .3s;
}
@keyframes rm-up { from { transform: translateY(100%); } }
.rm-inner { width: min(100%, var(--col)); margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.rm-head { width: 44px; flex: none; }
.rm-head .worm-head-mini { width: 44px; }
.rm-note { flex: 1; min-width: 0; font-family: 'Fredoka', var(--font-ui); font-weight: 600; font-size: 17px; color: rgba(244,239,250,.85); }
.rm-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.rm-btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 13px 26px; border-radius: 14px; cursor: pointer;
  background: #1A0B22; color: #FFF8FB; border: 2.5px solid #FFF0F7;
  font-family: 'Tilt Neon', var(--font-display); font-size: 22px; letter-spacing: .02em;
  text-shadow: 0 0 2px #fff, 0 0 10px #FF4FA3, 0 0 22px #FF4FA3;
  box-shadow: 0 0 2px #fff, 0 0 8px #FFD1E8, 0 0 20px #FF4FA3, 0 0 40px rgba(255,79,163,.45), inset 0 0 10px rgba(255,79,163,.5);
  animation: neon-hum 2.8s ease-in-out infinite; transition: background .2s, color .2s, transform .15s;
}
.rm-btn svg { width: 20px; height: 20px; filter: drop-shadow(0 0 6px #FF4FA3); }
.rm-btn:hover:not(:disabled) { background: #FFE3F1; color: #3A0F2A; text-shadow: none; transform: translateY(-2px); }
.rm-btn:hover:not(:disabled) svg { filter: none; }
.rm-btn:disabled { cursor: default; }
.rm-btn:focus-visible { outline: 3px solid #45D9FF; outline-offset: 4px; }
/* opponent asked: the whole bar lights up green and the button says Accept */
.rematch-bar.is-asked { border-top-color: #6BE38A; box-shadow: 0 -8px 40px rgba(107,227,138,.35); animation: rm-up .4s ease-out, rm-nudge 1.6s .4s ease-in-out infinite; }
.rematch-bar.is-asked .rm-note { color: #CFF7DA; font-size: 19px; }
.rematch-bar.is-asked .rm-btn { background: #0F2A18; border-color: #EAFFF0; text-shadow: 0 0 2px #fff, 0 0 10px #6BE38A, 0 0 22px #6BE38A; animation: ready-hum 1.6s ease-in-out infinite; }
.rematch-bar.is-asked .rm-btn svg { filter: drop-shadow(0 0 6px #6BE38A); }
.rematch-bar.is-asked .rm-btn:hover { background: #DFFBE7; color: #0F2A18; text-shadow: none; }
@keyframes rm-nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.rematch-bar.is-waiting .rm-btn { opacity: .7; animation: none; box-shadow: 0 0 10px rgba(255,79,163,.4); }
.rematch-bar.is-left .rm-btn { opacity: .4; animation: none; box-shadow: none; border-color: #5A4A6A; text-shadow: none; }
@media (max-width: 640px) {
  .rm-inner { flex-wrap: wrap; gap: 10px; }
  .rm-note { font-size: 15px; }
  .rm-actions { width: 100%; }
  .rm-actions .rm-btn { flex: 1; justify-content: center; }
  .screen-duel-results { padding-bottom: 170px; }
}
@media (prefers-reduced-motion: reduce) { .rematch-bar, .rm-btn { animation: none !important; } }
/* end round early (both must agree) */
.duel-hint-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.duel-end-note { font-family: 'Fredoka', var(--font-ui); font-weight: 600; color: #FFC857; }
.duel-end.is-asked { border-color: #FFC857; color: #FFE8B0; box-shadow: 0 0 14px rgba(255,200,87,.4); animation: rm-nudge 1.4s ease-in-out infinite; }
.duel-end.is-asked { animation: end-glow 1.4s ease-in-out infinite; }
@keyframes end-glow { 0%, 100% { box-shadow: 0 0 8px rgba(255,200,87,.35); } 50% { box-shadow: 0 0 20px rgba(255,200,87,.75); } }

/* ---------- red neon: leave / no thanks ---------- */
.rm-btn.rm-no {
  background: #24080E; color: #FFF5F6; border-color: #FFE6EA;
  text-shadow: 0 0 2px #fff, 0 0 10px #FF3B5C, 0 0 22px #FF3B5C;
  box-shadow: 0 0 2px #fff, 0 0 8px #FFC9D2, 0 0 18px #FF3B5C, 0 0 36px rgba(255,59,92,.4), inset 0 0 10px rgba(255,59,92,.45);
  animation: none; font-size: 20px; padding: 13px 22px;
}
.rm-btn.rm-no:hover { background: #FFE0E6; color: #4A0A16; text-shadow: none; }
.rm-btn.rm-no:focus-visible { outline-color: #FFC857; }
.rm-btn[hidden] { display: none; }

/* ---------- "Rematch rejected" pop ---------- */
.reject-pop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(circle at 50% 45%, rgba(255,59,92,.22), rgba(13,9,18,.94) 60%); animation: rr-in .35s ease-out; }
.rp-card { position: relative; width: min(100%, 460px); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 30px 26px 26px; border-radius: 24px; background: #170A12; border: 2.5px solid #FFE6EA;
  box-shadow: 0 0 3px #fff, 0 0 14px #FF3B5C, 0 0 40px rgba(255,59,92,.45), inset 0 0 18px rgba(255,59,92,.35);
  animation: rr-pop .45s cubic-bezier(.2,1.4,.4,1) both; }
.rp-head { width: 64px; margin-top: -4px; }
.rp-head .worm-head-mini { width: 64px; }
.rp-title { margin: 4px 0 0; font-family: 'Tilt Neon', var(--font-display); font-weight: 400; font-size: clamp(38px, 7vw, 54px); line-height: 1.05; color: #FFF0F2;
  text-shadow: 0 0 3px #fff, 0 0 12px #FF3B5C, 0 0 30px #FF3B5C; animation: rr-flicker 2.4s .6s ease-in-out infinite; }
.rp-line { margin: 0 0 10px; font-family: 'Fredoka', var(--font-ui); font-weight: 500; font-size: 17px; color: rgba(244,239,250,.85); }
.rp-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.rp-new { font-size: 20px; }
.rp-close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px;
  background: none; border: 0; color: rgba(244,239,250,.6); cursor: pointer; }
.rp-close:hover { color: #fff; background: rgba(255,255,255,.08); }
@media (prefers-reduced-motion: reduce) { .reject-pop, .rp-card, .rp-title { animation: none; } }
.rematch-bar.is-asked { animation: rm-up .4s ease-out, rm-glow 1.6s .4s ease-in-out infinite; }
@keyframes rm-glow { 0%, 100% { box-shadow: 0 -8px 30px rgba(107,227,138,.25); } 50% { box-shadow: 0 -8px 46px rgba(107,227,138,.55); } }
.rematch-bar .rm-btn.rm-no, .rematch-bar.is-asked .rm-btn.rm-no {
  background: #24080E; color: #FFF5F6; border-color: #FFE6EA;
  text-shadow: 0 0 2px #fff, 0 0 10px #FF3B5C, 0 0 22px #FF3B5C;
  box-shadow: 0 0 2px #fff, 0 0 8px #FFC9D2, 0 0 18px #FF3B5C, 0 0 36px rgba(255,59,92,.4), inset 0 0 10px rgba(255,59,92,.45);
  animation: none;
}
.rematch-bar .rm-btn.rm-no:hover { background: #FFE0E6; color: #4A0A16; text-shadow: none; }
.rm-btn { white-space: nowrap; }
@media (max-width: 640px) { .rm-btn { font-size: 18px; padding: 12px 14px; gap: 8px; } .rm-btn.rm-no { flex: 0 0 auto; } }
/* opponent got it first: maroon slot, light name pill */
.slot.is-taken .slot-pick { background: linear-gradient(90deg, rgba(158,42,75,.35), rgba(158,42,75,.08)); border-color: #9E2A4B; }
.slot.is-taken .slot-num.marker { background: #9E2A4B; color: #FFE3EA; box-shadow: 0 0 10px rgba(158,42,75,.55); }
.slot.is-taken .slot-taker { background: #9E2A4B; color: #FFE3EA; box-shadow: 0 0 10px rgba(158,42,75,.5); }
.track-who.is-nobody { --pc: #4A3A5C; background: #2A2036; color: #B9AEC9; box-shadow: none; border: 1.5px solid #4A3A5C; }
.track-who.is-nobody { --pc: #FF3B5C; background: #FF3B5C; color: #2A0610; border: 0; box-shadow: 0 0 12px rgba(255,59,92,.5); }
