/* Bluffstroke — art-heist game show. Klein blue, cadmium yellow, hard edges. */
:root {
  --blue: #1f33d6;
  --blue-deep: #16259e;
  --yellow: #ffd23f;
  --red: #ff4a2b;
  --paper: #fff8ea;
  --ink: #111111;
  --muted: #5b564c;
  --on-blue: #ffffff;
  --on-blue-soft: rgba(255, 255, 255, 0.72);
  --line: 3px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
  --shadow-sm: 4px 4px 0 var(--ink);
  --gold: linear-gradient(135deg, #7a5a14 0%, #e9c46a 16%, #b8862b 32%, #f6dd8f 50%, #a87824 68%, #e8c36b 84%, #7a5a14 100%);
  --gold-edge: #5e430d;
  --display: 'Bricolage Grotesque', 'Arial Black', system-ui, sans-serif;
  --mono: 'DM Mono', ui-monospace, Menlo, monospace;
  --serif: 'Instrument Serif', Georgia, serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--on-blue);
  font: 500 16px/1.5 var(--display);
  background-color: var(--blue);
  background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1.5px, transparent 1.6px);
  background-size: 22px 22px;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px clamp(16px, 4vw, 44px);
}
.logo { display: inline-flex; text-decoration: none; transform: rotate(-2deg); }
.logo span {
  font: 800 26px/1 var(--display);
  letter-spacing: -0.03em;
  text-transform: uppercase;
  padding: 7px 10px 8px;
  border: var(--line);
  box-shadow: var(--shadow-sm);
}
.logo-a { background: var(--yellow); color: var(--ink); }
.logo-b { background: var(--paper); color: var(--ink); border-left: 0 !important; font-style: normal; }
.logo-b::first-letter { color: var(--red); }

main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: clamp(14px, 3vw, 36px) clamp(16px, 4vw, 44px) 56px; }
.colophon {
  display: flex; flex-wrap: wrap; gap: 6px 28px; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 44px);
  font: 400 11px/1.5 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  color: var(--on-blue-soft);
  border-top: 2px solid rgba(255,255,255,.2);
}

/* ---------- Shared pieces ---------- */
.card {
  background: var(--paper);
  color: var(--ink);
  border: var(--line);
  box-shadow: var(--shadow);
}
.tag {
  display: inline-block;
  font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
  padding: 6px 8px; border: 2px solid currentColor;
}
.kicker { font: 500 12px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; margin: 0 0 10px; }
.on-blue .kicker, .kicker.on-blue { color: var(--yellow); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 12px 22px;
  background: var(--yellow); color: var(--ink);
  border: var(--line); border-radius: 0;
  box-shadow: var(--shadow-sm);
  font: 800 17px/1 var(--display); letter-spacing: -0.01em; text-transform: uppercase;
  cursor: pointer;
  transition: transform .08s, box-shadow .08s, background-color .12s;
}
.btn:hover { background: #ffdc66; }
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); }
.btn.red { background: var(--red); color: #fff; }
.btn.red:hover { background: #ff6648; }
.btn.paper { background: var(--paper); }
.btn.paper:hover { background: #fff; }
.btn.ink { background: var(--ink); color: var(--yellow); }
.btn.big { min-height: 66px; font-size: 21px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: var(--shadow-sm); }
.btn:focus-visible, .chip-btn:focus-visible, .tile:focus-visible, .icon-btn:focus-visible, .frame:focus-visible, input:focus-visible {
  outline: 3px solid var(--red); outline-offset: 3px;
}
.chip-btn {
  background: var(--paper); color: var(--ink); border: var(--line); box-shadow: var(--shadow-sm);
  padding: 9px 14px; cursor: pointer;
  font: 500 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
}
.chip-btn:active { transform: translate(4px, 4px); box-shadow: none; }
.text-btn {
  background: none; border: 0; padding: 2px 0; cursor: pointer; color: inherit;
  font: 500 12px/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  border-bottom: 2px solid currentColor;
}
.text-btn:hover { color: var(--red); }
.row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* ---------- Title screen ---------- */
.home {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 30px clamp(28px, 5vw, 64px); align-items: start;
  grid-template-areas: "hero lineup" "steps lineup";
}
.hero { grid-area: hero; }
.lineup { grid-area: lineup; }
.steps { grid-area: steps; }
.hero > .kicker { margin-bottom: 18px; }
.hero h1 {
  margin: 8px 0 0;
  font: 800 clamp(48px, 7.4vw, 104px)/0.88 var(--display);
  letter-spacing: -0.045em;
  text-transform: uppercase;
}
.hero h1 .hl { background: var(--yellow); color: var(--ink); padding: 0 .08em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.hero h1 .strike { position: relative; color: var(--on-blue); }
.hero h1 .strike::after {
  content: ""; position: absolute; left: -2%; right: -2%; top: 52%; height: .11em;
  background: var(--red); transform: rotate(-4deg);
}
.hero .intro {
  margin: 24px 0 0; max-width: 33em;
  font: 400 clamp(19px, 1.8vw, 23px)/1.42 var(--serif);
  color: var(--on-blue);
}
.hero .intro em { color: var(--yellow); }
.steps { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.steps li { padding: 16px 16px 18px; }
.steps li:nth-child(2) { transform: rotate(.8deg); }
.steps li:nth-child(3) { transform: rotate(-.6deg); }
.steps .verb { display: flex; align-items: baseline; gap: 10px; font: 800 24px/1 var(--display); text-transform: uppercase; letter-spacing: -0.02em; margin-bottom: 8px; }
.steps .verb b { font: 500 12px var(--mono); color: var(--red); }
.steps p { margin: 0; font-size: 15px; line-height: 1.45; color: var(--muted); font-weight: 500; }

.lineup { padding: clamp(18px, 2.4vw, 28px); }
.lineup h2, .section-title { font: 800 30px/1 var(--display); letter-spacing: -0.03em; text-transform: uppercase; margin: 0; }
.lineup-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.player-row {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) 44px 44px; align-items: stretch;
  border: var(--line); background: #fff; margin-bottom: 10px;
}
.player-row .num {
  display: grid; place-items: center; background: var(--ink); color: var(--yellow);
  font: 500 13px var(--mono);
}
.player-row input {
  width: 100%; min-width: 0; border: 0; background: transparent;
  padding: 12px 12px; font: 700 19px/1.2 var(--display); letter-spacing: -0.01em;
}
.icon-btn {
  border: 0; border-left: var(--line); background: var(--paper); cursor: pointer;
  font: 700 18px/1 var(--display); color: var(--ink);
}
.icon-btn:hover:not(:disabled) { background: var(--yellow); }
.icon-btn:disabled { color: #bbb; cursor: not-allowed; }
.target-head { margin: 26px 0 10px; display: flex; justify-content: space-between; align-items: baseline; }
.tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.tile {
  aspect-ratio: 1 / 1; border: var(--line); background: #fff; cursor: pointer;
  font: 800 clamp(20px, 2.4vw, 28px)/1 var(--display); letter-spacing: -0.03em;
  box-shadow: 3px 3px 0 var(--ink);
}
.tile:hover { background: var(--yellow); }
.tile[aria-pressed="true"] { background: var(--red); color: #fff; transform: translate(3px, 3px); box-shadow: none; }
.hint { font: 400 12px/1.4 var(--mono); color: var(--muted); margin: 0; }
.lineup .start { margin-top: 26px; }

/* ---------- Scoreboard ---------- */
.scoreboard { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: clamp(18px, 3vw, 30px); align-items: stretch; }
.score {
  flex: 1 1 150px; min-width: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 10px;
  padding: 8px 12px; background: var(--paper); color: var(--ink); border: var(--line);
}
.score .who { font: 700 15px/1.2 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score .pts { grid-row: span 2; font: 800 30px/1 var(--display); letter-spacing: -0.04em; }
.score .pts small { font: 500 12px var(--mono); color: var(--muted); letter-spacing: 0; }
.score .bar { height: 6px; background: rgba(0,0,0,.1); border: 1.5px solid var(--ink); }
.score .bar i { display: block; height: 100%; background: var(--blue); }
.score.presenting { background: var(--yellow); box-shadow: var(--shadow-sm); }
.score.presenting .bar i { background: var(--red); }
.round-badge {
  flex: 0 0 auto; display: grid; place-items: center; padding: 8px 14px;
  background: var(--ink); color: var(--yellow); border: var(--line);
  font: 500 12px/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; text-align: center;
}
.round-badge b { display: block; font: 800 26px/1 var(--display); letter-spacing: -0.03em; color: #fff; }

/* ---------- Hand-off screen ---------- */
.handoff { max-width: 640px; margin: clamp(10px, 4vw, 40px) auto 0; text-align: center; padding: clamp(26px, 5vw, 48px) clamp(18px, 4vw, 44px); }
.handoff .kicker { color: var(--red); }
.handoff .name {
  margin: 6px 0 14px;
  font: 800 clamp(38px, 6.4vw, 66px)/0.95 var(--display); letter-spacing: -0.04em; text-transform: uppercase;
  overflow-wrap: anywhere;
}
.handoff .warn { font: 400 21px/1.4 var(--serif); margin: 0 auto 26px; max-width: 26em; }
.handoff .warn em { background: var(--yellow); font-style: italic; padding: 0 4px; }
.deltas { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 26px; padding: 0; list-style: none; }
.deltas li { font: 500 13px/1 var(--mono); padding: 8px 10px; border: 2px solid var(--ink); background: #fff; }
.deltas li b { color: var(--red); }

/* ---------- Round ---------- */
.round { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(310px, 1fr); gap: clamp(22px, 4vw, 48px); align-items: start; }
.wall { display: flex; justify-content: center; padding-bottom: 6px; }
.frame {
  position: relative; display: block; max-width: 100%;
  padding: clamp(11px, 1.5vw, 18px);
  background: var(--gold); border: var(--line);
  box-shadow: 10px 10px 0 var(--ink), inset 0 0 0 2px rgba(255, 245, 200, .45), inset 0 0 0 6px rgba(94, 67, 13, .35);
  cursor: zoom-in; transform: rotate(-.6deg);
}
.gilt {
  position: relative; display: block;
  padding: clamp(6px, 1vw, 10px);
  background: var(--paper);
  box-shadow: 0 0 0 2px var(--gold-edge), inset 0 0 0 1px rgba(0,0,0,.12);
}
.gilt.mini { padding: 6px; border: 7px solid transparent; background: linear-gradient(var(--paper), var(--paper)) padding-box, var(--gold) border-box; box-shadow: 0 0 0 2px var(--ink), 5px 5px 0 2px var(--ink); }
.frame img {
  display: block; max-width: 100%; max-height: min(62vh, 700px); width: auto; height: auto;
  min-width: 180px; min-height: 180px; object-fit: contain; background: #e9e1cf;
  outline: 1px solid rgba(0,0,0,.35);
}
.frame .loading { position: absolute; inset: 0; display: grid; place-items: center; font: 400 22px var(--serif); font-style: italic; color: var(--muted); }
.frame .zoom-tag {
  position: absolute; left: 50%; bottom: -18px; transform: translateX(-50%) rotate(.6deg);
  background: var(--yellow); border: 2px solid var(--ink); padding: 6px 10px;
  font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; color: var(--ink);
}

.desk { padding: clamp(18px, 2.4vw, 26px); }
.desk .presenter { margin: 0 0 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font: 700 15px/1.3 var(--display); }
.desk .presenter .tag { background: var(--ink); color: var(--yellow); border-color: var(--ink); }
.titlebox { position: relative; border: var(--line); background: #fff; padding: 14px 16px 16px; margin-bottom: 16px; }
.titlebox .kicker { color: var(--muted); margin-bottom: 6px; }
.title-real { margin: 0; font: 400 clamp(26px, 2.6vw, 34px)/1.1 var(--serif); overflow-wrap: anywhere; }
.redacted { display: grid; gap: 8px; padding: 4px 0 2px; }
.redacted span { height: 22px; background: repeating-linear-gradient(-45deg, var(--ink) 0 10px, #2a2a2a 10px 20px); }
.redacted span:nth-child(2) { width: 58%; }
.stamp {
  position: absolute; right: 10px; top: -16px; transform: rotate(8deg);
  background: var(--paper); color: var(--red); border: 3px solid var(--red);
  font: 800 20px/1 var(--display); letter-spacing: .04em; padding: 6px 10px 5px;
  animation: stamp .35s cubic-bezier(.2, 1.6, .4, 1) both;
}
@keyframes stamp { from { transform: rotate(-12deg) scale(2.4); opacity: 0; } to { transform: rotate(8deg) scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .stamp { animation: none; } }

.meta { display: grid; grid-template-columns: 92px 1fr; gap: 6px 12px; margin: 0; font-size: 14.5px; font-weight: 500; }
.meta dt { font: 500 11px/1.9 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.meta dd { margin: 0; overflow-wrap: anywhere; }

.script { margin: 18px 0 0; border: var(--line); background: var(--yellow); padding: 14px 16px; }
.script .kicker { color: var(--ink); }
.script .coach { margin: 0 0 12px; font: 400 19px/1.35 var(--serif); }
.script .example { display: grid; gap: 6px; background: var(--paper); border: 2px solid var(--ink); padding: 10px 12px; margin-bottom: 10px; }
.script .example .k { font: 500 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.script .example .t { font: 400 21px/1.15 var(--serif); }
.script .text-btn { color: var(--ink); }

.say { margin: 18px 0 0; font: 400 19px/1.4 var(--serif); color: var(--muted); }
.actions { margin-top: 20px; display: grid; gap: 12px; }
.actions .row > .btn { flex: 1 1 140px; }

.guessers { display: grid; gap: 8px; margin: 10px 0 0; }
.check {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer;
  border: var(--line); background: #fff; font: 700 17px/1.2 var(--display);
}
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box { flex: 0 0 26px; height: 26px; border: var(--line); display: grid; place-items: center; font: 800 16px var(--display); background: #fff; }
.check:has(input:checked) { background: var(--yellow); }
.check input:checked + .box { background: var(--ink); color: var(--yellow); }
.check input:checked + .box::after { content: "✓"; }
.check:has(input:focus-visible) { outline: 3px solid var(--red); outline-offset: 2px; }
.check .gain { margin-left: auto; font: 500 11px/1.2 var(--mono); letter-spacing: .06em; text-align: right; color: var(--muted); }
.check input:checked ~ .gain { color: var(--ink); }

.sources { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.sources a { font: 500 11.5px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; text-decoration: none; border-bottom: 2px solid var(--ink); }
.sources a:hover { color: var(--red); border-color: var(--red); }

/* ---------- Winner ---------- */
.winner { max-width: 720px; margin: clamp(10px, 4vw, 40px) auto 0; padding: clamp(26px, 5vw, 48px) clamp(18px, 4vw, 44px); text-align: center; }
.winner .kicker { color: var(--red); }
.winner h1 { margin: 6px 0 10px; font: 800 clamp(40px, 7vw, 76px)/0.92 var(--display); letter-spacing: -0.045em; text-transform: uppercase; overflow-wrap: anywhere; }
.winner .sub { font: 400 22px/1.4 var(--serif); margin: 0 0 26px; }
.final { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 8px; text-align: left; }
.final li { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; padding: 10px 14px; border: var(--line); background: #fff; font: 700 18px var(--display); }
.final li:first-child { background: var(--yellow); }
.final li .place { font: 500 13px var(--mono); color: var(--muted); }
.final li .s { font: 800 26px/1 var(--display); letter-spacing: -0.03em; }
.final li .title { display: block; font: 500 11px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.winner .row { justify-content: center; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 64px 16px 24px; background: rgba(10, 14, 50, .96); cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border: 3px solid #fff; }
.lightbox-close {
  position: absolute; top: 14px; right: 16px; cursor: pointer;
  background: var(--yellow); color: var(--ink); border: var(--line); box-shadow: 4px 4px 0 #000;
  padding: 10px 14px; font: 500 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .home, .round { grid-template-columns: minmax(0, 1fr); }
  .home { grid-template-areas: "hero" "lineup" "steps"; }
  .frame img { max-height: 56vh; }
}
@media (max-width: 520px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
  .tiles { gap: 6px; }
  .logo span { font-size: 21px; }
  .score { flex-basis: calc(50% - 5px); }
  .round-badge { flex-basis: 100%; grid-auto-flow: column; gap: 10px; justify-content: center; }
  .round-badge b { font-size: 20px; }
}

/* ---------- Top actions & streak chips ---------- */
.top-actions { display: flex; gap: 10px; align-items: center; }
.top-actions .chip-btn { white-space: nowrap; }
.chip-btn[data-action="mute"][aria-pressed="false"] { background: var(--ink); color: var(--yellow); }
.score .who .chip {
  display: inline-block; margin-left: 6px; padding: 1px 5px 2px; vertical-align: 1px;
  font: 500 11px/1.2 var(--mono); border: 1.5px solid var(--ink); background: #fff;
}
.score .who .chip.hot { background: var(--red); color: #fff; border-color: var(--red); }
.score .who .chip.cold { background: #cfe3ff; }

/* ---------- Trash-talk banner ---------- */
.banner {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center; align-content: center; gap: 18px;
  background: rgba(10, 14, 50, 0); cursor: pointer; overflow: hidden;
  transition: background-color .3s;
}
.banner.in { background: rgba(10, 14, 50, .72); }
.banner.out { background: rgba(10, 14, 50, 0); }
.banner .band {
  width: 112vw; margin-left: -6vw;
  transform: translateX(-120%) rotate(-3deg);
  border-top: 4px solid var(--ink); border-bottom: 4px solid var(--ink);
  box-shadow: 0 10px 0 var(--ink);
  background: var(--yellow); color: var(--ink);
}
.banner.bad .band { background: var(--red); color: #fff; }
.banner.in .band { animation: band-in .5s cubic-bezier(.2, .9, .25, 1.15) forwards; }
.banner.out .band { animation: band-out .38s cubic-bezier(.6, 0, .9, .4) forwards; }
@keyframes band-in { from { transform: translateX(-120%) rotate(-3deg); } to { transform: translateX(0) rotate(-3deg); } }
@keyframes band-out { from { transform: translateX(0) rotate(-3deg); } to { transform: translateX(120%) rotate(-3deg); } }

.banner .ticker {
  overflow: hidden; white-space: nowrap; background: var(--ink); color: var(--yellow);
  font: 500 12px/1 var(--mono); letter-spacing: .2em; padding: 7px 0;
}
.banner.bad .ticker { color: #fff; }
.banner .ticker span { display: inline-block; animation: ticker 14s linear infinite; }
.banner .ticker.rev span { animation-direction: reverse; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.banner .band-body { max-width: 980px; margin: 0 auto; padding: clamp(18px, 3vw, 30px) clamp(24px, 8vw, 60px); text-align: center; }
.banner .band-kicker {
  margin: 0 0 6px; display: inline-block;
  font: 800 clamp(34px, 6.4vw, 72px)/0.9 var(--display); letter-spacing: -0.04em; text-transform: uppercase;
  opacity: 0; transform: scale(1.6);
}
.banner.in .band-kicker { animation: slam .32s .32s cubic-bezier(.2, 1.5, .4, 1) forwards; }
@keyframes slam { to { opacity: 1; transform: scale(1); } }
.banner .band-line { margin: 6px auto 0; max-width: 34em; font: 400 clamp(20px, 2.4vw, 28px)/1.25 var(--serif); opacity: 0; }
.banner .band-line b, .banner .streak b { font-family: var(--display); font-weight: 800; font-size: .86em; letter-spacing: -0.01em; }
.banner.in .band-line { animation: rise .35s .55s ease-out forwards; }
.banner .streak {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 14px auto 0; max-width: 40em; opacity: 0;
  font: 500 clamp(14px, 1.5vw, 17px)/1.35 var(--display);
}
.banner .streak .txt { text-align: left; }
.banner .streak .badge {
  flex: 0 0 auto; padding: 4px 8px; border: 2.5px solid currentColor;
  font: 800 16px/1 var(--display); letter-spacing: -0.02em;
}
.banner.in .streak { animation: rise .35s .85s ease-out forwards; }
.banner.in .streak + .streak { animation-delay: 1.1s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.banner .band-skip {
  margin: 0; font: 500 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.75);
  opacity: 0; transition: opacity .3s .9s;
}
.banner.in .band-skip { opacity: 1; }
.banner.out .band-skip { opacity: 0; transition-delay: 0s; }

@media (prefers-reduced-motion: reduce) {
  .banner.in .band, .banner.out .band { animation: none; transform: rotate(-3deg); }
  .banner .ticker span { animation: none; }
  .banner .band-kicker, .banner .band-line, .banner .streak { opacity: 1; transform: none; animation: none !important; }
}
@media (max-width: 520px) {
  .top-actions .chip-btn { padding: 8px 10px; font-size: 11px; }
}


/* ---------- Portrait medallions ---------- */
.portrait {
  --w: 26px;
  display: inline-grid; place-items: center; flex: 0 0 auto;
  width: var(--w); height: calc(var(--w) * 1.25);
  padding: calc(var(--w) * .1);
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 1.5px var(--ink);
  vertical-align: middle;
}
.portrait > span {
  display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 30%, hsl(var(--h) 55% 52%), hsl(var(--h) 50% 26%) 75%);
  box-shadow: inset 0 0 0 1px var(--gold-edge);
  color: #fff8ea; font: 800 calc(var(--w) * .36)/1 var(--display); letter-spacing: -0.02em;
  text-shadow: 0 1px 0 rgba(0,0,0,.35);
}
.portrait.xs { --w: 22px; }
.portrait.xs > span { font-size: 9px; }
.portrait.lg { --w: 108px; box-shadow: 0 0 0 3px var(--ink), 6px 6px 0 3px var(--ink); }
.portrait.xl { --w: 132px; box-shadow: 0 0 0 3px var(--ink), 7px 7px 0 3px var(--ink); }
.player-row .num { background: var(--ink); }
.score .who { display: flex; align-items: center; gap: 7px; }
.score .who .portrait { margin-right: 1px; }
.sitter { margin: 4px auto 14px; display: grid; justify-items: center; gap: 12px; }
.sitter figcaption { font: 500 10.5px/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); background: #fff; border: 2px solid var(--ink); padding: 5px 8px; }
.winner-portraits { display: flex; justify-content: center; flex-wrap: wrap; gap: 24px; }
.final .who-line { display: flex; align-items: center; gap: 10px; }

/* ---------- Difficulty ---------- */
.desk-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.desk .desk-top .presenter { margin: 0; }
.difficulty {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 8px; border: 2px solid var(--ink); background: #fff;
  font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink);
}
.difficulty .pips { display: inline-flex; gap: 3px; }
.difficulty .pips i { width: 8px; height: 8px; border: 1.5px solid var(--ink); background: transparent; }
.difficulty .pips i.on { background: var(--ink); }
.difficulty.d1 { background: #d9f2d0; }
.difficulty.d2 { background: var(--yellow); }
.difficulty.d3 { background: var(--red); color: #fff; border-color: var(--ink); }
.difficulty.d3 .pips i { border-color: #fff; }
.difficulty.d3 .pips i.on { background: #fff; }

/* ---------- Behind the canvas ---------- */
.backstory-btn { margin-top: 16px; width: 100%; }
.dossier {
  position: fixed; inset: 0; z-index: 45; display: grid; place-items: center;
  padding: 20px 16px; background: rgba(10, 14, 50, .78);
}
.dossier-card {
  position: relative; width: min(680px, 100%); max-height: calc(100vh - 40px); overflow: auto;
  padding: clamp(20px, 3.4vw, 34px);
  animation: dossier-in .28s cubic-bezier(.2, 1.2, .4, 1);
}
@keyframes dossier-in { from { transform: translateY(24px) rotate(-1deg); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dossier-card { animation: none; } }
.dossier-close {
  position: sticky; top: 0; float: right; margin: -6px -6px 8px 12px; z-index: 1;
  background: var(--yellow); color: var(--ink); border: var(--line); box-shadow: var(--shadow-sm);
  padding: 9px 12px; cursor: pointer; font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
}
.dossier-art { float: right; clear: right; margin: 4px 0 14px 18px; }
.dossier-art img { display: block; max-width: 170px; max-height: 190px; object-fit: contain; }
.dossier .kicker { color: var(--red); }
.dossier-title { margin: 0; font: 400 clamp(28px, 3.6vw, 38px)/1.05 var(--serif); }
.dossier-by { margin: 8px 0 16px; font: 700 16px/1.3 var(--display); }
.dossier-facts { clear: none; margin-bottom: 18px; }
.dossier section { clear: both; border-top: 2px solid var(--ink); padding-top: 12px; margin-top: 16px; }
.dossier section:first-of-type { clear: none; }
.dossier h3 { margin: 0 0 6px; font: 800 15px/1.2 var(--display); letter-spacing: .02em; text-transform: uppercase; }
.dossier section p { margin: 0; font: 400 19px/1.45 var(--serif); }
.dossier .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.dossier .tags span { font: 500 12px/1 var(--mono); padding: 6px 8px; border: 2px solid var(--ink); background: #fff; }
.dossier-loading { clear: both; font: italic 400 19px var(--serif); color: var(--muted); }
.dossier .sources { clear: both; margin-top: 20px; }
@media (max-width: 520px) {
  .dossier-art { float: none; margin: 0 0 14px; display: flex; justify-content: center; }
  .portrait.lg { --w: 88px; }
  .portrait.xl { --w: 104px; }
}
.portrait.lg > span, .portrait.xl > span {
  align-items: end; padding-bottom: 14%;
  font-size: calc(var(--w) * .2);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 120'%3E%3Cg fill='rgba(10,8,20,.42)'%3E%3Ccircle cx='50' cy='44' r='19'/%3E%3Cpath d='M10 120 C12 88 30 72 50 72 C70 72 88 88 90 120Z'/%3E%3C/g%3E%3C/svg%3E") center bottom / 92% auto no-repeat,
    radial-gradient(ellipse at 50% 30%, hsl(var(--h) 55% 56%), hsl(var(--h) 50% 24%) 78%);
}
@media (max-width: 520px) { .score .who .portrait { display: none; } }

.portrait > svg { display: block; width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 0 0 1px var(--gold-edge); }
.portrait.xs { --w: 24px; }

.portrait > img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 50% 28%; box-shadow: 0 0 0 1px var(--gold-edge); background: #2a2218; }

/* =========================================================
   Fit more on screen + sliding names
   ========================================================= */

/* Sliding names: only animate when the text doesn't fit. */
.mq { display: block; overflow: hidden; white-space: nowrap; min-width: 0; }
.mq-in { display: inline-block; }
.mq-on { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6px, #000 calc(100% - 12px), transparent); mask-image: linear-gradient(90deg, transparent 0, #000 6px, #000 calc(100% - 12px), transparent); }
.mq-on .mq-in { animation: mq var(--mq-dur, 6s) ease-in-out infinite alternate; }
@keyframes mq { 0%, 18% { transform: translateX(0); } 82%, 100% { transform: translateX(var(--mq-shift, 0)); } }
@media (prefers-reduced-motion: reduce) { .mq-on .mq-in { animation: none; } .mq { text-overflow: ellipsis; } }

/* Chrome: tighter bar, footer only where it matters. */
.topbar { padding: 10px clamp(12px, 3vw, 32px); }
.logo span { font-size: 22px; padding: 5px 9px 6px; }
main { padding: 6px clamp(12px, 3vw, 32px) 20px; }
body[data-screen="round"] .colophon, body[data-screen="handoff"] .colophon { display: none; }

/* Buttons a little slimmer everywhere. */
.btn { min-height: 46px; padding: 10px 16px; font-size: 15px; }
.btn.big { min-height: 52px; font-size: 18px; }

/* Scoreboard: one row that swipes sideways when crowded. */
.scoreboard { flex-wrap: nowrap; overflow-x: auto; gap: 8px; margin-bottom: 12px; padding: 0 6px 6px 0; scrollbar-width: thin; }
.score { flex: 1 0 150px; padding: 6px 10px; gap: 2px 8px; }
.score .who { display: flex; align-items: center; gap: 6px; font-size: 14px; overflow: visible; text-overflow: clip; }
.score .who .mq { flex: 1 1 auto; }
.score .who .chip { flex: 0 0 auto; }
.score .pts { font-size: 24px; }
.round-badge { flex: 0 0 auto; padding: 4px 12px; }
.round-badge b { font-size: 20px; }

/* Round: painting sized to the space that's actually left. */
.round { grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr); gap: clamp(16px, 3vw, 36px); }
.frame { padding: clamp(8px, 1.1vw, 13px); box-shadow: 7px 7px 0 var(--ink), inset 0 0 0 2px rgba(255, 245, 200, .45), inset 0 0 0 6px rgba(94, 67, 13, .35); }
.frame img { max-height: calc(100vh - 224px); max-height: calc(100dvh - 224px); min-height: 140px; min-width: 140px; }
.desk { padding: 14px 18px; }
.desk-top { margin-bottom: 10px; flex-wrap: nowrap; }
.desk .presenter { min-width: 0; flex: 1 1 auto; flex-wrap: nowrap; gap: 8px; font-size: 14px; }
.presenter .tag { flex: 0 0 auto; }
.presenter-name { flex: 1 1 auto; min-width: 0; }
.difficulty { flex: 0 0 auto; }
.titlebox { padding: 10px 12px 12px; margin-bottom: 10px; }
.title-real { font-size: clamp(21px, 2vw, 28px); }
.redacted span { height: 16px; }
.meta { font-size: 13.5px; gap: 2px 10px; grid-template-columns: 78px 1fr; }
.script { margin-top: 12px; padding: 10px 12px; }
.script .coach { font-size: 16px; margin-bottom: 8px; }
.script .example { padding: 8px 10px; margin-bottom: 8px; }
.script .example .t { font-size: 18px; }
.say { margin-top: 12px; font-size: 17px; }
.actions { margin-top: 12px; gap: 8px; }
.actions .row { gap: 8px; }
.reveal-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 10px; }
.reveal-tools .backstory-btn { width: auto; margin-top: 0; min-height: 40px; font-size: 14px; }
.reveal-tools .sources { margin-top: 0; }
.guessers { gap: 6px; margin-top: 6px; }
.check { padding: 7px 10px; gap: 10px; font-size: 15px; }
.check .box { flex: 0 0 22px; height: 22px; }
.check-name { flex: 1 1 auto; min-width: 0; }
.check .gain { flex: 0 0 auto; margin-left: 4px; white-space: nowrap; font-size: 10.5px; }

/* Hand-off and winner: smaller portrait, one-line names. */
.handoff { margin-top: 4px; padding: 20px clamp(16px, 3vw, 32px); }
.handoff .name { font-size: clamp(30px, 5vw, 54px); margin: 4px 0 8px; }
.handoff .warn { font-size: 18px; margin-bottom: 16px; }
.deltas { margin-bottom: 12px; }
.sitter { margin: 2px auto 8px; gap: 8px; }
.portrait.lg { --w: 84px; }
.portrait.xl { --w: 96px; }
.winner { margin-top: 4px; padding: 20px clamp(16px, 3vw, 32px); }
.winner h1 { font-size: clamp(30px, 5vw, 56px); margin: 4px 0 6px; }
.winner .sub { font-size: 18px; margin-bottom: 14px; }
.final { gap: 6px; margin-bottom: 16px; }
.final li { grid-template-columns: 34px minmax(0, 1fr) auto; padding: 6px 12px; font-size: 16px; }
.final li .s { font-size: 22px; }
.final .who-line { min-width: 0; }
.who-text { flex: 1 1 auto; min-width: 0; }

/* Setup: same content, less air. */
.home { gap: 16px clamp(24px, 4vw, 48px); }
.hero > .kicker { margin-bottom: 10px; }
.hero h1 { font-size: clamp(38px, 5.4vw, 78px); }
.hero .intro { margin-top: 14px; font-size: clamp(16px, 1.5vw, 20px); }
.steps { gap: 10px; }
.steps li { padding: 10px 12px 12px; }
.steps .verb { font-size: 19px; margin-bottom: 4px; }
.steps p { font-size: 13.5px; }
.lineup { padding: 14px 18px; }
.lineup h2, .section-title { font-size: 24px; }
.lineup-head { margin-bottom: 10px; }
.player-row { margin-bottom: 6px; }
.player-row input { padding: 8px 10px; font-size: 17px; }
.target-head { margin: 14px 0 8px; }
.tiles { gap: 6px; }
.tile { aspect-ratio: auto; height: 46px; font-size: 22px; }
.lineup .start { margin-top: 14px; }

/* Phones and narrow screens. */
@media (max-width: 900px) {
  .round { grid-template-columns: minmax(0, 1fr); }
  .frame img { max-height: 36vh; max-height: 36dvh; }
  .wall { padding-bottom: 14px; }
  /* Keep the main buttons in reach at the bottom of the screen. */
  .desk .actions {
    position: sticky; bottom: 0; z-index: 3;
    margin: 12px -18px -14px; padding: 10px 18px 12px;
    background: var(--paper); border-top: 3px solid var(--ink);
  }
}
@media (max-width: 520px) {
  .logo span { font-size: 19px; }
  .hero h1 { font-size: 40px; }
  .score { flex: 1 0 128px; }
  .round-badge { flex: 0 0 auto; grid-auto-flow: row; gap: 0; }
  .frame { transform: none; }
  .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tile { font-size: 18px; height: 42px; }
  .steps p { font-size: 13px; }
}
.guessers { grid-template-columns: minmax(0, 1fr); }
.check { min-width: 0; }
@media (max-width: 520px) {
  .frame img { max-height: 31vh; max-height: 31dvh; }
  .check .gain { font-size: 9.5px; letter-spacing: 0; }
}
@media (max-width: 380px) {
  .topbar { gap: 8px; }
  .logo span { font-size: 17px; padding: 4px 7px 5px; }
  .top-actions { gap: 6px; }
  .top-actions .chip-btn { padding: 7px 8px; font-size: 10px; letter-spacing: .08em; }
}

/* Setup name boxes: a sliding label sits over the input whenever it isn't being typed in. */
.name-cell { position: relative; display: block; min-width: 0; }
.name-show {
  position: absolute; inset: 0; display: flex; align-items: center; padding: 0 10px;
  background: #fff; pointer-events: none;
  font: 700 17px/1.2 var(--display); letter-spacing: -0.01em; color: var(--ink);
}
.name-show .mq { width: 100%; }
.name-cell:focus-within .name-show, .name-cell.empty .name-show { display: none; }
