@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

/* Registered so the colours can fade smoothly when the song (and cover) changes */
@property --tint-1 { syntax: "<color>"; inherits: true; initial-value: #3A1A0C; }
@property --tint-2 { syntax: "<color>"; inherits: true; initial-value: #8A3414; }
@property --accent { syntax: "<color>"; inherits: true; initial-value: #FF8A3D; }

:root {
  color-scheme: dark;
  --tint-1: #3A1A0C;
  --tint-2: #8A3414;
  --accent: #FF8A3D;
  --accent-ink: #1A0F09;
  --base: #0B0806;
  --text: #FFF8F0;
  --muted: rgba(255, 248, 240, 0.64);
  --faint: rgba(255, 248, 240, 0.4);
  --glass: rgba(255, 255, 255, 0.07);
  --glass-strong: rgba(255, 255, 255, 0.13);
  --glass-border: rgba(255, 255, 255, 0.1);
  --radius: 24px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Bricolage Grotesque", ui-rounded, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; }

body {
  background: var(--base);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.app {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow-x: hidden;
  transition: --tint-1 1.4s ease, --tint-2 1.4s ease, --accent 1.4s ease;
}

/* ---- Living background, coloured by the current cover ---- */

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(180deg, var(--tint-1), var(--base) 75%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--tint-1) 85%, #000), var(--base) 78%);
}

.blob {
  position: absolute;
  width: 75vmax;
  height: 75vmax;
  border-radius: 50%;
  mix-blend-mode: screen;
  will-change: transform;
}

.b1 {
  top: -32vmax;
  left: -24vmax;
  background: radial-gradient(circle, var(--accent), transparent 62%);
  opacity: 0.42;
  animation: drift-1 36s ease-in-out infinite alternate;
}

.b2 {
  right: -30vmax;
  bottom: -34vmax;
  background: radial-gradient(circle, var(--tint-2), transparent 64%);
  opacity: 0.75;
  animation: drift-2 44s ease-in-out infinite alternate;
}

.b3 {
  top: 28%;
  left: 38%;
  width: 55vmax;
  height: 55vmax;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 55%, var(--tint-2)), transparent 60%);
  opacity: 0.28;
  animation: drift-3 52s ease-in-out infinite alternate;
}

/* Fine film grain so the gradients don't band */
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.07;
  mix-blend-mode: overlay;
}

/* ---- Header ---- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1180px;
  margin: 0 auto 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.brand img {
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.status { display: flex; align-items: center; gap: 8px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.live-badge { letter-spacing: 0.06em; text-transform: uppercase; }

.live-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
}

.live-badge[data-live="true"] { color: var(--text); }
.live-badge[data-live="true"]::before {
  background: #FF4D4F;
  box-shadow: 0 0 0 0 rgba(255, 77, 79, 0.6);
  animation: live-ring 2s ease-out infinite;
}

.listeners svg { width: 15px; height: 15px; fill: currentColor; }

/* ---- Layout ---- */

.layout {
  display: grid;
  gap: 30px;
  max-width: 1180px;
  margin: 0 auto;
}

.player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  text-align: center;
}

/* ---- Cover art + vinyl ---- */

.art-wrap {
  position: relative;
  width: min(100%, 340px);
  aspect-ratio: 1;
}

.art {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  overflow: hidden;
  background: var(--glass);
  box-shadow: 0 26px 50px -14px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.06);
  transform: scale(0.86);
  transition: transform 0.7s var(--ease), box-shadow 0.7s var(--ease);
}

.app[data-playing="true"] .art {
  transform: scale(1);
  box-shadow: 0 40px 80px -18px rgba(0, 0, 0, 0.75), 0 0 70px -12px color-mix(in srgb, var(--accent) 55%, transparent), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.cover {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.9s ease, transform 1.2s var(--ease);
}

.cover.is-front { opacity: 1; transform: scale(1); }

.vinyl {
  position: absolute;
  top: 5%;
  left: 5%;
  display: none;
  width: 90%;
  height: 90%;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 31%, rgba(255, 255, 255, 0.05) 31.5%, transparent 33%),
    repeating-radial-gradient(circle, #121212 0 1.5px, #1c1c1c 1.5px 3px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  transform: scale(0.86);
  transition: transform 0.9s var(--ease);
}

/* Light catching the grooves; stays put while the label turns */
.vinyl::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 30deg, transparent 0 12%, rgba(255, 255, 255, 0.1) 18%, transparent 26% 62%, rgba(255, 255, 255, 0.07) 68%, transparent 76%);
}

.vinyl-label {
  position: absolute;
  inset: 34%;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 3px #0d0d0d;
  animation: spin 5s linear infinite;
  animation-play-state: paused;
}

.vinyl-label img { width: 100%; height: 100%; object-fit: cover; display: block; }

.vinyl-label::after {
  content: "";
  position: absolute;
  inset: 44%;
  border-radius: 50%;
  background: var(--base);
}

.app[data-playing="true"] .vinyl-label { animation-play-state: running; }

/* ---- Song info ---- */

.meta { width: 100%; min-width: 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.eq { display: none; align-items: flex-end; gap: 2px; height: 12px; }
.eq i { display: block; width: 3px; height: 100%; border-radius: 2px; background: currentColor; transform-origin: bottom; animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -0.45s; }
.eq i:nth-child(3) { animation-delay: -0.2s; }
.eq i:nth-child(4) { animation-delay: -0.65s; }
.app[data-playing="true"] .eq { display: inline-flex; }

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 7vw, 2.6rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.artist {
  margin: 8px 0 0;
  font-size: 1.1rem;
  font-weight: 650;
}

.album {
  margin: 4px 0 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.album:empty { display: none; }

.meta.enter > * { animation: rise 0.7s var(--ease) both; }
.meta.enter > :nth-child(2) { animation-delay: 0.05s; }
.meta.enter > :nth-child(3) { animation-delay: 0.1s; }
.meta.enter > :nth-child(4) { animation-delay: 0.15s; }

/* ---- Progress ---- */

.progress { width: 100%; }

.bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 70%, #fff), var(--accent));
  box-shadow: 0 0 14px var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}

.times {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--faint);
}

/* ---- Controls ---- */

.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
}

.play {
  position: relative;
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 14px 34px -6px color-mix(in srgb, var(--accent) 70%, transparent);
  cursor: pointer;
  transition: transform 0.2s var(--ease), background-color 1.4s ease;
}

.play::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
}

.app[data-playing="true"] .play::after { animation: ring 2.4s ease-out infinite; }

.play:hover { transform: scale(1.05); }
.play:active { transform: scale(0.95); }
.play:focus-visible { outline: 3px solid var(--text); outline-offset: 6px; }

.play svg { width: 34px; height: 34px; fill: currentColor; }
.play .i-pause,
.play .spinner { display: none; }
.play[data-state="playing"] .i-play,
.play[data-state="loading"] .i-play { display: none; }
.play[data-state="playing"] .i-pause { display: block; }
.play[data-state="loading"] .spinner { display: block; }

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.volume {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 240px);
  color: var(--faint);
}

.volume svg { flex: none; width: 20px; height: 20px; fill: currentColor; }
.volume input { flex: 1; accent-color: var(--accent); }

.notice {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.notice:empty { display: none; }

.install {
  padding: 10px 18px;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.install svg { width: 18px; height: 18px; fill: currentColor; }

.ios-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---- Lyrics / recently played panel ---- */

.panel {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  background: var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  backdrop-filter: blur(28px) saturate(150%);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.tabs {
  display: flex;
  gap: 4px;
  margin: 10px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
}

.tab {
  flex: 1;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.tab[aria-selected="true"] {
  background: var(--glass-strong);
  color: var(--text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.tab-panel { padding: 4px 22px 20px; }

.lyrics-stage { position: relative; }

.lyrics {
  position: relative;
  max-height: min(58vh, 540px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.lyrics::-webkit-scrollbar { display: none; }
.lyrics:empty { display: none; }

/* Room above and below, so the line being sung can sit a third of the way down */
.lyrics[data-synced="true"] {
  padding: min(19vh, 180px) 0 min(40vh, 360px);
  -webkit-mask-image: linear-gradient(transparent, #000 13%, #000 78%, transparent);
  mask-image: linear-gradient(transparent, #000 13%, #000 78%, transparent);
}

.line {
  --d: 3; /* how many lines away from the one being sung */
  margin: 0;
  padding: 8px 6% 8px 0; /* room on the right for the sung line to grow */
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 5.4vw, 1.7rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
  color: var(--text);
  opacity: 0.9;
  transform-origin: left center;
  transition: opacity 0.5s ease, transform 0.6s var(--ease), text-shadow 0.5s ease; /* not filter: blurring is costly to animate */
}

/* Lines fade and soften the further they are from the one being sung */
.lyrics.syncing .line {
  opacity: max(0.14, calc(0.5 - var(--d) * 0.07));
  filter: blur(calc(min(var(--d), 5) * 0.32px));
  transform: scale(0.965);
}

.lyrics.syncing .line.past { opacity: max(0.1, calc(0.34 - var(--d) * 0.05)); }

.lyrics.syncing .line.active {
  opacity: 1;
  filter: none;
  transform: none;
  text-shadow: 0 0 32px color-mix(in srgb, var(--accent) 50%, transparent);
}

/* Backing vocals, written in brackets */
.bv { font-size: 0.8em; font-weight: 650; opacity: 0.66; }

/* Word-by-word lyrics: the sung line's words light up as they're sung, with a soft edge */
.lyrics.syncing .line.active.has-words {
  text-shadow: none; /* a text shadow would paint over the filling word */
  filter: drop-shadow(0 0 22px color-mix(in srgb, var(--accent) 42%, transparent));
}

.lyrics.syncing .line.active .word { color: color-mix(in srgb, var(--text) 36%, transparent); }
.lyrics.syncing .line.active .word.sung { color: var(--text); }
.lyrics.syncing .line.active .word.singing {
  color: transparent;
  background: linear-gradient(90deg, var(--text) calc(var(--fill, 0%) - 7%), color-mix(in srgb, var(--text) 36%, transparent) calc(var(--fill, 0%) + 7%));
  -webkit-background-clip: text;
  background-clip: text;
}

/* Instrumental breaks and intros: three dots that breathe and fill in until singing resumes */
.line.gap {
  display: flex;
  gap: 0.24em;
  padding-top: 0.45em;
  padding-bottom: 0.45em;
}

.gap-dot {
  width: 0.34em;
  height: 0.34em;
  border-radius: 50%;
  background: var(--text);
  opacity: 0.3;
  transition: opacity 0.25s linear;
}

.lyrics.syncing .line.gap.active { animation: breathe 2.6s ease-in-out infinite; }

/* Words-only lyrics */
.plain {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: color-mix(in srgb, var(--text) 86%, transparent);
}

.plain p { margin: 0; }
.plain .stanza { margin-bottom: 1.05em; }

.plain .section {
  margin: 0.2em 0 0.45em;
  font-family: var(--font);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Status: an empty state when there's nothing to show, a small note above words-only lyrics */
.lyrics-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 44px 16px 36px;
  text-align: center;
  color: var(--muted);
}

.lyrics-status[data-kind=""] { display: none; }
.lyrics-status p { margin: 0; max-width: 30ch; font-size: 0.95rem; line-height: 1.45; }

.lyrics-status svg {
  width: 44px;
  height: 44px;
  padding: 11px;
  border-radius: 50%;
  background: var(--glass-strong);
  fill: var(--accent);
}

.lyrics-status[data-kind="instrumental"] svg { animation: bob 2.4s ease-in-out infinite; }

.lyrics-status[data-kind="note"] {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  margin: 2px 0 18px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  text-align: left;
}

.lyrics-status[data-kind="note"] svg { flex: none; width: 22px; height: 22px; padding: 0; background: none; }
.lyrics-status[data-kind="note"] p { max-width: none; font-size: 0.82rem; }

/* While looking lyrics up: placeholder lines, with the message kept for screen readers */
.lyrics-skeleton { display: none; padding: 26px 0 14px; }

.lyrics-skeleton i {
  display: block;
  height: 1.15rem;
  margin: 0 0 16px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--glass) 30%, var(--glass-strong) 50%, var(--glass) 70%) 0 0 / 300% 100%;
  animation: shimmer 1.6s linear infinite;
}

.lyrics-skeleton i:nth-child(1) { width: 72%; }
.lyrics-skeleton i:nth-child(2) { width: 54%; }
.lyrics-skeleton i:nth-child(3) { width: 82%; }
.lyrics-skeleton i:nth-child(4) { width: 46%; }
.lyrics-skeleton i:nth-child(5) { width: 64%; }

.lyrics-stage[data-state="loading"] .lyrics-skeleton { display: block; }

.lyrics-stage[data-state="loading"] .lyrics-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.lyrics-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.credit {
  margin: 0;
  font-size: 0.72rem;
  color: var(--faint);
}

.credit a { color: inherit; }

.icon-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--glass-strong);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s var(--ease);
}

.icon-btn:hover { background: rgba(255, 255, 255, 0.2); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; }

/* ---- The line being sung, under the song title (phones), opens full-screen lyrics ---- */

.now-line {
  display: flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  max-width: 100%;
  margin: 16px auto 0;
  padding: 9px 16px 9px 12px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 650;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s var(--ease);
}

.now-line:active { transform: scale(0.97); }
.now-line:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.now-line svg { flex: none; width: 16px; height: 16px; fill: var(--accent); }
.now-line-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-line-text.swap { animation: rise 0.45s var(--ease); }

/* ---- Full-screen lyrics ---- */

body.lyrics-open { overflow: hidden; }

.lyrics-view {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: max(14px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background: var(--base);
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.3s ease, transform 0.45s var(--ease);
}

.lyrics-view.open { opacity: 1; transform: none; }

.lv-backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(170deg, color-mix(in srgb, var(--tint-2) 70%, #000), color-mix(in srgb, var(--tint-1) 80%, #000) 70%);
}

.lv-backdrop img {
  position: absolute;
  inset: -25%;
  width: 150%;
  height: 150%;
  object-fit: cover;
  filter: blur(72px) saturate(1.6) brightness(0.62);
  opacity: 0.85;
}

.lv-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.5));
}

.lv-head,
.lv-body,
.lv-foot {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
}

.lv-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
  touch-action: none; /* swipe down here to close */
}

/* A handle, hinting that it can be swiped down */
.lv-head::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  width: 38px;
  height: 5px;
  margin-left: -19px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.28);
}

.lv-thumb {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.6);
}

.lv-meta { flex: 1; min-width: 0; }

.lv-title,
.lv-artist {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lv-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em; }
.lv-artist { margin-top: 2px; font-size: 0.86rem; color: var(--muted); }

.lv-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.lv-body .lyrics-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.lv-body .lyrics { flex: 1; max-height: none; }
.lv-body .lyrics[data-synced="true"] {
  padding: 26vh 0 54vh;
  -webkit-mask-image: linear-gradient(transparent, #000 20%, #000 76%, transparent);
  mask-image: linear-gradient(transparent, #000 20%, #000 76%, transparent);
}
.lv-body .lyrics:not([data-synced="true"]) { padding: 22px 0 48px; }
.lv-body .line { font-size: clamp(1.8rem, 7.4vw, 3rem); padding-top: 10px; padding-bottom: 10px; }
.lv-body .plain { font-size: clamp(1.2rem, 4.8vw, 1.65rem); }
.lv-body .lyrics-status { margin: auto 0; }
.lv-body .lyrics-status[data-kind="note"] { margin: 18px 0 0; }

.lv-foot {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-top: 12px;
}

.lv-progress { flex: 1; min-width: 0; }
.lv-progress[hidden] { display: block !important; visibility: hidden; }

.play-small { width: 56px; height: 56px; box-shadow: 0 10px 26px -6px color-mix(in srgb, var(--accent) 70%, transparent); }
.play-small svg { width: 24px; height: 24px; }
.play-small::after { inset: -5px; }

.history {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history li {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 7px;
  border-radius: 14px;
  transition: background-color 0.2s ease;
}

.history li:hover { background: var(--glass); }

.thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--glass);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

.h-text { display: flex; flex-direction: column; min-width: 0; gap: 2px; }

.h-title,
.h-artist {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.h-title { font-weight: 700; font-size: 0.97rem; }
.h-artist { font-size: 0.85rem; color: var(--muted); }

.history time {
  font-size: 0.74rem;
  color: var(--faint);
  white-space: nowrap;
}

.empty {
  margin: 6px 0 0;
  font-size: 0.92rem;
  color: var(--muted);
}

/* ---- Song requests ---- */

.chip {
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
}

.section-title {
  margin: 8px 0 10px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.section-title ~ .section-title { margin-top: 24px; }

.queue-tag {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--faint);
  transition: border-color 0.2s ease;
}

.search:focus-within { border-color: color-mix(in srgb, var(--accent) 65%, transparent); }
.search svg { flex: none; width: 18px; height: 18px; fill: currentColor; }

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px; /* stops iPhones zooming in on focus */
}

.search input::placeholder { color: var(--faint); }

.request-status {
  margin: 10px 2px 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.request-status:empty { display: none; }
.request-status[data-tone="success"] { color: var(--text); font-weight: 650; }
.request-status[data-tone="error"] { color: #FF9A8F; }

.songs {
  max-height: min(50vh, 460px);
  margin-top: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.request-btn {
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background-color 1.4s ease;
}

.request-btn:hover:not(:disabled) { transform: scale(1.05); }
.request-btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.request-btn:disabled {
  background: var(--glass-strong);
  color: var(--faint);
  cursor: default;
}

/* ---- Wider screens ---- */

@media (min-width: 900px) {
  .app { padding-left: 32px; padding-right: 32px; }
  .topbar { margin-bottom: 34px; }

  .layout {
    grid-template-columns: minmax(380px, 470px) minmax(0, 1fr);
    align-items: start;
    gap: 64px;
  }

  .player {
    position: sticky;
    top: 28px;
    align-items: flex-start;
    max-width: none;
    margin: 0;
    text-align: left;
  }

  .art-wrap { width: 320px; }
  .vinyl { display: block; }
  .app[data-playing="true"] .vinyl { transform: translateX(42%) scale(0.98); }
  h1 { font-size: 2.7rem; }

  .controls { flex-direction: row; gap: 26px; }
  .volume { width: 200px; }

  .panel { max-width: none; }
  .lyrics { max-height: calc(100dvh - 240px); }
  .songs { max-height: max(240px, calc(100dvh - 520px)); }
  .line { font-size: 2rem; }
  .now-line { display: none !important; } /* the lyrics are already beside the player */
  .lv-head { padding-top: 14px; }
  .lv-head::before { display: none; }
  .lv-thumb { width: 56px; height: 56px; }
  .lv-body .line { font-size: clamp(2.2rem, 3.6vw, 3.2rem); }
  .tab-panel { padding: 4px 32px 24px; }
}

/* ---- Motion ---- */

@keyframes drift-1 { to { transform: translate(18vmax, 14vmax) scale(1.15); } }
@keyframes drift-2 { to { transform: translate(-16vmax, -12vmax) scale(1.1); } }
@keyframes drift-3 { to { transform: translate(-22vmax, 10vmax) scale(0.85); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes eq {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}
@keyframes ring {
  0% { opacity: 0.55; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.35); }
}
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.14); }
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes shimmer { to { background-position: -300% 0; } }
@keyframes live-ring {
  0% { box-shadow: 0 0 0 0 rgba(255, 77, 79, 0.55); }
  100% { box-shadow: 0 0 0 9px rgba(255, 77, 79, 0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
