/* Layout: one column under a hand-operated outfield scoreboard, whose line score fills in as you play. */
:root {
  --board: #143f31; --panel: #0d2e23; --chalk: #f4f1e2; --dim: #b4c8b8; --line: #2f6250;
  --amber: #f5bd3b; --hit: #93e6ab; --miss: #ff9b85; --on-amber: #182a1f;
  --stencil: "Saira Stencil One", Impact, "Arial Narrow", sans-serif;
  --text: "Barlow", "Trebuchet MS", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--board); color: var(--chalk); font-family: var(--text); font-size: 18px; line-height: 1.45; }
#app { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px;
  padding-block: 18px 44px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2, p { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--chalk); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

.top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 14px; }
.brand { font-family: var(--stencil); font-size: 34px; line-height: 1.1; letter-spacing: .02em; font-weight: 400; }
.today { color: var(--dim); font-weight: 500; font-size: 16px; }
.today b { color: var(--chalk); font-weight: 700; }

.linescore { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(0, 1.45fr); gap: 4px; }
.cell { display: flex; flex-direction: column; min-width: 0; }
.cell small { text-align: center; font-size: 13px; font-weight: 700; color: var(--dim); padding-bottom: 2px; }
.tile { background: var(--panel); border: 1px solid var(--line); height: 44px; display: flex; align-items: center; justify-content: center;
  font-family: var(--stencil); font-size: clamp(17px, 5vw, 24px); font-variant-numeric: tabular-nums; }
.tile.now { border: 2px solid var(--amber); }
.tile.hit { color: var(--hit); }
.tile.miss { color: var(--miss); }
.tile.total { color: var(--amber); }

.panel { display: flex; flex-direction: column; gap: 16px; }
.hero { font-family: var(--stencil); font-weight: 400; font-size: clamp(36px, 10vw, 56px); line-height: 1.04; text-wrap: balance; }
.lede { font-size: 21px; max-width: 34em; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.worked { background: var(--panel); padding: 14px 16px; }
.worked b { color: var(--amber); }

.btn { font-family: var(--text); font-weight: 700; font-size: 19px; padding: 14px 20px; border: 2px solid var(--chalk); background: transparent; border-radius: 3px; }
.btn.main { background: var(--amber); border-color: var(--amber); color: var(--on-amber); }

.kicker { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; color: var(--dim); font-weight: 500; font-size: 16px; }
.clock { font-family: var(--stencil); font-size: 28px; color: var(--chalk); font-variant-numeric: tabular-nums; }
.clock.low { color: var(--miss); }
.clockbar { height: 6px; background: var(--line); overflow: hidden; }
.clockbar i { display: block; height: 100%; background: var(--amber); transform-origin: left; }
.clockbar.low i { background: var(--miss); }
.question { font-size: clamp(24px, 6vw, 30px); line-height: 1.22; font-weight: 500; text-wrap: pretty; }

form { display: flex; flex-direction: column; gap: 12px; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pair label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; font-size: 16px; color: var(--dim); min-width: 0; }
.field { width: 100%; min-width: 0; font-family: var(--stencil); font-size: 26px; padding: 10px 12px; background: var(--panel); color: var(--chalk); border: 2px solid var(--line); border-radius: 3px; font-variant-numeric: tabular-nums; }
.unit { color: var(--dim); font-size: 16px; }
.worth { min-height: 1.5em; font-size: 18px; font-weight: 500; }
.worth b { color: var(--amber); font-weight: 700; }
.worth.bad { color: var(--miss); }

.verdict { font-family: var(--stencil); font-size: clamp(32px, 9vw, 44px); line-height: 1.05; }
.verdict.hit { color: var(--hit); }
.verdict.miss { color: var(--miss); }
.answer { font-size: 22px; font-weight: 500; }
.answer b { font-weight: 700; color: var(--amber); }
.hint { color: var(--dim); font-size: 16px; }
.axis { width: 100%; height: auto; display: block; }
.axis text { fill: var(--chalk); font-family: var(--text); font-size: 24px; font-weight: 700; }
.axis .rule { stroke: var(--line); stroke-width: 2; }
.axis .band.hit { fill: var(--hit); }
.axis .band.miss { fill: var(--miss); }
.axis .mark { stroke: var(--amber); stroke-width: 3; }
.axis .ans { fill: var(--amber); }

.pct { font-family: var(--stencil); font-weight: 400; font-size: clamp(32px, 9vw, 46px); line-height: 1.06; text-wrap: balance; }
.score { font-size: 20px; font-weight: 500; }
.score b { font-family: var(--stencil); font-size: 30px; font-weight: 400; color: var(--amber); }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 16px; font-variant-numeric: tabular-nums; }
th { text-align: left; color: var(--dim); font-weight: 500; padding: 6px 8px 6px 0; border-bottom: 2px solid var(--line); }
td { padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
td:last-child, th:last-child { text-align: right; padding-right: 0; font-weight: 700; }
td.hit { color: var(--hit); }
td.miss { color: var(--miss); }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.row > .btn { flex: 1 1 170px; }
textarea.field { font-family: var(--text); font-size: 16px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.top-side { color: var(--dim); font-weight: 500; font-size: 16px; }
.preview-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 15px; color: var(--dim); border-bottom: 2px solid var(--line); padding-bottom: 12px; }
.preview-bar button { border: 2px solid var(--line); border-radius: 3px; background: transparent; padding: 4px 10px; font-weight: 700; }
.axis .crowd { fill: var(--dim); }
.crowd-line { font-size: 17px; color: var(--dim); }
.crowd-line b { color: var(--chalk); }
.swatch { display: inline-block; width: 18px; height: 5px; background: var(--dim); vertical-align: middle; margin-right: 8px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(62px, 1fr)); gap: 4px; }
.stats div { background: var(--panel); border: 1px solid var(--line); padding: 10px 8px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.stats b { font-family: var(--stencil); font-weight: 400; font-size: 26px; color: var(--amber); font-variant-numeric: tabular-nums; }
.stats small { color: var(--dim); font-size: 14px; font-weight: 500; }
