/* Price Peg: a "project estimate" look. Graph-paper background, line-item
   guesses, and a heat scale (red → orange → amber → green) for closeness.
   Mobile first; wider screens just get more breathing room. */

:root {
  color-scheme: light;
  --bg: #f3eee3;
  --grid: rgba(37, 78, 130, 0.07);
  --surface: #fffdf8;
  --surface-2: #f6f0e3;
  --ink: #1d232b;
  --ink-2: #545e6b;
  --line: #e1d8c5;
  --accent: #1f5590;
  --accent-ink: #ffffff;
  --accent-soft: #e2ebf6;
  --shadow: 0 1px 2px rgba(40, 30, 10, 0.06), 0 6px 18px rgba(40, 30, 10, 0.06);

  --hit: #2a8540;
  --hit-soft: #e1f2e5;
  --hot: #a87600;
  --hot-soft: #fbefcc;
  --warm: #d4500f;
  --warm-soft: #fde4d6;
  --cold: #c42b2b;
  --cold-soft: #fadfdf;
  --on-band: #ffffff;

  --radius: 16px;
  --radius-sm: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #14171c;
    --grid: rgba(130, 175, 230, 0.05);
    --surface: #1c2027;
    --surface-2: #252a33;
    --ink: #ece6da;
    --ink-2: #a5aebb;
    --line: #313844;
    --accent: #86b6ef;
    --accent-ink: #0c1a2b;
    --accent-soft: #1f2c3d;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    --hit: #5fcb77;
    --hit-soft: rgba(95, 203, 119, 0.14);
    --hot: #f0c64a;
    --hot-soft: rgba(240, 198, 74, 0.14);
    --warm: #ff8d47;
    --warm-soft: rgba(255, 141, 71, 0.14);
    --cold: #ff6f6f;
    --cold-soft: rgba(255, 111, 111, 0.14);
    --on-band: #14171c;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14171c;
  --grid: rgba(130, 175, 230, 0.05);
  --surface: #1c2027;
  --surface-2: #252a33;
  --ink: #ece6da;
  --ink-2: #a5aebb;
  --line: #313844;
  --accent: #86b6ef;
  --accent-ink: #0c1a2b;
  --accent-soft: #1f2c3d;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  --hit: #5fcb77;
  --hit-soft: rgba(95, 203, 119, 0.14);
  --hot: #f0c64a;
  --hot-soft: rgba(240, 198, 74, 0.14);
  --warm: #ff8d47;
  --warm-soft: rgba(255, 141, 71, 0.14);
  --cold: #ff6f6f;
  --cold-soft: rgba(255, 111, 111, 0.14);
  --on-band: #14171c;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
}

h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
a { color: var(--accent); }
svg { width: 1.25em; height: 1.25em; flex: none; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  max-width: 34rem;
  margin: 0 auto;
  padding: 0.25rem 0.5rem 0.25rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.wordmark__icon { color: var(--accent); width: 1.5rem; height: 1.5rem; transform: rotate(-12deg); }
.topbar__actions { display: flex; gap: 0.125rem; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 1.5rem; height: 1.5rem; }

/* ---------- Layout ---------- */

.page {
  max-width: 34rem;
  margin: 0 auto;
  padding: 1rem 1rem calc(2rem + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
#game { display: flex; flex-direction: column; gap: 1rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.banner {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px dashed var(--accent);
  font-size: 0.9rem;
}
.loading { color: var(--ink-2); text-align: center; padding: 3rem 0; }

/* ---------- Mode tabs ---------- */

.modes {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.mode-tab {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 3.25rem;
  padding: 0.35rem 0.25rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  line-height: 1.25;
  cursor: pointer;
}
.mode-tab:hover { background: var(--surface); color: var(--ink); }
.mode-tab[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--accent), var(--shadow);
}
.mode-tab__name { display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 800; font-size: 0.95rem; }
.mode-tab[aria-pressed="true"] .mode-tab__name { color: var(--accent); }
.mode-tab__name svg { width: 0.95rem; height: 0.95rem; color: var(--hit); }
.mode-tab__sub { font-size: 0.75rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.notice { padding: 1.5rem; text-align: center; display: grid; gap: 0.5rem; }
.notice h2 { font-size: 1.3rem; }

.puzzle-meta {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Puzzle card ---------- */

.puzzle { overflow: hidden; }
.puzzle__media {
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.puzzle__media img { width: 100%; height: 100%; object-fit: cover; }
.puzzle__noimg {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  font-weight: 600;
}
.puzzle__body { padding: 1rem 1.125rem 1.125rem; display: grid; gap: 0.5rem; }
.puzzle__title { font-size: 1.35rem; line-height: 1.25; letter-spacing: -0.01em; }
.puzzle__desc { color: var(--ink-2); }

.chip {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem 0.2rem 0.45rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.85rem;
  font-weight: 600;
}
.chip svg { width: 1rem; height: 1rem; color: var(--accent); }

/* ---------- Guess form ---------- */

.play { display: flex; flex-direction: column; gap: 0.75rem; }

.guess-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
.guess-form__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}
.guess-form label { font-weight: 700; font-size: 1.05rem; }
.tries { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--ink-2); font-weight: 600; }
.tries__pips { display: inline-flex; gap: 3px; }
.tries__pips i {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  border: 1.5px solid var(--ink-2);
}
.tries__pips i.used { background: var(--ink-2); }

.guess-form__row { display: flex; gap: 0.5rem; }
.money-input {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding-left: 0.875rem;
  transition: border-color 0.15s;
}
.money-input:focus-within { border-color: var(--accent); }
.money-input__sign { font-size: 1.5rem; font-weight: 700; color: var(--ink-2); }
.money-input input {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 3.5rem;
  padding: 0 0.75rem 0 0.25rem;
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  outline: none;
}
.money-input input::placeholder { color: var(--ink-2); opacity: 0.6; font-size: 1.15rem; font-weight: 600; }
.money-input input:disabled { cursor: not-allowed; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0 1.25rem;
  border-radius: 14px;
  border: 2px solid transparent;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s, filter 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { filter: brightness(1.08); }
.btn--primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--wide { width: 100%; }
.guess-form__submit { min-height: 3.5rem; min-width: 6.5rem; font-size: 1.05rem; white-space: nowrap; }

.hint { font-size: 0.85rem; color: var(--ink-2); }
.error { font-size: 0.9rem; font-weight: 600; color: var(--cold); min-height: 0; }
.error:empty { display: none; }

/* ---------- Known range ---------- */

.range {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.range__end { display: grid; line-height: 1.2; font-weight: 700; font-size: 1rem; }
.range__end small { font-size: 0.72rem; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.05em; }
.range__end--high { text-align: right; }
.range__track {
  flex: 1;
  height: 0.5rem;
  position: relative;
  /* a tape measure */
  background:
    repeating-linear-gradient(90deg, var(--ink-2) 0 1px, transparent 1px 8px) bottom / 100% 50% no-repeat,
    var(--accent-soft);
  border-radius: 2px;
  border: 1px solid var(--line);
}
.range__q {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  font-size: 0.9rem;
}

/* ---------- Guess list (line items) ---------- */

.guesses { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.guesses:empty { display: none; }

.guess {
  --band: var(--line);
  --band-soft: var(--surface);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem 0.6rem 0.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 6px solid var(--band);
  border-radius: 12px;
}
.guess.is-new { animation: slide-in 0.28s ease-out; }
@keyframes slide-in { from { opacity: 0; transform: translateY(-6px); } }

.guess__dir {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.guess__dir svg { width: 1.35rem; height: 1.35rem; }
.guess--hit .guess__dir { background: transparent; border: 0; color: var(--hit); }
.guess--hit .guess__dir svg { width: 2.5rem; height: 2.5rem; }

.guess__main { display: grid; line-height: 1.2; min-width: 0; }
.guess__amount { font-size: 1.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.guess__sub { font-size: 0.82rem; color: var(--ink-2); font-weight: 600; }

/* Closeness badge: colour + bar count (or a check) + words, so it never relies on colour alone. */
.band {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem 0.3rem 0.45rem;
  border-radius: 999px;
  background: var(--band-soft);
  border: 1.5px solid var(--band);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}
.band svg { color: var(--band); width: 1.1rem; height: 1.1rem; }

.meter { display: inline-flex; align-items: flex-end; gap: 2px; height: 0.9rem; }
.meter i { width: 4px; border-radius: 1px; border: 1.5px solid var(--band); }
.meter i:nth-child(1) { height: 45%; }
.meter i:nth-child(2) { height: 72%; }
.meter i:nth-child(3) { height: 100%; }
.meter--1 i:nth-child(-n + 1),
.meter--2 i:nth-child(-n + 2),
.meter--3 i:nth-child(-n + 3) { background: var(--band); }

.guess--hit, .band-hit { --band: var(--hit); --band-soft: var(--hit-soft); }
.guess--hot, .band-hot { --band: var(--hot); --band-soft: var(--hot-soft); }
.guess--warm, .band-warm { --band: var(--warm); --band-soft: var(--warm-soft); }
.guess--cold, .band-cold { --band: var(--cold); --band-soft: var(--cold-soft); }

/* ---------- Results ---------- */

.results { padding: 1.25rem 1.125rem; display: grid; gap: 0.875rem; scroll-margin-top: 4.5rem; }
.results:focus { outline: none; }
.results__kicker { font-size: 0.8rem; font-weight: 700; color: var(--ink-2); letter-spacing: 0.06em; text-transform: uppercase; }
.results__title { font-size: 1.5rem; line-height: 1.2; margin-top: -0.4rem; }

.reveal {
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  padding: 1rem;
  border-radius: 12px;
  background: var(--accent-soft);
  text-align: center;
}
.reveal__label { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.reveal__price {
  font-size: clamp(2.25rem, 11vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.reveal__closest { font-size: 0.9rem; color: var(--ink-2); font-weight: 600; }

.placeholder-flag {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 2px dashed var(--warm);
  color: var(--warm);
  font-weight: 800;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
}
.results__source { font-size: 0.9rem; color: var(--ink-2); }

.share-box { display: grid; gap: 0.6rem; }
.share-box__text {
  margin: 0;
  padding: 0.75rem 0.875rem;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: normal; /* wrap only between guesses, never inside one */
  user-select: all;
}

.more { display: grid; gap: 0.5rem; }
.more__title { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.more__list { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0.5rem; }
.more__btn {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 0.5rem;
  min-height: 3.25rem;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  border: 1.5px solid var(--accent);
  background: var(--surface);
  text-align: left;
  line-height: 1.25;
  cursor: pointer;
}
.more__btn:hover { background: var(--accent-soft); }
.more__name { font-weight: 800; }
.more__sub { grid-column: 1; font-size: 0.8rem; font-weight: 600; color: var(--ink-2); }
.more__btn svg { grid-column: 2; grid-row: 1 / span 2; width: 1.25rem; height: 1.25rem; color: var(--accent); }
.more__btn.is-done { border-color: var(--line); background: var(--surface-2); }
.more__btn.is-done svg { color: var(--hit); }

.countdown { text-align: center; font-size: 0.95rem; color: var(--ink-2); font-weight: 600; }
.countdown__time { font-family: var(--mono); font-size: 1.05rem; color: var(--ink); font-variant-numeric: tabular-nums; }

.calc-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1.5px solid var(--accent);
  font-weight: 700;
  text-decoration: none;
}
.calc-link:hover { background: var(--accent-soft); }

.ad-slot:empty { display: none; }
.ad-slot { min-height: 100px; }

.fineprint { font-size: 0.8rem; color: var(--ink-2); text-align: center; }
.fineprint a { color: inherit; text-underline-offset: 2px; }
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.25rem 1.25rem; font-size: 0.9rem; font-weight: 600; }
.footer-links a,
.link-btn { color: var(--accent); padding: 0.5rem 0.25rem; text-underline-offset: 3px; }
.link-btn { border: 0; background: none; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }

/* ---------- About page ---------- */

.wordmark--link { color: inherit; text-decoration: none; }
.btn--small { min-height: 2.5rem; padding: 0 0.9rem; font-size: 0.9rem; }
.prose { padding: 1.25rem 1.25rem 1.5rem; display: grid; gap: 0.85rem; }
.prose h1 { font-size: 1.6rem; line-height: 1.2; letter-spacing: -0.01em; }
.prose h2 { font-size: 1.15rem; margin-top: 0.75rem; }
.prose ul { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.5rem; }
.prose a { text-underline-offset: 2px; }

/* ---------- Dialogs ---------- */

.sheet {
  width: min(28rem, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.sheet[open] { display: grid; gap: 1rem; animation: pop 0.18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.sheet::backdrop { background: rgba(10, 12, 16, 0.5); }
.sheet__head { display: flex; justify-content: space-between; align-items: center; margin: -0.5rem -0.5rem 0 0; }
.sheet h2 { font-size: 1.3rem; }

.mode-list { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.3rem; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; font-size: 0.92rem; }
.legend li { display: grid; grid-template-columns: 8.5rem 1fr; align-items: center; gap: 0.6rem; }
.legend .band, .legend .dir { justify-self: start; }
.dir {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem 0.3rem 0.45rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  font-size: 0.82rem;
  font-weight: 700;
}
.dir svg { width: 1.05rem; height: 1.05rem; }

.stat-grid { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0.5rem; margin: 0; text-align: center; }
.stat-grid div { display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.stat-grid dt { font-size: 0.75rem; color: var(--ink-2); line-height: 1.2; }
.stat-grid dd { margin: 0; font-size: 1.75rem; font-weight: 800; font-variant-numeric: tabular-nums; }

.dist-title { font-size: 0.95rem; }
.dist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; }
.dist li { display: grid; grid-template-columns: 1.25rem 1fr; align-items: center; gap: 0.5rem; font-variant-numeric: tabular-nums; }
.dist__n { font-weight: 700; text-align: center; }
.dist__bar {
  min-width: 1.75rem;
  padding: 0.1rem 0.5rem;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  text-align: right;
  font-weight: 700;
  font-size: 0.9rem;
}
.dist--bands li { grid-template-columns: 2.75rem 1fr; }
.dist li.is-today .dist__bar { background: var(--hit); border-color: var(--hit); color: var(--on-band); }

/* ---------- Past puzzles ---------- */

.archive { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.archive a {
  display: grid;
  grid-template-columns: 2.6rem 1fr auto;
  align-items: center;
  gap: 0.6rem;
  min-height: 3.25rem;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  text-decoration: none;
}
.archive a:hover { border-color: var(--accent); }
.archive__num { font-weight: 800; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.archive__title { display: grid; line-height: 1.25; font-weight: 700; min-width: 0; }
.archive__title small { color: var(--ink-2); font-weight: 600; font-size: 0.8rem; }
.archive__result {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  white-space: nowrap;
}
.archive__result--won { border-color: var(--hit); background: var(--hit-soft); }
.archive__result--lost { border-color: var(--cold); background: var(--cold-soft); }
.archive__result--started { border-color: var(--hot); background: var(--hot-soft); }
.archive__result--shot { border-color: var(--accent); background: var(--accent-soft); }
.archive__empty { color: var(--ink-2); text-align: center; padding: 1rem 0; }
.banner a { font-weight: 700; margin-left: 0.25rem; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.5rem + env(safe-area-inset-bottom));
  transform: translate(-50%, 1rem);
  padding: 0.7rem 1.1rem;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 100;
}
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 40rem) {
  .page { padding-top: 1.5rem; gap: 1.25rem; }
  .puzzle__title { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
