/* ============================================================================================
   Songspot — printed like a gig poster.
   Paper + one ink per difficulty. The ink is a registered colour, so switching difficulty
   (or day / night) re-inks the whole page smoothly instead of snapping.
   ============================================================================================ */
@property --ink { syntax: '<color>'; inherits: true; initial-value: #ffb511; }
@property --ink-text { syntax: '<color>'; inherits: true; initial-value: #8a5a00; }
@property --on-ink { syntax: '<color>'; inherits: true; initial-value: #1b1916; }
@property --page { syntax: '<color>'; inherits: true; initial-value: #f4ebd7; }

:root {
  --display: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --sans: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --mono: 'DM Mono', ui-monospace, 'SF Mono', Consolas, monospace;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.3, 1.45, 0.5, 1);
  --topbar-h: 64px;
  --col: 452px;
  --r-sm: 7px;
  --r: 11px;
  --r-lg: 18px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  transition: --ink 0.45s ease, --ink-text 0.45s ease, --on-ink 0.45s ease, --page 0.6s ease;
}

/* Switching day / night swaps instantly underneath; the view transition below does the wipe */
:root.instant,
:root.instant * {
  transition: none !important;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-new(root) {
  animation: sheet-wipe 0.62s cubic-bezier(0.65, 0, 0.35, 1);
}
@keyframes sheet-wipe {
  from { clip-path: polygon(0 0, 0 0, -18% 100%, -18% 100%); }
  to { clip-path: polygon(0 0, 118% 0, 100% 100%, -18% 100%); }
}

/* ---- Day: warm paper, black ink ---------------------------------------------------------- */
:root,
:root[data-mode='day'] {
  color-scheme: light;
  --paper: #f3eee4;
  --card: #fbf8f2;
  --card-2: #ebe4d7;
  --card-3: #e1d9ca;
  --text: #1b1916;
  --muted: #6b645a;
  --faint: #9c9486;
  --line: rgba(27, 25, 22, 0.12);
  --line-2: rgba(27, 25, 22, 0.26);
  --key: #1b1916;
  --on-key: #f3eee4;
  --shade: #1b1916;
  --won-ink: #1d8f50;
  --lost-ink: #d6402f;
  --lost-text: #b4301f;
  --blend: multiply;
  --grain-a: 0.55;
  --backdrop: rgba(27, 22, 16, 0.42);
}

/* ---- Night: the same inks printed on black card ------------------------------------------- */
:root[data-mode='night'] {
  color-scheme: dark;
  --paper: #121113;
  --card: #1c1a1e;
  --card-2: #262428;
  --card-3: #302d33;
  --text: #f3eee4;
  --muted: #aaa397;
  --faint: #716b63;
  --line: rgba(243, 238, 228, 0.1);
  --line-2: rgba(243, 238, 228, 0.22);
  --key: #f3eee4;
  --on-key: #121113;
  --shade: color-mix(in oklab, var(--ink) 50%, #050405);
  --won-ink: #47d08a;
  --lost-ink: #ff6a5b;
  --lost-text: #ff8577;
  --blend: screen;
  --grain-a: 0.3;
  --backdrop: rgba(0, 0, 0, 0.6);
}

/* ---- Inks: a sunset from Stadium (bright day) to Basement (midnight) ----------------------- */
:root[data-theme='easy'] { --ink: #ffb511; --ink-text: #8a5a00; --on-ink: #1b1916; --page: #f4ebd7; }
:root[data-theme='medium'] { --ink: #ff6c2f; --ink-text: #b23f0b; --on-ink: #1b1916; --page: #f4e6d9; }
:root[data-theme='hard'] { --ink: #ff48b0; --ink-text: #b8166f; --on-ink: #1b1916; --page: #f4e4e1; }
:root[data-theme='expert'] { --ink: #7a52e0; --ink-text: #5e3bc4; --on-ink: #ffffff; --page: #eee8e4; }
:root[data-theme='impossible'] { --ink: #3056d8; --ink-text: #2544b0; --on-ink: #ffffff; --page: #ebe8e4; }
:root[data-mode='night'][data-theme='easy'] { --ink: #ffbd2e; --ink-text: #ffc84f; --on-ink: #1b1916; --page: #231d15; }
:root[data-mode='night'][data-theme='medium'] { --ink: #ff7a45; --ink-text: #ff925f; --on-ink: #1b1916; --page: #231816; }
:root[data-mode='night'][data-theme='hard'] { --ink: #ff5cbc; --ink-text: #ff7cc9; --on-ink: #1b1916; --page: #23161f; }
:root[data-mode='night'][data-theme='expert'] { --ink: #a488ff; --ink-text: #b8a2ff; --on-ink: #16121f; --page: #1c1924; }
:root[data-mode='night'][data-theme='impossible'] { --ink: #5f86ff; --ink-text: #86a3ff; --on-ink: #0d1222; --page: #171924; }

/* Each difficulty's own ink, whatever the current one is (tabs, ladder, setlist) */
.tier-easy { --t: #ffb511; --t-on: #1b1916; --t-text: #8a5a00; }
.tier-medium { --t: #ff6c2f; --t-on: #1b1916; --t-text: #b23f0b; }
.tier-hard { --t: #ff48b0; --t-on: #1b1916; --t-text: #b8166f; }
.tier-expert { --t: #7a52e0; --t-on: #ffffff; --t-text: #5e3bc4; }
.tier-impossible { --t: #3056d8; --t-on: #ffffff; --t-text: #2544b0; }
[data-mode='night'] .tier-easy { --t: #ffbd2e; --t-on: #1b1916; --t-text: #ffc84f; }
[data-mode='night'] .tier-medium { --t: #ff7a45; --t-on: #1b1916; --t-text: #ff925f; }
[data-mode='night'] .tier-hard { --t: #ff5cbc; --t-on: #1b1916; --t-text: #ff7cc9; }
[data-mode='night'] .tier-expert { --t: #a488ff; --t-on: #16121f; --t-text: #b8a2ff; }
[data-mode='night'] .tier-impossible { --t: #5f86ff; --t-on: #0d1222; --t-text: #86a3ff; }

/* ---- Print finish: Riso (hard offset shadows, grain, off-register ink) or Clean ----------- */
body {
  --hard: 4px 4px 0 var(--shade);
  --hard-sm: 2px 2px 0 var(--shade);
  --hard-lg: 6px 6px 0 var(--shade);
  --drop: drop-shadow(4px 4px 0 var(--shade));
  --misreg: 0.04em 0.035em 0 var(--ink);
}
body[data-print='clean'] {
  --hard: 0 6px 18px rgba(20, 16, 12, 0.13);
  --hard-sm: 0 2px 6px rgba(20, 16, 12, 0.12);
  --hard-lg: 0 14px 34px rgba(20, 16, 12, 0.18);
  --drop: drop-shadow(0 8px 16px rgba(20, 16, 12, 0.16));
  --misreg: none;
}
[data-mode='night'] body[data-print='clean'] {
  --hard: 0 6px 18px rgba(0, 0, 0, 0.45);
  --hard-sm: 0 2px 6px rgba(0, 0, 0, 0.4);
  --hard-lg: 0 14px 34px rgba(0, 0, 0, 0.5);
  --drop: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.5));
}

/* ============================================================================================
   Base
   ============================================================================================ */
* {
  box-sizing: border-box;
}

html {
  background: var(--page);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--page);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

body.no-scroll {
  overflow: hidden;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
  touch-action: manipulation;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: var(--ink-text);
}

:focus-visible {
  outline: 2.5px solid var(--key);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.ic {
  flex: none;
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

main {
  position: relative;
  z-index: 1;
}

/* Paper grain (Riso finish only): it sits on the paper, under the cards and the type */
.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1  0 0 0 0 0.09  0 0 0 0 0.08  2.4 0 0 0 -1.5'/></filter><rect width='220' height='220' filter='url(%23g)'/></svg>");
  transition: opacity 0.4s ease;
}
[data-mode='night'] .grain {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.96  0 0 0 0 0.94  0 0 0 0 0.9  2.4 0 0 0 -1.55'/></filter><rect width='220' height='220' filter='url(%23g)'/></svg>");
}
body[data-print='riso'] .grain {
  opacity: var(--grain-a);
}

/* Ink wash: floods out from the ticket when you name a song */
.wash {
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
  background: var(--ink);
  mix-blend-mode: var(--blend);
  opacity: 0;
  clip-path: circle(0 at var(--wx, 50%) var(--wy, 50%));
}
.wash.go {
  animation: wash 1.25s cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes wash {
  0% { opacity: 0.55; clip-path: circle(0 at var(--wx, 50%) var(--wy, 50%)); }
  45% { opacity: 0.32; }
  100% { opacity: 0; clip-path: circle(150vmax at var(--wx, 50%) var(--wy, 50%)); }
}

/* ============================================================================================
   Top bar
   ============================================================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: calc(var(--topbar-h) + var(--safe-t));
  padding: var(--safe-t) calc(22px + var(--safe-r)) 0 calc(22px + var(--safe-l));
  display: flex;
  align-items: center;
  gap: 16px;
  background: color-mix(in srgb, var(--page) 86%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1.5px solid transparent;
  transition: border-color 0.2s ease;
}
.topbar.scrolled {
  border-bottom-color: var(--line);
}
/* Home-screen app on iPhone: the status bar sits on a strip of black ink (its text is white) */
[data-mode='day'] .topbar::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: var(--safe-t);
  background: #1b1916;
}

.brand {
  display: flex;
  align-items: center;
  padding: 6px 4px;
  border-radius: 8px;
}
.logo {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 88%;
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text);
}
.logo-dot {
  display: inline-block;
  width: 0.54em;
  height: 0.54em;
  margin: 0 0.035em 0 0.02em;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0.06em 0.05em 0 var(--key);
  transform: scale(calc(1 + var(--lvl, 0) * 0.45));
  transition: transform 0.07s linear;
}
body[data-print='clean'] .logo-dot {
  box-shadow: none;
}

.nav {
  display: flex;
  gap: 3px;
  padding: 4px;
  border-radius: 999px;
  background: var(--card-2);
}
.nav-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  font-weight: 650;
  font-size: 14px;
  color: var(--muted);
  transition: background-color 0.2s ease, color 0.2s ease;
}
.nav-btn:hover {
  color: var(--text);
}
.nav-btn.active {
  background: var(--key);
  color: var(--on-key);
}
.nav-btn .ic {
  width: 14px;
  height: 14px;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.stat-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  background: var(--card-2);
  font-family: var(--mono);
  font-size: 13.5px;
}
.stat-chip b {
  font-weight: 500;
}
.stat-chip .ic {
  width: 15px;
  height: 15px;
  color: var(--ink-text);
}

.round-btn {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--card-2);
  transition: background-color 0.2s ease, transform 0.15s ease;
}
.round-btn:hover {
  background: var(--card-3);
}
.round-btn:active {
  transform: scale(0.94);
}
.round-btn.small {
  width: 34px;
  height: 34px;
}
.menu-btn {
  display: none;
}

/* ============================================================================================
   Buttons, switches, chips, inputs
   ============================================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: var(--r);
  border: 2px solid var(--key);
  background: var(--card);
  color: var(--text);
  font-weight: 700;
  font-size: 14.5px;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.2s ease;
}
.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--hard-sm);
}
.btn:active {
  transform: translate(1px, 1px);
  box-shadow: none;
}
.btn-ink {
  background: var(--ink);
  color: var(--on-ink);
  box-shadow: var(--hard);
}
.btn-ink:hover {
  box-shadow: var(--hard-lg);
}
.btn-ink:active {
  transform: translate(3px, 3px);
  box-shadow: none;
}
.btn-ghost {
  border-color: var(--line-2);
  background: transparent;
}
.btn-danger {
  border-color: var(--lost-ink);
  color: var(--lost-text);
  background: transparent;
}
.btn-spotify {
  --on-spotify: #0b0c0b;
  border-color: #1b1916;
  background: #1ed760;
  color: #0b0c0b;
  box-shadow: var(--hard);
}
.btn-wide {
  width: 100%;
}
.btn .ic {
  width: 16px;
  height: 16px;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}
.btn-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.link-btn {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--muted);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.link-btn:hover {
  color: var(--text);
}

.switch {
  position: relative;
  flex: none;
  width: 36px;
  height: 21px;
  margin-left: auto;
  border-radius: 999px;
  border: 2px solid var(--key);
  background: var(--card);
  transition: background-color 0.2s ease;
}
.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--key);
  transition: transform 0.25s var(--spring), background-color 0.2s ease;
}
.on > .switch {
  background: var(--ink);
}
.on > .switch::after {
  transform: translateX(15px);
}

.chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.chips.two {
  grid-template-columns: repeat(2, 1fr);
}
.chips.three {
  grid-template-columns: repeat(3, 1fr);
}
.chip {
  height: 32px;
  border-radius: 999px;
  border: 1.5px solid var(--line-2);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.12s ease;
}
.chip:hover {
  border-color: var(--key);
  color: var(--text);
}
.chip:active {
  transform: scale(0.95);
}
.chip.on {
  background: var(--key);
  border-color: var(--key);
  color: var(--on-key);
}
.chips.text .chip {
  font-family: var(--sans);
  font-weight: 650;
  font-size: 13px;
}

.range {
  --fill: 80%;
  flex: 1;
  min-width: 0;
  height: 22px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--key) var(--fill), var(--line-2) var(--fill));
}
.range::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--key) var(--fill), var(--line-2) var(--fill));
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border-radius: 50%;
  border: 2px solid var(--key);
  background: var(--ink);
  transition: transform 0.15s var(--spring);
}
.range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--key);
  background: var(--ink);
}
.range:active::-webkit-slider-thumb {
  transform: scale(1.18);
}

/* ============================================================================================
   Library
   ============================================================================================ */
.lib {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 26px calc(28px + var(--safe-r)) 150px calc(28px + var(--safe-l));
}

.lib-hero {
  max-width: 780px;
  margin: 24px auto 46px;
  text-align: center;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.kicker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lost-ink);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--lost-ink) 50%, transparent);
  animation: live 1.8s ease-out infinite;
}
@keyframes live {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--lost-ink) 55%, transparent); }
  70% { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.lib-hero h1 {
  margin: 16px 0 28px;
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 84%;
  font-size: clamp(42px, 6.6vw, 82px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-wrap: balance;
  text-shadow: var(--misreg);
}
.h1-serif {
  display: inline-block;
  margin-top: 0.08em;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-stretch: normal;
  font-size: 0.8em;
  letter-spacing: -0.015em;
  color: var(--ink-text);
  text-shadow: none;
}

.link-form {
  position: relative;
  display: flex;
  gap: 10px;
  max-width: 660px;
  margin: 0 auto;
}
.link-form input {
  flex: 1;
  min-width: 0;
  height: 56px;
  padding: 0 16px 0 48px;
  border-radius: var(--r);
  border: 2px solid var(--key);
  background: var(--card);
  font-size: 16px;
  font-weight: 500;
  box-shadow: var(--hard);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.link-form input::placeholder {
  color: var(--faint);
}
.link-form input:focus {
  outline: none;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}
.link-ic {
  position: absolute;
  z-index: 1;
  left: 17px;
  top: 19px;
  color: var(--muted);
  pointer-events: none;
  transition: translate 0.15s ease;
}
.link-form:focus-within .link-ic {
  translate: -2px -2px;
}
.link-form .btn {
  height: 56px;
  padding: 0 22px;
  font-size: 16px;
}

.how {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 26px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  font-weight: 550;
}
.how li {
  display: flex;
  align-items: center;
  gap: 9px;
}
.how b {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--on-ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--hard-sm);
}
.lib-note {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.row {
  margin: 36px 0;
}
.row-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.row-head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 88%;
  font-size: 23px;
  letter-spacing: -0.025em;
}
.row-head h2 .ic {
  color: var(--ink-text);
}
.row-arrows {
  margin-left: auto;
  display: flex;
  gap: 6px;
}
.arrow {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.arrow:hover {
  border-color: var(--key);
  background: var(--card);
}
.row-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 172px;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 8px 6px 18px;
  margin: 0 -6px;
  scrollbar-width: none;
}
.row-scroll::-webkit-scrollbar {
  display: none;
}

/* Playlists are little gig posters, pinned slightly crooked */
.card {
  display: block;
  min-width: 0;
  text-align: left;
  scroll-snap-align: start;
  transform: rotate(var(--rot, 0deg));
  transition: transform 0.3s var(--spring);
}
body[data-print='clean'] .card {
  transform: none;
}
.card:hover {
  transform: rotate(0deg) translateY(-5px);
}
.card:active {
  transform: rotate(0deg) translateY(-1px) scale(0.98);
}
.card-img {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--card-2);
  border: 2px solid var(--key);
  box-shadow: var(--hard);
  transition: box-shadow 0.25s ease;
}
.card:hover .card-img {
  box-shadow: 7px 7px 0 var(--ink);
}
body[data-print='clean'] .card-img {
  border: 0;
}
body[data-print='clean'] .card:hover .card-img {
  box-shadow: var(--hard-lg);
}
.card-img.round {
  border-radius: 50%;
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Riso halftone over the artwork; it lifts when you point at the poster */
body[data-print='riso'] .card-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, color-mix(in srgb, var(--ink) 70%, transparent) 0 0.9px, transparent 1.3px) 0 0 / 4px 4px;
  mix-blend-mode: var(--blend);
  opacity: 0.55;
  transition: opacity 0.3s ease;
}
body[data-print='riso'] .card:hover .card-img::after {
  opacity: 0;
}
.card-art {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--text);
  background: var(--card-2);
}
.art-liked {
  background: #ff48b0;
  color: #1b1916;
}
.art-top1 {
  background: #ffb511;
  color: #1b1916;
}
.art-top2 {
  background: #ff6c2f;
  color: #1b1916;
}
.art-top3 {
  background: #7a52e0;
  color: #fff;
}
.card-title {
  margin-top: 12px;
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-sub {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skeleton .card-img {
  border-color: transparent;
  box-shadow: none;
}
.skeleton .card-img,
.sk-line {
  background: linear-gradient(90deg, var(--card-2) 20%, var(--card-3) 40%, var(--card-2) 60%) 0 0 / 300% 100%;
  animation: shimmer 1.3s linear infinite;
}
.sk-line {
  height: 11px;
  margin-top: 12px;
  border-radius: 6px;
}
.sk-line.short {
  width: 60%;
  margin-top: 8px;
}
@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

.connect-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px 24px;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 2px solid var(--key);
  box-shadow: var(--hard);
}
body[data-print='clean'] .connect-card {
  border-color: transparent;
}
.connect-card.error {
  border-color: var(--lost-ink);
}
.connect-logo {
  --on-spotify: var(--card);
  color: #1ed760;
  flex: none;
}
.connect-text {
  flex: 1;
}
.connect-text h3 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
}
.connect-text p {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
}
.me {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
}
.me img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
}

.discover {
  margin: 44px 0 6px;
}
.discover-box {
  position: relative;
  max-width: 460px;
}
.discover-box .ic {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}
.discover-box input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 44px;
  border-radius: 999px;
  border: 2px solid var(--line-2);
  background: var(--card);
  font-size: 16px;
  transition: border-color 0.2s ease;
}
.discover-box input:focus {
  outline: none;
  border-color: var(--key);
}
.empty-note {
  margin: 20px 0;
  font-size: 14px;
  color: var(--muted);
}

.dock {
  position: fixed;
  left: 50%;
  bottom: calc(22px + var(--safe-b));
  z-index: 30;
  transform: translateX(-50%);
}
.dock-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 40px);
  height: 54px;
  padding: 0 22px 0 20px;
  border-radius: 999px;
  background: var(--key);
  color: var(--on-key);
  font-weight: 750;
  font-size: 15px;
  white-space: nowrap;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: dock-in 0.5s var(--spring) both;
}
.dock-btn > span:first-of-type {
  flex: none;
}
.dock-btn:hover:not(:disabled) {
  transform: translate(-1px, -2px);
  box-shadow: 5px 6px 0 var(--ink);
}
.dock-btn:disabled {
  opacity: 0.55;
  box-shadow: none;
}
.dock-src {
  min-width: 0;
  max-width: 44vw;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 500;
  opacity: 0.72;
}
.dock-src::before {
  content: '·';
  margin-right: 10px;
}
@keyframes dock-in {
  from { transform: translateY(30px); opacity: 0; }
}

/* ============================================================================================
   Game layout
   ============================================================================================ */
.game {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr) 228px;
  min-height: calc(100dvh - var(--topbar-h) - var(--safe-t));
}
body[data-layout='wide'] {
  --col: 588px;
}

.side {
  position: sticky;
  top: calc(var(--topbar-h) + var(--safe-t));
  align-self: start;
  max-height: calc(100dvh - var(--topbar-h) - var(--safe-t));
  overflow-y: auto;
  padding: 22px 20px 30px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.side-left {
  border-right: 1.5px dashed var(--line-2);
  padding-left: calc(20px + var(--safe-l));
}
.side-right {
  border-left: 1.5px dashed var(--line-2);
  padding-right: calc(20px + var(--safe-r));
}
.side-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.side-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}
.label-info {
  display: grid;
  place-items: center;
  color: var(--faint);
  transition: color 0.2s ease;
}
.label-info:hover {
  color: var(--text);
}
.label-info .ic {
  width: 14px;
  height: 14px;
}
.side-sep {
  height: 0;
  margin: 18px 0;
  border-top: 1.5px dashed var(--line-2);
}
.side-hint {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.4;
}
.side-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--line-2);
  font-weight: 650;
  font-size: 13px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.side-btn:hover {
  border-color: var(--key);
  background: var(--card);
}

.src-card {
  display: flex;
  align-items: center;
  gap: 12px;
}
.src-cover {
  flex: none;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  overflow: hidden;
  background: var(--card-2);
  border: 1.5px solid var(--key);
  box-shadow: var(--hard-sm);
}
.src-cover.round {
  border-radius: 50%;
}
.src-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.src-meta {
  min-width: 0;
}
.src-name {
  font-weight: 750;
  font-size: 14.5px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.src-sub {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--muted);
}

/* Difficulty ladder: Stadium → Basement */
.ladder {
  display: grid;
  gap: 4px;
}
.rung {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  text-align: left;
  transition: background-color 0.22s ease, color 0.22s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.rung:hover:not(:disabled) {
  background: var(--card-2);
}
.rung:active:not(:disabled) {
  transform: scale(0.98);
}
.rung:disabled {
  opacity: 0.42;
}
.rung-ink {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--t);
  box-shadow: 1.5px 1.5px 0 var(--key);
}
body[data-print='clean'] .rung-ink {
  box-shadow: none;
}
.rung-text {
  min-width: 0;
}
.rung-text b {
  display: block;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
}
.rung-text i {
  display: block;
  margin-top: 1px;
  font-style: normal;
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--muted);
}
.rung-count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.rung.active {
  background: var(--t);
  color: var(--t-on);
  box-shadow: var(--hard-sm);
}
.rung.active .rung-text i,
.rung.active .rung-count {
  color: inherit;
  opacity: 0.75;
}
.rung.active .rung-ink {
  background: var(--t-on);
  box-shadow: none;
}

.link-rows {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 12px;
}
.link-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 2px;
  font-weight: 650;
  font-size: 13px;
  color: var(--muted);
  transition: color 0.2s ease;
}
.link-row:hover {
  color: var(--text);
}
.link-row .ic {
  width: 14px;
  height: 14px;
}

.rank-status:not(:empty) {
  margin-top: 12px;
}
.rank-line {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}
.rank-line span:last-child {
  font-family: var(--mono);
}
.meter {
  height: 6px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.meter span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--ink);
  transition: width 0.35s ease;
}
.meter.wide {
  width: min(280px, 80%);
  margin: 16px auto 0;
  height: 8px;
  border: 1.5px solid var(--key);
  background: var(--card);
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.stat {
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--card);
  border: 1px solid var(--line);
}
.stat span {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat b {
  display: block;
  margin-top: 2px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.stat b.bump {
  animation: bump 0.45s var(--spring);
}

/* Setlist: every song you've heard, as a strip of ticket stubs */
.set-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.set-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.set-item {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border-radius: var(--r-sm);
  background: var(--card);
  border: 1px solid var(--line);
  text-align: left;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.2s ease;
}
.set-item:hover {
  transform: translate(-1px, -1px);
  border-color: var(--key);
  box-shadow: var(--hard-sm);
}
.set-item.fresh {
  animation: slot-in 0.55s var(--spring) both;
}
.set-cover {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  overflow: hidden;
  background: var(--card-2);
  color: var(--faint);
}
.set-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.set-text {
  min-width: 0;
}
.set-title,
.set-sub {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.set-title {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.25;
}
.set-sub {
  font-size: 11.5px;
  color: var(--muted);
}
.set-res {
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--t);
  color: var(--t-on);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
}
.set-item.lost .set-res {
  background: transparent;
  color: var(--lost-text);
  border: 1.5px solid currentColor;
  padding: 1.5px 5px;
}
.set-item.lost .set-title {
  text-decoration: line-through;
  text-decoration-color: var(--lost-ink);
  text-decoration-thickness: 1.5px;
}
.set-empty {
  margin: 0;
  padding: 12px;
  border-radius: var(--r-sm);
  border: 1.5px dashed var(--line-2);
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}
.set-more {
  justify-self: center;
  margin-top: 2px;
}

/* Right panel options */
.opt-stack {
  display: grid;
  gap: 6px;
}
.opt-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--line-2);
  font-weight: 650;
  font-size: 13.5px;
  text-align: left;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.opt-row:hover {
  border-color: var(--key);
}
.opt-row .ic {
  width: 14px;
  height: 14px;
}
.opt-row.active {
  background: var(--key);
  border-color: var(--key);
  color: var(--on-key);
}
.opt-tag {
  --on-spotify: var(--card);
  margin-left: auto;
  color: #1ed760;
}
.switch-row.on {
  border-color: var(--key);
  background: var(--card);
}
.volume-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}
.volume-row .ic {
  width: 17px;
  height: 17px;
}

.ui-opts summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}
.ui-opts summary::-webkit-details-marker {
  display: none;
}
.ui-opts summary:hover {
  color: var(--text);
}
.badge-new {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 9.5px;
  letter-spacing: 0.08em;
}
.ui-chev {
  margin-left: auto;
  transition: transform 0.25s ease;
}
.ui-opts[open] .ui-chev {
  transform: rotate(180deg);
}
.ui-opts-body {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}
.ui-opts-body .side-block {
  gap: 7px;
}

/* ============================================================================================
   Centre column
   ============================================================================================ */
.center {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(18px, 4.5vh, 54px) 24px 70px;
  min-width: 0;
}
.center > * {
  width: min(var(--col), 100%);
}

/* The poster for tonight's show: the playlist, printed big */
.poster {
  position: relative;
  margin-bottom: 16px;
  text-align: center;
}
.poster-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}
.pm-venue {
  color: var(--ink-text);
  font-weight: 500;
}
.pm-sep {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}
.poster-title {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 100%;
  margin-top: 8px;
  padding: 2px 8px 4px;
  border-radius: 10px;
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 80%;
  font-size: clamp(34px, 4.4vw, 54px);
  line-height: 0.94;
  letter-spacing: -0.04em;
  transition: background-color 0.2s ease;
}
.poster-title:hover {
  background: color-mix(in srgb, var(--key) 6%, transparent);
}
.poster-title.long {
  font-size: clamp(27px, 3.2vw, 38px);
}
.pt-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding-bottom: 0.06em;
  text-wrap: balance;
  text-shadow: var(--misreg);
}
.pt-caret {
  flex: none;
  margin-top: 0.14em;
  opacity: 0.45;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.poster-title:hover .pt-caret {
  opacity: 0.9;
}
.poster-title[aria-expanded='true'] .pt-caret {
  transform: rotate(180deg);
}
.poster-title.slide .pt-text {
  animation: poster-in 0.55s var(--spring) both;
}
@keyframes poster-in {
  from { transform: translateY(0.35em) rotate(-2deg); opacity: 0; }
}
/* The squeegee: re-inks the poster when the difficulty changes */
.poster::after {
  content: '';
  position: absolute;
  inset: -4px -14px;
  border-radius: 12px;
  background: var(--ink);
  mix-blend-mode: var(--blend);
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: left center;
}
.poster.reink::after {
  animation: squeegee 0.62s cubic-bezier(0.65, 0, 0.35, 1);
}
@keyframes squeegee {
  0% { transform: scaleX(0); transform-origin: left center; opacity: 0.85; }
  48% { transform: scaleX(1); transform-origin: left center; opacity: 0.85; }
  52% { transform: scaleX(1); transform-origin: right center; opacity: 0.85; }
  100% { transform: scaleX(0); transform-origin: right center; opacity: 0.85; }
}

.switcher {
  position: absolute;
  left: 50%;
  top: calc(100% + 4px);
  z-index: 25;
  width: min(360px, calc(100vw - 32px));
  transform: translateX(-50%);
  padding: 8px;
  border-radius: var(--r);
  border: 2px solid var(--key);
  background: var(--card);
  box-shadow: var(--hard-lg);
  text-align: left;
  animation: pop 0.22s var(--spring);
}
.sw-label {
  padding: 6px 8px 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.sw-item {
  width: 100%;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 6px 8px 6px 6px;
  border-radius: var(--r-sm);
  text-align: left;
  transition: background-color 0.15s ease;
}
.sw-item:hover,
.sw-item:focus-visible {
  background: var(--card-2);
}
.sw-art {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  overflow: hidden;
  background: var(--card-2);
}
.sw-art.round {
  border-radius: 50%;
}
.sw-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sw-text {
  min-width: 0;
}
.sw-name,
.sw-sub {
  display: block;
}
.sw-name {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sw-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sw-go {
  color: var(--faint);
}
.sw-lib {
  border-top: 1.5px dashed var(--line-2);
  margin-top: 6px;
  padding-top: 10px;
}

/* Difficulty tabs */
.tabs {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin: 0 auto 20px;
}
.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1.5px solid var(--line-2);
  font-weight: 650;
  font-size: 13px;
  white-space: nowrap;
  color: var(--muted);
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.12s ease;
}
.tab:hover {
  color: var(--text);
  border-color: var(--key);
}
.tab:active {
  transform: scale(0.95);
}
.tab-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--t);
  transition: background-color 0.25s ease;
}
.tab.active {
  background: var(--t);
  border-color: var(--key);
  color: var(--t-on);
  box-shadow: var(--hard-sm);
}
.tab.active .tab-dot {
  background: var(--t-on);
}
body[data-print='clean'] .tab.active {
  border-color: var(--t);
}

/* First-visit coach card */
.coach {
  position: relative;
  margin: 0 auto 18px;
  padding: 16px 18px 16px;
  border-radius: var(--r);
  border: 2px solid var(--key);
  background: var(--card);
  box-shadow: 5px 5px 0 var(--ink);
  animation: pop 0.4s var(--spring) both;
}
body[data-print='clean'] .coach {
  border-color: transparent;
  box-shadow: var(--hard-lg);
}
.coach h3 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.coach ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.coach li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 14px;
  line-height: 1.4;
}
.coach li b {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--on-ink);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
}
.coach .btn {
  height: 38px;
  margin-top: 14px;
}
.coach-x {
  position: absolute;
  top: 10px;
  right: 10px;
}

/* ---- The waveform: the song's real shape, printed one block at a time --------------------- */
.wave {
  margin: 0 auto 6px;
}
.wv-frame {
  --p: 0;
  position: relative;
  height: 78px;
}
.wv-track {
  position: absolute;
  inset: 0;
  display: flex;
  gap: 6px;
}
.wv-block {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 5px;
  border-radius: 7px;
  transition: background-color 0.35s ease, box-shadow 0.35s ease;
}
.wv-block i {
  flex: 1;
  min-width: 1px;
  height: 7%;
  border-radius: 2px;
  background: currentColor;
  transition: height 0.55s var(--spring) calc(var(--k) * 18ms), background-color 0.3s ease;
}
.wv-base .wv-block {
  color: var(--line-2);
  background: repeating-linear-gradient(-45deg, transparent 0 5px, var(--line) 5px 6.5px);
}
.wv-base .wv-block.next {
  box-shadow: inset 0 0 0 1.5px var(--line-2);
}
.wv-base .wv-block.on {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 12%, var(--card));
  box-shadow: none;
}
.wv-block.on i {
  height: calc(8% + var(--h, 0.1) * 84%);
}
.wv-base .wv-block.on.cur {
  box-shadow: inset 0 0 0 1.5px var(--key);
}
body[data-print='clean'] .wv-base .wv-block.on.cur {
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 60%, transparent);
}
/* the "lit" copy: black ink over-prints the yellow as the playhead passes */
.wv-lit {
  pointer-events: none;
  clip-path: inset(-10px calc(100% - var(--p) * 100%) -10px -10px);
}
.wv-lit .wv-block {
  color: var(--key);
}
.wv-lit .wv-block:not(.on) i {
  opacity: 0;
}
.wv-head {
  position: absolute;
  top: -7px;
  bottom: -7px;
  left: calc(var(--p) * 100%);
  width: 2px;
  margin-left: -1px;
  border-radius: 2px;
  background: var(--key);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.wv-head.on {
  opacity: 1;
}
.wv-head span {
  position: absolute;
  top: -6px;
  left: 50%;
  width: 11px;
  height: 11px;
  margin-left: -5.5px;
  border-radius: 50%;
  background: var(--key);
  transform: scale(calc(0.75 + var(--lvl, 0) * 0.8));
}
.wv-labels {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.wv-labels span {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
  transition: color 0.25s ease;
}
.wv-labels span.on {
  color: var(--muted);
}
.wv-labels span.cur {
  color: var(--text);
  font-weight: 500;
}
.wv-labels span.next {
  color: var(--ink-text);
}
.wave.done .wv-labels span {
  color: var(--muted);
}

/* ---- Stage: play button, messages, the ticket ----------------------------------------------- */
.stage {
  min-height: 176px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px auto 14px;
}
.center[data-phase='reveal'] .stage {
  margin-top: 18px;
}

.play-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  animation: pop 0.45s var(--spring) both;
}
/* The spot: a drop of ink that breathes, and ripples while it plays */
.spot-btn {
  position: relative;
  width: 118px;
  height: 118px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--on-ink);
  border-radius: 47% 53% 52% 48% / 52% 46% 54% 48%;
  box-shadow: var(--hard);
  animation: blob 7s ease-in-out infinite alternate;
  transition: transform 0.18s var(--ease-out), box-shadow 0.2s ease, filter 0.2s ease;
}
.spot-btn:hover:not(:disabled) {
  transform: scale(1.04) rotate(-2deg);
}
.spot-btn:active:not(:disabled) {
  transform: scale(0.95);
  box-shadow: none;
}
.spot-btn.playing {
  animation-duration: 1.1s;
  transform: scale(calc(1 + var(--lvl, 0) * 0.07));
  transition: transform 0.06s linear;
}
.spot-btn::before,
.spot-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2.5px solid var(--ink);
  opacity: 0;
  pointer-events: none;
}
.spot-btn.playing::before {
  animation: ripple 1.2s ease-out infinite;
}
.spot-btn.playing::after {
  animation: ripple 1.2s ease-out 0.6s infinite;
}
.spot-btn.loading {
  filter: saturate(0.4);
  opacity: 0.75;
  animation: blob 1.6s ease-in-out infinite alternate;
}
.spot-btn .play-ic .ic {
  transform: translateX(3px);
}
.spot-btn.playing .play-ic .ic {
  transform: none;
}
@keyframes blob {
  0% { border-radius: 47% 53% 52% 48% / 52% 46% 54% 48%; }
  33% { border-radius: 53% 47% 45% 55% / 47% 55% 45% 53%; }
  66% { border-radius: 45% 55% 56% 44% / 55% 48% 52% 45%; }
  100% { border-radius: 52% 48% 47% 53% / 46% 52% 48% 54%; }
}
@keyframes ripple {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.55); opacity: 0; }
}
.play-info {
  min-width: 118px;
}
.play-time {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 46px;
  line-height: 1;
  letter-spacing: -0.05em;
}
.play-time.bump {
  animation: bump 0.45s var(--spring);
}
.play-worth {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.play-worth b {
  color: var(--ink-text);
  font-weight: 750;
}
.play-key {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--faint);
}
@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.stage-msg {
  max-width: 400px;
  text-align: center;
  animation: rise 0.4s var(--ease-out) both;
}
.stage-msg h3 {
  margin: 14px 0 6px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 23px;
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.stage-msg p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}
/* A spinning record while things load */
.record {
  position: relative;
  width: 74px;
  height: 74px;
  margin: 0 auto;
  border-radius: 50%;
  background: repeating-radial-gradient(circle at center, #1b1916 0 1.6px, #34302b 2.1px 3.2px);
  box-shadow: var(--hard-sm);
  animation: spin 1.5s linear infinite;
}
[data-mode='night'] .record {
  background: repeating-radial-gradient(circle at center, #050405 0 1.6px, #2c2a2e 2.1px 3.2px);
  box-shadow: 0 0 0 1.5px var(--line-2);
}
.record::before {
  content: '';
  position: absolute;
  inset: 31%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--ink) 0 88%, var(--on-ink) 88% 92%, var(--ink) 92%);
}
.record::after {
  content: '';
  position: absolute;
  inset: 46%;
  border-radius: 50%;
  background: var(--page);
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================================================
   Guessing
   ============================================================================================ */
.guess-row {
  display: flex;
  gap: 10px;
}
.search {
  position: relative;
  flex: 1;
  min-width: 0;
}
.search input {
  width: 100%;
  height: 54px;
  padding: 0 42px 0 44px;
  border-radius: var(--r);
  border: 2px solid var(--key);
  background: var(--card);
  font-size: 16px;
  font-weight: 550;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.25s ease;
}
.search input::placeholder {
  color: var(--faint);
  font-weight: 450;
}
.search input:focus {
  outline: none;
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}
.search input:disabled {
  opacity: 0.6;
}
.search.selected input {
  background: color-mix(in srgb, var(--ink) 22%, var(--card));
}
.search.shake {
  animation: shake 0.4s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-9px) rotate(-0.6deg); }
  40% { transform: translateX(7px) rotate(0.5deg); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}
.search-ic {
  position: absolute;
  z-index: 1;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  transition: translate 0.15s ease;
}
/* follow the box when it lifts on focus */
.search:focus-within .search-ic,
.search:focus-within .search-spin {
  translate: -2px -2px;
}
.search-spin {
  position: absolute;
  z-index: 1;
  right: 15px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border-radius: 50%;
  border: 2.5px solid var(--line-2);
  border-top-color: var(--key);
  opacity: 0;
  animation: spin 0.7s linear infinite;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.search.searching .search-spin {
  opacity: 1;
}

.skip-btn {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 54px;
  padding: 0 17px;
  border-radius: var(--r);
  border: 2px solid var(--key);
  background: var(--card);
  font-weight: 750;
  font-size: 15px;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background-color 0.25s ease, color 0.25s ease;
}
.skip-btn:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: var(--hard-sm);
}
.skip-btn:active:not(:disabled) {
  transform: translate(1px, 1px);
  box-shadow: none;
}
.skip-btn:disabled {
  opacity: 0.5;
}
.skip-btn .ic {
  width: 14px;
  height: 14px;
}
.skip-gain {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 12.5px;
  opacity: 0.7;
}
.skip-btn.hot {
  background: var(--key);
  color: var(--on-key);
}
.skip-btn.is-guess {
  background: var(--ink);
  color: var(--on-ink);
  box-shadow: var(--hard);
  animation: nudge 0.42s var(--spring);
}
@keyframes nudge {
  0% { transform: scale(0.9); }
  60% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  max-height: var(--sg-max, 330px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border-radius: var(--r);
  border: 2px solid var(--key);
  background: var(--card);
  box-shadow: var(--hard-lg);
  animation: sg-in 0.18s var(--ease-out);
}
.suggest.up {
  top: auto;
  bottom: calc(100% + 8px);
  animation-name: sg-up;
}
@keyframes sg-in {
  from { opacity: 0; transform: translateY(-6px); }
}
@keyframes sg-up {
  from { opacity: 0; transform: translateY(6px); }
}
.sg {
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  text-align: left;
  transition: background-color 0.12s ease;
}
.sg:hover {
  background: var(--card-2);
}
.sg.active {
  background: var(--ink);
  color: var(--on-ink);
}
.sg-title {
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.3;
}
.sg-artist {
  font-size: 13px;
  color: var(--muted);
}
.sg.active .sg-artist {
  color: inherit;
  opacity: 0.78;
}
.sg-note {
  padding: 9px 12px;
  font-size: 13px;
  color: var(--muted);
}

/* Guesses so far, like a scribbled setlist */
.attempts {
  display: grid;
  gap: 6px;
  margin: 14px auto 0;
  padding: 0;
  list-style: none;
}
.attempts:empty {
  display: none;
}
.att {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 13.5px;
  animation: slot-in 0.4s var(--ease-out) both;
}
.att-stage {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.att-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}
.att-by {
  font-weight: 450;
  color: var(--muted);
}
.att-tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.att-skip .att-text {
  color: var(--faint);
}
.att-wrong .att-text {
  text-decoration: line-through;
  text-decoration-color: var(--lost-ink);
  text-decoration-thickness: 2px;
}
.att-wrong .att-tag {
  color: var(--lost-text);
}
/* close calls get a highlighter swipe */
.att-artist .att-tag,
.att-title .att-tag {
  padding: 1px 4px;
  color: var(--text);
  background: linear-gradient(color-mix(in srgb, var(--ink) 60%, transparent), color-mix(in srgb, var(--ink) 60%, transparent)) 0 0 / 0% 100% no-repeat;
  animation: highlight 0.5s ease-out 0.25s forwards;
}
@keyframes highlight {
  to { background-size: 100% 100%; }
}
@keyframes slot-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
}

/* ============================================================================================
   The ticket: prints out of a slot, gets stamped, tears off
   ============================================================================================ */
.reveal {
  --stub-w: 108px;
  position: relative;
  width: 100%;
  padding-top: 8px;
}
.reveal::before {
  content: '';
  position: absolute;
  left: 8%;
  right: 8%;
  top: 0;
  height: 5px;
  border-radius: 3px;
  background: var(--key);
  opacity: 0;
  animation: slot 1s ease both;
}
@keyframes slot {
  0% { opacity: 0.9; }
  70% { opacity: 0.9; }
  100% { opacity: 0; }
}
.ticket-area {
  position: relative;
  animation: thud 0.3s ease-out 0.8s;
}
.ticket-wrap {
  filter: var(--drop);
}
.ticket {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--stub-w);
  background: var(--card);
  border-radius: var(--r);
  /* the notches at both ends of the perforation */
  -webkit-mask:
    radial-gradient(circle 10px at calc(100% - var(--stub-w)) 0, #0000 97%, #000) top / 100% 51% no-repeat,
    radial-gradient(circle 10px at calc(100% - var(--stub-w)) 100%, #0000 97%, #000) bottom / 100% 51% no-repeat;
  mask:
    radial-gradient(circle 10px at calc(100% - var(--stub-w)) 0, #0000 97%, #000) top / 100% 51% no-repeat,
    radial-gradient(circle 10px at calc(100% - var(--stub-w)) 100%, #0000 97%, #000) bottom / 100% 51% no-repeat;
  animation: print 0.62s cubic-bezier(0.3, 0.7, 0.3, 1) both;
}
@keyframes print {
  0% { clip-path: inset(0 0 100% 0); transform: translateY(-22px); }
  75% { clip-path: inset(0 0 0 0); transform: translateY(0); }
  100% { clip-path: inset(0 0 0 0); transform: none; }
}
.tk-main {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 18px 18px 18px 18px;
  min-width: 0;
}
.tk-cover {
  position: relative;
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  overflow: hidden;
  background: var(--card-2);
  color: var(--faint);
}
.tk-cover > .ic {
  position: absolute;
}
.tk-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
.rv-toggle {
  position: relative;
  z-index: 2;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(20, 18, 16, 0.62);
  color: #fff;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: transform 0.2s var(--spring), opacity 0.2s ease;
}
.tk-cover:hover .rv-toggle {
  transform: scale(1.1);
}
.rv-toggle .ic {
  width: 18px;
  height: 18px;
}
.tk-cover:not(.paused) .rv-toggle {
  opacity: 0.85;
}
.rv-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  height: 4px;
  background: rgba(0, 0, 0, 0.3);
}
.rv-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink);
}
.tk-body {
  min-width: 0;
}
.tk-kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-text);
  animation: rise 0.45s var(--ease-out) 0.25s both;
}
.reveal.lost .tk-kicker {
  color: var(--lost-text);
}
.caret {
  animation: blink 1s steps(1) infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}
.tk-title {
  margin-top: 4px;
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 86%;
  font-size: 25px;
  line-height: 1.02;
  letter-spacing: -0.03em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  animation: rise 0.45s var(--ease-out) 0.32s both;
}
.tk-meta {
  margin-top: 5px;
  font-size: 13.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: rise 0.45s var(--ease-out) 0.38s both;
}
.tk-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 9px;
  animation: rise 0.45s var(--ease-out) 0.44s both;
}
.rv-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.rv-link:hover {
  color: var(--ink-text);
}
.tk-stub {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 14px 8px;
  border-left: 2px dashed var(--line-2);
  text-align: center;
  background: color-mix(in srgb, var(--ink) 16%, var(--card));
}
.tk-admit {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.tk-no {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 14px;
}
.tk-venue {
  font-weight: 750;
  font-size: 12.5px;
}
.tk-points {
  margin-top: 2px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 27px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink-text);
  animation: float-up 1.1s var(--spring) 0.7s both;
}
.reveal.lost .tk-points {
  color: var(--faint);
}
@keyframes float-up {
  0% { transform: translateY(14px) scale(0.6); opacity: 0; }
  100% { transform: none; opacity: 1; }
}
/* The rubber stamp */
.tk-stamp {
  position: absolute;
  right: calc(var(--stub-w) + 14px);
  bottom: -14px;
  z-index: 3;
  padding: 5px 12px 6px;
  border: 3px solid currentColor;
  border-radius: 9px;
  color: var(--won-ink);
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 78%;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  mix-blend-mode: var(--blend);
  transform: rotate(-8deg);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='s'><feTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  -2.4 0 0 0 2.05'/></filter><rect width='160' height='160' filter='url(%23s)'/></svg>");
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='s'><feTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  -2.4 0 0 0 2.05'/></filter><rect width='160' height='160' filter='url(%23s)'/></svg>");
  animation: stamp 0.46s cubic-bezier(0.2, 0.9, 0.3, 1.3) 0.52s both;
}
.reveal.lost .tk-stamp {
  color: var(--lost-ink);
  transform: rotate(6deg);
  animation-name: stamp-lost;
}
@keyframes stamp {
  0% { opacity: 0; transform: rotate(-20deg) scale(2.3); }
  70% { opacity: 1; transform: rotate(-7deg) scale(0.94); }
  100% { opacity: 1; transform: rotate(-8deg) scale(1); }
}
@keyframes stamp-lost {
  0% { opacity: 0; transform: rotate(18deg) scale(2.3); }
  70% { opacity: 1; transform: rotate(5deg) scale(0.94); }
  100% { opacity: 1; transform: rotate(6deg) scale(1); }
}
/* the whole ticket jolts when the stamp lands (see .ticket-area) */
@keyframes thud {
  0%, 100% { transform: none; }
  30% { transform: translateY(3px) scale(0.995); }
}
.rv-actions {
  display: flex;
  gap: 10px;
  margin-top: 30px;
  animation: rise 0.45s var(--ease-out) 0.55s both;
}
.rv-actions .btn {
  flex: 1;
}
.rv-actions .btn-next {
  flex: 1.2;
}
/* Next song: the ticket gets torn off */
.reveal.tearing .ticket-area {
  animation: tear 0.4s cubic-bezier(0.5, 0, 0.8, 0.4) forwards;
}
.reveal.tearing .rv-actions {
  animation: fade-out 0.2s ease forwards;
}
@keyframes tear {
  0% { transform: none; opacity: 1; }
  22% { transform: rotate(-2.5deg) translateY(-6px); opacity: 1; }
  100% { transform: rotate(5deg) translate(26px, 90px); opacity: 0; }
}
@keyframes fade-out {
  to { opacity: 0; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
}
@keyframes pop {
  from { opacity: 0; transform: scale(0.94); }
}
.switcher,
.sheet-options .ui-opts-body {
  transform-origin: top center;
}
.switcher {
  animation-name: switcher-in;
}
@keyframes switcher-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px) scale(0.97); }
}
@keyframes fade-in {
  from { opacity: 0; }
}

/* ============================================================================================
   Bottom sheet (phones / tablets)
   ============================================================================================ */
.sheet-root {
  position: fixed;
  inset: 0;
  z-index: 70;
  visibility: hidden;
  transition: visibility 0s linear 0.34s;
}
.sheet-root.open {
  visibility: visible;
  transition: none;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  background: var(--backdrop);
  opacity: 0;
  transition: opacity 0.28s ease;
}
.sheet-root.open .sheet-backdrop {
  opacity: 1;
}
.sheet {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(580px, 100%);
  max-height: min(90dvh, 860px);
  display: flex;
  flex-direction: column;
  padding-bottom: var(--safe-b);
  border-radius: 24px 24px 0 0;
  background: var(--page);
  border: 2px solid var(--key);
  border-bottom: 0;
  box-shadow: 0 -14px 40px rgba(0, 0, 0, 0.22);
  transform: translate(-50%, 102%);
  transition: transform 0.36s cubic-bezier(0.2, 0.9, 0.25, 1);
}
.sheet-root.open .sheet {
  transform: translate(-50%, calc(var(--drag, 0px)));
}
.sheet.dragging {
  transition: none;
}
.sheet-grip {
  flex: none;
  width: 46px;
  height: 5px;
  margin: 10px auto 0;
  border-radius: 3px;
  background: var(--line-2);
}
.sheet-head {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px 12px;
  touch-action: none;
}
.sheet-title {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 84%;
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.035em;
  text-shadow: var(--misreg);
}
.sheet-head p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.sheet-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 20px 18px;
}
.sheet-main .side,
.sheet-options .side {
  position: static;
  max-height: none;
  overflow: visible;
  padding: 6px 0 4px;
  border: 0;
}
.sheet-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 50px;
  margin-top: 16px;
  padding: 0 16px;
  border-radius: var(--r);
  border: 2px solid var(--key);
  background: var(--card);
  font-weight: 750;
  font-size: 15px;
}
.sheet-toggle .ic {
  transition: transform 0.25s ease;
}
.sheet-toggle[aria-expanded='true'] .ic {
  transform: rotate(180deg);
}
.sheet-options {
  padding-top: 6px;
  animation: rise 0.3s var(--ease-out) both;
}
.sheet-label {
  margin: 24px 0 10px;
}
.sheet-foot {
  flex: none;
  padding: 12px 20px 14px;
  border-top: 1.5px dashed var(--line-2);
}
.drawer-list {
  display: grid;
  gap: 6px;
}
.drawer-card {
  width: 100%;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 7px 10px 7px 7px;
  border-radius: var(--r-sm);
  background: var(--card);
  border: 1.5px solid var(--line);
  text-align: left;
  transition: border-color 0.2s ease;
}
.drawer-card:hover {
  border-color: var(--key);
}
.drawer-card.current {
  border-color: var(--key);
  box-shadow: var(--hard-sm);
}
.dc-art {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  overflow: hidden;
  background: var(--card-2);
}
.dc-art.round {
  border-radius: 50%;
}
.dc-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dc-title {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dc-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dc-go {
  color: var(--faint);
}

/* ============================================================================================
   Modal (settings, setlist stubs)
   ============================================================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--backdrop);
  animation: fade-in 0.18s ease;
}
.modal {
  position: fixed;
  z-index: 81;
  left: 50%;
  top: 50%;
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px - var(--safe-t) - var(--safe-b));
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  border: 2px solid var(--key);
  background: var(--page);
  box-shadow: var(--hard-lg);
  transform: translate(-50%, -50%);
  animation: modal-in 0.28s var(--spring);
}
.modal.small {
  width: min(480px, calc(100vw - 32px));
}
@keyframes modal-in {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.97); }
}
.modal-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px 24px;
  border-bottom: 1.5px dashed var(--line-2);
}
.modal-head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 86%;
  font-size: 26px;
  letter-spacing: -0.035em;
}
.modal-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 24px 24px;
}
.set-sec {
  padding: 18px 0;
  border-bottom: 1.5px dashed var(--line-2);
}
.set-sec:last-child {
  border-bottom: 0;
}
.set-sec h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 10px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.015em;
}
.set-sec h3 .ic {
  color: var(--ink-text);
}
.set-sec .opt-stack {
  gap: 8px;
}
.fine {
  margin: 8px 0;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
}
.fine b {
  color: var(--text);
}
.pill-ok {
  padding: 3px 8px;
  border-radius: 999px;
  background: #1ed760;
  color: #0b0c0b;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
}
.field-label {
  display: block;
  margin: 14px 0 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.field-row {
  display: flex;
  gap: 8px;
}
.field {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  border: 2px solid var(--line-2);
  background: var(--card);
  font-size: 16px;
}
.field:focus {
  outline: none;
  border-color: var(--key);
}
.field.code {
  display: flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 12.5px;
  overflow-x: auto;
  white-space: nowrap;
}
.steps {
  margin: 12px 0 0;
  padding-left: 20px;
  font-size: 13.5px;
  color: var(--muted);
}
.steps li {
  margin: 5px 0;
}
.phone-box {
  display: flex;
  align-items: center;
  gap: 16px;
}
.qr {
  flex: none;
  padding: 8px;
  border-radius: var(--r-sm);
  background: #fff;
  border: 2px solid var(--key);
}
.qr img,
.qr canvas {
  display: block;
}
.phone-text {
  flex: 1;
  min-width: 0;
}
.phone-text .field-row {
  align-items: center;
  margin: 8px 0;
}
.phone-text .field.code {
  height: auto;
  min-height: 44px;
  padding-block: 8px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.keys {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  margin: 0;
  font-size: 13.5px;
}
.keys dt {
  display: flex;
  gap: 4px;
  align-items: center;
}
.keys dd {
  margin: 0;
  color: var(--muted);
}
kbd {
  display: inline-block;
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1.5px solid var(--key);
  border-bottom-width: 3px;
  background: var(--card);
  font-family: var(--mono);
  font-size: 12px;
  text-align: center;
}

/* "Your ear": how fast you name songs */
.ear {
  display: grid;
  gap: 6px;
  margin: 6px 0 4px;
}
.ear-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.ear-bar {
  height: 20px;
  border-radius: 5px;
  background: var(--line);
  overflow: hidden;
}
.ear-bar span {
  display: block;
  height: 100%;
  min-width: 3px;
  border-radius: 5px;
  background: var(--ink);
  transform-origin: left;
  animation: grow 0.7s var(--ease-out) calc(var(--i) * 70ms) both;
}
.ear-row.missed .ear-bar span {
  background: var(--line-2);
}
.ear-row b {
  color: var(--text);
  font-weight: 500;
  text-align: right;
}
.ear-summary {
  margin: 10px 0 0;
  font-size: 13.5px;
}
@keyframes grow {
  from { transform: scaleX(0); }
}

/* A stub from the setlist, reopened */
.stub {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}
.stub-cover {
  position: relative;
  width: 110px;
  height: 110px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  overflow: hidden;
  background: var(--card-2);
  color: var(--faint);
  border: 2px solid var(--key);
  box-shadow: var(--hard-sm);
}
.stub-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.stub-title {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 86%;
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.stub-meta {
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--muted);
}
.stub-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.fact {
  padding: 3px 8px;
  border-radius: 5px;
  border: 1.5px solid var(--line-2);
  font-family: var(--mono);
  font-size: 11.5px;
}
.fact.ink {
  background: var(--t, var(--ink));
  border-color: transparent;
  color: var(--t-on, var(--on-ink));
}
.fact.lost {
  border-color: var(--lost-ink);
  color: var(--lost-text);
}
.stub-listen {
  margin-top: 18px;
}
.stub-bar {
  height: 4px;
  margin-top: 10px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}
.stub-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink);
}

/* ============================================================================================
   Toasts & confetti
   ============================================================================================ */
.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(92px + var(--safe-b));
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}
body[data-view='game'] .toasts {
  bottom: calc(24px + var(--safe-b));
}
.toast {
  padding: 11px 16px;
  border-radius: var(--r);
  border: 2px solid var(--key);
  background: var(--card);
  box-shadow: var(--hard);
  font-weight: 650;
  font-size: 14px;
  text-align: center;
  opacity: 0;
  transform: translateY(14px) rotate(-1deg);
  transition: opacity 0.22s ease, transform 0.3s var(--spring);
}
.toast.show {
  opacity: 1;
  transform: none;
}
.toast-ok {
  background: var(--ink);
  color: var(--on-ink);
}
.toast-warn {
  border-color: var(--key);
  background: color-mix(in srgb, #ffb511 35%, var(--card));
}
.toast-error {
  border-color: var(--lost-ink);
  color: var(--lost-text);
}
.confetti {
  position: fixed;
  inset: 0;
  z-index: 95;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ============================================================================================
   Responsive
   ============================================================================================ */
@media (max-width: 1239px) {
  .game {
    grid-template-columns: 218px minmax(0, 1fr) 206px;
  }
  .side {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Phones & tablets: the game alone; the side panels live in the bottom sheet */
@media (max-width: 999px) {
  .menu-btn {
    display: grid;
  }
  .brand {
    display: none;
  }
  .topbar {
    gap: 10px;
    padding-left: calc(14px + var(--safe-l));
    padding-right: calc(14px + var(--safe-r));
  }
  .game {
    display: block;
  }
  .game > .side {
    display: none;
  }
  .center {
    padding: clamp(10px, calc((100dvh - var(--topbar-h) - 520px) / 2), 180px) 20px calc(40px + var(--safe-b));
  }
  .row-arrows {
    display: none;
  }
}

@media (max-width: 640px) {
  :root {
    --topbar-h: 58px;
  }
  body {
    font-size: 14.5px;
  }
  .topbar {
    gap: 8px;
  }
  .nav-btn {
    height: 34px;
    padding: 0 12px;
    font-size: 13.5px;
    gap: 6px;
  }
  .stat-chip {
    height: 34px;
    padding: 0 10px;
    gap: 5px;
    font-size: 12.5px;
  }
  .round-btn {
    width: 38px;
    height: 38px;
  }
  .lib {
    padding: 14px calc(18px + var(--safe-r)) 130px calc(18px + var(--safe-l));
  }
  .lib-hero {
    margin: 16px auto 34px;
  }
  .lib-hero h1 {
    font-size: clamp(38px, 11.5vw, 54px);
  }
  .link-form {
    flex-direction: column;
  }
  .link-form input {
    flex: none;
  }
  .link-ic {
    top: 19px;
  }
  .link-form .btn {
    height: 52px;
  }
  .how {
    flex-direction: column;
    align-items: flex-start;
    width: max-content;
    max-width: 100%;
    margin: 22px auto 0;
    gap: 8px;
    text-align: left;
  }
  .row-scroll {
    grid-auto-columns: 138px;
    gap: 16px;
  }
  .row-head h2 {
    font-size: 20px;
  }
  .connect-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
  }
  .connect-card .btn,
  .connect-card .btn-col {
    width: 100%;
  }
  .center {
    padding-left: calc(16px + var(--safe-l));
    padding-right: calc(16px + var(--safe-r));
  }
  .poster {
    margin-bottom: 12px;
  }
  .poster-title {
    font-size: clamp(30px, 9vw, 40px);
  }
  .poster-title.long {
    font-size: clamp(24px, 7vw, 30px);
  }
  .tabs {
    flex-wrap: nowrap;
    gap: 5px;
    margin-bottom: 16px;
  }
  .tab {
    flex: 1 1 auto;
    height: 32px;
    padding: 0 6px;
    font-size: 12px;
  }
  .tab-dot {
    display: none;
  }
  .pm-opt {
    display: none;
  }
  .wv-frame {
    height: 62px;
  }
  .wv-track,
  .wv-labels {
    gap: 4px;
  }
  .wv-block {
    padding: 0 3px;
    gap: 1.5px;
  }
  .stage {
    min-height: 150px;
    margin: 8px auto 10px;
  }
  .spot-btn {
    width: 100px;
    height: 100px;
  }
  .play-wrap {
    gap: 20px;
  }
  .play-time {
    font-size: 40px;
  }
  .play-key {
    display: none;
  }
  .search input,
  .skip-btn {
    height: 52px;
  }
  .skip-btn {
    padding: 0 13px;
    font-size: 14px;
  }
  .reveal {
    --stub-h: 64px;
  }
  .ticket {
    grid-template-columns: minmax(0, 1fr);
    -webkit-mask:
      radial-gradient(circle 10px at 0 calc(100% - var(--stub-h)), #0000 97%, #000) left / 51% 100% no-repeat,
      radial-gradient(circle 10px at 100% calc(100% - var(--stub-h)), #0000 97%, #000) right / 51% 100% no-repeat;
    mask:
      radial-gradient(circle 10px at 0 calc(100% - var(--stub-h)), #0000 97%, #000) left / 51% 100% no-repeat,
      radial-gradient(circle 10px at 100% calc(100% - var(--stub-h)), #0000 97%, #000) right / 51% 100% no-repeat;
  }
  .tk-main {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
  }
  .tk-cover {
    width: 84px;
    height: 84px;
  }
  .tk-title {
    font-size: 22px;
  }
  .tk-stub {
    height: var(--stub-h);
    flex-direction: row;
    justify-content: space-between;
    gap: 10px;
    padding: 0 18px;
    border-left: 0;
    border-top: 2px dashed var(--line-2);
  }
  .tk-points {
    font-size: 24px;
    margin: 0;
  }
  .tk-stamp {
    right: 14px;
    bottom: calc(var(--stub-h) - 16px);
    font-size: 16px;
  }
  .rv-actions {
    margin-top: 22px;
  }
  .modal {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-height: calc(94dvh - var(--safe-t));
    padding-bottom: var(--safe-b);
    border-radius: 22px 22px 0 0;
    border-width: 2px 0 0;
    transform: none;
    animation: sheet-up 0.34s cubic-bezier(0.2, 0.9, 0.25, 1);
  }
  .modal.small {
    width: 100%;
  }
  .modal-body {
    padding: 4px 20px 22px;
  }
  .stub {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 14px;
  }
  .stub-cover {
    width: 88px;
    height: 88px;
  }
  .phone-box {
    flex-direction: column;
    align-items: flex-start;
  }
  .phone-text {
    align-self: stretch;
  }
  @keyframes sheet-up {
    from { transform: translateY(100%); }
  }
}

@media (max-width: 380px) {
  .stat-chip:nth-child(2) {
    display: none;
  }
  .nav-btn .ic {
    display: none;
  }
  .play-time {
    font-size: 34px;
  }
  .spot-btn {
    width: 90px;
    height: 90px;
  }
  .skip-gain {
    display: none;
  }
}

@media (hover: none) {
  .card:hover {
    transform: rotate(var(--rot, 0deg));
  }
  body[data-print='clean'] .card:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  .kicker-dot,
  .spot-btn,
  .record {
    animation: none !important;
  }
}
