/* The station board: Barlow Condensed for the wordmark, questions, readings
   and buttons. OFL, files in /fonts. */
@font-face {
  font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap;
  src: url('/fonts/barlow-condensed-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow Condensed'; font-weight: 700; font-display: swap;
  src: url('/fonts/barlow-condensed-latin-700-normal.woff2') format('woff2');
}

:root {
  /* Panels are slate in light and dark alike: a readings board on the sky. */
  --card: #2a374b; --key: #34435a; --text: #eef3fa; --muted: #a9b6c8; --line: #3f4f68;
  /* Yes/no colours pass WCAG AA (≥4.5:1) with white text. */
  --yes: #15803d; --no: #c2410c; --accent: #8fb4ff; --gold: #fbbf24;
  /* Text versions of yes/no, light enough to read on the slate. */
  --yes-ink: #4ade80; --no-ink: #fb923c;
  --radius: 12px; --key-radius: 10px;
  --font-display: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', system-ui, sans-serif;
  --emoji: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  /* Sky theme: top and bottom colours, plus readable ink for each. */
  --sky-top: #587091; --sky-bottom: #c9d3df; --ink-top: #fff; --ink-bottom: #1d2b44; --logo-or: #ffd23f;
  /* Doubled: the logo yellow, always with dark text, so it never reads as No. */
  --double: #ffd23f; --double-ink: #1b1300;
  /* Dark enough behind white text for 4.5:1 on the lightest sky it sits on. */
  --now-chip: rgb(10 20 40 / .5);
}
:root[data-sky='sunny']  { --sky-top: #1a73d0; --sky-bottom: #ffd68a; --ink-top: #fff; --ink-bottom: #3d2b00; }
:root[data-sky='cloudy'] { --sky-top: #587091; --sky-bottom: #c9d3df; --ink-top: #fff; --ink-bottom: #1d2b44; }
:root[data-sky='rain']   { --sky-top: #233249; --sky-bottom: #4f6788; --ink-top: #fff; --ink-bottom: #fff; }
:root[data-sky='storm']  { --sky-top: #1b1530; --sky-bottom: #4b3f78; --ink-top: #fff; --ink-bottom: #fff; }
:root[data-sky='snow']   { --sky-top: #a9c9ea; --sky-bottom: #f4f8fc; --ink-top: #13243f; --ink-bottom: #13243f; --logo-or: #1d5fd6; --now-chip: rgb(255 255 255 / .6); }
:root[data-sky='night']  { --sky-top: #060b18; --sky-bottom: #24324d; --ink-top: #fff; --ink-bottom: #fff; }
:root[data-sky='fog']    { --sky-top: #9aa4b1; --sky-bottom: #e1e5ea; --ink-top: #172233; --ink-bottom: #172233; --logo-or: #b45309; --now-chip: rgb(255 255 255 / .6); }

@media (prefers-color-scheme: dark) {
  :root { --card: #1f2a3b; --key: #2a374b; --line: #34435a; }
  /* Night version of every sky: darken it and use light ink throughout. */
  :root[data-sky] { --ink-top: #fff; --ink-bottom: #dfe6f0; --logo-or: #ffd23f; --now-chip: rgb(10 20 40 / .5); }
  :root[data-sky='night'] { --night-strength: .1; }
  body { --night: linear-gradient(rgb(6 10 22 / .55), rgb(6 10 22 / .55)); }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--sky-bottom); }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--night, linear-gradient(transparent, transparent)) fixed,
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 100vh) no-repeat, var(--sky-bottom);
}
.app { max-width: 520px; margin: 0 auto; padding: 0 12px 32px; }
h1, h2, .q-title, .big, .result-score, .chip, .btn, .choice, .pill { font-family: var(--font-display); }
h2 { font-size: 1.3rem; font-weight: 600; margin: 0 0 8px; }
.big, .result-score, .r-points, .board .pts, .board .rank, .track .mark, .pill { font-variant-numeric: tabular-nums; }
svg.i { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round;
  stroke-linejoin: round; flex: none; }
a { color: inherit; }
.muted { color: var(--muted); }
.small-print { font-size: .8125rem; }
:focus-visible { outline: 3px solid var(--double); outline-offset: 2px; }
input:focus-visible { outline-offset: 0; }

.top { display: flex; justify-content: space-between; align-items: center; padding: 14px 0 4px; color: var(--ink-top); }
.logo { font: 700 1.6rem var(--font-display); letter-spacing: .01em; }
.logo span { color: var(--logo-or); }
/* Small labels are the only capitals. */
.pill { border: 1px solid color-mix(in srgb, currentColor 50%, transparent); border-radius: 6px; padding: 1px 8px;
  font-size: .95rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }

/* Compact hero: the three questions should start above the fold. */
.hero { color: var(--ink-top); padding: 6px 2px 14px; }
.hero h1 { margin: 0; font-size: 2.6rem; font-weight: 700; line-height: 1; }
.place-button { font: 600 1.25rem var(--font-display); color: var(--ink-top); background: none; border: 0;
  border-bottom: 2px solid color-mix(in srgb, currentColor 55%, transparent); border-radius: 0;
  padding: 0 0 1px; margin-top: 4px; min-height: 40px; cursor: pointer; }
.hero-now { display: inline-block; margin: 6px 0 0; padding: 1px 10px; border-radius: var(--key-radius);
  background: var(--now-chip); font: 600 .9375rem var(--font-display); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.hero-now:empty { display: none; }
/* The living sky (P2.14): drawn behind the page, and eased between weathers. */
@property --sky-top { syntax: '<color>'; inherits: true; initial-value: #587091; }
@property --sky-bottom { syntax: '<color>'; inherits: true; initial-value: #c9d3df; }
@property --ink-top { syntax: '<color>'; inherits: true; initial-value: #fff; }
:root.sky-ready { transition: --sky-top 1.6s ease, --sky-bottom 1.6s ease, --ink-top 1.6s ease; }
@media (prefers-reduced-motion: reduce) { :root.sky-ready { transition: none; } }
.sky-fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.app { position: relative; }
.hero-sub { margin: 4px 0 0; font-size: .9375rem; font-weight: 500; }

main { display: grid; gap: 14px; }
.card { background: var(--card); color: var(--text); border-radius: var(--radius); padding: 16px; }
/* The board: today's three questions on one panel, in rows split by rules. */
.questions { display: grid; background: var(--card); color: var(--text); border-radius: var(--radius); overflow: hidden; }
#results-top:empty, #results-bottom:empty { display: none; }
.q { display: grid; gap: 12px; padding: 16px 14px; border-top: 1px solid var(--line); }
.q[hidden] { display: none; }
/* The tiles: one per question, the open one ringed, answered ones filled. */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 10px; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 92px; min-width: 0;
  padding: 8px 4px; border: 1.5px dashed var(--line); border-radius: var(--key-radius); background: none; color: var(--text);
  font: 600 1.05rem/1.1 var(--font-display); font-variant-numeric: tabular-nums; cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s; }
.tile svg.i { color: var(--muted); }
.tile .t-label { white-space: nowrap; }
.tile .t-said { min-height: 1.1em; font-size: .9rem; text-transform: uppercase; letter-spacing: .05em; }
.tile .t-said b, .t-pts b { color: var(--double); }
.tile.yes, .tile.no { border-style: solid; color: #fff; }
.tile.yes { background: var(--yes); border-color: var(--yes); }
.tile.no { background: var(--no); border-color: var(--no); }
.tile.yes svg.i, .tile.no svg.i { color: inherit; }
.tile.banked { box-shadow: inset 0 -4px 0 var(--double); }
.tile[aria-current='true']:not(.yes, .no) { border-style: solid; background: var(--key); }
/* The ring sits inside the tile, so the open one takes no more room than the others. */
.tiles .tile[aria-current='true'] { outline: 2px solid var(--text); outline-offset: -6px; }
.tiles .tile[aria-current='true']:focus-visible { outline-color: var(--double); }
.q-head { display: flex; gap: 10px; align-items: center; }
.q-head svg.i { color: var(--muted); }
.q-title { font-size: 1.6rem; font-weight: 600; line-height: 1.1; }
.q-detail { font-size: .875rem; color: var(--muted); }
/* The answer: a dial whose two halves are the keys. Tap the left half for No,
   the right for Yes; the star beside it doubles the question. */
.answer { display: grid; grid-template-columns: 1fr 52px; gap: 6px; align-items: stretch; }
.dial { position: relative; min-height: 104px; border: 1px solid var(--line); border-radius: var(--key-radius); background: var(--key); overflow: hidden; }
.dial .track { position: absolute; left: 12px; right: 12px; bottom: 6px; margin: 0; }
.halves { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; }
.half { display: flex; align-items: baseline; padding: 8px 10px; border: 0; background: none; cursor: pointer;
  font: 600 1.2rem/1.1 var(--font-display); white-space: nowrap; transition: background .15s; }
.half.no { justify-content: flex-start; color: var(--no-ink); }
.half.yes { justify-content: flex-end; color: var(--yes-ink); border-left: 1px dashed var(--line); }
.half small { font: 600 .85rem var(--font-display); margin-left: 6px; align-self: baseline; }
.half[aria-pressed='true']::before { content: '✓ '; white-space: pre; }
.half.no[aria-pressed='true'] { background: color-mix(in srgb, var(--no) 30%, transparent); }
.half.yes[aria-pressed='true'] { background: color-mix(in srgb, var(--yes) 30%, transparent); }
.half.pop { animation: pop .26s ease-out; }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.04); } 100% { transform: scale(1); } }
.half:disabled { cursor: default; opacity: .55; }
.crowd { display: grid; gap: 6px; font-size: .8125rem; color: var(--muted); }
.bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--line); }
.bar .y { background: var(--yes); } .bar .n { background: var(--no); }
.bar div { transition: width .4s ease-out; }
.crowd-row { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.crowd strong { color: var(--text); }
.tag-gold { color: var(--gold); font-weight: 600; }

/* Once all three are in, the Send key sits right under the tiles. */
.done { display: grid; gap: 8px; padding: 0 10px 14px; }
.done[hidden] { display: none; }
.done p { margin: 0; }
.done .btn { width: 100%; }
/* Buttons are keys on the board: light on slate. Yellow stays for Doubled. */
.btn { font-size: 1.15rem; font-weight: 600; min-height: 48px; padding: 0 20px; border: 0; border-radius: var(--key-radius);
  cursor: pointer; background: #eef3fa; color: #17202c; }
.btn.secondary { background: var(--key); color: var(--text); border: 1px solid var(--line); }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 1.05rem; }
.btn-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.results .btn-row { justify-content: space-between; }
.load-error .btn-row { justify-content: center; }

.results { border: 2px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.result-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.result-head h2 { margin: 0; }
.result-score { font-size: 2.2rem; font-weight: 700; line-height: 1; }
.result-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.result-list li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: center; }
.result-list li svg.i { color: var(--muted); }
.result-list .r-actual { font-size: .8125rem; color: var(--muted); }
/* Results tiles turn over to the points each question scored. */
.results .tiles { padding: 12px 0 0; }
.rtile, .rtile.banked { padding: 0; border: 0; cursor: default; perspective: 600px; box-shadow: none; }
.t-flip { display: grid; width: 100%; height: 100%; transform: rotateY(180deg); transform-style: preserve-3d; }
.t-face { grid-area: 1 / 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 8px 4px; border: 1.5px solid var(--line); border-radius: var(--key-radius); background: var(--key); backface-visibility: hidden; }
.t-back { transform: rotateY(180deg); }
.t-pts { font: 700 1.5rem/1 var(--font-display); }
.rtile.right .t-back { background: var(--yes); border-color: var(--yes); color: #fff; }
.rtile.wrong .t-back { background: var(--no); border-color: var(--no); color: #fff; }
.rtile.right .t-back svg.i, .rtile.wrong .t-back svg.i { color: inherit; }
.rtile.none .t-back { color: var(--muted); }
.rtile.banked .t-back { box-shadow: inset 0 -4px 0 var(--double); }

.board { margin: 0; padding: 0; list-style: none; }
.board li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.board li:last-child { border-bottom: 0; }
.board .rank { width: 2em; color: var(--muted); font: 700 1.1rem var(--font-display); }
.board .name { flex: 1; }
.board .pts { font: 600 1.1rem var(--font-display); }
.board li.me { font-weight: 700; }
.board li.me .rank { color: var(--accent); }
.empty { color: var(--muted); margin: 0; }

.league { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.league-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.league-actions { display: flex; align-items: center; gap: 4px; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 10px; color: var(--muted); font-weight: 700; font-size: 1.2rem; }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: var(--line); }
.menu-panel { position: absolute; right: 0; top: 44px; z-index: 5; background: var(--key); border: 1px solid var(--line);
  border-radius: var(--key-radius); box-shadow: 0 10px 30px rgb(0 0 0 / .25); padding: 6px; min-width: 160px; }
.menu-panel button { width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 10px 12px;
  font: inherit; color: var(--no-ink); cursor: pointer; }
.menu-panel button:hover { background: var(--line); }
form.inline { display: flex; gap: 8px; margin-top: 8px; }
form.inline input { flex: 1; }
form.stack { display: grid; gap: 8px; margin-top: 10px; }
input { font: inherit; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--key-radius);
  background: transparent; color: var(--text); min-width: 0; }
.error { color: var(--no-ink); min-height: 1.2em; margin: 2px 0 0; font-size: .875rem; }
.linkish { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 8px 0; }

.account-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.account-row p { margin: 0; }

.invite { display: grid; gap: 10px; margin: 6px 0 4px; border: 2px solid var(--gold); }
.invite .big { font: 600 1.2rem/1.25 var(--font-display); }
.invite .btn { width: 100%; }


footer { text-align: center; font-size: .8125rem; color: var(--ink-bottom); margin-top: 24px; }
.site-footer { margin-top: 32px; padding: 24px 4px 8px; border-top: 1px solid color-mix(in srgb, var(--ink-bottom) 25%, transparent); }
.site-footer a { color: inherit; }
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 12px; font-weight: 600; }
.footer-links a { text-decoration: none; padding: 8px 2px; }
.footer-links a:hover { text-decoration: underline; }
.footer-small { margin: 6px auto; max-width: 420px; opacity: .85; line-height: 1.45; }
.footer-bottom { margin-top: 14px; }
/* Simple text pages: privacy and terms. */
.doc { padding-bottom: 24px; }
.doc .card h1 { font-size: 1.6rem; margin: 0 0 4px; }
.doc .card h2 { margin-top: 20px; }
.doc .card p, .doc .card li { line-height: 1.6; }
.draft { background: #3a3110; color: #f6e3a0; border-radius: 8px; padding: 10px 12px; font-size: .9rem; }

dialog { border: 0; border-radius: var(--radius); padding: 18px; width: min(480px, calc(100vw - 32px));
  background: var(--card); color: var(--text); box-shadow: 0 20px 60px rgb(0 0 0 / .3); }
dialog::backdrop { background: rgb(10 20 40 / .5); }
@media (max-width: 600px) {
  /* Bottom sheet on phones. */
  dialog { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 22px 22px 0 0; padding-bottom: 28px; }
}
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
.dialog-head h2 { margin: 0; font-size: 1.375rem; }
.icon-btn { background: none; border: 0; font-size: 1.2rem; cursor: pointer; color: var(--muted); width: 44px; height: 44px; }
#place-search { width: 100%; margin: 12px 0 8px; font-size: 1.05rem; }
.place-list { list-style: none; margin: 0; padding: 0; max-height: 50vh; overflow: auto; }
.place-list button { width: 100%; text-align: left; background: none; border: 0; padding: 12px 8px; border-radius: 10px;
  font: inherit; color: var(--text); cursor: pointer; min-height: 48px; }
.place-list button:hover, .place-list button:focus-visible { background: var(--line); }
.place-list small { color: var(--muted); }
.place-list .label { font-size: .75rem; color: var(--muted); padding: 8px 8px 2px; text-transform: uppercase; letter-spacing: .05em; }
.place-list .empty { padding: 12px 8px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #17202c; color: #fff; padding: 12px 18px; border-radius: 14px; transition: all .25s;
  max-width: calc(100vw - 32px); z-index: 10; font-weight: 500; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
/* The morning reveal: questions in one at a time, each reading slides onto its
   dial and its tile turns over to the points; then the verdict and Share. */
.results.revealing .result-list li { animation: rise .45s ease-out var(--d) both; }
.results.revealing .t-flip { animation: flip .5s ease-in-out calc(var(--d) + 1.3s) both; }
.results.revealing .result-headline, .results.revealing [data-action='share'] { visibility: hidden; }
.results.revealed .result-headline { animation: rise .4s ease-out both; }
.results.revealed .track .ob.go { animation: none; } /* a tap skips the readings still on their way */
.results.revealed [data-action='share'] { animation: nudge .9s ease-in-out .2s 2; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes flip { from { transform: none; } to { transform: rotateY(180deg); } }
@keyframes nudge { 0%, 100% { transform: none; } 50% { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before { transition: none !important; animation: none !important; }
}

/* Odds on the buttons, the rain hint and the double key. */
.choice small { font: 600 .85rem var(--font-display); opacity: .8; margin-left: 4px; }
.hint { margin: 0; font-size: .8125rem; color: var(--muted); line-height: 1.4; }
.banker { min-height: 52px; padding: 0; border-radius: var(--key-radius); cursor: pointer; font-size: 1.4rem;
  border: 1px solid var(--line); background: var(--key); color: var(--double); }
.banker[aria-pressed='true'] { background: var(--double); color: var(--double-ink); border-color: var(--double); }
.banker:disabled { opacity: .5; cursor: default; }
.q.banked { box-shadow: inset 4px 0 0 var(--double); }
.crowd:empty { display: none; }
.source { margin: 6px 0 0; font-size: .8125rem; color: var(--muted); }
.hero-station { margin: 4px 0 0; font-size: .8125rem; opacity: .9; }
.versus { margin: 6px 0 0; font-weight: 600; font-family: var(--font-display); }
.champion { margin: 0 0 8px; font-size: .9rem; }
.champion:empty { display: none; }
.place-list button:disabled { opacity: .55; cursor: default; }
.place-list button:disabled:hover { background: none; }
.league-new summary { list-style: none; display: inline-block; padding: 8px 0; cursor: pointer; }
.league-new summary::-webkit-details-marker { display: none; }
.league-new.first summary { display: none; }
.league-new:not(.first)[open] summary { margin-bottom: 4px; }
.hero-waiting { font-weight: 600; }
.hero-waiting:empty { display: none; }
details.report { margin-top: 10px; }
details.report summary { list-style: none; display: inline-block; }
details.report summary::-webkit-details-marker { display: none; }
select, textarea { font: inherit; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: transparent; color: var(--text); }
textarea { resize: vertical; }

/* ---- First-visit intro ---- */
body.intro-mode .hero, body.intro-mode #main { display: none !important; }
.lay { display: grid; grid-template-areas: "intro" "demo" "cta" "extra"; }
.a-intro { grid-area: intro; } .a-demo { grid-area: demo; } .a-cta { grid-area: cta; } .a-extra { grid-area: extra; margin-top: 22px; }
.intro-text { color: var(--ink-top); text-align: center; padding: 8px 0 14px; }
.intro-text h1 { font-size: 2.15rem; line-height: 1.05; margin: 10px 0 8px; font-weight: 700; letter-spacing: -.01em; }
.intro-text h1 em { font-style: normal; color: var(--logo-or); }
.intro-text p { margin: 0 auto; max-width: 30em; }
.demos { display: grid; gap: 12px; }
.demo { display: grid; gap: 10px; padding: 14px 16px; }
.demo-label { font: 600 .75rem var(--font-display); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.demo .q-title { font-size: 1.3rem; }
.demo-copy { margin: 0; font-size: .9375rem; line-height: 1.4; }
.demo-choices .choice { display: flex; align-items: center; justify-content: center; min-height: 48px; cursor: default; }
.cta { margin-top: 14px; display: grid; gap: 10px; }
.btn-big { width: 100%; min-height: 56px; font-size: 1.3rem; }
.cities { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.city { font: 600 1.05rem var(--font-display); color: var(--text); background: var(--card); border: 0;
  border-radius: var(--key-radius); padding: 0 14px; min-height: 40px; cursor: pointer; }
.fine { text-align: center; color: var(--ink-top); font-size: .8125rem; opacity: .92; margin: 0; }
.peek { margin-top: 18px; color: var(--ink-bottom); text-align: center; }
.peek h2 { font-size: 1rem; margin: 0 0 8px; }
.bubble { display: inline-block; text-align: left; background: #dcf8c6; color: #102a12; border-radius: 14px 14px 4px 14px;
  padding: 10px 14px; font-size: .9375rem; line-height: 1.45; box-shadow: 0 4px 14px rgb(0 0 0 / .12); }
.bubble .g { font-family: var(--emoji); font-size: 1.1rem; }
@media (prefers-color-scheme: dark) {
  .bubble { background: #1f3b26; color: #dff5e3; }
}
@media (min-width: 960px) {
  body.intro-mode .app { max-width: 1060px; }
  .lay { grid-template-columns: 1.1fr .9fr; grid-template-areas: "intro demo" "cta demo" ". extra"; grid-template-rows: auto 1fr auto;
    column-gap: 56px; align-items: start; margin-top: 40px; }
  .a-cta { margin-top: 28px; }
  .a-extra { margin-top: 14px; }
  .intro-text { text-align: left; padding: 0; }
  .intro-text h1 { font-size: 3.6rem; }
  .intro-text p { margin: 0; font-size: 1.15rem; }
  .cities { justify-content: flex-start; }
  .cta { max-width: 440px; }
  .fine, .peek { text-align: left; }
}

/* ---- Fixes from the QA and UI reviews ---- */
/* Grid children can't be widened by a wide input or long word (320px phones). */
main > *, .lay > *, .app > * { min-width: 0; }
form.inline input { width: 100%; min-width: 0; }
.big, .league-head strong, .q-title, .place-button, .result-head h2, .board .name, .champion, .intro-text h1 { overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }

/* Phones: the play button comes before the examples. */
@media (max-width: 959px) {
  .lay { grid-template-areas: "intro" "cta" "demo" "extra"; }
  .a-cta { margin: 0 0 16px; }
}

/* Small links keep their small size (the font shorthand was resetting it). */
.linkish { font: unset; font-family: inherit; font-weight: inherit; font-size: inherit; color: var(--accent); }
.linkish.small-print, .small-print .linkish { font-size: .8125rem; }

/* Toasts: full width of the screen when needed, above the home bar. */
.toast { width: max-content; max-width: calc(100vw - 32px); bottom: calc(24px + env(safe-area-inset-bottom)); text-align: center; }

/* Results: the headline leads, the stat follows. */
.result-headline { margin: 4px 0 0; font: 600 1.25rem/1.25 var(--font-display); color: var(--text); }
.results .versus { font-family: inherit; font-weight: 500; font-size: .9375rem; margin-top: 4px; }
.result-list strong { font-family: var(--font-display); font-weight: 600; }
.result-list .r-actual { display: block; line-height: 1.4; margin-top: 2px; }
.results { border: 0; }

/* Error card when a town can't load. */
.load-error { text-align: center; margin-bottom: 14px; }
.load-error p { margin: 0; }

/* Invite and shared-result cards: a warm tint, not a warning border. */
.invite { border: 0; background: color-mix(in srgb, var(--gold) 12%, var(--card)); }

/* Intro: chips fit on one line, readable small print, solid kicker. */
.city { padding: 0 12px; min-height: 40px; }
.fine { font-weight: 500; text-shadow: 0 1px 6px rgb(0 0 0 / .35); }
.choice small { opacity: 1; }

/* Picker: a too-far town keeps its explanation readable. */
.place-list button:disabled { opacity: 1; }
.place-list button:disabled strong, .place-list button:disabled > small:first-of-type { opacity: .5; }
@media (hover: none) { .place-list button:hover { background: none; } }

/* Text pages */
.doc ul { padding-left: 1.2em; }

/* Dark mode: these come last so they win. */
@media (prefers-color-scheme: dark) {
  html { background: #0b1220; }
  :root[data-sky='sunny'], :root[data-sky='snow'], :root[data-sky='fog'] { --night-strength: .35; }
  body { --night: linear-gradient(rgb(6 10 22 / var(--night-strength, .55)), rgb(6 10 22 / var(--night-strength, .55))); }
}
@media (max-width: 479px) {
  .cities { display: grid; grid-template-columns: 1fr 1fr; }
  .city { width: 100%; }
}
@media (prefers-color-scheme: dark) {
  /* Light skies get a dark bottom at night, so the footer stays readable. */
  :root[data-sky='snow'] { --sky-bottom: #2e3c52; }
  :root[data-sky='fog'] { --sky-bottom: #39414d; }
  :root[data-sky='sunny'] { --sky-bottom: #3a3222; }
}
@media (prefers-color-scheme: dark) {
  :root[data-sky='cloudy'] { --sky-bottom: #2f3b4d; }
}

/* ---- Second review: simpler, plainer, with the dial on every question ---- */

/* The dial: the number asked in the middle, the forecast as a hollow dot,
   what was measured as a solid one. Settled, the number asked moves under the
   rail so the reading can land above it. */
.track { position: relative; height: 64px; margin: 0 6px; }
.track .rail { position: absolute; left: 0; right: 0; top: 25px; height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, #7fb3ff, #ffd36b 55%, #ff9a5a); }
.track.rain .rail { background: linear-gradient(90deg, #d9e6f5, #7fb3ff 55%, #2f5fa8); }
.track.wind .rail { background: linear-gradient(90deg, #b8c4d4, #7aa7c7 55%, #3f6f9e); }
.track .mark { position: absolute; transform: translateX(-50%); text-align: center; font: 600 .8rem/1.1 var(--font-display); white-space: nowrap; }
.track .mark i { display: block; margin: 0 auto; }
.track .ln { top: 0; color: var(--text); }
.track .ln i { width: 3px; height: 18px; margin-top: 2px; background: var(--text); border-radius: 2px; }
.track .side { position: absolute; top: 0; font: 600 .75rem var(--font-display); }
.track .side.l { left: 0; color: var(--no-ink); } .track .side.r { right: 0; color: var(--yes-ink); }
.track .fc { top: 21px; color: var(--muted); }
.track .fc i { width: 16px; height: 16px; margin-bottom: 4px; border-radius: 50%; background: var(--card); border: 3px solid var(--muted); }
.track.settled { height: 52px; margin-top: 4px; }
.track.settled .ln { top: 18px; color: var(--muted); font-weight: 500; }
.track.settled .ln i { height: 18px; margin: 0 auto 1px; }
.track .ob { left: var(--to); top: 0; color: var(--text); font-weight: 700; }
.track .ob i { width: 16px; height: 16px; margin: 4px auto 0; border-radius: 50%; background: var(--text); border: 2px solid var(--card); }
.track .ob.go { animation: settle 1.1s cubic-bezier(.2, .8, .3, 1) calc(var(--d, 0ms) + .3s) both; }
@keyframes settle { from { left: var(--from); opacity: 0; } 25% { opacity: 1; } to { left: var(--to); } }
.result-list li .track { grid-column: 1 / -1; }

/* Intro examples: the odds read as text, not as buttons you can press. */
.demo-odds { display: flex; gap: 18px; margin: 0; font: 600 1.05rem var(--font-display); }
.demo-odds .y { color: var(--yes-ink); } .demo-odds .n { color: var(--no-ink); }
.fine { justify-self: center; padding: 0; background: none; border-radius: 0; text-shadow: 0 1px 4px rgb(0 0 0 / .35); }
.cta .linkish { color: var(--ink-top); text-decoration: underline; justify-self: center; font-weight: 600; }
@media (min-width: 960px) { .fine, .cta .linkish { justify-self: start; } }

/* Name box after the first answer. */
.name-card .big { display: block; font: 600 1.2rem/1.25 var(--font-display); }
.name-card p { margin: 4px 0 10px; }
.name-card .inline { display: flex; gap: 8px; }
.name-card .inline input { flex: 1; width: 100%; }

/* Tables: long names shorten instead of breaking mid-word; the forecast plays along. */
.board .name, .league-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; min-width: 0; }
.league-head strong { flex: 1; }
.league-actions { flex: none; }
.board li.forecast { color: var(--muted); font-style: italic; }

/* Results: what the station measured leads. */
.results .source { font-size: .9375rem; color: var(--text); margin-top: 6px; }
.result-list li { row-gap: 2px; }

/* Footer: how it works folds out; Log in sits with the links. */
.how { max-width: 440px; margin: 0 auto 14px; text-align: left; }
.how summary { cursor: pointer; font: 600 1rem var(--font-display); text-align: center; list-style: none; padding: 6px; }
.how summary::-webkit-details-marker { display: none; }
.how p { margin: 8px 0; line-height: 1.5; }
.how[open] summary { margin-bottom: 4px; }
.footer-links .linkish { color: inherit; font-weight: 600; padding: 8px 2px; font-size: inherit; }
@media (prefers-color-scheme: dark) { .footer-links .linkish { color: inherit; } }
body.results-first .hero, body.results-first .hero .place-button { color: var(--ink-bottom); }

body.results-first .hero { padding-top: 18px; }
/* Desktop intro: the group-chat example sits under the button, not in a gap. */
@media (min-width: 960px) {
  .lay { grid-template-areas: "intro demo" "cta demo" "extra demo"; grid-template-rows: auto auto 1fr; }
  .a-extra { margin-top: 28px; }
  .peek { text-align: left; }
}
.demo-odds { font: 500 .9375rem system-ui, sans-serif; flex-wrap: wrap; gap: 4px; align-items: baseline; }
.demo-odds .y, .demo-odds .n { font: 600 1.05rem var(--font-display); }
#rename-form { align-items: center; }
#account .error:empty { display: none; }
.name-card .error:empty { display: none; }
.name-card .linkish { margin-top: 6px; }
