/* ============================================================
   JukeMob — Neo-Brutalist theme
   thick black borders · hard offset shadows · loud colors
   ============================================================ */
:root {
  --bg: #fff3d6;
  --paper: #ffffff;
  --ink: #111111;

  --yellow: #ffd23f;
  --pink: #ff5da2;
  --cyan: #2de2e6;
  --lime: #b6ff3c;
  --purple: #b15cff;
  --orange: #ff7a00;
  --blue: #4d7cff;
  --red: #ff4d4d;

  /* Per-booth branding accent (overridable at runtime via applyBranding). */
  --accent: var(--pink);

  --border: 3px;
  --shadow: 5px 5px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --shadow-lg: 8px 8px 0 var(--ink);
  --ease: cubic-bezier(.2, .9, .25, 1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Helvetica Neue', Arial, system-ui, sans-serif;
  font-weight: 600;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(0,0,0,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,.05) 1px, transparent 1px);
  background-size: 28px 28px;
  min-height: 100vh;
}

.wrap { width: 100%; max-width: 620px; margin: 0 auto; padding: 18px 14px 96px; }
.wrap.admin { max-width: 1000px; }

a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.05; letter-spacing: -.5px; }

/* ---- brand / header ---- */
.brand {
  display: inline-block;
  font-size: 30px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -1px;
  background: var(--accent);
  color: var(--ink);
  border: var(--border) solid var(--ink);
  box-shadow: var(--shadow);
  padding: 10px 16px;
  transform: rotate(-1.5deg);
}
.brand.admin-brand { background: var(--cyan); }

/* per-booth logo (branding) — sits above/beside the brand ribbon */
.brand-logo {
  display: block; max-height: 56px; max-width: 200px; width: auto;
  margin-bottom: 12px; border: var(--border) solid var(--ink); box-shadow: var(--shadow-sm);
  background: #fff; padding: 4px; object-fit: contain;
}
.tagline {
  font-weight: 800;
  font-size: 15px;
  margin: 18px 2px 18px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ---- panels ---- */
.panel {
  background: var(--paper);
  border: var(--border) solid var(--ink);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 18px;
}
.panel > h2 {
  font-size: 20px;
  font-weight: 900;
  text-transform: uppercase;
  display: inline-block;
  background: var(--yellow);
  border: var(--border) solid var(--ink);
  padding: 4px 12px;
  margin: -28px 0 16px -4px;
  transform: rotate(-1deg);
  box-shadow: var(--shadow-sm);
}
.panel h3 {
  font-size: 12px; font-weight: 900; text-transform: uppercase;
  letter-spacing: 1px; margin: 20px 0 8px;
}

/* ---- forms ---- */
label { display: block; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; margin: 14px 0 6px; }

input, select {
  width: 100%;
  font-family: inherit;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  border: var(--border) solid var(--ink);
  padding: 12px 14px;
  outline: none;
  box-shadow: var(--shadow-sm);
}
input::placeholder { color: #6b6b6b; font-weight: 700; }
input:focus, select:focus { background: #fffce8; box-shadow: var(--shadow); }

/* ---- keyboard focus: a clear, high-contrast ring (mouse clicks unaffected) ---- */
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.vote:focus-visible, .iconbtn:focus-visible, .chip__x:focus-visible { outline-offset: 1px; }

/* ---- buttons ---- */
button {
  font-family: inherit;
  font-weight: 900;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--ink);
  background: var(--paper);
  border: var(--border) solid var(--ink);
  box-shadow: var(--shadow-sm);
  padding: 12px 16px;
  cursor: pointer;
  transition: transform .08s var(--ease), box-shadow .08s var(--ease), filter .1s;
}
button:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow); }
button:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: var(--shadow-sm); }

.btn-primary { background: var(--yellow); }
.btn-accent  { background: var(--cyan); }
.btn-go      { background: var(--lime); }
.btn-danger  { background: var(--red); color: var(--ink); }
.btn-dark    { background: var(--ink); color: #fff; }
.btn-ghost   { background: var(--paper); }
.btn-block   { width: 100%; margin-top: 16px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-sm { padding: 8px 11px; font-size: 12px; box-shadow: var(--shadow-sm); }

/* ---- helpers ---- */
.muted { font-weight: 700; font-size: 13px; color: #555; }
.center { text-align: center; }
.hidden { display: none !important; }
.empty {
  text-align: center; font-weight: 800; text-transform: uppercase;
  border: var(--border) dashed var(--ink); padding: 22px; font-size: 13px;
  background: repeating-linear-gradient(45deg, #fff, #fff 8px, #fff7e0 8px, #fff7e0 16px);
}

/* ---- join code + QR ---- */
.code {
  font-size: 34px; font-weight: 900; letter-spacing: 8px; text-align: center;
  background: var(--lime); border: var(--border) solid var(--ink); box-shadow: var(--shadow-sm);
  padding: 14px; margin: 10px 0;
}
.qr {
  display: block; width: 200px; height: 200px; margin: 14px auto;
  background: #fff; padding: 8px; border: var(--border) solid var(--ink); box-shadow: var(--shadow);
}
.linkbox {
  display: flex; gap: 8px; align-items: center;
  border: var(--border) solid var(--ink); box-shadow: var(--shadow-sm); padding: 6px; margin: 8px 0; background: #fff;
}
.linkbox input { border: none; box-shadow: none; padding: 6px; font-size: 13px; font-weight: 700; }
.linkbox input:focus { background: #fff; box-shadow: none; }

/* ---- search component ---- */
.search { position: relative; }
.search__row { display: flex; gap: 8px; align-items: stretch; }
.search__field { position: relative; flex: 1; min-width: 0; }
.search__field .search__input { width: 100%; }
.search__submit { flex: none; white-space: nowrap; }
.search__results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
  background: var(--paper); border: var(--border) solid var(--ink); box-shadow: var(--shadow);
  max-height: 320px; overflow-y: auto;
}
.result {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; cursor: pointer;
  border-bottom: 2px solid var(--ink);
}
.result:last-child { border-bottom: none; }
.result:hover, .result.active { background: var(--cyan); }
.result__text { flex: 1; min-width: 0; }
.result__title { font-weight: 900; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result__artist { font-weight: 700; font-size: 12px; color: #444; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chip {
  display: flex; align-items: center; gap: 10px; height: 100%; box-sizing: border-box;
  border: var(--border) solid var(--ink); box-shadow: var(--shadow-sm);
  background: var(--lime); padding: 8px 10px;
}
.chip__text { flex: 1; min-width: 0; }
.chip__title { font-weight: 900; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip__x {
  border: 2px solid var(--ink); background: #fff; width: 30px; height: 30px; flex: none;
  font-size: 16px; padding: 0; box-shadow: 2px 2px 0 var(--ink);
}

.cover {
  width: 52px; height: 52px; flex: none; display: block;
  border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); image-rendering: auto;
}
.cover.sm { width: 40px; height: 40px; }

/* ---- track / leaderboard ---- */
.list { position: relative; }
.track {
  display: flex; align-items: center; gap: 10px;
  background: var(--paper); border: var(--border) solid var(--ink); box-shadow: var(--shadow-sm);
  padding: 10px; margin-bottom: 12px;
  animation: pop-in .28s var(--ease) both;
  /* rank-tint changes ease in instead of snapping → no flash when the order shuffles */
  transition: background-color .35s var(--ease), box-shadow .2s var(--ease);
  will-change: transform;
}
.track.is-1 { background: var(--yellow); box-shadow: var(--shadow); }
.track.is-2 { background: #fff4c2; }
.track.is-3 { background: #fff9de; }
.track.track--playing { background: var(--cyan); box-shadow: var(--shadow-lg); }
.track.track--played { opacity: .55; }

.rank {
  font-size: 22px; font-weight: 900; width: 30px; flex: none; text-align: center;
}
.track--playing .rank { font-size: 16px; }

.track__main { flex: 1; min-width: 0; }
.track__title { font-weight: 900; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track__artist { font-weight: 700; font-size: 12px; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track__meta { font-weight: 800; font-size: 12px; margin-top: 3px; }

.badge {
  display: inline-block; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px;
  background: var(--ink); color: #fff; border: 2px solid var(--ink); padding: 1px 6px; margin-left: 4px;
}
.badge.played { background: #fff; color: var(--ink); }

.score {
  font-size: 24px; font-weight: 900; min-width: 40px; text-align: center;
  border: 2px solid var(--ink); padding: 2px 4px; background: #fff; flex: none;
}
.score.up { background: var(--lime); }
.score.down { background: var(--pink); }
.score.pop { animation: pop-score .4s var(--ease); }

.votes { display: flex; flex-direction: column; gap: 6px; flex: none; }
.vote {
  width: 48px; height: 36px; display: grid; place-items: center; font-size: 18px; padding: 0;
  background: #fff;
}
.vote.up.active { background: var(--lime); }
.vote.down.active { background: var(--pink); }
.vote.bump { animation: bump .25s var(--ease); }

/* ---- admin song actions ---- */
.track__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.track-block { margin-bottom: 12px; animation: pop-in .28s var(--ease) both; will-change: transform; }
.track-block .track { margin-bottom: 0; animation: none; }

/* ---- status pills ---- */
.controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-weight: 900; text-transform: uppercase; font-size: 13px; }
.status-pill { font-size: 12px; font-weight: 900; text-transform: uppercase; border: 2px solid var(--ink); padding: 3px 10px; box-shadow: 2px 2px 0 var(--ink); }
.status-active { background: var(--lime); }
.status-paused { background: var(--orange); }
.status-closed { background: var(--red); }

/* ---- wishes ---- */
.wish {
  display: flex; align-items: center; gap: 10px;
  border: var(--border) solid var(--ink); box-shadow: var(--shadow-sm); padding: 8px 10px; margin-bottom: 10px; background: #fff;
  animation: pop-in .28s var(--ease) both;
}
.wish.pending { background: #fff0d6; }
.wish__main { flex: 1; min-width: 0; }
.wish__actions { display: flex; gap: 8px; flex: none; }

/* ---- banners ---- */
.banner { border: var(--border) solid var(--ink); box-shadow: var(--shadow-sm); padding: 12px 14px; margin-bottom: 16px; font-weight: 900; text-transform: uppercase; font-size: 13px; }
.banner.warn { background: var(--orange); }
.banner.err { background: var(--red); }

/* ---- toast ---- */
#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 10px; z-index: 80; width: calc(100% - 28px); max-width: 420px; }
.toast { background: var(--ink); color: #fff; border: var(--border) solid var(--ink); box-shadow: var(--shadow); padding: 12px 16px; font-weight: 800; font-size: 14px; animation: slide-up .22s var(--ease); }
.toast.ok { background: var(--lime); color: var(--ink); }
.toast.err { background: var(--red); color: var(--ink); }

/* ---- animations ---- */
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes pop-score { 0% { transform: scale(1); } 35% { transform: scale(1.45) rotate(-4deg); } 100% { transform: scale(1); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes slide-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

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

/* ---- request widget (stands out from song cards) ---- */
.panel.request {
  background: var(--purple);
  padding: 14px;
}
.panel.request .search__input { background: #fff; }

/* ---- now playing + up-next queue ---- */
.nowplaying {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--cyan); border: var(--border) solid var(--ink); box-shadow: var(--shadow-lg);
  padding: 12px; margin-bottom: 16px;
}
.nowplaying__row { display: flex; align-items: center; gap: 12px; }
.nowplaying .cover { width: 58px; height: 58px; }
.nowplaying__main { flex: 1; min-width: 0; }

/* crowd now-playing progress bar (Spotify-driven; off via admin setting) */
.np-progress { display: flex; flex-direction: column; gap: 4px; }
.np-progress__bar { height: 12px; background: rgba(0, 0, 0, .14); border: 2px solid var(--ink); overflow: hidden; }
.np-progress__fill { height: 100%; width: 0; background: var(--ink); transition: width .5s linear; }
.np-progress__time { display: flex; justify-content: space-between; font-size: 11px; font-weight: 800; letter-spacing: .3px; }
.nowplaying__label { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; display: flex; align-items: center; gap: 6px; }
.nowplaying__label::before { content: ''; width: 9px; height: 9px; background: var(--ink); border-radius: 50%; animation: blink 1.1s steps(2, start) infinite; }
.nowplaying__title { font-size: 18px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nowplaying__artist { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.queue-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 4px 2px 12px; }
.queue-head__title {
  font-size: 15px; font-weight: 900; text-transform: uppercase;
  background: var(--lime); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); padding: 3px 10px;
}
.queue-head__hint { font-size: 12px; font-weight: 800; color: #333; text-transform: uppercase; }

@keyframes blink { to { opacity: .25; } }

/* new #1 — a clean ring pulse, no jarring flash */
@keyframes leader {
  0% { box-shadow: var(--shadow-sm); }
  25% { box-shadow: 0 0 0 5px var(--lime), var(--shadow-lg); }
  100% { box-shadow: var(--shadow); }
}
.track.leader { animation: leader .7s var(--ease); }

/* ---- language switch ---- */
.langsw {
  position: fixed; top: 12px; right: 12px; z-index: 90; display: flex;
  border: var(--border) solid var(--ink); box-shadow: var(--shadow-sm); background: #fff;
}
.langsw button {
  border: none; box-shadow: none; padding: 6px 10px; font-size: 12px; background: #fff;
}
.langsw button:hover { transform: none; box-shadow: none; }
.langsw button:active { transform: none; }
.langsw button.active { background: var(--ink); color: #fff; }
.langsw button + button { border-left: var(--border) solid var(--ink); }

/* ---- admin header ---- */
.admin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.iconbtn {
  font-size: 20px; line-height: 1; padding: 9px 12px; background: var(--yellow);
  border: var(--border) solid var(--ink); box-shadow: var(--shadow-sm); flex: none;
}

/* ---- collapsible session widget ---- */
.swidget { margin-bottom: 18px; }
.swidget__bar {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  background: var(--paper); border: var(--border) solid var(--ink); box-shadow: var(--shadow-sm);
  padding: 10px 12px; font-size: 13px; text-transform: none; letter-spacing: 0;
}
.swidget__bar:hover { transform: none; box-shadow: var(--shadow); }
.swidget__bar:active { transform: none; }
.swidget__code { font-weight: 900; letter-spacing: 3px; font-size: 15px; }
.swidget__label { font-weight: 800; color: #444; flex: 1; text-transform: uppercase; font-size: 11px; letter-spacing: .5px; }
.swidget__caret { font-weight: 900; font-size: 14px; flex: none; }
.swidget__body {
  border: var(--border) solid var(--ink); border-top: none; box-shadow: var(--shadow-sm);
  background: var(--paper); padding: 14px;
}
.swidget__qr { text-align: center; }
.swidget__qr .qr { margin: 4px auto 8px; }
.swidget__body .controls { margin-top: 14px; }
.swidget__body .btn-row { margin-top: 10px; }

/* ---- now playing (admin variants) ---- */
.nowplaying--admin, .nowplaying--empty { margin-bottom: 18px; }
.nowplaying--admin .np-btn, .nowplaying--empty .np-btn { flex: none; white-space: nowrap; }
.nowplaying--empty {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  background: var(--yellow); border: var(--border) solid var(--ink); box-shadow: var(--shadow); padding: 12px;
}
.nowplaying--empty .nowplaying__title { font-size: 15px; }

/* ---- played history ---- */
.played-row {
  display: flex; align-items: center; gap: 10px;
  border: var(--border) solid var(--ink); box-shadow: var(--shadow-sm);
  padding: 7px 9px; margin-bottom: 9px; background: #fff; opacity: .82;
}

/* ---- requests: resolved + count badge ---- */
.wish.resolved { opacity: .6; }
.wish__status { font-size: 11px; font-weight: 900; text-transform: uppercase; flex: none; }
.hbadge {
  display: inline-block; vertical-align: middle; margin-left: 6px;
  background: var(--pink); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink);
  font-size: 12px; font-weight: 900; min-width: 22px; text-align: center; padding: 1px 6px;
}

/* ---- settings modal ---- */
.modal {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .45); padding: 18px;
}
.modal__box { width: 100%; max-width: 420px; margin: 0; max-height: 90vh; overflow-y: auto; }
.switch {
  display: flex; align-items: center; gap: 10px; margin: 14px 0 0;
  text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 800; cursor: pointer;
}
.switch input { width: 22px; height: 22px; flex: none; box-shadow: none; accent-color: var(--ink); cursor: pointer; }

/* ---- settings danger zone ---- */
.danger-zone { margin-top: 22px; border-top: var(--border) solid var(--ink); padding-top: 14px; }
.danger-zone h3 { color: var(--red); margin-bottom: 4px; }
.danger-zone .btn-block { margin-top: 10px; }

/* ---- merged playback widget (now playing + Spotify control) ---- */
.playback { border-width: var(--border); }
.playback__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.playback__conn { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pb-user { font-size: 12px; font-weight: 900; text-transform: uppercase; color: #1aa34a; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pb-track { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.pb-track .cover { width: 64px; height: 64px; flex: none; }
.pb-track__main { flex: 1; min-width: 0; }
.pb-track__title { font-size: 19px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-track__artist { font-size: 13px; font-weight: 700; color: #444; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-actbtn { flex: none; min-width: 46px; }

/* single seek/progress bar — clickable to scrub */
.seekbar { height: 14px; margin: 12px 0; background: var(--paper); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); overflow: hidden; cursor: pointer; }
.seekbar__fill { height: 100%; width: 0; background: #1db954; transition: width .25s linear; pointer-events: none; }

.pb-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.pb-transport { display: flex; gap: 8px; flex: none; }
.sp-tbtn { font-size: 16px; min-width: 46px; padding: 8px 10px; box-shadow: var(--shadow-sm); }
/* device picker sits where the volume used to be */
.pb-device {
  flex: 1; min-width: 120px; padding: 9px 10px; border: var(--border) solid var(--ink);
  box-shadow: var(--shadow-sm); background: var(--paper); font-weight: 700; font-size: 13px;
}

.pb-manual { margin-top: 12px; }

/* The per-track "Up Next" action only makes sense once connected (auto-advance). */
.sp-queue { display: none; }
body.spotify-connected .sp-queue { display: inline-block; }
.sp-queue.is-queued { background: var(--cyan); }

/* ---- "up next" badge on leaderboard rows ---- */
.track__titlerow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.track__titlerow .track__title { min-width: 0; }
.upnext-badge {
  flex: none; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px;
  background: var(--cyan); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); padding: 1px 6px; white-space: nowrap;
}

/* ---- resizable + scrollable list containers (leaderboard / requests / played) ---- */
.scrollpanel { overflow-y: auto; resize: vertical; min-height: 90px; height: 300px; padding-right: 6px; }
.scrollpanel--tall { height: 440px; }
.scrollpanel--short { height: 220px; }

/* ---- admin ribbon: keep long booth names readable ---- */
.admin-brand { font-size: clamp(20px, 5.5vw, 30px); max-width: 100%; overflow-wrap: anywhere; white-space: normal; }

/* ---- responsive ---- */
@media (min-width: 860px) {
  /* top: playback+leaderboard (left) · add+requests (right); bottom: played · session */
  .admin-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
  .admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
}

/* ============================================================
   TV / big-screen mode (read-only venue display)  — feature #11
   ============================================================ */
.tv-body { overflow-x: hidden; }
.tv {
  width: 100%; max-width: 1680px; margin: 0 auto;
  /* extra right inset so neo-brutalist box-shadows aren't clipped */
  padding: clamp(18px, 3vw, 36px);
  padding-right: calc(clamp(18px, 3vw, 36px) + 8px);
  min-height: 100vh; display: flex; flex-direction: column; gap: clamp(18px, 2.5vw, 30px);
}

.tv-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.tv-head > * { min-width: 0; }
.tv-head .brand { font-size: clamp(30px, 4.4vw, 62px); margin: 0; }
.tv-head .brand-logo { max-height: clamp(56px, 8vw, 100px); max-width: 320px; margin: 0 0 10px; }

.tv-join { display: flex; align-items: center; gap: 16px; max-width: 100%; background: var(--paper); border: var(--border) solid var(--ink); box-shadow: var(--shadow); padding: 12px 16px; }
.tv-qr { width: clamp(96px, 11vw, 150px); height: clamp(96px, 11vw, 150px); display: block; background: #fff; padding: 6px; border: 2px solid var(--ink); }
.tv-join__label { font-size: clamp(12px, 1.1vw, 16px); font-weight: 900; text-transform: uppercase; letter-spacing: 1px; }
.tv-join__code { font-size: clamp(28px, 3.2vw, 46px); font-weight: 900; letter-spacing: 6px; line-height: 1.1; }

.tv-main { flex: 1; display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(18px, 2.4vw, 30px); align-items: start; min-height: 0; }
.tv-main > * { min-width: 0; }
@media (max-width: 900px) { .tv-main { grid-template-columns: 1fr; } }

/* now-playing, enlarged for the room */
.tv-now .nowplaying { box-shadow: var(--shadow-lg); padding: clamp(16px, 2vw, 26px); margin: 0; background: var(--accent); min-width: 0; }
.tv-now .nowplaying__row { min-width: 0; }
.tv-now .nowplaying .cover { width: clamp(110px, 13vw, 190px); height: clamp(110px, 13vw, 190px); }
.tv-now .nowplaying__label { font-size: clamp(13px, 1.2vw, 18px); }
.tv-now .nowplaying__title { font-size: clamp(26px, 3.4vw, 52px); white-space: normal; overflow-wrap: break-word; }
.tv-now .nowplaying__artist { font-size: clamp(16px, 1.7vw, 26px); white-space: normal; overflow-wrap: break-word; }
.tv-now .np-progress__bar { height: 18px; }
.tv-now .np-progress__time { font-size: clamp(13px, 1.1vw, 18px); }
.tv-empty {
  display: grid; place-items: center; text-align: center; min-height: 220px;
  background: var(--yellow); border: var(--border) solid var(--ink); box-shadow: var(--shadow-lg);
  font-size: clamp(22px, 3vw, 40px); font-weight: 900; text-transform: uppercase; letter-spacing: -.5px; padding: 28px;
}

.tv-board__title {
  display: inline-block; font-size: clamp(18px, 2vw, 30px); font-weight: 900; text-transform: uppercase;
  background: var(--lime); border: var(--border) solid var(--ink); box-shadow: var(--shadow-sm);
  padding: 6px 16px; margin: 0 0 16px; transform: rotate(-1deg);
}
.tv-list .track { padding: clamp(10px, 1.2vw, 16px); gap: clamp(10px, 1.2vw, 18px); margin-bottom: clamp(10px, 1.2vw, 16px); min-width: 0; max-width: 100%; }
.tv-list .cover { width: clamp(56px, 5.5vw, 84px); height: clamp(56px, 5.5vw, 84px); }
.tv-list .rank { font-size: clamp(26px, 3vw, 44px); width: clamp(36px, 3.5vw, 56px); }
.tv-list .track__title { font-size: clamp(18px, 1.9vw, 30px); }
.tv-list .track__artist { font-size: clamp(13px, 1.3vw, 20px); }
.tv-list .track__meta { font-size: clamp(13px, 1.2vw, 19px); }
.tv-list .score { font-size: clamp(24px, 2.6vw, 40px); min-width: clamp(52px, 5vw, 76px); }
.tv-list .upnext-badge { font-size: clamp(11px, 1vw, 15px); }

/* ============================================================
   Post-event recap (shareable)  — feature #13
   ============================================================ */
.recap .recap-title {
  font-size: clamp(24px, 6vw, 38px); font-weight: 900; text-transform: uppercase; letter-spacing: -1px;
  background: var(--accent); border: var(--border) solid var(--ink); box-shadow: var(--shadow-sm);
  display: inline-block; padding: 8px 16px; margin: -34px 0 18px -4px; transform: rotate(-1deg);
}
.recap-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
@media (min-width: 520px) { .recap-stats { grid-template-columns: repeat(4, 1fr); } }
.recap-stat { background: #fff; border: var(--border) solid var(--ink); box-shadow: var(--shadow-sm); padding: 12px; text-align: center; }
.recap-stat__num { font-size: 30px; font-weight: 900; line-height: 1; }
.recap-stat__label { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; margin-top: 6px; color: #333; }

.recap-list { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.recap-row {
  display: flex; align-items: center; gap: 12px;
  border: var(--border) solid var(--ink); box-shadow: var(--shadow-sm); padding: 10px; margin-bottom: 10px; background: #fff;
  animation: pop-in .28s var(--ease) both;
}
.recap-row.is-1 { background: var(--yellow); box-shadow: var(--shadow); }
.recap-row.is-2 { background: #fff4c2; }
.recap-row.is-3 { background: #fff9de; }
.recap-row .rank { font-size: 24px; font-weight: 900; width: 34px; flex: none; text-align: center; }
.recap-row .recap-row__main { flex: 1; min-width: 0; }
.recap-row .chip__title { font-weight: 900; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recap-score { font-size: 22px; font-weight: 900; min-width: 48px; text-align: center; border: 2px solid var(--ink); padding: 2px 6px; background: var(--lime); flex: none; }
.recap-footer { text-align: center; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: #555; margin-top: 18px; }
.recap .btn-row { justify-content: center; margin-top: 18px; }
