/* The web viewer: Floodlight always (tokens.css), the app's scoreboard and the Tape.
   Spacing 4/8/12/16/24/32, cards 20, tiles 14, chips pill (Design/CLAUDE.md). */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font: 17px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  background: var(--background);
  color: var(--textPrimary);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--accent); }
.num, .cap { font-family: "Barlow Condensed", sans-serif; font-variant-numeric: tabular-nums; }
.cap { font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; }
.t2 { color: var(--textSecondary); }
.t3 { color: var(--textTertiary); }

main { max-width: 640px; margin: 0 auto; padding: 16px 16px 32px; display: flex; flex-direction: column; gap: 16px; }
header.top { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.wordmark { font: 700 22px "Barlow Condensed", sans-serif; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; color: var(--textPrimary); }
.wordmark b { color: var(--accent); }
.pill { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 12px; background: var(--accentSoft); color: var(--textPrimary); }
.pill.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--negative); }
.pill.live.stale::before { background: var(--textTertiary); }

/* The Scoreboard header */
.scoreboard { background: var(--scoreboard); color: var(--onScoreboard); border-radius: 22px; padding: 16px 16px 12px; position: relative; overflow: hidden; }
.scoreboard::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(color-mix(in srgb, var(--onScoreboard) 9%, transparent) 1px, transparent 1.2px); background-size: 5px 5px; }
.sbrow { display: flex; align-items: center; justify-content: space-between; position: relative; gap: 8px; }
.team { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.team .nm { font: 600 14px "Barlow Condensed", sans-serif; letter-spacing: .08em; text-transform: uppercase; display: flex; align-items: center; gap: 6px; max-width: 100%;
  color: color-mix(in srgb, var(--onScoreboard) 75%, transparent); }
.team .nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.score { font: 700 clamp(56px, 18vw, 88px)/.9 "Barlow Condensed", sans-serif; font-variant-numeric: tabular-nums; }
.score.pulse { animation: pulse .6s ease-out; }
@keyframes pulse { 0% { color: var(--accent); transform: scale(1.08); } 100% { transform: none; } }
.mid { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; }
.clock { font: 600 clamp(36px, 11vw, 48px)/1 "Barlow Condensed", sans-serif; font-variant-numeric: tabular-nums; }
.per { font: 600 13px "Barlow Condensed", sans-serif; letter-spacing: .12em; color: color-mix(in srgb, var(--onScoreboard) 70%, transparent); }
.sbfoot { position: relative; margin-top: 10px; text-align: center; font: 600 13px "Barlow Condensed", sans-serif; letter-spacing: .06em;
  color: color-mix(in srgb, var(--onScoreboard) 70%, transparent); min-height: 18px; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--divider); border-radius: 20px; padding: 12px 16px; }
.card > h2 { margin-bottom: 4px; color: var(--textSecondary); }

/* The Tape: a tick per play, oldest left, then the ruled scorebook log */
.ticks { display: flex; align-items: flex-end; gap: 4px; height: 40px; border-bottom: 2px solid var(--divider); padding: 0 4px; margin: 8px 0 4px; overflow: hidden; }
.ticks i { width: 4px; border-radius: 2px; flex: none; }
.ticks i.us { background: var(--chart1); height: 24px; }
.ticks i.them { background: var(--negative); height: 18px; }
.ticks i.miss { background: none; border: 1.2px solid currentColor; height: 12px; }
.ticks i.miss.us { color: var(--chart2); }
.ticks i.miss.them { color: var(--negative); }
.ticks i.other { background: var(--textTertiary); height: 8px; }
ol.log { list-style: none; }
ol.log li { display: flex; gap: 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--divider); }
ol.log li:last-child { border-bottom: 0; }
ol.log .when { width: 52px; flex: none; text-align: right; font-size: 17px; font-weight: 600; color: var(--textSecondary); }
ol.log .side { width: 4px; align-self: stretch; border-radius: 2px; flex: none; }
ol.log .what { font-size: 15px; }
ol.log li.miss .what { color: var(--textSecondary); }
.more { display: block; width: 100%; min-height: 44px; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }

/* Box score */
.box { width: 100%; border-collapse: collapse; font-size: 15px; }
.box th { font: 600 13px "Barlow Condensed", sans-serif; letter-spacing: .08em; color: var(--textTertiary); text-align: right; padding: 4px 0 4px 8px; }
.box th:first-child, .box td:first-child { text-align: left; padding-left: 0; }
.box td { padding: 8px 0 8px 8px; border-top: 1px solid var(--divider); text-align: right; font: 600 17px "Barlow Condensed", sans-serif; font-variant-numeric: tabular-nums; }
.box td:first-child { font: 15px -apple-system, BlinkMacSystemFont, system-ui, sans-serif; }
.box td:first-child .num { display: inline-block; width: 28px; color: var(--textSecondary); font-weight: 700; font-size: 17px; }

/* Messages, the join page */
.message { text-align: center; padding: 32px 16px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.message h1 { font: 700 28px "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: .02em; }
.message p { color: var(--textSecondary); max-width: 420px; }
.code { font: 700 40px "Barlow Condensed", sans-serif; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.btn { display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: 14px; padding: 0 24px; width: 100%; max-width: 360px;
  font-weight: 700; text-decoration: none; }
.btn.pri { background: var(--accent); color: var(--onAccent); }
.btn.sec { background: var(--accentSoft); color: var(--textPrimary); }
footer { text-align: center; font-size: 13px; color: var(--textTertiary); padding-top: 8px; }
footer a { color: var(--textSecondary); }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .score.pulse { animation: none; }
}

/* The board's sections sit in the page's column, spaced like the rest */
#board { display: contents; }
