/* Lanterna happens at night. The page is as dark as the unlit map, so the only
   bright things are what the player has lit: warm lantern light, from deep
   amber for a common answer to white for the rarest. Type is chalk on the dark.
   How rare an answer is shows as star magnitude: a bigger, paler mark, and a
   rayed star for the rarest. */
:root {
  --night: #070a13;    /* the page, and the sea on the map */
  --plate: #151c2f;    /* pressed controls */
  --chalk: #f3efe4;    /* text and linework */
  --mist: #939db4;     /* secondary text */
  --gilt: #f2b450;     /* lantern light: the main action */
  --rule: rgba(243, 239, 228, 0.17);

  /* The five tiers, common to legendary, each a clearly different colour
     (Ivan's choice): bronze, pale green, light blue, gold, and the brightest
     white for legendary. Same as the map (js/mapview.js). */
  --m1: #cd7f32;  /* bronze */
  --m2: #dcf8b1;  /* pale green */
  --m3: #5ec4ff;  /* light blue */
  --m4: #f5c542;  /* gold */
  --m5: #ffffff;  /* brightest white */

  /* The timer burning down, and the brighter lantern light under the pointer. */
  --fuse: #ff4a3d;
  --gilt-hi: #ffdd3c;

  --serif: 'Libre Caslon Text', 'Iowan Old Style', Georgia, serif;
  --sans: 'Schibsted Grotesk', 'Segoe UI', system-ui, sans-serif;

  --gutter: 1.25rem;
}

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

/* Scroll bars are dim on the dark, with no light track: on a wide screen the
   text column's bar runs down the middle of the map. */
html { background: var(--night); scrollbar-color: rgba(147, 157, 180, 0.32) transparent; }
.panel { scrollbar-width: thin; }

body {
  margin: 0;
  background: var(--night);
  color: var(--chalk);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

h1, h2, p, ol, ul, dl { margin: 0; }
ol, ul { padding: 0; list-style: none; }

::selection { background: var(--gilt); color: var(--night); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

:focus-visible {
  outline: 2px solid var(--gilt);
  outline-offset: 3px;
}

/* ---------- Layout: bar, map, text ---------- */

.shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 34rem;
  margin: 0 auto;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
  padding: max(0.5rem, env(safe-area-inset-top)) var(--gutter) 0;
}

/* The map fills its space edge to edge and fades into the page, which is the
   same colour as the night sea. */
.stage {
  position: relative;
  height: 46dvh;
  margin-top: 0.25rem;
  overflow: hidden;
}

.stage[hidden],
.shell[data-screen] .stage[hidden] { display: none; } /* beats the per-screen display rules below */

/* Before the script has written anything, the text block takes no room: on a
   slow connection the browser would otherwise paint it empty and then push it
   up as the words arrive. */
.panel:empty { display: none; }

.stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, var(--night), transparent 8%, transparent 88%, var(--night)),
    linear-gradient(to right, var(--night), transparent 5%, transparent 95%, var(--night));
}

.shell[data-screen='reveal'] .stage { height: 44dvh; }

.shell[data-screen='atlas'] .stage { height: 48dvh; }

/* The map's holder only takes part in the layout on phones (see the end of
   this file); everywhere else it is as if it were not there. */
.stage-wrap { display: contents; }

.map { display: block; width: 100%; height: 100%; }

/* Setting off: the text steps back while the camera drops to where you are. */
.panel { transition: opacity 400ms ease; }
.shell.is-leaving .panel { opacity: 0.3; }

.panel { padding: 1.25rem var(--gutter) 3rem; }

/* While typing on a phone the keyboard needs the room, so the map steps aside. */
@media (max-width: 59.99rem) {
  .shell[data-screen='rules'] .stage,
  .shell[data-screen='about'] .stage { display: none; }
}

/* Wide screens: the plate fills the left side and stays put; text runs down the right. */
@media (min-width: 60rem) {
  :root { --gutter: 1.875rem; } /* 30px on every screen, the question card's edge too (Ivan, 2026-11-19; was 3.5rem) */

  .shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(26rem, 36rem);
    grid-template-rows: auto 1fr;
    max-width: none;
    margin: 0;
  }

  .stage,
  .shell[data-screen] .stage {
    grid-column: 1;
    grid-row: 1 / 3;
    position: sticky;
    top: 0;
    height: 100dvh;
    margin: 0;
  }

  .stage::after {
    background:
      linear-gradient(to bottom, var(--night), transparent 5%, transparent 95%, var(--night)),
      linear-gradient(to right, var(--night), transparent 3%, transparent 90%, var(--night));
  }

  .bar {
    grid-column: 2;
    min-height: 4.5rem;
    padding: 2.25rem var(--gutter) 0 1rem;
  }

  .panel {
    grid-column: 2;
    padding: 3rem var(--gutter) 4rem 1rem;
  }

  /* With the map missing (its data failed to load) the text takes the middle. */
  .shell:has(.stage[hidden]) .bar,
  .shell:has(.stage[hidden]) .panel { grid-column: 1 / 3; width: 100%; max-width: 36rem; margin: 0 auto; }
}

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

.wordmark {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1;
}

.tabs { display: flex; gap: 1.5rem; }

.tab {
  min-height: 2.75rem;
  padding: 0.75rem 0 0.375rem;
  border: 0;
  border-bottom: 1.5px solid transparent;
  background: none;
  color: var(--mist);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

.tab:hover { color: var(--chalk); }
.tab[aria-current='page'] { color: var(--chalk); border-bottom-color: var(--chalk); cursor: default; }

.bar-side { display: flex; align-items: center; gap: 0.25rem; }

/* Sound on or off, during a game. */
.sound-icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-right: -0.625rem;
  border: 0;
  background: none;
  color: var(--mist);
  cursor: pointer;
}

.sound-icon svg { width: 1.375rem; height: 1.375rem; }
.sound-icon:hover { color: var(--chalk); }
.sound-icon[aria-pressed='false'] { opacity: 0.75; }

.count {
  color: var(--mist);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- Rarity marks: one per question ---------- */

.lamps {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 1.5rem;
}

/* Not answered yet: a small open ring. */
.lamp {
  --c: transparent;
  --size: 0.5rem;
  display: block;
  flex: none;
  width: var(--size);
  height: var(--size);
  border: 1px solid rgba(242, 245, 241, 0.42);
  border-radius: 50%;
}

.lamp.is-current { --size: 0.625rem; border: 1.5px solid var(--chalk); }

/* Missed: a short dash where a star would be. */
.lamp.is-miss {
  width: 0.625rem;
  height: 0;
  border: 0;
  border-top: 1.5px solid var(--mist);
  border-radius: 0;
}

.lamp.is-lit { border: 0; background: var(--c); box-shadow: 0 0 0.625rem -0.0625rem var(--c); }

.tier-common    { --c: var(--m1); --size: 0.375rem; }
.tier-uncommon  { --c: var(--m2); --size: 0.5rem; }
.tier-rare      { --c: var(--m3); --size: 0.6875rem; }
.tier-veryrare  { --c: var(--m4); --size: 0.875rem; }
.tier-legendary { --c: var(--m5); --size: 1.25rem; }

/* First magnitude: a rayed star, as on a star chart. */
.lamp.tier-legendary.is-lit {
  border-radius: 0;
  clip-path: polygon(50% 0, 55% 38%, 72.6% 27.4%, 62% 45%, 100% 50%, 62% 55%, 72.6% 72.6%, 55% 62%, 50% 100%, 45% 62%, 27.4% 72.6%, 38% 55%, 0 50%, 38% 45%, 27.4% 27.4%, 45% 38%);
  box-shadow: none;
}

/* ---------- Buttons ---------- */

.button {
  min-height: 3.25rem;
  padding: 0 1.5rem;
  border: 0;
  border-radius: 2px;
  background: var(--gilt);
  color: var(--night);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.button:hover { background: var(--gilt-hi); }
.button:focus-visible { outline-color: var(--chalk); }
.button:active { transform: translateY(1px); }

.button.is-quiet {
  background: transparent;
  color: var(--chalk);
  box-shadow: inset 0 0 0 1px var(--rule);
}

.button.is-quiet:hover { background: transparent; box-shadow: inset 0 0 0 1px var(--chalk); }

/* ---------- Headlines and running text ---------- */

.route {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 11.5vw, 3.75rem);
  line-height: 1.2; /* Caslon's g reaches 0.26 below the line and its capitals 0.77 above: just over 1 */
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.lede {
  margin-top: 1rem;
  max-width: 31em;
  font-size: 1.125rem;
}

.rules {
  margin-top: 0.5rem;
  max-width: 31em;
  color: var(--mist);
}

.note {
  margin-top: 0.75rem;
  color: var(--mist);
  font-size: 0.9375rem;
}

.credits {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--mist);
  font-size: 0.8125rem;
}

.credits a { color: inherit; text-underline-offset: 2px; }
.credits a:hover { color: var(--chalk); }

/* ---------- Tonight ---------- */

.home .button { margin-top: 1.5rem; }
.home .rules { margin-top: 1.5rem; }

/* The key to the marks, as a chart would print it. */
.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.125rem;
  margin-top: 1rem;
  padding: 0.875rem 0;
  border-block: 1px solid var(--rule);
  color: var(--mist);
  font-size: 0.875rem;
}

.legend li { display: inline-flex; align-items: center; gap: 0.5rem; }

/* Test builds: a plain menu for opening any day. */
.daypick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.875rem;
  margin-top: 2rem;
  color: var(--mist);
  font-size: 0.9375rem;
}

.daypick select {
  min-height: 2.75rem;
  padding: 0 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--plate);
  color: var(--chalk);
  font: inherit;
  font-weight: 600;
}

.daypick select:hover { border-color: var(--mist); }

.wait { margin-top: 0.5rem; max-width: 31em; color: var(--mist); }

/* How to play, About, sound: quiet links at the foot of the start screen. */
.footlinks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin-top: 2rem;
}

.textlink {
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--chalk);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  cursor: pointer;
}

.textlink:hover { text-decoration-color: var(--chalk); }
.textlink[aria-pressed='false'] { color: var(--mist); }

.footlinks + .credits { margin-top: 1rem; }

/* ---------- How to play, and about ---------- */

.page p { margin-top: 0.75rem; max-width: 34em; }
.page .route + p { margin-top: 1.25rem; font-size: 1.125rem; }

.page h2 {
  margin-top: 2rem;
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1.2;
}

.page a { color: inherit; text-underline-offset: 3px; }
.page a:hover { color: var(--gilt); }
.page .button { margin-top: 2.25rem; }

.legend.is-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  max-width: 22rem;
  padding: 0;
  color: var(--chalk);
  font-size: 1rem;
}

.legend.is-list li {
  display: grid;
  grid-template-columns: 1.75rem 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.legend.is-list li + li { border-top: 1px solid var(--rule); }
.legend.is-list .lamp { justify-self: center; }
.legend.is-list .range { color: var(--mist); font-variant-numeric: tabular-nums; }

/* ---------- Question ---------- */

.fuse {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.fuse-track {
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* The time left is a rule that shortens. */
.fuse-light {
  display: block;
  width: 100%;
  height: 3px;
  margin-top: -1px;
  background: var(--chalk);
}

.fuse-secs {
  min-width: 1.5em;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.fuse.is-low .fuse-light { height: 5px; margin-top: -2px; background: var(--gilt); }
.fuse.is-low .fuse-secs { color: var(--gilt); animation: tighten 1s ease-in-out infinite; }

@keyframes tighten {
  50% { transform: scale(1.18); }
}

/* Your Europe: how much is lit, said once and large. It is the page's
   headline, on two lines: the number in the colour of light, then the words.
   (No tabular figures: they leave a gap after a 1.) */
.big-share { text-wrap: wrap; }
.big-num {
  display: block;
  font-size: clamp(4.25rem, 19vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--gilt);
}
.big-label { display: block; font-size: clamp(1.75rem, 8vw, 2.5rem); line-height: 1.2; }

.whereabouts {
  margin-top: 1.5rem;
  color: var(--mist);
  font-size: 0.9375rem;
}

.question {
  margin-top: 0.5rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 8.6vw, 2.875rem);
  line-height: 1.05;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

/* The answer is written on a ruled line, not typed into a box. */
.answer-form {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.answer-form input {
  flex: 1;
  min-width: 0;
  height: 3.25rem;
  padding: 0;
  border: 0;
  border-bottom: 1.5px solid var(--chalk);
  border-radius: 0;
  background: none;
  color: var(--chalk);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.75rem;
  /* Italic letters lean out past where they start: the foot of a "p" or "j"
     would be cut off at the box's inner edge. A little indent and a line tall
     enough for the descenders keep them whole. */
  text-indent: 0.15em;
  line-height: 1.5;
}

.answer-form input::placeholder { color: var(--mist); opacity: 0.75; }
.answer-form input:focus { outline: none; border-bottom: 2.5px solid var(--gilt); }

.hint {
  min-height: 1.5rem;
  margin-top: 0.5rem;
  color: var(--mist);
  font-size: 0.9375rem;
}

/* ---------- Result ---------- */

.asked {
  color: var(--mist);
  font-size: 0.9375rem;
}

.given {
  margin-top: 0.125rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(2.75rem, 12.5vw, 4.25rem);
  line-height: 1.04;
  color: var(--c);
  overflow-wrap: anywhere;
}

.reveal.is-miss .given {
  color: var(--mist);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.reveal .given { animation: set-down 320ms ease-out both; }

@keyframes set-down {
  from { opacity: 0; transform: translateY(0.2em); }
  to   { opacity: 1; transform: none; }
}

.read-as {
  margin-top: 0.375rem;
  color: var(--mist);
  font-size: 0.9375rem;
}

.verdict {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-top: 1rem;
  font-size: 1.125rem;
  font-weight: 700;
}

.verdict .points {
  font-weight: 400;
  color: var(--mist);
  font-variant-numeric: tabular-nums;
}

.travel { margin-top: 0.625rem; max-width: 31em; }

.context {
  margin-top: 1.125rem;
  max-width: 31em;
  color: var(--mist);
  font-size: 0.875rem;
  opacity: 0.85;
}

.context b { color: var(--chalk); font-weight: 600; }

.reveal .button { margin-top: 1.5rem; }

/* ---------- End of the night ---------- */

.total {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 8.6vw, 2.875rem);
  line-height: 1.05;
  text-wrap: balance;
}

.total-note { margin-top: 0.875rem; max-width: 32em; color: var(--mist); }

/* The night's answers, set out like a catalogue of stars. */
.recap { margin-top: 1.75rem; border-top: 1px solid var(--rule); }

.recap > li { border-bottom: 1px solid var(--rule); }

/* Each answer is a row that opens into every answer on our list. */
.recap summary {
  display: grid;
  grid-template-columns: 1.75rem 1fr auto;
  align-items: baseline;
  column-gap: 0.5rem;
  padding: 0.75rem 0;
  list-style: none;
  cursor: pointer;
}

.recap summary::-webkit-details-marker { display: none; }
.recap summary:focus-visible { outline: 2px solid var(--gilt); outline-offset: 2px; border-radius: 0.25rem; }

/* A small chevron after the score: down when shut, up when open. */
.recap .worth::after {
  content: '';
  display: inline-block;
  width: 0.4em;
  height: 0.4em;
  margin-left: 0.6em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-0.2em) rotate(45deg);
  transition: transform 160ms ease;
}

.recap details[open] .worth::after { transform: translateY(0.05em) rotate(-135deg); }

.answers-panel { margin: 0 0 0.875rem 2.25rem; }
.answers-head { margin-bottom: 0.375rem; color: var(--mist); font-size: 0.8125rem; }

.answer-tiers { border-left: 1px solid var(--rule); }

/* Each tier: its name and count, then its answers in tidy columns like an
   index, name on the left and score on the right, so a list of a hundred
   still reads in straight lines. Commonest first, line by line. */
.answer-tier { padding: 0.625rem 0 0.625rem 0.875rem; }

.answer-tier + .answer-tier { border-top: 1px solid var(--rule); }

.answer-tier-name {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.375rem;
  color: var(--c);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
}

.answer-tier-count { color: var(--mist); font-size: 0.8125rem; font-weight: 400; }

.answer-words {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  column-gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
  line-height: 1.3;
  color: var(--chalk);
}

.answer-words li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(243, 239, 228, 0.05);
}

.answer-score {
  flex: none;
  color: var(--mist);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

/* Your own answer: ringed in its tier's colour. */
.answer-words .is-yours {
  margin: 0 -0.5rem;
  padding: 0.25rem 0.5rem;
  border-bottom-color: transparent;
  border-radius: 0.375rem;
  box-shadow: inset 0 0 0 1.5px var(--c);
  color: var(--c);
  font-weight: 700;
}

.answer-words .is-yours .answer-score { color: var(--c); }

@media (prefers-reduced-motion: reduce) { .recap .worth::after { transition: none; } }

.recap .lamp { align-self: center; justify-self: center; }
.recap .asked { grid-column: 2 / 4; font-size: 0.875rem; }

.recap .said {
  grid-column: 2;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.625rem;
  line-height: 1.2;
  color: var(--c);
  overflow-wrap: anywhere;
}

.recap .is-missed .said { color: var(--mist); }

.recap .worth {
  grid-column: 3;
  text-align: right;
  white-space: nowrap;
  font-size: 0.875rem;
  color: var(--mist);
}

.actions { display: flex; flex-wrap: wrap; gap: 0.625rem; margin-top: 2rem; }

/* End of the night: sharing is the one big button, full width like the start
   screen's; the two ways on sit side by side under it, equal halves. */
.night .actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
}

.night .actions .button { width: 100%; padding: 0 0.75rem; }
.night .actions .button:first-child { grid-column: 1 / -1; }

/* ---------- Your Europe ---------- */

.atlas > .button { margin-top: 1.5rem; }

.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.625rem 1.75rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.facts dt { color: var(--mist); }
.facts dd { margin: 0; font-weight: 600; }

.erase {
  display: block;
  margin-top: 2.5rem;
  padding: 0.5rem 0;
  border: 0;
  background: none;
  color: var(--mist);
  font: inherit;
  font-size: 0.9375rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.erase:hover, .erase.is-armed { color: var(--chalk); }
.atlas > .textlink { display: block; margin-top: 1.5rem; text-align: left; }

/* ---------- Stats ---------- */

.stats h2 {
  margin-top: 2.25rem;
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1.2;
}
.stats > .button { margin-top: 1.5rem; }
.stats .facts { margin-top: 1.5rem; }
.stats-note { margin-top: 0.375rem; color: var(--mist); font-size: 0.875rem; }

/* The last nights, as bars rising from one line. */
.score-bars { display: flex; align-items: flex-end; gap: 0.375rem; margin-top: 1.25rem; }
.score-bars li { flex: 1; max-width: 2.75rem; min-width: 0; display: flex; flex-direction: column; align-items: stretch; }
.score-value { margin-bottom: 0.25rem; color: var(--chalk); font-size: 0.75rem; text-align: center; font-variant-numeric: tabular-nums; }
.score-bar { display: block; height: max(2px, calc(var(--k) * 7rem)); border-radius: 2px 2px 0 0; background: rgba(243, 239, 228, 0.3); }
.score-bars .is-crossed .score-bar { background: var(--gilt); box-shadow: 0 0 0.75rem -0.25rem var(--gilt); }
.score-day { padding-top: 0.375rem; border-top: 1px solid var(--rule); color: var(--mist); font-size: 0.75rem; text-align: center; font-variant-numeric: tabular-nums; }

/* Answers found, rarest first, each with its mark. */
.tier-tally { margin-top: 0.75rem; }
.tier-tally li { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--rule); }
.tally-mark { display: grid; place-items: center; width: 1.25rem; height: 1.25rem; }
.tally-name { color: var(--chalk); }
.tally-n { margin-left: auto; font-family: var(--serif); font-size: 1.375rem; line-height: 1; font-variant-numeric: tabular-nums; }
.tier-tally .is-none .tally-name, .tier-tally .is-none .tally-n { color: var(--mist); }
.tier-tally .is-none .lamp { opacity: 0.35; box-shadow: none; }

/* Three tabs and the name on a small phone. */
@media (max-width: 24rem) {
  .tabs { gap: 1rem; }
  .wordmark { font-size: 1.3125rem; }
}

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

/* Small additions: share, returning-player line. */
.player-line { margin-top: 0.75rem; color: var(--gilt); font-size: 0.9375rem; }
.share-note { margin-top: 0.75rem; color: var(--mist); font-size: 0.9375rem; }
.share-box { display: block; width: 100%; margin-top: 0.5rem; padding: 0.5rem; border: 1px solid var(--rule); background: var(--plate); color: var(--chalk); font: inherit; resize: none; }

/* The night as a picture: seven lamps, large. */
.lamps.is-big { height: 2.5rem; gap: 1.5rem; margin-top: 1.25rem; padding-left: 0.5rem; }
.lamps.is-big .lamp { transform: scale(1.9); }
.lamps.is-big .lamp:not(.is-lit):not(.is-miss) { opacity: 0.5; border: 1.5px solid var(--mist); background: none; --size: 0.5rem; }

/* The main button: wide on a phone, so the thumb finds it, with a warm glow. */
.home .button, .night .actions .button:first-child { box-shadow: 0 0 2rem -0.5rem var(--gilt); }
@media (max-width: 59.99rem) {
  .home > .button { width: 100%; }
}

/* ---------- Result: the rarity meter ---------- */
.reveal .asked { margin-bottom: 0.5rem; }
.meter { position: relative; height: 3px; margin-top: 0.875rem; max-width: 20rem; background: var(--rule); }
.meter-fill {
  position: absolute; inset: 0 auto 0 0;
  width: var(--to);
  background: var(--c);
  box-shadow: 0 0 0.75rem var(--c);
  animation: fill-meter 700ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.meter-tick { position: absolute; top: -3px; width: 1px; height: 9px; background: var(--mist); opacity: 0.6; }
.travel b { color: var(--chalk); font-weight: 700; }
@keyframes fill-meter { from { width: 0; } }
@media (prefers-reduced-motion: reduce) { .meter-fill { animation: none; } }

/* ---------- End of the night: three figures ---------- */
/* One grid of two rows: the numbers stand on one line (a shared baseline,
   whatever their size) and every label starts on the same line below, even
   when one label wraps to two lines and its neighbours do not (Ivan,
   2026-11-19: "3" sat lower than "0" on the Stats tab). Each figure's own
   <div> steps aside (display: contents) so its number and label can take
   their places in the shared rows. */
.figures {
  display: grid;
  grid-template-rows: auto auto;
  grid-auto-columns: minmax(0, 1fr);
  column-gap: 1.5rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}
.figures > div { display: contents; }
.figures dd, .figures dt { margin: 0; }
.figures dd { grid-row: 1; align-self: baseline; white-space: nowrap; font-family: var(--serif); font-size: clamp(1.5rem, 7vw, 2.5rem); line-height: 1.05; color: var(--chalk); font-variant-numeric: tabular-nums; }
.figures dt { grid-row: 2; margin-top: 0.25rem; color: var(--mist); font-size: 0.8125rem; line-height: 1.3; }

/* ---------- Second critique pass ---------- */
.lamps.is-big .lamp.is-miss { width: 0.5rem; height: 0.5rem; border: 1.5px solid var(--mist); border-radius: 50%; background: none; }
/* The main figure, the last one, gets a wider column. */
.figures:has(> .is-main:nth-child(2)) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
.figures:has(> .is-main:nth-child(3)) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr); }
.figures .is-main dd { font-size: clamp(2.25rem, 11vw, 3.5rem); color: var(--gilt); }
.best-line { margin-top: 1rem; color: var(--mist); font-size: 0.9375rem; }
.fuse-light { height: 4px; margin-top: -1px; }
.fuse.is-low .fuse-light { height: 6px; margin-top: -2px; }

/* Tablets and narrow desktop windows: one column, but wider, with a bigger map. */
@media (min-width: 34rem) and (max-width: 59.99rem) {
  .shell { max-width: 46rem; }
  .stage { height: 58dvh; }
  .shell[data-screen='reveal'] .stage { height: 52dvh; }
  .stage::after {
    background:
      linear-gradient(to bottom, var(--night), transparent 8%, transparent 88%, var(--night)),
      linear-gradient(to right, var(--night), transparent 14%, transparent 86%, var(--night));
  }
}
/* A missed answer is a dim dot; an empty ring means not asked yet. */
.lamps.is-big .lamp.is-miss { width: 0.4rem; height: 0.4rem; border: 0; background: var(--mist); opacity: 0.45; }

/* ---------- The question: a card floating over the whole map ---------- */
/* The map fills the window; the bar floats along the top; the question sits
   in a card at the top (phone) or top right (wide screen), so a phone
   keyboard never covers it. */

.shell[data-screen='question'] .stage,
.shell[data-screen='reveal'] .stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  height: auto;
  margin: 0;
}

.shell[data-screen='question'] .stage::after,
.shell[data-screen='reveal'] .stage::after { background: none; }

.shell[data-screen='question'] .bar,
.shell[data-screen='reveal'] .bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  max-width: none;
  min-height: 3.5rem;
  margin: 0;
  padding: max(0.625rem, env(safe-area-inset-top)) 1rem 0.5rem;
  background: linear-gradient(to bottom, rgba(7, 10, 19, 0.85), rgba(7, 10, 19, 0));
}

.shell[data-screen='question'] .panel,
.shell[data-screen='reveal'] .panel {
  position: fixed;
  z-index: 10;
  top: calc(max(0.625rem, env(safe-area-inset-top)) + 3.5rem);
  left: 0.625rem;
  right: 0.625rem;
  padding: 1.25rem 1.25rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 1.5rem;
  background: rgba(21, 28, 47, 0.94);
  box-shadow: 0 1.5rem 3rem -1rem rgba(0, 0, 0, 0.7);
}

/* The result: on a phone the card sits at the bottom, so the light you just
   lit stays in view above it. */
.shell[data-screen='reveal'] .panel {
  top: auto;
  bottom: max(0.625rem, env(safe-area-inset-bottom));
  max-height: 60dvh;
  overflow-y: auto;
}

.shell[data-screen='reveal'] .reveal .button { width: 100%; margin-top: 1.25rem; }
.shell[data-screen='reveal'] .given { font-size: clamp(2.25rem, 10vw, 3.25rem); }
.shell[data-screen='reveal'] .meter { max-width: none; }

@media (min-width: 60rem) {
  .shell[data-screen='question'] .bar,
  .shell[data-screen='reveal'] .bar { padding: 1.25rem var(--gutter) 0.5rem; }

  .shell[data-screen='question'] .panel,
  .shell[data-screen='reveal'] .panel {
    top: 5rem;
    bottom: auto;
    max-height: calc(100dvh - 6.5rem);
    left: auto;
    right: var(--gutter);
    width: 27rem;
    padding: 1.75rem 1.75rem 1.25rem;
  }
}

/* The time left: a thick rounded bar, the seconds in a circle. */
.shell[data-screen='question'] .fuse-track {
  height: 0.5rem;
  border-radius: 999px;
  background: var(--plate);
  box-shadow: inset 0 0 0 1px var(--rule);
  overflow: hidden;
}

.shell[data-screen='question'] .fuse-light,
.shell[data-screen='question'] .fuse.is-low .fuse-light {
  height: 100%;
  margin: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--fuse), var(--gilt));
}

.shell[data-screen='question'] .fuse.is-low .fuse-light { background: var(--fuse); }

.shell[data-screen='question'] .fuse-secs {
  display: grid;
  place-items: center;
  min-width: 0;
  width: 2.375rem;
  height: 2.375rem;
  border-radius: 50%;
  background: var(--chalk);
  color: var(--night);
  font-size: 0.9375rem;
}

.shell[data-screen='question'] .fuse.is-low .fuse-secs { background: var(--gilt); color: var(--night); }

.shell[data-screen='question'] .whereabouts { margin-top: 0.875rem; font-size: 0.875rem; }

.shell[data-screen='question'] .question { margin-top: 0.25rem; font-size: clamp(1.625rem, 6.6vw, 2rem); line-height: 1.07; }

/* A rounded field and a round arrow button. */
.shell[data-screen='question'] .answer-form { align-items: center; gap: 0.5rem; margin-top: 1rem; }

.shell[data-screen='question'] .answer-form input {
  height: 3.25rem;
  padding: 0 1.125rem;
  border: 1.5px solid var(--rule);
  border-radius: 999px;
  background: var(--night);
  font-size: 1.25rem;
}

.shell[data-screen='question'] .answer-form input:focus { border: 1.5px solid var(--gilt); }

.send {
  display: grid;
  place-items: center;
  flex: none;
  width: 3.25rem;
  height: 3.25rem;
  border: 0;
  border-radius: 50%;
  background: var(--gilt);
  color: var(--night);
  cursor: pointer;
  transition: background 150ms ease;
}

.send:hover { background: var(--gilt-hi); }
.send svg { width: 1.375rem; height: 1.375rem; }

.shell[data-screen='question'] .hint { margin-top: 0.25rem; min-height: 1.25rem; font-size: 0.875rem; }

/* A wrong try: the answer box gives a small shake. */
.answer-form.is-wrong { animation: shake 320ms ease-in-out; }

@keyframes shake {
  20% { transform: translateX(-6px); }
  45% { transform: translateX(5px); }
  70% { transform: translateX(-3px); }
}

@media (prefers-reduced-motion: reduce) { .answer-form.is-wrong { animation: none; } }

/* ---------- Phone fixes (Ivan's phone test, 2026-11-18) ---------- */

/* Start screen: the line, the seven rings and the button sit together as one
   group instead of floating apart. The rings are smaller and sit flush left. */
.home .lede + .lamps.is-big { margin-top: 0.875rem; }
.home .lamps.is-big { height: 1.75rem; gap: 1.125rem; padding-left: 0.35rem; }
.home .lamps.is-big .lamp { transform: scale(1.5); }
.home .lamps.is-big + .player-line { margin-top: 0.5rem; }
.home > .button { margin-top: 1.25rem; }

/* The result card on a phone: compact, so the lit route stays in view above it. */
@media (max-width: 59.99rem) {
  .shell[data-screen='reveal'] .panel { padding: 1rem 1.125rem 0.875rem; max-height: 46dvh; }
  .shell[data-screen='reveal'] .asked { font-size: 0.875rem; line-height: 1.35; }
  .shell[data-screen='reveal'] .given { margin-top: 0.125rem; font-size: clamp(1.875rem, 8.5vw, 2.375rem); }
  .shell[data-screen='reveal'] .read-as { font-size: 0.8125rem; }
  .shell[data-screen='reveal'] .verdict { margin-top: 0.5rem; font-size: 1rem; }
  .shell[data-screen='reveal'] .meter { margin-top: 0.5rem; }
  .shell[data-screen='reveal'] .travel { margin-top: 0.5rem; font-size: 0.9375rem; line-height: 1.4; }
  .shell[data-screen='reveal'] .context { margin-top: 0.25rem; font-size: 0.8125rem; line-height: 1.4; }
  .shell[data-screen='reveal'] .reveal .button { min-height: 2.875rem; margin-top: 0.75rem; }
}

/* Phones: the map runs edge to edge. Its box has Europe's own shape (about
   1.1 times as tall as wide), so all of Europe fills the full width with no
   empty night at the sides, and the sides no longer fade into the page. */
@media (max-width: 33.99rem) {
  .stage,
  .shell[data-screen='atlas'] .stage,
  .shell[data-screen='stats'] .stage,
  .shell[data-screen='home'] .stage,
  .shell[data-screen='night'] .stage { height: min(110vw, 70dvh); margin-top: 0; }

  .stage::after { background: linear-gradient(to bottom, var(--night), transparent 6%, transparent 86%, var(--night)); }
}

/* Wide screens: the map column has Europe's own shape (as tall as the window,
   0.91 as wide), so Europe fills it with no empty night inside, and the text
   sits right beside it. The pair is centred in the window, so any spare width
   becomes even margins at the outer edges, not a gap between map and text. */
@media (min-width: 60rem) {
  .shell {
    grid-template-columns: min(calc(100dvh * 0.91), calc(100vw - 30rem)) minmax(26rem, 36rem);
    justify-content: center;
    column-gap: 1rem;
  }

  .stage::after {
    background:
      linear-gradient(to bottom, var(--night), transparent 5%, transparent 95%, var(--night)),
      linear-gradient(to right, var(--night), transparent 4%, transparent 96%, var(--night));
  }
}


/* ---------- The map is the page ---------- */
/* (2026-11-18: map on one side and text on the other looked like a slide.)
   On the start screen, the end of the night, Your Europe and the info pages
   the map fills the window and the text is written straight onto the night,
   with no box: lower left on a wide screen, along the bottom on a phone. The
   map darkens smoothly towards the text so it stays readable, and the camera
   keeps Europe and the route in the open part. */

.shell[data-screen='home'],
.shell[data-screen='night'],
.shell[data-screen='atlas'],
.shell[data-screen='stats'],
.shell[data-screen='rules'],
.shell[data-screen='about'] { height: 100dvh; overflow: hidden; }

.shell[data-screen='home'] .stage,
.shell[data-screen='night'] .stage,
.shell[data-screen='atlas'] .stage,
.shell[data-screen='stats'] .stage,
.shell[data-screen='rules'] .stage,
.shell[data-screen='about'] .stage {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 0;
  width: auto;
  height: auto;
  margin: 0;
}

/* The night deepens towards the text: from the bottom on a phone. */
.shell[data-screen='home'] .stage::after,
.shell[data-screen='night'] .stage::after,
.shell[data-screen='atlas'] .stage::after,
.shell[data-screen='stats'] .stage::after,
.shell[data-screen='rules'] .stage::after,
.shell[data-screen='about'] .stage::after {
  background: linear-gradient(to top, rgba(7, 10, 19, 0.97) 0%, rgba(7, 10, 19, 0.9) 40%, rgba(7, 10, 19, 0) 62%);
}

.shell[data-screen='home'] .bar,
.shell[data-screen='night'] .bar,
.shell[data-screen='atlas'] .bar,
.shell[data-screen='stats'] .bar,
.shell[data-screen='rules'] .bar,
.shell[data-screen='about'] .bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  max-width: none;
  margin: 0;
  padding: max(0.625rem, env(safe-area-inset-top)) var(--gutter) 0.5rem;
  background: linear-gradient(to bottom, rgba(7, 10, 19, 0.8), rgba(7, 10, 19, 0));
}

.shell[data-screen='home'] .panel,
.shell[data-screen='night'] .panel,
.shell[data-screen='atlas'] .panel,
.shell[data-screen='stats'] .panel,
.shell[data-screen='rules'] .panel,
.shell[data-screen='about'] .panel {
  position: fixed;
  z-index: 10;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 60dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.5rem var(--gutter) max(1.5rem, env(safe-area-inset-bottom));
}

.shell[data-screen='rules'] .panel,
.shell[data-screen='about'] .panel,
.shell[data-screen='stats'] .panel,
.shell[data-screen='night'] .panel { max-height: 64dvh; }

.shell[data-screen='home'] .panel .route { font-size: clamp(2.25rem, 10vw, 3.5rem); }

@media (min-width: 60rem) {
  /* Wide screens: the text runs down the left over the darkened night. */
  .shell[data-screen='home'] .stage::after,
  .shell[data-screen='night'] .stage::after,
  .shell[data-screen='atlas'] .stage::after,
  .shell[data-screen='stats'] .stage::after,
  .shell[data-screen='rules'] .stage::after,
  .shell[data-screen='about'] .stage::after {
    background: linear-gradient(to right, rgba(7, 10, 19, 0.96) 0, rgba(7, 10, 19, 0.88) 30rem, rgba(7, 10, 19, 0) 46rem);
  }

  .shell[data-screen='home'] .bar,
  .shell[data-screen='night'] .bar,
  .shell[data-screen='atlas'] .bar,
  .shell[data-screen='stats'] .bar,
  .shell[data-screen='rules'] .bar,
  .shell[data-screen='about'] .bar { padding: 1.75rem var(--gutter) 0.5rem; }

  .shell[data-screen='home'] .panel,
  .shell[data-screen='night'] .panel,
  .shell[data-screen='atlas'] .panel,
  .shell[data-screen='stats'] .panel,
  .shell[data-screen='rules'] .panel,
  .shell[data-screen='about'] .panel {
    top: 0;
    right: auto;
    width: 36rem;
    max-height: none;
    display: flex;
    flex-direction: column;
    padding: 6rem var(--gutter) 3rem;
  }

  /* The start screen's text sits low, like a title over an opening shot. */
  .shell[data-screen='home'] .panel > .home { margin-top: auto; }
}

/* The start screen: tonight's crossing low on the left, and everything else
   in one quiet strip along the foot of the window. */
.homefoot { margin-top: 1.75rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-size: 0.875rem; }
.homefoot .daypick { margin-top: 0; }
.homefoot .footlinks { margin-top: 0.75rem; }

@media (min-width: 60rem) {
  /* --foot: the pinned strip's height, measured in app.js (placeText). */
  .shell[data-screen='home'] .panel { width: 34rem; padding-bottom: max(6.5rem, calc(var(--foot, 0px) + 1.5rem)); }


  .homefoot {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 15;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 1.5rem;
    margin: 0;
    padding: 0.75rem var(--gutter) 1rem;
    border-top: 0;
    background: linear-gradient(to top, rgba(7, 10, 19, 0.92), rgba(7, 10, 19, 0));
    color: var(--mist);
  }

  .homefoot .daypick { display: flex; align-items: center; gap: 0.625rem; }
  .homefoot .daypick label { margin: 0; }
  .homefoot .daypick select { min-height: 2.25rem; }
  .homefoot .note { margin: 0; font-size: 0.8125rem; }
  .homefoot .footlinks { margin: 0 0 0 auto; gap: 1.25rem; }
  .homefoot .footlinks .textlink { font-size: 0.875rem; }
  .homefoot .credits { flex-basis: 100%; margin: 0; font-size: 0.75rem; }
}

/* Phones: the start screen's text takes under half the screen, so the map
   keeps the top half; the rest scrolls inside the text area. */
@media (max-width: 59.99rem) {
  .shell[data-screen='home'] .panel { max-height: 47dvh; }
  .shell[data-screen='home'] .panel .route { margin-top: 0.25rem; }
}

/* Text that scrolls up over the map fades out at the top of its area instead
   of being cut off in a hard line. The area starts with some room, so nothing
   is faded until you scroll. */
.shell[data-screen='home'] .panel,
.shell[data-screen='night'] .panel,
.shell[data-screen='atlas'] .panel,
.shell[data-screen='stats'] .panel,
.shell[data-screen='rules'] .panel,
.shell[data-screen='about'] .panel {
  padding-top: 2.5rem;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 2.5rem);
  mask-image: linear-gradient(to bottom, transparent 0, #000 2.5rem);
}

@media (min-width: 60rem) {
  .shell[data-screen='home'] .panel,
  .shell[data-screen='night'] .panel,
  .shell[data-screen='atlas'] .panel,
  .shell[data-screen='stats'] .panel,
  .shell[data-screen='rules'] .panel,
  .shell[data-screen='about'] .panel {
    padding-top: 6rem;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, transparent 3.5rem, #000 6rem);
    mask-image: linear-gradient(to bottom, transparent 0, transparent 3.5rem, #000 6rem);
  }
}

/* Counting up: the score and the places lit rise with the light, then land
   with a small pop. */
.is-landed { display: inline-block; animation: landed 420ms cubic-bezier(0.2, 0.9, 0.3, 1.3); }
@keyframes landed { 40% { transform: scale(1.3); } }
@media (prefers-reduced-motion: reduce) { .is-landed { animation: none; } }
.meter-fill.is-driven { animation: none; }
.verdict .points .count, .travel b { font-variant-numeric: tabular-nums; }

/* ---------- Phones: the text slides up over the map ---------- */
/* (2026-11-18, Ivan.) On the start screen, the end of the night, Your Europe
   and the info pages the whole page scrolls. First the text slides up over
   the map while the map stays put; once the text has climbed about halfway up
   the map, the map scrolls away with it. The map is sticky inside a holder
   that is --hold taller than the window, so the hand-over happens in the
   browser's own scrolling, with no script.
   --rest: the highest the text starts, from the top of the window; shorter
     text sits lower, at the foot of the window.
   --hold: how far the text climbs before the map moves too.
   --fade: the soft dark edge above the text that travels with it.
   All of them come from --steady, a height that stays put while a phone's
   address bar slides in and out (see js/viewport.js). */
@media (max-width: 59.99rem) {
  .shell[data-screen='home'],
  .shell[data-screen='night'],
  .shell[data-screen='atlas'],
  .shell[data-screen='stats'],
  .shell[data-screen='rules'],
  .shell[data-screen='about'] {
    /* --steady: the window's height in px, measured by js/viewport.js (the
       browser's own 100svh is the fallback if that script did not run).
       --tall is the map's height: a little more than the window, so the map
       still reaches the foot when the phone's bars slide away and the window
       grows. */
    --steady-h: var(--steady, 100svh);
    --tall-h: calc(var(--steady, 100lvh) + 7.5rem);
    --rest: calc(var(--steady-h) * 0.54); /* app.js sets it in px per screen (placeText) */
    --hold: calc(var(--steady-h) * 0.26);
    --fade: calc(var(--steady-h) * 0.02);
    height: auto;
    min-height: var(--steady-h);
    /* The map's holder is taller than the window (--tall-h plus --hold), so
       that the map can stay put while long text slides up over it. Clipped
       here, that extra height adds nothing to the length of the page: a page
       whose text fits on one screen does not scroll at all. Left to show, it
       let such a page scroll up by a quarter of a screen, leaving the text
       in the middle and empty night below (Ivan's phone, 2026-11-20).
       "clip", not "hidden": hidden would make this box the one that scrolls
       and the map would no longer stay put. */
    overflow-x: visible;
    overflow-y: clip;
  }

  .shell[data-screen='night'],
  .shell[data-screen='stats'],
  .shell[data-screen='rules'],
  .shell[data-screen='about'] { --rest: calc(var(--steady-h) * 0.5); }

  .shell[data-screen='home'] .stage-wrap,
  .shell[data-screen='night'] .stage-wrap,
  .shell[data-screen='atlas'] .stage-wrap,
  .shell[data-screen='stats'] .stage-wrap,
  .shell[data-screen='rules'] .stage-wrap,
  .shell[data-screen='about'] .stage-wrap {
    display: block;
    height: calc(var(--tall-h) + var(--hold));
    margin-bottom: calc(var(--rest) - var(--fade) - var(--tall-h) - var(--hold));
  }

  .shell .stage-wrap:has(> .stage[hidden]) { display: contents; }

  /* While the map data is still on its way the holder keeps its room, so the
     text appears where it will rest and the map fills in above it, instead of
     the text jumping up from below the window when the map arrives.
     (index.html starts with is-map-loading; app.js takes it off.) */
  .shell.is-map-loading[data-screen] .stage-wrap:has(> .stage[hidden]) { display: block; }

  .shell[data-screen='home'] .stage,
  .shell[data-screen='night'] .stage,
  .shell[data-screen='atlas'] .stage,
  .shell[data-screen='stats'] .stage,
  .shell[data-screen='rules'] .stage,
  .shell[data-screen='about'] .stage {
    position: sticky;
    top: 0;
    inset: 0 auto auto;
    height: var(--tall-h);
  }

  /* The map only fades under the bar; the dark edge now belongs to the text. */
  .shell[data-screen='home'] .stage::after,
  .shell[data-screen='night'] .stage::after,
  .shell[data-screen='atlas'] .stage::after,
  .shell[data-screen='stats'] .stage::after,
  .shell[data-screen='rules'] .stage::after,
  .shell[data-screen='about'] .stage::after {
    background: linear-gradient(to bottom, rgba(7, 10, 19, 0.6), rgba(7, 10, 19, 0) 12%);
  }

  /* Between a phone and a wide screen the map is a column in the middle of
     the window, and the land runs to the column's sides, so there it fades
     into the page instead of ending in a straight cut. */
  @media (min-width: 34rem) {
    .shell[data-screen='home'] .stage::after,
    .shell[data-screen='night'] .stage::after,
    .shell[data-screen='atlas'] .stage::after,
    .shell[data-screen='stats'] .stage::after,
    .shell[data-screen='rules'] .stage::after,
    .shell[data-screen='about'] .stage::after {
      background:
        linear-gradient(to bottom, rgba(7, 10, 19, 0.6), rgba(7, 10, 19, 0) 12%),
        linear-gradient(to right, var(--night), rgba(7, 10, 19, 0) 9%, rgba(7, 10, 19, 0) 91%, var(--night));
    }
  }

  .shell[data-screen='home'] .panel,
  .shell[data-screen='night'] .panel,
  .shell[data-screen='atlas'] .panel,
  .shell[data-screen='stats'] .panel,
  .shell[data-screen='rules'] .panel,
  .shell[data-screen='about'] .panel {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    max-height: none;
    overflow: visible;
    /* Short text sinks to the foot of the window, so the map above it gets
       all the room; --rest is only the highest the text starts. */
    margin-top: auto;
    padding-top: calc(var(--fade) + 0.5rem);
    /* Clear at first and dark only near the words, so a city drawn just
       above the text is not dimmed. */
    background: linear-gradient(to bottom,
      rgba(7, 10, 19, 0) 0,
      rgba(7, 10, 19, 0.2) calc(var(--fade) * 0.55),
      rgba(7, 10, 19, 0.92) var(--fade),
      rgba(7, 10, 19, 0.97) calc(var(--fade) + 5rem));
  }

  /* Once the map scrolls away, the bar gets a dark ground. */
  .shell .bar { transition: background-color 240ms ease; }
  .shell.is-scrolled[data-screen] .bar {
    background-color: rgba(7, 10, 19, 0.94);
    box-shadow: 0 1px 0 var(--rule);
  }
}

/* The strip at the foot of the wide start screen is fixed inside the text
   column, and the column's fade mask (above) would crop it at the column's
   right edge. The start screen's text is short and never scrolls there, so it
   needs no mask. On phones the whole page scrolls now, so no mask either. */
@media (min-width: 60rem) {
  .shell[data-screen='home'] .panel {
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

@media (max-width: 59.99rem) {
  .shell[data-screen='home'] .panel,
  .shell[data-screen='night'] .panel,
  .shell[data-screen='atlas'] .panel,
  .shell[data-screen='stats'] .panel,
  .shell[data-screen='rules'] .panel,
  .shell[data-screen='about'] .panel {
    -webkit-mask-image: none;
    mask-image: none;
  }
}
