/* AFT calculator — an arcade cabinet in Army black and gold. Built for one sweaty thumb: nothing smaller than 64px to tap. */
:root {
  --bg: #0d0f0b; --panel: #171a14; --line: #2b2f25; --ink: #f2efe2; --muted: #9b9a88;
  --gold: #f0bf3a; --gold-deep: #c99a2e; --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; user-select: none; -webkit-user-select: none; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.app { max-width: 520px; min-height: 100svh; margin: 0 auto; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.bar { display: flex; align-items: center; gap: 12px; height: 56px; }
.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: 6px 8px; }
.brand { font: 800 1.15rem/1 var(--cond); letter-spacing: .12em; color: var(--ink); }
.brand b { color: var(--gold); }
.pips { margin-left: auto; display: flex; gap: 6px; }
.pips i { width: 14px; height: 14px; border-radius: 3px; background: var(--line); cursor: pointer; }
.pips i.done { background: var(--gold-deep); }
.pips i.on { background: var(--gold); box-shadow: 0 0 0 3px rgba(240,191,58,.25); }

.screen { flex: 1; display: flex; flex-direction: column; align-items: stretch; gap: 18px; padding-top: 12px; }
.screen[hidden] { display: none; }
.title { margin: 18px 0 0; font: 800 2.6rem/1 var(--cond); letter-spacing: .01em; text-transform: uppercase; }
.title span { color: var(--gold); }
.sub { margin: -8px 0 6px; color: var(--muted); }
.group { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tog { height: 72px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel); font: 800 1.2rem/1 var(--cond); letter-spacing: .12em; color: var(--muted); }
.tog[aria-pressed="true"] { border-color: var(--gold); color: var(--bg); background: var(--gold); }
.hint { margin: -6px 0 0; color: var(--muted); font-size: .9rem; text-align: center; }

.stepper { display: flex; flex-direction: column; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.stepper .label { font: 700 .8rem/1 var(--cond); letter-spacing: .14em; color: var(--muted); }
.stepper .row { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; }
.sb { flex: 1 1 0; min-width: 0; height: 72px; border-radius: 14px; border: 0; background: #262a20; font: 800 1.6rem/1 var(--cond); color: var(--ink); cursor: pointer; }
.sb.big { background: #31361f; color: var(--gold); font-size: 1.3rem; }
.sb:active { transform: scale(.96); background: #3a3f2c; }
.val { flex: 0 0 auto; min-width: 2.5ch; text-align: center; font: 800 2.4rem/1 var(--cond); font-variant-numeric: tabular-nums; }
.val.huge { font-size: 5.2rem; color: var(--gold); text-shadow: 0 0 24px rgba(240,191,58,.25); letter-spacing: .02em; }
.unit { font: 700 .8rem/1 var(--cond); letter-spacing: .2em; color: var(--muted); margin-top: -4px; }
.evno { margin: 8px 0 0; font: 700 .8rem/1 var(--cond); letter-spacing: .2em; color: var(--muted); text-align: center; }
.evname { margin: 0; font: 800 1.9rem/1.05 var(--cond); text-align: center; text-transform: uppercase; }
.pts { display: flex; align-items: baseline; justify-content: center; gap: 10px; }
.ptsn { font: 800 3.4rem/1 var(--cond); font-variant-numeric: tabular-nums; color: var(--go); }
.ptsn.low { color: var(--nogo); }
.ptsn.pop { animation: pop .18s ease-out; }
@keyframes pop { from { transform: scale(1.18); } to { transform: none; } }
.ptsl { font: 700 .85rem/1 var(--cond); letter-spacing: .2em; color: var(--muted); }
.meter { position: relative; height: 12px; border-radius: 6px; background: var(--line); }
.meter i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 6px; background: var(--go); transition: width .15s ease-out; }
.meter i.low { background: var(--nogo); }
.meter b { position: absolute; left: 60%; top: -4px; bottom: -4px; width: 3px; background: var(--ink); opacity: .6; }
.next { margin: 0; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }

/* how it's done: a button under the event name, and a bottom sheet */
.info { align-self: center; height: 44px; padding: 0 18px; border-radius: 22px; border: 2px solid var(--line); background: none; color: var(--gold); font: 800 .9rem/1 var(--cond); letter-spacing: .12em; cursor: pointer; }
.sheet { position: fixed; inset: 0; z-index: 10; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,.6); }
.sheet[hidden] { display: none; }
.sheet-card { width: min(520px, 100%); max-height: 88svh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0; padding: 20px 20px calc(16px + env(safe-area-inset-bottom)); }
.sheet-card h3 { margin: 0 0 8px; font: 800 1.5rem/1.1 var(--cond); text-transform: uppercase; color: var(--gold); }
.sheet-card h4 { margin: 14px 0 4px; font: 700 .8rem/1 var(--cond); letter-spacing: .18em; color: var(--muted); }
.sheet-card p, .sheet-card li { margin: 0; line-height: 1.45; }
.sheet-card ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.sheet-card .tip { margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: #262a20; }
.sheet-card .src { margin-top: 12px; font-size: .85rem; }
.sheet-card .src a { color: var(--gold); }
.sheet-card .close { width: 100%; height: 64px; margin-top: 16px; border-radius: 14px; border: 0; background: var(--gold); color: var(--bg); font: 800 1.2rem/1 var(--cond); letter-spacing: .12em; cursor: pointer; }

/* the result */
.board { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.brow { display: grid; grid-template-columns: 1fr auto 4ch; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); opacity: .45; transition: opacity .2s; }
.brow.lit { opacity: 1; }
.bn { font: 700 1rem/1.15 var(--cond); text-transform: uppercase; letter-spacing: .03em; }
.bv { color: var(--muted); font-variant-numeric: tabular-nums; }
.bp { font: 800 1.7rem/1 var(--cond); text-align: right; color: var(--go); font-variant-numeric: tabular-nums; }
.bp.low { color: var(--nogo); }
.total { display: flex; align-items: baseline; justify-content: center; gap: 10px; margin-top: 6px; }
.tl { font: 700 .9rem/1 var(--cond); letter-spacing: .2em; color: var(--muted); }
.tn { font: 800 5rem/1 var(--cond); color: var(--gold); font-variant-numeric: tabular-nums; text-shadow: 0 0 28px rgba(240,191,58,.3); }
.tm { font: 700 1.4rem/1 var(--cond); color: var(--muted); }
.stamp { align-self: center; min-height: 64px; font: 900 3rem/1 var(--cond); letter-spacing: .1em; padding: 6px 20px; border-radius: 10px; border: 5px solid transparent; transform: scale(0) rotate(-12deg); }
.stamp.on { transform: scale(1) rotate(-6deg); transition: transform .32s cubic-bezier(.2, 1.6, .4, 1); }
.stamp.go { color: var(--go); border-color: var(--go); }
.stamp.nogo { color: var(--nogo); border-color: var(--nogo); }
.verdict { margin: -4px 0 0; text-align: center; color: var(--ink); }
.cta { display: block; text-align: center; padding: 20px; border-radius: 14px; background: var(--gold); color: var(--bg); font: 800 1.25rem/1 var(--cond); letter-spacing: .1em; text-decoration: none; }
.ctanote { margin: -8px 0 0; text-align: center; color: var(--muted); font-size: .85rem; }
.again { height: 56px; border-radius: 12px; border: 2px solid var(--line); background: none; font: 800 1rem/1 var(--cond); letter-spacing: .14em; color: var(--muted); }

/* the thumb bar */
.foot { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 10px; max-width: 520px; margin: 0 auto; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); }
.nav { height: 72px; border-radius: 14px; border: 0; font: 800 1.35rem/1 var(--cond); letter-spacing: .1em; cursor: pointer; }
.nav.prev { width: 80px; background: var(--panel); color: var(--muted); }
.nav.go { flex: 1; background: var(--gold); color: var(--bg); }
.nav.skip { width: 104px; background: none; border: 2px solid var(--line); color: var(--muted); font-size: 1.1rem; }
/* a skipped event: the number dims until you touch it */
.screen.ev.skipped .val.huge, .screen.ev.skipped .pts, .screen.ev.skipped .meter { opacity: .3; }
.screen.ev.skipped .next { color: var(--gold); }
.pips i.sk { background: none; box-shadow: inset 0 0 0 2px var(--gold-deep); }
.brow.skip .bn, .brow.skip .bv { color: var(--muted); }
.bp.sk { font-size: .85rem; letter-spacing: .1em; color: var(--muted); }
.stamp.practice { color: var(--gold); border-color: var(--gold); font-size: 2.2rem; }
.nav[hidden], .foot[hidden] { display: none; }

.about { max-width: 520px; margin: 0 auto; padding: 24px 16px 48px; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); }
.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: .8rem; }

@media (min-width: 900px) { .app { padding-top: 24px; } }
@media (prefers-reduced-motion: reduce) { .ptsn.pop { animation: none; } .meter i { transition: none; } .stamp.on { transition: none; } .brow { transition: none; } }
