/* ================================================================ tokens */
@property --c1 { syntax: '<color>'; inherits: true; initial-value: #7a5238; }
@property --c2 { syntax: '<color>'; inherits: true; initial-value: #1d140f; }

:root {
  --script-font: "Rouge Script", "Snell Roundhand", "Apple Chancery", cursive; /* welcome-screen cursive */
  --c1: #7a5238;               /* album colour (vivid) */
  --c2: #1d140f;               /* album colour (dark)  */
  --accent: #a77bff;           /* app theme: purple */
  --brand: #7c4dff;            /* filled buttons (white text) */
  --text: #f4efe9;
  --muted: rgba(244, 239, 233, .66);
  --faint: rgba(244, 239, 233, .42);
  --glass: rgba(28, 21, 17, .62);
  --glass-strong: rgba(26, 20, 16, .88);
  --line: rgba(255, 255, 255, .12);
  --ease: cubic-bezier(.2, .7, .2, 1);
  transition: --c1 1.4s ease, --c2 1.4s ease;
  /* tonearm follows the album colour */
  --arm: color-mix(in srgb, var(--c1) 82%, #d9d4cc);
  /* the record itself — app.js swaps these for coloured / splatter / picture-disc pressings */
  --vinyl: repeating-radial-gradient(circle, #141414 0 1px, #1c1c1c 1px 2px, #101010 2px 3px);
  --vinyl-fx: none;
  --runout: #0c0c0c;
  /* UI highlight colours as RGB triples, so paper panels can swap them (see "painted theme" at the end) */
  --hl: 255 255 255;           /* hovers, tracks, dividers */
  --acc: 167 123 255;          /* accent tints */
  --field: #000;               /* text fields */
}

/* ---- turntable finishes ---- */
:root, [data-finish="walnut"] { --pl-a: #5e412d; --pl-b: #3b291c; --pl-ink: rgba(255,240,225,.45); --pl-grain: 1;  --pl-hi: rgba(255,255,255,.10); }
[data-finish="oat"]        { --pl-a: #e6dccb; --pl-b: #cbbda4; --pl-ink: rgba(60,45,30,.55);    --pl-grain: .45; --pl-hi: rgba(255,255,255,.45); }
[data-finish="clay"]       { --pl-a: #a8917a; --pl-b: #85705b; --pl-ink: rgba(40,28,18,.55);    --pl-grain: .5;  --pl-hi: rgba(255,255,255,.22); }
[data-finish="charcoal"]   { --pl-a: #302c29; --pl-b: #1b1816; --pl-ink: rgba(255,255,255,.38); --pl-grain: .3;  --pl-hi: rgba(255,255,255,.08); }
[data-finish="oxblood"]    { --pl-a: #63211f; --pl-b: #3d1213; --pl-ink: rgba(255,220,210,.5);  --pl-grain: .4;  --pl-hi: rgba(255,255,255,.10); }
[data-finish="rose"]       { --pl-a: #e7c7c1; --pl-b: #cea39c; --pl-ink: rgba(90,50,45,.55);    --pl-grain: .3;  --pl-hi: rgba(255,255,255,.45); }
[data-finish="sage"]       { --pl-a: #aabba1; --pl-b: #869a7d; --pl-ink: rgba(35,50,30,.55);    --pl-grain: .3;  --pl-hi: rgba(255,255,255,.35); }
[data-finish="terracotta"] { --pl-a: #ba6c4f; --pl-b: #8f4b35; --pl-ink: rgba(255,235,220,.55); --pl-grain: .4;  --pl-hi: rgba(255,255,255,.18); }
[data-finish="lilac"]      { --pl-a: #cfc0e2; --pl-b: #ac9bc8; --pl-ink: rgba(55,40,80,.55);    --pl-grain: .3;  --pl-hi: rgba(255,255,255,.42); }
[data-finish="moss"]       { --pl-a: #5f6646; --pl-b: #414730; --pl-ink: rgba(235,240,215,.5);  --pl-grain: .4;  --pl-hi: rgba(255,255,255,.12); }

/* ================================================================ base */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body {
  background: #1d140f;
  color: var(--text);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none; -webkit-user-select: none;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hidden { display: none !important; }

/* ================================================================ room */
.room {
  position: fixed; left: 0; top: 0; width: 100%; height: 100%;
  z-index: -1;
  filter: blur(3px) brightness(.58) saturate(.95);
}
.tint-fill { fill: var(--c1); }
.ambient {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(75% 65% at 45% 45%, var(--c1), transparent 75%);
  mix-blend-mode: soft-light; opacity: .9;
}
.vignette {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(120% 95% at 50% 45%, transparent 45%, rgba(10,6,4,.7)),
    linear-gradient(180deg, rgba(10,6,4,.25), transparent 25%, transparent 70%, rgba(10,6,4,.45));
}

/* ================================================================ layout (phone first) */
.app {
  height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px;
  padding: calc(max(12px, env(safe-area-inset-top)) + 54px) 16px max(16px, env(safe-area-inset-bottom));
}
.deck { width: min(92%, 52vh, 560px); flex: none; container-type: inline-size; margin-bottom: -4vh; }
.aside { width: min(100%, 520px); display: flex; flex-direction: column; gap: 12px; }

@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  .app {
    display: grid; grid-template-columns: minmax(0, 1fr) 340px;
    align-items: center; justify-items: center; column-gap: 5vw;
    padding: 76px 4vw 36px;
  }
  .deck { width: min(92%, calc(108vh - 170px), 800px); }
  .aside { width: 100%; gap: 16px; }
}
@media (min-width: 1600px) and (min-aspect-ratio: 1/1) {
  body.has-album .app, body.tl-queue .app { grid-template-columns: minmax(0, 1fr) 320px 320px; column-gap: 3.5vw; }
}

/* ================================================================ turntable */
/* 3/4 view: the plinth is tilted back in 3D. app.js mirrors TILT + PERSPECTIVE for tonearm dragging. */
.turntable {
  /* No nested 3D (preserve-3d): browsers disagree on how to stack it — Safari hid the record.
     Instead every layer gets the same projection in its own transform and stacks in plain DOM order.
     app.js mirrors these numbers (TILT, PERSP_K, LIFT) for tonearm dragging. */
  --proj: translateY(-13cqw) perspective(260cqw) rotateX(48deg);
  --arm-h: 4.2cqw;   /* height of the tonearm pivot above the deck */
  position: relative; width: 100%; aspect-ratio: 1 / 1;
  cursor: pointer;
}
.face {
  position: absolute; inset: 0;
  transform-origin: 50% 50%; transform: var(--proj);
  border-radius: 4.5% 4.5% 1.2% 1.2%;
  background:
    linear-gradient(135deg, var(--pl-hi), transparent 45%),
    repeating-linear-gradient(91deg, rgba(0,0,0,calc(.07 * var(--pl-grain))) 0 1px, transparent 1px 6px),
    repeating-linear-gradient(89deg, rgba(255,255,255,calc(.05 * var(--pl-grain))) 0 2px, transparent 2px 17px),
    linear-gradient(180deg, var(--pl-a), var(--pl-b));
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset;
}
.deck { position: relative; }
.deck::before { /* the cabinet's shadow on the table */
  content: ""; position: absolute; left: 1%; right: 1%; top: 80%; height: 16%;
  background: radial-gradient(closest-side, rgba(0,0,0,.6), transparent);
  filter: blur(10px); pointer-events: none;
}
/* ---- TVS cabinet: speaker front, deck hardware ---- */
.front {
  position: absolute; left: 0; right: 0; top: 100%; height: 21cqw;
  /* hinge down from the deck's front edge (deck centre is 50cqw above this box) */
  transform-origin: 50% -50cqw;
  transform: var(--proj) translateY(50cqw) rotateX(-90deg) translateY(-50cqw);
  border-radius: 0 0 2.6cqw 2.6cqw;
  padding: 2cqw 3.2cqw 2.6cqw;
  display: flex;
  /* one continuous cabinet: same colour as the deck's front edge, a soft rounded-over top edge,
     gently darker toward the bottom and the corners */
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--pl-b) 85%, #fff) 0, var(--pl-b) 1.4cqw, transparent 1.5cqw),
    linear-gradient(90deg, rgba(0,0,0,.2), transparent 3.5%, transparent 96.5%, rgba(0,0,0,.2)),
    repeating-linear-gradient(90deg, rgba(0,0,0,calc(.07 * var(--pl-grain))) 0 1px, transparent 1px 6px),
    linear-gradient(180deg, var(--pl-b) 0, color-mix(in srgb, var(--pl-b) 72%, #000) 100%);
}
.grille {
  position: relative; flex: 1; border-radius: 1.4cqw;
  background:
    radial-gradient(circle, rgba(0,0,0,.5) 0 32%, transparent 38%) 0 0 / .8cqw .8cqw,
    linear-gradient(180deg, #3d3530, #221d1a);
  box-shadow: inset 0 .4cqw .9cqw rgba(0,0,0,.65), 0 .15cqw 0 rgba(255,255,255,.14);
}
.grille::before, .grille::after { /* speaker cones showing through the cloth */
  content: ""; position: absolute; top: 50%; width: 17%; aspect-ratio: 1; transform: translateY(-50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(0,0,0,.4) 0 18%, rgba(0,0,0,.18) 22% 55%, rgba(0,0,0,.28) 60%, transparent 70%);
}
.grille::before { left: 7%; } .grille::after { right: 7%; }
.badge {
  position: absolute; left: 50%; bottom: 4.2cqw; transform: translateX(-50%);
  font: italic 700 3.4cqw/1 Georgia, "Times New Roman", serif; letter-spacing: .3em;
  padding: .55cqw 1.2cqw .55cqw 1.55cqw; border-radius: .6cqw;
  color: #3a2d22;
  background: linear-gradient(180deg, #f6f1e8, #bdb5aa 55%, #ece6dc);
  box-shadow: 0 .25cqw .5cqw rgba(0,0,0,.55), inset 0 0 0 .14cqw rgba(0,0,0,.22);
}
.hinge {
  position: absolute; top: -.5%; width: 9%; height: 2.2%; border-radius: .5cqw;
  background: linear-gradient(180deg, #f2eee8, #a39d95 60%, #d6d1ca);
  box-shadow: 0 .2cqw .4cqw rgba(0,0,0,.45);
}
.plate {
  position: absolute; left: 3.6%; bottom: 2.6%;
  display: flex; align-items: center; gap: 1.6cqw;
  padding: .8cqw 1.4cqw; border-radius: 1.2cqw;
  background: linear-gradient(180deg, rgba(0,0,0,.14), rgba(0,0,0,.24));
  box-shadow: inset 0 .15cqw .3cqw rgba(0,0,0,.35), 0 .1cqw 0 rgba(255,255,255,.1);
}
.knob {
  width: 4.4cqw; aspect-ratio: 1; border-radius: 50%; position: relative;
  background: conic-gradient(from 0deg, #f4f1ec, #9d978f, #e9e5df, #8f8981, #f4f1ec);
  box-shadow: 0 .35cqw .6cqw rgba(0,0,0,.5), inset 0 0 0 .3cqw rgba(0,0,0,.08);
}
.knob::after { content: ""; position: absolute; left: 50%; top: 10%; width: .4cqw; height: 32%; margin-left: -.2cqw; border-radius: 1cqw; background: #3a3530; transform-origin: 50% 125%; transform: rotate(35deg); }
.speedsw { display: flex; gap: .2cqw; padding: .3cqw; border-radius: 1cqw; background: rgba(0,0,0,.32); }
.speedsw i { font-style: normal; font-size: 1.6cqw; font-weight: 700; letter-spacing: .04em; padding: .35cqw .7cqw; border-radius: .7cqw; color: var(--pl-ink); transition: background .3s, color .3s; }
.speedsw i.on { background: rgba(255,255,255,.85); color: #2a211b; }
#armHit { pointer-events: stroke; cursor: grab; touch-action: none; }
body.arm-dragging, body.arm-dragging #armHit { cursor: grabbing; }
.platter {
  position: absolute; left: 7%; top: 7%; width: 86%; height: 86%;
  border-radius: 50%;
  background: radial-gradient(circle, #3b3835 0 60%, #2a2725 61%, #4a4642 97%, #1d1b19 100%);
  box-shadow: 0 6px 18px rgba(0,0,0,.6), 0 0 0 1px rgba(0,0,0,.6);
}
.record {
  --gaps: none;
  position: absolute; inset: 1.5%;
  border-radius: 50%;
  will-change: transform;
  background:
    var(--gaps),
    radial-gradient(circle closest-side, transparent 0 96%, rgba(255,255,255,.08) 97%, transparent 98.5%),
    var(--vinyl-fx),
    var(--vinyl);
  box-shadow: 0 0 0 1px #000, 0 2px 6px rgba(0,0,0,.8);
}
.record::after { /* run-out area */
  content: ""; position: absolute; inset: 31%;
  border-radius: 50%;
  background: radial-gradient(circle, transparent 0 60%, var(--runout) 61%);
}
.label {
  position: absolute; inset: 33%;
  border-radius: 50%;
  background-color: var(--accent);
  background-size: cover; background-position: center;
  box-shadow: 0 0 0 1px rgba(0,0,0,.6) inset;
  z-index: 1; overflow: hidden;
}
body.picture-disc .label { opacity: 0; }
.label { transition: opacity .6s ease; }
.label-next, .sleeve-next { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity .8s ease; }
.label-next.show, .sleeve-next.show { opacity: 1; }
.label-text {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  font-size: 2.1cqw; color: rgba(255,255,255,.88); text-align: center; padding: 18%;
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.sheen {
  position: absolute; inset: 1.5%;
  border-radius: 50%; pointer-events: none; z-index: 2;
  background: conic-gradient(from 20deg,
    transparent 0deg, rgba(255,255,255,.10) 30deg, transparent 60deg,
    transparent 180deg, rgba(255,255,255,.08) 210deg, transparent 240deg, transparent 360deg);
  -webkit-mask: radial-gradient(circle, transparent 0 34%, #000 35%);
          mask: radial-gradient(circle, transparent 0 34%, #000 35%);
  mix-blend-mode: screen;
}
.spindle {
  position: absolute; left: 50%; top: 50%; width: 2.6%; height: 2.6%;
  transform: translate(-50%, -50%); border-radius: 50%; z-index: 3;
  background: radial-gradient(circle at 35% 35%, #fff, #aaa 40%, #555);
  box-shadow: 0 1px 2px rgba(0,0,0,.6);
}
.arm-hi { stop-color: color-mix(in srgb, var(--arm) 45%, #fff); }
.arm-mid { stop-color: var(--arm); }
.arm-hi2 { stop-color: color-mix(in srgb, var(--arm) 65%, #fff); }
.arm-head { fill: color-mix(in srgb, var(--arm) 40%, #1c1916); }
.tonearm-base { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; overflow: visible; }
/* the arm layer floats above the deck; app.js sets translateZ (higher when the needle is lifted) */
.tonearm { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; transform-origin: 50% 50%; transform: var(--proj) translateZ(var(--arm-h)); }
.head-a { stop-color: color-mix(in srgb, var(--arm) 30%, #151311); }
.head-b { stop-color: color-mix(in srgb, var(--arm) 55%, #3a3632); }
/* vertical posts the arm stands on (pivot + rest), standing up out of the deck */
.post {
  /* --ty: the post's base line, measured from the deck centre; it stands up from there */
  position: absolute; height: var(--arm-h);
  transform-origin: var(--ox) calc(-1 * var(--ty));
  transform: var(--proj) translateY(var(--ty)) rotateX(90deg) translateY(calc(-1 * var(--ty)));
  border-radius: .5cqw .5cqw 0 0;
  background: linear-gradient(90deg, #5e5a54, #d9d4cd 30%, #f6f2ec 42%, #a29c94 65%, #4a4641);
}
.led {
  width: 1.4cqw; aspect-ratio: 1; border-radius: 50%;
  background: rgba(0,0,0,.35); box-shadow: 0 0 0 1px rgba(0,0,0,.35);
  transition: background .4s, box-shadow .4s;
}
.led.on { background: var(--accent); box-shadow: 0 0 10px var(--accent), 0 0 0 1px rgba(0,0,0,.4); }

/* ================================================================ now-playing stand */
.np { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 34px; align-items: end; }
.stand { position: relative; width: 96px; }
.sleeve-wrap { position: relative; aspect-ratio: 1; perspective: 700px; }
.peek {
  position: absolute; top: 3%; left: 20%; width: 94%; aspect-ratio: 1; border-radius: 50%;
  background:
    radial-gradient(circle, rgba(0,0,0,.6) 0 1.5%, var(--c1) 2% 17%, #0b0b0b 17.5% 19%, transparent 19.5%),
    radial-gradient(circle, transparent 0 96%, rgb(var(--hl) / .1) 97%, transparent 99%),
    var(--vinyl-fx),
    var(--vinyl);
  box-shadow: 0 10px 20px -6px rgba(0,0,0,.7);
  transition: left .7s var(--ease), transform .7s var(--ease);
}
.peek.swap { left: 0; transform: rotate(-40deg); }
.sleeve {
  position: absolute; inset: 0; border-radius: 2px; overflow: hidden;
  background: #2a2420;
  transform: rotateX(5deg); transform-origin: bottom center;
  box-shadow: 0 22px 30px -12px rgba(0,0,0,.8), 0 2px 4px rgba(0,0,0,.5);
}
.sleeve-art { position: absolute; inset: 0; background-size: cover; background-position: center; }
.sleeve-shine {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(115deg, rgb(var(--hl) / .22), transparent 38%),
    linear-gradient(0deg, rgba(0,0,0,.18), transparent 25%);
  box-shadow: inset 0 0 0 1px rgb(var(--hl) / .08);
}
.ledge {
  position: relative; z-index: 1;
  width: 118%; margin: -3px 0 0 -9%;
  height: 12px; border-radius: 2px 2px 3px 3px;
  background:
    linear-gradient(180deg, rgb(var(--hl) / .18), transparent 35%),
    repeating-linear-gradient(90deg, rgba(0,0,0,.08) 0 1px, transparent 1px 9px),
    linear-gradient(180deg, #8d6446, #5a3c28);
  box-shadow: 0 10px 14px -4px rgba(0,0,0,.6);
  display: grid; place-items: center;
}
.ledge span { display: none; font-size: 9px; letter-spacing: .28em; text-transform: uppercase; color: rgba(40,24,14,.75); font-weight: 700; text-shadow: 0 1px 0 rgb(var(--hl) / .18); }

.info { min-width: 0; padding-bottom: 6px; }
.ctx.link { cursor: pointer; border-radius: 4px; }
.ctx.link::after { content: " ›"; }
.ctx.link:hover, .ctx.link:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.tl .nm small { display: block; font-size: 12px; color: var(--faint); font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.tl-note { color: var(--muted); font-size: 13px; padding: 4px 12px 10px; margin: 0; }
.ctx {
  font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700;
  color: var(--accent); margin-bottom: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.title { font-size: clamp(19px, 2.3vw, 28px); font-weight: 700; margin: 0; line-height: 1.2;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-wrap: balance; }
.artist { color: var(--muted); margin: 4px 0 0; font-size: clamp(15px, 1.5vw, 17px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vinyl-pill {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; max-width: 100%;
  padding: 5px 12px 5px 6px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted);
  background: rgb(var(--hl) / .07); border: 1px solid var(--line);
}
.vinyl-pill:hover { color: var(--text); background: rgb(var(--hl) / .12); }
.vinyl-pill span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vinyl-pill .dot, .press-disc {
  flex: none; width: 18px; height: 18px; border-radius: 50%;
  background: radial-gradient(circle, var(--c1) 0 22%, transparent 24%), var(--vinyl-fx), var(--vinyl);
  box-shadow: 0 0 0 1px rgba(0,0,0,.4);
}
.album { color: var(--faint); margin: 2px 0 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  .np { display: flex; flex-direction: column; align-items: flex-start; gap: 26px; }
  .stand { width: 210px; margin-left: 12px; }
  .ledge { height: 22px; margin-top: -4px; }
  .ledge span { display: block; }
  .info { width: 100%; }
}

/* ================================================================ bars */
.seek { padding: 9px 0; cursor: pointer; touch-action: none; }
.seek-track { position: relative; height: 5px; border-radius: 3px; background: rgb(var(--hl) / .16); }
.seek-fill { height: 100%; width: 0; background: var(--text); border-radius: 3px; }
.seek-knob {
  position: absolute; top: 50%; left: 0; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; transform: translate(-50%, -50%) scale(0); transition: transform .15s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.seek:hover .seek-knob, .seek.dragging .seek-knob, .seek:focus-visible .seek-knob { transform: translate(-50%, -50%) scale(1); }
@media (hover: none) { .seek-knob { transform: translate(-50%, -50%) scale(.85); } }
.seek.dragging .seek-track { height: 7px; margin: -1px 0; }
.times { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: -2px; font-variant-numeric: tabular-nums; }

.albumbar { display: flex; gap: 3px; margin-top: 10px; }
.seg { position: relative; flex: 1 1 0; height: 5px; border-radius: 2px; background: rgb(var(--hl) / .14); overflow: visible; }
.seg::before { content: ""; position: absolute; inset: -9px 0; } /* bigger tap target */
.seg i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 2px; background: rgb(var(--hl) / .55); }
.seg.done i { width: 100%; }
.seg.current { background: rgb(var(--hl) / .22); }
.seg.current i { background: var(--text); }
.seg:hover { background: rgb(var(--hl) / .3); }
.albumlabel { font-size: 12px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; display: flex; justify-content: space-between; gap: 8px; }
.albumlabel b { color: var(--text); font-weight: 600; }

/* ================================================================ controls */
.controls { display: flex; justify-content: center; align-items: center; gap: 8px; }
.icon-btn { width: 48px; height: 48px; display: inline-grid; place-items: center; border-radius: 999px; transition: background .2s, color .2s; }
.icon-btn:hover { background: rgb(var(--hl) / .1); }
.icon-btn svg { width: 24px; height: 24px; fill: currentColor; }
.icon-btn.small { width: 40px; height: 40px; color: var(--muted); }
.icon-btn.small:hover { color: var(--text); }
.icon-btn.small svg { width: 20px; height: 20px; }
.icon-btn.active { color: var(--accent); }
.play { width: 62px; height: 62px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--text); color: #1a120d; box-shadow: 0 8px 20px -6px rgba(0,0,0,.6); transition: transform .15s; }
.play:hover { transform: scale(1.04); }
.play:active { transform: scale(.96); }
.play svg { width: 28px; height: 28px; fill: currentColor; }
#tracklistBtn { visibility: hidden; }
body.has-album #tracklistBtn { visibility: visible; }
@media (min-width: 900px) and (min-aspect-ratio: 1/1) { .controls { justify-content: flex-start; margin-left: -8px; } }
@media (min-width: 1600px) and (min-aspect-ratio: 1/1) { body.has-album #tracklistBtn { visibility: hidden; } }

/* ================================================================ top corners */
.corner { position: fixed; z-index: 12; top: max(12px, env(safe-area-inset-top)); display: flex; gap: 4px; transition: opacity .6s ease; }
.corner.left { left: 12px; }
.corner.right { right: 12px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 12px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  font-weight: 600; font-size: 14px;
}
.pill:hover { background: rgba(50,38,30,.75); }
.pill svg { width: 18px; height: 18px; fill: currentColor; }

/* ================================================================ panels (library + tracklist) */
.panel {
  position: fixed; top: 0; bottom: 0; z-index: 15;
  width: min(380px, 100vw);
  display: flex; flex-direction: column;
  background: var(--glass-strong);
  backdrop-filter: blur(26px) saturate(1.2); -webkit-backdrop-filter: blur(26px) saturate(1.2);
  border: 1px solid var(--line);
  visibility: hidden;
  transition: transform .45s var(--ease), visibility 0s linear .45s, opacity .6s;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
.panel.open { transform: none; visibility: visible; transition: transform .45s var(--ease), visibility 0s, opacity .6s; }
.tracklist { right: 0; transform: translateX(102%); border-right: 0; }
.scrim { position: fixed; inset: 0; z-index: 14; background: rgba(0,0,0,.4); opacity: 0; pointer-events: none; transition: opacity .35s; }
.scrim.show { opacity: 1; pointer-events: auto; }

@media (min-width: 1600px) and (min-aspect-ratio: 1/1) {
  body.has-album .tracklist, body.tl-queue .tracklist {
    position: relative; inset: auto; transform: none; visibility: visible;
    width: 100%; height: min(78vh, 760px); border-radius: 18px; border: 1px solid var(--line);
    background: var(--glass); padding: 0; z-index: auto;
    transition: opacity .6s;
  }
  body.has-album:not(.tl-queue) .tracklist .close { display: none; }
}

.panel-head { display: flex; align-items: center; gap: 14px; padding: 18px 14px 14px 18px; border-bottom: 1px solid var(--line); }
.panel-head .close { margin-left: auto; flex: none; align-self: flex-start; }
.tl-cover { width: 64px; height: 64px; flex: none; border-radius: 3px; background: #2a2420 center/cover; box-shadow: 0 6px 14px -4px rgba(0,0,0,.6); }
.tl-meta { min-width: 0; }
.kicker { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.panel-head h2 { margin: 2px 0 0; font-size: 18px; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.panel-head p { margin: 2px 0 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tl { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.tl button {
  width: 100%; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 10px 10px; border-radius: 10px; text-align: left;
}
.tl button:hover { background: rgb(var(--hl) / .07); }
.tl .n { color: var(--faint); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; position: relative; height: 16px; }
.tl .nm { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl .d { color: var(--faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tl li.current button { background: rgb(var(--hl) / .1); }
.tl li.current .nm { color: #fff; font-weight: 600; }
.tl li.current .n { color: transparent; }
.tl li.current .n::before {
  content: ""; position: absolute; right: 2px; bottom: 1px; width: 13px; height: 13px;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 100% / 3px 40% no-repeat,
    linear-gradient(var(--accent), var(--accent)) 50% 100% / 3px 90% no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100% 100% / 3px 60% no-repeat;
  animation: eq 1s ease-in-out infinite;
  animation-play-state: paused;
}
body.playing .tl li.current .n::before { animation-play-state: running; }
@keyframes eq {
  0%, 100% { background-size: 3px 40%, 3px 90%, 3px 60%; }
  33% { background-size: 3px 95%, 3px 35%, 3px 75%; }
  66% { background-size: 3px 55%, 3px 70%, 3px 30%; }
}

/* ---- record wall (library) ---- */
.panel.wall {
  left: 0; right: 0; width: auto; border: 0; z-index: 20;
  transform: translateY(24px); opacity: 0;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(255,214,160,.12), transparent 60%),
    radial-gradient(140% 100% at 50% 50%, transparent 55%, rgba(0,0,0,.45)),
    repeating-linear-gradient(90deg, rgba(0,0,0,.22) 0 2px, rgb(var(--hl) / .035) 2px 3px, transparent 3px 72px),
    repeating-linear-gradient(90deg, rgb(var(--hl) / .02) 0 1px, transparent 1px 11px),
    linear-gradient(180deg, #4d372a, #2b1e16);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.panel.wall.open { transform: none; opacity: 1; }
.wall-head {
  display: flex; align-items: center; gap: 16px;
  padding: 16px clamp(16px, 4vw, 56px) 12px;
  background: linear-gradient(180deg, rgba(30,21,15,.85), rgba(30,21,15,0));
}
.wall-head h2 { margin: 2px 0 0; font-size: 22px; }
.wall-head input {
  margin-left: auto; width: min(320px, 42vw);
  font: inherit; font-size: 15px; color: var(--text);
  background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px;
}
.wall-head input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.wall-head .close { margin-left: 0; flex: none; }
.wall-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px clamp(16px, 4vw, 56px) 64px; }
.wall-msg:empty { display: none; }
.wall-msg { color: var(--muted); text-align: center; padding: 40px 12px; font-size: 15px; }
.wall-msg .btn { margin-top: 14px; }
.wall-sec[hidden] { display: none; }
.plaque {
  display: inline-flex; align-items: baseline; gap: 10px;
  margin: 26px 0 26px; padding: 7px 16px 6px; border-radius: 4px;
  font-size: 12px; letter-spacing: .2em; text-transform: uppercase; font-weight: 800;
  color: #2b1b0d;
  background: linear-gradient(180deg, #e0c08a, #b48a52);
  box-shadow: 0 1px 0 rgb(var(--hl) / .5) inset, 0 6px 12px -4px rgba(0,0,0,.6);
}
.plaque .count { font-weight: 600; letter-spacing: .05em; opacity: .7; }
.wall-note { color: var(--faint); font-size: 14px; margin: 0 0 30px; }
.shelf-row { margin-bottom: 38px; }
.row-covers, .row-caps { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); column-gap: var(--gap); }
.row-covers { align-items: end; padding: 0 4px; }
.rec { display: block; width: 100%; position: relative; }
.rec .cover {
  position: relative; display: grid; place-items: center; aspect-ratio: 1; overflow: hidden;
  border-radius: 2px;
  transform: rotate(var(--tilt, 0deg)); transform-origin: bottom center;
  box-shadow: 0 16px 16px -12px rgba(0,0,0,.9), 0 2px 4px rgba(0,0,0,.45);
  transition: transform .28s var(--ease), box-shadow .28s;
  font-weight: 800; font-size: 34px; color: rgb(var(--hl) / .8);
}
.rec .cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rec .cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, rgb(var(--hl) / .16), transparent 40%); box-shadow: inset 0 0 0 1px rgb(var(--hl) / .07); pointer-events: none; }
.rec:hover .cover, .rec:focus-visible .cover { transform: translateY(-10px) scale(1.035); box-shadow: 0 26px 26px -14px rgba(0,0,0,.9), 0 3px 6px rgba(0,0,0,.4); }
.rec.current .cover { outline: 2px solid var(--accent); outline-offset: 3px; }
.rec.current::before {
  content: "Now playing"; position: absolute; z-index: 1; left: 50%; top: -12px; transform: translateX(-50%);
  background: var(--accent); color: #1a0f08; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; white-space: nowrap; box-shadow: 0 4px 8px rgba(0,0,0,.4);
}
.plank {
  position: relative; height: 16px; margin: -3px -16px 0; border-radius: 2px;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.06) 0 1px, transparent 1px 13px),
    linear-gradient(180deg, #c09670 0, #956b48 28%, #6e4c32 100%);
  box-shadow: 0 1px 0 rgb(var(--hl) / .25) inset, 0 16px 18px -6px rgba(0,0,0,.65);
}
.plank::before, .plank::after { /* brackets */
  content: ""; position: absolute; top: 100%; width: 12px; height: 20px; background: #24170f;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
.plank::before { left: 7%; }
.plank::after { right: 7%; transform: scaleX(-1); }
.row-caps { margin-top: 12px; padding: 0 4px; }
.cap { text-align: left; min-width: 0; }
.cap .name { display: block; font-size: 13px; font-weight: 600; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cap .sub { display: block; font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
@media (max-width: 600px) {
  .wall-head { flex-wrap: wrap; }
  .wall-head input { order: 3; width: 100%; margin-left: 0; }
  .wall-head .close { margin-left: auto; }
  .rec .cover { font-size: 24px; }
  .cap .name { font-size: 12px; } .cap .sub { font-size: 11px; }
  .shelf-row { margin-bottom: 30px; }
}

/* ---- record wall tabs ---- */
.wall-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(0,0,0,.3); border: 1px solid var(--line); margin-left: 12px; }
.wall-tabs button { padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 700; color: var(--muted); display: inline-flex; gap: 7px; align-items: baseline; }
.wall-tabs button[aria-selected="true"] { background: linear-gradient(180deg, #a97fff, #7c4dff); color: #fff; box-shadow: 0 4px 10px -3px rgba(0,0,0,.6); }
.wall-tabs .count { font-size: 12px; font-weight: 600; opacity: .7; }
.wall-sec { padding-top: 26px; }
@media (max-width: 600px) { .wall-tabs { order: 2; margin-left: 0; } .wall-head .tl-meta { flex: 1; } }

/* ---- pulling a record out of its sleeve ---- */
.rec .cover { z-index: 1; }
.rec.pulling { z-index: 3; }
.rec.pulling .cover { transform: translateX(-14%) rotate(-4deg); }
.pull-disc {
  position: absolute; left: 3%; top: 3%; width: 94%; aspect-ratio: 1; border-radius: 50%; z-index: 0;
  background:
    radial-gradient(circle, transparent 0 96%, rgb(var(--hl) / .12) 97%, transparent 99%),
    repeating-radial-gradient(circle, #151515 0 1px, #1f1f1f 1px 2px);
  box-shadow: 0 12px 24px rgba(0,0,0,.6);
  animation: pullOut .95s var(--ease) forwards;
}
.pull-disc i { position: absolute; inset: 33%; border-radius: 50%; background-size: cover; background-position: center; box-shadow: inset 0 0 0 1px rgba(0,0,0,.5); }
.pull-disc i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 9%; height: 9%; transform: translate(-50%,-50%); border-radius: 50%; background: #111; }
@keyframes pullOut {
  0% { transform: translateX(0) rotate(0); }
  50% { transform: translateX(60%) rotate(120deg); }
  100% { transform: translate(60%, -12%) rotate(280deg) scale(1.06); }
}

/* ---- vinyl panel: pressings + where to buy ---- */
.panel.vinylpanel { right: 0; transform: translateX(102%); width: min(420px, 100vw); border-right: 0; z-index: 17; }
.panel.vinylpanel.open { transform: none; }
.vp-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 6px 18px 32px; user-select: text; -webkit-user-select: text; }
.vp-body h4 { font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin: 20px 0 10px; }
.vp-note, .vp-empty { color: var(--muted); font-size: 14px; margin: 0 0 6px; }
.vp-empty b { color: var(--text); display: block; margin-bottom: 4px; }
.press { display: grid; grid-template-columns: 22px 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 8px; border-radius: 10px; cursor: pointer; }
.press:hover { background: rgb(var(--hl) / .06); }
.press:has(input:checked) { background: rgb(var(--hl) / .1); }
.press input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.press .press-disc { width: 30px; height: 30px; }
.press b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.press small { display: block; font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.press .tag { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #1a0f08; background: var(--accent); border-radius: 999px; padding: 2px 7px; margin-left: 6px; vertical-align: 2px; }
.press a, .vp-link { color: var(--text); font-size: 12.5px; font-weight: 600; text-decoration: none; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.press a:hover, .vp-link:hover { background: rgb(var(--hl) / .1); }
.vp-more { margin: 6px 0 0 8px; font-size: 13px; color: var(--accent); font-weight: 600; }
.vp-links { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.vp-link { display: flex; justify-content: space-between; gap: 10px; border-radius: 12px; padding: 11px 14px; background: rgb(var(--hl) / .05); }
.vp-link small { color: var(--faint); font-weight: 500; }
.vp-sub { font-size: 13px; font-weight: 600; color: var(--muted); margin: 6px 0 8px; }
.vp-shops { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.vp-shops a { display: block; padding: 10px 12px; border-radius: 10px; background: rgb(var(--hl) / .05); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 13.5px; font-weight: 600; }
.vp-shops a small { display: block; color: var(--faint); font-weight: 500; font-size: 11.5px; }
.vp-shops a:hover { background: rgb(var(--hl) / .1); }
.vp-fine { font-size: 12px; color: var(--faint); margin-top: 16px; }
.vp-fine a { color: var(--muted); }

/* ================================================================ idle / ambient mode */
body.idle { cursor: none; }
.bars, .controls, .info { transition: opacity .6s ease; }
body.idle .corner, body.idle .bars, body.idle .controls, body.idle .tracklist { opacity: 0; pointer-events: none; }

/* ================================================================ toast */
.toast {
  position: fixed; z-index: 30; left: 50%; top: calc(max(12px, env(safe-area-inset-top)) + 52px);
  transform: translate(-50%, -20px); opacity: 0; transition: .3s ease;
  background: var(--glass-strong); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; max-width: calc(100vw - 32px);
  font-size: 14px; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ================================================================ settings dialog */
dialog {
  width: min(500px, calc(100vw - 24px)); max-height: calc(100dvh - 32px);
  border: 1px solid var(--line); border-radius: 18px; padding: 0;
  background: #1f1814; color: var(--text);
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  user-select: text; -webkit-user-select: text;
}
dialog::backdrop { background: rgba(0,0,0,.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.dlg-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 16px 14px 10px 22px; background: #1f1814; }
.dlg-head h2 { margin: 0; font-size: 21px; }
dialog section { padding: 6px 22px 18px; border-top: 1px solid var(--line); }
dialog section:first-of-type { border-top: 0; }
dialog h3 { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 14px 0 8px; }
dialog p, dialog li { color: var(--muted); font-size: 14px; }
dialog p { margin: 6px 0; }
dialog summary { cursor: pointer; font-size: 14px; font-weight: 600; margin: 8px 0; }
dialog ol { padding-left: 20px; margin: 10px 0; }
dialog li { margin-bottom: 8px; }
dialog a { color: var(--accent); }
.uri { display: flex; gap: 6px; margin-top: 6px; }
.uri code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; background: var(--field); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; color: var(--text); }
label.field { display: block; margin: 12px 0 6px; font-size: 13px; font-weight: 600; }
input[type=text] { width: 100%; font: inherit; font-size: 16px; color: var(--text); background: var(--field); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
input[type=text]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.btn { padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; border: 1px solid var(--line); }
.btn.primary { background: var(--brand); color: #fff; border-color: transparent; }
.btn.primary:hover { background: #8f66ff; }
/* Spotify's own button keeps Spotify green */
#connectBtn.btn.primary { background: #1ed760; color: #000; }
#connectBtn.btn.primary:hover { background: #3be477; }
.btn:not(.primary):hover { background: rgb(var(--hl) / .08); }
.warn { color: #ffb38a !important; font-size: 13px !important; }
.hint { font-size: 12.5px !important; color: var(--faint) !important; }

.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 12px 8px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.swatch i {
  display: block; width: 46px; height: 46px; border-radius: 12px;
  background:
    linear-gradient(135deg, var(--pl-hi), transparent 50%),
    repeating-linear-gradient(91deg, rgba(0,0,0,calc(.08 * var(--pl-grain))) 0 1px, transparent 1px 5px),
    linear-gradient(180deg, var(--pl-a), var(--pl-b));
  box-shadow: inset 0 0 0 1px rgb(var(--hl) / .12), 0 4px 10px rgba(0,0,0,.4);
  position: relative;
}
.swatch i::after { content: ""; position: absolute; inset: 20%; border-radius: 50%; background: #151515; box-shadow: inset 0 0 0 4px #1f1f1f; }
.swatch[aria-checked="true"] { color: var(--text); }
.swatch[aria-checked="true"] i { outline: 2px solid var(--text); outline-offset: 3px; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; margin: 6px 0 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.vol { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.vol input { flex: 1; accent-color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .panel, .peek, .rec .cover { transition: none; }
}
.tl button:disabled { cursor: default; }
.tl button:disabled:hover { background: none; }

/* section headings in the live playlist queue */
.tl-note.tl-head { padding: 12px 12px 4px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.tl li.current button:disabled:hover { background: rgb(var(--hl) / .1); }

/* ===================== your collection: My vinyl shelves, stickers, Discogs ===================== */
.vgroup { margin-bottom: 18px; }
.vgroup-title { font-size: 20px; font-weight: 800; margin: 6px 4px 18px; letter-spacing: -.01em; }
.vgroup-title small { display: block; font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: 3px; }
.vconnect {
  margin: 10px 4px 34px; padding: 20px 22px; border-radius: 16px; max-width: 560px;
  background: linear-gradient(160deg, rgba(231,200,145,.14), rgb(var(--hl) / .04)); border: 1px solid var(--line);
}
.vconnect b { font-size: 16px; }
.vconnect p { color: var(--muted); font-size: 14px; margin: 6px 0 14px; }

/* a little round sticker on the sleeve's corner: ✓ owned, ♥ wishlist */
.sticker {
  position: absolute; z-index: 2; top: -7px; right: -7px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 900; line-height: 1;
  box-shadow: 0 3px 8px rgba(0,0,0,.5), inset 0 1px 0 rgb(var(--hl) / .4); pointer-events: none;
  transition: transform .28s var(--ease);
}
.sticker.owned { background: radial-gradient(circle at 35% 30%, #f3dfae, #c9a062); color: #3a240e; }
.sticker.wanted { background: radial-gradient(circle at 35% 30%, #f2b8b8, #c96a72); color: #fff; font-size: 12px; }
.rec:hover .sticker, .rec:focus-visible .sticker { transform: translateY(-10px); }
.rec-badge {
  position: absolute; z-index: 1; left: 6px; bottom: 6px; max-width: calc(100% - 12px);
  padding: 3px 7px; border-radius: 999px; background: rgba(15,10,6,.78); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  color: #f3e6cf; font-size: 10.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 520px) { .rec-badge { font-size: 9px; padding: 2px 5px; left: 4px; bottom: 4px; } .sticker { width: 20px; height: 20px; font-size: 11px; } }

/* vinyl panel: collection line + read-only pressings */
.vp-own { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0 2px; }
.own-tag { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.own-tag.owned { background: linear-gradient(180deg, #e7c891, #b98f55); color: #2b1b0d; }
.own-tag.wanted { background: rgba(201,106,114,.25); color: #f4c4c4; border: 1px solid rgba(201,106,114,.5); }
.own-spins { font-size: 13px; color: var(--muted); }
div.press { grid-template-columns: 30px minmax(0, 1fr) auto; cursor: default; }
.vinyl-pill.owned { color: #f3dfae; }

/* settings: Discogs */
details.mini { margin-top: 10px; }
details.mini summary { cursor: pointer; font-size: 13px; color: var(--muted); }
details.mini p { margin: 8px 0 0; }

/* ===================== sides: flip the record ===================== */
.flip-btn {
  position: absolute; z-index: 6; left: 50%; top: 40%; transform: translate(-50%, -50%) scale(.92);
  display: inline-flex; align-items: center; gap: 10px; padding: 13px 20px 13px 16px; border-radius: 999px;
  background: rgba(20,13,8,.82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(231,200,145,.45); color: var(--text); font-size: 15px; white-space: nowrap;
  box-shadow: 0 14px 34px -8px rgba(0,0,0,.75);
  opacity: 0; pointer-events: none; transition: opacity .35s ease, transform .35s var(--ease);
}
.flip-btn b { color: #f3dfae; }
.flip-btn svg { width: 20px; height: 20px; fill: #f3dfae; flex: none; }
.flip-btn.show { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); animation: flipNudge 2.6s ease-in-out 1s infinite; }
.flip-btn:hover { background: rgba(40,27,16,.9); }
@keyframes flipNudge { 0%, 100% { box-shadow: 0 14px 34px -8px rgba(0,0,0,.75), 0 0 0 0 rgba(231,200,145,.35); } 50% { box-shadow: 0 14px 34px -8px rgba(0,0,0,.75), 0 0 0 10px rgba(231,200,145,0); } }
@media (max-width: 520px) { .flip-btn { font-size: 13.5px; padding: 11px 16px 11px 13px; } }

/* the record lifts and turns over */
.platter.flipping .record { animation: recordFlip 1.2s cubic-bezier(.55,0,.35,1); }
@keyframes recordFlip {
  0% { scale: 1 1; translate: 0 0; }
  20% { scale: 1.03 1.03; translate: 0 -3%; }
  50% { scale: .02 1.05; translate: 0 -5%; }
  80% { scale: 1.03 1.03; translate: 0 -3%; }
  100% { scale: 1 1; translate: 0 0; }
}
@media (prefers-reduced-motion: reduce) { .platter.flipping .record { animation: none; } }

/* side letter printed on the label */
.label::after {
  content: attr(data-side); position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%);
  font: 800 clamp(7px, 1.6cqw, 13px)/1 ui-serif, Georgia, serif; letter-spacing: .1em; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.8); pointer-events: none; z-index: 2;
}
.label:not([data-side]):after, .label[data-side=""]::after { display: none; }

/* a small gap in the album bar where a new side starts */
.seg.side-start { margin-left: 7px; }
.seg.side-start::after { content: ""; position: absolute; left: -5px; top: -3px; bottom: -3px; width: 1.5px; border-radius: 1px; background: rgba(243,223,174,.6); }
.linkish { color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.wall-note.vlf { margin-top: -14px; }
details.mini ol.hint { margin: 8px 0 0; padding-left: 18px; }
details.mini ol.hint li { margin-bottom: 6px; }

/* ===================== notes, prices, local stores ===================== */
input[type=password], dialog textarea { width: 100%; font: inherit; font-size: 16px; color: var(--text); background: var(--field); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
input[type=password]:focus, dialog textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
dialog textarea { resize: vertical; min-height: 96px; line-height: 1.45; margin-top: 12px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pill-row .vinyl-pill { min-width: 0; }
.note-pill { padding: 5px 12px 5px 9px; flex: none; }
.note-pill svg { width: 15px; height: 15px; fill: currentColor; }
#noteDlg { width: min(460px, calc(100vw - 32px)); }
.note-form section { border-top: 0; }
.note-album { display: flex; gap: 12px; align-items: center; margin-top: 4px; }
.note-album b { display: block; color: var(--text); font-size: 15px; }
.note-album small { display: block; color: var(--faint); font-size: 12.5px; margin-top: 2px; }
.note-cover { width: 44px; height: 44px; border-radius: 4px; flex: none; background-size: cover; background-position: center; box-shadow: 0 4px 10px rgba(0,0,0,.5); }

.notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.note { position: relative; display: flex; gap: 12px; padding: 12px 38px 12px 14px; border-radius: 12px; background: rgb(var(--hl) / .05); border: 1px solid var(--line); user-select: text; -webkit-user-select: text; }
.note p { margin: 4px 0 0; font-size: 14.5px; line-height: 1.45; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.note-meta { font-size: 12px; color: var(--faint); }
.note-meta b { color: var(--muted); }
.note-del { position: absolute; top: 6px; right: 8px; width: 26px; height: 26px; border-radius: 50%; color: var(--faint); font-size: 18px; line-height: 1; }
.note-del:hover { color: var(--text); background: rgb(var(--hl) / .1); }
.notes.diary { max-width: 720px; margin: 0 4px 30px; }
.notes.diary .note { background: rgba(20,13,8,.55); }

.rec-badge.drop { background: #c9a062; color: #24160a; }
.vp-price { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: rgb(var(--hl) / .05); border: 1px solid var(--line); font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.vp-price b { color: var(--text); }
.vp-price.drop { border-color: rgba(231,200,145,.5); background: rgba(231,200,145,.1); }
.vp-price.drop b { color: #f3dfae; }
.vp-price a { margin-left: auto; color: var(--text); font-size: 12.5px; font-weight: 600; text-decoration: none; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); }

/* wall header with three tabs: keep labels on one line, move search to its own row on mid-size screens */
.wall-head .tl-meta, .wall-tabs button { white-space: nowrap; }
.wall-tabs { flex: none; }
@media (max-width: 960px) {
  .wall-head { flex-wrap: wrap; }
  .wall-head input { order: 3; width: 100%; margin-left: 0; }
  .wall-head .close { margin-left: auto; }
}
@media (max-width: 420px) { .wall-tabs button { padding: 8px 11px; font-size: 13px; } .wall-tabs .count { display: none; } }

/* ===================== TV mode (?tv) ===================== */
/* Sized in vw/vh so it reads from the couch at 720p, 1080p or 4K. No buttons: a remote or the phone drives it. */
.tv-clock, .tv-hint, .upnext { display: none; }
body.tv .app {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; justify-items: center;
  column-gap: 5vw; padding: 9vh 8vw 9vh; animation: tvDrift 900s ease-in-out infinite alternate;
}
body.tv .deck { width: min(84%, 68vh); margin: 0; }   /* the 3D tilt draws ~17% wider than the box */
body.tv .aside { width: 100%; max-width: 44vw; gap: 3vh; justify-self: start; }
body.tv .np { display: flex; flex-direction: column; align-items: flex-start; gap: 4vh; }
body.tv .stand { width: 17vh; margin-left: 1vh; }
body.tv .ledge { height: 2.2vh; }
body.tv .ledge span { display: block; font-size: 1.1vh; }
body.tv .info { width: 100%; }
body.tv .ctx { font-size: max(13px, 1.25vw); margin-bottom: 1.2vh; }
body.tv .ctx.link::after { content: none; }
body.tv .title { font-size: max(28px, 3.6vw); line-height: 1.12; letter-spacing: -.015em; }
body.tv .artist { font-size: max(18px, 1.9vw); margin-top: 1vh; }
body.tv .album { font-size: max(15px, 1.35vw); margin-top: .6vh; }
body.tv .upnext { display: block; margin: 2.4vh 0 0; font-size: max(14px, 1.15vw); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.tv .upnext.hidden { display: none; }
body.tv .pill-row, body.tv .controls, body.tv .tracklist, body.tv .seek-knob { display: none !important; }
body.tv .seek { pointer-events: none; padding: 0; }
body.tv .seek-track { height: max(4px, .45vh); }
body.tv .times { font-size: max(13px, 1vw); margin-top: 1vh; }
body.tv .albumbar { margin-top: 2vh; }
body.tv .seg { height: max(4px, .45vh); }
body.tv .albumlabel { font-size: max(13px, 1vw); }
body.tv .bars { opacity: 1 !important; }                 /* keep progress visible; only the buttons hide */
body.tv.idle .corner { opacity: 0; }
body.tv .toast { font-size: max(15px, 1.2vw); padding: 1.2vh 1.6vw; top: 4vh; }
body.tv .flip-btn { font-size: max(16px, 1.5vw); padding: 1.6vh 2vw 1.6vh 1.6vw; }
body.tv .flip-btn svg { width: 1.6vw; height: 1.6vw; min-width: 20px; min-height: 20px; }
@media (max-aspect-ratio: 1/1) {          /* portrait screens: stack */
  body.tv .app { grid-template-columns: 1fr; row-gap: 4vh; }
  body.tv .deck { width: min(88vw, 52vh); }
  body.tv .aside { max-width: 88vw; justify-self: center; }
  body.tv .np { flex-direction: row; align-items: flex-end; }
}

body.tv .tv-clock {
  display: block; position: fixed; z-index: 11; top: 4vh; right: 4vw;
  font-size: max(16px, 1.5vw); font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums;
  transition: opacity .6s ease;
}
body.tv:not(.idle) .tv-clock { opacity: 0; }   /* the corner buttons take its place while the mouse is moving */
body.tv .tv-hint {
  display: block; position: fixed; z-index: 31; left: 50%; bottom: 6vh; transform: translate(-50%, 12px);
  padding: 1.2vh 1.8vw; border-radius: 999px; background: rgba(20,13,8,.8); border: 1px solid var(--line);
  font-size: max(14px, 1.1vw); color: var(--muted); opacity: 0; pointer-events: none; transition: opacity .5s ease, transform .5s var(--ease);
}
body.tv .tv-hint b { color: var(--text); }
body.tv .tv-hint.show { opacity: 1; transform: translate(-50%, 0); }

/* burn-in care: drift a few pixels over many minutes, and dim when paused for a while */
@keyframes tvDrift {
  0% { translate: -0.6vw -0.5vh; } 33% { translate: 0.5vw 0.4vh; } 66% { translate: -0.3vw 0.6vh; } 100% { translate: 0.6vw -0.4vh; }
}
body.tv .app, body.tv .room, body.tv .ambient { transition: opacity 2.5s ease, filter 2.5s ease; }
body.tv.tv-dim .app { opacity: .35; }
body.tv.tv-dim .room { filter: brightness(.45); }
@media (prefers-reduced-motion: reduce) { body.tv .app { animation: none; } }

/* vinyl panel: side breaks */
.vp-sides { display: flex; flex-wrap: wrap; gap: 8px; }
.vp-sides span { font-size: 13px; color: var(--muted); padding: 6px 11px; border-radius: 999px; background: rgb(var(--hl) / .05); border: 1px solid var(--line); }
.vp-sides b { color: var(--text); margin-right: 4px; }

/* ===================== what should I play? ===================== */
#pickDlg, #shareDlg { width: min(480px, calc(100vw - 32px)); }
.pick-body { border-top: 0 !important; }
.pick-note { padding: 20px 0; }
.pick-card { display: flex; gap: 22px; align-items: center; margin: 6px 0 4px; }
.pick-sleeve { position: relative; width: 150px; height: 150px; flex: none; margin-right: 40px; }
.pick-cover { position: absolute; inset: 0; border-radius: 3px; box-shadow: 0 18px 28px -10px rgba(0,0,0,.8); }
.pick-disc {
  position: absolute; top: 4%; left: 4%; width: 92%; height: 92%; border-radius: 50%;
  background: radial-gradient(circle, #222 0 2%, var(--c1) 2.5% 18%, #0b0b0b 18.5% 20%, transparent 20.5%),
              repeating-radial-gradient(circle, #151515 0 2px, #1d1d1d 2px 3px);
  box-shadow: 0 10px 20px -6px rgba(0,0,0,.7);
  animation: pickSlide .9s .15s var(--ease) both;
}
@keyframes pickSlide { from { transform: translateX(0) rotate(0); } to { transform: translateX(34%) rotate(50deg); } }
.pick-meta { min-width: 0; }
.pick-meta h3 { margin: 4px 0 2px; font-size: 20px; color: var(--text); letter-spacing: 0; text-transform: none; line-height: 1.25; }
.pick-meta p { margin: 0; color: var(--muted); font-size: 15px; }
.pick-meta small { display: block; margin-top: 8px; color: var(--faint); font-size: 13px; }
@media (max-width: 440px) { .pick-card { flex-direction: column; align-items: flex-start; } .pick-sleeve { width: 130px; height: 130px; } }
@media (max-width: 520px) { #pickBtn span { display: none; } }

/* ===================== share card ===================== */
.share-body { border-top: 0 !important; }
#shareImg { display: block; width: auto; max-width: 100%; height: min(62vh, 640px); aspect-ratio: 9 / 16; margin: 4px auto 0; border-radius: 12px; background: rgb(var(--hl) / .04); box-shadow: 0 16px 34px -12px rgba(0,0,0,.8); object-fit: contain; }
.share-body .row { justify-content: center; }
.share-body a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.share-body .hint { text-align: center; }
@media (max-width: 520px) { .note-pill span { display: none; } .note-pill { padding: 5px 9px; } }

/* TV mode: a clear way out */
.tv-exit { display: none !important; }
body.tv .tv-exit { display: inline-flex !important; }
body.tv .corner { gap: 8px; }

/* ===================== background scenes ===================== */
.room[data-scene]:not(.on) { display: none; }
.tint-stroke { stroke: var(--c1); }
.tint-stop { stop-color: var(--c1); }
.room[data-scene="vinyl"] { filter: blur(3px) brightness(.62) saturate(1); }
.room[data-scene="party"] { filter: blur(2.5px) brightness(.85) saturate(1.15); }
.room[data-scene="skyline"] { filter: blur(2.5px) brightness(.8) saturate(1.05); }
/* party lights move while music plays */
.pt-beam { transform-box: view-box; transform-origin: 800px 90px; animation: ptSweep 7s ease-in-out infinite alternate; animation-play-state: paused; }
.pt-beam.b2 { animation-duration: 9s; animation-direction: alternate-reverse; }
.pt-beam.b3 { animation-duration: 6s; animation-delay: -2s; }
.pt-beam.b4 { animation-duration: 11s; animation-direction: alternate-reverse; animation-delay: -4s; }
@keyframes ptSweep { from { transform: rotate(-16deg); } to { transform: rotate(16deg); } }
.pt-spot { transform-box: fill-box; transform-origin: center; animation: ptSpot 5s ease-in-out infinite alternate; animation-play-state: paused; }
.pt-spot.s2 { animation-duration: 7s; animation-delay: -3s; }
.pt-spot.s3 { animation-duration: 4s; animation-delay: -1s; }
@keyframes ptSpot { from { transform: translateX(-120px) scale(.9); opacity: .6; } to { transform: translateX(120px) scale(1.1); opacity: 1; } }
.pt-bulb { animation: ptBulb 2.6s ease-in-out infinite alternate; }
@keyframes ptBulb { from { opacity: .45; } to { opacity: 1; } }
.pt-sparkle { animation: ptSparkle 3.2s ease-in-out infinite; opacity: 0; animation-play-state: paused; }
@keyframes ptSparkle { 0%, 100% { opacity: 0; } 50% { opacity: .9; } }
body.playing .pt-beam, body.playing .pt-spot, body.playing .pt-sparkle { animation-play-state: running; }
/* skyline: a few stars twinkle, windows switch on and off */
.sk-twinkle { animation: ptSparkle 5s ease-in-out infinite; }
.sk-win { animation: skWin 24s steps(1) infinite; }
@keyframes skWin { 0%, 60% { opacity: .9; } 61%, 100% { opacity: .05; } }
@media (prefers-reduced-motion: reduce) { .pt-beam, .pt-spot, .pt-bulb, .pt-sparkle, .sk-twinkle, .sk-win { animation: none !important; } .pt-sparkle { opacity: .5; } }

/* settings: scene picker */
.scenes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.scene-opt { display: flex; flex-direction: column; gap: 6px; align-items: stretch; font-size: 13px; font-weight: 600; color: var(--muted); text-align: center; }
.scene-opt i { display: block; aspect-ratio: 16 / 10; border-radius: 8px; box-shadow: inset 0 0 0 1px rgb(var(--hl) / .12); }
.scene-opt[aria-checked="true"] { color: var(--text); }
.scene-opt[aria-checked="true"] i { box-shadow: 0 0 0 2px var(--accent), inset 0 0 0 1px rgb(var(--hl) / .12); }
@media (max-width: 420px) { .scenes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ===================== ratings & reviews ===================== */
.stars { display: inline-block; font-size: 14px; line-height: 1; letter-spacing: 1px; vertical-align: -1px; }
.stars::before {
  content: "★★★★★";
  background: linear-gradient(90deg, #f3c66b calc(var(--v, 0) * 20%), rgb(var(--hl) / .2) 0);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stars.big { font-size: 26px; letter-spacing: 3px; }
.star-input { position: relative; display: inline-block; outline-offset: 4px; border-radius: 6px; }
.star-input .stars { pointer-events: none; }
.star-input .stars::before { background: linear-gradient(90deg, #f3c66b calc(var(--v, 0) * 20%), rgb(var(--hl) / .2) 0); -webkit-background-clip: text; background-clip: text; }
.star-input button { position: absolute; top: 0; bottom: 0; width: 10%; cursor: pointer; }
.star-input button:nth-of-type(1) { left: 0; } .star-input button:nth-of-type(2) { left: 10%; } .star-input button:nth-of-type(3) { left: 20%; }
.star-input button:nth-of-type(4) { left: 30%; } .star-input button:nth-of-type(5) { left: 40%; } .star-input button:nth-of-type(6) { left: 50%; }
.star-input button:nth-of-type(7) { left: 60%; } .star-input button:nth-of-type(8) { left: 70%; } .star-input button:nth-of-type(9) { left: 80%; }
.star-input button:nth-of-type(10) { left: 90%; }
.rv-mine textarea { width: 100%; font: inherit; font-size: 15px; color: var(--text); background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 10px; resize: vertical; min-height: 90px; line-height: 1.45; }
.rv-mine textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.rv-avg { display: flex; align-items: center; gap: 12px; margin: 2px 0 14px; color: var(--muted); font-size: 14px; }
.rv-avg b { color: var(--text); font-size: 18px; }
.rv-list .note { padding-right: 14px; }
.rv-list .stars, .rv-feed .stars { margin-top: 4px; }
.rv-feed .note { cursor: pointer; padding-right: 14px; }
.rv-feed .note:hover { background: rgba(40,27,16,.7); }
.rate-pill .rate-star { color: #f3c66b; font-size: 14px; line-height: 1; }
.rate-pill.rated { color: var(--text); }
@media (max-width: 520px) { .rate-pill .rate-star, .rate-pill #rateText { display: inline; } }

/* sign-in button after sending: greyed out while the 10-second wait counts down */
#profileGo.sent, #profileGo.sent:hover { opacity: .5; cursor: default; filter: saturate(.3); font-variant-numeric: tabular-nums; }

/* shown while the crackle is on but the browser is still waiting for a first click/tap/key */
.crackle-hint {
  position: fixed; z-index: 29; left: 50%; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 12px);
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none; transition: .3s ease;
  background: var(--glass-strong); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 13.5px;
  padding: 8px 14px 8px 30px; border-radius: 999px; cursor: pointer;
}
.crackle-hint::before {
  content: ''; position: absolute; left: 12px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px;
  border-radius: 50%; background: var(--accent); animation: crackle-pulse 1.4s ease-in-out infinite;
}
.crackle-hint.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
@keyframes crackle-pulse { 50% { opacity: .35; transform: scale(.7); } }
@media (prefers-reduced-motion: reduce) { .crackle-hint::before { animation: none; } }
body.tv .crackle-hint { font-size: max(15px, 1.2vw); bottom: 5vh; }

/* ================================================================ trending */
.like-btn, .like-count {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; font: inherit; font-size: 13px;
  color: var(--muted); background: rgb(var(--hl) / .06); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
}
.like-btn { cursor: pointer; transition: color .15s, background .15s, border-color .15s; }
.like-btn:hover { color: var(--text); background: rgb(var(--hl) / .12); }
.like-btn.on { color: #ff7a8a; border-color: rgba(255,122,138,.45); background: rgba(255,122,138,.12); }
.like-btn:disabled { opacity: .7; }
.like-btn span, .like-count { font-variant-numeric: tabular-nums; }
.like-count { background: none; }
.trend-reviews .note { position: relative; }
.trend-rank {
  flex: none; align-self: center; width: 1.6em; text-align: center; font-size: 15px; font-weight: 700;
  color: var(--faint); font-variant-numeric: tabular-nums;
}
.trend-reviews .note:nth-child(-n+3) .trend-rank { color: var(--accent); }

/* ================================================================ turntable detail */
/* platter rim: brushed aluminium with two rows of strobe dots (they look still at the right speed under the lamp) */
.strobe {
  position: absolute; left: 5.3%; top: 5.3%; width: 89.4%; height: 89.4%; border-radius: 50%;
  --glow: 0;
  background:
    radial-gradient(circle at 14% 86%, rgba(255,160,80,calc(.95 * var(--glow))), rgba(255,140,60,calc(.35 * var(--glow))) 18%, transparent 36%),
    conic-gradient(from 18deg, #8f8a83, #ece8e1 9%, #a29c94 21%, #dcd7cf 34%, #858079 47%, #efebe4 60%, #99938b 74%, #e2ddd5 87%, #8f8a83);
  box-shadow: 0 .5cqw 1.4cqw rgba(0,0,0,.55), 0 0 0 .18cqw rgba(0,0,0,.45), inset 0 0 0 .1cqw rgba(255,255,255,.35);
  transition: --glow .6s;
}
.strobe::before, .strobe::after { content: ""; position: absolute; inset: 0; border-radius: 50%; }
.strobe::before { /* outer row */
  background: repeating-conic-gradient(rgba(28,25,22,.85) 0 .75deg, transparent .75deg 1.5deg);
  -webkit-mask: radial-gradient(closest-side, transparent 97.4%, #000 97.6% 99.2%, transparent 99.4%);
          mask: radial-gradient(closest-side, transparent 97.4%, #000 97.6% 99.2%, transparent 99.4%);
}
.strobe::after { /* inner row, a different spacing (the other mains frequency) */
  background: repeating-conic-gradient(rgba(28,25,22,.8) 0 .9deg, transparent .9deg 1.8deg);
  -webkit-mask: radial-gradient(closest-side, transparent 95.3%, #000 95.5% 96.9%, transparent 97.1%);
          mask: radial-gradient(closest-side, transparent 95.3%, #000 95.5% 96.9%, transparent 97.1%);
}
body.playing .strobe { --glow: 1; }
@property --glow { syntax: '<number>'; inherits: true; initial-value: 0; }
.strobe-lamp {
  position: absolute; left: 7.4%; top: 85.4%; width: 4.6%; height: 3.2%; border-radius: .8cqw;
  transform: rotate(45deg);
  background: linear-gradient(180deg, #3a3631, #161412);
  box-shadow: 0 .25cqw .5cqw rgba(0,0,0,.55), inset 0 .1cqw 0 rgba(255,255,255,.15);
}
.strobe-lamp::after { /* the lens, facing the platter */
  content: ""; position: absolute; left: 22%; right: 22%; top: 12%; height: 34%; border-radius: .4cqw;
  background: #3b2a20; transition: background .5s, box-shadow .5s;
}
body.playing .strobe-lamp::after { background: #ffb36b; box-shadow: 0 0 .8cqw #ff9a4a, 0 -.6cqw 1.6cqw rgba(255,150,70,.55); }
.platter { box-shadow: 0 .3cqw .8cqw rgba(0,0,0,.55), 0 0 0 1px rgba(0,0,0,.6); }

/* chrome spindle with a little collar */
.spindle {
  width: 2.8%; height: 2.8%;
  background: radial-gradient(circle at 38% 34%, #fff 0 12%, #d9d5cf 30%, #8a857e 62%, #3f3b37 100%);
  box-shadow: 0 0 0 .22cqw rgba(20,18,16,.75), 0 0 0 .34cqw rgba(255,255,255,.18), 0 .2cqw .4cqw rgba(0,0,0,.6);
}

/* plinth: a soft bevel around the top edge */
.face {
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, inset 0 0 0 .3cqw rgba(255,255,255,.05),
    inset 0 -.5cqw 1cqw rgba(0,0,0,.22), inset .4cqw 0 .8cqw rgba(0,0,0,.08), inset -.4cqw 0 .8cqw rgba(0,0,0,.08);
}

/* pitch slider, bottom right */
.pitch {
  position: absolute; right: 2.3%; top: 63%; width: 3.4%; height: 29%;
  border-radius: .6cqw;
  background:
    linear-gradient(90deg, transparent 0 44%, #0e0d0c 44% 56%, transparent 56%),                     /* the slot */
    repeating-linear-gradient(180deg, var(--pl-ink) 0 .12cqw, transparent .12cqw 2.1cqw) 0 .9cqw / 26% calc(100% - 1.4cqw) no-repeat, /* scale */
    linear-gradient(180deg, rgba(0,0,0,.18), rgba(0,0,0,.28));
  box-shadow: inset 0 .15cqw .3cqw rgba(0,0,0,.4), 0 .1cqw 0 rgba(255,255,255,.08);
}
.pitch::before { /* centre (0%) mark */
  content: ""; position: absolute; left: -12%; width: 34%; top: calc(50% - .12cqw); height: .24cqw; border-radius: .2cqw; background: var(--accent);
}
.pitch-cap {
  position: absolute; left: -14%; right: -14%; top: calc(50% - 1.3cqw); height: 2.6cqw; border-radius: .5cqw;
  background: linear-gradient(180deg, #f1ede7, #b8b2aa 45%, #8d8780 55%, #d9d4cd);
  box-shadow: 0 .35cqw .6cqw rgba(0,0,0,.55), inset 0 -.1cqw 0 rgba(0,0,0,.25);
}
.pitch-cap::after { content: ""; position: absolute; left: 12%; right: 12%; top: calc(50% - .1cqw); height: .2cqw; background: #2a2622; border-radius: .1cqw; }

/* start/stop button on the control plate */
.startstop {
  position: relative; width: 8.4cqw; height: 4.4cqw; padding: 0; border: 0; border-radius: .8cqw; cursor: pointer;
  background: linear-gradient(180deg, #f2eee8, #c9c3bb 55%, #aea79f);
  box-shadow: 0 .35cqw .6cqw rgba(0,0,0,.5), inset 0 -.25cqw 0 rgba(0,0,0,.18), inset 0 .1cqw 0 rgba(255,255,255,.8);
  transition: transform .08s, box-shadow .08s;
}
.startstop span {
  display: block; font: 700 1.05cqw/1 system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: #3b342d;
}
.startstop:active { transform: translateY(.15cqw); box-shadow: 0 .15cqw .3cqw rgba(0,0,0,.5), inset 0 -.1cqw 0 rgba(0,0,0,.18); }
.startstop:focus-visible { outline: .3cqw solid var(--accent); outline-offset: .3cqw; }

/* rubber feet under the cabinet */
.front::before, .front::after {
  content: ""; position: absolute; bottom: -1.3cqw; width: 9cqw; height: 1.6cqw; border-radius: 0 0 1.2cqw 1.2cqw;
  background: linear-gradient(180deg, #2a2623, #121110);
}
.front::before { left: 5%; } .front::after { right: 5%; }

/* ================================================================ welcome screen */
.intro {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 40%, #33204f 0%, #1a1128 55%, #0c0812 100%);
  color: #f6eee3; cursor: pointer;
  transition: opacity .8s ease, visibility 0s linear .8s;
}
.intro.out { opacity: 0; visibility: hidden; pointer-events: none; }
.intro.out .intro-inner { transform: scale(1.04); }
.intro-disc { /* a faint record turning slowly behind the words */
  position: absolute; width: 130vmax; aspect-ratio: 1; left: 50%; top: 50%; margin: -65vmax 0 0 -65vmax; border-radius: 50%;
  background:
    repeating-radial-gradient(circle, rgb(var(--hl) / .035) 0 1px, transparent 1px 7px),
    radial-gradient(circle, transparent 0 60%, rgba(0,0,0,.35) 100%);
  opacity: 0; animation: introDisc 1.6s ease .1s forwards, introSpin 40s linear infinite;
}
.intro-inner { position: relative; text-align: center; padding: 0 16px; transition: transform .8s var(--ease); width: min(92vw, 820px); }
.intro-welcome {
  margin: 0 0 .1em; white-space: nowrap;
  font-family: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-weight: 400; font-size: clamp(20px, 3.4vw, 34px); letter-spacing: .04em; color: rgba(246,238,227,.82);
  opacity: 0; transform: translateY(10px);
}
.intro-script { display: block; width: 100%; height: auto; overflow: visible; }
.intro-ink {
  font-family: var(--script-font); font-size: 188px;
  fill: #f6eee3; stroke: #f6eee3; stroke-width: .6; paint-order: stroke;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,.45));
}
.intro-rule {
  display: block; height: 2px; width: 120px; margin: 4px auto 0; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform: scaleX(0); opacity: 0;
}
.intro-skip {
  position: absolute; bottom: calc(max(20px, env(safe-area-inset-bottom)) + 8px); left: 0; right: 0; margin: 0; text-align: center;
  font-size: 12.5px; letter-spacing: .08em; color: rgba(246,238,227,.38); opacity: 0;
}
/* the sequence starts once the script font is ready (app.js adds .go) */
.intro.go .intro-welcome { animation: introUp .9s var(--ease) forwards; }
.intro.go .intro-pen { animation: introWrite 2.3s cubic-bezier(.45,.05,.4,1) .55s forwards; }
.intro.go .intro-rule { animation: introRule .9s var(--ease) 2.6s forwards; }
.intro.go .intro-skip { animation: introUp .6s ease 1.2s forwards; }
@keyframes introUp { to { opacity: 1; transform: none; } }
@keyframes introWrite { to { transform: translateX(1700px); } }
@keyframes introRule { to { opacity: 1; transform: scaleX(1); } }
@keyframes introDisc { to { opacity: 1; } }
@keyframes introSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .intro-disc { animation: introDisc .4s ease forwards; }
  .intro.go .intro-welcome, .intro.go .intro-skip { animation: introUp .4s ease forwards; }
  .intro.go .intro-pen { animation: none; transform: translateX(1700px); }
  .intro.go .intro-rule { animation: introRule .4s ease forwards; }
}

/* ================================================================ dialog pages: one job per button */
#setup[data-page] section[data-page] { display: none; }
#setup[data-page="spotify"] section[data-page="spotify"],
#setup[data-page="discogs"] section[data-page="discogs"],
#setup[data-page="lastfm"] section[data-page="lastfm"],
#setup[data-page="profile"] section[data-page="profile"],
#setup[data-page="settings"] section[data-page="settings"] { display: block; }
#setup[data-page] section[data-page] h3:first-child { display: none; }      /* the dialog title already says it */
#setup[data-page="settings"] section[data-page] h3:first-child { display: block; }

/* ================================================================ top bar */
.topnav { display: flex; align-items: center; gap: 4px; }
.nav-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px; border-radius: 999px;
  font: inherit; font-weight: 600; font-size: 13px; color: var(--text); white-space: nowrap; cursor: pointer;
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  transition: background .2s, border-color .2s;
}
.nav-btn:hover { background: rgba(70,50,110,.55); border-color: rgb(var(--acc) / .35); }
.nav-btn:focus-visible, .menu-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-btn .dot { display: none; width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 6px rgba(74,222,128,.7); }
.nav-btn.on .dot { display: inline-block; }
.nav-btn span { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; }
.menu-btn { display: none; cursor: pointer; color: var(--text); font: inherit; font-weight: 600; font-size: 14px; }
body.tv .topnav, body.tv .menu-btn { display: none !important; }
/* narrower screens: the same buttons inside a ☰ menu */
@media (max-width: 1239px) {
  .menu-btn { display: inline-flex; }
  .topnav {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 40;
    flex-direction: column; align-items: stretch; gap: 2px; min-width: 210px; padding: 6px;
    border-radius: 16px; background: rgba(24,18,32,.97); border: 1px solid rgb(var(--acc) / .22);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 18px 50px rgba(0,0,0,.5);
    opacity: 0; transform: translateY(-6px); visibility: hidden; pointer-events: none;
    transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
  }
  .topnav.open { opacity: 1; transform: none; visibility: visible; pointer-events: auto; transition: opacity .18s ease, transform .18s ease; }
  .topnav .nav-btn { height: 42px; padding: 0 14px; font-size: 14.5px; border: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; border-radius: 10px; justify-content: space-between; }
  .topnav .nav-btn:hover { background: rgb(var(--acc) / .14); }
  .topnav .nav-btn .dot { order: 2; }
  .topnav #settingsBtn { margin-top: 4px; box-shadow: 0 -1px 0 var(--line); border-radius: 0 0 10px 10px; }
}
@media (max-width: 560px) { .menu-btn span { display: none; } .menu-btn { padding: 0 11px; } }
.my-reviews .note { cursor: pointer; }

.corner.right:has(.topnav.open) { z-index: 45; opacity: 1 !important; }

/* ================================================================ album sheet */
dialog.album-sheet {
  width: min(920px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 8px 28px; padding: 28px 28px 24px;
  height: -webkit-fit-content; height: fit-content;         /* size to the content: Safari otherwise stretched it to the window */
  align-content: start; align-items: start;
  background: linear-gradient(160deg, #241a30, #17121d 60%); border-color: rgb(var(--acc) / .18);
}
dialog.album-sheet:not([open]) { display: none; }
.as-close { position: absolute; top: 10px; right: 10px; z-index: 3; }
.as-stage { position: relative; align-self: start; padding: 6% 30% 6% 0; }
.as-sleeve { position: relative; aspect-ratio: 1; }
.as-cover {
  position: absolute; inset: 0; z-index: 2; border-radius: 4px; background: #2b2233 center/cover;
  box-shadow: 0 22px 50px rgba(0,0,0,.6), inset 0 0 0 1px rgb(var(--hl) / .08);
  opacity: 0; transform: scale(.94) translateY(8px);
}
.as-cover::after { /* sleeve sheen */
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(115deg, rgb(var(--hl) / .14), transparent 40%, transparent 70%, rgba(0,0,0,.18));
}
.as-disc {
  position: absolute; inset: 3%; z-index: 1; border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 31%, rgba(0,0,0,.6) 31.5% 33%, transparent 33.5%),
    repeating-radial-gradient(circle, #141216 0 2px, #1d1a20 2px 3px),
    #111;
  box-shadow: 0 10px 28px rgba(0,0,0,.6), inset 0 0 0 1px rgb(var(--hl) / .06);
  transform: translateX(0) rotate(0deg);
}
.as-disc::before { /* light catching the grooves */
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 30deg, transparent 0 20deg, rgb(var(--hl) / .12) 40deg, transparent 70deg 200deg, rgb(var(--hl) / .08) 220deg, transparent 250deg);
}
.as-label { position: absolute; inset: 34%; border-radius: 50%; background: var(--accent) center/cover; box-shadow: inset 0 0 0 1px rgba(0,0,0,.4); }
.as-label::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6%; height: 6%; margin: -3%; border-radius: 50%; background: #0c0a0e; }
.as-info { display: flex; flex-direction: column; min-width: 0; padding-top: 6px; }
.as-info h2 { margin: 4px 0 2px; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.15; }
.as-sub { margin: 0 0 14px; color: var(--muted); }
.as-info > * { opacity: 0; transform: translateY(8px); }
.as-tracks { overflow: auto; max-height: 52vh; margin: 0 -6px 16px; padding: 0 6px; }
.as-track.as-side { display: block; border: 0; padding: 0; margin: 12px 0 2px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.as-track {
  display: grid; grid-template-columns: 2.2em minmax(0, 1fr) auto; align-items: baseline; gap: 8px;
  padding: 6px 4px; border-bottom: 1px solid rgb(var(--hl) / .06); font-size: 14.5px;
  opacity: 0; transform: translateX(6px);
}
.as-track .n { color: var(--faint); font-variant-numeric: tabular-nums; }
.as-track .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-track .d { color: var(--faint); font-variant-numeric: tabular-nums; font-size: 13px; }
.as-note { color: var(--muted); font-size: 14px; }
.as-actions { margin-top: 0; }
/* the sequence */
.album-sheet.go .as-cover { animation: asIn .45s var(--ease) forwards; }
.album-sheet.go .as-disc { animation: asSlide 1s cubic-bezier(.3,.7,.2,1) .35s forwards; }
.album-sheet.go .as-info > * { animation: asUp .5s var(--ease) forwards; animation-delay: .9s; }
.album-sheet.go .as-info > .as-actions { animation-delay: 1.35s; }
.album-sheet.go .as-track { animation: asTrack .35s var(--ease) forwards; animation-delay: calc(1s + var(--i, 0) * 45ms); }
.album-sheet.spinning .as-disc { animation: asSpinOut 1s cubic-bezier(.5,0,.7,1) forwards; }
@keyframes asIn { to { opacity: 1; transform: none; } }
@keyframes asSlide { to { transform: translateX(46%) rotate(220deg); } }
@keyframes asUp { to { opacity: 1; transform: none; } }
@keyframes asTrack { to { opacity: 1; transform: none; } }
@keyframes asSpinOut { from { transform: translateX(46%) rotate(220deg); } to { transform: translateX(46%) rotate(940deg); } }
@media (prefers-reduced-motion: reduce) {
  .album-sheet .as-cover, .album-sheet .as-info > *, .album-sheet .as-track { animation: none !important; opacity: 1; transform: none; }
  .album-sheet .as-disc { animation: none !important; transform: translateX(46%); }
}
@media (max-width: 720px) {
  dialog.album-sheet { grid-template-columns: 1fr; padding: 22px 18px 18px; }
  .as-stage { width: min(78%, 340px); padding: 0 24% 0 0; margin: 0 auto; }
  .as-tracks { max-height: none; overflow: visible; }
}

.share-mini { margin-left: 0; }
.my-reviews .note .share-mini { margin-top: 8px; }

/* coming back to the album sheet: show it finished, no replay */
.album-sheet.instant .as-cover, .album-sheet.instant .as-info > *, .album-sheet.instant .as-track { animation: none !important; opacity: 1; transform: none; }
.album-sheet.instant .as-disc { animation: none !important; transform: translateX(46%) rotate(220deg); }
/* Back to the album (Reviews / Pressings opened from the sheet) */
.back-btn {
  display: inline-flex; align-items: center; gap: 4px; align-self: center; flex: none; height: 34px; padding: 0 12px 0 6px; margin-right: 2px;
  border-radius: 999px; border: 1px solid var(--line); background: rgb(var(--hl) / .06); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.back-btn:hover { background: rgb(var(--acc) / .16); border-color: rgb(var(--acc) / .35); }
.back-btn svg { width: 18px; height: 18px; fill: currentColor; }
.back-btn.hidden { display: none; }
/* the album title in the tracklist panel opens the album sheet */
.tl-title-link { cursor: pointer; text-decoration: underline transparent; text-underline-offset: 4px; transition: text-decoration-color .2s; }
.tl-title-link:hover, .tl-title-link:focus-visible { text-decoration-color: var(--accent); outline: none; }
body.tl-queue .tl-title-link { cursor: default; text-decoration: none; }

/* ================================================================ Connect Spotify page */
.sp-box { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: rgb(var(--hl) / .04); border: 1px solid var(--line); }
.sp-box h4 { margin: 0 0 4px; font-size: 15px; }
details.sp-box > summary { cursor: pointer; font-weight: 600; }
details.sp-box[open] > summary { margin-bottom: 8px; }
.sp-steps { margin: 6px 0 12px; padding-left: 20px; line-height: 1.55; }
.sp-steps li { margin-bottom: 8px; }
.copyable { display: inline-flex; align-items: center; gap: 6px; margin: 0 4px; }
.btn.mini { height: 26px; padding: 0 10px; font-size: 12px; }
.opt { color: var(--faint); font-weight: 400; }
#clientIdCheck.ok { color: #4ade80 !important; }
#clientIdCheck.bad { color: #fca5a5 !important; }

/* ================================================================ roomier plinth
   The record-and-arm mechanism keeps its exact geometry in the .turntable square (the arm maths depends on it);
   the wooden plinth and speaker front reach past it on every side, like a real deck where the platter
   takes up ~70% of the width. Everything is measured against the .turntable square (cqw). */
.turntable { container-type: inline-size; width: 80.6%; margin: 5% auto 7%; --px: 12cqw; --py: 7cqw; }   /* bottom: room for the deeper front */
.face { inset: calc(-1 * var(--py)) calc(-1 * var(--px)); border-radius: 3.6% 3.6% 1% 1%; }
.mech { position: absolute; left: var(--px); top: var(--py); width: 100cqw; height: 100cqw; }
.front {
  left: calc(-1 * var(--px)); right: calc(-1 * var(--px)); top: calc(100% + var(--py));
  transform-origin: 50% calc(-50cqw - var(--py));
  transform: var(--proj) translateY(calc(50cqw + var(--py))) rotateX(-90deg) translateY(calc(-50cqw - var(--py)));
}
.plate { left: 3%; bottom: 3%; }
.pitch { right: 3%; top: 58%; height: 30%; }
@media (max-width: 600px) { .turntable { width: 72%; } }   /* the tilt widens the front edge; keep its corners on screen */

/* ================================================================ record tools, beside the turntable */
.deck-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; order: 1; width: min(100%, 520px); }
.deck { order: 0; }
.aside { order: 2; }
.tracklist { order: 3; }
.tool-btn {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-width: 0;
  height: 38px; padding: 0 14px 0 10px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text);
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  transition: background .2s, border-color .2s;
}
.tool-btn:hover, .tool-btn[aria-expanded="true"] { background: rgba(70,50,110,.5); border-color: rgb(var(--acc) / .35); }
.tool-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tool-btn.hidden { display: none; }
.tool-btn svg { width: 17px; height: 17px; fill: currentColor; flex: none; }
.tool-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool-btn .dot { flex: none; width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle, var(--c1) 0 22%, transparent 24%), var(--vinyl-fx), var(--vinyl); box-shadow: 0 0 0 1px rgba(0,0,0,.4); }
.tool-btn.owned { color: #f3dfae; }
.tool-btn .rate-star { color: var(--faint); font-size: 15px; line-height: 1; }
.tool-btn.rated .rate-star { color: #f6c454; }
.tool-btn .chev { width: 0; height: 0; margin-left: 2px; border: 4px solid transparent; border-top: 5px solid currentColor; border-bottom: 0; opacity: .6; flex: none; }
/* wide screens: a column of buttons to the left of the turntable */
@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  .app { grid-template-columns: auto minmax(0, 1fr) 320px; column-gap: 2.5vw; padding-left: 2.5vw; padding-right: 3vw; }
  .deck-tools { order: 0; flex-direction: column; flex-wrap: nowrap; align-items: stretch; width: 176px; justify-self: end; }
  .deck { order: 1; } .aside { order: 2; }
  .tool-btn { height: 42px; padding: 0 16px 0 12px; font-size: 14px; }
  .tool-btn .chev { margin-left: auto; }
}
@media (min-width: 1600px) and (min-aspect-ratio: 1/1) {
  body.has-album .app, body.tl-queue .app { grid-template-columns: auto minmax(0, 1fr) 300px 300px; column-gap: 2vw; }
}
body.idle .deck-tools { opacity: 0; pointer-events: none; }
.deck-tools { transition: opacity .6s ease; }
body.tv .deck-tools { display: none !important; }

/* dropdown menus for Rate and Share */
.tool-menu {
  position: fixed; z-index: 60; min-width: 230px; max-width: min(320px, calc(100vw - 24px)); padding: 6px;
  border-radius: 14px; background: rgba(24,18,32,.97); border: 1px solid rgb(var(--acc) / .22);
  box-shadow: 0 18px 50px rgba(0,0,0,.55); animation: menuIn .14s ease;
}
.tool-menu button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 9px 12px; border-radius: 9px;
  font: inherit; text-align: left; color: var(--text); background: none; border: 0; cursor: pointer;
}
.tool-menu button:hover, .tool-menu button:focus-visible { background: rgb(var(--acc) / .16); outline: none; }
.tool-menu b { font-size: 14px; font-weight: 600; }
.tool-menu small { font-size: 12.5px; color: var(--faint); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px); } }

/* note card */
.note-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.note-card-head .note-cover { width: 64px; height: 64px; border-radius: 6px; flex: none; box-shadow: 0 8px 20px rgba(0,0,0,.45); }
.note-card-meta { display: flex; flex-direction: column; min-width: 0; }
.note-card-meta b { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-card-meta small { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.note-about { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.note-about label { font-size: 13px; font-weight: 600; color: var(--muted); }
.note-about select {
  font: inherit; font-size: 14px; color: var(--text); background: rgb(var(--hl) / .07); border: 1px solid var(--line);
  border-radius: 10px; padding: 7px 30px 7px 10px; min-width: 0; max-width: 100%;
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
}
.note-about select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#noteTrack { flex: 1 1 200px; }
#noteTrack.hidden { display: none; }

/* centre spindle: a chrome post with a rounded tip, standing up through the record */
.spindle-post { border-radius: .4cqw .4cqw 0 0; background: linear-gradient(90deg, #6a655e, #e9e5df 35%, #ffffff 45%, #a8a39b 70%, #55514b); }
.spindle-cap {
  position: absolute; left: 49.2%; top: 49.2%; width: 1.6%; height: 1.6%; border-radius: 50%; pointer-events: none;
  transform-origin: .8cqw .8cqw; transform: var(--proj) translateZ(2.4cqw);
  background: radial-gradient(circle at 38% 34%, #fff 0 18%, #d9d5cf 40%, #8a857e 75%, #4a4641);
  box-shadow: 0 0 0 .08cqw rgba(0,0,0,.35);
}

/* ================================================================ plinth controls, bigger and spread out (face coordinates: 124 × 114 cqw) */
.plate { left: 3cqw; bottom: 2.2cqw; gap: 2.4cqw; padding: 1.3cqw 2cqw; border-radius: 1.8cqw; }
.startstop { width: 13cqw; height: 6.2cqw; border-radius: 1.1cqw; }
.startstop span { font-size: 1.45cqw; letter-spacing: .14em; }
.speedsw { gap: .4cqw; padding: .5cqw; border-radius: 1.4cqw; background: rgba(0,0,0,.34); }
.speedsw button {
  font: 700 2.1cqw/1 system-ui, sans-serif; letter-spacing: .03em; color: var(--pl-ink);
  padding: 1.1cqw 1.4cqw; border: 0; border-radius: 1cqw; background: none; cursor: pointer; transition: background .3s, color .3s, box-shadow .3s;
}
.speedsw button:hover { color: var(--text); background: rgba(255,255,255,.08); }
.speedsw button.on { background: linear-gradient(180deg, #f6f3ee, #cdc7bf); color: #2a211b; box-shadow: 0 .2cqw .4cqw rgba(0,0,0,.45); }
.speedsw button:focus-visible, .startstop:focus-visible { outline: .3cqw solid var(--accent); outline-offset: .2cqw; }
.led { width: 1.8cqw; }

/* volume: a big knob in the front-right corner */
.vol { position: absolute; right: 4cqw; bottom: 1.6cqw; width: 11cqw; height: 11cqw; display: grid; place-items: center; cursor: ns-resize; touch-action: none; outline: none; }
.vol-ticks { position: absolute; inset: 0; border-radius: 50%;
  background: repeating-conic-gradient(from -135deg, var(--pl-ink) 0 1.6deg, transparent 1.6deg 27deg);
  -webkit-mask: radial-gradient(circle, transparent 0 62%, #000 63% 70%, transparent 71%); mask: radial-gradient(circle, transparent 0 62%, #000 63% 70%, transparent 71%);
  clip-path: polygon(50% 50%, 0 100%, 0 0, 100% 0, 100% 100%); }
.vol .knob {
  width: 7.4cqw; --a: 0deg;
  background: conic-gradient(from 0deg, #f4f1ec, #9d978f, #e9e5df, #8f8981, #f4f1ec);
  box-shadow: 0 .5cqw .9cqw rgba(0,0,0,.55), inset 0 0 0 .35cqw rgba(0,0,0,.08);
}
.vol .knob::after { width: .55cqw; height: 34%; margin-left: -.275cqw; background: var(--accent); transform: rotate(var(--a)); transform-origin: 50% 125%; }
.vol-label { position: absolute; bottom: -1.2cqw; font: 700 1.05cqw/1 system-ui, sans-serif; letter-spacing: .2em; text-transform: uppercase; color: var(--pl-ink); }
.vol:focus-visible .knob { outline: .3cqw solid var(--accent); outline-offset: .4cqw; }

/* pitch: taller, with a scale and a readout; the cap drags */
.pitch { right: 4.2cqw; top: 60cqw; width: 5.4cqw; height: 34cqw; cursor: ns-resize; touch-action: none; outline: none; }
.pitch-scale { position: absolute; left: -3.4cqw; top: .6cqw; bottom: .6cqw; display: flex; flex-direction: column; justify-content: space-between;
  font: 700 1.1cqw/1 system-ui, sans-serif; color: var(--pl-ink); }
.pitch-cap { left: -18%; right: -18%; height: 3.4cqw; top: calc(50% - 1.7cqw + var(--p, 0) * 15.3cqw); transition: top .05s linear; }
.pitch-read { position: absolute; left: 50%; bottom: -2.4cqw; transform: translateX(-50%); font: 700 1.1cqw/1 system-ui, sans-serif; color: var(--pl-ink); white-space: nowrap; }
.pitch:focus-visible .pitch-cap { outline: .3cqw solid var(--accent); outline-offset: .2cqw; }

/* cue lever: click to lift / lower the needle; the lever swings up while the record's paused */
.cue { pointer-events: auto; cursor: pointer; outline: none; }
.cue-arm { transition: transform .35s var(--ease); transform-box: fill-box; transform-origin: 50% 90%; }
.deck.cue-up .cue-arm { transform: rotate(-18deg) translateY(-6%); }
.cue:focus-visible rect:first-child { stroke: var(--accent); stroke-width: .5; }

/* pitch readout: the change and the real speed, big enough to read */
.pitch-read { bottom: -5.4cqw; display: flex; flex-direction: column; align-items: center; gap: .3cqw; font-size: 1.6cqw; color: var(--text); opacity: .85; }
.pitch-read small { font-size: 1.2cqw; font-weight: 600; color: var(--pl-ink); letter-spacing: .04em; }
.strobe::before, .strobe::after { transform: rotate(var(--strobe-rot, 0deg)); will-change: transform; }   /* only the dots turn; the lamp's glow stays put */

/* the tilted deck draws ~1.2× its box (3D tilt + the wider plinth); size the box so the whole drawing fits its
   column with a clear gap to the buttons on the left and the album info on the right */
@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  .deck { width: min(76%, calc(100vh - 230px), 720px); justify-self: center; }
}

/* swapped: the slider is volume, the knob is pitch */
.vol-slider .pitch-scale b { font-size: 1cqw; letter-spacing: .06em; text-transform: uppercase; }
.vol-slider .pitch-read { bottom: -3.2cqw; }
.pitch-knob .vol-ticks::after { content: none; }
.pitch-knob::before { /* the 0% mark at 12 o'clock */
  content: ""; position: absolute; top: .2cqw; left: 50%; width: .5cqw; height: 1.1cqw; margin-left: -.25cqw; border-radius: .2cqw; background: var(--accent);
}
.pitch-knob .knob::after { transform: rotate(var(--a)); }
.pitch-knob-read {
  position: absolute; right: calc(100% + .8cqw); top: 50%; transform: translateY(-50%); text-align: right; white-space: nowrap;
  display: flex; flex-direction: column; gap: .2cqw; font: 700 1.5cqw/1 system-ui, sans-serif; color: var(--text); opacity: .85;
}
.pitch-knob-read small { font-size: 1.15cqw; font-weight: 600; color: var(--pl-ink); }
.pitch-knob { cursor: ns-resize; }

/* the Vinyl button shows its whole message ("On your shelf · Tangerine translucent"), wrapping onto more lines */
.tool-btn.vinyl-tool { height: auto; min-height: 38px; padding-top: 8px; padding-bottom: 8px; border-radius: 20px; text-align: left; }
.tool-btn.vinyl-tool span { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; overflow-wrap: anywhere; }
@media (min-width: 900px) and (min-aspect-ratio: 1/1) { .tool-btn.vinyl-tool { min-height: 42px; } }


/* ================================================================ painted theme
   The app's look matches the icon: a flat, painted room (see the scenes in index.html), cream paper panels
   with ink text and a solid cut-paper shadow, flat colour buttons and Jost headings.
   UI only: the turntable keeps its own detailed look (its sections above are untouched, and the tokens it
   reads, --accent and --text at :root, keep their values). */
:root {
  --wall: #2b4536; --floor: #a9532d; --cobalt: #3f5185; --cobalt-dark: #33436f; --mustard: #c99a45;
  --pink: #c9a0a6; --cream: #e9dcc3; --cream-2: #ddcdb0; --ink: #1b2520;
  --head-font: "Jost", Futura, "Avenir Next", "Helvetica Neue", sans-serif;
  --cut: 6px 7px 0 rgba(10, 22, 15, .38);              /* cut-paper shadow */
  --cut-sm: 3px 4px 0 rgba(10, 22, 15, .38);
  --paper-radius: 18px 22px 16px 20px / 20px 16px 22px 18px;
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --grain-paper: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .2 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
body { background: var(--wall); }

/* ---- the room: in focus, flat colour, one still paper-grain layer over it (not over the turntable) ---- */
.paint-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.room, .room[data-scene="vinyl"], .room[data-scene="party"], .room[data-scene="skyline"] { filter: none; }
body.tv.tv-dim .room { filter: brightness(.45); }
/* a dim record room: warm lamp light in the middle, darker corners, paper grain */
.ambient { background: radial-gradient(62% 58% at 50% 40%, rgba(255, 190, 115, .16), transparent 72%); mix-blend-mode: screen; opacity: 1; }
.vignette {
  background: var(--grain-paper), radial-gradient(130% 100% at 50% 42%, transparent 42%, rgba(14, 11, 8, .55));
  mix-blend-mode: multiply; opacity: 1;
}

/* ---- paper: everything you read or press ---- */
.corner .pill, .corner .icon-btn, .nav-btn, .topnav, .tool-btn, .tool-menu, .aside, .panel:not(.wall),
dialog, .toast, .crackle-hint, .tv-hint, .vconnect, .wall-head input {
  --text: var(--ink); --muted: rgba(19, 36, 26, .68); --faint: rgba(19, 36, 26, .5); --line: rgba(19, 36, 26, .16);
  --accent: var(--cobalt); --brand: var(--cobalt); --glass: var(--cream); --glass-strong: var(--cream);
  --hl: 19 36 26; --acc: 61 90 208; --field: #f5ecdb;
  color: var(--text);
}
.aside, .panel:not(.wall), dialog, dialog.album-sheet, .tool-menu, .toast, .crackle-hint, .tv-hint, .vconnect {
  background: var(--cream) var(--grain-paper); background-blend-mode: multiply;
  border: 0; backdrop-filter: none; -webkit-backdrop-filter: none;
}
.aside { padding: 18px 20px 16px; border-radius: var(--paper-radius); box-shadow: var(--cut); }
dialog, dialog.album-sheet { border-radius: var(--paper-radius); box-shadow: 8px 10px 0 rgba(10, 22, 15, .42); }
dialog::backdrop { background: rgba(19, 36, 26, .5); backdrop-filter: none; -webkit-backdrop-filter: none; }
.dlg-head { background: var(--cream); }
.panel:not(.wall) { box-shadow: -6px 0 0 rgba(10, 22, 15, .3); }
.toast, .crackle-hint, .tv-hint { box-shadow: var(--cut-sm); }
.toast { border-radius: 14px; }
@media (min-width: 1600px) and (min-aspect-ratio: 1/1) {
  body.has-album .tracklist, body.tl-queue .tracklist { border: 0; border-radius: var(--paper-radius); box-shadow: var(--cut); }
}

/* headings */
h1, h2, .title, .dlg-head h2, .panel-head h2, .as-info h2, .wall-head h2, .vgroup-title, .pick-meta h3,
.ctx, .kicker, dialog h3, .vp-body h4, .plaque, .as-track.as-side { font-family: var(--head-font); }
.title, .as-info h2, .dlg-head h2 { font-weight: 700; letter-spacing: -.005em; }

/* ---- buttons: flat blocks with a small cut-paper shadow ---- */
.corner .pill, .corner .icon-btn, .nav-btn, .tool-btn {
  background: var(--cream); border: 0; backdrop-filter: none; -webkit-backdrop-filter: none;
  box-shadow: var(--cut-sm); font-family: var(--head-font); font-weight: 600;
  transition: transform .12s ease, box-shadow .12s ease, background .2s;
}
.corner .icon-btn { color: var(--ink); }
.corner .pill:hover, .corner .icon-btn:hover, .nav-btn:hover, .tool-btn:hover, .tool-btn[aria-expanded="true"] {
  background: #f1e6d0; transform: translate(-1px, -1px); box-shadow: 4px 5px 0 rgba(10, 22, 15, .38);
}
.corner .pill:active, .corner .icon-btn:active, .nav-btn:active, .tool-btn:active { transform: translate(2px, 3px); box-shadow: 1px 1px 0 rgba(10, 22, 15, .38); }
.nav-btn.on { background: var(--cobalt); color: var(--cream); }
.nav-btn.on:hover { background: #4b5f99; }
.nav-btn .dot { background: #6fb486; box-shadow: 0 0 0 2px var(--cream); }
.corner { gap: 8px; }
.topnav { gap: 8px; }
@media (max-width: 1239px) {
  .topnav { border: 0; border-radius: var(--paper-radius); box-shadow: var(--cut); background: var(--cream) var(--grain-paper); background-blend-mode: multiply; gap: 2px; }
  .topnav .nav-btn, .topnav .nav-btn:hover, .topnav .nav-btn:active { box-shadow: none; transform: none; }
  .topnav .nav-btn.on { background: none; color: var(--ink); }
}
.tool-menu { border-radius: 16px; box-shadow: var(--cut); }
.tool-btn.owned { color: var(--cobalt-dark); }
.tool-btn.rated .rate-star, .rate-pill .rate-star { color: #b8862a; }

.play { background: var(--cobalt); color: var(--cream); box-shadow: var(--cut-sm); }
.icon-btn:hover { background: rgb(var(--hl) / .08); }
.btn { font-family: var(--head-font); }
.btn.primary { background: var(--cobalt); color: var(--cream); box-shadow: var(--cut-sm); }
.btn.primary:hover { background: #4b5f99; }
#connectBtn.btn.primary { box-shadow: var(--cut-sm); }
.wall-tabs button[aria-selected="true"] { background: var(--mustard); color: var(--ink); box-shadow: 2px 3px 0 rgba(10, 22, 15, .4); }

/* ---- now playing card ---- */
.seek-fill, .seg.current i { background: var(--cobalt); }
.seek-knob { background: var(--cobalt); box-shadow: 0 0 0 3px var(--cream); }
.ledge { background: var(--cobalt-dark); box-shadow: 3px 4px 0 rgba(10, 22, 15, .3); }
.ledge span { color: var(--cream); text-shadow: none; }
.vinyl-pill.owned { color: var(--cobalt-dark); }

/* colours that were picked for dark glass, readable on paper */
.warn { color: #b8401a !important; }
#clientIdCheck.ok { color: #1f8a4c !important; }
#clientIdCheck.bad { color: #b8401a !important; }
.like-btn.on { color: #b02f52; border-color: rgba(176, 47, 82, .4); background: rgba(176, 47, 82, .1); }
.own-tag.wanted { color: #9c2f4a; background: rgba(201, 106, 114, .18); }
.vp-price.drop b { color: #8a5d00; }
.tl li.current .nm { color: var(--text); }
.rv-feed .note:hover { background: rgb(var(--hl) / .08); }
:is(.aside, .panel:not(.wall), dialog) .stars::before {
  background: linear-gradient(90deg, #b8862a calc(var(--v, 0) * 20%), rgb(var(--hl) / .18) 0); -webkit-background-clip: text; background-clip: text;
}
.sticker.owned { background: var(--mustard); color: var(--ink); }
.sticker.wanted { background: var(--pink); color: #9c2f4a; }
.own-tag.owned, .plaque { background: var(--mustard); color: var(--ink); box-shadow: 2px 3px 0 rgba(10, 22, 15, .4); }

/* flip the record: a flat cobalt card over the deck */
.flip-btn { background: var(--cobalt); color: var(--cream); border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: var(--cut); font-family: var(--head-font); }
.flip-btn:hover { background: #4b5f99; }
.flip-btn b { color: var(--mustard); }
.flip-btn svg { fill: var(--mustard); }
@keyframes flipNudge { 0%, 100% { box-shadow: var(--cut), 0 0 0 0 rgba(201, 154, 69, .5); } 50% { box-shadow: var(--cut), 0 0 0 10px rgba(201, 154, 69, 0); } }

/* ---- record wall: the painted green wall with cream shelves ---- */
.panel.wall {
  --accent: var(--mustard);
  background:
    var(--grain),
    repeating-linear-gradient(90deg, rgba(0,0,0,.07) 0 3px, transparent 3px 11px, rgba(0,0,0,.04) 11px 14px, transparent 14px 31px),
    var(--wall);
  background-blend-mode: multiply, normal, normal;
}
.wall-head { background: linear-gradient(180deg, var(--wall) 55%, rgba(43, 69, 54, 0)); }
.wall-head input { background: var(--cream); border: 0; box-shadow: var(--cut-sm); }
.wall-head input::placeholder { color: rgba(19, 36, 26, .5); }
.plank { background: var(--cream); box-shadow: 0 5px 0 var(--ink), 0 12px 0 rgba(10, 22, 15, .25); }
.plank::before, .plank::after { background: var(--ink); top: calc(100% + 5px); }
.rec.current::before { color: var(--ink); box-shadow: 2px 3px 0 rgba(10, 22, 15, .4); }
.rec .cover { box-shadow: 4px 5px 0 rgba(10, 22, 15, .4); }
.rec:hover .cover, .rec:focus-visible .cover { box-shadow: 7px 9px 0 rgba(10, 22, 15, .35); }
.vconnect { border-radius: var(--paper-radius); box-shadow: var(--cut); }
.notes.diary .note { background: var(--cream); color: var(--ink); --text: var(--ink); --muted: rgba(19,36,26,.68); --faint: rgba(19,36,26,.5); --line: rgba(19,36,26,.16); --hl: 19 36 26; border: 0; box-shadow: var(--cut-sm); }

/* ---- welcome screen ---- */
.intro { background: var(--grain), var(--wall); background-blend-mode: multiply, normal; color: var(--cream); }
.intro-ink { fill: var(--cream); stroke: var(--cream); filter: drop-shadow(4px 5px 0 rgba(10, 22, 15, .4)); }
.intro-welcome { font-family: var(--head-font); font-weight: 600; letter-spacing: .2em; text-transform: uppercase; font-size: clamp(14px, 2vw, 20px); color: var(--mustard); }
.intro-rule { background: var(--mustard); height: 4px; }
.intro-skip { color: rgba(243, 230, 207, .6); }

/* idle (ambient) mode: the now-playing card keeps its progress bars and folds the buttons away,
   instead of leaving an empty block of paper */
.aside .controls { max-height: 90px; transition: opacity .6s ease, max-height .6s var(--ease), margin .6s var(--ease); }
body.idle .aside .bars { opacity: 1; pointer-events: none; }
body.idle .aside .controls { max-height: 0; margin-top: -12px; overflow: hidden; }
body.idle .aside .pill-row { opacity: 0; }

/* brand in the top bar: the logo and the name */
.brand-pill { padding: 0 16px 0 5px; gap: 9px; text-decoration: none; color: var(--ink); }
.brand-pill img { width: 30px; height: 30px; border-radius: 8px; display: block; transform: scale(1.22); }   /* the logo file has its own margin */
.brand-pill span { font-family: var(--head-font); font-weight: 700; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
@media (max-width: 760px) { .brand-pill span { display: none; } .brand-pill { padding: 0 5px; } }
body.tv .brand-pill { display: none; }

/* ================================================================ light / dark, and a quieter background
   Paper surfaces read their colours from --p-* tokens, so dark mode only swaps tokens.
   The room sits behind a soft wash so it stays in the background; its texture (streaks, grain, darker corners)
   is plain CSS gradients: no live SVG filters, which made every repaint of the full-screen room very slow. */
:root {
  --p-bg: var(--cream); --p-bg-hover: #f1e6d0; --p-text: var(--ink);
  --p-muted: rgba(27, 37, 32, .68); --p-faint: rgba(27, 37, 32, .5); --p-line: rgba(27, 37, 32, .16);
  --p-hl: 27 37 32; --p-field: #f5ecdb; --p-accent: #3f5185; --p-acc: 63 81 133;
  --p-shadow: rgba(10, 16, 12, .38);
  --room-wash: rgba(74, 78, 68, .42);          /* fades the room toward a soft grey-green */
  --room-edge: rgba(14, 11, 8, .42);
  --warn: #b8401a; --ok: #1f8a4c; --love: #b02f52; --owned: #33436f; --gold: #8a5d00;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --p-bg: #252d28; --p-bg-hover: #2d3731; --p-text: #e9dcc3;
    --p-muted: rgba(233, 220, 195, .7); --p-faint: rgba(233, 220, 195, .5); --p-line: rgba(233, 220, 195, .14);
    --p-hl: 233 220 195; --p-field: #1b221e; --p-accent: #9aaadb; --p-acc: 154 170 219;
    --p-shadow: rgba(0, 0, 0, .5);
    --room-wash: rgba(10, 13, 11, .62); --room-edge: rgba(0, 0, 0, .5);
    --warn: #f0a07a; --ok: #8fd4a6; --love: #f09ab0; --owned: #aab8e6; --gold: #e2c27a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --p-bg: #252d28; --p-bg-hover: #2d3731; --p-text: #e9dcc3;
  --p-muted: rgba(233, 220, 195, .7); --p-faint: rgba(233, 220, 195, .5); --p-line: rgba(233, 220, 195, .14);
  --p-hl: 233 220 195; --p-field: #1b221e; --p-accent: #9aaadb; --p-acc: 154 170 219;
  --p-shadow: rgba(0, 0, 0, .5);
  --room-wash: rgba(10, 13, 11, .62); --room-edge: rgba(0, 0, 0, .5);
  --warn: #f0a07a; --ok: #8fd4a6; --love: #f09ab0; --owned: #aab8e6; --gold: #e2c27a;
  color-scheme: dark;
}
:root { --cut: 6px 7px 0 var(--p-shadow); --cut-sm: 3px 4px 0 var(--p-shadow); }

/* the room: washed back, lightly textured, darker toward the corners, warm light in the middle */
.vignette {
  mix-blend-mode: normal; opacity: 1;
  background:
    var(--grain-paper),
    radial-gradient(130% 100% at 50% 42%, transparent 40%, var(--room-edge)),
    repeating-linear-gradient(90deg, rgba(0,0,0,.05) 0 3px, transparent 3px 11px, rgba(0,0,0,.03) 11px 14px, transparent 14px 31px),
    repeating-linear-gradient(90deg, transparent 0 47px, rgba(0,0,0,.04) 47px 53px, transparent 53px 97px),
    linear-gradient(var(--room-wash), var(--room-wash));
}
.ambient { mix-blend-mode: normal; background: radial-gradient(60% 55% at 50% 40%, rgba(255, 196, 128, .10), transparent 72%); }

/* paper reads the theme tokens */
.corner .pill, .corner .icon-btn, .nav-btn, .topnav, .tool-btn, .tool-menu, .aside, .panel:not(.wall),
dialog, .toast, .crackle-hint, .tv-hint, .vconnect, .wall-head input {
  --text: var(--p-text); --muted: var(--p-muted); --faint: var(--p-faint); --line: var(--p-line);
  --accent: var(--p-accent); --glass: var(--p-bg); --glass-strong: var(--p-bg);
  --hl: var(--p-hl); --acc: var(--p-acc); --field: var(--p-field);
  color: var(--text);
}
.aside, .panel:not(.wall), dialog, dialog.album-sheet, .tool-menu, .toast, .crackle-hint, .tv-hint, .vconnect,
.corner .pill, .corner .icon-btn, .nav-btn, .tool-btn, .dlg-head, .wall-head input { background-color: var(--p-bg); }
.aside, .panel:not(.wall), dialog, dialog.album-sheet, .tool-menu, .toast, .crackle-hint, .tv-hint, .vconnect { background-image: var(--grain-paper); }
@media (max-width: 1239px) { .topnav { background-color: var(--p-bg); } .topnav .nav-btn { background: none; } .topnav .nav-btn.on { color: var(--p-text); } }
.corner .pill:hover, .corner .icon-btn:hover, .nav-btn:hover, .tool-btn:hover, .tool-btn[aria-expanded="true"] { background-color: var(--p-bg-hover); }
.corner .icon-btn, .brand-pill { color: var(--p-text); }
.nav-btn.on { background-color: var(--cobalt); color: var(--cream); }
.seek-knob { box-shadow: 0 0 0 3px var(--p-bg); }
.nav-btn .dot { box-shadow: 0 0 0 2px var(--p-bg); }
.wall-head input { color: var(--p-text); }
.wall-head input::placeholder { color: var(--p-faint); }
.notes.diary .note { background: var(--p-bg); color: var(--p-text); --text: var(--p-text); --muted: var(--p-muted); --faint: var(--p-faint); --line: var(--p-line); --hl: var(--p-hl); }
.panel:not(.wall) { box-shadow: -6px 0 0 var(--p-shadow); }
dialog, dialog.album-sheet { box-shadow: 8px 10px 0 var(--p-shadow); }
.warn { color: var(--warn) !important; }
#clientIdCheck.ok { color: var(--ok) !important; }
#clientIdCheck.bad { color: var(--warn) !important; }
.like-btn.on { color: var(--love); }
.own-tag.wanted { color: var(--love); }
.vp-price.drop b { color: var(--gold); }
.tool-btn.owned, .vinyl-pill.owned { color: var(--owned); }

/* settings: appearance */
.theme-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-opts button {
  padding: 9px 16px; border-radius: 999px; font-family: var(--head-font); font-weight: 600; font-size: 14px;
  color: var(--text); border: 1px solid var(--line); background: rgb(var(--hl) / .04);
}
.theme-opts button:hover { background: rgb(var(--hl) / .1); }
.theme-opts button[aria-checked="true"] { background: var(--cobalt); color: var(--cream); border-color: transparent; box-shadow: var(--cut-sm); }

/* idle: once the controls have faded out, stop drawing them at all (cheaper than keeping see-through layers) */
.corner, .bars, .controls, .tracklist, .deck-tools, .pill-row { transition: opacity .6s ease, visibility 0s linear 0s; }
body.idle .corner, body.idle .controls, body.idle .tracklist, body.idle .deck-tools, body.idle .aside .pill-row {
  visibility: hidden; transition: opacity .6s ease, visibility 0s linear .6s;
}
body.idle .bars:not(.aside .bars) { visibility: hidden; transition: opacity .6s ease, visibility 0s linear .6s; }
.corner.right:has(.topnav.open) { visibility: visible; }

/* TV mode keeps its own two-column layout (turntable left, now playing right) on every screen size.
   Without this, the wide-screen rules for the docked tracklist (body.has-album .app, 1600px and up) won,
   left a zero-width first column for the hidden record tools, and squeezed the turntable to nothing. */
body.tv .app, body.tv.has-album .app, body.tv.tl-queue .app { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); column-gap: 5vw; padding: 9vh 8vw 9vh; }
body.tv .deck { order: 0; }
body.tv .aside { order: 1; }
@media (max-aspect-ratio: 1/1) {
  body.tv .app, body.tv.has-album .app, body.tv.tl-queue .app { grid-template-columns: 1fr; row-gap: 4vh; }
}
body.tv .tv-hint { background: var(--p-bg) var(--grain-paper); background-blend-mode: multiply; border: 0; box-shadow: var(--cut-sm); color: var(--p-muted); }
body.tv .tv-hint b { color: var(--p-text); }
