/* Trivia Host — styles.
   Planning pages are quiet and light; host mode and the big screen are a dark scoreboard. */
:root {
  --paper: #F5F7FA;
  --panel: #FFFFFF;
  --ink: #172033;
  --muted: #5B6476;
  --line: #DCE1E9;
  --rink: #14213D;
  --rink-2: #1C2D52;
  --rink-line: #2C3F68;
  --team-a: #2E5BD8;
  --team-a-deep: #2349B3;
  --team-b: #E8692C;
  --team-b-deep: #C4511A;
  --warn: #F4B400;
  --alarm: #E23D3D;
  --good: #1F8A5B;
  --body: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --board: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', 'Segoe UI', sans-serif;
  --r: 8px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--body); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--paper); }
a { color: var(--team-a-deep); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--team-a); outline-offset: 2px; }
kbd { font-family: var(--board); font-size: .8em; border: 1px solid currentColor; border-radius: 4px; padding: 0 .35em; opacity: .7; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
[hidden] { display: none !important; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 40px; padding: .45em 1em; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--panel); color: var(--ink); font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #B9C1CE; }
.btn.primary { background: var(--rink); border-color: var(--rink); color: #fff; }
.btn.primary:hover { background: var(--rink-2); }
.btn.danger { background: var(--alarm); border-color: var(--alarm); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost.danger { color: #B42323; background: transparent; }
.btn.small { min-height: 32px; padding: .25em .7em; font-size: .875rem; }
.btn.big { min-height: 56px; font-size: 1.15rem; padding: .5em 1.4em; }
.btn:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.icon { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); cursor: pointer; }
.icon:disabled { opacity: .3; cursor: default; }
input[type=text], input:not([type]), input[type=search], input[type=password], input[type=date], select, textarea {
  border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: .5em .7em; min-height: 40px; width: 100%;
}
textarea { resize: vertical; line-height: 1.45; }
label { display: grid; gap: .3em; font-weight: 700; font-size: .95rem; }
label .muted { font-weight: 400; }
label.inline { display: inline-flex; align-items: center; gap: .5em; }
label.inline input { width: auto; }
label.check { display: inline-flex; align-items: center; gap: .45em; font-weight: 400; cursor: pointer; }
.row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }

/* ---------- app frame ---------- */
.topbar {
  display: flex; align-items: center; gap: 1.5rem; padding: 0 24px; height: 60px;
  background: var(--rink); color: #fff; position: sticky; top: 0; z-index: 10;
}
.wordmark { white-space: nowrap; font-family: var(--board); font-weight: 700; font-size: 1.6rem; letter-spacing: .01em; color: inherit; text-decoration: none; }
.topbar nav { display: flex; gap: .25rem; height: 100%; }
.topbar nav a { display: flex; align-items: center; padding: 0 .9rem; color: #C9D3E8; text-decoration: none; font-weight: 700; border-bottom: 3px solid transparent; }
.topbar nav a:hover { color: #fff; }
.topbar nav a.on { color: #fff; border-bottom-color: var(--team-b); }
#sync { margin-left: auto; font-size: .8rem; color: #AEB9D1; }
#sync[data-state=offline] { color: #FFD166; }
#sync::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: #4CC38A; vertical-align: 1px; }
#sync[data-state=offline]::before { background: #FFD166; }
#sync[data-state=saving]::before { background: #AEB9D1; }
#sync:empty::before { display: none; }
main#page { max-width: 1120px; margin: 0 auto; padding: 28px 24px 80px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 2rem; }
.page-head input[type=search] { width: 280px; }
.back { font-size: .9rem; font-weight: 700; text-decoration: none; }
.back::before { content: '‹ '; }
h2.section { font-size: 1.15rem; margin: 2rem 0 .5rem; }
h3.section { font-size: 1rem; margin: 1.5rem 0 .5rem; color: var(--muted); }
.sub { margin: .75rem 0; }
.empty { padding: 2.5rem 1.5rem; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r); background: var(--panel); }
.notice { padding: .75rem 1rem; border-radius: var(--r); background: #FFF6DB; border: 1px solid #F1D98C; margin: .75rem 0; }
.danger-zone { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: .7rem 1rem; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--rink); }
.count { font-family: var(--board); font-weight: 600; background: #E8ECF3; border-radius: 10px; padding: 0 .5em; margin-left: .2em; font-size: .9em; }

/* ---------- chips & status ---------- */
.chip { display: inline-block; font-size: .78rem; font-weight: 700; padding: .1em .55em; border-radius: 999px; white-space: nowrap; }
.chip.date { background: #E9EEFD; color: var(--team-a-deep); }
.status { font-size: .82rem; font-weight: 700; white-space: nowrap; }
.status.ready { color: var(--good); }
.status.draft, .status.none { color: var(--muted); }
.status.used { color: var(--muted); }
.status.over { color: #B42323; }
.status.live { color: var(--team-b-deep); }
.status.done { color: var(--muted); }

/* ---------- library ---------- */
.themes { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.theme { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.theme.ready { border-left: 4px solid var(--good); }
.theme.used { opacity: .75; }
.theme-head { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .85rem 1rem; border: 0; background: none; text-align: left; cursor: pointer; }
.theme-name { font-weight: 700; font-size: 1.05rem; flex: 1; }
.theme-head::before { content: '▸'; color: var(--muted); transition: transform .15s; }
.theme-head[aria-expanded=true]::before { transform: rotate(90deg); }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--rink); }
.theme-body { padding: 0 1rem 1rem 2.4rem; }
.qlist { list-style: none; margin: 0 0 .75rem; padding: 0; }
.qrow { display: flex; gap: .75rem; align-items: flex-start; padding: .7rem 0; border-top: 1px solid var(--line); }
.qlist.loose .qrow, .qlist.dim .qrow { background: var(--panel); padding: .7rem 1rem; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: .4rem; }
.qlist.dim { opacity: .65; }
.qnum { font-family: var(--board); font-weight: 700; font-size: 1.15rem; color: var(--muted); min-width: 1.2em; }
.qtext { flex: 1; min-width: 0; }
.qtext .q { font-weight: 400; }
.qtext .a { font-weight: 700; color: var(--team-a-deep); }
.qtext .a::before { content: 'A: '; color: var(--muted); font-weight: 400; }
.qtools { display: flex; gap: .3rem; align-items: center; }
.pick { width: 20px; height: 20px; margin-top: .2rem; }
.sticky-bar { position: sticky; top: 60px; background: var(--paper); padding: .5rem 0; z-index: 2; }
.archive-group { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem 1rem .25rem; margin-bottom: .75rem; }
.archive-group h3 { font-size: 1.05rem; margin-bottom: .25rem; }

/* ---------- games ---------- */
.week-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.week { display: grid; grid-template-columns: 110px 1fr 90px 160px auto; gap: 1rem; align-items: center; padding: .8rem 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.week-list.compact .week { grid-template-columns: 90px 1fr 1fr 140px; padding: .55rem 1rem; }
.week-num { font-family: var(--board); font-weight: 700; font-size: 1.25rem; }
.matchups { line-height: 1.35; }
.game-grid { display: grid; gap: 1rem; grid-template-columns: repeat(3, 1fr); margin-top: 1rem; }
.game-grid.g1 { grid-template-columns: minmax(0, 520px); }
.game-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.game-card header { background: var(--rink); color: #fff; padding: .75rem 1rem; }
.game-card h3 { font-family: var(--board); font-size: 1.35rem; font-weight: 700; }
.game-card header p { color: #C9D3E8; }
.final-score { color: #fff !important; font-weight: 700; }
.slots { list-style: none; margin: 0; padding: 0; }
.slot { display: grid; gap: .35rem; padding: .8rem 1rem; border-top: 1px solid var(--line); }
.slot:first-child { border-top: 0; }
.slot:last-child { background: #FBF6F1; }
.slot-label { font-size: .8rem; color: var(--muted); }
.slot-theme { font-weight: 700; }
.slot.empty .slot-theme { font-weight: 400; }
.slot.tp .slot-theme { color: var(--team-b-deep); }
.pick-list { display: grid; gap: .4rem; max-height: 55vh; overflow: auto; margin: .75rem 0; }
.pick-item { display: grid; gap: .15rem; text-align: left; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); cursor: pointer; }
.pick-item:hover { border-color: var(--team-a); }
.pick-item.near { border-left: 4px solid var(--team-a); }
.pick-item .preview { font-size: .85rem; color: var(--muted); }
.pick-item .chip { justify-self: start; }

/* ---------- season ---------- */
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
table.standings { width: 100%; border-collapse: collapse; }
.standings th, .standings td { padding: .65rem .8rem; border-bottom: 1px solid var(--line); text-align: left; }
.standings th { font-size: .8rem; color: var(--muted); font-weight: 700; }
.standings .num { text-align: right; font-variant-numeric: tabular-nums; }
.standings .tm { font-weight: 700; }
.standings .total { font-family: var(--board); font-size: 1.35rem; font-weight: 700; }
.standings tr:last-child td { border-bottom: 0; }
.standings sup { color: var(--team-b-deep); margin-left: 2px; }
.settings p { max-width: 65ch; margin-bottom: .75rem; }
table.keys td { padding: .3rem 1rem .3rem 0; }

/* ---------- dialogs ---------- */
dialog.modal { border: 0; border-radius: 12px; padding: 1.5rem; width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(20, 33, 61, .35); }
dialog.modal.wide { width: min(760px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(20, 33, 61, .55); }
dialog h2 { font-size: 1.35rem; margin-bottom: 1rem; }
.form { display: grid; gap: 1rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.confirm-text { font-size: 1.1rem; margin-bottom: 1rem; }
fieldset.radio-row { border: 0; padding: 0; margin: 0; display: grid; gap: .4rem; }
fieldset.radio-row legend { font-weight: 700; margin-bottom: .3rem; }
fieldset.radio-row label { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--rink); color: #fff; padding: .6rem 1.1rem; border-radius: 999px; font-weight: 700; z-index: 100; transition: opacity .4s; }
.toast.out { opacity: 0; }
.error { color: #B42323; min-height: 1.5em; }

/* ---------- login ---------- */
body.login-mode { background: var(--rink); color: #fff; }
.login { max-width: 360px; margin: 18vh auto 0; display: grid; gap: 1rem; padding: 0 24px; }
.login .wordmark { font-size: 3rem; }
.login input { color: var(--ink); }
.login .error { color: #FFB4A8; }
.login .btn.primary { background: var(--team-b-deep); border-color: var(--team-b-deep); }

/* ---------- host mode ---------- */
body.host-mode { background: var(--rink); color: #EEF2FA; }
.host { min-height: 100vh; display: flex; flex-direction: column; }
.host-top { display: flex; align-items: center; gap: 1rem; padding: .5rem 1.25rem; border-bottom: 1px solid var(--rink-line); flex-wrap: wrap; }
.host-top .back { color: #C9D3E8; }
.host-top .back::before { content: '‹ '; }
.host-title { font-family: var(--board); font-weight: 600; font-size: 1.15rem; color: #C9D3E8; }
.gtabs { display: flex; gap: .3rem; }
.gtab { border: 1px solid var(--rink-line); background: transparent; color: #C9D3E8; border-radius: 999px; padding: .3rem .9rem; font-weight: 700; cursor: pointer; }
.gtab.on { background: #fff; color: var(--rink); border-color: #fff; }
.gtab:disabled { opacity: .35; cursor: default; }
.gtab .tick { color: #4CC38A; }
.gtab.on .tick { color: var(--good); }
.host-top .btn { background: transparent; color: #EEF2FA; border-color: var(--rink-line); }
.host-top #sync { margin-left: auto; }

.board { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 1.25rem; padding: 1rem 1.25rem; }
.team { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .4rem 1.25rem; border-radius: 10px; font-family: var(--board); }
.team.a { background: var(--team-a); }
.team.b { background: var(--team-b-deep); }
.team.won { box-shadow: 0 0 0 4px #fff; }
.tname { font-size: 1.6rem; font-weight: 600; line-height: 1.1; color: #fff; }
.tscore { font-size: 3.4rem; font-weight: 700; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.pips { list-style: none; display: grid; grid-template-columns: repeat(20, 12px); gap: 4px; align-content: center; margin: 0; padding: 0; }
.pips li { height: 22px; border-radius: 3px; background: var(--rink-2); border: 1px solid var(--rink-line); }
.pips li.setstart { margin-left: 6px; }
.pips li:first-child { margin-left: 0; }
.pips li.dbl { height: 30px; align-self: center; }
.pips li.a { background: var(--team-a); border-color: var(--team-a); }
.pips li.b { background: var(--team-b); border-color: var(--team-b); }
.pips li.x { background: #56627D; border-color: #56627D; }
.pips li.cur { background: #fff; border-color: #fff; }

.stage { flex: 1; display: flex; flex-direction: column; gap: 1rem; padding: .5rem 1.25rem 1.25rem; max-width: 1400px; width: 100%; margin: 0 auto; }
.qmeta { display: flex; align-items: baseline; gap: 1.25rem; flex-wrap: wrap; }
.qcount { font-family: var(--board); font-weight: 700; font-size: 2rem; color: #fff; }
.qcount .of { color: #8E9BB8; font-weight: 500; }
.theme-tag { font-size: 1.15rem; color: #C9D3E8; }
.pts { margin-left: auto; font-family: var(--board); font-weight: 700; font-size: 1.3rem; color: #C9D3E8; }
.pts.dbl { color: var(--rink); background: var(--warn); padding: 0 .6em; border-radius: 6px; }
.stage-grid { display: grid; grid-template-columns: 1fr 260px; gap: 1rem; flex: 1; min-height: 0; }
.qcard { background: #FBFCFE; color: var(--ink); border-radius: 14px; padding: 2rem 2.25rem; display: flex; flex-direction: column; justify-content: center; gap: 1.5rem; }
.question { font-size: clamp(1.5rem, 2.6vw, 2.4rem); line-height: 1.35; max-width: 42ch; }
.answer { display: flex; gap: 1rem; align-items: baseline; padding: .9rem 1.2rem; border-radius: 10px; background: #E9EEFD; border-left: 6px solid var(--team-a); font-size: clamp(1.2rem, 2vw, 1.7rem); font-weight: 700; }
.answer .label { font-family: var(--board); font-weight: 600; font-size: 1rem; color: var(--muted); }
.qcard.tp { background: #FFF4EC; align-items: flex-start; }
.read-card { font-family: var(--board); font-size: clamp(2.5rem, 6vw, 5rem); font-weight: 700; color: var(--team-b-deep); line-height: 1; }

.timer { background: var(--rink-2); border: 1px solid var(--rink-line); border-radius: 14px; padding: 1.25rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .9rem; text-align: center; }
.timer-num { font-family: var(--board); font-size: 7rem; font-weight: 700; line-height: .9; font-variant-numeric: tabular-nums; color: #fff; }
.timer-track { width: 100%; height: 10px; background: var(--rink); border-radius: 5px; overflow: hidden; }
.timer-bar { height: 100%; background: #4CC38A; transform-origin: left; }
.timer[data-state=idle] .timer-num { color: #8E9BB8; }
.timer[data-state=warn] .timer-num { color: var(--warn); }
.timer[data-state=warn] .timer-bar { background: var(--warn); }
.timer[data-state=expired] { background: var(--alarm); border-color: var(--alarm); }
.timer[data-state=expired] .timer-track { visibility: hidden; }
.timer-btn { min-height: 52px; font-size: 1.15rem; min-width: 140px; }
.timer .btn.ghost { color: #C9D3E8; }
.timer .hint { font-size: .8rem; color: #8E9BB8; }

.score-row { display: grid; grid-template-columns: 1fr 220px 1fr; gap: 1rem; }
.score-btn { position: relative; display: flex; align-items: center; justify-content: center; gap: .75rem; min-height: 84px; border: 0; border-radius: 12px; color: #fff; cursor: pointer; font-family: var(--board); font-size: 1.8rem; font-weight: 700; padding: 0 1rem; }
.score-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-btn b { font-size: 1.4rem; opacity: .85; }
.score-btn kbd { position: absolute; top: 8px; right: 10px; font-size: .9rem; }
.score-btn.a { background: var(--team-a); }
.score-btn.a:hover { background: var(--team-a-deep); }
.score-btn.b { background: var(--team-b-deep); }
.score-btn.b:hover { background: #A94515; }
.score-btn.none { background: transparent; border: 2px solid var(--rink-line); color: #C9D3E8; font-size: 1.4rem; }
.score-btn.none:hover { border-color: #8E9BB8; }
.score-btn:active { transform: translateY(1px); }
.undo-row { display: flex; justify-content: space-between; align-items: center; color: #8E9BB8; }
.undo-row .muted { color: #8E9BB8; }
.undo-row .btn.ghost { color: #C9D3E8; }

.stage.done, .stage.mystery { justify-content: center; }
.winner-card { align-self: center; text-align: center; display: grid; gap: 1rem; justify-items: center; padding: 3rem 2rem; }
.winner-card .kicker { font-size: 1.15rem; color: #C9D3E8; }
.winner-card h2 { font-family: var(--board); font-size: clamp(3rem, 7vw, 5.5rem); font-weight: 700; color: #fff; }
.winner-card .final { font-family: var(--board); font-size: 2rem; color: #C9D3E8; }
.winner-card .muted { color: #8E9BB8; }
.winner-card .btn.primary { background: var(--team-b-deep); border-color: var(--team-b-deep); margin-top: 1rem; }
.mystery-picks { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; margin-top: 1rem; }
.mystery-picks .btn { background: var(--rink-2); color: #fff; border-color: var(--rink-line); min-width: 160px; }
.mystery-picks .btn.primary { background: var(--team-b-deep); border-color: var(--team-b-deep); }
.stage.summary { align-items: center; justify-content: center; gap: 1.5rem; }
.stage.summary h2 { font-family: var(--board); font-size: 3.5rem; color: #fff; }
.stage.summary h3 { color: #C9D3E8; }
.bracket { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; min-width: min(560px, 100%); }
.bracket li { display: grid; grid-template-columns: 80px 1fr auto 1fr; gap: 1rem; align-items: center; padding: .7rem 1rem; background: var(--rink-2); border-radius: 10px; font-size: 1.15rem; }
.bracket .blabel { font-family: var(--board); color: #8E9BB8; }
.bracket .w { font-weight: 700; color: #fff; }
.bracket li > span:last-child { text-align: right; }
.stage.summary .standings { width: auto; min-width: 360px; font-size: 1.1rem; background: var(--rink-2); border-radius: 10px; }
.stage.summary .standings td { border-color: var(--rink-line); }
.stage.tiebreak .qcount { color: var(--warn); }

/* ---------- big screen ---------- */
body.screen-mode { background: var(--rink); color: #fff; overflow: hidden; }
.screen { height: 100vh; display: flex; flex-direction: column; padding: 3vh 3vw; gap: 3vh; }
.scr-idle { margin: auto; text-align: center; color: #8E9BB8; font-size: 1.5rem; }
.scr-idle .wordmark { font-size: 12vw; color: #fff; display: block; }
.scr-title { font-family: var(--board); font-size: 3.2vh; color: #8E9BB8; font-weight: 600; text-align: center; }
.scr-board { flex: 1; display: grid; grid-template-columns: 1fr 1.1fr 1fr; gap: 2.5vw; min-height: 0; }
.scr-team { border-radius: 2vh; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 2vh 1vw; font-family: var(--board); text-align: center; }
.scr-team.a { background: var(--team-a); }
.scr-team.b { background: var(--team-b-deep); }
.scr-team.won { box-shadow: 0 0 0 1vh #fff; }
.scr-team .n { font-size: 6vh; font-weight: 600; line-height: 1.05; }
.scr-team .s { font-size: 30vh; font-weight: 700; line-height: .95; font-variant-numeric: tabular-nums; }
.scr-center { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 1.5vh; }
.scr-q { font-family: var(--board); font-size: 7vh; font-weight: 700; white-space: nowrap; }
.scr-q span { color: #8E9BB8; font-weight: 500; }
.scr-theme { font-size: 4.2vh; color: #DDE4F2; line-height: 1.2; }
.scr-dbl { font-family: var(--board); font-size: 4.5vh; font-weight: 700; background: var(--warn); color: var(--rink); padding: 0 .6em; border-radius: 1vh; }
.scr-win { font-family: var(--board); font-size: 12vh; font-weight: 700; line-height: 1; }
.scr-timer { margin-top: 3vh; width: 100%; display: grid; justify-items: center; gap: 1.5vh; }
.scr-timer span { font-family: var(--board); font-size: 22vh; font-weight: 700; line-height: .85; font-variant-numeric: tabular-nums; }
.scr-track { width: 80%; height: 1.4vh; background: var(--rink-2); border-radius: 1vh; overflow: hidden; }
.scr-track div { height: 100%; background: #4CC38A; transform-origin: left; }
.scr-timer[data-state=idle] span { color: #56627D; }
.scr-timer[data-state=warn] span { color: var(--warn); }
.scr-timer[data-state=warn] .scr-track div { background: var(--warn); }
.scr-timer[data-state=expired] span { color: var(--alarm); }
.scr-pips { display: flex; justify-content: center; gap: .6vw; }
.scr-pips i { width: 3.2vw; height: 2.4vh; border-radius: .5vh; background: var(--rink-2); border: 1px solid var(--rink-line); }
.scr-pips i.setstart { margin-left: 1.2vw; }
.scr-pips i:first-child { margin-left: 0; }
.scr-pips i.a { background: var(--team-a); border-color: var(--team-a); }
.scr-pips i.b { background: var(--team-b); border-color: var(--team-b); }
.scr-pips i.x { background: #56627D; border-color: #56627D; }
.scr-pips i.cur { background: #fff; }
.scr-bracket { list-style: none; margin: auto; padding: 0; display: grid; gap: 2.5vh; width: min(90vw, 1400px); }
.scr-bracket li { display: grid; grid-template-columns: 1fr 2fr 2fr; gap: 2vw; align-items: center; font-family: var(--board); font-size: 6vh; background: var(--rink-2); border-radius: 1.5vh; padding: 1.5vh 2vw; }
.scr-bracket .blabel { color: #8E9BB8; }
.scr-bracket span { display: flex; justify-content: space-between; gap: 1vw; color: #8E9BB8; }
.scr-bracket span.w { color: #fff; }
.fs-btn { position: fixed; bottom: 12px; right: 12px; background: transparent; color: #56627D; border: 1px solid var(--rink-line); border-radius: 6px; padding: .3rem .7rem; cursor: pointer; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .game-grid { grid-template-columns: 1fr; }
  .week { grid-template-columns: 1fr auto; }
  .week > span:nth-child(3) { display: none; }
  .week-list.compact .week { grid-template-columns: 70px 1fr; gap: .25rem .75rem; }
  .week-list.compact .week > span:nth-child(3) { display: block; grid-column: 2; }
  .week-list.compact .week > span:nth-child(4) { grid-column: 2; }
  .stage-grid { grid-template-columns: 1fr; }
  .timer-num { font-size: 4.5rem; }
  .score-row { grid-template-columns: 1fr 1fr; }
  .score-btn.none { grid-column: 1 / -1; grid-row: 2; min-height: 56px; }
  .board { grid-template-columns: 1fr 1fr; }
  .pips { display: none; }
  .two { grid-template-columns: 1fr; }
  .topbar { gap: .75rem; padding: 0 12px; }
  .topbar .wordmark { font-size: 1.25rem; }
  .topbar nav { overflow-x: auto; min-width: 0; }
  .topbar nav a { padding: 0 .6rem; white-space: nowrap; }
  .tabs button { padding: .7rem .7rem; }
  .qrow { flex-wrap: wrap; }
  .theme-head { flex-wrap: wrap; }
  .scr-board { grid-template-columns: 1fr; }
  .topbar #sync { display: none; }
  main#page { padding: 20px 16px 60px; }
  .page-head input[type=search] { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.host .btn.primary { background: var(--team-b-deep); border-color: var(--team-b-deep); color: #fff; }
.host .stage .btn:not(.primary):not(.ghost) { background: var(--rink-2); border-color: var(--rink-line); color: #fff; }
.host-mode .toast { background: #fff; color: var(--rink); }

.chip.mystery { background: #F1E8FB; color: #6A3BA6; }
.import .file-btn { justify-self: start; }
.imp-sheet { border: 1px solid var(--line); border-radius: var(--r); padding: .8rem 1rem; display: grid; gap: .5rem; margin-bottom: .6rem; }
.imp-sheet.skipped { opacity: .55; }
.imp-sheet header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.imp-sheet header h3 { font-size: 1.05rem; }
.imp-sheet header select { width: auto; }
.imp-dates select, .imp-dates input { width: auto; }
.imp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; }
.imp-list li { display: flex; gap: .6rem; align-items: center; font-size: .92rem; flex-wrap: wrap; }
.imp-name { flex: 1; min-width: 12rem; }
.imp-n { color: var(--muted); font-size: .85rem; }
.imp-list li.warn .imp-n { color: #B42323; font-weight: 700; }
.imp-note { font-size: .88rem; color: #8A5A00; }
#impSheets { max-height: 55vh; overflow: auto; }

.test-badge { margin-left: auto; background: var(--warn); color: var(--rink); font-weight: 700; font-size: .85rem; padding: .2rem .7rem; border-radius: 999px; white-space: nowrap; }
