@font-face {
  font-family: 'DM Sans';
  src: url('../fonts/DMSans-Variable.woff') format('woff');
  font-weight: 100 1000;
  font-display: swap;
}

:root {
  --cream: #FAF8F4;
  --paper: #FFFFFF;
  --ink: #2F3437;
  --muted: #646B70;
  --line: #E6E1D8;
  --sage: #8FA68A;
  --sage-d: #4E6A48;
  --sage-l: #EDF2EB;
  --terra: #D08C6A;
  --terra-d: #B8714F;
  --terra-l: #FBEEE6;
  --red: #C8423B;
  --ok: #3E7B4F;
  --warn: #B7791F;
  --radius: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cream: #15191A; --paper: #1E2426; --ink: #ECEDEA; --muted: #A9B0AC; --line: #313A3D;
    --sage-d: #A8C7A1; --sage-l: #22302A; --terra-l: #3A2A22; --ok: #7DC394; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--cream);
  color: var(--ink);
  font: 16px/1.5 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--sage-d); }
button { font: inherit; color: inherit; }
h1 { font-size: 30px; line-height: 1.15; margin: 8px 0 12px; letter-spacing: -0.01em; }
h2 { font-size: 20px; margin: 28px 0 8px; }
h2 small { font-weight: 500; color: var(--muted); font-size: 14px; }
kbd { font: 700 12px/1 'DM Sans', sans-serif; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 2px 5px; background: var(--paper); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* Buttons and small parts */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 18px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--paper); color: var(--ink);
  font-weight: 700; text-decoration: none; cursor: pointer; text-align: center;
  transition: transform .08s ease, background .15s;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--sage-d); border-color: var(--sage-d); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #13201A; } }
.btn.big { min-height: 56px; font-size: 18px; width: 100%; }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: 14px; border-radius: 11px; }
.btn.warn { color: var(--red); }
.btn.on { background: var(--sage-l); border-color: var(--sage); }
.btn.strike { background: var(--red); border-color: var(--red); color: #fff; font-size: 22px; }
.btn.file { cursor: pointer; }
.link { background: none; border: 0; padding: 0; color: var(--sage-d); text-decoration: underline; cursor: pointer; font-weight: 600; }
.chip {
  border: 1.5px solid var(--line); background: var(--paper); border-radius: 999px; padding: 8px 14px;
  font-weight: 700; cursor: pointer; min-height: 40px;
}
.chip.on { background: var(--sage-d); border-color: var(--sage-d); color: #fff; }
.chip b { font-weight: 800; opacity: .75; margin-left: 2px; }
.chip em { font-style: normal; font-size: 11px; background: var(--terra); color: #fff; border-radius: 6px; padding: 1px 5px; }
.chip.p1 { border-color: var(--terra); }
.pill { display: inline-block; background: var(--terra); color: #fff; border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 700; }
.hint { color: var(--muted); font-size: 14px; }
.note { background: var(--terra-l); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.err { color: var(--red); font-weight: 600; }
.row { display: flex; flex-wrap: wrap; align-items: center; }
.gap { gap: 10px; margin-top: 18px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; font-size: 15px; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--sage-d); }

/* Logo lockup */
.logo { display: flex; flex-direction: column; align-items: center; line-height: .9; font-weight: 900; text-transform: uppercase; }
.logo .l1 { letter-spacing: .38em; font-size: 46px; color: var(--acc, #E8B44C); margin-right: -.38em; }
.logo .l2 {
  font-size: 150px; letter-spacing: -0.02em;
  background: linear-gradient(180deg, #FFFFFF 10%, #FFE8A8 60%, #E8B44C 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 0 rgba(0,0,0,.25));
}
.logo.small .l1 { font-size: 15px; color: var(--terra-d); }
.logo.small .l2 { font-size: 46px; background: none; color: var(--ink); filter: none; }

/* Pages */
.page { max-width: 860px; margin: 0 auto; padding: 18px 16px 60px; }
.page.narrow { max-width: 560px; }
.back { display: inline-block; margin: 4px 0 6px; text-decoration: none; font-weight: 700; }
.lead { font-size: 18px; color: var(--muted); }
.steps li { margin: 6px 0; }

.home { max-width: 760px; margin: 0 auto; padding: 28px 16px 40px; }
.home-top { text-align: center; margin-bottom: 22px; }
.home-top p { color: var(--muted); font-size: 18px; margin: 8px 0 0; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.choice {
  display: grid; grid-template-columns: 48px 1fr; column-gap: 12px; align-items: start;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 20px; padding: 18px;
  color: var(--ink); text-decoration: none; transition: transform .1s, border-color .15s;
}
.choice:hover { border-color: var(--sage); transform: translateY(-2px); }
.choice .ic { grid-row: span 2; font-size: 34px; line-height: 1; }
.choice b { font-size: 19px; }
.choice span:last-child { color: var(--muted); font-size: 14.5px; }
.resume { display: block; background: var(--sage-l); border: 1.5px solid var(--sage); border-radius: 16px; padding: 14px 16px; margin-bottom: 14px; font-weight: 700; text-decoration: none; color: var(--ink); }
.home-links { display: flex; gap: 22px; justify-content: center; margin: 24px 0 8px; font-weight: 700; }
.demo-cta { margin-top: 22px; background: var(--terra-l); border-radius: 18px; padding: 18px; display: grid; gap: 10px; }
.home-foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 30px; }
@media (max-width: 640px) { .choices { grid-template-columns: 1fr; } .logo.small .l2 { font-size: 40px; } }

.join { display: grid; gap: 12px; margin: 16px 0 6px; }
.join input {
  font: 900 44px/1 'DM Sans', sans-serif; letter-spacing: .25em; text-align: center; text-transform: uppercase;
  padding: 14px; border-radius: 16px; border: 2px solid var(--line); background: var(--paper); color: var(--ink); width: 100%;
}
.join input:focus { outline: none; border-color: var(--sage); }

/* Setup form */
.setup h2 { margin-top: 4px; }
.setup fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.setup legend { font-weight: 800; margin-bottom: 8px; font-size: 15px; }
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.pack {
  display: grid; grid-template-columns: 24px 1fr; column-gap: 8px; align-items: center;
  border: 1.5px solid var(--line); background: var(--paper); border-radius: 14px; padding: 12px; cursor: pointer;
}
.pack input { width: 20px; height: 20px; accent-color: var(--sage-d); }
.pack:has(input:checked) { border-color: var(--sage-d); background: var(--sage-l); }
.pack .pk-name { font-weight: 800; }
.pack .pk-name em { font-style: normal; font-size: 12px; background: var(--terra); color: #fff; border-radius: 6px; padding: 1px 6px; }
.pack .pk-n { grid-column: 2; color: var(--muted); font-size: 13px; }
.pack.off, .pack.locked { opacity: .55; cursor: default; }
.pack.locked { grid-template-columns: 1fr; border-style: dashed; }
.pack.locked .pk-n { grid-column: 1; }
.pack.locked .pk-name::before { content: '🔒 '; }
.teams { display: grid !important; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.teams legend { grid-column: 1 / -1; }
.teams input, .h-field input, .field textarea, .field input, .title-edit input {
  width: 100%; font: 700 17px/1.3 'DM Sans', sans-serif; padding: 12px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--paper); color: var(--ink);
}
.teams .vs { font-weight: 800; color: var(--muted); }
@media (max-width: 480px) { .teams { grid-template-columns: 1fr; } .teams .vs { display: none; } }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; min-width: 46px; min-height: 42px; align-items: center; justify-content: center; padding: 6px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); font-weight: 800; }
.seg input:checked + span { background: var(--sage-d); border-color: var(--sage-d); color: #fff; }
.seg input:disabled + span { opacity: .4; }
.seg input:focus-visible + span { outline: 3px solid var(--terra); }

/* Host (phone) */
.pg-host body, body.pg-host { background: var(--cream); }
.host { max-width: 640px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.h-top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--cream); border-bottom: 1px solid var(--line);
}
.h-back { font-size: 30px; line-height: 1; text-decoration: none; color: var(--ink); padding: 0 6px; }
.h-conn { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 14px; flex: 1; }
.h-conn i { width: 10px; height: 10px; border-radius: 50%; background: var(--warn); }
.h-conn.ok i { background: #2E9E5B; box-shadow: 0 0 0 4px rgba(46,158,91,.18); }
.h-conn.off i { background: var(--red); }
.h-code { font-weight: 900; letter-spacing: .12em; background: var(--paper); border: 1.5px solid var(--line); border-radius: 10px; padding: 4px 8px; font-size: 14px; }
.h-menu-btn { background: none; border: 0; font-size: 26px; line-height: 1; padding: 4px 8px; cursor: pointer; }
.h-main { flex: 1; padding: 12px 14px 100px; overflow-y: auto; }
.h-bar {
  position: sticky; bottom: 0; display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--cream); border-top: 1px solid var(--line);
}
.h-bar:empty { display: none; }
.h-bar .btn { flex: 1; }
.h-bar .btn.strike { flex: 1.3; }
.h-sec { display: grid; gap: 12px; }
.h-scoreline { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.h-scoreline span { background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 12px; font-weight: 700; display: flex; justify-content: space-between; gap: 8px; overflow: hidden; }
.h-scoreline span.on { border-color: var(--sage-d); background: var(--sage-l); }
.h-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; color: var(--muted); font-weight: 600; }
.h-meta b { color: var(--ink); }
.h-meta .hot { color: #fff; background: var(--terra); border-radius: 8px; padding: 0 8px; }
.h-meta .code { margin-left: auto; font-weight: 800; }
.h-q { font-size: 22px; line-height: 1.25; margin: 0; }
.h-row { display: flex; flex-wrap: wrap; gap: 8px; }
.h-help { background: var(--sage-l); border-radius: 12px; padding: 10px 12px; margin: 0; font-size: 14.5px; }
.h-note { margin: 0; color: var(--muted); }
.h-field { display: grid; gap: 4px; font-weight: 700; font-size: 14px; }
.h-answers { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.h-ans { display: flex; gap: 6px; align-items: stretch; }
.h-ans-main {
  flex: 1; display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; text-align: left;
  min-height: 58px; padding: 8px 12px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--paper); cursor: pointer;
}
.h-ans-main .n { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: var(--cream); display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.h-ans-main .t { font-weight: 800; font-size: 17px; line-height: 1.2; }
.h-ans-main .t small { display: block; font-weight: 500; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.h-ans-main .p { font-size: 20px; font-weight: 900; color: var(--terra-d); }
.h-ans.open .h-ans-main { background: var(--sage-l); border-color: var(--sage); opacity: .9; }
.h-ans.open .n { background: var(--sage-d); }
.h-ans.late .h-ans-main { opacity: .55; }
.h-ans-main:disabled { cursor: default; color: inherit; }
.h-hide { border: 1.5px solid var(--line); background: var(--paper); border-radius: 12px; padding: 0 10px; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--muted); }
.h-control { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; }
.h-strikerow { display: flex; align-items: center; gap: 14px; }
.h-strikerow .btn.strike { flex: 1; min-height: 60px; }
.h-strikerow .btn.strike span { font-size: 17px; }
.h-dots i { font-style: normal; font-weight: 900; font-size: 22px; color: var(--line); margin: 0 2px; }
.h-dots i.on { color: var(--red); }
.h-move { font-size: 14px; color: var(--muted); }
.h-done { display: grid; gap: 10px; }
.h-timer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.h-timer b { font-size: 44px; font-weight: 900; min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }
.h-lq { background: var(--paper); border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px; display: grid; gap: 8px; }
.h-lq-top { display: flex; gap: 8px; align-items: baseline; }
.h-lq-top .code { font-weight: 800; color: var(--muted); font-size: 12px; }
.h-lq-top .q { font-weight: 800; flex: 1; }
.h-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.h-chips .chip { padding: 6px 10px; min-height: 36px; font-size: 14px; }
.h-chips .chip.none { border-style: dashed; }
.h-lq-bot { display: flex; gap: 8px; align-items: center; }
.h-lq-bot input { flex: 1; min-width: 0; padding: 9px 10px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--cream); color: var(--ink); font: 600 15px 'DM Sans', sans-serif; }

.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(20,24,25,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet-card { background: var(--cream); width: 100%; max-width: 560px; border-radius: 22px 22px 0 0; padding: 18px 16px calc(22px + env(safe-area-inset-bottom)); display: grid; gap: 10px; position: relative; }
.sheet-card h3 { margin: 0 0 4px; }
.sheet-x { position: absolute; right: 12px; top: 8px; border: 0; background: none; font-size: 30px; cursor: pointer; }
.fix { display: grid; gap: 8px; }
.fix > div { display: flex; gap: 8px; align-items: center; }
.fix span { flex: 1; font-weight: 700; }

#toast {
  position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); opacity: 0; z-index: 50;
  background: var(--ink); color: var(--cream); padding: 10px 16px; border-radius: 12px; font-weight: 700;
  transition: opacity .2s, transform .2s; pointer-events: none; max-width: 90vw;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.update { position: fixed; left: 50%; top: 10px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--cream); padding: 8px 10px 8px 16px; border-radius: 12px; font-weight: 600; display: flex; gap: 10px; align-items: center; }
.update button { background: var(--sage); border: 0; border-radius: 8px; padding: 6px 12px; font-weight: 800; cursor: pointer; color: #13201A; }

/* Editor */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.card { display: grid; gap: 4px; background: var(--paper); border: 1.5px solid var(--line); border-radius: 16px; padding: 16px; text-decoration: none; color: var(--ink); text-align: left; cursor: pointer; }
.card span { color: var(--muted); font-size: 14px; }
.card.add { border-style: dashed; }
.title-edit input { font-size: 26px; font-weight: 800; margin: 6px 0 12px; }
.qlist { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.qlist li { display: flex; gap: 10px; align-items: center; background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.qlist li a { flex: 1; text-decoration: none; color: var(--ink); display: grid; }
.qlist .q { font-weight: 700; flex: 1; }
.qlist .m { color: var(--muted); font-size: 13px; }
.qlist li.empty { color: var(--muted); border-style: dashed; }
.qlist.small li { padding: 6px 10px; font-size: 14px; }
.copyfrom { margin: 8px 0; }
.copyfrom summary { cursor: pointer; font-weight: 700; color: var(--sage-d); }
.copyfrom h3 { font-size: 15px; margin: 14px 0 6px; }
.qform { display: grid; gap: 10px; }
.field { display: grid; gap: 6px; font-weight: 800; }
.ahead { display: grid; grid-template-columns: 28px 1fr 78px 36px; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 700; padding: 0 2px; }
.ahead span:first-child { grid-column: 2; }
.answers { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.answers li { display: grid; gap: 4px; }
.arow { display: grid; grid-template-columns: 28px 1fr 78px 36px; gap: 8px; align-items: center; }
.arow .n { font-weight: 800; color: var(--muted); text-align: center; }
.arow input, .aalts { padding: 11px 10px; border-radius: 11px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); font: 700 16px 'DM Sans', sans-serif; width: 100%; }
.arow .apts { text-align: center; font-weight: 900; }
.aalts { margin-left: 36px; width: calc(100% - 80px); font-weight: 500; font-size: 14px; padding: 7px 10px; background: var(--cream); }
.arow .x { border: 0; background: none; font-size: 24px; cursor: pointer; color: var(--muted); }
.arow .x:disabled { opacity: .2; }
.meter { display: grid; gap: 6px; margin-top: 6px; }
.meter .bar { height: 14px; background: var(--line); border-radius: 99px; overflow: hidden; }
.meter .bar i { display: block; height: 100%; width: 0; background: var(--warn); transition: width .2s; }
.meter.ok .bar i { background: #2E9E5B; }
.meter.over .bar i { background: var(--red); }
.meter .txt { font-weight: 800; }
.meter.ok .txt { color: var(--ok); }
.meter.over .txt { color: var(--red); }
.errs { margin: 0; padding-left: 18px; color: var(--red); font-size: 14px; font-weight: 600; }
.help li { margin: 6px 0; }

/* ====== The TV board: a fixed 1920×1080 stage scaled to fit ====== */
.pg-board, .pg-solo { overflow: hidden; }
.tv { position: fixed; inset: 0; background: #000; }
.boardhost { position: absolute; inset: 0; }
.stage-wrap { position: absolute; inset: 0; overflow: hidden; background: #000; }
.stage { position: absolute; left: 50%; top: 50%; width: 1920px; height: 1080px; transform-origin: center center; }

.b {
  position: relative; width: 100%; height: 100%; overflow: hidden; color: #fff;
  font-family: 'DM Sans', system-ui, sans-serif; user-select: none;
  --bg1: #0E3B2C; --bg2: #06231A; --acc: #E8B44C; --acc2: #C8423B; --tile: #FFF8EA; --tileInk: #1B2A22;
  --hid1: #1D6047; --hid2: #0E3A2A; --pts: #C8423B; --ptsInk: #FFFFFF; --dot: rgba(255,255,255,.07);
}
.theme-thanksgiving { --bg1: #5E2C16; --bg2: #2A1209; --acc: #F2AE4A; --acc2: #E06A2C; --tile: #FFF5E6; --tileInk: #3A1F12; --hid1: #844220; --hid2: #4F2411; --pts: #D9622B; --dot: rgba(255,214,160,.07); }
.theme-new-years-eve { --bg1: #1A2456; --bg2: #060A1E; --acc: #EBCB6E; --acc2: #9FB0EA; --tile: #FDFBF4; --tileInk: #141A36; --hid1: #2A3778; --hid2: #141C47; --pts: #141A36; --ptsInk: #EBCB6E; --dot: rgba(235,203,110,.09); }
.theme-family-classic { --bg1: #2E564C; --bg2: #132D27; --acc: #F2C063; --acc2: #D08C6A; --tile: #FAF8F4; --tileInk: #2F3437; --hid1: #3E7064; --hid2: #21453C; --pts: #D08C6A; --dot: rgba(250,248,244,.06); }
.b-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 45% at 50% 0%, rgba(255,255,255,.16), transparent 70%),
    radial-gradient(circle at 20% 80%, rgba(0,0,0,.25), transparent 55%),
    radial-gradient(var(--dot) 2.5px, transparent 3px) 0 0 / 46px 46px,
    linear-gradient(180deg, var(--bg1), var(--bg2));
}
.theme-christmas .b-bg::after, .theme-new-years-eve .b-bg::after, .theme-thanksgiving .b-bg::after, .theme-family-classic .b-bg::after {
  content: ''; position: absolute; inset: 0; opacity: .5;
  background: radial-gradient(rgba(255,255,255,.22) 1.5px, transparent 2px) 23px 23px / 92px 92px;
}
.theme-new-years-eve .b-bg::after { background: radial-gradient(rgba(235,203,110,.35) 2px, transparent 2.5px) 10px 30px / 120px 90px, radial-gradient(rgba(159,176,234,.3) 2px, transparent 2.5px) 60px 0 / 140px 110px; }
.theme-thanksgiving .b-bg::after { background: radial-gradient(rgba(242,174,74,.22) 2px, transparent 2.5px) 20px 20px / 100px 100px; }
.b > *:not(.b-bg) { position: relative; }
.b-brand { position: absolute !important; left: 36px; bottom: 22px; font-size: 20px; font-weight: 800; color: rgba(255,255,255,.55); letter-spacing: .02em; }
.b-brand span { font-weight: 500; }
.b-demo { position: absolute !important; right: -70px; top: 38px; transform: rotate(35deg); background: var(--acc2); color: #fff; font-weight: 900; letter-spacing: .2em; padding: 8px 90px; font-size: 22px; }
.b-fx { position: absolute !important; inset: 0; pointer-events: none; z-index: 10; }

.b-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 34px 56px 0; height: 190px; }
.b-round { font-size: 34px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; display: flex; align-items: center; gap: 16px; }
.b-round small { font-size: 26px; opacity: .7; font-weight: 700; }
.b-code { font-size: 20px; font-weight: 800; letter-spacing: .08em; padding: 4px 10px; border-radius: 8px; background: rgba(0,0,0,.3); color: rgba(255,255,255,.6); }
.b-mult { background: var(--acc2); color: #fff; font-size: 22px; padding: 6px 16px; border-radius: 999px; letter-spacing: .08em; animation: pulse 1.6s ease-in-out infinite; }
.b-bank {
  min-width: 320px; text-align: center; padding: 10px 40px 14px; border-radius: 26px;
  background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.2)); border: 4px solid var(--acc);
  box-shadow: 0 0 40px rgba(0,0,0,.35), inset 0 0 24px rgba(0,0,0,.3);
}
.b-bank small { display: block; font-size: 20px; text-transform: uppercase; letter-spacing: .14em; color: var(--acc); font-weight: 800; }
.b-bank b { display: block; font-size: 96px; line-height: 1; font-weight: 900; font-variant-numeric: tabular-nums; }
.b-strikes { justify-self: end; display: flex; gap: 14px; }
.b-strikes i { font-style: normal; width: 74px; height: 74px; border-radius: 16px; display: grid; place-items: center; font-size: 54px; font-weight: 900; background: rgba(0,0,0,.25); color: rgba(255,255,255,.18); border: 3px solid rgba(255,255,255,.12); }
.b-strikes i.on { background: var(--red, #C8423B); color: #fff; border-color: #fff; box-shadow: 0 0 24px rgba(200,66,59,.7); }

.b-mid { display: grid; grid-template-columns: 268px 1fr 268px; gap: 30px; padding: 0 50px; height: 770px; align-items: center; }
.b-team {
  height: 470px; border-radius: 30px; padding: 26px 18px; text-align: center; display: grid; grid-template-rows: 130px 1fr 60px; align-items: center;
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.04)); border: 3px solid rgba(255,255,255,.15);
  transition: transform .4s, border-color .3s, box-shadow .3s;
}
.b-tname { height: 130px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.b-tname span { font-size: 40px; font-weight: 900; line-height: 1.08; width: 100%; overflow-wrap: anywhere; }
.b-tscore { font-size: 120px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.b-ttag { font-size: 28px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; color: var(--acc); }
.b-team.on { border-color: var(--acc); box-shadow: 0 0 50px rgba(255,210,120,.35); transform: scale(1.04); }
.b-team.steal { border-color: var(--acc2); box-shadow: 0 0 50px rgba(255,120,100,.45); animation: pulse 1.2s ease-in-out infinite; }
.b-team.steal .b-ttag { color: #fff; }
.b-team.won { border-color: var(--acc); background: linear-gradient(180deg, rgba(255,210,120,.28), rgba(255,255,255,.06)); }

.b-board { display: grid; grid-template-rows: 124px 1fr; gap: 22px; height: 100%; padding: 6px 0 0; }
.b-q {
  border-radius: 22px; background: rgba(0,0,0,.28); border: 3px solid rgba(255,255,255,.14);
  display: flex; align-items: center; justify-content: center; padding: 10px 34px; text-align: center; overflow: hidden;
}
.b-q span { font-weight: 800; font-size: 50px; line-height: 1.12; width: 100%; color: rgba(255,255,255,.55); font-style: italic; }
.b-q.show span { color: #fff; font-style: normal; }
.b-grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(4, 1fr); gap: 18px 22px; height: 590px; }
.tile { perspective: 1400px; }
.tile-in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.25, 1.3, .45, 1); }
.tile.open .tile-in { transform: rotateX(-180deg); }
.tile.still .tile-in { transition: none; }
.tile-front, .tile-back { position: absolute; inset: 0; border-radius: 18px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.tile-front {
  display: grid; place-items: center;
  background: linear-gradient(180deg, var(--hid1), var(--hid2)); border: 4px solid var(--acc);
  box-shadow: inset 0 3px 0 rgba(255,255,255,.18), inset 0 -6px 0 rgba(0,0,0,.25), 0 8px 20px rgba(0,0,0,.3);
}
.tile-front .num {
  width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; font-size: 58px; font-weight: 900;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.25), transparent 60%), rgba(0,0,0,.35); color: var(--acc);
  border: 3px solid var(--acc);
}
.tile.empty .tile-front { background: rgba(0,0,0,.22); border-color: rgba(255,255,255,.08); box-shadow: none; }
.tile-back {
  transform: rotateX(180deg); display: grid; grid-template-columns: 1fr 128px; overflow: hidden;
  background: var(--tile); color: var(--tileInk); border: 4px solid var(--acc); box-shadow: 0 10px 26px rgba(0,0,0,.35);
}
.tile-back .ans { display: flex; align-items: center; padding: 0 22px 0 26px; overflow: hidden; }
.tile-back .ans > span { font-size: 54px; font-weight: 900; text-transform: uppercase; letter-spacing: -.01em; line-height: .98; width: 100%; overflow: hidden; overflow-wrap: normal; }
.tile-back .pts { display: grid; place-items: center; background: var(--pts); color: var(--ptsInk); font-size: 70px; font-weight: 900; font-variant-numeric: tabular-nums; }
.tile.late .tile-back { opacity: .72; }
.tile.late .tile-back .pts { background: #8A8F93; color: #fff; }

.b-phase { position: absolute !important; left: 0; right: 0; bottom: 30px; display: flex; justify-content: center; }
.b-phase span { font-size: 32px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; padding: 10px 34px; border-radius: 999px; background: rgba(0,0,0,.35); border: 3px solid rgba(255,255,255,.18); }
.b-phase.ph-steal span { background: var(--acc2); border-color: #fff; animation: pulse 1.2s infinite; }
.b-phase.ph-done span { background: var(--acc); color: #1B1B1B; border-color: #fff; }
.b-phase.ph-faceoff span { border-color: var(--acc); color: var(--acc); }

.bigx { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 30px; }
.bigx i {
  font-style: normal; font-size: 420px; line-height: 1; font-weight: 900; color: #E5362B;
  -webkit-text-stroke: 14px #fff; paint-order: stroke fill; text-shadow: 0 20px 60px rgba(0,0,0,.6);
  animation: xpop 1.3s cubic-bezier(.2, 1.6, .4, 1) both;
}
.bigx i:nth-child(2) { animation-delay: .05s; } .bigx i:nth-child(3) { animation-delay: .1s; }
@keyframes xpop { 0% { transform: scale(.2) rotate(-20deg); opacity: 0; } 18% { transform: scale(1.1); opacity: 1; } 30% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(.95); } }
@keyframes pulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.25); } }

.b-center { position: absolute !important; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 26px; }
.b-title .logo .l1 { font-size: 58px; }
.b-title .logo .l2 { font-size: 210px; }
.b-packs { font-size: 34px; font-weight: 800; color: var(--acc); text-transform: uppercase; letter-spacing: .12em; }
.b-vs { display: flex; align-items: center; gap: 40px; font-size: 62px; font-weight: 900; margin-top: 10px; }
.b-vs span { padding: 16px 38px; border-radius: 24px; background: rgba(255,255,255,.12); border: 3px solid rgba(255,255,255,.2); max-width: 760px; }
.b-vs i { font-style: normal; color: var(--acc); font-size: 48px; text-transform: uppercase; }
.b-sub { font-size: 34px; opacity: .8; font-weight: 600; }
.b-h1 { font-size: 110px; font-weight: 900; line-height: 1; }
.b-scores { display: flex; gap: 70px; margin: 20px 0; }
.b-final .b-scores { margin-top: 70px; }
.b-score { position: relative; width: 640px; padding: 40px 30px; border-radius: 34px; background: rgba(255,255,255,.1); border: 4px solid rgba(255,255,255,.2); }
.b-score .n { font-size: 54px; font-weight: 900; line-height: 1.1; }
.b-score .s { font-size: 170px; font-weight: 900; line-height: 1; margin-top: 12px; font-variant-numeric: tabular-nums; }
.b-score.win { border-color: var(--acc); background: linear-gradient(180deg, rgba(255,210,120,.3), rgba(255,255,255,.08)); box-shadow: 0 0 80px rgba(255,210,120,.35); }
.b-score .crown { position: absolute; top: -104px; left: 50%; transform: translateX(-50%); font-size: 110px; color: var(--acc); text-shadow: 0 6px 20px rgba(0,0,0,.4); }

/* Lightning Round */
.ltop { grid-template-columns: 1fr auto 1fr; height: 230px; }
.b-goal { justify-self: end; font-size: 34px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.b-goal b { color: var(--acc); font-size: 60px; }
.b-timer { position: relative; width: 190px; height: 190px; }
.b-timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.b-timer circle { fill: rgba(0,0,0,.35); stroke-width: 9; }
.b-timer .trk { stroke: rgba(255,255,255,.15); }
.b-timer .arc { fill: none; stroke: var(--acc); stroke-linecap: round; transition: stroke-dashoffset .1s linear; }
.b-timer b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 92px; font-weight: 900; font-variant-numeric: tabular-nums; }
.b-timer.low .arc { stroke: #FF5A4F; }
.b-timer.low b { color: #FF7A70; animation: pulse .5s infinite; }
.lwrap { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; padding: 0 90px; height: 640px; }
.lcol { position: relative; display: grid; grid-template-rows: 64px 1fr; gap: 12px; }
.lhead { font-size: 32px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; text-align: center; opacity: .7; }
.lcol.active .lhead { opacity: 1; color: var(--acc); }
.lrows { display: grid; grid-template-rows: repeat(5, 1fr); gap: 14px; }
.lrow { display: grid; grid-template-columns: 1fr 130px; gap: 12px; }
.lans, .lpts { border-radius: 16px; background: linear-gradient(180deg, var(--hid1), var(--hid2)); border: 3px solid rgba(255,255,255,.18); display: flex; align-items: center; overflow: hidden; }
.lans { padding: 0 24px; }
.lans > span { font-size: 44px; font-weight: 900; text-transform: uppercase; white-space: nowrap; width: 100%; overflow: hidden; }
.lpts { justify-content: center; font-size: 58px; font-weight: 900; }
.lrow.open .lans { background: var(--tile); color: var(--tileInk); border-color: var(--acc); }
.lpts.in { background: var(--pts); color: var(--ptsInk); border-color: var(--acc); animation: xpop2 .45s ease-out; }
@keyframes xpop2 { 0% { transform: scale(.6); } 70% { transform: scale(1.08); } 100% { transform: scale(1); } }
.lcover { position: absolute; inset: 76px 0 0; border-radius: 20px; background: repeating-linear-gradient(45deg, var(--hid2), var(--hid2) 24px, var(--hid1) 24px, var(--hid1) 48px); border: 4px solid var(--acc); display: grid; place-items: center; }
.lcover span { background: rgba(0,0,0,.55); padding: 16px 30px; border-radius: 16px; font-size: 34px; font-weight: 900; }
.ltotal { position: absolute !important; left: 90px; right: 90px; bottom: 60px; display: grid; grid-template-columns: 1fr 300px; gap: 30px; align-items: center; }
.lbar { height: 34px; border-radius: 99px; background: rgba(0,0,0,.35); border: 3px solid rgba(255,255,255,.18); overflow: hidden; }
.lbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--acc2), var(--acc)); transition: width .6s; }
.lsum { text-align: center; border: 4px solid var(--acc); border-radius: 22px; padding: 4px 0 8px; background: rgba(0,0,0,.3); }
.lsum small { display: block; font-size: 22px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--acc); }
.lsum b { font-size: 76px; line-height: 1; font-weight: 900; }
.ltotal.reached .lsum { background: var(--acc); color: #1B1B1B; }
.ltotal.reached .lsum small { color: #1B1B1B; }

/* Join screen on the board */
.b-connect { display: grid !important; grid-template-columns: 1fr 640px; gap: 80px; align-items: center; padding: 0 120px; }
.c-left { display: grid; gap: 34px; justify-items: start; }
.c-left .logo { align-items: flex-start; }
.c-left .logo .l1 { margin-left: 6px; }
.c-left .logo .l2 { font-size: 170px; }
.c-steps { margin: 0; padding-left: 50px; font-size: 40px; font-weight: 700; line-height: 1.5; }
.c-status { font-size: 30px; font-weight: 800; padding: 12px 26px; border-radius: 999px; background: rgba(0,0,0,.3); border: 3px solid rgba(255,255,255,.2); max-width: 960px; }
.c-status.ok { border-color: #7EE2A2; color: #B4F1C8; }
.c-status.wait::before { content: ''; display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: var(--acc); margin-right: 14px; animation: pulse 1s infinite; }
.c-status.off { border-color: var(--acc2); font-size: 26px; border-radius: 22px; }
.c-alt { font-size: 26px; opacity: .85; }
.c-alt button { background: none; border: 0; color: var(--acc); font: 800 26px 'DM Sans', sans-serif; text-decoration: underline; cursor: pointer; padding: 0; }
.c-right { display: grid; gap: 26px; justify-items: center; }
.c-qr { width: 500px; height: 500px; background: #fff; border-radius: 34px; padding: 26px; box-shadow: 0 30px 80px rgba(0,0,0,.45); border: 6px solid var(--acc); }
.c-qr svg { width: 100%; height: 100%; display: block; }
.c-code { text-align: center; }
.c-code small { display: block; font-size: 26px; opacity: .8; font-weight: 600; }
.c-code b { font-size: 120px; font-weight: 900; letter-spacing: .14em; line-height: 1.1; color: var(--acc); }

/* TV page chrome */
.tv-ctl { position: absolute; right: 14px; top: 14px; display: flex; gap: 8px; opacity: 0; transition: opacity .3s; z-index: 30; }
.tv.show-ctl .tv-ctl, .solo-board:hover .tv-ctl { opacity: 1; }
.tv-btn { width: 48px; height: 48px; border-radius: 14px; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 20px; font-weight: 800; display: grid; place-items: center; cursor: pointer; text-decoration: none; }
.tv-sound { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 31; border: 0; border-radius: 999px; padding: 12px 22px; background: rgba(255,255,255,.92); color: #1B1B1B; font-weight: 800; cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.tv-join { position: absolute; inset: 0; z-index: 40; background: rgba(0,0,0,.6); display: grid; place-items: center; }
.tv-join-card { background: #fff; color: #1B1B1B; border-radius: 26px; padding: 24px; text-align: center; display: grid; gap: 10px; }
.tv-join-card .c-qr { width: min(60vh, 420px); height: min(60vh, 420px); border-width: 0; box-shadow: none; padding: 0; }
.tv-join-card b { font-size: 48px; letter-spacing: .14em; }

/* One-screen mode */
.solo { position: fixed; inset: 0; display: grid; grid-template-columns: 1fr 380px; background: #000; }
.solo.nopanel { grid-template-columns: 1fr 0; }
.solo.setup { grid-template-columns: 1fr minmax(380px, 46%); }
.solo-board { position: relative; }
.solo-panel { background: var(--cream); overflow-y: auto; display: flex; flex-direction: column; }
.solo.nopanel .solo-panel { display: none; }
.solo-head { position: sticky; top: 0; z-index: 2; display: flex; gap: 6px; align-items: center; padding: 10px; background: var(--cream); border-bottom: 1px solid var(--line); }
.solo-head .link { margin-right: auto; }
.solo-main { padding: 12px; flex: 1; }
.solo .keys { padding: 0 12px; font-size: 13px; color: var(--muted); }
.solo .keys summary { cursor: pointer; font-weight: 700; }
.solo-end { padding: 10px 12px 16px; }
.solo-show { position: absolute; right: 0; top: 50%; z-index: 30; border: 0; border-radius: 12px 0 0 12px; padding: 12px 8px; background: rgba(255,255,255,.85); font-weight: 800; cursor: pointer; }
.setup.compact .packs { grid-template-columns: 1fr; }
@media (max-width: 900px) {
  .solo, .solo.setup { grid-template-columns: 1fr; grid-template-rows: 46vh 1fr; }
  .solo.nopanel { grid-template-rows: 1fr 0; }
}

/* Confetti */
.confetti { position: absolute; inset: 0; overflow: hidden; }
.confetti i { position: absolute; top: -30px; width: 18px; height: 30px; border-radius: 4px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--dx), 1180px) rotate(var(--r)); } }
@media (prefers-reduced-motion: reduce) {
  .tile-in { transition: none; }
  .bigx i, .b-mult, .b-team.steal, .b-phase.ph-steal span, .lpts.in { animation: none; }
}

/* Printable host sheet */
.printbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; max-width: 900px; margin: 0 auto; padding: 14px 16px; }
.psheet { max-width: 900px; margin: 0 auto; padding: 0 16px 40px; color: #222; background: #fff; }
.ppack + .ppack { break-before: page; }
.ph { border-bottom: 2px solid #222; padding-bottom: 8px; margin-bottom: 6px; }
.ph-k { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; color: #8A6A3E; }
.ph h1 { margin: 2px 0 4px; font-size: 26px; }
.ph p { margin: 0; font-size: 11.5px; color: #555; }
.psheet h2 { font-size: 15px; margin: 14px 0 6px; text-transform: uppercase; letter-spacing: .08em; }
.pbreak { break-before: page; }
.pcols { columns: 2; column-gap: 22px; }
.pq { break-inside: avoid; border: 1px solid #CFCFCF; border-radius: 8px; padding: 6px 8px 5px; margin: 0 0 8px; }
.pq-h { display: flex; gap: 6px; font-weight: 800; font-size: 12px; line-height: 1.25; margin-bottom: 3px; }
.pq-code { flex: none; background: #222; color: #fff; border-radius: 4px; padding: 0 4px; font-size: 10.5px; height: 15px; line-height: 15px; }
.pq-a { list-style: none; margin: 0; padding: 0; }
.pq-a li { display: grid; grid-template-columns: 14px 1fr 22px; gap: 4px; font-size: 11px; line-height: 1.3; border-top: 1px dotted #DDD; padding: 1px 0; }
.pq-a .pn { color: #888; font-weight: 700; }
.pq-a .pt small { color: #888; font-size: 9.5px; margin-left: 5px; }
.pq-a .pp { text-align: right; font-weight: 800; }
@media print {
  @page { size: letter; margin: 0.45in; }
  body { background: #fff !important; }
  .no-print { display: none !important; }
  .psheet { padding: 0; max-width: none; }
}
