:root {
  --bg: #0b0f14;
  --panel: #151b23;
  --panel-2: #1f2732;
  --line: #2e3845;
  --text: #f2f5f8;
  --muted: #9aa7b5;
  --accent: #ff8a1f;
  --accent-ink: #1a0f02;
  --make: #17a34a;
  --make-ink: #ffffff;
  --miss: #3a2226;
  --miss-line: #8a3f49;
  --miss-ink: #ffc2c8;
  --neutral: #24303d;
  --foul: #b45309;
  --stop: #dc2626;
  --go: #16a34a;
  --warn: #fbbf24;
  --danger: #f87171;
  --sub: #38bdf8;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

body { overflow: hidden; position: fixed; inset: 0; }
#root { height: 100%; }

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
input, select { font: inherit; color: inherit; }

/* ---------- live game ---------- */

.live {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(104px, 17fr) minmax(0, 66fr) minmax(58px, 8fr);
  gap: 8px;
  padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
}

.board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 1.05fr) minmax(0, 1.25fr);
  gap: 8px;
  min-height: 0;
}

.side {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 8px 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.score {
  font-size: clamp(44px, 7.4vmin, 76px);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  min-width: 1.25em;
  text-align: center;
}
.side-info { min-width: 0; display: grid; gap: 5px; }
.side-name { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bonus { color: var(--warn); font-weight: 800; }
.side-buttons { display: flex; gap: 5px; }
.mini {
  flex: 1;
  min-height: 40px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--neutral);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.mini:active { filter: brightness(1.5); }
.mini.pts { font-size: 17px; font-weight: 800; background: #3b2a55; }

.clock {
  border-radius: var(--radius);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  background: var(--panel);
  min-height: 0;
}
.clock-main {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: center;
  align-items: center;
  column-gap: 14px;
  min-height: 0;
  color: #fff;
}
.clock-main.go { background: var(--go); }
.clock-main.stop { background: var(--stop); }
.clock-main.end { background: var(--accent); color: var(--accent-ink); }
.clock-main:active { filter: brightness(0.85); }
.clock-time {
  font-size: clamp(42px, 7.6vmin, 78px);
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.clock-label { display: grid; text-align: left; font-weight: 800; line-height: 1.15; }
.clock-action { font-size: 17px; letter-spacing: .03em; }
.clock-period { font-size: 14px; opacity: .85; }
.clock-tools { display: grid; grid-template-columns: 2fr 5fr; gap: 1px; background: var(--line); }
.clock-fix, .clock-opts {
  min-height: 30px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  background: var(--panel-2);
}

.work { min-height: 0; display: grid; grid-template-rows: 30fr 42fr 28fr; gap: 8px; }

.floor { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; min-height: 0; }
.tile {
  position: relative;
  background: var(--panel-2);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 8px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  justify-items: center;
  align-content: center;
  overflow: hidden;
  min-height: 0;
  min-width: 0;
}
.tile:active { filter: brightness(1.25); }
.tile-num { font-size: clamp(32px, 6.2vmin, 62px); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.tile-name { font-size: clamp(14px, 2.1vmin, 20px); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; margin-top: 1px; }
.tile-meta { font-size: clamp(12px, 1.7vmin, 15px); color: var(--muted); font-variant-numeric: tabular-nums; align-self: center; white-space: nowrap; }
.tile-meta b { color: var(--text); }
.tile.selected { border-color: var(--accent); background: #3a2a14; box-shadow: 0 0 0 2px var(--accent) inset; }
.tile.target { border-color: var(--sub); border-style: dashed; background: #12303f; }
.tile.ready { border-color: var(--accent); border-style: dashed; }
.tile.f-warn { border-color: var(--warn); }
.tile.f-danger, .tile.f-out { border-color: var(--danger); }
.tile.selected.f-warn, .tile.selected.f-danger, .tile.selected.f-out { border-color: var(--accent); }
.fouls { display: inline-flex; gap: 3px; vertical-align: 1px; margin-left: 5px; }
.fouls i { width: 8px; height: 8px; border-radius: 50%; background: #4a5666; display: block; }
.fouls i.on { background: var(--warn); }
.f-danger .fouls i.on, .f-out .fouls i.on { background: var(--danger); }
.out-tag { font-size: 12px; color: var(--danger); font-weight: 800; }

.flash { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(23, 163, 74, .9); color: #fff; font-size: clamp(24px, 4.4vmin, 44px); font-weight: 800; pointer-events: none; animation: flash .7s ease-out forwards; text-align: center; }
.flash.bad { background: rgba(180, 83, 9, .92); }
.flash.sub { background: rgba(14, 116, 160, .92); }
@keyframes flash { 0%, 45% { opacity: 1; } 100% { opacity: 0; } }

.pad { display: grid; grid-template-columns: repeat(3, 1.05fr) repeat(3, 1fr) 1.05fr; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 7px; min-height: 0; }
.stat {
  border-radius: var(--radius);
  display: grid;
  place-content: center;
  text-align: center;
  font-weight: 800;
  background: var(--neutral);
  min-height: 0;
  line-height: 1.1;
}
.stat:active { filter: brightness(1.4); transform: scale(.98); }
.stat-big { font-size: clamp(24px, 4.3vmin, 42px); }
.stat-small { font-size: clamp(11px, 1.6vmin, 15px); font-weight: 700; opacity: .85; letter-spacing: .02em; }
.stat.make { background: var(--make); color: var(--make-ink); }
.stat.miss { background: var(--miss); color: var(--miss-ink); box-shadow: 0 0 0 1px var(--miss-line) inset; }
.stat.foul { background: var(--foul); grid-row: 1 / span 2; grid-column: 7; }
.stat.armed { outline: 4px solid var(--accent); outline-offset: -4px; }
.pad.disabled .stat { opacity: .38; }

.bench { display: flex; flex-direction: column; min-height: 0; gap: 4px; }
.bench-label { font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--muted); }
.bench-grid { flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 7px; min-height: 0; }
.bench-grid.wrap { grid-auto-flow: row; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); grid-auto-columns: auto; }
.chip {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 11px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  padding: 2px 9px;
  min-height: 0;
  min-width: 0;
  text-align: left;
}
.chip:active { filter: brightness(1.4); }
.chip-num { font-size: clamp(22px, 3.6vmin, 34px); font-weight: 800; font-variant-numeric: tabular-nums; grid-row: span 2; }
.chip-name { font-size: clamp(12px, 1.7vmin, 15px); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; align-self: end; }
.chip-meta { font-size: clamp(11px, 1.5vmin, 13px); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; align-self: start; }
.chip.selected { border-color: var(--sub); background: #12303f; box-shadow: 0 0 0 2px var(--sub) inset; }
.chip.target { border-color: var(--sub); border-style: dashed; background: #12303f; }
.chip.f-warn { border-color: var(--warn); }
.chip.f-danger, .chip.f-out { border-color: var(--danger); }
.chip.f-out { opacity: .55; }
.bench.locked .chip { opacity: .55; }
.bench.locked .bench-label { color: var(--warn); }

.actions { display: grid; grid-template-columns: 72px minmax(0, 1fr) 150px 170px; gap: 8px; min-height: 0; }
.action { border-radius: 12px; font-size: 19px; font-weight: 800; background: var(--panel-2); }
.action:active { filter: brightness(1.4); }
.action.menu { font-size: 14px; color: var(--muted); font-weight: 700; }
.action.undo { background: #4b5563; }
.action.undo:disabled { opacity: .35; }
.action.stats { background: var(--accent); color: var(--accent-ink); font-size: 21px; }
.status {
  background: var(--panel);
  border-radius: 12px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: clamp(15px, 2.2vmin, 19px);
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
}
.status.hint { color: var(--accent); font-weight: 800; }
.status.subhint { color: var(--sub); font-weight: 800; }
.status span { overflow: hidden; text-overflow: ellipsis; }

/* ---------- in-game stats panel ---------- */

.panel-view { min-height: 0; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.attention { display: flex; flex-wrap: wrap; gap: 8px; flex: none; }
.attention:empty { display: none; }
.attn { background: var(--panel); border-radius: 10px; padding: 7px 12px; display: flex; gap: 8px; align-items: baseline; font-size: 16px; font-weight: 700; min-width: 0; }
.attn-title { font-size: 12px; font-weight: 800; letter-spacing: .06em; color: var(--muted); white-space: nowrap; }
.attn.alert { box-shadow: 0 0 0 2px var(--danger) inset; }
.attn.alert .attn-title { color: var(--danger); }
.attn.hot .attn-title { color: #4ade80; }
.tabs { display: flex; gap: 6px; flex: none; align-items: center; flex-wrap: wrap; }
.team-line { margin-left: auto; color: var(--muted); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; padding: 0 6px; }
.tab { padding: 9px 18px; border-radius: 10px; background: var(--panel); font-weight: 700; font-size: 15px; min-height: 42px; }
.tab.on { background: var(--text); color: var(--bg); }
.table-wrap { flex: 1; min-height: 0; overflow: auto; background: var(--panel); border-radius: 12px; -webkit-overflow-scrolling: touch; }

table.box { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 16px; }
.box th, .box td { padding: 9px 7px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
.box th { position: sticky; top: 0; background: var(--panel-2); font-size: 13px; color: var(--muted); z-index: 1; }
.box th button { font-weight: 800; padding: 4px 2px; min-height: 28px; }
.box th.sorted button { color: var(--accent); }
.box .left { text-align: left; }
.box .pts { font-weight: 800; }
.box tr.on-floor td.left { box-shadow: 4px 0 0 var(--go) inset; }
.box td.f-warn { color: var(--warn); font-weight: 800; }
.box td.f-danger { color: var(--danger); font-weight: 800; }
.box tr.totals td { font-weight: 800; background: var(--panel-2); border-bottom: 0; }
.box tr.tap { cursor: pointer; }
.box td.zero { color: #5c6875; }
.box tr.section td { background: var(--bg); color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .08em; padding: 5px 10px; }
.box.key { font-size: 19px; }
.box.key td { padding: 5px 10px; }
.box.key tr.section td { padding: 3px 10px; }
.num { color: var(--muted); display: inline-block; min-width: 2.2em; }

.plays { list-style: none; margin: 0; padding: 0; }
.plays li { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 12px; border-bottom: 1px solid var(--line); min-height: 48px; font-size: 16px; }
.plays .when { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.plays .del { color: var(--danger); font-weight: 700; padding: 8px 12px; min-height: 40px; border-radius: 8px; background: var(--neutral); font-size: 14px; }
.plays .locked { color: var(--muted); font-size: 12px; }
.empty { padding: 24px; text-align: center; color: var(--muted); }

/* ---------- regular pages ---------- */

.page { height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: max(18px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(30px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
.page-inner { max-width: 1100px; margin: 0 auto; display: grid; gap: 18px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; margin: 0; flex: 1; min-width: 180px; }
.back { min-height: 46px; padding: 0 16px; border-radius: 10px; background: var(--panel-2); font-weight: 700; }
.btn { min-height: 52px; padding: 0 20px; border-radius: 12px; background: var(--panel-2); font-weight: 800; font-size: 17px; }
.btn:active { filter: brightness(1.4); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.go { background: var(--go); color: #fff; }
.btn.danger { background: #7f1d1d; color: #fff; }
.btn:disabled { opacity: .4; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.brand { font-size: 36px; font-weight: 800; margin: 0; }
.brand small { display: block; font-size: 16px; font-weight: 600; color: var(--muted); margin-top: 2px; }
.hero { min-height: 120px; width: 100%; border-radius: 18px; font-size: 30px; font-weight: 800; background: var(--accent); color: var(--accent-ink); display: grid; place-content: center; text-align: center; }
.hero small { display: block; font-size: 16px; font-weight: 700; opacity: .8; margin-top: 4px; }
.hero.resume { background: var(--go); color: #fff; }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile-link { min-height: 88px; border-radius: 16px; background: var(--panel-2); font-size: 22px; font-weight: 800; }
.tile-link:active { filter: brightness(1.4); }
.card { background: var(--panel); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; min-width: 0; }
.card h2 { font-size: 17px; margin: 0; }
.card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.4; }
.game-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 13px 12px; background: var(--panel-2); border-radius: 11px; text-align: left; min-height: 58px; }
.game-row b { font-size: 17px; }
.result { font-weight: 800; font-size: 18px; text-align: center; }
.result.w { color: #4ade80; }
.result.l { color: var(--danger); }
.game-row .sub { color: var(--muted); font-size: 14px; display: block; font-weight: 500; }
.game-score { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 18px; }
.warn-note, .card p.warn-note { color: var(--warn); font-weight: 700; font-size: 15px; }
.card p.warn-note:empty { display: none; }
.footnote { color: var(--muted); font-size: 13px; text-align: center; }

.field { display: grid; gap: 5px; font-size: 14px; color: var(--muted); font-weight: 700; }
.field input, .field select { background: var(--panel-2); border: 2px solid var(--line); border-radius: 10px; padding: 12px; min-height: 50px; color: var(--text); font-size: 17px; font-weight: 600; width: 100%; }
.field input:focus { outline: 0; border-color: var(--accent); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stepper { display: grid; grid-template-columns: 50px minmax(0, 1fr) 50px; align-items: center; background: var(--panel-2); border-radius: 10px; min-height: 50px; color: var(--text); }
.stepper button { min-height: 50px; font-size: 22px; font-weight: 800; }
.stepper button:active { background: var(--line); }
.stepper output { text-align: center; font-size: 17px; font-weight: 800; }
.seg { display: flex; background: var(--panel-2); border-radius: 10px; overflow: hidden; min-height: 50px; color: var(--text); }
.seg button { flex: 1; font-weight: 700; font-size: 15px; padding: 0 6px; }
.seg button.on { background: var(--text); color: var(--bg); }

.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pick { position: relative; background: var(--panel-2); border: 3px solid var(--line); border-radius: var(--radius); }
.pick-main { width: 100%; padding: 14px 8px; display: grid; justify-items: center; gap: 2px; min-height: 96px; }
.pick-main b { font-size: 34px; line-height: 1; }
.pick-main span { font-size: 15px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick.starter { border-color: var(--accent); background: #3a2a14; }
.pick.playing { border-color: var(--go); background: #12301f; }
.pick.playing .pick-tag { color: #4ade80; }
.quick-add { display: grid; grid-template-columns: 80px minmax(0, 1fr) 90px; gap: 8px; }
.quick-add input { background: var(--panel-2); border: 2px solid var(--line); border-radius: 10px; padding: 11px; min-height: 52px; font-size: 17px; font-weight: 600; width: 100%; color: var(--text); }
.quick-add input:focus { outline: 0; border-color: var(--accent); }
.avail.add { border: 2px dashed var(--line); }
.avail.add small { color: var(--muted); }
.pick-tag { font-size: 12px; font-weight: 800; color: var(--accent); min-height: 16px; }

.roster-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) 90px; gap: 8px; align-items: center; }
.roster-row input { background: var(--panel-2); border: 2px solid var(--line); border-radius: 10px; padding: 11px; min-height: 50px; font-size: 18px; font-weight: 700; width: 100%; color: var(--text); }
.roster-row input:focus { outline: 0; border-color: var(--accent); }
.roster-row .num-in { text-align: center; }
.roster-row .btn { min-height: 50px; padding: 0 8px; font-size: 14px; color: var(--danger); }

.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.metric { background: var(--panel); border-radius: 12px; padding: 12px 14px; }
.metric b { display: block; font-size: 30px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.metric span { color: var(--muted); font-size: 13px; font-weight: 700; }

.final-head { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 14px; align-items: center; background: var(--panel); border-radius: var(--radius); padding: 18px; text-align: center; }
.final-head .team { font-size: 20px; font-weight: 800; overflow-wrap: anywhere; }
.final-head .big { font-size: 56px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.final-head .label { color: var(--muted); font-size: 14px; font-weight: 700; margin-top: 4px; }
.card .table-wrap { background: transparent; overflow-x: auto; }

/* ---------- overlays ---------- */

#modal:empty { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); display: grid; place-items: center; padding: 16px; z-index: 50; }
.dialog { background: var(--panel); border-radius: 18px; padding: 20px; width: min(560px, 100%); max-height: 92vh; overflow-y: auto; display: grid; gap: 14px; box-shadow: 0 0 0 1px var(--line); }
.dialog h2 { margin: 0; font-size: 24px; }
.dialog p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.4; }
.dialog .btn-row .btn { flex: 1; min-width: 130px; }
.fix-time { font-size: 60px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.fix-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fix-grid .btn { padding: 0; }
.sect { font-size: 13px; font-weight: 800; color: var(--muted); letter-spacing: .05em; }
.avail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; }
.avail-grid p { grid-column: 1 / -1; }
.avail { min-height: 50px; padding: 4px 6px; border-radius: 10px; background: var(--panel-2); border: 2px solid var(--go); font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; }
.avail small { display: block; font-size: 11px; color: #4ade80; }
.avail.out { border: 2px dashed var(--danger); opacity: .75; }
.avail.out small { color: var(--danger); }
.team-field select { font-weight: 800; }
.fix-dialog { gap: 9px; padding: 14px 18px; }
.fix-dialog h2 { font-size: 19px; }
.fix-dialog .fix-time { font-size: 44px; }
.fix-dialog p { font-size: 14px; }
.fix-dialog .btn, .fix-dialog .seg, .fix-dialog .seg button { min-height: 44px; }
.fix-effect { background: var(--panel-2); border-radius: 10px; padding: 10px 12px; display: grid; gap: 4px; font-size: 16px; }
.fix-effect b { font-variant-numeric: tabular-nums; margin-right: 6px; }

/* Sits low on the screen so it can never cover the clock or score. */
#toast { position: fixed; left: 50%; bottom: calc(max(8px, env(safe-area-inset-bottom)) + 70px); transform: translateX(-50%); z-index: 70; display: grid; gap: 6px; width: min(640px, calc(100% - 24px)); pointer-events: none; }
.toast { background: #111827; border: 2px solid var(--accent); padding: 12px 16px; border-radius: 12px; font-weight: 700; font-size: 17px; text-align: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.toast.error { border-color: var(--danger); background: #3b1116; }
#fatal { position: fixed; left: 0; right: 0; bottom: 0; background: #7f1d1d; color: #fff; padding: 12px 16px; z-index: 80; font-weight: 700; font-size: 15px; display: flex; gap: 12px; align-items: center; }
#fatal[hidden] { display: none; }
#fatal span { flex: 1; }
#fatal button { padding: 8px 14px; background: #fff; color: #7f1d1d; border-radius: 8px; font-weight: 800; }

/* ---------- portrait ---------- */

@media (orientation: portrait) {
  .board { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1.1fr); }
  .clock { grid-column: 1 / -1; grid-row: 1; }
  .live { grid-template-rows: minmax(190px, 21fr) minmax(0, 71fr) 58px; }
  .work { grid-template-rows: 26fr 38fr 36fr; }
  .floor .tile { padding: 4px; }
  .actions { grid-template-columns: 62px minmax(0, 1fr) 110px 130px; }
  .pad { grid-template-columns: repeat(3, 1.05fr) repeat(3, 1fr) .95fr; }
  .stat-big { font-size: clamp(20px, 3.3vmin, 34px); }
  .chip { grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: center; text-align: center; padding: 2px 4px; }
  .chip-num { grid-row: auto; }
  .chip-name, .chip-meta { align-self: center; max-width: 100%; }
}

/* ---------- print ---------- */

@media print {
  html, body { position: static; overflow: visible; height: auto; background: #fff; color: #000; }
  #toast, #modal, #fatal, .no-print { display: none !important; }
  .page { height: auto; overflow: visible; padding: 0; }
  .card, .final-head, .metric { background: #fff; color: #000; border: 1px solid #999; }
  .final-head .label, .card p, .num { color: #333; }
  .box th { position: static; background: #eee; color: #000; }
  .box th, .box td { border-color: #bbb; padding: 5px; font-size: 12px; }
  .box tr.totals td { background: #eee; }
  .box td.f-warn, .box td.f-danger { color: #000; }
  .box tr.on-floor td.left { box-shadow: none; }
}
