/* Basement Jukebox — base layout + structure.
   Everything visual is a CSS variable so a skin file can repaint the whole thing
   without touching markup. Add a skin: copy skins/dark.css, change the tokens. */

:root {
  --bg: #0b0b0f;
  --bg-2: #121219;
  --panel: rgba(255,255,255,.04);
  --panel-2: rgba(255,255,255,.07);
  --line: rgba(255,255,255,.09);
  --text: #f2f2f5;
  --text-dim: #9a9aa8;
  --accent: #f0b35b;
  --accent-ink: #1a1206;
  --danger: #e2603f;
  --radius: 14px;
  --art-radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  --font-display: var(--font);
  --display-spacing: -0.02em;
  --display-transform: none;
  --shadow: 0 18px 50px rgba(0,0,0,.55);
  --glow: none;
  --texture: none;
  --record-visible: 1;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* The browser's own [hidden]{display:none} is an attribute selector (0,0,1), so ANY class
   that sets display beats it and el.hidden = true silently does nothing. That is how the
   staff-only controls stayed visible to guests. Make the attribute win, everywhere. */
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  /* NOT overscroll-behavior-y: none — on Android Chrome that property IS pull-to-refresh,
     so disabling bounce also removed the only way those guests could reload the page.
     iOS has a toolbar reload button and never noticed. The scrolling lists below still set
     `contain` locally, which stops them dragging the page without touching the gesture. */
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: var(--texture); opacity: .5;
}

button, input, select { font: inherit; color: inherit; }
.hidden { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { color: var(--accent); font-size: 20px; text-shadow: var(--glow); }
.brand-name {
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
  letter-spacing: var(--display-spacing); text-transform: var(--display-transform);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-right { display: flex; gap: 8px; align-items: center; }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--text-dim); border-radius: 999px;
  padding: 8px 13px; font-size: 13px; cursor: pointer;
  max-width: 34vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chip.icon { padding: 8px 11px; font-size: 15px; }
.chip:active { background: var(--panel-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-dim); flex: none; }
.chip.live .dot { background: var(--accent); box-shadow: 0 0 10px var(--accent); }

/* ---------- stage ---------- */
.stage {
  position: relative; z-index: 1;
  max-width: 1100px; margin: 0 auto;
  padding: 16px 16px calc(28px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px;
}

/* ---------- now playing ---------- */
.now {
  display: grid; grid-template-columns: minmax(0, 190px) 1fr; gap: 20px; align-items: center;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.now-art-wrap { position: relative; aspect-ratio: 1; }
.now-art {
  position: relative; z-index: 2;
  width: 100%; height: 100%; object-fit: cover;
  border-radius: var(--art-radius); background: var(--bg-2); display: block;
}
.record {
  position: absolute; z-index: 1; top: 4%; right: -10%; width: 92%; aspect-ratio: 1;
  border-radius: 50%; opacity: calc(var(--record-visible) * .9);
  box-shadow: -6px 0 18px rgba(0,0,0,.5);
  background:
    radial-gradient(circle at 50% 50%, var(--accent) 0 8%, #0e0e12 8.5% 13%, transparent 13.5%),
    repeating-radial-gradient(circle at 50% 50%, #17171d 0 2px, #0c0c10 2px 4px);
  animation: spin 4.2s linear infinite; animation-play-state: paused;
}
.playing .record { animation-play-state: running; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .record { animation: none; } }

.now-meta { min-width: 0; }
.now-label {
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 8px; text-shadow: var(--glow);
}
.now-title {
  font-family: var(--font-display);
  margin: 0 0 4px; font-size: clamp(22px, 4.2vw, 36px); line-height: 1.12;
  letter-spacing: var(--display-spacing); text-transform: var(--display-transform);
  overflow-wrap: anywhere;
}
.now-artist { color: var(--text-dim); font-size: clamp(14px, 2vw, 17px); margin-bottom: 16px; overflow-wrap: anywhere; }
.progress { height: 5px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--accent); box-shadow: var(--glow); transition: width .9s linear; }
.now-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 9px; font-size: 12.5px; color: var(--text-dim); }
.added-by { opacity: .85; }

/* ---------- panels ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 18px; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.panel-head h3 {
  font-family: var(--font-display); margin: 0; font-size: 13px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim);
}
.count {
  display: inline-block; min-width: 20px; text-align: center; margin-left: 6px;
  background: var(--panel-2); border-radius: 99px; padding: 1px 7px; color: var(--text); letter-spacing: 0;
}
.badges { display: flex; gap: 6px; }
.badge {
  font-size: 10.5px; letter-spacing: .11em; text-transform: uppercase;
  border: 1px solid var(--accent); color: var(--accent);
  border-radius: 99px; padding: 3px 9px; text-shadow: var(--glow);
}
.badge.warn { border-color: var(--danger); color: var(--danger); text-shadow: none; }
.empty { color: var(--text-dim); font-size: 14px; margin: 6px 0 0; }

/* ---------- queue ---------- */
/* minmax(0, 1fr), not the default auto: an auto track refuses to shrink below its content's
   minimum, so a single long row widens the track, the panel, and the whole page with it.
   That is what put a sideways scrollbar on phones. */
.queue {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px;
}

/* Past a handful of songs the queue scrolls inside itself rather than pushing search off
   the bottom of the screen. ~5 rows visible; the fade hints there is more below. */
.queue.scrolls {
  max-height: calc(5 * 62px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;          /* stop the page scrolling once the list ends */
  mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent 100%);
  padding-right: 2px;
}
.queue.scrolls::-webkit-scrollbar { width: 5px; }
.queue.scrolls::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
.q-item { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: 10px; min-width: 0; }
.q-item + .q-item { border-top: 1px solid var(--line); border-radius: 10px; }
.q-item:nth-child(odd) { background: rgba(255,255,255,.015); }
.q-num { width: 22px; text-align: right; color: var(--text-dim); font-variant-numeric: tabular-nums; font-size: 13px; flex: none; }
.q-art { width: 42px; height: 42px; border-radius: 6px; object-fit: cover; background: var(--bg-2); flex: none; }
.q-text { min-width: 0; flex: 1; overflow: hidden; }
/* display:block matters: overflow and text-overflow do nothing on an inline element, so
   without it a long title does not ellipsis — it just runs on underneath the vote buttons. */
.q-name { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-sub { display: block; font-size: 12.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-sub .who { color: var(--accent); opacity: .9; }
.q-tag { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim); border: 1px solid var(--line); border-radius: 99px; padding: 2px 7px; flex: none; }
.q-ctl { display: flex; gap: 4px; flex: none; }
.q-ctl button { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--text-dim); cursor: pointer; }
.q-ctl button:active { background: var(--panel-2); }
.q-ctl .kill { color: var(--danger); }

/* ---------- search ---------- */
.search-row { display: flex; gap: 8px; align-items: center; }
#search {
  flex: 1; min-width: 0; padding: 14px 16px; font-size: 16px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
}
#search:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow); }
#search::placeholder { color: var(--text-dim); }
.credits-line { margin: 10px 2px 0; font-size: 12.5px; color: var(--text-dim); min-height: 17px; }
.credits-line b { color: var(--accent); font-weight: 600; }

.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 12px; margin-top: 14px; }
.card { border: 0; background: transparent; padding: 0; text-align: left; cursor: pointer; display: grid; gap: 7px; }
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--art-radius); background: var(--bg-2); box-shadow: var(--shadow); }
.card .t { font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .a { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card:active img { transform: scale(.96); }
.card img { transition: transform .12s ease; }
.card.queued img { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  border-radius: 11px; padding: 12px 16px; cursor: pointer; font-size: 15px;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; box-shadow: var(--glow); }
.btn.ghost { background: transparent; color: var(--text-dim); }
.btn.danger { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn.big { padding: 14px 26px; font-size: 20px; }

/* ---------- host drawer ---------- */
.drawer {
  /* Above .curtain (80): the whole point of the "Bar staff" button is to reach this panel
     while the gate is covering the screen. */
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.6); backdrop-filter: blur(6px);
  display: none; align-items: flex-end; justify-content: center;
}
.drawer.open { display: flex; }
.drawer-inner {
  width: min(560px, 100%); max-height: 88vh; overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 18px 20px calc(26px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow);
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.drawer-head h3 { font-family: var(--font-display); margin: 0; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); }
.host-transport { display: flex; gap: 10px; justify-content: center; margin: 6px 0 18px; }
.field { display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 16px; }
.field input[type=range], .field select {
  display: block; width: 100%; margin-top: 8px;
  padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text);
  letter-spacing: 0; text-transform: none; font-size: 15px;
}
.field input[type=range] { padding: 0; border: 0; background: transparent; accent-color: var(--accent); height: 30px; }
.toggles { display: grid; gap: 10px; margin-bottom: 18px; }
.switch { display: flex; align-items: center; gap: 11px; font-size: 14.5px; color: var(--text); }
.switch input { width: 20px; height: 20px; accent-color: var(--accent); }
.host-actions { display: flex; gap: 10px; margin-bottom: 10px; }
.host-actions .btn { flex: 1; }
.pin-row { display: flex; gap: 10px; }
.pin-row input { flex: 1; padding: 13px 15px; font-size: 18px; letter-spacing: .3em; border-radius: 11px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.muted { color: var(--text-dim); font-size: 14px; }
.small { font-size: 12px; }
.err { color: var(--danger); font-size: 13px; min-height: 18px; margin: 8px 0 0; }

/* ---------- setup + toast ---------- */
.curtain { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: var(--bg); padding: 24px; }
.curtain-card { max-width: 460px; text-align: center; }
.curtain-card h1 { font-family: var(--font-display); font-size: 24px; margin: 0 0 10px; }
.curtain-card p { color: var(--text-dim); line-height: 1.55; margin: 0 0 22px; white-space: pre-wrap; text-align: left; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom));
  /* visibility, not just a transform: sliding "far enough" down is arithmetic that has now
     been wrong twice, because the distance to clear depends on the element's own height AND
     the safe-area inset. This cannot peek. */
  visibility: hidden;
  transform: translate(-50%, calc(100% + 24px + env(safe-area-inset-bottom)));
  z-index: 120; background: var(--accent); color: var(--accent-ink);
  padding: 13px 22px; border-radius: 99px; font-weight: 600; font-size: 15px;
  box-shadow: var(--shadow); max-width: 92vw; text-align: center;
  transition: transform .26s cubic-bezier(.2,.9,.3,1.2), visibility 0s linear .26s;
}
.toast.show { visibility: visible; transform: translate(-50%, 0); transition-delay: 0s; }
.toast.bad { background: var(--danger); color: #fff; }

/* ---------- responsive ---------- */
@media (max-width: 620px) {
  .now { grid-template-columns: 1fr; text-align: center; padding: 16px; }
  .now-art-wrap { width: 60%; margin: 0 auto; }
  .record { display: none; }
  .now-foot { justify-content: center; gap: 16px; flex-wrap: wrap; }
  .results { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
  .chip { max-width: 28vw; }
}
/* Wall tablet in landscape: make the now-playing card carry the room. */
@media (min-width: 900px) {
  .now { padding: 26px; gap: 28px; grid-template-columns: minmax(0, 240px) 1fr; }
}

/* ============================================================
   Sessions, guests, voting
   ============================================================ */

/* ---------- name gate ---------- */
.gate-mark { font-size: 40px; color: var(--accent); text-shadow: var(--glow); margin-bottom: 10px; }
.curtain-card h1 { margin-bottom: 8px; }
#gate-form { display: grid; gap: 10px; margin-top: 4px; }
#gate-name {
  width: 100%; padding: 15px 18px; font-size: 18px; text-align: center;
  border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
}
#gate-name:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow); }
.small-btn { margin-top: 18px; font-size: 13px; padding: 8px 14px; }

/* ---------- credits chip ---------- */
.chip.credits { gap: 8px; }
.chip.credits b { color: var(--accent); font-variant-numeric: tabular-nums; }
.chip.credits.spent b { color: var(--danger); }

/* ---------- queue voting ---------- */
.q-item.floor { opacity: .62; }
.q-item.floor .q-name { font-style: italic; }

.q-vote { display: flex; align-items: center; gap: 2px; flex: none; }
.vbtn {
  width: 36px; height: 36px; border-radius: 9px; cursor: pointer;
  border: 1px solid transparent; background: transparent; color: var(--text-dim);
  font-size: 13px; line-height: 1; display: grid; place-items: center;
}
.vbtn:active { transform: scale(.9); }
.vbtn.up.on    { color: var(--accent); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.vbtn.down.on  { color: var(--danger); border-color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); }
.vscore {
  min-width: 26px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}
.vscore.pos { color: var(--accent); font-weight: 600; }
.vscore.neg { color: var(--danger); }

.q-kill {
  width: 32px; height: 32px; flex: none; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--danger); font-size: 15px;
}

/* ---------- drawer tabs ---------- */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tab {
  flex: 1; padding: 11px 8px; cursor: pointer; font-size: 13px;
  background: transparent; border: 0; border-bottom: 2px solid transparent;
  color: var(--text-dim); letter-spacing: .04em;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.field input[type=text], .field input[type=number] {
  display: block; width: 100%; margin-top: 8px; padding: 11px 13px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text);
  letter-spacing: 0; text-transform: none; font-size: 15px;
}
.field input:focus { outline: none; border-color: var(--accent); }

/* ---------- guest list ---------- */
.guest-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.guest {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px;
}
.guest.blocked { opacity: .5; }
.guest.blocked .guest-name { text-decoration: line-through; }
.guest-name { font-size: 15px; flex: 1; min-width: 90px; }
.guest-meta { font-size: 12.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.guest-ctl { display: flex; gap: 5px; flex: none; }
.btn.tiny { padding: 7px 11px; font-size: 13px; border-radius: 8px; }

@media (max-width: 620px) {
  .vbtn { width: 40px; height: 40px; }   /* thumbs, not cursors */
  .q-num { display: none; }
}

/* ---------- playlist picker ---------- */
.picked {
  margin-top: 8px; padding: 11px 13px; border-radius: 10px;
  border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--text); font-size: 15px; letter-spacing: 0; text-transform: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#pl-search {
  display: block; width: 100%; margin-top: 8px; padding: 11px 13px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text);
  letter-spacing: 0; text-transform: none; font-size: 15px;
}
#pl-search:focus { outline: none; border-color: var(--accent); }
.pl-list {
  list-style: none; margin: 8px 0 0; padding: 4px;
  max-height: 230px; overflow-y: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
}
.pl-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 9px; border-radius: 8px;
  cursor: pointer; letter-spacing: 0; text-transform: none;
}
.pl-item:active { background: var(--panel-2); }
.pl-item.on { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.pl-art {
  width: 34px; height: 34px; border-radius: 5px; object-fit: cover; flex: none;
  background: var(--panel-2); display: grid; place-items: center; color: var(--text-dim);
}
.pl-name { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-empty { padding: 12px 10px; color: var(--text-dim); font-size: 14px; letter-spacing: 0; text-transform: none; }

.guest-badge {
  font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; vertical-align: middle;
  border: 1px solid var(--accent); color: var(--accent); border-radius: 99px; padding: 2px 7px; margin-left: 6px;
}

/* ============================================================
   Staff: crate browsing + multi-select
   ============================================================ */
.modes { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.mode {
  padding: 8px 14px; border-radius: 999px; cursor: pointer; font-size: 13px;
  border: 1px solid var(--line); background: transparent; color: var(--text-dim);
}
.mode.active { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); font-weight: 600; }
.select-toggle { margin-left: auto; }
.select-toggle.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); font-weight: 600; }

.crate-head { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; }
.crate-name {
  flex: 1; min-width: 0; font-size: 14px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.crate-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 2px; }
.crate-track {
  display: flex; align-items: center; gap: 12px; padding: 9px 8px;
  border-radius: 10px; cursor: pointer;
}
.crate-track:nth-child(odd) { background: rgba(255,255,255,.02); }
.crate-track:active { background: var(--panel-2); }
.crate-mark {
  width: 30px; height: 30px; flex: none; border-radius: 8px; display: grid; place-items: center;
  border: 1px solid var(--line); color: var(--text-dim); font-size: 14px;
}
.crate-track.picked { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.crate-track.picked .crate-mark { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.card.picked img { outline: 3px solid var(--accent); outline-offset: 2px; }

.selbar {
  position: sticky; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px; padding: 11px 14px;
  border: 1px solid var(--accent); border-radius: 12px;
  background: color-mix(in srgb, var(--bg-2) 92%, var(--accent));
  box-shadow: var(--shadow); font-size: 14px;
}
.selbar-actions { display: flex; gap: 8px; flex: none; }

.guest-device {
  display: block; font-size: 11.5px; color: var(--text-dim); margin-top: 2px; font-weight: 400;
}

/* ============================================================
   Wall display — read across a room, no controls
   ============================================================ */
html[data-mode="display"] .topbar,
html[data-mode="display"] .stage { display: none !important; }
/* The wall keeps its toast: it is the only way a failed tap on the pause or reveal button
   can say anything at all, and a silent dead-looking button is what sent Kyle hunting. */
html[data-mode="display"] .toast { z-index: 130; }
html[data-mode="display"], html[data-mode="display"] body { height: 100%; overflow: hidden; }

.wall {
  position: fixed; inset: 0; z-index: 10;
  display: block;                       /* the cards float now, so nothing reserves a column */
  padding: clamp(20px, 3.5vh, 54px);
  background: var(--bg);
}
.wall-main {
  height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(18px, 3vh, 40px); min-width: 0; text-align: center;
  /* Keep the block clear of the corner cards: the progress bar otherwise runs underneath
     them. Centring happens in what is left, which is what the eye reads as centred anyway. */
  padding-bottom: clamp(56px, 9vh, 104px);
}
.wall-art-wrap { flex: 0 1 auto; min-height: 0; display: flex; justify-content: center; }
.wall-art {
  max-height: 46vh; max-width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: clamp(10px, 1.4vw, 20px); box-shadow: var(--shadow); background: var(--bg-2);
}
.wall-now { min-width: 0; width: min(980px, 82vw); }
.wall-label {
  font-size: clamp(11px, 1.1vw, 15px); letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .5em; text-shadow: var(--glow);
}
.wall-title {
  font-family: var(--font-display); margin: 0 0 .12em;
  font-size: clamp(30px, 5.2vw, 84px); line-height: 1.05;
  letter-spacing: var(--display-spacing); text-transform: var(--display-transform);
  overflow-wrap: anywhere;
}
.wall-artist { font-size: clamp(17px, 2.2vw, 34px); color: var(--text-dim); margin-bottom: .6em; overflow-wrap: anywhere; }
.wall-progress { height: clamp(5px, .7vh, 9px); border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.wall-progress-fill { height: 100%; width: 0; background: var(--accent); box-shadow: var(--glow); transition: width .9s linear; }
.wall-by { margin-top: .6em; font-size: clamp(13px, 1.3vw, 19px); color: var(--text-dim); }

/* A floating corner, not a column — so nothing pulls the artwork off centre. */
.wall-side {
  position: fixed; z-index: 15;
  right: clamp(14px, 2vw, 30px); bottom: clamp(14px, 2vh, 30px);
  width: clamp(210px, 20vw, 290px);
  display: flex; flex-direction: column; align-items: stretch;
  gap: clamp(8px, 1.2vh, 14px);
}

.wall-q { display: flex; align-items: center; gap: clamp(8px, 1vw, 14px); min-width: 0; }
.wall-q.floor { opacity: .55; }
.wall-q img, .wall-q-art {
  width: clamp(30px, 2.6vw, 42px); height: clamp(30px, 2.6vw, 42px); flex: none;
  border-radius: 6px; object-fit: cover; background: var(--bg-2);
}
.wall-q-text { min-width: 0; flex: 1; }
.wall-q-name { display: block; font-size: clamp(12px, 1.1vw, 16px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wall-q-sub { display: block; font-size: clamp(10px, .9vw, 13px); color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wall-q-score { font-size: clamp(13px, 1.3vw, 19px); font-variant-numeric: tabular-nums; flex: none; }
.wall-q-score.pos { color: var(--accent); font-weight: 600; }
.wall-q-score.neg { color: var(--danger); }
.wall-empty { color: var(--text-dim); font-size: clamp(13px, 1.3vw, 18px); margin: 0; }

/* ---------- collapsible corner cards ---------- */
/* Closed by default: the wall is a wall, not a control panel. */
.panel-card {
  background: color-mix(in srgb, var(--bg-2) 68%, transparent);
  backdrop-filter: blur(22px);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; flex: 0 0 auto;
  transition: border-color .3s ease;
}
.panel-card.open { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }

.card-tab {
  display: flex; align-items: center; gap: .55em; width: 100%;
  padding: clamp(10px, 1.05vw, 15px) clamp(12px, 1.2vw, 17px);
  background: transparent; border: 0; cursor: pointer; text-align: left;
  color: var(--text); font-size: clamp(12px, 1.05vw, 16px);
}
.card-tab:active { background: var(--panel-2); }
.card-tab-icon { color: var(--accent); font-size: 1.15em; line-height: 1; }
.card-tab-label {
  font-size: clamp(9.5px, .82vw, 12px); letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-dim); flex: none;
}
.card-tab-now {
  flex: 1; min-width: 0; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-tab-chev { color: var(--text-dim); font-size: .8em; transition: transform .3s ease; }
.panel-card.open .card-tab-chev { transform: rotate(180deg); }

/* Collapse by grid rows: animates smoothly without hard-coding a height. */
.card-body {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .32s ease, opacity .25s ease;
  opacity: 0;
}
.panel-card.open .card-body { grid-template-rows: 1fr; opacity: 1; }
.card-body > * { min-height: 0; }
.join-card .card-body { justify-items: center; }
.panel-card.open .card-body { padding: 0 clamp(12px, 1.2vw, 17px) clamp(12px, 1.2vw, 17px); }

.wall-qr { width: 100%; max-width: clamp(150px, 16vw, 240px); }
.wall-qr svg { width: 100%; height: auto; display: block; color: #0d0d12; }
.wall-join-head {
  font-size: clamp(10px, .95vw, 13px); letter-spacing: .05em;
  color: var(--text-dim); text-align: center; margin-top: .6em;
}
.wall-next-empty { font-size: clamp(11px, 1vw, 14px); color: var(--text-dim); margin: 0; }

/* Same containment on the wall: minmax(0,1fr) so a long title cannot widen the card, and a
   height cap so a deep queue cannot grow the card off the top of the screen. */
.wall-queue {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(5px, .8vh, 10px);
  max-height: min(46vh, 340px); overflow-y: auto; overscroll-behavior: contain;
}
.wall-queue::-webkit-scrollbar { width: 4px; }
.wall-queue::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
.wall-q { min-width: 0; }
.wall-up {
  flex: none; width: clamp(32px, 2.6vw, 42px); height: clamp(32px, 2.6vw, 42px);
  border-radius: 10px; cursor: pointer; font-size: .8em; line-height: 1;
  border: 1px solid var(--line); background: transparent; color: var(--text-dim);
}
.wall-up.on {
  color: var(--accent); border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

/* Findable without inviting a passing guest to press it: legible, low contrast, out of the
   way, and it asks before doing anything. The previous 18%-opacity × was effectively
   invisible, which is not the same as unobtrusive. */
/* Opposite corner from the cards, which grow upward from bottom-right. */
.wall-controls {
  position: fixed; bottom: 10px; left: 12px; z-index: 20;
  display: flex; align-items: center; gap: 8px;
}
.wall-ctl {
  padding: 9px 15px; border-radius: 999px; cursor: pointer; font-size: 14px;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--bg-2) 75%, transparent);
  color: var(--text); backdrop-filter: blur(14px);
}
.wall-ctl:active { background: var(--panel-2); }
#wall-reveal { border-color: var(--accent); color: var(--accent); }
.wall-exit {
  padding: 9px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--text-dim); opacity: .55; font-size: 13px; letter-spacing: .02em;
}
.wall-exit:active { opacity: 1; background: var(--panel-2); }

/* An iPad held upright: less room above, so the sleeve gives some back. */
@media (max-aspect-ratio: 1/1) {
  .wall-art { max-height: 38vh; }
  .wall-side { width: min(320px, calc(100vw - 28px)); }
}

.wall-reach {
  font-size: clamp(10px, .9vw, 13px); letter-spacing: .04em; text-align: center;
  color: var(--danger); font-weight: 600;
}

/* ============================================================
   Wall display — atmosphere
   ============================================================ */

/* The room is lit by whatever is playing. Two stacked layers crossfade on a track change. */
.wall-bg { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
.wall-bg img {
  position: absolute; inset: -12%;
  width: 124%; height: 124%; object-fit: cover;
  opacity: 0; transition: opacity 1.4s ease;
  filter: blur(64px) saturate(1.7) brightness(.62);
  transform: scale(1.06);
  animation: drift 34s ease-in-out infinite alternate;
}
.wall-bg img.on { opacity: 1; }
@keyframes drift {
  0%   { transform: scale(1.04) translate3d(-1.4%, -1%, 0);  filter: blur(64px) saturate(1.7) brightness(.56); }
  50%  { transform: scale(1.13) translate3d(1.2%, .6%, 0);   filter: blur(64px) saturate(1.9) brightness(.72); }
  100% { transform: scale(1.06) translate3d(.6%, 1.2%, 0);   filter: blur(64px) saturate(1.7) brightness(.58); }
}
/* Keeps text legible over whatever the artwork happens to be. */
.wall-scrim {
  position: absolute; inset: 0; z-index: 1;
  background:
    /* A wash of the record's own colour, low in the mix so text stays readable. */
    radial-gradient(90% 70% at 28% 38%, color-mix(in srgb, var(--art-glow, var(--accent)) 16%, transparent), transparent 70%),
    linear-gradient(105deg, color-mix(in srgb, var(--bg) 88%, transparent) 0%,
                            color-mix(in srgb, var(--bg) 62%, transparent) 46%,
                            color-mix(in srgb, var(--bg) 90%, transparent) 100%),
    radial-gradient(120% 90% at 18% 70%, transparent 25%, color-mix(in srgb, var(--bg) 80%, transparent) 100%);
  transition: background 2s ease;
}
/* Name the layers explicitly, and ONLY the ones that need it. This rule has now bitten
   twice: a blanket `.wall > *` version stretched the fixed exit button across a grid cell,
   and including .wall-side here overrode its `position: fixed` and dropped the corner cards
   into the opposite corner. Anything positioned fixed must stay out of it. */
.wall-main { position: relative; z-index: 2; }
.wall { background: var(--bg); overflow: hidden; }

.wall-art { transition: box-shadow .8s ease; }
body.playing .wall-art-stack .wall-art {
  box-shadow: 0 30px 80px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,.07),
              0 0 70px color-mix(in srgb, var(--accent) 22%, transparent);
}

.wall-foot { display: flex; align-items: center; justify-content: center; gap: clamp(14px, 2vw, 26px); margin-top: .7em; }

/* A seven-band equaliser. Decorative — it is not reading the audio, and it stops when the
   music does, which is the only honesty that matters here. */
.eq { display: inline-flex; align-items: flex-end; gap: clamp(3px, .35vw, 6px); height: clamp(18px, 2.4vh, 34px); flex: none; }
.eq i {
  width: clamp(3px, .34vw, 6px); height: 22%;
  background: var(--accent); border-radius: 2px; opacity: .85;
  box-shadow: var(--glow);
  animation: bounce 900ms ease-in-out infinite alternate;
  animation-play-state: paused;
}
body.playing .eq i { animation-play-state: running; }
.eq i:nth-child(1) { animation-duration: 760ms;  animation-delay: -120ms; }
.eq i:nth-child(2) { animation-duration: 1040ms; animation-delay: -420ms; }
.eq i:nth-child(3) { animation-duration: 620ms;  animation-delay: -260ms; }
.eq i:nth-child(4) { animation-duration: 1180ms; animation-delay: -60ms;  }
.eq i:nth-child(5) { animation-duration: 840ms;  animation-delay: -540ms; }
.eq i:nth-child(6) { animation-duration: 980ms;  animation-delay: -300ms; }
.eq i:nth-child(7) { animation-duration: 700ms;  animation-delay: -180ms; }
@keyframes bounce { from { height: 18%; } to { height: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .eq i, .wall-bg img { animation: none; }
}

.wall-join, .wall-next {
  backdrop-filter: blur(22px);
  background: color-mix(in srgb, var(--bg-2) 62%, transparent);
}

/* ---------- Wurlitzer: chrome bonnet and warm bubble glow ---------- */
html[data-skin="wurlitzer"] .wall-scrim {
  background:
    radial-gradient(90% 65% at 50% -12%, rgba(255,180,60,.30), transparent 70%),
    linear-gradient(105deg, rgba(16,11,6,.90) 0%, rgba(16,11,6,.60) 46%, rgba(16,11,6,.93) 100%),
    repeating-linear-gradient(90deg, rgba(255,214,150,.045) 0 1px, transparent 1px 3px);
}
html[data-skin="wurlitzer"] .wall-art {
  border-radius: 50% 50% 12px 12px / 22% 22% 12px 12px;
  border-top: 2px solid rgba(255,214,150,.55);
}
html[data-skin="wurlitzer"] .wall-join,
html[data-skin="wurlitzer"] .wall-next { border-radius: 26px; }
html[data-skin="wurlitzer"] .wall-title { text-shadow: 0 0 28px rgba(255,180,60,.45); }

/* ---------- Neon: scanlines, hot glow, a horizon ---------- */
html[data-skin="neon"] .wall-scrim {
  background:
    linear-gradient(105deg, rgba(6,4,11,.88) 0%, rgba(6,4,11,.55) 44%, rgba(6,4,11,.92) 100%),
    radial-gradient(70% 55% at 8% 4%, rgba(255,45,149,.28), transparent 62%),
    radial-gradient(70% 55% at 96% 96%, rgba(63,241,255,.22), transparent 62%),
    repeating-linear-gradient(0deg, rgba(0,0,0,.30) 0 1px, transparent 1px 3px);
}
html[data-skin="neon"] .wall-title {
  color: #fff;
  text-shadow: 0 0 12px var(--accent), 0 0 44px rgba(63,241,255,.55);
  animation: flicker 7s steps(1) infinite;
}
@keyframes flicker {
  0%,96%,100% { opacity: 1; }
  97% { opacity: .72; }
  98% { opacity: 1; }
  99% { opacity: .84; }
}
html[data-skin="neon"] .wall-progress-fill { background: linear-gradient(90deg, #ff2d95, #3ff1ff); }
html[data-skin="neon"] .eq i:nth-child(even) { background: #3ff1ff; box-shadow: 0 0 12px rgba(63,241,255,.8); }
html[data-skin="neon"] .wall-join, html[data-skin="neon"] .wall-next { border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { html[data-skin="neon"] .wall-title { animation: none; } }

/* ---------- animated glow behind the art ---------- */
/* Custom properties do not transition unless they are registered, which is why the glow
   colour used to snap on a track change while the artwork behind it dissolved. */
@property --art-glow {
  syntax: '<color>';
  inherits: true;
  initial-value: #f0b35b;
}
.wall { transition: --art-glow 2s ease; }

/* --art-glow is set from the album artwork at runtime; the accent is the fallback. */
.wall-art-wrap { --glow-colour: var(--art-glow, var(--accent)); isolation: isolate; }

/* A slowly turning light source. This is what actually reads as movement from across a
   room — the breathing layers below give it body, but rotation gives it life. */
.wall-halo {
  position: absolute; z-index: -1; inset: -34%;
  border-radius: 50%; pointer-events: none;
  opacity: 0; transition: opacity 1.6s ease;
  background: conic-gradient(from 0deg,
      transparent 0deg,
      color-mix(in srgb, var(--glow-colour) 55%, transparent) 55deg,
      transparent 120deg,
      color-mix(in srgb, var(--glow-colour) 40%, transparent) 210deg,
      transparent 290deg,
      color-mix(in srgb, var(--glow-colour) 50%, transparent) 340deg,
      transparent 360deg);
  filter: blur(46px);
  animation: halo-spin 26s linear infinite;
}
body.playing .wall-halo { opacity: .85; }
@keyframes halo-spin { to { transform: rotate(360deg); } }

.wall-art-wrap::before,
.wall-art-wrap::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%;
  pointer-events: none; opacity: 0; transition: opacity 1.2s ease, background 1.4s ease;
}
/* Two layers at different sizes and speeds: one breath alone reads mechanical. */
.wall-art-wrap::before {
  inset: -14% -14% -18%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--glow-colour) 62%, transparent), transparent 72%);
  filter: blur(34px);
  animation: glow-a 6s ease-in-out infinite alternate;
}
.wall-art-wrap::after {
  inset: -26% -26% -30%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--glow-colour) 34%, transparent), transparent 70%);
  filter: blur(58px);
  animation: glow-b 9.5s ease-in-out infinite alternate;
}
body.playing .wall-art-wrap::before { opacity: .95; }
body.playing .wall-art-wrap::after  { opacity: .8; }

@keyframes glow-a {
  0%   { transform: scale(.88) translate3d(-1.5%, 2%, 0);  opacity: .55; }
  50%  { transform: scale(1.14) translate3d(1.5%, -1%, 0); opacity: 1; }
  100% { transform: scale(.95) translate3d(0, -2.5%, 0);   opacity: .7; }
}
@keyframes glow-b {
  0%   { transform: scale(1.14) rotate(-7deg); opacity: .4; }
  45%  { transform: scale(.9)  rotate(5deg);   opacity: .92; }
  100% { transform: scale(1.06) rotate(9deg);  opacity: .5; }
}

/* ---------- track changes ---------- */
/* The stack sizes itself to the visible sleeve, so the outgoing copy can sit exactly on top
   of the incoming one without a second layout box. */
.wall-art-stack { position: relative; display: inline-block; line-height: 0; }
.wall-art-prev {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; pointer-events: none;
}
.wall-art-prev.fading {
  /* A slow dissolve with a touch of drift, so the outgoing sleeve recedes rather than
     blinking out. */
  transition: opacity 1.7s cubic-bezier(.3,0,.2,1), transform 1.7s cubic-bezier(.3,0,.2,1), filter 1.7s ease;
  transform: scale(1.035);
  filter: blur(3px);
}

/* Text hands over: the outgoing line drops away, the incoming one rises in. Staggered so
   the three lines cascade instead of moving as one slab. */
.wall-title, .wall-artist, .wall-by {
  transition: opacity .52s cubic-bezier(.3,0,.2,1), transform .52s cubic-bezier(.3,0,.2,1);
}
.wall-artist { transition-delay: .06s; }
.wall-by     { transition-delay: .12s; }
.wall-title.swapping  { opacity: 0; transform: translate3d(0, 18px, 0); }
.wall-artist.swapping { opacity: 0; transform: translate3d(0, 13px, 0); }
.wall-by.swapping     { opacity: 0; transform: translate3d(0, 8px, 0); }

/* The record itself breathes very slightly, so the glow is not sliding under a static slab. */
body.playing .wall-art-stack { animation: float 9s ease-in-out infinite alternate; }
@keyframes float { from { transform: translate3d(0, .55%, 0); } to { transform: translate3d(0, -.55%, 0); } }

@media (prefers-reduced-motion: reduce) {
  .wall-art-wrap::before, .wall-art-wrap::after, body.playing .wall-art, .wall-halo { animation: none; }
}

/* ---------- invite ---------- */
.credits-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.credits-row .credits-line { margin: 0; }
.invite-btn { flex: none; white-space: nowrap; }

.sheet {
  position: fixed; inset: 0; z-index: 110;
  background: rgba(0,0,0,.66); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.sheet.open { display: flex; }
.sheet-inner {
  width: min(380px, 100%);
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px 20px;
  box-shadow: var(--shadow); text-align: center;
}
.sheet-inner .drawer-head { text-align: left; }
.sheet-inner .muted { margin: 0 0 14px; }
.share-qr { width: min(260px, 70vw); margin: 0 auto 12px; }
.share-qr svg { width: 100%; height: auto; display: block; color: #0d0d12; }
.share-url {
  font-size: 13px; color: var(--accent); overflow-wrap: anywhere;
  margin-bottom: 14px; user-select: all;
}

/* ============================================================
   The music game
   ============================================================ */
.game { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.game-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.game-badge {
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent-ink); background: var(--accent); border-radius: 99px; padding: 4px 11px; font-weight: 600;
}
.game-phase { font-size: 12.5px; color: var(--text-dim); }
.game-lede { font-size: 15.5px; margin: 0 0 14px; line-height: 1.45; }
.btn.wide { width: 100%; margin-bottom: 8px; }

.game-players { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.pchip {
  font-size: 13px; padding: 5px 11px; border-radius: 99px;
  border: 1px solid var(--line); color: var(--text-dim);
}
.pchip.ready { border-color: var(--accent); color: var(--accent); }

.mine-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: minmax(0,1fr); gap: 4px; }
.mine-item { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 7px 6px; border-radius: 9px; background: rgba(255,255,255,.03); }
.mine-item img, .mine-item .q-art { width: 38px; height: 38px; border-radius: 6px; object-fit: cover; flex: none; background: var(--bg-2); }

.round-song { display: flex; align-items: center; gap: 13px; margin-bottom: 16px; min-width: 0; }
.round-song img { width: 62px; height: 62px; border-radius: 8px; object-fit: cover; flex: none; }
.rs-name { display: block; font-size: 17px; font-weight: 600; }
.rs-artist { display: block; font-size: 13.5px; color: var(--text-dim); }

.guess-grid, .award-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-bottom: 14px; }
.guess-btn {
  padding: 14px 10px; border-radius: 12px; cursor: pointer; font-size: 15px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
}
.guess-btn.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--text); font-weight: 600; }

.wager { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.wager-label { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); flex: none; }
.wager-pills { display: flex; gap: 6px; flex: 1; }
.wager-pill {
  flex: 1; padding: 11px 0; border-radius: 10px; cursor: pointer; font-size: 15px;
  border: 1px solid var(--line); background: transparent; color: var(--text-dim);
}
.wager-pill.on { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 700; }

.countdown {
  font-family: var(--font-display); font-size: clamp(76px, 26vw, 150px); line-height: 1;
  text-align: center; color: var(--accent); text-shadow: var(--glow); padding: 18px 0;
}
.countdown.pop { animation: cd-pop .45s cubic-bezier(.2,.9,.3,1.3); }
@keyframes cd-pop { from { transform: scale(.55); opacity: .2; } to { transform: scale(1); opacity: 1; } }

.reveal-owner { font-size: 21px; margin-bottom: 14px; }
.reveal-lines { display: grid; gap: 5px; margin-bottom: 16px; }
.reveal-line {
  display: flex; align-items: center; gap: 9px; font-size: 14px;
  padding: 8px 11px; border-radius: 9px; border: 1px solid var(--line);
}
.reveal-line.right { border-color: var(--accent); }
.reveal-line.wrong { opacity: .6; }
.rl-guess { color: var(--text-dim); flex: 1; min-width: 0; }
.rl-wager { font-variant-numeric: tabular-nums; }

.scoreboard { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.score-head { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 8px; }
.score-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; font-size: 15px; }
.score-row.me { color: var(--accent); }
.score-pos { width: 20px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.score-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-pts { font-variant-numeric: tabular-nums; font-weight: 600; }
.score-drinks { font-variant-numeric: tabular-nums; color: var(--text-dim); font-size: 13px; }

.rules-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 5px; font-size: 13.5px; color: var(--text-dim); }
.rules-list b { color: var(--accent); }

/* ---------- the game, on the wall ---------- */
.wall-game {
  position: fixed; z-index: 15;
  right: clamp(14px, 2vw, 30px); bottom: clamp(14px, 2vh, 30px);
  width: clamp(250px, 26vw, 380px);
  background: color-mix(in srgb, var(--bg-2) 72%, transparent);
  backdrop-filter: blur(22px);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(12px, 1.3vw, 18px);
}
.wg-phase {
  font-size: clamp(10px, .9vw, 13px); letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .7em;
}
.wg-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.wg-waiting { font-size: clamp(11px, 1vw, 14px); color: var(--text-dim); margin-bottom: .5em; }
.wg-count {
  font-family: var(--font-display); font-size: clamp(60px, 7vw, 110px); line-height: 1;
  text-align: center; color: var(--accent); text-shadow: var(--glow);
}
.wg-owner { font-size: clamp(15px, 1.5vw, 23px); margin-bottom: .6em; }
.wg-flawless { display: block; font-size: clamp(11px, 1vw, 14px); color: var(--accent); }
.wg-lines { display: grid; gap: 3px; }
.wg-line {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px;
  font-size: clamp(11px, 1vw, 14px); padding: 4px 7px; border-radius: 7px; border: 1px solid var(--line);
}
.wg-line.right { border-color: var(--accent); }
.wg-line.wrong { opacity: .55; }
.wg-line span:nth-child(2) { color: var(--text-dim); }
.wg-board { margin-top: .9em; border-top: 1px solid var(--line); padding-top: .7em; display: grid; gap: 2px; }
.wg-row { display: flex; align-items: center; gap: 9px; font-size: clamp(12px, 1.1vw, 16px); }
.wg-pos { width: 16px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.wg-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg-pts { font-variant-numeric: tabular-nums; font-weight: 600; }
.wg-dr { font-variant-numeric: tabular-nums; color: var(--text-dim); font-size: .85em; }
.wg-rules { list-style: none; margin: .8em 0 0; padding: 0; display: grid; gap: 3px; font-size: clamp(10px, .9vw, 13px); color: var(--text-dim); }
.wg-rules b { color: var(--accent); }

.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

.settle-note { font-size: 13.5px; margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; }
.settle-note.holding { color: var(--danger); border: 1px solid var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); }
.settle-note.going   { color: var(--accent); border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.wg-hold  { font-size: clamp(11px, 1vw, 14px); color: var(--danger); margin-bottom: .5em; }
.wg-going { font-size: clamp(11px, 1vw, 14px); color: var(--accent); margin-bottom: .5em; }

/* The wall's one interactive thing: get the game moving without finding a phone. */
.wg-go {
  display: block; width: 100%; margin-top: .8em;
  padding: clamp(12px, 1.4vw, 20px); border-radius: 12px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  font-size: clamp(14px, 1.4vw, 21px); font-weight: 700; letter-spacing: .02em;
  box-shadow: var(--glow);
}
.wg-go:disabled { opacity: .4; background: transparent; color: var(--text-dim); border-color: var(--line); box-shadow: none; }
.wg-go:active:not(:disabled) { transform: translateY(1px); }

/* ---------- handing out points ---------- */
.award-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.award-left {
  font-family: var(--font-display); font-size: 44px; line-height: 1;
  color: var(--accent); text-shadow: var(--glow);
}
.award-copy { font-size: 15px; color: var(--text); }
.award-btn { position: relative; }
.award-btn.given { border-color: var(--accent); }
.award-count {
  display: inline-block; margin-left: 7px; font-size: 13px; font-weight: 700;
  color: var(--accent-ink); background: var(--accent); border-radius: 99px; padding: 1px 8px;
}
.wg-count-small { font-size: clamp(13px, 1.3vw, 19px); color: var(--accent); }


/* ---------- game night ----------
   On a game night the game is the app. The jukebox still runs underneath on autopilot,
   but a guest has no queue to look at and no credits to spend, so showing either is
   just clutter that invites the question "why can't I add a song?". The search panel
   stays — it is how you pick your songs for the game. */
:root[data-night="game"] #queue-panel,
:root[data-night="game"] #credits-row { display: none; }

/* The wall says what the room is doing, so a glance is enough. */
.wall-mode {
  position: absolute; top: clamp(12px, 2vh, 26px); left: 50%; transform: translateX(-50%);
  z-index: 3; font-family: var(--font-display); font-size: clamp(11px, 1.1vw, 15px);
  letter-spacing: .18em; text-transform: uppercase; color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 99px; padding: 5px 16px;
  background: rgba(0,0,0,.28); backdrop-filter: blur(6px); white-space: nowrap;
}
.wall-mode.game { color: var(--accent); border-color: var(--accent); box-shadow: var(--glow); }
