/* Countrydown — the daylight atlas.
   A flat world on a pale sky, with one dock under it. The clock is the bar in
   that dock, where the day runs out: yellow for day, dark for night.
   Everything else stays quiet, in one typeface.
   There are two themes, and the site opens in the dark one. Every colour that
   differs between them is a variable: the light values come first, the dark
   ones follow in the next block. */

:root {
  color-scheme: light;

  /* text and surfaces */
  --ink: #131a33;
  --ink-2: #48526f;
  --ink-3: #7b85a1;
  --rule: #dfe5f0;
  --dash: #cfd7e5;
  --card: #ffffff;
  --well: #f1f5fa;
  --well-h: #e8eef7;
  --edge: rgba(19, 26, 51, .05);
  --ghost: rgba(255, 255, 255, .6);
  --ghost-h: #ffffff;
  --chip-plain: #e6ebf3;
  --pulse: rgba(19, 26, 51, .28);
  --accent: #2a2f73;
  --bar: #7f8aa8;

  /* the map */
  --sky-a: #e3eefb;
  --sky-b: #fbf4ea;
  --sea: #c6dcf3;
  --sea-line: #b1cdea;
  --plate-ring: #ffffff;
  --halo: rgba(19, 26, 51, .06);
  --stroke: #ffffff;

  --land-0: #fbe6a2;  --land-0h: #f4d263;
  --land-1: #bfe6cb;  --land-1h: #92d6a8;
  --land-2: #f8ccb4;  --land-2h: #f1aa86;
  --land-3: #d7d0f3;  --land-3h: #b9aeea;
  --land-4: #f6f0e2;  --land-4h: #e6dabd;

  /* day, night and the answers */
  --sun: #ffc233;
  --on-sun: #131a33;
  --bar-day: #ffe9ae;
  --bar-night: #2a2f73;
  --orb-night: #2a2f73;
  --good: #1fae78;  --good-ink: #0b6b4a;  --good-text: #0b6b4a;
  --miss: #f0624d;  --miss-ink: #9e2f22;  --miss-text: #9e2f22;
  --bad: #e5484d;
  --wrong: #3a4162;
  --unfound: #4a5272;        /* a country not found yet, on the passport's map */

  --font: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --out: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.3, 1.4, .5, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --ink: #eef1fb;
  --ink-2: #b6bedb;
  --ink-3: #8891b4;
  --rule: #30386a;
  --dash: #3b447b;
  --card: #191f40;
  --well: #242b55;
  --well-h: #2e3668;
  --edge: rgba(255, 255, 255, .08);
  --ghost: rgba(255, 255, 255, .09);
  --ghost-h: rgba(255, 255, 255, .17);
  --chip-plain: #353d70;
  --pulse: rgba(238, 241, 251, .35);
  --accent: #ffc233;
  --bar: #7d87bf;

  --sky-a: #0a0e24;
  --sky-b: #151a3c;
  --sea: #1a2a58;
  --sea-line: #25386f;
  --plate-ring: #2e3d7c;
  --halo: rgba(0, 0, 0, .28);
  --stroke: #121b40;

  --land-0: #b9a55b;  --land-0h: #d8c476;
  --land-1: #6ea98a;  --land-1h: #8ecaa8;
  --land-2: #c28a6b;  --land-2h: #dfa789;
  --land-3: #8f87c9;  --land-3h: #aea6e6;
  --land-4: #a9a18d;  --land-4h: #c8c0ab;

  --bar-day: #ffc233;
  --bar-night: #0a0e24;
  --orb-night: #5d66cf;
  --good: #2bc48a;  --good-ink: #0c5a3f;  --good-text: #58dca8;
  --miss: #f26a55;  --miss-ink: #8f2a1f;  --miss-text: #ff9686;
  --wrong: #090c1e;
  --unfound: #0b1029;
}

@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring: linear(0, .009, .035 2.1%, .141 4.4%, .723 12.9%, .938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, .991, .977 51%, .974 53.8%, .975 57.1%, .997 69.8%, 1.003 76.9%, 1.004 83.8%, 1);
  }
}

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

html, body { height: 100%; margin: 0; }

body {
  background: var(--sky-a);
  color: var(--ink);
  font: 400 17px/1.45 var(--font);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

h1, h2, h3, p, ol, ul, dl, dd { margin: 0; padding: 0; }
ol, ul { list-style: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

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

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

/* ---------- the map ---------- */
.stage {
  position: fixed; inset: 0; overflow: hidden;
  background: linear-gradient(180deg, var(--sky-a) 0%, var(--sky-b) 100%);
}

/* The globe is drawn on this canvas by js/map.js, colours, answers and dots
   included; it reads them from the variables above. The cursor turns to a
   pointer over a country while an answer is wanted (set there too). */
.map { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; }
.map { touch-action: none; user-select: none; cursor: grab; }
.map.is-dragging { cursor: grabbing; }
.overlay { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 2; }

/* ---------- top bar ---------- */
.bar {
  position: absolute; left: 0; right: 0; top: 0; z-index: 4;
  height: 64px; padding: 0 16px 0 22px;
  display: flex; align-items: center; justify-content: space-between;
  pointer-events: none;
}
.bar > * { pointer-events: auto; }

.brand {
  font: 800 25px/1 var(--font); letter-spacing: -.04em;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
/* the o of "down": a little world, part of it already in the dark */
.orb {
  display: inline-block; width: .56em; height: .56em; margin: 0 .04em 0 .035em;
  border-radius: 50%; vertical-align: -.015em;
  background: radial-gradient(circle at 84% 50%, var(--sun) 0 59%, var(--orb-night) 60.5%);
}

.tools { display: flex; gap: 6px; }
.ghost {
  appearance: none; display: inline-flex; align-items: center; justify-content: center;
  height: 38px; padding: 0 14px; border: 0; border-radius: 999px;
  font: 600 15px/1 var(--font); color: var(--ink);
  background: var(--ghost); cursor: pointer;
  transition: background-color .15s linear;
}
.ghost:hover { background: var(--ghost-h); }
.ghost svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ghost__icon { display: none; }                       /* stands in for the words on a narrow screen */
.ghost.ghost--icon { width: 38px; padding: 0; }

/* the sound switch: a speaker, crossed out when sound is off */
.ghost--sound .snd-off { display: none; }
.ghost--sound[aria-pressed="false"] { color: var(--ink-3); }
.ghost--sound[aria-pressed="false"] .snd-on { display: none; }
.ghost--sound[aria-pressed="false"] .snd-off { display: inline; }

/* the theme switch shows where it leads: a moon by day, a sun by night */
.ghost--theme .th-sun { display: none; }
:root[data-theme="dark"] .ghost--theme .th-sun { display: inline; }
:root[data-theme="dark"] .ghost--theme .th-moon { display: none; }

/* ---------- buttons ---------- */
.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center;
  height: 54px; padding: 0 22px; border: 0; border-radius: 17px;
  font: 700 17px/1 var(--font); letter-spacing: -.01em; white-space: nowrap;
  color: var(--ink); background: var(--well);
  box-shadow: inset 0 0 0 1.5px var(--rule);
  cursor: pointer; user-select: none; touch-action: manipulation;
  transition: transform .45s var(--spring), background-color .15s linear, box-shadow .2s linear;
}
.btn:hover { transform: translateY(-2px); background: var(--well-h); }
.btn:active { transform: scale(.97); transition-duration: .08s; }
.btn--sun { color: var(--on-sun); background: var(--sun); box-shadow: 0 12px 22px -12px rgba(224, 150, 0, .9); }
.btn--sun:hover { background: #ffcc52; box-shadow: 0 16px 26px -12px rgba(224, 150, 0, .9); }

.link {
  appearance: none; padding: 0; border: 0; background: none;
  font: 600 15px/1.3 var(--font); color: var(--ink); cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px;
}
.link:hover { color: var(--accent); }

/* ---------- the dock ---------- */
.dock {
  position: absolute; left: 50%; bottom: 16px; z-index: 3;
  width: min(1060px, calc(100% - 32px));
  padding: 16px 20px 20px;
  background: var(--card); border-radius: 30px;
  box-shadow: 0 34px 60px -34px rgba(19, 26, 51, .45), 0 12px 26px -16px rgba(19, 26, 51, .2), 0 0 0 1px var(--edge);
  transform: translateX(-50%);
}

.view, .hud { display: none; }
.stage[data-view="home"] .view--home,
.stage[data-view="end"] .view--end { display: grid; }
.stage[data-view="round"] .view--round,
.stage[data-view="final"] .view--final { display: block; }
.stage[data-view="round"] .hud,
.stage[data-view="end"] .hud,
.stage[data-view="round"] .hud__points.view--round,
.stage[data-view="end"] .hud__points.view--end { display: flex; }
.stage[data-view="home"] .zoom { display: none; }

.stage[data-view="home"] .view--home,
.stage[data-view="end"] .view--end,
.stage[data-view="final"] .view--final { animation: view-in .5s var(--out) both; }

@keyframes view-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* home: two tabs, each with the same two columns under them */
.view--home { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 2px 4px 2px; }
.pane {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(250px, .65fr); gap: 14px 44px; align-items: end;
}

/* the tabs: a small switch, the open one in ink */
.tabs { justify-self: start; display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--well); }
.tab {
  appearance: none; height: 34px; padding: 0 16px; border: 0; border-radius: 999px;
  font: 600 15px/1 var(--font); color: var(--ink-2); background: transparent; cursor: pointer; white-space: nowrap;
  transition: background-color .15s linear, color .15s linear;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--card); background: var(--ink); }

/* the categories: one card each, with the colour of its clues */
.topics { display: grid; gap: 8px; }
.topic {
  --chip: var(--chip-plain); --chip-ink: var(--ink-2);
  appearance: none; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px;
  width: 100%; padding: 9px 14px 9px 9px; border: 0; border-radius: 17px; text-align: left;
  color: var(--ink); background: var(--well); box-shadow: inset 0 0 0 1.5px var(--rule);
  cursor: pointer; user-select: none; touch-action: manipulation;
  transition: transform .45s var(--spring), background-color .15s linear;
}
.topic:hover { transform: translateY(-2px); background: var(--well-h); }
.topic:active { transform: scale(.98); transition-duration: .08s; }
.topic[data-cat="dish"] { --chip: #ffe7c7; --chip-ink: #94470a; }
.topic[data-cat="landmark"] { --chip: #d8f1de; --chip-ink: #1b6537; }
.topic[data-cat="person"] { --chip: #ffe0ea; --chip-ink: #a11c55; }
.topic[data-cat="film"] { --chip: #dde6ef; --chip-ink: #2c4a66; }
.topic[data-cat="music"] { --chip: #f3dcf5; --chip-ink: #7d2386; }
.topic[data-cat="nature"] { --chip: #cfeeea; --chip-ink: #0c5f58; }
.topic[data-cat="history"] { --chip: #efe3cf; --chip-ink: #6e4b12; }
.topic[data-cat="invention"] { --chip: #fff2b8; --chip-ink: #7a5a00; }
.topic[data-cat="sport"] { --chip: #ffd9d2; --chip-ink: #9c2a14; }
.topic[data-cat="city"] { --chip: #dbe9ff; --chip-ink: #1d4c9f; }
.topic[data-cat="language"] { --chip: #d9eef9; --chip-ink: #0f5a7a; }
.topic[data-cat="photo"] { --chip: #ffe0d4; --chip-ink: #9a3412; }

/* the categories tab: the headline and its note side by side, the seven categories in a grid under them */
.pane--cats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; }
.pane--cats .headline { font-size: clamp(30px, 3.4vw, 44px); }
.pane--cats .lede { margin-top: 0; }
.pane--cats .topics { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 8px; padding-top: 6px; }
.topic { position: relative; }
.plusline { margin-top: 8px; font: 500 15px/1.4 var(--font); color: var(--ink-2); }
.plusline .link { font-size: 15px; }

/* on a category: its free round, or a lock for Plus */
.topic__tag {
  position: absolute; right: 10px; top: -10px;   /* on the card's top edge, clear of its name */
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 999px;
  font: 700 11px/1 var(--font); letter-spacing: .01em; white-space: nowrap;
  color: var(--chip-ink); background: var(--chip);
}
.topic__tag[hidden] { display: none; }
.topic__tag[data-state="locked"] { color: var(--ink-2); background: var(--card); box-shadow: inset 0 0 0 1.5px var(--rule); }
.topic__tag[data-state="locked"]::before {
  content: ""; width: 9px; height: 10px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 10'%3E%3Cpath d='M2 4V3a2.5 2.5 0 0 1 5 0v1h.5A1 1 0 0 1 8.5 5v4a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1zm1.3 0h2.4V3a1.2 1.2 0 0 0-2.4 0z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 10'%3E%3Cpath d='M2 4V3a2.5 2.5 0 0 1 5 0v1h.5A1 1 0 0 1 8.5 5v4a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1zm1.3 0h2.4V3a1.2 1.2 0 0 0-2.4 0z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* the Plus window */
.plus__why { margin: 6px 0 0; font: 600 16px/1.4 var(--font); color: var(--ink); }
.plus__list { margin-top: 14px; }
.plus__price { display: flex; align-items: baseline; gap: 8px; margin: 18px 0 4px; color: var(--ink-2); font: 500 15px/1.2 var(--font); }
.plus__price b { font: 800 34px/1 var(--font); letter-spacing: -.03em; color: var(--ink); }
.plus__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.plus__actions .btn { flex: 1 1 200px; }
.plus__actions form { display: contents; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.plus__legal { margin-top: 14px; font: 500 14px/1.4 var(--font); color: var(--ink-3); }
/* "Already have Plus? Restore it", and what restoring found */
.plus__restore { display: grid; gap: 8px; margin-top: 16px; font: 500 15px/1.4 var(--font); color: var(--ink-2); }
.plus__restore[hidden], .plus__restore [hidden] { display: none; }
.plus__restore .link:disabled { opacity: .55; cursor: wait; }
.plus__restored { color: var(--ink); }
/* above the sign-in form, when it was opened to restore Plus */
.form__restore { margin-bottom: 12px; padding: 10px 14px; border-radius: 12px; box-shadow: inset 0 0 0 1.5px var(--sun); font: 600 15px/1.4 var(--font); color: var(--ink); }

/* the pricing, terms, privacy and refund pages, at the foot of a window */
.legal { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; font: 500 14px/1.4 var(--font); }
.legal a { color: var(--ink-2); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.legal a:hover { color: var(--ink); }
.topic__badge {
  width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: var(--chip);
  fill: none; stroke: var(--chip-ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.topic__words { display: grid; gap: 2px; }
.topic__words b { font: 700 17px/1.15 var(--font); letter-spacing: -.01em; }
.topic__words span { font: 500 14px/1.25 var(--font); color: var(--ink-2); }

/* the language button: a globe and the language's two letters, and the menu under it */
.langpick { position: relative; display: flex; }
.ghost--lang { gap: 6px; padding: 0 12px 0 10px; }
.ghost__code { font: 700 13px/1 var(--font); letter-spacing: .02em; }
.langmenu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 6; min-width: 168px;
  display: grid; gap: 2px; padding: 6px; border-radius: 18px;
  background: var(--card); box-shadow: 0 22px 44px -18px rgba(10, 14, 36, .55), 0 0 0 1px var(--edge);
}
.langmenu__item {
  appearance: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; height: 40px; padding: 0 12px; border: 0; border-radius: 12px; text-align: left;
  font: 600 15px/1 var(--font); color: var(--ink); background: transparent; cursor: pointer;
}
.langmenu__item:hover, .langmenu__item:focus-visible { background: var(--well); }
.langmenu__item:focus-visible { outline-offset: -3px; }
.langmenu__item[aria-checked="true"]::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sun);
  box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px var(--sun);
}
.headline {
  font: 800 clamp(34px, 4.7vw, 58px)/.98 var(--font); letter-spacing: -.045em;
  text-wrap: balance;
}
.lede { max-width: 50ch; margin-top: 14px; color: var(--ink-2); text-wrap: pretty; }
.start { display: grid; gap: 10px; }
.start__day { margin-bottom: 4px; font: 500 15px/1.4 var(--font); color: var(--ink-2); }
.start__day b { display: block; font-weight: 700; color: var(--ink); }
.start__more { justify-self: start; margin: 2px 4px 0; }   /* the way into the archive: quieter than the two buttons */

/* round: where you are, the points, the day running out, the clues */
.hud { align-items: center; justify-content: space-between; gap: 16px; min-height: 46px; padding: 0 4px; }
.hud__where { display: flex; align-items: center; gap: 12px; font: 600 15px/1 var(--font); color: var(--ink-2); white-space: nowrap; }
.hud__points { position: relative; align-items: baseline; gap: 8px; }
.hud__unit { font: 500 15px/1 var(--font); color: var(--ink-3); white-space: nowrap; }

.pips { display: flex; gap: 7px; }
.sw { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--rule); }
.sw--now { background: var(--ink); animation: now 1.6s ease-in-out infinite; }
.sw--0 { background: var(--good); }
.sw--1 { background: var(--sun); }
.sw--2 { background: #f5913a; }
.sw--3 { background: transparent; box-shadow: inset 0 0 0 2.5px var(--bad); }

@keyframes now {
  0%, 100% { box-shadow: 0 0 0 0 var(--pulse); }
  50% { box-shadow: 0 0 0 6px transparent; }
}

.score { display: inline-flex; font: 800 44px/1 var(--font); letter-spacing: -.02em; }
.score i { display: inline-block; width: .58em; font-style: normal; text-align: center; }
.score i.sep { width: .26em; }
.score.is-low { color: var(--bad); }

.minus {
  position: absolute; right: 100%; top: 50%; margin: -15px 12px 0 0; padding: 7px 11px;
  border-radius: 999px; font: 700 15px/1 var(--font); white-space: nowrap;
  color: #fff; background: var(--bad); opacity: 0;
}
.minus.is-on { animation: minus 1.2s var(--out) forwards; }

@keyframes minus {
  0% { opacity: 0; transform: translateX(14px) scale(.8); }
  14% { opacity: 1; transform: none; }
  70% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-10px); }
}

.daybar { --t: 0; position: relative; height: 12px; margin: 10px 0 14px; border-radius: 6px; background: var(--bar-day); }
.daybar__night { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--t) * 100%); border-radius: 6px; background: var(--bar-night); }
.daybar__notch { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--card); }
.daybar__notch--2 { left: 33.333%; }
.daybar__notch--3 { left: 66.667%; }
.daybar__sun {
  position: absolute; left: calc(var(--t) * 100%); top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border-radius: 50%; background: var(--sun);
  box-shadow: 0 0 0 3px var(--card), 0 3px 8px rgba(19, 26, 51, .3);
}

.clues { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.clue {
  --chip: var(--chip-plain); --chip-ink: var(--ink-2);
  min-height: 108px; padding: 12px 14px 14px;
  border: 1.5px solid transparent; border-radius: 18px;
  background: var(--well);
}
.clue[data-cat="person"] { --chip: #ffe0ea; --chip-ink: #a11c55; }
.clue[data-cat="city"] { --chip: #dbe9ff; --chip-ink: #1d4c9f; }
.clue[data-cat="dish"], .clue[data-cat="drink"], .clue[data-cat="dessert"] { --chip: #ffe7c7; --chip-ink: #94470a; }
.clue[data-cat="landmark"] { --chip: #d8f1de; --chip-ink: #1b6537; }
.clue[data-cat="film"] { --chip: #dde6ef; --chip-ink: #2c4a66; }
.clue[data-cat="wildlife"] { --chip: #e4f0c2; --chip-ink: #4a6610; }
.clue[data-cat="nature"] { --chip: #cfeeea; --chip-ink: #0c5f58; }
.clue[data-cat="geography"] { --chip: #e3e1f7; --chip-ink: #46388f; }
.clue[data-cat="history"] { --chip: #efe3cf; --chip-ink: #6e4b12; }
.clue[data-cat="culture"], .clue[data-cat="music"], .clue[data-cat="festival"] { --chip: #f3dcf5; --chip-ink: #7d2386; }
.clue[data-cat="sport"], .clue[data-cat="stadium"] { --chip: #ffd9d2; --chip-ink: #9c2a14; }
.clue[data-cat="language"] { --chip: #d9eef9; --chip-ink: #0f5a7a; }
.clue[data-cat="invention"], .clue[data-cat="flag"] { --chip: #fff2b8; --chip-ink: #7a5a00; }

.clue__head { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.clue__n {
  flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  font: 700 13px/1 var(--font); color: var(--card); background: var(--ink);
}
.clue__cat { padding: 6px 10px; border-radius: 999px; font: 600 13px/1 var(--font); font-style: normal; color: var(--chip-ink); background: var(--chip); }
.clue__eta { margin-left: auto; font: 500 14px/1 var(--font); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.clue__text { margin-top: 9px; font: 500 17px/1.34 var(--font); text-wrap: pretty; }

.clue[data-state="locked"] { border: 1.5px dashed var(--dash); background: transparent; }
.clue[data-state="locked"] .clue__n { color: var(--ink-3); background: transparent; box-shadow: inset 0 0 0 1.5px var(--dash); }
.clue[data-state="locked"] .clue__cat { padding-left: 0; padding-right: 0; color: var(--ink-3); background: transparent; }
.clue[data-state="locked"] .clue__text { visibility: hidden; }

/* the handle on the top edge of the dock during a round: lowers the clue cards, and brings them back */
.tuck {
  position: absolute; left: 50%; top: -15px; z-index: 1; display: none; place-items: center;
  width: 58px; height: 28px; padding: 0; border: 0; border-radius: 999px;
  color: var(--ink-2); background: var(--card); cursor: pointer;
  box-shadow: 0 6px 14px -6px rgba(10, 14, 36, .5), 0 0 0 1px var(--edge);
  transform: translateX(-50%); transition: background-color .15s linear, color .15s linear;
}
.tuck:hover { color: var(--ink); background: var(--well-h); }
.tuck svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s var(--out); }
.stage[data-view="round"] .tuck { display: grid; }
.stage.is-tucked .tuck svg { transform: rotate(180deg); }
/* a clue opened while the cards are down */
.tuck.is-news { color: var(--on-sun); background: var(--sun); animation: tuck-news 1.2s ease-in-out infinite; }
@keyframes tuck-news { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 194, 51, .55); } 50% { box-shadow: 0 0 0 8px rgba(255, 194, 51, 0); } }
.stage.is-tucked .view--round .clues { display: none; }
.stage.is-tucked .view--round .daybar { margin-bottom: 0; }
.clues.is-back { animation: text-in .35s var(--out) both; }

/* a photo clue: the picture takes the place of the words, at the same size of card */
.clue__photo { display: none; margin: 9px 0 0; }
.clue[data-photo] .clue__text { display: none; }
.clue[data-photo] .clue__photo { display: block; }
.clue__zoom {
  display: block; width: 100%; padding: 0; border: 0; border-radius: 12px; overflow: hidden;
  background: var(--chip-plain); cursor: zoom-in;
}
.clue__zoom img { display: block; width: 100%; height: 228px; object-fit: cover; }
/* one line on what the picture shows, two at most */
.clue__caption {
  margin-top: 7px; font: 500 14px/1.3 var(--font); color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.clue[data-state="locked"] .clue__photo { visibility: hidden; }
.clue[data-state="open"] .clue__photo { animation: text-in .45s var(--out) .05s both; }

/* the photo, larger, over everything; a press anywhere closes it */
.photoview {
  position: fixed; inset: 0; z-index: 20; display: grid; place-content: center; justify-items: center; gap: 10px;
  padding: 16px; background: rgba(8, 11, 28, .84);
}
.photoview__close { padding: 0; border: 0; background: none; cursor: zoom-out; }
.photoview__close img {
  display: block; max-width: min(960px, calc(100vw - 32px)); max-height: calc(100vh - 150px); border-radius: 16px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6);
}
.photoview__caption { max-width: 40ch; font: 600 18px/1.35 var(--font); color: #fff; text-align: center; text-wrap: balance; }
/* shown by itself as the clue opens: a thin bar runs down the few seconds it stays */
.photoview { animation: photo-in .3s var(--out) both; }
.photoview__timer { display: none; width: min(320px, 70vw); height: 3px; border-radius: 3px; background: var(--sun); transform-origin: left center; }
.photoview.is-auto .photoview__timer { display: block; animation: photo-timer 3.2s linear both; }
@keyframes photo-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes photo-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }

.clue[data-state="open"] { animation: clue-in .9s var(--out) 1; }
.clue[data-state="open"] .clue__n { animation: pop .5s var(--spring) 1; }
.clue[data-state="open"] .clue__text { animation: text-in .45s var(--out) .05s both; }

@keyframes clue-in {
  0% { background: var(--sun); }
  100% { background: var(--well); }
}
@keyframes text-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@keyframes pop {
  from { transform: scale(.4); }
  to { transform: none; }
}

/* after an answer */
.view--end { grid-template-columns: minmax(0, .85fr) minmax(0, 1.5fr) auto; gap: 10px 28px; align-items: end; padding: 6px 4px 0; }
.verdict__line { font: 500 15px/1.3 var(--font); color: var(--ink-2); }
.verdict__name { margin-top: 4px; font: 800 clamp(32px, 4vw, 48px)/1 var(--font); font-stretch: 90%; letter-spacing: -.04em; text-wrap: balance; }
.recap { display: grid; gap: 5px; font: 400 15px/1.35 var(--font); color: var(--ink-2); }
.recap li { display: grid; grid-template-columns: 5.4em minmax(0, 1fr); gap: 10px; }
.recap em { font-style: normal; font-weight: 600; color: var(--ink); }

/* the result */
.final__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; min-height: 46px; padding: 0 4px; }
.final__head .hud__points { display: flex; }
.final__title { padding-bottom: 6px; font: 700 22px/1.1 var(--font); letter-spacing: -.02em; }
.rows { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 12px 0 16px; }
.rows li { display: grid; align-content: start; gap: 3px; padding: 12px 14px 14px; border-radius: 18px; background: var(--well); }
.rows small { display: flex; align-items: center; gap: 7px; font: 600 13px/1.2 var(--font); color: var(--ink-2); }
.rows span { font: 700 18px/1.15 var(--font); font-stretch: 88%; letter-spacing: -.015em; overflow-wrap: break-word; hyphens: auto; }
.rows b { margin-top: 6px; font: 800 28px/1 var(--font); letter-spacing: -.03em; }
/* how this score stands among the player's own daily rounds: a sentence and a
   small chart. The columns are the context, so they stay grey; the one thing
   in the accent colour is the line that marks this round. */
.stand {
  display: grid; grid-template-columns: minmax(170px, .3fr) minmax(0, 1fr); gap: 10px 32px; align-items: end;
  margin: 12px 0 0; padding: 14px 18px 12px; border-radius: 18px; background: var(--well);
}
.stand__say { display: grid; gap: 3px; font: 500 15px/1.3 var(--font); color: var(--ink-2); }
.stand__say b { font: 800 34px/1 var(--font); letter-spacing: -.03em; color: var(--ink); }
.stand__say b:empty { display: none; }

.dist { --plot: 58px; position: relative; padding-top: 24px; }
.dist__bars {
  display: grid; grid-template-columns: repeat(var(--n, 25), minmax(0, 1fr)); gap: 2px;
  height: var(--plot); border-bottom: 1px solid var(--dash);
}
.dist__bars li { position: relative; display: flex; align-items: flex-end; justify-content: center; outline-offset: 1px; }
.dist__bars i { display: block; width: 100%; max-width: 24px; height: calc(var(--h) * 100%); min-height: 4px; border-radius: 4px 4px 0 0; background: var(--bar); }
.dist__bars li:hover i, .dist__bars li:focus-visible i { background: var(--ink); }
.dist__bars li:hover::after, .dist__bars li:focus-visible::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 6px); z-index: 2;
  padding: 6px 9px; border-radius: 9px; font: 600 12px/1.2 var(--font); white-space: nowrap;
  color: var(--card); background: var(--ink); pointer-events: none; transform: translateX(-50%);
}
.dist__bars li.is-left:hover::after, .dist__bars li.is-left:focus-visible::after { left: 0; transform: none; }
.dist__bars li.is-right:hover::after, .dist__bars li.is-right:focus-visible::after { left: auto; right: 0; transform: none; }

.dist__you {
  position: absolute; left: calc(var(--x, 0) * 100%); top: 24px; width: 2px; height: var(--plot); margin-left: -1px;
  background: var(--accent); pointer-events: none;
}
.dist__you::before {
  content: ""; position: absolute; left: 50%; top: -5px; width: 10px; height: 10px; margin-left: -5px;
  border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--well);
}
.dist__you span {
  position: absolute; left: 50%; bottom: calc(100% + 9px);
  font: 700 12px/1 var(--font); font-style: normal; white-space: nowrap; color: var(--ink);
  transform: translateX(-50%);
}
.dist__you.is-left span { left: -5px; transform: none; }
.dist__you.is-right span { left: auto; right: -5px; transform: none; }

.dist__axis { display: flex; justify-content: space-between; margin-top: 6px; font: 500 12px/1 var(--font); color: var(--ink-3); font-variant-numeric: tabular-nums; }

.final__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 0 4px; }
.after { display: flex; flex-wrap: wrap; gap: 6px 20px; font: 500 15px/1.3 var(--font); color: var(--ink-2); }
.final__actions { display: flex; gap: 10px; }
.copybox {
  display: block; width: 100%; margin-top: 14px; padding: 10px 12px;
  border: 0; border-radius: 14px; resize: none;
  font: 500 15px/1.4 var(--font); color: var(--ink); background: var(--well);
}

/* ---------- on the map ---------- */
.zoom {
  position: absolute; left: 16px; bottom: calc(var(--dock-h, 230px) + 14px); z-index: 3;
  display: flex; overflow: hidden; border-radius: 14px; background: var(--card);
  box-shadow: 0 10px 22px -12px rgba(19, 26, 51, .35), 0 0 0 1px var(--edge);
}
.zoom button { appearance: none; display: grid; place-items: center; width: 42px; height: 40px; border: 0; background: none; color: var(--ink); cursor: pointer; }
.zoom button + button { box-shadow: inset 1px 0 0 var(--rule); }
.zoom button:hover { background: var(--well); }
.zoom svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.status {
  position: absolute; left: 50%; bottom: calc(var(--dock-h, 230px) + 16px); z-index: 3;
  padding: 10px 16px; border-radius: 999px;
  font: 600 15px/1 var(--font); white-space: nowrap; color: var(--card); background: var(--ink);
  box-shadow: 0 10px 22px -10px rgba(19, 26, 51, .5);
  pointer-events: none; transform: translateX(-50%);
}

.toast {
  position: absolute; z-index: 5; padding: 8px 12px; border-radius: 999px;
  font: 700 14px/1 var(--font); white-space: nowrap; color: #fff; background: var(--bad);
  box-shadow: 0 8px 18px -8px rgba(229, 72, 77, .8);
  transform: translate(-50%, -150%);
  animation: toast 1.3s var(--out) forwards;
}
@keyframes toast {
  0% { opacity: 0; translate: 0 10px; scale: .8; }
  14% { opacity: 1; translate: 0 0; scale: 1; }
  72% { opacity: 1; translate: 0 -4px; }
  100% { opacity: 0; translate: 0 -16px; }
}

.ripple {
  position: absolute; z-index: 4; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  box-shadow: 0 0 0 2.5px var(--bad);
  animation: ripple .7s var(--out) forwards;
}
.ripple--good { box-shadow: 0 0 0 2.5px var(--good); }
@keyframes ripple {
  from { opacity: .9; scale: .4; }
  to { opacity: 0; scale: 5; }
}

/* the name of the country under the mouse */
.hovername {
  position: fixed; left: 0; top: 0; z-index: 6;
  padding: 7px 12px 8px; border-radius: 12px;
  font: 700 15px/1 var(--font); letter-spacing: -.01em; white-space: nowrap;
  color: var(--ink); background: var(--card);
  box-shadow: 0 10px 22px -10px rgba(19, 26, 51, .45), 0 0 0 1px var(--edge);
  pointer-events: none; will-change: transform;
}

.tag {
  position: absolute; z-index: 4; padding: 9px 14px 10px; border-radius: 16px;
  text-align: center; white-space: nowrap; background: var(--card);
  box-shadow: 0 14px 26px -14px rgba(19, 26, 51, .5), 0 0 0 1px var(--edge);
  transform: translate(-50%, calc(-100% - 22px));
  animation: tag .5s var(--spring) both;
}
.tag--below { transform: translate(-50%, 22px); }
.tag b { display: block; font: 800 19px/1.1 var(--font); letter-spacing: -.02em; }
.tag span { font: 700 14px/1.2 var(--font); color: var(--good-text); }
.tag--missed span { color: var(--miss-text); }
@keyframes tag {
  from { opacity: 0; scale: .7; }
  to { opacity: 1; scale: 1; }
}

/* ---------- dialogs ---------- */
dialog {
  width: min(600px, calc(100vw - 20px)); max-width: none; max-height: none;
  padding: 0; border: 0; border-radius: 30px;
  color: var(--ink); background: transparent; overflow: visible;
}
dialog::backdrop { background: rgba(19, 26, 51, .42); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
:root[data-theme="dark"] dialog::backdrop { background: rgba(3, 5, 16, .62); }
dialog[open] .sheet { animation: sheet .5s var(--spring) both; }
@keyframes sheet {
  from { opacity: 0; transform: translateY(22px) scale(.97); }
  to { opacity: 1; transform: none; }
}

.sheet {
  max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); padding: 28px 28px 26px;
  border-radius: 30px; background: var(--card); overflow: auto;
  box-shadow: 0 40px 80px -30px rgba(19, 26, 51, .6);
}
.sheet h2 { margin-bottom: 18px; font: 800 36px/1 var(--font); letter-spacing: -.04em; }
.sheet__sub { margin-bottom: 12px; font: 700 18px/1.2 var(--font); letter-spacing: -.01em; }
.sheet__note { margin-bottom: 20px; font-size: 15px; color: var(--ink-2); }

.rules { display: grid; gap: 12px; margin-bottom: 24px; }
.rules li { position: relative; padding-left: 26px; }
.rules li::before {
  content: ""; position: absolute; left: 2px; top: .42em; width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 84% 50%, var(--sun) 0 59%, var(--orb-night) 60.5%);
}

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 24px; }
.stats div { padding: 14px 14px 12px; border-radius: 18px; background: var(--well); }
.stats dd { font: 800 34px/1 var(--font); letter-spacing: -.03em; }
.stats dt { margin-top: 6px; font: 500 14px/1.25 var(--font); color: var(--ink-2); }

/* the passport's map: the countries found in colour (drawn by js/map.js) */
.foundmap { display: block; width: 100%; aspect-ratio: 1.95; margin: 2px 0 14px; }
.stamps { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-bottom: 12px; }
.stamp { min-height: 40px; padding: 10px 8px; border-radius: 12px; font: 700 15px/1.2 var(--font); text-align: center; color: var(--on-sun); background: var(--bar-day); }
.stamp--empty { border: 1.5px dashed var(--dash); background: transparent; }

/* ---------- members: the form, the scoreboard, the earlier days ---------- */
/* a window's title is focused as it opens, only so the keyboard starts there; and a
   window too tall for the screen scrolls, which makes the sheet itself focusable */
.sheet h2:focus, .sheet:focus { outline: none; }

.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; margin-bottom: 22px; }
.form > p, .form__row { grid-column: 1 / -1; }
.form__lede { margin-bottom: 2px; color: var(--ink-2); }
.field { display: grid; gap: 7px; font: 600 14px/1.2 var(--font); color: var(--ink-2); }
.field input {
  appearance: none; width: 100%; height: 52px; padding: 0 16px; border: 0; border-radius: 15px;
  font: 600 17px/1 var(--font); color: var(--ink); background: var(--well);
  box-shadow: inset 0 0 0 1.5px var(--rule);
}
.field input:focus-visible { outline: 3px solid var(--accent); outline-offset: 0; }
/* a browser that fills the fields in paints them its own colour; this keeps ours */
.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink); caret-color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--rule), inset 0 0 0 60px var(--well);
}
.form--one { grid-template-columns: minmax(0, 1fr); }
.form--one .field { max-width: 340px; }
/* Google's own button sits in the slot. It is drawn by Google, in Google's
   colours, in a frame that only stays see-through on a light colour scheme. */
.google { grid-column: 1 / -1; display: grid; gap: 14px; }
.google__slot { min-height: 44px; color-scheme: light; }
.form__hint { font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.form__error { font: 600 15px/1.4 var(--font); color: var(--miss-text); }
.form__row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 2px; }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.form--leave { grid-template-columns: minmax(0, 1fr); margin-top: -4px; padding-top: 18px; border-top: 1px solid var(--rule); }
.form--leave .field { max-width: 340px; }

/* which daily round, with the two arrows that step through the days */
.board__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.board__when { display: grid; gap: 3px; min-width: 0; font: 500 15px/1.3 var(--font); color: var(--ink-2); }
.board__when b { font: 700 22px/1.1 var(--font); letter-spacing: -.02em; color: var(--ink); }
.stepper { flex: none; display: flex; overflow: hidden; border-radius: 14px; background: var(--well); box-shadow: inset 0 0 0 1.5px var(--rule); }
.stepper button { appearance: none; display: grid; place-items: center; width: 44px; height: 42px; border: 0; background: none; color: var(--ink); cursor: pointer; outline-offset: -3px; }
.stepper button + button { box-shadow: inset 1.5px 0 0 var(--rule); }
.stepper button:hover { background: var(--well-h); }
.stepper button:disabled { color: var(--ink-3); background: none; opacity: .5; cursor: default; }
.stepper svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* the member's own place, said large, like the figures in the Passport */
.board__say {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 10px; padding: 14px 18px 15px;
  border-radius: 18px; font: 500 15px/1.3 var(--font); color: var(--ink-2); background: var(--well);
}
.board__say b { font: 800 34px/1 var(--font); letter-spacing: -.03em; color: var(--ink); }
.board__say b:empty { display: none; }

.ranks { display: grid; gap: 2px; margin-bottom: 18px; transition: opacity .15s linear; }
.ranks.is-loading { opacity: .4; }
.ranks li {
  display: grid; grid-template-columns: 2.2em minmax(0, 1fr) auto; align-items: center; gap: 12px;
  min-height: 38px; padding: 0 18px; border-radius: 13px; font: 600 16px/1.2 var(--font);
}
.ranks__n { font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ranks__who { display: flex; align-items: center; gap: 9px; min-width: 0; overflow: hidden; white-space: nowrap; }
.ranks__who em { flex: none; padding: 3px 8px 4px; border-radius: 999px; font: 700 12px/1 var(--font); color: var(--on-sun); background: var(--sun); }
.ranks__pts { font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.ranks li.is-you { background: var(--well); }
.ranks li.is-you .ranks__n { color: var(--ink); }
.ranks li.ranks__gap { display: block; min-height: 0; height: 20px; padding: 0; font: 700 15px/20px var(--font); text-align: center; color: var(--ink-3); }
.ranks li.ranks__gap::before { content: "\22EE"; }

.board__me { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; margin-bottom: 22px; font: 500 15px/1.3 var(--font); color: var(--ink-2); }
.board__me b { font-weight: 700; color: var(--ink); }
.board__me .link--quiet { font-weight: 500; color: var(--ink-2); text-decoration-thickness: 1px; }   /* deleting is there, but not on a par with signing out */
.board__me .link--quiet:hover { color: var(--ink); }

/* a member's earlier daily rounds: the date, the five countries, the points, the place */
.days { display: grid; gap: 4px; margin-bottom: 10px; }
.day {
  appearance: none; display: grid; grid-template-columns: minmax(0, 1fr) auto 4.2em 3em; align-items: center; gap: 14px;
  width: 100%; min-height: 44px; padding: 0 16px; border: 0; border-radius: 13px;
  font: 600 16px/1.2 var(--font); text-align: left; color: var(--ink); background: var(--well); cursor: pointer;
  transition: background-color .15s linear;
}
.day:hover { background: var(--well-h); }
/* in the archive a day has no place, only its score, or the word Play if it is still open */
.day.day--archive { grid-template-columns: minmax(0, 1fr) auto 4.4em; }
.day.day--archive em { color: var(--accent); }
.day__pips { display: flex; gap: 5px; }
.day__pips .sw { width: 10px; height: 10px; }
.day b { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.day em { font-style: normal; font-weight: 700; text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.noscript { position: fixed; left: 0; right: 0; bottom: 0; padding: 14px; text-align: center; color: var(--card); background: var(--ink); }

/* ---------- narrower screens ---------- */
@media (max-width: 900px) {
  .pane { grid-template-columns: minmax(0, 1.15fr) minmax(220px, .85fr); gap: 14px 28px; }
  .pane--cats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pane--cats .topics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .view--end { grid-template-columns: minmax(0, 1fr) auto; }
  .recap { grid-column: 1 / -1; grid-row: 2; }
  .rows b { font-size: 24px; }
}

@media (max-width: 720px) {
  .bar { height: 56px; padding: 0 8px 0 16px; }
  .brand { font-size: 22px; }
  .ghost { height: 36px; padding: 0 12px; font-size: 14px; }
  .ghost.ghost--icon { width: 36px; }
  .tools { gap: 4px; }
}

/* six controls do not fit beside the name on a phone: the three with words become icons, and the language button a globe */
@media (max-width: 640px) {
  .ghost { width: 36px; padding: 0; }
  .ghost__text, .ghost__code { display: none; }
  .ghost__icon { display: block; }
}

@media (max-width: 720px) {

  .dock { bottom: 8px; width: calc(100% - 16px); padding: 12px 12px 14px; border-radius: 26px; }

  .view--home { gap: 12px; padding: 2px 6px 2px; }
  .pane { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .topic { padding: 7px 12px 7px 7px; }
  .topic__badge { width: 36px; height: 36px; padding: 8px; border-radius: 11px; }
  /* seven categories on a phone: two to a row, names only */
  .pane--cats { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .pane--cats .headline { font-size: 28px; }
  .pane--cats .topics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 6px; padding-top: 6px; }
  .pane--cats .topic { gap: 8px; padding: 5px 8px 5px 5px; border-radius: 14px; }
  .pane--cats .topic__badge { width: 32px; height: 32px; padding: 7px; border-radius: 10px; }
  .pane--cats .topic__words b { font-size: 14.5px; line-height: 1.15; }
  .pane--cats .topic__words span { display: none; }
  .pane--cats .topic__tag { right: 6px; top: -11px; height: 17px; padding: 0 6px; font-size: 10px; }
  .plusline { margin-top: 4px; font-size: 14px; }
  .plusline .link { font-size: 14px; }
  .headline { font-size: 36px; }
  .lede { margin-top: 10px; font-size: 16px; line-height: 1.4; }
  .start { grid-template-columns: 1fr 1fr; }
  .start__day, .start__more { grid-column: 1 / -1; }
  .start__day { margin-bottom: 0; }
  .btn { height: 52px; padding: 0 12px; font-size: 16px; }

  .hud { min-height: 42px; }
  .score { font-size: 38px; }
  .minus { right: 0; top: 0; margin: -28px 0 0; }   /* above the points, clear of the round's dots */
  .daybar { margin: 8px 0 10px; }
  .clues { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .clue { min-height: 0; padding: 9px 12px 11px; border-radius: 16px; }
  .clue__text { margin-top: 6px; font-size: 16px; }
  /* photos on a phone: three small pictures side by side, so the map keeps its room; a tap shows one larger */
  .clues.has-photos { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .clues.has-photos .clue { padding: 6px 6px 7px; border-radius: 14px; }
  .clues.has-photos .clue__head { gap: 5px; min-height: 22px; }
  .clues.has-photos .clue__n { width: 20px; height: 20px; font-size: 11px; }
  .clues.has-photos .clue__cat { padding: 4px 6px; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .clues.has-photos .clue__eta { font-size: 11px; white-space: nowrap; }
  .clues.has-photos .clue[data-state="locked"] .clue__cat { display: none; }   /* the countdown needs the room until it opens */
  .clues.has-photos .clue__photo { margin-top: 5px; }
  .clues.has-photos .clue__zoom { border-radius: 9px; }
  .clues.has-photos .clue__zoom img { height: 140px; }
  .clues.has-photos .clue__caption { display: none; }   /* too narrow here: the line shows with the larger photo */

  .view--end { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .recap { grid-row: auto; }
  .view--end .btn { width: 100%; }

  .final__title { font-size: 19px; }
  .stand { grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 10px; padding: 12px 14px 10px; border-radius: 14px; }
  .stand__say { display: block; }
  .stand__say b { display: inline; margin: 0 5px; font-size: 22px; letter-spacing: -.02em; }
  .dist { --plot: 44px; }
  .rows { grid-template-columns: minmax(0, 1fr); gap: 6px; margin: 10px 0 12px; }
  .rows li {
    grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto; grid-template-areas: "name note points";
    align-items: center; gap: 0 10px; padding: 7px 14px 8px; border-radius: 14px;
  }
  .rows span { grid-area: name; font-size: 17px; }
  .rows small { grid-area: note; font-size: 12.5px; white-space: nowrap; }
  .rows b { grid-area: points; margin: 0; font-size: 20px; }
  .final__foot { gap: 12px; }
  .stage[data-view="final"] .zoom { display: none; }   /* the result fills a phone; the map is only a backdrop here */
  .final__actions { order: -1; width: 100%; }
  .final__actions .btn { flex: 1; }

  .zoom { left: 8px; bottom: calc(var(--dock-h, 320px) + 10px); }
  .status { bottom: calc(var(--dock-h, 320px) + 62px); }   /* clear of the zoom buttons */

  .sheet { padding: 22px 20px 20px; }
  .sheet h2 { font-size: 30px; }
  .stats dd { font-size: 28px; }

  .form { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .board__when b { font-size: 20px; }
  .board__say { padding: 12px 14px 13px; border-radius: 14px; }
  .board__say b { font-size: 28px; }
  .ranks li { min-height: 40px; padding: 0 14px; gap: 10px; }
  .day { grid-template-columns: minmax(0, 1fr) auto 3.8em 2.7em; gap: 10px; padding: 0 12px; font-size: 15px; }
}

@media (max-width: 400px) {
  .ghost, .ghost.ghost--icon { width: 34px; height: 34px; }
  .tools { gap: 3px; }
}

@media (max-width: 380px) {
  .bar { padding: 0 6px 0 12px; }
  .brand { font-size: 20px; }
  .hud__text { display: none; }
  .hud__points .hud__unit { display: none; }   /* "points left" in a longer language does not fit beside the number */
  .headline { font-size: 32px; }
  .btn { font-size: 15px; }
}

/* a short phone: the tabs take a line, so the lede under the headline goes and the map keeps its room */
@media (max-width: 720px) and (max-height: 700px) {
  .lede { display: none; }
}

/* the narrowest phones: the six controls shrink a little to stay beside the name */
@media (max-width: 360px) {
  .brand { font-size: 16px; }
  .ghost, .ghost.ghost--icon { width: 30px; height: 30px; }
  .ghost svg { width: 18px; height: 18px; }
  .tools { gap: 2px; }
}
@media (max-width: 345px) {
  .start { grid-template-columns: minmax(0, 1fr); }   /* the two buttons no longer fit side by side */
}

/* a phone held sideways: the dock becomes a column on the left */
@media (max-height: 519px) and (orientation: landscape) {
  .bar { height: 48px; justify-content: flex-end; }
  .brand { display: none; }
  .dock {
    left: 10px; bottom: 10px; width: min(430px, 50%); max-height: calc(100% - 20px);
    padding: 12px 12px 14px; border-radius: 24px; overflow-x: hidden; overflow-y: auto;
    transform: none;
  }
  /* the dock is a column here and scrolls: the handle sits inside its top corner */
  .tuck { left: auto; right: 10px; top: 10px; width: 40px; transform: none; }
  .view--home, .view--end, .pane { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .pane--cats .headline { font-size: 26px; }
  .pane--cats .topics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 6px; }
  .pane--cats .topic { gap: 8px; padding: 5px 8px 5px 5px; }
  .pane--cats .topic__badge { width: 32px; height: 32px; padding: 7px; border-radius: 10px; }
  .pane--cats .topic__words b { font-size: 14.5px; }
  .pane--cats .topic__words span { display: none; }
  .recap { grid-column: auto; grid-row: auto; }
  .headline { font-size: 30px; }
  .lede { display: none; }
  .hud__text { display: none; }
  .score { font-size: 34px; }
  .clues { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .clue { min-height: 0; padding: 8px 12px 9px; }
  .clue__text { margin-top: 4px; font-size: 15px; }
  .clues.has-photos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .clues.has-photos .clue { padding: 6px; }
  .clues.has-photos .clue__cat { font-size: 11px; padding: 4px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .clues.has-photos .clue__zoom img { height: 96px; }
  .clues.has-photos .clue__caption { display: none; }
  .rows { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .rows li { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name points" "note points"; gap: 0 12px; padding: 6px 12px; border-radius: 12px; }
  .rows span { grid-area: name; font-size: 16px; }
  .rows small { grid-area: note; }
  .rows b { grid-area: points; margin: 0; font-size: 20px; align-self: center; }
  .stand { display: none; }
  .zoom { left: auto; right: 10px; bottom: 10px; }
  .status { left: 75%; bottom: 62px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
  }
}
