/* Score charts — the AFT calculator's black and gold, with tables that read on a phone and print on white paper. */
:root {
  --bg: #0d0f0b; --panel: #171a14; --line: #2b2f25; --ink: #f2efe2; --muted: #9b9a88;
  --gold: #f0bf3a; --go: #7ed957; --nogo: #ff6b4a;
  --cond: "Arial Narrow", "Roboto Condensed", "Helvetica Neue", system-ui, sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--sans); }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px 48px; }
.bar { display: flex; gap: 8px; height: 56px; align-items: center; }
.back { color: var(--muted); text-decoration: none; font: 700 .8rem/1 var(--cond); letter-spacing: .1em; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
h1 { margin: 12px 0 0; font: 800 2.4rem/1.05 var(--cond); text-transform: uppercase; }
.sub { margin: 4px 0 16px; color: var(--gold); font: 700 1.1rem/1.2 var(--cond); letter-spacing: .06em; text-transform: uppercase; }

.controls { display: grid; gap: 10px; }
.group { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.group[hidden] { display: none; }
.group.off { opacity: .35; pointer-events: none; }
.tog { height: 60px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel); font: 800 1.1rem/1 var(--cond); letter-spacing: .1em; color: var(--muted); }
.tog small { font-size: .7em; letter-spacing: .05em; opacity: .8; }
.tog[aria-pressed="true"] { border-color: var(--gold); background: var(--gold); color: var(--bg); }
.ages { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.age { height: 52px; border-radius: 10px; border: 2px solid var(--line); background: var(--panel); font: 800 1rem/1 var(--cond); color: var(--muted); font-variant-numeric: tabular-nums; }
.age[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
.note { margin: 18px 0 10px; color: var(--muted); }

.tables { display: grid; gap: 16px; }
.tw { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 7px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
thead th { position: sticky; top: 0; background: var(--panel); color: var(--muted); font: 700 .78rem/1.1 var(--cond); letter-spacing: .08em; text-transform: uppercase; }
table.aft th, table.aft td { padding: 7px 6px; text-align: center; }
table.aft thead th small { display: block; font-size: .85em; letter-spacing: 0; text-transform: none; opacity: .8; }
.key { margin: 0 0 -6px; color: var(--muted); font-size: .85rem; }
tbody th { text-align: left; color: var(--gold); font-weight: 800; }
tbody tr:nth-child(even) { background: rgba(255,255,255,.025); }
tr.min { background: rgba(126,217,87,.14) !important; }
tr.min th::after { content: " min"; color: var(--go); font-size: .75em; font-weight: 700; }
tr.under td, tr.under th, td.u { color: var(--muted); }
table.run th { text-align: left; color: var(--ink); font-weight: 600; }
.print { width: 100%; height: 56px; margin-top: 16px; border-radius: 12px; border: 2px solid var(--line); background: none; font: 800 1rem/1 var(--cond); letter-spacing: .14em; color: var(--muted); }

.about { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; }
.about h2 { color: var(--ink); font: 800 1.3rem/1.2 var(--cond); text-transform: uppercase; }
.about b { color: var(--ink); }
.about a { color: var(--gold); }
.about .small { font-size: .82rem; }

@media (min-width: 640px) { .ages { grid-template-columns: repeat(10, 1fr); } .tables:has(.run) { grid-template-columns: 1fr 1fr; align-items: start; } }

/* on paper: just the title, the selection and the tables, black on white */
@media print {
  :root { --bg: #fff; --panel: #fff; --line: #bbb; --ink: #000; --muted: #444; --gold: #000; --go: #000; }
  body { font-size: 11px; }
  .bar, .controls, .print, .about, .note { display: none; }
  .key { margin: 0 0 4px; }
  h1 { font-size: 20px; margin: 0; } .sub { margin: 0 0 8px; }
  .tw { border: 0; overflow: visible; } th, td { padding: 2px 6px; }
  thead th { position: static; }
  tr.min { background: #e8e8e8 !important; }
  .tables:has(.run) { grid-template-columns: 1fr 1fr; }
}
