:root {
  --bg: #0c1017;
  --bg-soft: #121824;
  --panel: #171f2c;
  --panel-2: #1d2736;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f7f4ec;
  --muted: #9ca8ba;
  --accent: #f7b32b;
  --accent-2: #f05d5e;
  --success: #53d8a7;
  --danger: #ff7070;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  --radius: 18px;
  --radius-sm: 11px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

.app-loading,
.display-empty,
.fatal-card {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  text-align: center;
  color: var(--muted);
}

.fatal-card > * { max-width: 720px; }

.brand-mark {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--accent), #ff7b2f);
  color: #191208;
  font-weight: 1000;
  font-size: 28px;
  letter-spacing: -2px;
  box-shadow: 0 14px 35px rgba(247, 179, 43, 0.22);
}
.brand-mark.small { width: 46px; height: 46px; border-radius: 14px; font-size: 19px; }
.brand-mark.display-logo { margin: 0 auto 18px; }

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.17em;
}

h1, h2, h3, p { margin-top: 0; }
h1 { letter-spacing: -0.04em; }
h2 { letter-spacing: -0.025em; }

.button,
.icon-button,
.text-button,
.nav-button,
.episode-link,
.host-score-card,
.control-pick,
.grade-button,
.thumb-button,
.fullscreen-button {
  border: 0;
  color: inherit;
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 10px;
  font-weight: 800;
  background: var(--panel-2);
}
.button.primary { background: var(--accent); color: #211605; }
.button.secondary { background: #2a3749; }
.button.ghost { background: transparent; border: 1px solid var(--line); }
.button.danger-ghost { background: transparent; border: 1px solid rgba(255,112,112,.3); color: #ff9a9a; }
.button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.button.wide { width: 100%; }

.text-button { background: transparent; color: var(--muted); padding: 8px; }
.text-button:hover { color: var(--text); }
.danger-text { color: var(--danger); }

.notice {
  padding: 13px 15px;
  border-radius: 10px;
  margin: 16px 0;
}
.notice.success { background: rgba(83,216,167,.12); color: #8bf1ca; }
.notice.error { background: rgba(255,112,112,.12); color: #ff9d9d; }

.setup-page,
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 20% 20%, rgba(247,179,43,.11), transparent 32%),
    radial-gradient(circle at 80% 80%, rgba(240,93,94,.08), transparent 33%),
    var(--bg);
}

.setup-card,
.login-card {
  width: min(100%, 470px);
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(23,31,44,.95);
  box-shadow: var(--shadow);
}
.setup-card .brand-mark,
.login-card .brand-mark { margin-bottom: 24px; }
.setup-card h1,
.login-card h1 { margin-bottom: 10px; font-size: clamp(2rem, 5vw, 3rem); }
.setup-card p,
.login-card p { color: var(--muted); line-height: 1.55; }

.stack-form { display: grid; gap: 16px; margin-top: 24px; }
.form-error { min-height: 20px; color: var(--danger); font-size: .9rem; }

label { display: grid; gap: 8px; color: #c8d0dc; font-size: .82rem; font-weight: 800; }
label small { color: var(--muted); font-weight: 500; }
input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #101722;
  color: var(--text);
  padding: 12px 13px;
  outline: none;
}
input:focus,
textarea:focus,
select:focus { border-color: rgba(247,179,43,.72); box-shadow: 0 0 0 3px rgba(247,179,43,.11); }
textarea { resize: vertical; }

.control-shell { min-height: 100vh; display: grid; grid-template-columns: 270px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #0f151f;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 22px; }
.sidebar-brand strong { display: block; font-size: .95rem; line-height: 1.15; }
.sidebar-brand span { display: block; margin-top: 4px; color: var(--muted); font-size: .72rem; }
.main-nav { display: grid; gap: 5px; }
.nav-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-weight: 750;
}
.nav-button span { width: 22px; text-align: center; }
.nav-button:hover,
.nav-button.active { background: var(--panel); color: var(--text); }
.nav-button.active { box-shadow: inset 3px 0 var(--accent); }

.episode-nav-header {
  margin: 24px 7px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.icon-button { width: 28px; height: 28px; border-radius: 8px; background: var(--panel); font-size: 18px; }
.episode-list { display: grid; gap: 4px; min-height: 0; overflow: auto; }
.episode-link {
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  text-align: left;
}
.episode-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .83rem; font-weight: 750; }
.episode-link small { font-size: .68rem; color: #667286; }
.episode-link:hover,
.episode-link.active { background: var(--panel); color: var(--text); }
.empty-mini { color: var(--muted); font-size: .8rem; padding: 10px; }
.sidebar-actions { margin-top: auto; display: grid; gap: 7px; padding-top: 16px; }

.workspace { min-width: 0; }
.workspace-header {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 19px 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(12,16,23,.88);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
}
.workspace-header h1 { margin: 0; font-size: clamp(1.35rem, 2vw, 2rem); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.save-status { color: var(--muted); font-size: .78rem; }
.workspace-main { padding: 26px 30px 48px; }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 15px 42px rgba(0,0,0,.13);
}

.live-toolbar { padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.toolbar-group { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.toolbar-group.compact .button { min-height: 36px; font-size: .78rem; }
.host-score-strip { margin: 16px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.host-score-card {
  min-width: 0;
  padding: 12px;
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  text-align: left;
}
.host-score-card:hover,
.host-score-card.active { border-color: rgba(247,179,43,.55); background: #202b3b; }
.host-score-card span span { min-width: 0; }
.host-score-card small,
.host-score-card strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.host-score-card small { color: var(--accent); font-size: .66rem; font-weight: 900; text-transform: uppercase; }
.host-score-card strong { margin-top: 3px; font-size: .85rem; }
.host-score-card b { font-size: 1.5rem; color: var(--accent); }

.avatar,
.large-avatar,
.display-avatar,
.mini-display-avatar {
  overflow: hidden;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  background: linear-gradient(135deg, #30415a, #192231);
  color: var(--accent);
  font-weight: 1000;
}
.avatar { width: 42px; height: 42px; border-radius: 50%; }
.avatar img,
.large-avatar img,
.display-avatar img,
.mini-display-avatar img { width: 100%; height: 100%; object-fit: cover; }
.large-avatar { width: 90px; height: 90px; border-radius: 28px; margin-bottom: 18px; font-size: 2.3rem; }

.live-grid { display: grid; grid-template-columns: minmax(300px, .78fr) minmax(470px, 1.22fr); gap: 16px; align-items: start; }
.pick-board-panel,
.current-pick-panel { padding: 20px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-heading h2 { margin: 0; font-size: 1.25rem; }
.section-heading > span,
.section-heading > small { color: var(--muted); font-size: .75rem; }
.control-pick-list { display: grid; gap: 8px; }
.control-pick {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border-radius: 11px;
  background: #111924;
  border: 1px solid transparent;
  text-align: left;
}
.control-pick:hover,
.control-pick.active { border-color: rgba(247,179,43,.55); }
.control-pick.revealed { background: #1c2a34; }
.control-pick .rank { color: var(--accent); font-weight: 1000; font-size: 1.05rem; }
.pick-copy { min-width: 0; }
.pick-copy strong,
.pick-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-copy strong { font-size: .88rem; }
.pick-copy small { margin-top: 4px; color: var(--muted); font-size: .7rem; }
.pick-score { text-align: center; font-size: 1.15rem; font-weight: 1000; }

.current-pick-preview {
  min-height: 220px;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(170px, .8fr) 1.2fr;
  align-items: stretch;
  border-radius: 15px;
  background: #0d131d;
  border: 1px solid var(--line);
}
.current-pick-preview img,
.preview-placeholder { width: 100%; height: 100%; min-height: 220px; object-fit: cover; }
.preview-placeholder { display: grid; place-items: center; color: rgba(247,179,43,.4); font-size: 5rem; font-weight: 1000; background: radial-gradient(circle, #26364b, #101722); }
.preview-copy { padding: 26px; display: flex; flex-direction: column; justify-content: center; }
.preview-copy span { color: var(--accent); font-size: .72rem; font-weight: 900; letter-spacing: .14em; }
.preview-copy h2 { margin: 8px 0 7px; font-size: clamp(1.6rem, 3vw, 2.7rem); line-height: 1; }
.preview-copy p { margin: 0; color: var(--muted); }
.current-pick-preview.hidden::after { content: "HIDDEN ON TV"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(8,11,17,.74); backdrop-filter: blur(4px); color: var(--accent); font-size: 1.2rem; font-weight: 1000; letter-spacing: .15em; }
.score-summary { margin: 13px 0 20px; display: grid; grid-template-columns: auto auto 1fr; align-items: baseline; gap: 10px; }
.score-summary span { color: var(--muted); font-size: .8rem; font-weight: 800; }
.score-summary strong { color: var(--accent); font-size: 2rem; }
.score-summary small { color: var(--muted); text-align: right; }
.grading-panel { border-top: 1px solid var(--line); padding-top: 20px; }
.grader-row { display: grid; grid-template-columns: 42px 140px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.06); }
.grader-row:first-of-type { border-top: 0; }
.grader-name strong,
.grader-name small { display: block; }
.grader-name small { color: var(--muted); font-size: .68rem; margin-top: 2px; }
.grade-buttons { display: grid; grid-template-columns: repeat(4, minmax(58px, 1fr)); gap: 7px; }
.grade-button { min-height: 50px; padding: 7px; border-radius: 10px; background: #111924; border: 1px solid var(--line); }
.grade-button strong,
.grade-button span { display: block; }
.grade-button strong { font-size: 1rem; }
.grade-button span { margin-top: 2px; color: var(--muted); font-size: .64rem; }
.grade-button:hover:not(:disabled),
.grade-button.selected { border-color: var(--accent); background: rgba(247,179,43,.13); color: var(--accent); }
.grade-button:disabled { opacity: .35; cursor: not-allowed; }

.setup-section { padding: 22px; margin-bottom: 16px; }
.form-grid { display: grid; gap: 14px; margin-bottom: 16px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-grid.three { grid-template-columns: 1.3fr 1fr .55fr; }
.form-grid.four { grid-template-columns: repeat(4, minmax(0,1fr)); }
.toggle-label { display: flex; align-items: center; gap: 10px; align-self: end; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #101722; }
.toggle-label input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.participant-checks { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin-top: 18px; }
.participant-option { display: grid; grid-template-columns: auto auto minmax(0,1fr); align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #111924; }
.participant-option > input { width: 17px; height: 17px; accent-color: var(--accent); }
.participant-option strong,
.participant-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.participant-option small { margin-top: 2px; color: var(--muted); font-size: .68rem; }

.episode-rules-grid { display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 12px; margin-top: 18px; }
.rule-card { padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #111924; }
.mini-rule-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.mini-rule-grid label { gap: 5px; }
.mini-rule-grid label span { color: var(--accent); font-size: 1rem; }
.mini-rule-grid input { padding: 10px; }
.bonus-rule-card { display: grid; grid-template-columns: 1.5fr .5fr 1.5fr .5fr; gap: 8px; align-items: end; }
.bonus-rule-card .eyebrow { grid-column: 1 / -1; }

.setup-lists { display: grid; gap: 12px; }
.list-editor { overflow: hidden; }
.list-editor summary { list-style: none; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 16px 19px; cursor: pointer; }
.list-editor summary::-webkit-details-marker { display: none; }
.list-editor summary strong,
.list-editor summary small { display: block; }
.list-editor summary small { color: var(--muted); margin-top: 3px; font-size: .72rem; }
.list-editor summary b { color: var(--accent); }
.list-editor-body { padding: 2px 18px 18px; display: grid; gap: 9px; }
.pick-edit-row { display: grid; grid-template-columns: 54px 1fr 1fr 86px auto; gap: 9px; align-items: end; padding: 10px; border-radius: 12px; background: #111924; }
.rank-box { min-height: 44px; display: grid; place-items: center; color: var(--accent); font-weight: 1000; }
.upload-label { position: relative; }
.upload-label input { position: absolute; opacity: 0; pointer-events: none; }
.upload-label span { min-height: 44px; display: grid; place-items: center; padding: 0 10px; border-radius: 10px; border: 1px dashed rgba(247,179,43,.42); color: var(--accent); cursor: pointer; text-align: center; }
.upload-label.wide span { width: 100%; }
.thumb-button { width: 44px; height: 44px; padding: 0; border-radius: 9px; overflow: hidden; background: transparent; }
.thumb-button img { width: 100%; height: 100%; object-fit: cover; }

.host-editor-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.host-editor-card { padding: 22px; display: flex; flex-direction: column; gap: 13px; }
.host-editor-card .eyebrow { margin-bottom: 0; }

.grade-setting-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.grade-setting-grid label { padding: 14px; border-radius: 13px; background: #111924; }
.grade-setting-grid label span { font-size: 1.2rem; color: var(--accent); }
.bonus-settings { display: grid; grid-template-columns: 1.5fr .5fr 1.5fr .5fr; gap: 12px; align-items: end; }
.keyboard-help { padding: 22px; display: grid; grid-template-columns: .8fr 1.2fr; gap: 28px; }
.keyboard-help > div:last-child { display: grid; grid-template-columns: auto 1fr; gap: 9px 12px; align-items: center; }
kbd { min-width: 58px; padding: 7px 9px; border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 7px; background: #101722; text-align: center; font-weight: 800; }
.keyboard-help span { color: var(--muted); }
.empty-state { min-height: 420px; display: grid; place-items: center; align-content: center; gap: 12px; text-align: center; color: var(--muted); }

/* Audience display */
.display-page { min-height: 100vh; overflow: hidden; background: #070a0f; }
.display-shell { min-height: 100vh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background:
  radial-gradient(circle at 50% -20%, rgba(247,179,43,.18), transparent 35%),
  linear-gradient(180deg, #0b1018, #070a0f 70%); }
.display-change .spotlight-card,
.display-change .audience-tile.active { animation: displayPop .38s ease both; }
@keyframes displayPop { from { opacity: .25; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }
.display-header { min-height: 88px; display: grid; grid-template-columns: 1fr auto 48px; align-items: center; gap: 22px; padding: 16px 28px; border-bottom: 1px solid rgba(255,255,255,.11); background: rgba(5,8,13,.78); }
.display-brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.display-brand span,
.display-brand strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.display-brand span { color: var(--accent); font-size: .68rem; font-weight: 1000; letter-spacing: .14em; text-transform: uppercase; }
.display-brand strong { margin-top: 4px; font-size: clamp(.9rem, 1.8vw, 1.35rem); }
.display-topic { color: #b8c2d1; font-size: clamp(.9rem, 1.5vw, 1.2rem); font-weight: 800; }
.fullscreen-button { width: 44px; height: 44px; border-radius: 12px; background: #17202d; font-size: 1.25rem; }
.display-main { min-height: 0; display: grid; padding: clamp(20px, 3vw, 44px); }

.spotlight-layout { min-height: 0; display: grid; grid-template-rows: auto minmax(0,1fr) auto; gap: clamp(14px, 2vh, 24px); }
.spotlight-host { display: inline-flex; align-items: center; gap: 13px; justify-self: start; }
.display-avatar { width: clamp(54px, 6vw, 82px); height: clamp(54px, 6vw, 82px); border-radius: 50%; font-size: clamp(1.4rem, 3vw, 2.4rem); }
.spotlight-host span,
.spotlight-host strong,
.spotlight-host small { display: block; }
.spotlight-host span { color: var(--accent); font-size: .7rem; font-weight: 1000; letter-spacing: .15em; }
.spotlight-host strong { margin-top: 4px; font-size: clamp(1.2rem, 2.2vw, 2rem); }
.spotlight-host small { color: var(--muted); }
.spotlight-card {
  min-height: 0;
  display: grid;
  grid-template-columns: clamp(75px, 8vw, 130px) minmax(220px, .8fr) minmax(350px, 1.2fr) clamp(110px, 11vw, 180px);
  align-items: stretch;
  overflow: hidden;
  border: 2px solid rgba(247,179,43,.55);
  border-radius: clamp(18px, 2vw, 30px);
  background: #111925;
  box-shadow: 0 30px 90px rgba(0,0,0,.42), inset 0 0 80px rgba(247,179,43,.04);
}
.spotlight-rank { display: grid; place-items: center; background: var(--accent); color: #211605; font-size: clamp(2rem, 5vw, 5rem); font-weight: 1000; }
.spotlight-media { min-height: 260px; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle, #2a3a50, #111925 70%); }
.spotlight-media img { width: 100%; height: 100%; object-fit: cover; }
.mystery-mark { color: rgba(247,179,43,.62); font-size: clamp(6rem, 12vw, 12rem); line-height: 1; font-weight: 1000; }
.spotlight-copy { min-width: 0; padding: clamp(26px, 4vw, 70px); display: flex; flex-direction: column; justify-content: center; }
.spotlight-copy p { color: var(--accent); font-size: clamp(.75rem, 1.2vw, 1rem); font-weight: 1000; letter-spacing: .2em; }
.spotlight-copy h1 { margin: 0; font-size: clamp(2.5rem, 6.5vw, 7.4rem); line-height: .9; text-transform: uppercase; overflow-wrap: anywhere; }
.spotlight-copy h2 { margin: 16px 0 0; color: #b7c1cf; font-size: clamp(1rem, 2vw, 2rem); font-weight: 600; }
.spotlight-score { display: grid; place-items: center; align-content: center; gap: 6px; background: rgba(255,255,255,.035); border-left: 1px solid rgba(255,255,255,.08); }
.spotlight-score span { color: var(--muted); font-size: clamp(.65rem, 1vw, .9rem); font-weight: 900; letter-spacing: .18em; }
.spotlight-score strong { color: var(--accent); font-size: clamp(3.5rem, 7vw, 7rem); line-height: 1; }
.is-hidden .spotlight-card { border-color: rgba(255,255,255,.15); }
.is-hidden .spotlight-rank { background: #253246; color: #a8b5c8; }
.display-grades { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.display-grade { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid rgba(255,255,255,.09); border-radius: 14px; background: #101722; }
.mini-display-avatar { width: 34px; height: 34px; border-radius: 50%; }
.display-grade span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #c2cbd7; font-weight: 800; }
.display-grade strong { color: var(--accent); font-size: 1.5rem; }

.board-layout { min-height: 0; display: grid; grid-template-rows: auto minmax(0,1fr); gap: 20px; }
.board-host { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 14px; }
.board-host span,
.board-host strong { display: block; }
.board-host span { color: var(--accent); font-size: .7rem; font-weight: 1000; letter-spacing: .15em; }
.board-host strong { margin-top: 4px; font-size: clamp(1.4rem, 2.5vw, 2.5rem); }
.board-host b { color: var(--accent); font-size: clamp(1.7rem, 3vw, 3rem); }
.audience-board { min-height: 0; display: grid; grid-auto-rows: minmax(54px, 1fr); gap: clamp(7px, 1vh, 12px); }
.audience-tile { min-height: 0; display: grid; grid-template-columns: clamp(56px, 6vw, 100px) minmax(0,1fr) clamp(60px, 7vw, 110px); align-items: center; gap: 18px; overflow: hidden; border: 1px solid rgba(255,255,255,.11); border-radius: 14px; background: #111925; }
.audience-tile.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(247,179,43,.13); }
.audience-tile.revealed { background: linear-gradient(90deg, rgba(247,179,43,.11), #111925 35%); }
.audience-rank { height: 100%; display: grid; place-items: center; background: #253246; color: #aeb9c9; font-size: clamp(1.2rem, 2.7vw, 2.8rem); font-weight: 1000; }
.audience-tile.revealed .audience-rank { background: var(--accent); color: #211605; }
.audience-tile strong,
.audience-tile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audience-tile strong { font-size: clamp(1rem, 2vw, 2.1rem); text-transform: uppercase; }
.audience-tile small { margin-top: 4px; color: var(--muted); font-size: clamp(.65rem, 1vw, .95rem); }
.audience-tile b { color: var(--accent); text-align: center; font-size: clamp(1.4rem, 2.8vw, 3rem); }
.display-totals { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 0; border-top: 1px solid rgba(255,255,255,.11); background: #080c12; }
.display-total { min-width: 0; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 11px clamp(12px, 2vw, 28px); border-right: 1px solid rgba(255,255,255,.08); }
.display-total:last-child { border-right: 0; }
.display-total.active { background: rgba(247,179,43,.09); }
.display-total span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #c1cad6; font-weight: 850; }
.display-total strong { color: var(--accent); font-size: clamp(1.5rem, 3vw, 3rem); }
.display-error { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--muted); }
.display-error strong { color: var(--danger); font-size: 1.4rem; }

@media (max-width: 1180px) {
  .host-score-strip,
  .host-editor-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .live-grid { grid-template-columns: 1fr; }
  .form-grid.four,
  .participant-checks,
  .episode-rules-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .bonus-rule-card { grid-column: 1 / -1; }
  .pick-edit-row { grid-template-columns: 48px 1fr 1fr 82px; }
  .pick-edit-row .thumb-button { grid-column: 4; }
  .spotlight-card { grid-template-columns: 85px minmax(180px,.7fr) 1.3fr 105px; }
}

@media (max-width: 820px) {
  .control-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-brand { padding-bottom: 14px; }
  .main-nav { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .nav-button { justify-content: center; padding: 10px 7px; font-size: .72rem; }
  .nav-button span { display: none; }
  .episode-nav-header,
  .episode-list { display: none; }
  .sidebar-actions { margin-top: 12px; grid-template-columns: 1fr auto; align-items: center; }
  .workspace-header { position: static; padding: 18px; }
  .workspace-main { padding: 18px; }
  .live-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-group .button { flex: 1; }
  .host-score-strip { grid-template-columns: 1fr 1fr; }
  .form-grid.two,
  .form-grid.three,
  .form-grid.four,
  .participant-checks,
  .episode-rules-grid,
  .host-editor-grid,
  .bonus-settings,
  .keyboard-help { grid-template-columns: 1fr; }
  .pick-edit-row { grid-template-columns: 48px 1fr; }
  .pick-edit-row label:nth-of-type(2),
  .pick-edit-row .upload-label,
  .pick-edit-row .thumb-button { grid-column: 2; }
  .current-pick-preview { grid-template-columns: 1fr; }
  .grader-row { grid-template-columns: 42px 1fr; }
  .grade-buttons { grid-column: 1 / -1; }
  .display-page { overflow: auto; }
  .display-header { grid-template-columns: 1fr 44px; }
  .display-topic { display: none; }
  .spotlight-card { grid-template-columns: 70px 1fr; grid-template-rows: minmax(180px, .8fr) 1fr auto; }
  .spotlight-rank { grid-row: 1 / 4; }
  .spotlight-copy { padding: 24px; }
  .spotlight-score { min-height: 80px; border-left: 0; border-top: 1px solid rgba(255,255,255,.08); }
  .display-grades,
  .display-totals { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .display-total:nth-child(2) { border-right: 0; }
  .display-total:nth-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.08); }
}

@media (max-width: 520px) {
  .setup-card,
  .login-card { padding: 25px; }
  .workspace-header { align-items: flex-start; }
  .header-actions .button { display: none; }
  .host-score-strip { grid-template-columns: 1fr; }
  .host-score-card { grid-template-columns: 38px minmax(0,1fr) auto; }
  .grade-buttons { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .participant-checks,
  .mini-rule-grid,
  .bonus-rule-card { grid-template-columns: 1fr; }
  .bonus-rule-card .eyebrow { grid-column: 1; }
  .display-main { padding: 14px; }
  .display-grades { grid-template-columns: 1fr 1fr; gap: 7px; }
  .display-grade { grid-template-columns: auto auto; }
  .display-grade span { display: none; }
  .display-totals { grid-template-columns: 1fr 1fr; }
}
