/* Leaguewide — shared styles. One family (Archivo) used across its width axis:
   wide + heavy for headlines/scores, condensed for dense data, normal for reading. */
@import url('https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@62..125,300..900&display=swap');

:root {
  /* Card Stock 86: royal blue, card red and yellow on off-white card stock */
  --paper: #FAF6EC;      /* card stock */
  --sheet: #FFFFFF;
  --ink: #141B33;        /* navy ink */
  --ink-2: #4E5570;
  --ink-3: #6B7189;
  --rule: #E0D9C6;
  --gold: #F7C948;       /* card yellow */
  --gold-ink: #141B33;
  --red: #D62828;        /* card red: scorebug, live badges */
  --red-ink: #FFFFFF;
  --dot: rgba(29, 61, 143, .09);   /* halftone print dots */
  --brand: #1D3D8F;      /* royal blue: the Leaguewide mark */
  --team: #1D3D8F;       /* league color; replaced per league */
  --team-ink: #FFFFFF;
  --win: #12805C;
  --loss: #B3261E;
  --focus: #F7C948;
  --radius: 6px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0E1430; --sheet: #161E40; --ink: #F5F1E6; --ink-2: #C3C6D6; --ink-3: #9196AE;
    --rule: #2A3460; --red: #E04545; --dot: rgba(247, 201, 72, .06); --win: #3DBE8E; --loss: #F0675C; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0E1430; --sheet: #161E40; --ink: #F5F1E6; --ink-2: #C3C6D6; --ink-3: #9196AE;
  --rule: #2A3460; --red: #E04545; --dot: rgba(247, 201, 72, .06); --win: #3DBE8E; --loss: #F0675C; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--paper); color: var(--ink);
  font-family: 'Archivo', system-ui, sans-serif; font-variation-settings: 'wdth' 100;
  font-size: 16px; line-height: 1.55; min-height: 100vh;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.4px); background-size: 9px 9px;
}
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* type scale (1.25) */
.display { font-weight: 850; font-variation-settings: 'wdth' 125; letter-spacing: -.01em; line-height: .98;
  font-size: clamp(2.2rem, 7vw, 3.9rem); }
.h1 { font-weight: 800; font-variation-settings: 'wdth' 118; font-size: clamp(1.9rem, 5vw, 2.8rem); line-height: 1.05; }
.h2 { font-weight: 800; font-variation-settings: 'wdth' 112; font-size: clamp(1.45rem, 3.4vw, 1.95rem); line-height: 1.1; }
.h3 { font-weight: 750; font-variation-settings: 'wdth' 105; font-size: 1.15rem; line-height: 1.25; }
.lede { font-size: 1.125rem; color: var(--ink-2); max-width: 36em; }
.small { font-size: .875rem; color: var(--ink-2); }
.cond { font-variation-settings: 'wdth' 70; }
.num { font-variant-numeric: tabular-nums; }

/* masthead */
.mast { border-bottom: 1px solid var(--rule); background: var(--sheet); position: sticky; top: 0; z-index: 20; }
.mast .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 850;
  font-variation-settings: 'wdth' 125; font-size: 1.15rem; letter-spacing: -.01em; }
.logo-mark { width: 26px; height: 18px; background: var(--brand); clip-path: polygon(0 0, 100% 0, 82% 100%, 0 100%); position: relative; }
.logo-mark::after { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 34%; background: var(--red);
  clip-path: polygon(46% 0, 100% 0, 54% 100%, 0 100%); }
.mast nav { display: flex; align-items: center; gap: 6px; }
.mast nav a.link { text-decoration: none; padding: 8px 10px; font-weight: 600; font-size: .95rem; color: var(--ink-2); border-radius: var(--radius); }
.mast nav a.link:hover { color: var(--ink); background: var(--paper); }
@media (max-width: 560px) { .mast nav a.hide-sm { display: none; } }
@media (max-width: 440px) { .mast nav .hide-xs { display: none; } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: var(--radius); border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper);
  font-weight: 750; font-variation-settings: 'wdth' 108; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: transparent; color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn.gold:hover { background: transparent; color: var(--ink); border-color: var(--gold); }
.btn.team { background: var(--team); border-color: var(--team); color: var(--team-ink); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: .9rem; }
.btn.block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--rule); border-color: var(--rule); color: var(--ink-3); cursor: not-allowed; }

/* scorebug: the signature element — slanted broadcast bars */
.bug { display: grid; grid-template-columns: 1fr auto; background: var(--sheet); border: 1px solid var(--rule);
  border-radius: var(--radius); overflow: hidden; font-variant-numeric: tabular-nums; }
.bug-row { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 10px; padding: 7px 12px 7px 0; }
.bug-row + .bug-row { border-top: 1px solid var(--rule); }
.bug-chip { align-self: stretch; }
.bug-name { font-weight: 700; font-variation-settings: 'wdth' 82; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bug-name small { font-weight: 500; color: var(--ink-3); margin-left: 6px; }
.bug-score { font-weight: 850; font-variation-settings: 'wdth' 120; font-size: 1.2rem; }
.bug-row.lead .bug-score { color: var(--ink); }
.bug-row.trail .bug-score { color: var(--ink-3); }
.bug-side { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 0 12px;
  background: var(--red); color: var(--red-ink); font-size: .78rem; font-weight: 700; font-variation-settings: 'wdth' 75;
  clip-path: polygon(14px 0, 100% 0, 100% 100%, 0 100%); padding-left: 22px; text-align: center; line-height: 1.2; }
.bug-side b { color: var(--gold); font-size: .95rem; text-shadow: 0 1px 0 rgba(0,0,0,.25); }

/* cards & panels */
.panel { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); }
.panel-pad { padding: 20px; }
@media (min-width: 720px) { .panel-pad { padding: 28px; } }

/* forms */
.field { display: grid; gap: 6px; }
.field label { font-weight: 650; font-size: .95rem; }
.field .hint { font-size: .85rem; color: var(--ink-3); }
.input { width: 100%; min-height: 46px; padding: 0 14px; border: 1.5px solid var(--rule); border-radius: var(--radius);
  background: var(--sheet); }
.input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 55%, transparent); }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; font-weight: 650; font-size: .82rem; color: var(--ink-3); padding: 8px 10px; border-bottom: 1.5px solid var(--ink);
  font-variation-settings: 'wdth' 80; }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--rule); }
.tbl td.r, .tbl th.r { text-align: right; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: .8rem; font-weight: 650;
  border: 1px solid var(--rule); color: var(--ink-2); background: var(--sheet); white-space: nowrap; }
.pill.gold { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.pill.team { background: var(--team); border-color: var(--team); color: var(--team-ink); }

.foot { border-top: 1px solid var(--rule); margin-top: 72px; padding: 28px 0 40px; color: var(--ink-3); font-size: .85rem; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }
.foot a { color: var(--ink-2); }
.foot .fb-btns { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1px solid var(--rule); }
.foot .fb-btns .btn { color: var(--ink); }

[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
