/* Savage Jeopardy: host screen (big shared screen). Phone styles live in buzz.css. */
:root {
  --green: #44d62c;
  --gold: #f5b82e;
  --blue-1: #2338c8;
  --blue-2: #0a1a8c;
  --blue-3: #060f5e;
  --ink: #07070c;
  --panel: #12121c;
  --line: #2a2a3a;
  --text: #f4f5fa;
  --muted: #a3a6b8;
  --red: #ff5a5a;
  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 50% -10%, #17331a 0%, transparent 60%), var(--ink);
  color: var(--text);
  min-height: 100vh;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
kbd {
  display: inline-block;
  font: 700 0.72em/1 var(--font);
  padding: 0.25em 0.45em;
  border-radius: 4px;
  border: 1px solid currentColor;
  opacity: 0.75;
  vertical-align: 0.1em;
}
.muted { color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  border: 0; border-radius: 10px;
  padding: 0.7em 1.2em;
  font-weight: 800; letter-spacing: 0.02em;
  color: #061a02; background: var(--green);
  transition: transform 0.08s ease, filter 0.15s ease;
}
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.big { font-size: 1.15rem; padding: 0.85em 1.6em; }
.btn.small { font-size: 0.85rem; padding: 0.5em 0.9em; }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 2px var(--line); }
.btn.ghost:hover:not(:disabled) { box-shadow: inset 0 0 0 2px var(--muted); }
.btn.gold { background: var(--gold); color: #1d1300; }
.btn.ok { background: var(--green); color: #061a02; }
.btn.no { background: var(--red); color: #2a0000; }
.btn kbd { opacity: 0.6; }
.icon-btn {
  width: 2.2em; height: 2.2em; border-radius: 8px; border: 0;
  background: #1c1c2a; color: var(--text); font-size: 1.1rem;
}
.icon-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.6rem 1.2rem;
  border-bottom: 1px solid #1d2b1d;
}
.brand { display: flex; align-items: center; gap: 0.6rem; }
.brand img { width: 40px; height: 40px; }
.brand h1 { margin: 0; font-size: 1.35rem; font-weight: 900; letter-spacing: 0.01em; text-transform: uppercase; }
.brand h1 span { color: var(--gold); }
.joinline { margin: 0 auto; font-size: 1rem; font-weight: 600; color: var(--muted); text-align: center; }
.joinline b { color: var(--text); }
.joinline .code { color: var(--green); font-weight: 900; letter-spacing: 0.15em; font-size: 1.25em; }
.tools { display: flex; gap: 0.5rem; margin-left: auto; }
.tool {
  border: 1px solid var(--line); background: #11111a; color: var(--text);
  border-radius: 8px; padding: 0.45em 0.85em; font-weight: 600; font-size: 0.9rem;
}
.tool:hover { border-color: var(--muted); }
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 48;
  background: #161622; border: 1px solid var(--line); border-radius: 10px;
  min-width: 280px; padding: 6px; box-shadow: 0 16px 40px rgba(0,0,0,0.5);
}
.menu button {
  display: block; width: 100%; text-align: left; border: 0; background: transparent; color: var(--text);
  padding: 0.65em 0.8em; border-radius: 6px; font-weight: 600;
}
.menu button:hover { background: #22223a; }

.loading { display: grid; place-items: center; min-height: 60vh; color: var(--muted); font-weight: 600; text-align: center; padding: 1rem; }

/* ---------- setup ---------- */
.setup {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.5rem;
  max-width: 1200px; margin: 0 auto; padding: 1.5rem;
}
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 1.5rem; }
.panel h2 { margin: 0 0 1.2rem; font-size: 1.3rem; font-weight: 900; text-transform: uppercase; }
.field { display: block; margin-bottom: 1.3rem; }
.field > span { display: block; font-weight: 800; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 0.5rem; }
select, input[type=text], input[type=number] {
  width: 100%; padding: 0.7em 0.8em; border-radius: 10px;
  border: 1px solid var(--line); background: #0b0b12; color: var(--text); font-weight: 600;
}
select:focus, input:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: transparent; }
.team-list { list-style: none; margin: 0 0 0.7rem; padding: 0; display: grid; gap: 0.6rem; }
.team-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 0.6rem; align-items: center;
  padding: 0.5rem; border-radius: 12px; background: #0d0d16; border-left: 6px solid var(--c);
}
.team-row .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c); }
.swatches { display: flex; gap: 4px; flex-wrap: wrap; max-width: 210px; }
.sw { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; background: var(--s); padding: 0; }
.sw.on { border-color: #fff; box-shadow: 0 0 0 2px #000 inset; }
.switch { display: flex; align-items: center; gap: 0.8rem; margin: 0.5rem 0 1.4rem; cursor: pointer; font-weight: 700; }
.switch small { display: block; font-weight: 500; color: var(--muted); margin-top: 2px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { flex: none; width: 48px; height: 28px; border-radius: 99px; background: #333; position: relative; transition: background 0.2s; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 2px solid var(--gold); outline-offset: 2px; }
.form-error { color: var(--red); font-weight: 700; margin: 0 0 1rem; }

.join-panel { text-align: center; border-color: #2a4a2a; box-shadow: 0 0 40px rgba(68,214,44,0.08); }
.join-big { margin: 0.3rem 0; font-size: 1.15rem; font-weight: 600; color: var(--muted); }
.join-big b { color: var(--text); word-break: break-all; }
.room-code {
  margin: 0.4rem 0 1.4rem; font-size: clamp(3.5rem, 9vw, 6.5rem); font-weight: 900; letter-spacing: 0.18em;
  color: var(--green); text-shadow: 0 0 30px rgba(68,214,44,0.35);
}
.player-list { text-align: left; display: grid; gap: 0.6rem; }
.pl-team h3 { margin: 0 0 0.2rem; font-size: 0.95rem; font-weight: 800; color: var(--c); }
.pl-team h3 small { color: var(--muted); font-weight: 600; margin-left: 0.3em; }
.pl-team p { margin: 0; color: var(--text); font-weight: 500; }
.pl-names { list-style: none; margin: 0.15rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.pl-names li {
  display: inline-flex; align-items: center; gap: 0.2rem; padding: 0.15rem 0.2rem 0.15rem 0.6rem;
  border-radius: 999px; background: #1c1c28; box-shadow: inset 0 0 0 1px #2c2c3e; font-weight: 600; font-size: 0.92rem;
  max-width: 100%; overflow-wrap: anywhere;
}
.pl-kick {
  flex: none; width: 1.6rem; height: 1.6rem; border: 0; border-radius: 50%; background: transparent;
  color: var(--muted); font-size: 1.05rem; line-height: 1; cursor: pointer;
}
.pl-kick:hover, .pl-kick:focus-visible { background: var(--red); color: #fff; outline: none; }
#playersBody { margin: 0.8rem 0 1rem; max-height: 55vh; overflow: auto; }

/* ---------- game layout ---------- */
body.host { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.game { flex: 1; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto auto; gap: 0.6rem; padding: 0.7rem 1rem 0.8rem; }
.stage {
  min-height: 0; padding: 10px; border-radius: 16px;
  background: linear-gradient(#15151f, #0a0a10);
  box-shadow: inset 0 0 0 1px #262636, 0 20px 50px rgba(0,0,0,0.5);
}
.board-wrap {
  position: relative; height: 100%; min-height: 260px; overflow: hidden;
  container-type: size;
  border-radius: 8px; padding: 5px; background: #000;
  box-shadow: 0 0 0 2px var(--green), 0 0 22px rgba(68,214,44,0.45);
}

/* ---------- board ---------- */
.board {
  display: grid; height: 100%; gap: 5px;
  grid-template-columns: repeat(var(--cols, 6), minmax(0, 1fr));
  grid-template-rows: 1.15fr repeat(var(--rows, 5), 1fr);
}
.cat, .tile {
  background: linear-gradient(170deg, var(--blue-1) 0%, var(--blue-2) 55%, var(--blue-3) 100%);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.55), inset 0 0 24px rgba(0,0,0,0.55);
  display: grid; place-items: center; text-align: center; min-width: 0; min-height: 0;
}
.cat { padding: 0.3em; border-bottom: 3px solid #000; }
.cat span {
  font-weight: 900; text-transform: uppercase; color: #fff; line-height: 1.05; letter-spacing: -0.01em;
  font-size: min(calc(100cqh / (var(--rows) + 1.15) * 0.25), calc(100cqw / var(--cols) * 0.095));
  text-shadow: 2px 2px 0 #000;
  overflow-wrap: anywhere;
}
.tile { border: 0; padding: 0; color: var(--gold); }
.tile span {
  font-weight: 900; letter-spacing: -0.01em;
  font-size: min(calc(100cqh / (var(--rows) + 1.15) * 0.5), calc(100cqw / var(--cols) * 0.26));
  text-shadow: 3px 3px 0 #000, 0 0 12px rgba(0,0,0,0.6);
}
button.tile:hover { filter: brightness(1.25); }
button.tile:focus-visible { outline: 3px solid var(--green); outline-offset: -3px; }
.tile.used, .tile.none { background: linear-gradient(170deg, #0f1d8a, #061060); }
.tile.none { opacity: 0.4; }

/* ---------- clue card (fills the board) ---------- */
.card {
  position: absolute; inset: 5px; z-index: 5;
  display: flex; flex-direction: column; gap: 1.2cqh;
  padding: 2.4cqh 3cqw;
  background: linear-gradient(170deg, var(--blue-1) 0%, var(--blue-2) 50%, var(--blue-3) 100%);
  box-shadow: inset 0 0 0 3px rgba(0,0,0,0.5), inset 0 0 80px rgba(0,0,0,0.5);
  border-radius: 4px; overflow: auto;
}
.card-head {
  display: flex; justify-content: space-between; gap: 1rem;
  font-weight: 900; text-transform: uppercase; font-size: max(14px, 2.2cqw); text-shadow: 2px 2px 0 #000;
}
.card-head .val { color: var(--gold); white-space: nowrap; }
.clue-body { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2cqh; text-align: center; }
.clue-text {
  margin: 0; max-width: 92%; color: #fff; text-transform: uppercase; font-weight: 800; line-height: 1.18;
  text-shadow: 3px 3px 0 #000; letter-spacing: 0.01em;
}
.clue-text.l { font-size: min(5cqw, 9cqh); }
.clue-text.m { font-size: min(4.1cqw, 7.5cqh); }
.clue-text.s { font-size: min(3.3cqw, 6cqh); }
.clue-text.xs { font-size: min(2.7cqw, 5cqh); }
.with-answer .clue-text { font-size: min(2.8cqw, 5cqh); opacity: 0.85; }
.with-answer.compact .clue-text { font-size: min(2.2cqw, 4cqh); }
.answer-box { width: min(92%, 1100px); display: grid; gap: 1.4cqh; animation: pop 0.35s ease; }
.answer {
  margin: 0; color: var(--gold); font-weight: 900; text-transform: uppercase;
  font-size: min(4.2cqw, 7cqh); text-shadow: 3px 3px 0 #000; line-height: 1.1;
}
.learn {
  text-align: left; padding: 1.4cqh 2cqw; border-radius: 12px;
  background: rgba(6, 20, 4, 0.82); border: 2px solid var(--green); box-shadow: 0 0 26px rgba(68,214,44,0.35);
}
.learn b { display: block; color: var(--green); text-transform: uppercase; letter-spacing: 0.08em; font-size: max(12px, 1.5cqw); margin-bottom: 0.3em; }
.learn p { margin: 0; font-weight: 600; font-size: max(15px, min(2.2cqw, 4cqh)); line-height: 1.35; }

.buzz-panel { display: flex; align-items: center; justify-content: center; gap: 1.2rem; flex-wrap: wrap; min-height: 4cqh; }
.answering {
  display: grid; justify-items: center; padding: 0.8cqh 2.5cqw; border-radius: 14px;
  background: rgba(0,0,0,0.45); border: 3px solid var(--c); box-shadow: 0 0 30px var(--c);
  animation: pop 0.3s ease;
}
.answering b { font-size: max(20px, min(3.6cqw, 6cqh)); font-weight: 900; text-transform: uppercase; color: var(--c); text-shadow: 2px 2px 0 #000; }
.answering small { font-weight: 700; font-size: max(12px, 1.4cqw); text-transform: uppercase; letter-spacing: 0.06em; }
.answering.ok { border-color: var(--green); }
.status { font-weight: 800; font-size: max(14px, 1.7cqw); text-transform: uppercase; letter-spacing: 0.05em; color: #cfd6ff; }
.status.live { color: var(--green); animation: pulse 1.2s ease infinite; }
.queue { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.6rem; counter-reset: q 1; flex-wrap: wrap; }
.queue li {
  counter-increment: q; padding: 0.4em 0.8em; border-radius: 99px; background: rgba(0,0,0,0.4); border: 2px solid var(--c);
  font-size: max(12px, 1.3cqw);
}
.queue li::before { content: '#' counter(q) ' '; font-weight: 900; color: var(--gold); }
.queue li span { color: var(--muted); }
.wrong-line { margin: 0; font-weight: 800; color: #ffb3b3; font-size: max(13px, 1.5cqw); }

.timer { position: relative; height: max(14px, 2.4cqh); border-radius: 99px; background: rgba(0,0,0,0.5); overflow: hidden; flex: none; }
.timer i { position: absolute; inset: 0; background: linear-gradient(90deg, var(--green), #b6f5a9); transform-origin: left; }
.timer.low i { background: linear-gradient(90deg, var(--red), var(--gold)); }
.timer span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: max(11px, 1.6cqh); color: #000; mix-blend-mode: normal; text-shadow: 0 0 4px rgba(255,255,255,0.7); }

/* Daily Double */
.dd-splash { flex: 1; display: grid; place-items: center; align-content: center; gap: 1.5cqh; text-align: center; }
.dd-title {
  margin: 0; font-weight: 900; text-transform: uppercase; line-height: 0.92; font-size: min(11cqw, 19cqh);
  color: var(--gold); text-shadow: 5px 5px 0 #000, 0 0 40px rgba(245,184,46,0.5);
  animation: ddIn 0.9s cubic-bezier(.2,1.4,.4,1) both;
}
.dd-cat { margin: 0; font-weight: 800; text-transform: uppercase; font-size: max(14px, 2cqw); }
.dd-form { display: grid; gap: 1.4cqh; justify-items: center; animation: fadeUp 0.5s 0.6s both; }
.dd-form p { margin: 0; font-weight: 700; }
.pick { display: flex; gap: 0.6rem; flex-wrap: wrap; justify-content: center; }
.pick-btn {
  border: 2px solid var(--c); background: rgba(0,0,0,0.4); color: #fff; border-radius: 12px;
  padding: 0.55em 0.9em; font-weight: 800; display: inline-flex; gap: 0.5em; align-items: center;
}
.pick-btn small { color: var(--gold); }
.pick-btn.on { background: var(--c); color: #000; box-shadow: 0 0 22px var(--c); }
.pick-btn.on small { color: #000; }
.wager { display: grid; gap: 0.4rem; font-weight: 800; text-transform: uppercase; }
.wager small { text-transform: none; color: #cfd6ff; font-weight: 600; }
.wager input { width: 220px; font-size: 1.6rem; text-align: center; font-weight: 900; }

/* Final Jeopardy */
.final-cat { flex: 1; display: grid; place-items: center; align-content: center; text-align: center; gap: 1cqh; }
.final-cat h2 { margin: 0; font-size: min(6cqw, 11cqh); font-weight: 900; text-transform: uppercase; text-shadow: 4px 4px 0 #000; }
.eyebrow { margin: 0; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; color: var(--gold); }
.muted-l { margin: 0; color: #cfd6ff; font-weight: 600; }
.final-teams, .final-marks { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.8rem; }
.ft, .fm { background: rgba(0,0,0,0.45); border-top: 5px solid var(--c); border-radius: 10px; padding: 0.7rem; display: grid; gap: 0.35rem; }
.ft b, .fm b { color: var(--c); text-transform: uppercase; font-weight: 900; }
.ft em { font-style: normal; font-weight: 700; font-size: 0.85rem; color: #ffcf7a; }
.ft em.in { color: var(--green); }
.ft-entry { display: flex; gap: 0.4rem; }
.ft-entry input { padding: 0.45em 0.6em; }
.final-status { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; }
.final-status span { padding: 0.35em 0.8em; border-radius: 99px; border: 2px solid var(--c); background: rgba(0,0,0,0.4); font-weight: 700; }
.final-status span.in { background: var(--c); color: #000; }
.fm p { margin: 0; font-weight: 600; }
.fm-ans { font-size: 1.05rem; }
.fm-ans small { color: var(--muted); }
.fm-btns { display: flex; gap: 0.4rem; }
.mark { flex: 1; border: 2px solid; border-radius: 8px; padding: 0.45em; font-weight: 800; background: transparent; }
.mark.ok { border-color: var(--green); color: var(--green); }
.mark.no { border-color: var(--red); color: var(--red); }
.mark.ok.on { background: var(--green); color: #000; }
.mark.no.on { background: var(--red); color: #000; }

/* Round intro and winner */
.card.intro, .card.done { justify-content: center; align-items: center; text-align: center; }
.intro img { width: 12cqh; height: 12cqh; }
.intro h2 { margin: 1cqh 0; font-size: min(9cqw, 16cqh); font-weight: 900; text-transform: uppercase; color: var(--gold); text-shadow: 5px 5px 0 #000; animation: ddIn 0.8s cubic-bezier(.2,1.4,.4,1) both; }
.intro p { margin: 0; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; }
.winner { display: grid; justify-items: center; gap: 1.6cqh; }
.winner img { width: 14cqh; height: 14cqh; }
.winner h2 { margin: 0; font-size: min(6.5cqw, 11cqh); font-weight: 900; text-transform: uppercase; color: var(--c); text-shadow: 4px 4px 0 #000; animation: ddIn 0.8s both; }
.standings { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; min-width: min(560px, 80cqw); }
.standings li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6em 1em; border-radius: 10px; background: rgba(0,0,0,0.45); border-left: 6px solid var(--c); font-size: max(15px, 2cqw); font-weight: 800; }
.standings li:first-child { box-shadow: 0 0 24px var(--c); }
.standings .neg { color: var(--red); }

/* ---------- controls and scoreboard ---------- */
.controls { display: flex; justify-content: space-between; align-items: center; gap: 0.7rem; flex-wrap: wrap; min-height: 48px; }
.c-left, .c-right { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.hint { margin: 0; color: var(--muted); font-weight: 600; }
.hint b { color: var(--text); }
.scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.6rem; }
.chip {
  position: relative; display: flex; align-items: stretch; gap: 0.5rem;
  background: linear-gradient(170deg, #141428, #0b0b18); border-radius: 12px; padding: 0.55rem 0.6rem 0.55rem 0.8rem;
  border-top: 5px solid var(--c); box-shadow: inset 0 0 0 1px #24243a; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s;
}
.chip:focus-visible { outline: 2px solid var(--gold); }
.chip.sel { transform: translateY(-3px); box-shadow: inset 0 0 0 2px var(--c), 0 0 26px var(--c); }
.chip.locked { opacity: 0.45; }
.chip > kbd { position: absolute; top: 6px; right: 46px; font-size: 0.65rem; }
.chip-main { flex: 1; min-width: 0; display: grid; }
.chip-name { font-weight: 900; text-transform: uppercase; color: var(--c); font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 1.6rem; }
.chip-score { font-size: 1.9rem; font-weight: 900; color: var(--gold); text-shadow: 2px 2px 0 #000; line-height: 1.1; }
.chip-score.neg { color: var(--red); }
.chip small { color: var(--muted); font-weight: 600; font-size: 0.75rem; }
.badge { position: absolute; top: -12px; left: 10px; font-style: normal; font-weight: 900; font-size: 0.7rem; text-transform: uppercase; padding: 0.2em 0.6em; border-radius: 99px; background: var(--gold); color: #000; }
.badge.lock { background: var(--red); }
.adj { display: grid; gap: 4px; }
.adj button { width: 34px; flex: 1; border: 0; border-radius: 7px; background: #23233a; color: var(--text); font-weight: 900; font-size: 1.05rem; }
.adj button:hover { background: #33335a; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 1rem; background: rgba(0,0,0,0.7); }
.dialog { width: min(720px, 100%); max-height: 90vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--green); border-radius: 16px; padding: 1.6rem; }
.dialog h2 { margin: 0 0 1rem; font-weight: 900; text-transform: uppercase; }
.dialog h3 { margin: 1.2rem 0 0.4rem; font-size: 1rem; text-transform: uppercase; color: var(--gold); }
.dialog ol { padding-left: 1.2rem; line-height: 1.55; margin: 0; }
.dialog li { margin-bottom: 0.35rem; }
.keys { line-height: 2; color: var(--muted); }
.toast {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 50;
  background: #1d1d2c; border: 1px solid var(--gold); color: var(--text); font-weight: 700;
  padding: 0.75em 1.2em; border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,0.5); max-width: 90vw;
}
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 45; width: 100%; height: 100%; }

@keyframes pop { from { transform: scale(0.85); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pulse { 50% { opacity: 0.55; } }
@keyframes ddIn { from { transform: scale(0.2) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeUp { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- small screens (the host screen still works on a laptop or phone) ---------- */
@media (max-width: 860px) {
  .setup { grid-template-columns: 1fr; padding: 1rem; }
  .joinline { order: 3; width: 100%; font-size: 0.9rem; }
  body.host { height: auto; min-height: 100dvh; }
  .game { grid-template-rows: auto auto auto; }
  .stage { height: 62vh; min-height: 300px; padding: 6px; }
}
@media (max-width: 520px) {
  .topbar { padding: 0.5rem 0.75rem; }
  .brand h1 { font-size: 1.05rem; }
  .tool { padding: 0.4em 0.6em; font-size: 0.8rem; }
  .team-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .team-row .swatches { grid-column: 1 / -1; grid-row: 2; max-width: none; }
  .panel { padding: 1.1rem; }
  .scores { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chip-score { font-size: 1.4rem; }
}

/* 404 page */
.page { max-width: 560px; margin: 15vh auto; padding: 1rem; text-align: center; }
.page a { color: var(--green); font-weight: 700; }

/* Players dialog reuses the setup list styles. */
.dialog .pl-team h3 { margin: 0 0 0.2rem; font-size: 0.95rem; text-transform: none; color: var(--c); }
.dialog .pl-names li { margin: 0; }
