/* Plot Point, "Daily Pop" (docs/DESIGN.md §11a).
   Light: Indigo & Tangerine. Dark: After Dark (neon pink and cyan).
   Bricolage Grotesque for the interface; Literata Bold only in the logo's wordmark.
   Rounded cards, bold colour, no green-and-yellow (it mustn't read as Wordle). */
:root {
  --paper: #f4f2fd;        /* page background */
  --paper-2: #e7e3fb;      /* chips, hovers */
  --card: #ffffff;
  --ink: #25206b;          /* indigo: text, outlines */
  --ink-soft: #5a5591;
  --line: #d9d5f2;
  --head: #25206b;         /* header band */
  --head-2: #3a3488;       /* header buttons */
  --head-ink: #f7f5ff;
  --accent: #ff8a2a;       /* tangerine: main button, difficulty, the player's pin, logo */
  --accent-ink: #1d1850;
  --link: #4433c9;
  --second: #b9a8ff;       /* lilac: labels, near guesses */
  --second-ink: #1d1850;
  --button: #ff8a2a;
  --button-ink: #1d1850;
  --sea: #c9c1f7;
  --far: #d0343f;          /* distance colours, matching the share card (🟥 🟧 🟪 🎯);
                              they differ in lightness as well as hue */
  --mid: #ff8a2a;
  --near: #9b87f5;
  --win: #e0287d;
  --win-ink: #c81c6c;      /* the same pink, darkened for words: --win is 4.4:1 on a white card and
                              4.0:1 on the page, short of the 4.5:1 that text this size needs */
  --radius: 14px;
  --radius-lg: 20px;
  --sans: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif-display: "Literata", Georgia, serif;
  --serif: var(--sans);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16162a; --paper-2: #2e2e4c; --card: #22223a; --ink: #f3f1ff; --ink-soft: #a9a6c9;
    --line: #34345a; --head: #0e0e1a; --head-2: #22223a; --head-ink: #f3f1ff;
    --accent: #ff5ca8; --accent-ink: #14081a; --link: #ff8cc4; --second: #5ce1ff; --second-ink: #0a1a22;
    --button: #ff5ca8; --button-ink: #14081a; --sea: #1d3a5f;
    --far: #ff5a5f; --mid: #ffb347; --near: #b9a8ff; --win: #ff5ca8; --win-ink: #ff5ca8;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.5 var(--sans);
  font-optical-sizing: auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--link); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--ink-soft); }

/* ---- Logo: book pin + "Plot Point" with the P of Point drawn as a pilcrow ---- */
.logo { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.logo-pin { width: 1.05em; height: 1.2em; flex: none; }
.logo-pin .pin { fill: var(--accent); }
.logo-pin .book { fill: var(--head); }
.wordmark {
  margin: 0; display: inline-flex; align-items: baseline; white-space: nowrap;
  font: 700 1em/1 var(--serif-display); letter-spacing: -0.01em;
}
.wordmark .pilcrow-p { width: .467em; height: .7em; margin-right: .03em; flex: none; }
.pilcrow-p .stem { fill: currentColor; }
.pilcrow-p .bowl { fill: var(--accent); }

/* ---- Top bar ---- */
.topbar {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 14px;
  background: var(--head);
  color: var(--head-ink);
}
.brand { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.brand .logo { font-size: clamp(1.45rem, 4.6vw, 1.8rem); }
.meta { font-size: .85rem; font-weight: 600; opacity: .8; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 14px;
  border: 0; background: var(--head-2); color: var(--head-ink);
  display: grid; place-items: center; cursor: pointer; font-weight: 800; font-size: 1.1rem;
}
.icon-btn:hover { background: color-mix(in srgb, var(--head-2) 80%, var(--head-ink)); }
.icon-btn:focus-visible { outline-color: var(--accent); }

/* ---- Layout ---- */
.layout { flex: 1; display: flex; flex-direction: column; }
.map-wrap {
  height: 40vh; min-height: 250px; position: relative;
  margin: 12px 16px 0; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: 0 0 0 2px var(--ink);
}
/* On a phone the bonus round is played on the map, so it grows for the round. */
@media (max-width: 899px) { body.pinpointing .map-wrap { height: 68vh; height: 68dvh; } }
#map { position: absolute; inset: 0; background: var(--sea); }
/* The map fills its rounded frame, which would cut off a focus ring drawn outside it. */
#map:focus-visible { outline-offset: -6px; }
/* The bonus round by keyboard (js/app.js): while the map has the keyboard's focus, a crosshair
   marks its centre, where Enter puts the pin, and a line says which keys do what. Neither shows
   for a mouse or a finger. */
#map.pinpoint:focus-visible::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px;
  border: 3px solid var(--ink); border-radius: 50%; box-shadow: 0 0 0 2px #fff, inset 0 0 0 2px #fff;
  background: radial-gradient(circle, var(--ink) 0 3px, #fff 3px 5px, transparent 5px);
  z-index: 1000; pointer-events: none;
}
.map-keys {
  display: none; position: absolute; left: 60px; right: 12px; top: 12px; z-index: 1001; margin: 0;
  padding: 6px 10px; border-radius: 10px; background: var(--ink); color: var(--paper);
  font-size: .85rem; line-height: 1.35; text-align: center; pointer-events: none;
}
#map.pinpoint:focus-visible ~ .map-keys { display: block; }
.graticule { stroke: var(--ink); stroke-opacity: .08; stroke-width: 1; fill: none; }
.leaflet-container { font: 13px var(--sans); background: var(--sea); }
.leaflet-bar { border: 0 !important; box-shadow: 0 0 0 2px var(--ink) !important; border-radius: 12px !important; overflow: hidden; }
.leaflet-bar a, .leaflet-bar a:hover { color: var(--ink); background: var(--card); border-bottom-color: var(--line); font-weight: 800; }
.leaflet-bar a.leaflet-disabled { color: var(--line); background: var(--card); }
.leaflet-control-attribution.leaflet-control {
  background: color-mix(in srgb, var(--card) 85%, transparent); color: var(--ink-soft);
  font-size: 10px; line-height: 1.4; margin: 0 10px 10px 0; padding: 0 6px; border-radius: 6px;
  max-width: calc(100% - 20px);
}
.leaflet-control-attribution a { color: var(--ink-soft); }
.leaflet-control-zoom { margin: 12px 0 0 12px !important; }

/* The bonus round's bar (js/app.js renderMapOverlay): along the map's bottom edge, out of the way
   of the zoom buttons, and faded while the map is dragged or zoomed so it never hides the spot.
   The attribution moves to the top right for the round, where nothing else is. */
.map-overlay {
  position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 1000;
  display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-radius: var(--radius); background: var(--card);
  box-shadow: 0 0 0 2px var(--ink), 0 8px 24px rgba(20, 16, 60, .2);
  transition: opacity .15s;
}
.map-overlay[hidden] { display: none; }
body.map-moving .map-overlay { opacity: 0; pointer-events: none; }
body.pinpointing .leaflet-bottom.leaflet-right { bottom: auto; top: 0; }
body.pinpointing .leaflet-control-attribution.leaflet-control { margin: 10px 10px 0 0; }
.map-overlay-prompt {
  margin: 0; flex: 1 1 220px; font-size: .9rem; line-height: 1.3; font-weight: 600;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.map-overlay-prompt .eyebrow { display: inline; margin-right: 4px; }
.map-overlay-prompt .hint-text { color: var(--ink-soft); font-weight: 400; }
.map-overlay-actions { display: flex; gap: 8px; }
.map-overlay-actions button { padding: 8px 14px; }
.panel { padding: 16px; max-width: 640px; width: 100%; margin: 0 auto; }

@media (min-width: 900px) {
  body { height: 100dvh; }
  .layout { flex-direction: row; min-height: 0; padding: 0 0 16px; }
  .map-wrap { flex: 1.4; height: auto; margin: 16px 0 0 16px; }
  .panel { flex: 1; max-width: 520px; overflow-y: auto; padding: 16px 24px; margin: 0; }
}

/* ---- Difficulty: five rounded bars ---- */
.difficulty { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: .9rem; }
.difficulty .level { font-weight: 800; }
.difficulty .muted { margin-left: auto; font-weight: 600; }
.stars { display: inline-flex; gap: 4px; }
.stars i { width: 20px; height: 8px; border-radius: 4px; background: var(--accent); }
.stars i.dim { background: var(--line); }

/* ---- Hints: the scene in a card, then the unlocked hints as chips ---- */
.hints {
  list-style: none; margin: 0 0 14px; padding: 16px; display: flex; flex-wrap: wrap; gap: 6px;
  background: var(--card); border-radius: var(--radius-lg); box-shadow: 0 2px 0 var(--line);
}
.hint {
  padding: 6px 12px; border-radius: 12px; background: var(--paper-2);
  font-size: .9rem; line-height: 1.35;
}
.hint:first-child {
  flex: 1 1 100%; padding: 0 0 6px; background: none; border-radius: 0;
  font: 600 clamp(1.2rem, 3.6vw, 1.4rem)/1.25 var(--sans); letter-spacing: -0.01em;
  text-wrap: pretty;
}
.hint:first-child .hint-label {
  display: table; margin-bottom: 8px; padding: 3px 10px; border-radius: 999px;
  background: var(--second); color: var(--second-ink); font: 800 .75rem/1.3 var(--sans);
}
.hint.new { animation: arrive 1.6s ease-out; }
.hint-label { font-weight: 800; color: var(--ink-soft); margin-right: 4px; }
.hint-label::after { content: ":"; }
.hint:first-child .hint-label::after { content: none; }
@keyframes arrive { from { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 55%, transparent); } to { box-shadow: 0 0 0 4px transparent; } }

/* ---- Hint icon track ---- */
.hint-track { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; }
.hint-track[hidden] { display: none; }
.track-label { font: 700 .85rem/1 var(--sans); color: var(--ink-soft); margin-right: 4px; }
.hint-icon {
  position: relative; width: 40px; height: 40px; border-radius: 12px; padding: 0;
  display: grid; place-items: center; cursor: help;
  background: var(--card); border: 0; box-shadow: 0 0 0 2px var(--ink); color: var(--ink);
  transition: color .3s, box-shadow .3s;
}
.hint-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* Hover and keyboard focus both tint the button; focus keeps the page's ring as well (the tint
   alone is 1.25:1 against the button's own white). */
.hint-icon:hover, .hint-icon:focus-visible { background: var(--paper-2); }
.hint-icon.used { color: var(--ink-soft); box-shadow: 0 0 0 2px var(--line); background: transparent; }
.hint-icon.used::after {
  content: ""; position: absolute; left: 7px; right: 7px; top: 50%; height: 3px;
  background: var(--accent); border-radius: 2px; transform: rotate(45deg);
  animation: strike .35s ease-out;
}
@keyframes strike { from { transform: rotate(45deg) scaleX(0); } to { transform: rotate(45deg) scaleX(1); } }

.tip {
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  width: 220px; padding: 9px 12px; border-radius: 12px; z-index: 1000;
  background: var(--ink); color: var(--paper); text-align: left;
  font: 400 .85rem/1.4 var(--sans); cursor: default;
  opacity: 0; visibility: hidden; transition: opacity .15s, visibility .15s;
  pointer-events: none;
}
.tip strong { display: block; }
.tip em { display: block; margin-top: 4px; opacity: .75; font-style: normal; }
.tip::after {
  content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--ink);
}
.hint-icon:nth-of-type(1) .tip { left: -8px; transform: none; }
.hint-icon:nth-of-type(1) .tip::after { left: 26px; }
.hint-icon:hover .tip, .hint-icon:focus-visible .tip, .hint-icon.show-tip .tip { opacity: 1; visibility: visible; }

/* ---- Controls ---- */
.controls { display: grid; gap: 8px; margin-bottom: 6px; }
.controls[hidden] { display: none; }
#search {
  width: 100%; padding: 13px 16px; border-radius: var(--radius);
  border: 0; box-shadow: 0 0 0 2px var(--ink); background: var(--card);
  font-size: 1.05rem; font-weight: 600;
}
#search::placeholder { color: var(--ink-soft); font-weight: 400; }
/* The ring is the link colour, as everywhere else. It was tangerine, which is only 2.1:1 against
   the page in the light theme: too faint to show where the keyboard is. */
#search:focus { outline: 3px solid var(--link); outline-offset: 2px; }
.search-wrap { position: relative; }
.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 1100;
  list-style: none; margin: 0; padding: 6px; border-radius: var(--radius);
  background: var(--card); box-shadow: 0 0 0 2px var(--ink), 0 12px 28px rgba(20, 16, 60, .2);
  /* js/app.js (placeResults) sets a max-height to the room on screen; a longer list scrolls. */
  overflow-y: auto; overscroll-behavior: contain;
}
/* Opened upwards, when there's more room above the box (a phone with its keyboard up). */
.search-results.above { top: auto; bottom: calc(100% + 6px); box-shadow: 0 0 0 2px var(--ink), 0 -12px 28px rgba(20, 16, 60, .2); }
.search-results[hidden] { display: none; }
.search-results li {
  display: flex; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer; font-weight: 600;
}
.search-results li.active, .search-results li:hover { background: var(--paper-2); }
.opt-country { color: var(--ink-soft); font-size: .88rem; font-weight: 400; text-align: right; }
.pending { font-size: .9rem; color: var(--ink-soft); }
.pending.set { color: var(--ink); font-weight: 800; }
.primary, .secondary {
  padding: 13px 20px; border-radius: var(--radius); cursor: pointer; font-weight: 800; border: 0;
}
.primary { background: var(--button); color: var(--button-ink); box-shadow: 0 3px 0 color-mix(in srgb, var(--button) 60%, var(--ink)); }
.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--button) 88%, #fff); }
.primary:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 color-mix(in srgb, var(--button) 60%, var(--ink)); }
.primary:disabled { background: var(--paper-2); color: var(--ink-soft); box-shadow: none; cursor: not-allowed; }
.secondary { background: var(--card); color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.secondary:hover { background: var(--paper-2); }
.give-up { text-align: center; font-size: .88rem; color: var(--ink-soft); }
/* 44px tall to the touch, like the footer's links: "Yes, reveal it" and "Keep guessing" sit
   side by side, so each needs room of its own. */
.give-up .link-btn { font-size: inherit; padding: 12px 8px; }
.give-up .link-btn.quiet { color: var(--ink-soft); }

/* ---- Guess log: small cards in two columns ---- */
.guesses { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.guess {
  display: grid; grid-template-columns: 12px 1fr auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center;
  padding: 10px 12px; border-radius: var(--radius); background: var(--card); box-shadow: 0 2px 0 var(--line);
}
.guess .n {
  grid-row: 2; width: 12px; height: 12px; border-radius: 4px; background: var(--c);
  font-size: 0; box-shadow: 0 0 0 1px var(--ink);
}
.guess .place { grid-column: 1 / 3; grid-row: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.guess .dist { grid-column: 2 / 4; grid-row: 2; font-size: .88rem; font-variant-numeric: tabular-nums lining-nums; }
.guess.win { box-shadow: 0 0 0 2px var(--win); }
.guess.win .dist { color: var(--win-ink); font-weight: 800; }
.guess .arrow { grid-column: 3; grid-row: 1; font-size: 1.2rem; font-weight: 800; text-align: right; color: var(--ink); }
.far { --c: var(--far); } .mid { --c: var(--mid); } .near { --c: var(--near); } .win { --c: var(--win); }

/* ---- Map markers ---- */
.pin-icon span {
  display: block; width: 24px; height: 24px; border-radius: 50% 50% 50% 0;
  background: var(--accent); transform: rotate(-45deg); border: 3px solid var(--ink);
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.guess-dot { stroke: var(--ink); }
.guess-dot.far { fill: var(--far); } .guess-dot.mid { fill: var(--mid); }
.guess-dot.near { fill: var(--near); } .guess-dot.win { fill: var(--win); }
.answer-radius { stroke: var(--win); fill: var(--win); fill-opacity: .16; }
.guess-line { stroke: var(--ink); stroke-opacity: .7; }
.answer-icon span {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--win); color: #fff; border: 3px solid var(--ink); font-size: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.leaflet-tooltip { font: 600 13px var(--sans); color: #25206b; border-radius: 8px; }
.leaflet-tooltip.answer-label { font: 800 15px var(--sans); }

/* ---- Result & reveal ---- */
.result-head { text-align: center; padding: 6px 0 18px; }
/* The two lines are one heading, which takes the focus when the game ends (js/app.js,
   focusResult) so a screen reader says the result. Only ever focused by the page, so no ring. */
.result-title { margin: 0; font: inherit; }
.result-title:focus { outline: none; }
.headline, .score { display: block; }
.headline { font: 800 2rem/1.1 var(--sans); letter-spacing: -0.02em; margin: 0; }
.score { margin: 4px 0 14px; color: var(--ink-soft); font-weight: 600; }
.everyone { margin: -8px 0 14px; font-size: .9rem; color: var(--ink-soft); }
.share-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.countdown { font-size: .9rem; color: var(--ink-soft); margin: 12px 0 0; font-variant-numeric: tabular-nums; }

.eyebrow {
  display: table; margin: 0; padding: 3px 10px; border-radius: 999px;
  background: var(--second); color: var(--second-ink); font-size: .78rem; font-weight: 800;
}

.bonus-card {
  border-radius: var(--radius-lg); box-shadow: 0 0 0 2px var(--ink);
  padding: 18px; margin-bottom: 18px; text-align: center; background: var(--card);
}
.bonus-card .eyebrow { margin: 0 auto; }
.bonus-prompt { font: 800 1.3rem/1.25 var(--sans); margin: 8px 0; }
.bonus-card .pending { margin: 10px 0; }
.bonus-line { margin: 0 0 14px; font-size: .95rem; color: var(--ink-soft); }
.bonus-line.hit { color: var(--win-ink); font-weight: 800; }
.bonus-radius { stroke: var(--accent); fill: var(--accent); fill-opacity: .18; }
.bookmarks { font-size: 1.4rem; letter-spacing: 4px; margin: 4px 0; }
.bookmarks .dim { opacity: .2; filter: grayscale(1); }

/* The reveal reads like a guidebook entry: place first, then the book. */
.reveal { padding: 18px; margin-bottom: 18px; background: var(--card); border-radius: var(--radius-lg); box-shadow: 0 2px 0 var(--line); }
.reveal h2 { font: 800 1.7rem/1.15 var(--sans); letter-spacing: -0.02em; margin: 8px 0 2px; }
.byline { margin: 0 0 12px; color: var(--ink-soft); font-weight: 600; }
.reveal p { margin: 0 0 8px; }

.recs { display: grid; gap: 10px; margin-bottom: 24px; }
.recs h3 { font: 800 1rem var(--sans); margin: 0; }
.rec {
  display: grid; gap: 1px; padding: 14px 16px; border-radius: var(--radius); text-decoration: none; color: inherit;
  background: var(--card); box-shadow: 0 2px 0 var(--line);
}
a.rec:hover { box-shadow: 0 0 0 2px var(--ink); }
.rec-tag { font-size: .8rem; font-weight: 800; color: var(--link); margin-bottom: 2px; }
.rec-title { font: 800 1.1rem/1.3 var(--sans); }
.rec-author { color: var(--ink-soft); }
.rec-pitch { font-size: .95rem; margin-top: 4px; }
.sponsored-slot { background: transparent; box-shadow: none; border: 2px dashed var(--line); }
a.rec.sponsored .rec-tag, .sponsored-slot .rec-tag { color: var(--ink-soft); }
.disclosure { font-size: .78rem; color: var(--ink-soft); margin: 0; }

/* ---- What the game is (index.html), under the game ---- */
.intro { margin-top: 28px; padding-top: 16px; border-top: 2px solid var(--line); color: var(--ink-soft); font-size: .92rem; }
.intro h2 { font: 800 1rem/1.3 var(--sans); color: var(--ink); margin: 0 0 6px; }
.intro p { margin: 0 0 8px; text-wrap: pretty; }

/* ---- Footer ---- */
.footer {
  display: flex; flex-wrap: wrap; gap: 0 4px; justify-content: center; align-items: center;
  padding: 4px 16px; font-size: .85rem;
}
/* Each link and button is 44px tall to the touch (they were 20px, hard to hit with a thumb and
   easy to miss for the one next door). The words look the same; the padding is the extra. */
.footer > a, .footer > .link-btn { padding: 12px 6px; }
.footer > .proto-tag { margin: 0 6px; }
.footer > .credit { padding: 4px 6px 10px; }
.proto-tag { background: var(--paper-2); border-radius: 99px; padding: 1px 10px; color: var(--ink-soft); font-weight: 700; }
.link-btn { background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font-size: inherit; }
.credit { color: var(--ink-soft); font-size: .78rem; }

/* ---- Dialogs ---- */
dialog {
  border: 0; border-radius: var(--radius-lg); background: var(--paper); color: var(--ink);
  width: min(440px, calc(100vw - 32px)); padding: 22px 24px;
  /* No taller than the screen that's showing (dvh leaves out the phone browser's bars); a long one scrolls inside. */
  max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain;
  box-shadow: 0 0 0 2px var(--ink), 0 24px 60px rgba(20, 16, 60, .35);
}
dialog::backdrop { background: rgba(20, 16, 60, .5); }
dialog h2 { font: 800 1.5rem var(--sans); letter-spacing: -0.02em; margin: 0 0 8px; }
dialog h2:focus { outline: none; }   /* focused only so the dialog opens at its top (js/app.js, openDialog) */
dialog h3 { font: 800 1rem var(--sans); margin: 18px 0 6px; }
dialog ul { padding-left: 20px; }
dialog li { margin-bottom: 4px; }
dialog form { margin-top: 18px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.share-card { display: block; width: 100%; height: auto; aspect-ratio: 1; border-radius: var(--radius); background: #25206b; }
.squares { font-size: .9rem; color: var(--ink-soft); }
.note { font-size: .9rem; color: var(--ink-soft); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; gap: 8px; margin-top: 8px; }
.stat-grid strong { display: block; font: 800 1.8rem var(--sans); font-variant-numeric: lining-nums; }
.stat-grid span { font-size: .8rem; color: var(--ink-soft); }
.bars { display: grid; gap: 4px; }
.bar-row { display: grid; grid-template-columns: 16px 1fr; gap: 8px; align-items: center; font-size: .9rem; }
.bar { background: var(--accent); color: var(--accent-ink); text-align: right; padding: 0 8px; border-radius: 6px; font-weight: 800; }
.star-rows { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: .9rem; }
.star-rows li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; margin: 0; }
.star-rows .stars i { width: 12px; height: 6px; }
.practice-list { list-style: none; padding: 0; display: grid; gap: 6px; }
.practice-list a {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: 12px; background: var(--card); text-decoration: none; color: inherit;
}
.practice-list a:hover { box-shadow: 0 0 0 2px var(--ink); }
.practice-list .stars i { width: 12px; height: 6px; }
.badge { font-size: .85rem; color: var(--ink-soft); font-weight: 600; }

/* ---- Info and legal pages ---- */
body.doc-page { height: auto; display: block; }
.doc-head { padding: 16px; background: var(--head); color: var(--head-ink); text-align: center; }
.doc-brand { font: 700 1.5rem var(--serif-display); color: inherit; text-decoration: none; }
.doc { max-width: 66ch; margin: 0 auto; padding: 28px 16px 48px; }
.doc h1 { font: 800 2rem/1.15 var(--sans); letter-spacing: -0.02em; margin: 0 0 6px; }
.doc h2 { font: 800 1.2rem/1.3 var(--sans); margin: 28px 0 6px; }
.doc h3 { font: 700 1rem/1.4 var(--sans); margin: 18px 0 4px; }
.doc p, .doc li { text-wrap: pretty; }
.doc ul { padding-left: 20px; }
.doc li { margin-bottom: 4px; }
.doc-date { color: var(--ink-soft); margin-top: 0; }
.doc-foot { justify-content: center; }
.load-error { color: var(--far); }
li.hint.load-error { font: inherit; }
/* No game to show (before launch day, or the puzzle didn't load: js/app.js, showNoGame): just the
   message, without the empty map or the buttons that need a puzzle. */
.no-game .map-wrap, .no-game .difficulty, .no-game #practice-btn, .no-game #units-btn { display: none; }
.no-game #stats-btn { visibility: hidden; }
.no-game .panel { margin: 0 auto; padding-top: 24px; }

/* ---- Toast ---- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 999px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 2000;
  max-width: calc(100vw - 32px); white-space: pre-line; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .hint.new, .hint-icon.used::after { animation: none; }
  .toast { transition: none; }
  .primary:active:not(:disabled) { transform: none; }
}
