/* Baller to Baller — editorial look.
   Light mode is a printed sports page: off-white paper, heavy black ink, one bold accent per sport
   (pitch green for football, hardwood orange for NBA, gold for NFL). Dark mode is warm matte charcoal.
   No glows, gradients or neon. The game is one board: Start on top, Target at the bottom, and the
   chain of guesses in between, joined by a single line. */

/* ---------- Sport accents (a light-mode and a dark-mode value each) ---------- */
:root, :root[data-sport="soccer"] { --acc-l: #1d7a3e; --acc-d: #5cc27e; }
:root[data-sport="nba"] { --acc-l: #b44a18; --acc-d: #ef7b3e; }
:root[data-sport="nfl"] { --acc-l: #8c6a10; --acc-d: #d8b04a; }

/* ---------- Light: paper and ink ---------- */
:root {
  --bg: #f7f6f2; --surface: #fffefb; --surface-2: #efede6;
  --ink: #141412; --muted: #5f5c55; --line: #dedbd2; --line-strong: #b9b5aa;
  --accent: var(--acc-l); --accent-ink: #ffffff;
  --good: #1d7a3e; --bad: #b3261e; --hint: #855f00;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, system-ui, sans-serif;
  --body: "Barlow", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --r: 4px;
}
/* ---------- Dark: warm matte charcoal ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1a18; --surface: #23221f; --surface-2: #2b2a26;
    --ink: #f1eee7; --muted: #a6a197; --line: #383631; --line-strong: #57534b;
    --accent: var(--acc-d); --accent-ink: #1b1a18;
    --good: #5cc27e; --bad: #ff7a6b; --hint: #e2b446;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1b1a18; --surface: #23221f; --surface-2: #2b2a26;
  --ink: #f1eee7; --muted: #a6a197; --line: #383631; --line-strong: #57534b;
  --accent: var(--acc-d); --accent-ink: #1b1a18;
  --good: #5cc27e; --bad: #ff7a6b; --hint: #e2b446;
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--body); min-height: 100vh; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap {
  max-width: 560px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- Header: masthead ---------- */
.hero { background: var(--bg); border-bottom: 4px solid var(--accent); }
.hero .wrap { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding-block: 16px 14px; }
.brand { text-align: center; min-width: 0; }
.brand h1 {
  margin: 0; display: flex; align-items: center; justify-content: center; white-space: nowrap;
  font: 900 clamp(30px, 8vw, 40px)/1 var(--display); letter-spacing: .01em; text-transform: uppercase; color: var(--ink);
}
/* Signature mark: two players (a filled node and a ring) joined by a link. The board below uses the same marks. */
.mark { display: inline-flex; align-items: center; flex: none; font: 700 .3em var(--body); margin: 0 .5em; }
.mark i { display: block; width: 1em; height: 1em; border-radius: 50%; }
.mark .n1 { background: var(--ink); }
.mark .n2 { border: .24em solid var(--accent); }
.mark span {
  padding: 0 .85em; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); line-height: 1;
  background:
    linear-gradient(var(--ink), var(--ink)) left center / .6em 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) right center / .6em 2px no-repeat;
}
.brand .sub { font: 600 11px var(--body); margin-top: 8px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.icon-btn {
  width: 36px; height: 36px; border-radius: var(--r); border: 1px solid var(--line);
  background: transparent; color: var(--ink); display: grid; place-items: center;
  font: 700 16px var(--body); text-decoration: none; transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.hdr-side { display: flex; gap: 6px; }
.hdr-side.right { justify-content: flex-end; }

main { padding-block: 6px 28px; }

/* ---------- Sport nav and difficulty ---------- */
.sport-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.sport-tabs button {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 4px 12px; border: none; background: none; color: var(--muted);
  font: 600 15px var(--body); transition: color .15s, box-shadow .2s;
}
.sport-tabs button svg { width: 19px; height: 19px; flex: none; }
.sport-tabs button:hover { color: var(--ink); }
.sport-tabs button[aria-pressed="true"] { color: var(--ink); box-shadow: inset 0 -3px 0 var(--accent); }
.sport-tabs button:not([data-done="0"])::after {
  content: attr(data-done) "/3"; position: absolute; top: 5px; right: 4px;
  font: 600 9px var(--mono); color: var(--muted);
}
.sport-tabs button[data-done="3"]::after { content: "✓"; color: var(--good); font-size: 11px; }

.diff-tabs, .stats-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--r); padding: 3px; gap: 3px; background: var(--surface); }
.diff-tabs { margin-bottom: 12px; }
.diff-tabs button, .stats-tabs button {
  border: none; background: none; border-radius: 2px; color: var(--muted); padding: 7px 0;
  font: 700 12px var(--body); letter-spacing: .12em; text-transform: uppercase; transition: background .15s, color .15s;
}
.diff-tabs button:hover, .stats-tabs button:hover { color: var(--ink); }
.diff-tabs button[aria-pressed="true"], .stats-tabs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.diff-tabs button[data-status="won"]::before { content: "✓ "; color: var(--good); }
.diff-tabs button[data-status="lost"]::before { content: "✕ "; color: var(--bad); }
.diff-tabs button[aria-pressed="true"][data-status]::before { color: inherit; }

.today-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted); margin: 0 2px 12px;
}
.today-bar b { color: var(--ink); font-family: var(--mono); }
.today-bar .streak { font-weight: 700; color: var(--accent); }

.loading-msg { display: none; text-align: center; color: var(--muted); padding: 56px 0; font: 13px var(--mono); }
#game.loading .loading-msg { display: block; }
#game.loading .game-body { display: none; }

/* ---------- The board ---------- */
.board { position: relative; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--ink); border-radius: var(--r); }
.board-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid var(--line);
}
.par { font: 700 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.par::before { content: "Par · "; color: var(--muted); font-weight: 500; }
.meter { display: flex; align-items: center; gap: 10px; }
.pips { display: flex; gap: 3px; }
.pip { width: 12px; height: 6px; border-radius: 1px; background: var(--line); transition: background .2s; }
.pip.ok { background: var(--ink); }
.pip.miss { background: var(--bad); }
.pip.hint { background: var(--hint); }
.meter-text { font: 500 12px var(--mono); color: var(--muted); white-space: nowrap; }

/* Every row sits on one vertical line, with its marker centred on it (x = 27px). */
.endpoint, .chain li, .slot-input { position: relative; }
.endpoint::before, .chain li::before, .slot-input::before {
  content: ""; position: absolute; left: 26px; width: 2px; top: 0; bottom: 0; background: var(--ink); transform-origin: top;
}
.endpoint.start::before { top: 30px; }
.endpoint.target::before { bottom: auto; height: 30px; }
/* the part of the route still to find is dashed */
.chain[data-state="playing"] li:last-child::before, .chain[data-state="lost"] li:last-child::before,
.slot-input::before, .slots li::before {
  background: repeating-linear-gradient(180deg, var(--line-strong) 0 4px, transparent 4px 8px);
}
.step {
  position: absolute; left: 16px; top: 50%; margin-top: -11px; z-index: 1;
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font: 700 11px var(--mono); background: var(--ink); color: var(--bg);
}

.endpoint { padding: 16px 16px 16px 52px; }
.endpoint .step { top: 19px; margin-top: 0; }
.endpoint.start .step { background: var(--accent); }
.endpoint.target .step { background: var(--surface); border: 4px solid var(--accent); }
.endpoint.target.reached .step { background: var(--accent); border-color: var(--accent); }
.endpoint .lbl { font: 700 10px var(--body); text-transform: uppercase; letter-spacing: .18em; color: var(--muted); }
.endpoint .nm { font: 700 23px/1.15 var(--body); letter-spacing: -.01em; margin-top: 2px; overflow-wrap: anywhere; }
.endpoint .yrs { font: 500 12px var(--mono); color: var(--muted); margin-top: 2px; }
.teams { display: block; font-size: 12px; line-height: 1.4; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.teams.pills { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.pill {
  font: 600 12px/1 var(--body); color: var(--ink); padding: 5px 9px; border-radius: 3px;
  background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap;
}
.pill.more { color: var(--muted); background: none; }

.chain { list-style: none; margin: 0; padding: 0; }
.via { font-size: 12px; color: var(--muted); padding: 5px 16px 5px 52px; min-height: 16px; }
.via b { color: var(--ink); font-weight: 600; }
.node { position: relative; padding: 9px 16px 9px 52px; min-height: 40px; display: flex; align-items: center; }
.node .who { font-weight: 600; font-size: 15px; min-width: 0; overflow-wrap: anywhere; }
.node .who small { color: var(--muted); font: 500 11px var(--mono); margin-left: 6px; white-space: nowrap; }
.node.reveal .step { background: var(--surface); color: var(--muted); border: 2px dashed var(--line-strong); }
.node.reveal .who { color: var(--muted); }
.node.empty .step { background: var(--surface); border: 2px dashed var(--line-strong); }
.node.empty .who { display: block; width: 46%; height: 9px; border-radius: 2px; background: var(--surface-2); }

.slot-input { padding: 6px 16px 6px 52px; }
.slot-input::after {  /* "your next guess" marker */
  content: ""; position: absolute; left: 18px; top: 29px; width: 18px; height: 18px; margin-top: -9px;
  border-radius: 50%; background: var(--surface); border: 2px solid var(--ink); z-index: 1;
}
.ac-wrap { position: relative; }
#guessInput {
  width: 100%; padding: 12px 14px; font: 500 16px var(--body); color: var(--ink);
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--r);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
#guessInput:focus { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
#guessInput::placeholder { color: var(--muted); }
.ac {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5;
  list-style: none; margin: 0; padding: 4px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r);
  box-shadow: 0 10px 24px -12px rgba(20, 18, 15, .35);
  max-height: 300px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.ac:empty { display: none; }
.ac li { padding: 9px 10px; border-radius: 2px; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.ac li span { flex: 1; min-width: 0; font-weight: 600; }
.ac li small { color: var(--muted); white-space: nowrap; font: 500 11px var(--mono); }
.ac li.active, .ac li:hover { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
.ac li .teams { margin-top: 1px; font-size: 11.5px; font-weight: 400; }
.ac li.empty { color: var(--muted); cursor: default; font-size: 14px; }
.ac li.empty:hover { background: none; box-shadow: none; }
.toast { min-height: 0; font-size: 13.5px; font-weight: 600; }
.toast:not(:empty) { margin-top: 8px; }
.toast.bad { color: var(--bad); }
.toast.good { color: var(--good); }
.toast.hint { color: var(--hint); }

/* ---------- Buttons ---------- */
.row-btns { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.btn {
  border: 1px solid var(--ink); background: var(--ink); color: var(--bg); border-radius: var(--r);
  padding: 11px 20px; font: 700 13px var(--body); letter-spacing: .06em; text-transform: uppercase;
  transition: transform .12s ease, background .15s, color .15s;
}
.btn:hover { background: color-mix(in srgb, var(--ink) 86%, var(--bg)); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); flex: 1; min-width: 0; padding: 10px 8px; font-size: 11.5px; letter-spacing: .04em; white-space: nowrap; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.ghost.danger { color: var(--bad); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

/* ---------- Result ---------- */
.result { margin-top: 14px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--r); }
.result .banner { padding: 20px 16px 4px; }
.result h2 { font: 900 40px/1 var(--display); text-transform: uppercase; letter-spacing: .01em; margin: 0; color: var(--ink); }
.result .score { margin-top: 8px; font: 500 12px var(--mono); color: var(--muted); }
.streak-pill { display: inline-block; margin-top: 10px; padding: 3px 10px; border-radius: 3px; font: 700 12px var(--mono); color: var(--accent); border: 1px solid var(--accent); }
.result .body { padding: 12px 16px 18px; }
.result .grid { font-size: 20px; letter-spacing: 3px; margin-bottom: 14px; }
.result-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; align-items: center; }
.result-actions .btn.ghost { flex: 0 1 auto; }
.alldone { font-weight: 700; color: var(--good); }
.result .link-btn { margin-top: 12px; font-size: 13px; }
.result .next { font-size: 12px; color: var(--muted); margin-top: 14px; text-transform: uppercase; letter-spacing: .08em; }
.result .next b { color: var(--ink); font: 600 14px var(--mono); letter-spacing: .04em; }
#shareText { display: block; width: 100%; margin-top: 10px; padding: 8px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 13px/1.4 var(--mono); resize: none; }

/* ---------- Tip link under the result ---------- */
.coffee-row { margin: 12px 0 0; text-align: center; font-size: 13.5px; color: var(--muted); }
.coffee-row a { color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* ---------- The one ad (after a finished puzzle only) ---------- */
.ad-slot { margin-top: 14px; padding: 8px 0 0; border-top: 1px solid var(--line); text-align: center; min-height: 120px; }
.ad-label { display: block; font: 600 10px var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.adsbygoogle { display: block; }

/* ---------- Practice link and footer (one line, the board owns the page) ---------- */
.practice-row { text-align: center; margin-top: 18px; }
.link-btn { background: none; border: none; padding: 0; color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.site-foot { border-top: 1px solid var(--line); padding: 16px 16px max(24px, env(safe-area-inset-bottom, 0px)); text-align: center; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; }
.foot-links a, .foot-links button { background: none; border: 0; padding: 2px 0; color: var(--muted); font: 500 13px var(--body); text-decoration: none; }
.foot-links a:hover, .foot-links button:hover { color: var(--ink); }
.foot-note { margin: 8px 0 0; font-size: 11.5px; color: var(--muted); }

/* ---------- Dialogs ---------- */
dialog {
  color: var(--ink); padding: 0; overflow: hidden; background: var(--surface);
  border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--r);
  max-width: 440px; width: calc(100% - 32px);
  max-height: min(88vh, 760px); max-height: min(88dvh, 760px);
  box-shadow: 0 24px 48px -20px rgba(20, 18, 15, .45);
}
/* Header stays put; only the text underneath scrolls, so the title is never cut off on phones. */
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: rgba(20, 18, 15, .5); }
dialog .dlg-head { flex: none; padding: 16px 22px 12px; border-bottom: 1px solid var(--line); }
dialog .dlg-body { padding: 14px 22px 20px; overflow-y: auto; overscroll-behavior: contain; }
dialog h2 { font: 900 28px/1.05 var(--display); text-transform: uppercase; letter-spacing: .01em; margin: 0; }
dialog h2:focus { outline: none; }
dialog h3 { font: 700 11px var(--body); text-transform: uppercase; letter-spacing: .16em; margin: 16px 0 8px; color: var(--muted); }
dialog ul { padding-left: 18px; margin: 8px 0; }
dialog li { margin-bottom: 6px; }
dialog .fine { font-size: 12px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; margin-bottom: 16px; }
.stats .n { font: 700 24px var(--mono); }
.stats .l { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
#statsBody h3:first-child { margin-top: 4px; }
#statsBody .stats { grid-template-columns: repeat(5, 1fr); }
#statsBody .stats .n { font-size: 21px; }
.stats-tabs { margin-bottom: 8px; }
.stats-tabs button { padding: 6px 0; font-size: 11px; }
.stats-table { width: 100%; border-collapse: collapse; font: 13px var(--mono); margin-bottom: 8px; }
.stats-table th, .stats-table td { padding: 7px 4px; text-align: center; border-bottom: 1px solid var(--line); }
.stats-table thead th { font: 700 9px var(--body); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.stats-table tbody th { text-align: left; font: 700 13px var(--body); }
.stats-table tr.total th, .stats-table tr.total td { border-bottom: none; font-weight: 700; }

/* How to play */
.help-lead { margin: 0 0 10px; font-weight: 600; }
.help-steps { margin: 0 0 6px; padding-left: 20px; }
.help-steps li { margin-bottom: 6px; }
.help-steps li::marker { font-family: var(--mono); color: var(--accent); font-weight: 700; }
.help-modes { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0 0 12px; font-size: 14px; }
.help-modes dt { font: 700 14px var(--body); }
.help-modes dd { margin: 0; color: var(--muted); }
.help-modes dd::first-letter { text-transform: uppercase; }
.credits { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.credits summary { cursor: pointer; font: 600 13px var(--body); color: var(--muted); }
.credits p { font-size: 12px; line-height: 1.6; color: var(--muted); margin: 8px 0 0; }
.credits a, .help-links a { color: inherit; }
.help-links { margin: 10px 0 0; font-size: 12px; color: var(--muted); }

/* Privacy settings */
.cookie-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.cookie-actions .btn { flex: 1 1 140px; }
.cookie-cat { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cookie-cat p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.cookie-cat .btn.ghost { flex: none; padding: 8px 12px; }
.cookie-cat .always { font: 700 11px var(--mono); color: var(--good); white-space: nowrap; text-transform: uppercase; }
.switch {
  appearance: none; flex: none; width: 44px; height: 24px; border-radius: 12px; margin-top: 2px;
  background: var(--surface-2); border: 1px solid var(--line-strong); position: relative; cursor: pointer; transition: background .15s;
}
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch:checked { background: var(--accent); border-color: var(--accent); }
.switch:checked::after { transform: translateX(20px); background: var(--accent-ink); }

/* ---------- Win confetti ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 60; }
.confetti i { position: absolute; top: -12px; width: 6px; height: 12px; border-radius: 1px; background: var(--accent); animation: confetti-fall linear forwards; }
.confetti i:nth-child(3n) { background: var(--ink); }
.confetti i:nth-child(3n+1) { background: var(--hint); width: 7px; height: 7px; }
@keyframes confetti-fall { to { transform: translate(var(--drift), 105vh) rotate(var(--spin)); opacity: .9; } }

/* ---------- Motion: purposeful, small ---------- */
.board.enter .endpoint .nm { animation: rise .45s cubic-bezier(.2, .8, .2, 1) both; }
.board.enter .endpoint.target .nm { animation-delay: .08s; }
.board.enter .pill { animation: fade-in .4s .18s both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
/* a new link drops in while the line draws down to it */
.node.fresh { animation: node-in .34s cubic-bezier(.2, .8, .2, 1) both; }
.chain[data-state="playing"] li:has(+ li .node.fresh)::before { animation: draw .26s ease-out both; }
/* a finished chain plays back one link at a time */
.chain:not([data-state="playing"]) .node.fresh { animation-delay: calc(var(--i, 0) * 90ms); }
.chain:not([data-state="playing"]) li::before { animation: draw .24s ease-out both; animation-delay: calc(var(--i, 0) * 90ms - 60ms); }
.chain[data-state="revealed"] .node.reveal.fresh { animation-name: flip-in; animation-duration: .45s; }
.chain[data-state="won"] .step { animation: lit .7s ease-out both; animation-delay: calc(var(--i, 0) * 90ms + .2s); }
.endpoint.target.reached .step { animation: lit .8s ease-out both; }
@keyframes node-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes draw { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes flip-in { from { opacity: 0; transform: perspective(600px) rotateX(70deg); } to { opacity: 1; transform: none; } }
@keyframes lit { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); } 100% { box-shadow: 0 0 0 9px transparent; } }
#guessInput.shake { animation: shake .38s ease-in-out; }
#guessInput.flash { animation: flash .7s ease-out; }
@keyframes shake {
  0%, 100% { transform: none; }
  20% { transform: translateX(-7px); border-color: var(--bad); }
  40% { transform: translateX(6px); border-color: var(--bad); }
  60% { transform: translateX(-4px); border-color: var(--bad); }
  80% { transform: translateX(2px); }
}
@keyframes flash { 0% { border-color: var(--good); box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 40%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
.result { animation: rise .4s ease-out both; }
.result h2 { animation: stamp .5s cubic-bezier(.2, 1.3, .4, 1) .1s both; }
@keyframes stamp { from { opacity: 0; transform: scale(1.18); } to { opacity: 1; transform: none; } }
.sport-tabs button svg { transition: transform .25s cubic-bezier(.2, 1.3, .4, 1); }
.sport-tabs button[aria-pressed="true"] svg { transform: rotate(-12deg); }

/* ---------- Utilities ---------- */
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Phones ---------- */
@media (max-width: 440px) {
  .brand h1 { font-size: 28px; }
  .mark { margin: 0 .4em; }
  .hdr-side .icon-btn { width: 34px; height: 34px; }
  .hero .wrap { gap: 6px; }
  .sport-tabs button { font-size: 14px; gap: 6px; }
  .sport-tabs button svg { width: 16px; height: 16px; }
  .endpoint .nm { font-size: 21px; }
  #statsBody .stats { grid-template-columns: repeat(3, 1fr); }
}
/* Phones: while typing a guess, add room below the page so the input can scroll up near the top,
   leaving space for the suggestions above the on-screen keyboard. */
@media (max-width: 600px) { body.typing { padding-bottom: 70vh; } }
