/* Exactly 21 (working name): "Matchday bold", dark only. Same family as Last Man Saloon, its own accent (electric cyan). Spec: goals21/SPEC.md section 4. */
:root {
  --bg: #080C10;
  --card: #111820;
  --card-2: #0F2A33;
  --line: #1F2A34;
  --line-2: #18212A;
  --chip: #1A2330;
  --btn-off: #26303B;
  --text: #F1F5F8;
  --text-2: #C3CED8;
  --muted: #8593A0;
  --dim: #4A5663;
  --acc: #3DDCFF;
  --on-acc: #04141A;
  --win: #B8F25B;
  --red: #FF4D4D;
  --red-bg: #2A1416;
  --amber: #FFB020;
  --radius: 12px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--acc); text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); }
.hidden { display: none !important; }

.app { max-width: 460px; margin: 0 auto; padding: 14px 16px 96px; min-height: 100vh; }

/* top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; min-height: 32px; }
.top .back { background: none; border: 0; color: var(--muted); padding: 4px 0; font-size: 14px; }
.top-left { display: inline-flex; align-items: center; gap: 14px; }
.top-home { font-size: 14px; color: var(--acc); padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; }
.brand { font-weight: 800; letter-spacing: .01em; font-size: 17px; display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.brand-mark { min-width: 28px; height: 26px; padding: 0 6px; border-radius: 7px; background: var(--acc); color: var(--on-acc); display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 15px; }
.pill { display: inline-flex; align-items: center; gap: 5px; background: var(--chip); border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.pill.live { color: var(--acc); }
.pill.win { color: var(--win); }
.pill.out { color: var(--red); }
.pill.warn { color: var(--amber); }

/* type */
.k { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
h1 { font-size: 30px; line-height: 1.08; margin: 2px 0 12px; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 20px; margin: 18px 0 8px; font-weight: 700; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }

.card { background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 8px; }
.card.link { display: block; color: var(--text); }
.card.me { border-color: var(--acc); background: var(--card-2); }
.box { background: var(--card); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; color: var(--text-2); font-size: 13px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 50px; border-radius: 12px; border: 0; background: var(--acc); color: var(--on-acc); font-size: 16px; font-weight: 700; }
.btn:disabled, .btn.off { background: var(--btn-off); color: var(--muted); cursor: default; }
.btn.ghost { background: var(--card); color: var(--text); border: 1.5px solid var(--line); }
.btn.danger { background: var(--red-bg); color: var(--red); }
.btn + .btn { margin-top: 8px; }
.link-btn { background: none; border: 0; color: var(--acc); padding: 0; font-size: inherit; }
.link-btn.red { color: var(--red); }

/* forms */
.label { display: block; margin: 12px 0 6px; }
.input { width: 100%; background: var(--card); border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 12px; font-size: 16px; outline: none; }
.input:focus { border-color: var(--acc); }
.err { color: var(--red); font-size: 13px; margin-top: 8px; min-height: 1em; }
.ok-msg { color: var(--win); font-size: 13px; margin-top: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 7px 11px; border-radius: 999px; background: var(--card); border: 1.5px solid var(--line); font-size: 13px; }
.chip.on { background: var(--acc); color: var(--on-acc); border-color: var(--acc); font-weight: 600; }
.seg { display: flex; background: var(--card); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: none; padding: 8px 4px; border-radius: 8px; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--acc); color: var(--on-acc); font-weight: 600; }

.tabs { display: flex; gap: 4px; background: var(--card); border-radius: 10px; padding: 3px; margin-bottom: 12px; }
.tabs a { flex: 1; text-align: center; padding: 7px 0; border-radius: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.tabs a.on { background: var(--acc); color: var(--on-acc); font-weight: 600; }

/* home */
.hero { padding: 26px 0 8px; }
.hero h1 { font-size: 40px; }
.game-card { display: flex; align-items: center; gap: 12px; }
.game-card .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--chip); display: flex; align-items: center; justify-content: center; font-weight: 900; color: var(--acc); flex-shrink: 0; }
.game-card .mid { flex: 1; min-width: 0; }
.game-card .nm { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps .s { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 7px 0; }
.steps .n { width: 24px; height: 24px; border-radius: 50%; background: var(--btn-off); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.steps .n.on { background: var(--acc); color: var(--on-acc); }
.code-box { font-size: 30px; letter-spacing: .25em; font-weight: 800; color: var(--acc); text-align: center; padding: 12px; background: var(--card); border-radius: 12px; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.invite { background: var(--card); border-radius: 16px; padding: 16px; text-align: center; margin-bottom: 12px; }
.invite .shield { width: 52px; height: 52px; border-radius: 14px; background: var(--acc); color: var(--on-acc); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 900; margin: 0 auto 8px; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 50; max-width: calc(100% - 32px); }
.toast.bad { background: var(--red); color: #fff; }
.spinner { text-align: center; color: var(--muted); padding: 40px 0; }
.empty { text-align: center; color: var(--muted); padding: 24px 8px; }
.list-rules { padding-left: 18px; color: var(--text-2); }
.list-rules li { margin-bottom: 8px; }

/* players (lobby) */
.pr { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.av { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; background: var(--chip); }
.av.me { background: var(--acc); color: var(--on-acc); }
.pr .grow { flex: 1; min-width: 0; }
.pr .nm { font-weight: 600; }
.pr .st { font-size: 12px; color: var(--muted); text-align: right; }
.pr .st.ok { color: var(--win); }

/* the table: one row per player, 21 pips for the goals */
.row { background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 11px 12px; margin-bottom: 8px; display: block; color: var(--text); }
.row.me { border-color: var(--acc); background: var(--card-2); }
.row.winner { border-color: var(--win); }
.row.gone { opacity: .55; }
.row-top { display: flex; align-items: center; gap: 10px; }
.row-top .grow { flex: 1; min-width: 0; }
.row-top .nm { font-weight: 700; font-size: 16px; }
.row-top .tm { font-size: 13px; color: var(--text-2); }
.tot { text-align: right; line-height: 1; }
.tot b { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tot small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.pips { display: flex; gap: 2px; margin-top: 9px; }
.pips i { flex: 1; height: 8px; border-radius: 2px; background: var(--line); }
.pips i.f { background: var(--acc); }
.pips i.w { background: var(--win); }
.row .need { margin-top: 7px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.row .need b { color: var(--text); font-weight: 600; }
.live-on { color: var(--acc); font-weight: 600; white-space: nowrap; }
.live-on i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--red); margin-right: 5px; animation: livepulse 1.4s ease-in-out infinite; }
.live-on.bad { color: var(--amber); }
@keyframes livepulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .live-on i { animation: none; } }

.hero-card { border-radius: 18px; padding: 18px 16px; text-align: center; margin-bottom: 14px; background: var(--win); color: #0B1404; }
.hero-card .k { color: inherit; opacity: .8; }
.hero-card .big { font-size: 32px; font-weight: 800; line-height: 1.1; margin: 4px 0; }

/* my team */
.team-card { text-align: center; padding: 18px 12px; }
.team-card .tn { font-size: 26px; font-weight: 800; line-height: 1.15; }
.team-card .big21 { font-size: 64px; font-weight: 900; line-height: 1; color: var(--acc); font-variant-numeric: tabular-nums; margin: 6px 0 2px; }
.team-card .big21 span { font-size: 24px; color: var(--muted); font-weight: 700; }
.res { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.res .when { width: 56px; font-size: 12px; color: var(--muted); flex-shrink: 0; }
.res .grow { flex: 1; min-width: 0; font-size: 14px; }
.res .g { font-weight: 800; font-size: 18px; width: 28px; text-align: right; font-variant-numeric: tabular-nums; }
.res .tag { font-size: 11px; color: var(--muted); text-align: right; min-width: 72px; }
.res.over .g { color: var(--dim); text-decoration: line-through; }
.res.over .tag { color: var(--amber); }
.res.zero .g { color: var(--dim); }

/* the draw reveal */
.rv { background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 8px; display: flex; align-items: center; gap: 12px; min-height: 66px; }
.rv .tm { font-size: 20px; font-weight: 800; }
.rv .q { font-size: 28px; font-weight: 900; color: var(--dim); }
.rv.pending .tm { display: none; }
.rv.done .q { display: none; }
.rv.done { border-color: var(--acc); animation: pop .4s ease-out; }
@keyframes pop { 0% { transform: scale(.97); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .rv.done { animation: none; } }
.seed { font-size: 11px; color: var(--muted); word-break: break-all; margin-top: 4px; }

/* install and notification cards, account switch, button rows */
.card.install { border-color: var(--acc); }
.card.install p { margin: 4px 0 10px; }
.row-btns { display: flex; gap: 8px; }
.row-btns .btn { margin: 0; }
.rule-label { display: flex; justify-content: space-between; font-size: 13px; margin: 12px 0 6px; }
