/* Unlock Our World - Meridian Atlas

   Every colour is derived from the map. The map is the only surface in the
   product carrying real chroma, everything else is a blue cast neutral.

   MAP LIGHTNESS LADDER (CIE L*)
     locked        94.9   the world at zero, warm paper
     territory     91.9   inert land, not playable
     locked-hover  89.4   a pre-echo of tier1
     sea           86.4   deliberately BETWEEN locked land and tier1, so one
                          stroke colour reads as a border against all seven
                          fills. Do not lighten --sea, it breaks the coastline.
     tier1         77.7
     tier2         66.3
     tier3         52.7

   The difficulty triad is categorical and deliberately staggered in lightness
   (medium 63.5 / easy 54.2 / hard 36.8) with Hard on violet rather than red.
   That keeps the three separable in greyscale and under deuteranopia, and it
   leaves red meaning exactly one thing in this product: a wrong answer.

   FILL versus INK: bare --easy / --medium / --hard / --good / --bad are FILL
   values, for map fills, dots, bars and swatches. The *-ink values are the
   TEXT values. Never set text in a bare fill token.
*/

:root {
  color-scheme: light;

  /* ------------------------------------------------------------- neutrals */
  --bg:          #f1f5f8;
  --bg-deep:     #e7edf3;
  --surface:     #ffffff;
  --surface-2:   #f5f8fc;
  --surface-3:   #eef3f9;
  --ink:         #1c283a;
  --ink-hover:   #101a29;
  --on-ink:      #ffffff;
  --muted:       #525d6c;
  --faint:       #63707f;
  --line:        #e1e7ec;
  --line-2:      #cad3da;
  --line-3:      #b3bfc9;
  --swatch-line: rgba(28, 40, 58, .10);
  --glass:       rgba(255, 255, 255, .88);
  --glass-bar:   rgba(255, 255, 255, .80);
  --scrim:       rgba(20, 30, 46, .30);
  --scrim-2:     rgba(20, 30, 46, .36);

  /* --------------------------------------------------------------- accent */
  /* Blue is information only: the play button, focus rings, map pins. It never
     appears on .btn-primary, the segmented control or the stat cards. */
  --accent:      #345eb5;
  --accent-ink:  #1f479f;
  --accent-soft: #e8f0fd;
  --accent-line: #c6d7f5;
  --accent-ring: rgba(52, 94, 181, .24);
  --accent-cast: 0 1px 1px rgba(28, 40, 58, .10), 0 10px 24px -12px rgba(52, 94, 181, .6);
  /* The far end of the Play button's colour drift: the map's green, taken deep
     enough that the white label still clears AA at the worst moment, which is
     the sheen passing over the drift rather than over the accent. */
  --play-drift: #19685e;

  /* ------------------------------------------------ difficulty and state */
  --easy:        #2f9269;
  --easy-ink:    #1e6b4a;
  --easy-soft:   #e6f2ea;
  --easy-line:   #c6e0d1;

  --medium:      #c98f26;
  --medium-ink:  #8a5c10;
  --medium-soft: #f9efdb;
  --medium-line: #ecd9ae;

  --hard:        #6a4497;
  --hard-ink:    #5d3f92;
  --hard-soft:   #efeaf7;
  --hard-line:   #d9cfec;

  --good:        #237a55;
  --good-ink:    #1e6b4a;
  --good-soft:   #e6f2ea;
  --good-line:   #c6e0d1;
  --bad:         #ae4440;
  --bad-ink:     #9a3733;
  --bad-soft:    #fbeaea;
  --bad-soft-2:  #f7dcdb;
  --bad-line:    #f0d0cf;
  --bad-line-2:  #e4b6b4;

  /* ------------------------------------------------------------------ map */
  --sea:          #c7dbea;
  --sea-deep:     #a3bfd3;
  --locked:       #f2f0ec;
  --locked-hover: #cae7dd;
  --territory:    #e9e8e4;
  --tier1:        #8ecdb2;
  --tier2:        #64af9a;
  --tier3:        #278c7f;
  --coast:        var(--sea);
  --graticule:    rgba(163, 191, 211, .55);
  --graticule-2:  rgba(140, 172, 196, .70);
  --neatline:     #b9cddd;
  --vignette:     rgba(40, 72, 100, .16);
  --gilt:         #f0c04e;
  --gilt-line:    #c08a2e;

  /* One quiet hue per answer card, A to D, so a question reads as four
     distinct things rather than four identical rectangles. They stay pale
     until you point at one. */
  --opt-a: #3059b3;  --opt-a-soft: #eaf0fc;  --opt-a-line: #c6d7f4;
  --opt-b: #6f4ca1;  --opt-b-soft: #f1ecf9;  --opt-b-line: #dccdee;
  --opt-c: #187062;  --opt-c-soft: #e5f3f0;  --opt-c-line: #c0e0d9;
  --opt-d: #866013;  --opt-d-soft: #f8f1e0;  --opt-d-line: #ebd9ad;

  /* hero stage: the light pool behind the headline and the drifting flag layer */
  --hero-glow: rgba(52, 94, 181, .13);
  --flag-a1: .16;
  --flag-a2: .26;
  --flag-a3: .40;
  --flag-cast: 0 14px 30px -16px rgba(28, 40, 58, .5);
  --logo-cast: 0 18px 38px -18px rgba(39, 140, 127, .7);
  --pin-halo:      rgba(52, 94, 181, .18);
  --pin-halo-good: rgba(35, 122, 85, .20);
  --pin-halo-bad:  rgba(174, 68, 64, .18);

  /* ---------------------------------------------------------------- shape */
  --r-xs: 8px;
  --r-sm: 11px;
  --r: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 999px;

  /* ------------------------------------------------------------ elevation */
  /* Every surface takes --hi (raised) or --well (recessed). Never both, never
     neither. Shadows carry the ink hue, never neutral black. */
  --hi: inset 0 1px 0 rgba(255, 255, 255, .85);
  --well: inset 0 1px 2px rgba(28, 40, 58, .07), inset 0 0 0 1px rgba(28, 40, 58, .03);
  --shadow-1: 0 1px 1px rgba(28, 40, 58, .03), 0 1px 2px rgba(28, 40, 58, .05);
  --shadow-2: 0 1px 2px rgba(28, 40, 58, .05), 0 8px 24px -12px rgba(28, 40, 58, .2);
  --shadow-3: 0 2px 6px rgba(28, 40, 58, .07), 0 28px 64px -28px rgba(28, 40, 58, .34);
  --shadow-plate:
    inset 0 0 0 1px rgba(28, 40, 58, .07),
    inset 0 22px 46px -36px rgba(28, 40, 58, .45),
    0 18px 44px -26px rgba(28, 40, 58, .24);
  --focus: 0 0 0 3px var(--accent-ring);

  /* ----------------------------------------------------------------- type */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, monospace;

  /* --------------------------------------------------------------- motion */
  --ease: cubic-bezier(.22, .8, .3, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --t-fast: .14s;
  --t: .2s;
  --t-map: .55s;
}

/* ------------------------------------------------------------- NIGHT CHART */
/* The ramp inverts: unlocking lightens land against a deep ocean. Every map
   token moves together, or progress would run both ways at once. The coast
   rule still holds, since --sea stays darker than every land value. */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg:          #101820;
  --bg-deep:     #0b1119;
  --surface:     #1a222b;
  --surface-2:   #222b35;
  --surface-3:   #2a3540;
  --ink:         #ecf1f5;
  --ink-hover:   #ffffff;
  --on-ink:      #101820;
  --muted:       #a6b1bc;
  --faint:       #8b96a2;
  --line:        #2f3841;
  --line-2:      #414b56;
  --line-3:      #55606b;
  --swatch-line: rgba(255, 255, 255, .12);
  --glass:       rgba(26, 34, 43, .84);
  --glass-bar:   rgba(16, 24, 32, .78);
  --scrim:       rgba(4, 8, 13, .6);
  --scrim-2:     rgba(4, 8, 13, .68);

  --accent:      #739def;
  --accent-ink:  #9dbcf7;
  --accent-soft: #1e2e45;
  --accent-line: #2c4266;
  --accent-ring: rgba(115, 157, 239, .32);
  --accent-cast: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 24px -12px rgba(115, 157, 239, .45);
  --play-drift: #60b899;

  --easy:        #4fa87a;  --easy-ink:   #7fc79f;
  --easy-soft:   #16301f;  --easy-line:  #244a32;
  --medium:      #d3a24e;  --medium-ink: #e3bd7e;
  --medium-soft: #33270f;  --medium-line:#4d3c1c;
  --hard:        #9280da;  --hard-ink:   #b6a7ec;
  --hard-soft:   #221f3d;  --hard-line:  #362f5c;
  --good:        #5cb086;  --good-ink:   #7fc79f;
  --good-soft:   #16301f;  --good-line:  #244a32;
  --bad:         #de7d76;  --bad-ink:    #eda49e;
  --bad-soft:    #2f1a19;  --bad-soft-2: #3d211f;
  --bad-line:    #4a2926;  --bad-line-2: #5e3733;

  --sea:          #101d2a;
  --sea-deep:     #223648;
  --locked:       #3a4046;
  --locked-hover: #37544d;
  --territory:    #2c3135;
  --tier1:        #32695e;
  --tier2:        #44907c;
  --tier3:        #60b899;
  --graticule:    rgba(34, 54, 72, .85);
  --graticule-2:  rgba(52, 80, 104, .95);
  --neatline:     #2b3a49;
  --vignette:     rgba(0, 0, 0, .34);
  --gilt:         #f2cb70;
  --gilt-line:    #d9a745;

  --opt-a: #8fb2f5;  --opt-a-soft: #1b2b43;  --opt-a-line: #2c4166;
  --opt-b: #b49aea;  --opt-b-soft: #251f3d;  --opt-b-line: #382f5b;
  --opt-c: #63c1ae;  --opt-c-soft: #13302c;  --opt-c-line: #1f4841;
  --opt-d: #ddb063;  --opt-d-soft: #322611;  --opt-d-line: #4b3a1b;

  --hero-glow: rgba(115, 157, 239, .16);
  --flag-a1: .13;
  --flag-a2: .22;
  --flag-a3: .34;
  --flag-cast: 0 16px 34px -16px rgba(0, 0, 0, .85);
  --logo-cast: 0 18px 42px -16px rgba(39, 140, 127, .55);
  --pin-halo:      rgba(115, 157, 239, .22);
  --pin-halo-good: rgba(92, 176, 134, .22);
  --pin-halo-bad:  rgba(222, 125, 118, .2);

  --hi: inset 0 1px 0 rgba(255, 255, 255, .06);
  --well: inset 0 1px 2px rgba(0, 0, 0, .4), inset 0 0 0 1px rgba(0, 0, 0, .25);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .34);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, .34), 0 8px 24px -12px rgba(0, 0, 0, .62);
  --shadow-3: 0 2px 6px rgba(0, 0, 0, .4), 0 28px 64px -28px rgba(0, 0, 0, .8);
  --shadow-plate:
    inset 0 0 0 1px rgba(255, 255, 255, .05),
    inset 0 22px 46px -36px rgba(0, 0, 0, .7),
    0 18px 44px -26px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }

/* A class that sets display beats the browser's rule for [hidden], so say it
   once here rather than remembering it at every call site. */
[hidden] { display: none !important; }

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.006em;
  font-optical-sizing: auto;
  font-feature-settings: "cv05" 1, "cv08" 1, "ss03" 1, "calt" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

p, .setting .d, .feedback .body { text-wrap: pretty; }
h1, h2, .question { text-wrap: balance; }

h1, h2, h3, h4 { margin: 0; font-weight: 620; letter-spacing: -0.024em; line-height: 1.2; }

button { font: inherit; color: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

:where(button, a, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--focus), var(--shadow-1);
}

/* Instrument lettering. One mono face turns dashboard chrome into a chart. */
.label, .eyebrow, .stat .k, .review h3, .fact .k, .ramp-cap {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
}

.stat .v, .quiz-count, .level .meta, .prow-top b, .score-ring .num,
.chip b, .fact .v, .ramp-keys {
  font-variant-numeric: tabular-nums slashed-zero;
}

/* ------------------------------------------------------------------ shell */
.app { min-height: 100%; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 22px;
  background: var(--glass-bar);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  padding: 0;
  font-weight: 620;
  letter-spacing: -0.024em;
  font-size: 15.5px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: linear-gradient(148deg, var(--tier3), var(--accent));
  display: grid;
  place-items: center;
  color: var(--on-ink);
  flex: none;
  box-shadow: var(--shadow-1), var(--hi);
}
.brand-mark svg { width: 19px; height: 19px; }

.topbar-spacer { flex: 1; }

.nav {
  display: flex;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 3px;
  box-shadow: var(--well);
}

.nav button {
  border: 0;
  background: none;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.nav button:hover { color: var(--ink); }
.nav button[aria-current="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-1), var(--hi);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  box-shadow: var(--shadow-1), var(--hi);
}
.chip b { color: var(--ink); font-weight: 620; }

.screen { flex: 1; display: none; }
.screen.is-active { display: block; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 22px; }

/* ------------------------------------------------------------------- home */
/* The hero is its own stage so the drifting flags are clipped to it and never
   carry on down the page. overflow:hidden here is what does that. */
.hero-stage {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.hero-stage > .wrap { position: relative; z-index: 2; }

/* a soft pool of light behind the headline, above the flags */
.hero-stage::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -18%;
  width: min(1100px, 130%);
  height: 78%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(52% 58% at 50% 45%, var(--hero-glow), transparent 72%);
}

.hero-flags {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* Clear through the middle where the type and the card sit, present at the
     edges. A mask rather than a painted scrim, because it fades the tiles out
     instead of laying an opaque shape over them. */
  -webkit-mask-image: radial-gradient(112% 86% at 50% 42%, transparent 0%, transparent 31%, #000 70%);
  mask-image: radial-gradient(112% 86% at 50% 42%, transparent 0%, transparent 31%, #000 70%);
}
.hero-flag {
  position: absolute;
  border-radius: 7px;
  overflow: hidden;
  line-height: 0;
  box-shadow: var(--flag-cast), inset 0 0 0 1px rgba(255, 255, 255, .08);
  animation: heroFloat var(--dur) ease-in-out infinite alternate;
  animation-delay: var(--delay);
}
/* Two images can sit in a tile at once so one country can cross fade into the
   next. Only the one carrying .on is visible. */
.hero-flag img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 1.5s var(--ease);
}
.hero-flag img.on { opacity: 1; }
/* Depth comes from size, opacity and a touch of blur on the far layers. */
.hero-flag.l1 { opacity: var(--flag-a1); filter: blur(1.6px); }
.hero-flag.l2 { opacity: var(--flag-a2); filter: blur(.6px); }
.hero-flag.l3 { opacity: var(--flag-a3); }

@keyframes heroFloat {
  from { transform: translate3d(0, 0, 0) rotate(var(--r0)); }
  to { transform: translate3d(var(--dx), var(--dy), 0) rotate(var(--r1)); }
}

.hero { padding: 56px 0 34px; text-align: center; }

.hero-logo {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 22px;
  border-radius: 20px;
  background: linear-gradient(148deg, var(--tier3), var(--accent));
  color: var(--on-ink);
  box-shadow: var(--logo-cast), var(--hi);
}
.hero-logo svg { width: 38px; height: 38px; }
.hero h1 {
  font-size: clamp(36px, 5.6vw, 56px);
  font-weight: 640;
  letter-spacing: -0.038em;
  line-height: 1.04;
}
.hero p {
  margin: 16px auto 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 16.5px;
  letter-spacing: 0;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 18px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1), var(--hi);
}

.launch {
  max-width: 560px;
  margin: 34px auto 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2), var(--hi);
  padding: 24px;
}

.label { display: block; margin-bottom: 10px; }
.label-gap { margin-top: 18px; }

.regions { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.region {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--r-pill);
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  box-shadow: var(--well);
  transition: background var(--t) var(--ease), color var(--t) var(--ease),
              border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.region:hover { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.region[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-ink);
  font-weight: 600;
  box-shadow: var(--shadow-1), var(--hi);
}

.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

/* A printed tab: the difficulty colour is a 3px bar along the bottom edge
   rather than a full tint, so three saturated blocks never shout over the map. */
.level {
  position: relative;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--r);
  padding: 13px 10px 12px;
  text-align: center;
  box-shadow: var(--well);
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease),
              transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.level:hover {
  background: var(--surface);
  border-color: var(--line-2);
  box-shadow: var(--shadow-1), var(--hi);
  transform: translateY(-1px);
}
.level .dot {
  display: block;
  width: 9px; height: 9px;
  border-radius: 50%;
  margin: 0 auto 7px;
  background: var(--line-3);
  box-shadow: 0 0 0 3px var(--surface-2);
  transition: background var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.level .name {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.level .meta {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--faint);
  margin-top: 3px;
}
.level[data-level="easy"] .dot { background: var(--easy); }
.level[data-level="medium"] .dot { background: var(--medium); }
.level[data-level="hard"] .dot { background: var(--hard); }

.level[aria-pressed="true"] {
  background: var(--surface);
  border-color: var(--line-2);
  box-shadow: var(--shadow-1), var(--hi), inset 0 -3px 0 var(--line-3);
}
.level[aria-pressed="true"][data-level="easy"] {
  box-shadow: var(--shadow-1), var(--hi), inset 0 -3px 0 var(--easy);
}
.level[aria-pressed="true"][data-level="medium"] {
  box-shadow: var(--shadow-1), var(--hi), inset 0 -3px 0 var(--medium);
}
.level[aria-pressed="true"][data-level="hard"] {
  box-shadow: var(--shadow-1), var(--hi), inset 0 -3px 0 var(--hard);
}
.level[aria-pressed="true"][data-level="easy"] .dot { box-shadow: 0 0 0 3px var(--easy-soft); }
.level[aria-pressed="true"][data-level="medium"] .dot { box-shadow: 0 0 0 3px var(--medium-soft); }
.level[aria-pressed="true"][data-level="hard"] .dot { box-shadow: 0 0 0 3px var(--hard-soft); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 0 20px;
  height: 44px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.008em;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: var(--shadow-1), var(--hi);
  transition: transform var(--t-fast) var(--ease), background var(--t) var(--ease),
              border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.btn:hover { background: var(--surface); border-color: var(--line-2); box-shadow: var(--shadow-2), var(--hi); }
.btn:active { transform: scale(.985); }

.btn-primary {
  background: var(--ink);
  color: var(--on-ink);
  border-color: var(--ink);
  box-shadow: var(--shadow-2), var(--hi);
}
.btn-primary:hover { background: var(--ink-hover); border-color: var(--ink-hover); }

/* The play button is the only place blue becomes a surface. */
.btn-play {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  width: 100%;
  height: 58px;
  margin-top: 18px;
  font-size: 17px;
  letter-spacing: -0.012em;
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-ink);
  box-shadow: var(--accent-cast), var(--hi);
  transition: transform var(--t-fast) var(--ease), box-shadow .3s var(--ease),
              border-color var(--t) var(--ease);
}

/* Two layers behind the label, so the text never moves and the work stays on
   the compositor. ::before is a slow drift between the accent blue and the
   map's deep green, the same pair the logo uses. ::after is a single sheen
   that crosses once when the pointer arrives. */
.btn-play::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 260%;
  z-index: -1;
  background: linear-gradient(100deg,
    var(--accent) 0%, var(--play-drift) 26%, var(--accent) 50%,
    var(--play-drift) 74%, var(--accent) 100%);
  opacity: 0;
  transition: opacity .4s var(--ease);
}
.btn-play::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: -55%;
  width: 40%;
  z-index: -1;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .12), transparent);
  transform: skewX(-16deg);
  opacity: 0;
}

.btn-play:hover {
  background: var(--accent);
  border-color: var(--accent-ink);
  transform: translateY(-1px);
  box-shadow: 0 1px 1px rgba(28, 40, 58, .1), 0 16px 34px -12px rgba(52, 94, 181, .7), var(--hi);
}
.btn-play:hover::before { opacity: 1; animation: playDrift 3s linear infinite; }
.btn-play:hover::after { animation: playSheen 1.15s var(--ease-out); }
.btn-play:active { box-shadow: 0 1px 2px rgba(28, 40, 58, .14); transform: scale(.985); }

/* The gradient repeats every 1.3 button widths, so shifting the 260% wide
   layer by half its own width lands back on an identical frame. No seam. */
@keyframes playDrift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}
@keyframes playSheen {
  0% { left: -55%; opacity: 0; }
  25% { opacity: 1; }
  100% { left: 115%; opacity: 0; }
}

.btn-ghost { background: none; border-color: transparent; color: var(--muted); box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.btn-sm { height: 34px; padding: 0 13px; font-size: 13px; border-radius: var(--r-sm); }
.btn-danger { color: var(--bad-ink); border-color: var(--bad-line); background: var(--bad-soft); }
.btn-danger:hover { background: var(--bad-soft-2); border-color: var(--bad-line-2); }
.btn:disabled { opacity: .45; pointer-events: none; }

.launch-note { margin-top: 12px; text-align: center; font-size: 12.5px; color: var(--faint); }

.complete {
  display: grid;
  gap: 3px;
  padding: 14px 12px 12px;
  margin-top: 4px;
  border-radius: var(--r);
  background: var(--easy-soft);
  border: 1px solid var(--easy-line);
  color: var(--easy-ink);
  box-shadow: var(--hi);
}
.complete .big { font-size: 16px; font-weight: 620; letter-spacing: -0.022em; color: var(--ink); }

/* --------------------------------------------------------------- sections */
.section { padding: 30px 0 46px; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.section-head h2 { font-size: 20px; }
.section-head h2::before {
  content: "";
  display: block;
  width: 26px;
  height: 2px;
  background: var(--ink);
  margin-bottom: 10px;
}
.section-head p { margin: 5px 0 0; color: var(--muted); font-size: 13.5px; }

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

/* ------------------------------------------------------------------- map */
.map-shell {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--sea);
  border: 0;
  box-shadow: var(--shadow-plate);
}
.map-shell.is-preview { box-shadow: var(--shadow-plate), var(--shadow-2); }

/* ocean depth, fixed while the SVG zooms underneath, the way a printed sheet
   behaves. Pure paint, no blend mode, no per frame cost. */
.map-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(125% 95% at 50% 6%, transparent 44%, var(--vignette) 100%);
}
/* neatline, a second rule inside the plate edge */
.map-shell::before {
  content: "";
  position: absolute;
  inset: 6px;
  pointer-events: none;
  z-index: 2;
  border: 1px solid var(--neatline);
  border-radius: calc(var(--r-xl) - 6px);
}

.map-holder { display: block; line-height: 0; }
.wm-svg { display: block; width: 100%; height: auto; touch-action: pan-y; user-select: none; }
.wm-svg.is-zoomed { cursor: grab; touch-action: none; }
.wm-svg.is-locating { cursor: crosshair; }

.wm-sea { fill: var(--sea); }

.wm-graticule { pointer-events: none; }
.wm-grid {
  fill: none;
  stroke: var(--graticule);
  stroke-width: .35;
  vector-effect: non-scaling-stroke;
}
.wm-grid-major { stroke: var(--graticule-2); stroke-width: .5; }

/* One stroke colour against all seven fills. non-scaling-stroke keeps every
   border a crisp hairline at any zoom level. */
.wm-territory {
  fill: var(--territory);
  stroke: var(--coast);
  stroke-width: .5;
  vector-effect: non-scaling-stroke;
}
.wm-country {
  fill: var(--locked);
  stroke: var(--coast);
  stroke-width: .6;
  vector-effect: non-scaling-stroke;
  transition: fill var(--t-map) var(--ease), stroke var(--t) var(--ease);
}
.wm-dot {
  fill: var(--locked);
  stroke: var(--sea-deep);
  stroke-width: .9;
  vector-effect: non-scaling-stroke;
  transition: fill var(--t-map) var(--ease), stroke var(--t) var(--ease);
}

.wm-country[data-state="tier1"], .wm-dot[data-state="tier1"] { fill: var(--tier1); }
.wm-country[data-state="tier2"], .wm-dot[data-state="tier2"] { fill: var(--tier2); }
.wm-country[data-state="tier3"], .wm-dot[data-state="tier3"] { fill: var(--tier3); }
.wm-country[data-state="easy"], .wm-dot[data-state="easy"] { fill: var(--easy); }
.wm-country[data-state="medium"], .wm-dot[data-state="medium"] { fill: var(--medium); }
.wm-country[data-state="hard"], .wm-dot[data-state="hard"] { fill: var(--hard); }

.is-interactive .wm-country, .is-interactive .wm-dot { cursor: pointer; }
/* Hovering a locked country previews what it becomes, rather than greying it. */
.is-interactive .wm-country[data-state="locked"]:hover,
.is-interactive .wm-dot[data-state="locked"]:hover { fill: var(--locked-hover); }
.is-interactive .wm-country[data-state]:not([data-state="locked"]):hover,
.is-interactive .wm-dot[data-state]:not([data-state="locked"]):hover {
  stroke: rgba(28, 40, 58, .42);
  stroke-width: .9;
  filter: saturate(1.08);
}
.wm-country:focus-visible, .wm-dot:focus-visible {
  outline: none;
  stroke: var(--accent);
  stroke-width: 1.4;
}

/* Gold is the only warm event on the map, and it lasts one second. fill is set
   at 0% only, so it interpolates down to whatever tier the country now holds. */
.wm-country.is-unlocking, .wm-dot.is-unlocking { animation: gild 1.15s var(--ease-out); }
@keyframes gild {
  0%   { fill: var(--gilt); stroke: var(--gilt-line); stroke-width: 1.6; }
  45%  { stroke: var(--gilt-line); stroke-width: 1; }
  100% { stroke: var(--coast); stroke-width: .6; }
}

.wm-ring {
  fill: none;
  stroke: var(--gilt-line);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
  animation: ripple 1.4s var(--ease-out) forwards;
}
@keyframes ripple {
  0%   { r: 5; opacity: .85; stroke-width: 2.2; }
  100% { r: 44; opacity: 0; stroke-width: .4; }
}

.wm-highlight {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}
.wm-highlight-target { stroke: var(--tier3); stroke-width: 1.8; animation: fadein .5s var(--ease); }
.wm-halo {
  fill: none;
  stroke: var(--tier3);
  stroke-width: 1.2;
  opacity: .85;
  vector-effect: non-scaling-stroke;
  animation: fadein .5s var(--ease);
}
@keyframes fadein { from { opacity: 0 } to { opacity: .85 } }

.wm-pin-halo { fill: var(--pin-halo); }
.wm-pin-core { fill: var(--accent); stroke: var(--surface); stroke-width: 1.4; }
.wm-pin-good .wm-pin-halo { fill: var(--pin-halo-good); }
.wm-pin-good .wm-pin-core { fill: var(--good); }
.wm-pin-bad .wm-pin-halo { fill: var(--pin-halo-bad); }
.wm-pin-bad .wm-pin-core { fill: var(--bad); }
.wm-pin { animation: drop .35s var(--ease); }
@keyframes drop { from { opacity: 0; transform: translateY(-6px) } to { opacity: 1; transform: none } }

/* map controls */
.map-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }

.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: var(--well);
}
.segmented button {
  border: 0;
  background: none;
  border-radius: var(--r-pill);
  padding: 6px 13px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-1), var(--hi);
}
.segmented .swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--swatch-line);
}

.legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i {
  width: 11px; height: 11px;
  border-radius: 3px;
  display: inline-block;
  box-shadow: inset 0 0 0 1px var(--swatch-line);
}

/* A sequential scale shown as a scale, not four unrelated dots. */
.legend-ramp { display: grid; gap: 4px; justify-items: start; }
.ramp-bar {
  display: grid;
  grid-template-columns: repeat(4, 30px);
  border: 1px solid var(--neatline);
  border-radius: 3px;
  overflow: hidden;
}
.ramp-bar i { display: block; height: 10px; }
.ramp-keys {
  display: grid;
  grid-template-columns: repeat(4, 30px);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  color: var(--faint);
  text-align: center;
}
.ramp-cap { display: block; }

.map-float { position: absolute; right: 12px; bottom: 12px; z-index: 3; display: flex; gap: 6px; }
.map-float button {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  font-size: 15px;
  color: var(--muted);
  box-shadow: var(--shadow-1), var(--hi);
}
.map-float button:hover { color: var(--ink); border-color: var(--line-2); }

.map-hint {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 3;
  background: var(--glass);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 6px 13px;
  font-size: 12.5px;
  color: var(--muted);
  box-shadow: var(--shadow-1), var(--hi);
  pointer-events: none;
}

/* -------------------------------------------------------------- progress */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 15px 16px;
  box-shadow: var(--shadow-1), var(--hi);
}
.stat .k { display: block; }
.stat .v { font-size: 28px; font-weight: 640; letter-spacing: -0.035em; margin-top: 6px; line-height: 1.1; }
.stat .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

.bar { height: 6px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; margin-top: 10px; box-shadow: var(--well); }
.bar i { display: block; height: 100%; border-radius: var(--r-pill); background: var(--ink); transition: width .6s var(--ease); }
.bar.easy i { background: var(--easy); }
.bar.medium i { background: var(--medium); }
.bar.hard i { background: var(--hard); }

.progress-rows { display: grid; gap: 14px; padding: 18px 20px; }
.prow-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; }
.prow-top b { font-weight: 600; }
.prow-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.prow-name i { width: 9px; height: 9px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--swatch-line); }

/* ------------------------------------------------------------------ quiz */
.quiz { max-width: 760px; margin: 0 auto; padding: 24px 22px 60px; }
.quiz-head { margin-bottom: 18px; }
.quiz-title { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.quiz-country { display: flex; align-items: center; gap: 11px; font-size: 21px; font-weight: 640; letter-spacing: -0.028em; }
.quiz-country .badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: var(--r-pill);
}
.badge.easy { background: var(--easy-soft); color: var(--easy-ink); }
.badge.medium { background: var(--medium-soft); color: var(--medium-ink); }
.badge.hard { background: var(--hard-soft); color: var(--hard-ink); }

.quiz-count { font-family: var(--mono); font-size: 12px; color: var(--faint); }

.steps { display: flex; gap: 5px; margin-top: 14px; }
.steps i { flex: 1; height: 4px; border-radius: var(--r-pill); background: var(--surface-2); box-shadow: var(--well); transition: background .3s var(--ease); }
.steps i.done { background: var(--ink); }
.steps i.good { background: var(--good); }
.steps i.bad { background: var(--bad); }
.steps i.now { background: var(--line-2); }

.question {
  margin: 26px 0 20px;
  font-size: clamp(22px, 3.4vw, 30px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.22;
}

.options { display: grid; gap: 9px; }
.opt {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  text-align: left;
  padding: 15px 16px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.008em;
  box-shadow: var(--shadow-1), var(--hi);
  transition: transform var(--t-fast) var(--ease), border-color var(--t) var(--ease),
              background var(--t) var(--ease), box-shadow var(--t) var(--ease), opacity var(--t) var(--ease);
}

/* Each card carries its own hue. It slides in from the left on hover and is
   reused for the answer states, so the same motion says correct or wrong. */
.options .opt:nth-child(1) { --opt: var(--opt-a); --opt-soft: var(--opt-a-soft); --opt-line: var(--opt-a-line); }
.options .opt:nth-child(2) { --opt: var(--opt-b); --opt-soft: var(--opt-b-soft); --opt-line: var(--opt-b-line); }
.options .opt:nth-child(3) { --opt: var(--opt-c); --opt-soft: var(--opt-c-soft); --opt-line: var(--opt-c-line); }
.options .opt:nth-child(4) { --opt: var(--opt-d); --opt-soft: var(--opt-d-soft); --opt-line: var(--opt-d-line); }

.opt::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 100%;
  z-index: -1;
  background: linear-gradient(100deg, var(--wash, var(--opt-soft)) 0%, transparent 72%);
  opacity: 0;
  transform: translateX(-28%);
  transition: opacity .26s var(--ease), transform .45s var(--ease);
}
.opt:hover::before { opacity: 1; transform: none; }
.opt:hover { border-color: var(--opt-line); transform: translateY(-1px); box-shadow: var(--shadow-2), var(--hi); }
.opt:hover .key { background: var(--opt); border-color: var(--opt); color: var(--on-ink); box-shadow: none; }
.opt:active { transform: scale(.995); }

.opt .key {
  flex: none;
  width: 26px; height: 26px;
  border-radius: var(--r-xs);
  background: var(--opt-soft);
  border: 1px solid transparent;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--opt);
  transition: background var(--t) var(--ease), color var(--t) var(--ease), border-color var(--t) var(--ease);
}
.opt .txt { flex: 1; }
.opt .tick { flex: none; font-size: 17px; opacity: 0; transform: scale(.4); }

.options.is-locked .opt { pointer-events: none; }
.options.is-locked .opt:not(.is-right):not(.is-wrong) { opacity: .38; transform: scale(.99); }

.opt.is-right {
  --wash: var(--good-soft);
  border-color: var(--good);
  background: var(--good-soft);
  animation: optRing .75s var(--ease-out);
}
.opt.is-right::before { opacity: 1; transform: none; animation: optSweep .55s var(--ease-out); }
.opt.is-right .key { background: var(--good); border-color: var(--good); color: var(--on-ink); }
.opt.is-right .tick { color: var(--good-ink); animation: tickPop .5s var(--ease-out) forwards; }

.opt.is-wrong {
  --wash: var(--bad-soft);
  border-color: var(--bad);
  background: var(--bad-soft);
  box-shadow: 0 0 0 1px var(--bad), var(--hi);
  animation: optShake .42s var(--ease);
}
.opt.is-wrong::before { opacity: 1; transform: none; }
.opt.is-wrong .key { background: var(--bad); border-color: var(--bad); color: var(--on-ink); }
.opt.is-wrong .tick { color: var(--bad-ink); animation: tickPop .5s var(--ease-out) forwards; }

.opt.is-right:focus-visible { box-shadow: 0 0 0 1px var(--good), 0 0 0 4px rgba(35, 122, 85, .24); }
.opt.is-wrong:focus-visible { box-shadow: 0 0 0 1px var(--bad), 0 0 0 4px rgba(174, 68, 64, .24); }

/* the right answer throws one ring, the wrong one flinches */
@keyframes optRing {
  from { box-shadow: 0 0 0 1px var(--good), 0 0 0 2px rgba(35, 122, 85, .45), var(--hi); }
  to { box-shadow: 0 0 0 1px var(--good), 0 0 0 18px rgba(35, 122, 85, 0), var(--hi); }
}
@keyframes optSweep {
  from { transform: translateX(-100%); }
  to { transform: none; }
}
@keyframes optShake {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(-5px); }
  42% { transform: translateX(4px); }
  68% { transform: translateX(-2px); }
}
@keyframes tickPop {
  0% { opacity: 0; transform: scale(.3) rotate(-20deg); }
  55% { opacity: 1; transform: scale(1.3) rotate(6deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

/* flag options */
.options.flags { grid-template-columns: repeat(2, 1fr); }
.opt-flag {
  display: block;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-1), var(--hi);
  transition: transform var(--t-fast) var(--ease), border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.options.flags .opt-flag:nth-child(1) { --opt: var(--opt-a); --opt-soft: var(--opt-a-soft); --opt-line: var(--opt-a-line); }
.options.flags .opt-flag:nth-child(2) { --opt: var(--opt-b); --opt-soft: var(--opt-b-soft); --opt-line: var(--opt-b-line); }
.options.flags .opt-flag:nth-child(3) { --opt: var(--opt-c); --opt-soft: var(--opt-c-soft); --opt-line: var(--opt-c-line); }
.options.flags .opt-flag:nth-child(4) { --opt: var(--opt-d); --opt-soft: var(--opt-d-soft); --opt-line: var(--opt-d-line); }
.opt-flag:hover { transform: translateY(-2px); box-shadow: var(--shadow-2), var(--hi); border-color: var(--opt-line); }
.opt-flag:hover .cap { color: var(--opt); }
.opt-flag .frame {
  aspect-ratio: 3 / 2;
  border-radius: var(--r-xs);
  overflow: hidden;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  box-shadow: var(--well);
}
.opt-flag .frame img { width: 100%; height: 100%; object-fit: cover; }
.opt-flag .cap {
  margin-top: 9px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--faint);
  text-align: center;
}
.options.is-locked .opt-flag { pointer-events: none; }
.options.is-locked .opt-flag:not(.is-right):not(.is-wrong) { opacity: .35; transform: scale(.98); }
.opt-flag.is-right {
  border-color: var(--good);
  background: var(--good-soft);
  animation: optRing .75s var(--ease-out);
}
.opt-flag.is-right .cap { color: var(--good-ink); animation: tickPop .5s var(--ease-out) forwards; }
.opt-flag.is-wrong {
  border-color: var(--bad);
  background: var(--bad-soft);
  box-shadow: 0 0 0 1px var(--bad), var(--hi);
  animation: optShake .42s var(--ease);
}
.opt-flag.is-wrong .cap { color: var(--bad-ink); }

/* White field flags need an edge or they bleed into the surface. */
.opt-flag .frame, .toast img, .sheet-head img, .result .flagline img {
  box-shadow: inset 0 0 0 1px var(--swatch-line);
}
.opt-flag .frame { box-shadow: var(--well), inset 0 0 0 1px var(--swatch-line); }

.feedback {
  margin-top: 18px;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px 16px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 14px;
  box-shadow: var(--shadow-1), var(--hi);
  animation: rise .3s var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }
.feedback.good { border-color: var(--good-line); background: var(--good-soft); }
.feedback.bad { border-color: var(--bad-line); background: var(--bad-soft); }
.feedback .mark { font-weight: 700; }
.feedback.good .mark { color: var(--good-ink); }
.feedback.bad .mark { color: var(--bad-ink); }
.feedback .body { flex: 1; color: var(--muted); }
.feedback .body b { color: var(--ink); font-weight: 600; }

.quiz-map { border-radius: var(--r-lg); position: relative; }
.quiz-map .map-holder { height: clamp(230px, 44vh, 400px); }
.quiz-map .wm-svg { width: 100%; height: 100%; }
.quiz-map::before { inset: 5px; border-radius: calc(var(--r-lg) - 5px); }
.quiz-actions { margin-top: 18px; display: flex; justify-content: flex-end; gap: 10px; }

/* --------------------------------------------------------------- results */
.result { max-width: 620px; margin: 0 auto; padding: 60px 22px 60px; text-align: center; }
.score-ring { width: 148px; height: 148px; margin: 0 auto 22px; position: relative; display: grid; place-items: center; }
.score-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.score-ring .track { fill: none; stroke: var(--line); stroke-width: 9; }
.score-ring .fill {
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
  stroke: var(--tier3);
  transition: stroke-dashoffset 1s var(--ease);
}
.score-ring.fail .fill { stroke: var(--medium); }
.score-ring .num { position: relative; font-size: 46px; font-weight: 660; letter-spacing: -0.045em; line-height: 1; }
.score-ring .num small { font-size: 17px; color: var(--faint); font-weight: 500; }

.result h2 { font-size: 30px; font-weight: 640; letter-spacing: -0.035em; line-height: 1.1; }
.result .sub { color: var(--muted); margin-top: 10px; font-size: 15px; }
.result .flagline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 6px 14px 6px 6px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 600;
  box-shadow: var(--shadow-1), var(--hi);
}
.result .flagline img { width: 30px; height: 20px; object-fit: cover; border-radius: 4px; }
.result-actions { margin-top: 28px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.review { margin-top: 32px; text-align: left; border-top: 1px solid var(--line); padding-top: 18px; }
.review h3 { display: block; margin-bottom: 10px; }
.review ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.review li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13.5px;
  color: var(--muted);
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1), var(--hi);
}
.review li .m { font-weight: 700; flex: none; }
.review li.ok .m { color: var(--good-ink); }
.review li.no .m { color: var(--bad-ink); }

/* --------------------------------------------------------------- overlays */
.sheet-back {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--scrim);
  backdrop-filter: blur(3px);
  display: none;
  animation: veil .2s var(--ease);
}
@keyframes veil { from { opacity: 0 } to { opacity: 1 } }
.sheet-back.is-open { display: block; }

.sheet {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(420px, 92vw);
  background: var(--surface);
  border-left: 1px solid var(--line);
  border-radius: var(--r-lg) 0 0 var(--r-lg);
  box-shadow: var(--shadow-3), var(--hi);
  z-index: 61;
  transform: translateX(102%);
  transition: transform .32s var(--ease);
  display: flex;
  flex-direction: column;
}
.sheet.is-open { transform: none; }
.sheet-head { padding: 20px 22px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 14px; align-items: flex-start; }
.sheet-head img { width: 46px; height: 31px; object-fit: cover; border-radius: 5px; flex: none; }
.sheet-head h3 { font-size: 19px; letter-spacing: -0.026em; }
.sheet-head .sub { font-size: 13px; color: var(--faint); margin-top: 2px; }
.sheet-close { border: 0; background: none; padding: 4px 6px; color: var(--faint); font-size: 18px; line-height: 1; border-radius: var(--r-xs); }
.sheet-close:hover { background: var(--surface-2); color: var(--ink); }
.sheet-body { padding: 18px 22px 24px; overflow-y: auto; flex: 1; }
.sheet-foot { padding: 14px 22px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; }

.locks { display: grid; gap: 7px; margin-bottom: 20px; }
.lock {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--well);
}
.lock i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-3); flex: none; }
.lock .state { margin-left: auto; font-size: 12.5px; color: var(--faint); font-weight: 500; }
.lock[data-on="1"] { background: var(--surface); box-shadow: var(--shadow-1), var(--hi); }
.lock[data-on="1"] i { box-shadow: 0 0 0 3px var(--surface); }
.lock[data-on="1"] .state { font-weight: 600; }
.lock[data-on="1"][data-level="easy"] { border-color: var(--easy-line); background: var(--easy-soft); }
.lock[data-on="1"][data-level="easy"] i { background: var(--easy); box-shadow: 0 0 0 3px var(--easy-soft); }
.lock[data-on="1"][data-level="easy"] .state { color: var(--easy-ink); }
.lock[data-on="1"][data-level="medium"] { border-color: var(--medium-line); background: var(--medium-soft); }
.lock[data-on="1"][data-level="medium"] i { background: var(--medium); box-shadow: 0 0 0 3px var(--medium-soft); }
.lock[data-on="1"][data-level="medium"] .state { color: var(--medium-ink); }
.lock[data-on="1"][data-level="hard"] { border-color: var(--hard-line); background: var(--hard-soft); }
.lock[data-on="1"][data-level="hard"] i { background: var(--hard); box-shadow: 0 0 0 3px var(--hard-soft); }
.lock[data-on="1"][data-level="hard"] .state { color: var(--hard-ink); }

.facts { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.fact { display: flex; justify-content: space-between; gap: 16px; padding: 12px 14px; background: var(--surface); font-size: 13.5px; align-items: baseline; }
.fact .k { flex: none; }
.fact .v { font-weight: 500; text-align: right; }

.hidden-note {
  padding: 26px 18px;
  text-align: center;
  border: 1px dashed var(--line-2);
  border-radius: var(--r);
  color: var(--faint);
  font-size: 13.5px;
  background: var(--surface-2);
  box-shadow: var(--well);
}

/* ------------------------------------------------------------------ toast */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 90;
  display: grid;
  gap: 9px;
  justify-items: center;
  pointer-events: none;
  width: min(420px, calc(100vw - 32px));
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 17px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-3), var(--hi);
  animation: toastin .38s var(--ease-out);
  width: 100%;
}
@keyframes toastin { from { opacity: 0; transform: translateY(14px) scale(.97) } to { opacity: 1; transform: none } }
.toast.out { animation: toastout .3s var(--ease) forwards; }
@keyframes toastout { to { opacity: 0; transform: translateY(10px) scale(.98) } }
.toast img { width: 32px; height: 22px; object-fit: cover; border-radius: 4px; }
.toast .glyph { font-size: 20px; }
.toast .t { font-size: 14px; font-weight: 620; letter-spacing: -0.015em; }
.toast .d { font-size: 12.5px; color: var(--muted); }

/* ----------------------------------------------------------- achievements */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 10px; }
.badge-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 15px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-1), var(--hi);
}
.badge-card .g { font-size: 22px; filter: grayscale(1); opacity: .35; }
.badge-card .n { font-weight: 600; font-size: 14px; }
.badge-card .d { font-size: 12.5px; color: var(--faint); margin-top: 1px; }
/* the same gold that marks an unlock marks an achievement */
.badge-card.on {
  border-color: var(--easy-line);
  background: var(--easy-soft);
  box-shadow: var(--shadow-1), var(--hi), inset 0 -2px 0 var(--gilt-line);
}
.badge-card.on .g { filter: none; opacity: 1; }
.badge-card.on .n { color: var(--easy-ink); }

/* -------------------------------------------------------------- settings */
.setting { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting .n { font-weight: 600; font-size: 14.5px; }
.setting .d { font-size: 13px; color: var(--muted); margin-top: 2px; max-width: 46ch; }
.setting code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 5px;
  box-shadow: var(--well);
}

.confirm {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  padding: 22px;
  background: var(--scrim-2);
  backdrop-filter: blur(3px);
}
.confirm.is-open { display: grid; }
.confirm .box {
  width: min(400px, 100%);
  background: var(--surface);
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-3), var(--hi);
  padding: 24px;
  animation: rise .25s var(--ease);
}
.confirm h3 { font-size: 18px; }
.confirm p { color: var(--muted); font-size: 14px; margin: 9px 0 20px; }
.confirm .row { display: flex; gap: 9px; justify-content: flex-end; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .big { font-size: 42px; margin-bottom: 12px; }

/* ---------------------------------------------------------------- atlas */
/* The reference pages under /atlas. Same tokens, plain document layout. */
body.atlas { background: var(--bg); }

.atlas-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 22px;
  background: var(--glass-bar);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.atlas-bar .brand { text-decoration: none; color: inherit; }

.atlas-nav { display: flex; gap: 2px; flex-wrap: wrap; margin-right: auto; }
.atlas-nav a {
  padding: 6px 11px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.atlas-nav a:hover { color: var(--ink); background: var(--surface-2); }
.atlas-nav a[aria-current] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1), var(--hi); }

.atlas-main { padding-top: 26px; padding-bottom: 60px; }
.atlas-main h1 {
  font-size: clamp(30px, 4.6vw, 44px);
  font-weight: 640;
  letter-spacing: -0.032em;
  line-height: 1.08;
  margin-bottom: 16px;
}
.atlas-main h2 {
  font-size: 21px;
  margin: 46px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.atlas-main h2::before {
  content: "";
  display: block;
  width: 26px;
  height: 2px;
  background: var(--ink);
  margin-bottom: 10px;
}
.atlas-main a { color: var(--accent-ink); text-decoration-color: var(--accent-line); text-underline-offset: 2px; }
.atlas-main a:hover { text-decoration-thickness: 2px; }

.crumbs {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 18px;
}
.crumbs a { color: var(--faint); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }

.atlas-intro { max-width: 68ch; color: var(--muted); font-size: 16px; }
.atlas-intro strong { color: var(--ink); font-weight: 620; }
.atlas-intro p { margin: 0 0 12px; }
.policy-date {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
}

.table-scroll { overflow-x: auto; border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.atlas-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  font-size: 14px;
  min-width: 620px;
}
.atlas-table th, .atlas-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.atlas-table thead th {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
  background: var(--surface-2);
  white-space: nowrap;
}
.atlas-table tbody th { font-weight: 600; }
.atlas-table tbody tr:last-child th, .atlas-table tbody tr:last-child td { border-bottom: 0; }
.atlas-table tbody tr:hover { background: var(--surface-2); }
.atlas-table td { color: var(--muted); font-variant-numeric: tabular-nums; }

.country-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 12px; }
.country-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1), var(--hi);
  padding: 16px 18px 14px;
  scroll-margin-top: 90px;
}
.cc-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.cc-head img {
  width: 44px; height: 30px;
  object-fit: cover;
  border-radius: 4px;
  flex: none;
  box-shadow: inset 0 0 0 1px var(--swatch-line);
}
.cc-head h3 { font-size: 17px; letter-spacing: -0.024em; }
.cc-sub { margin: 1px 0 0; font-size: 12.5px; color: var(--faint); }

.cc-facts { margin: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.cc-facts > div { display: flex; justify-content: space-between; gap: 14px; padding: 9px 12px; background: var(--surface); }
.cc-facts dt {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  flex: none;
  padding-top: 2px;
}
.cc-facts dd { margin: 0; font-size: 13px; text-align: right; font-weight: 500; }

.cc-note { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.cc-play { margin: 10px 0 0; font-size: 12.5px; }

.continent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.continent-card {
  display: block;
  padding: 18px 20px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-1), var(--hi);
  text-decoration: none !important;
  color: inherit !important;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.continent-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2), var(--hi); }
.continent-card h3 { font-size: 19px; letter-spacing: -0.026em; }
.continent-card p { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.continent-card .cc-count {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--easy-ink);
}

.az-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px 22px; }
.az-group h3 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--faint);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.az-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.az-group li { font-size: 13.5px; }
.az-group a { text-decoration: none; }
.az-group a:hover { text-decoration: underline; }

.atlas-foot {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 28px 0 40px;
  margin-top: 40px;
}
.atlas-foot p { max-width: 60ch; color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.atlas-foot nav { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13.5px; }
.atlas-foot a { color: var(--accent-ink); }

/* ------------------------------------------------------- home page prose */
.prose { max-width: 68ch; color: var(--muted); font-size: 15.5px; }
.prose p { margin: 0 0 12px; }
.prose strong { color: var(--ink); font-weight: 600; }

.howto { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.howto li {
  position: relative;
  padding: 18px 20px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-1), var(--hi);
  counter-increment: step;
}
.howto li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 24px; height: 24px;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  box-shadow: var(--well);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--faint);
  margin-bottom: 11px;
}
.howto h3 { font-size: 15.5px; letter-spacing: -0.02em; }
.howto p { margin: 5px 0 0; font-size: 13.5px; color: var(--muted); }

.faq { display: grid; gap: 8px; margin: 0; }
.faq details {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-1), var(--hi);
  overflow: hidden;
}
.faq summary {
  padding: 14px 18px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--faint); font-size: 18px; font-weight: 400; }
.faq details[open] summary::after { content: "\2212"; }
.faq summary:hover { background: var(--surface-2); }
.faq .answer { padding: 0 18px 16px; color: var(--muted); font-size: 14px; max-width: 68ch; }
.faq .answer p { margin: 0 0 10px; }
.faq .answer p:last-child { margin: 0; }

.site-foot {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 30px 0 44px;
  margin-top: 20px;
}
.site-foot .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }
.site-foot h2 {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 10px;
}
.site-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-foot a { color: var(--accent-ink); font-size: 13.5px; text-underline-offset: 2px; }
.site-foot p { color: var(--muted); font-size: 13px; margin: 0; max-width: 42ch; }

.made-by {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--faint);
}
.made-by a { color: var(--accent-ink); font-weight: 600; text-underline-offset: 2px; }

/* --------------------------------------------------------- cookie consent */
.cookie-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 200;
  display: none;
  padding: 14px;
  background: var(--glass-bar);
  backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--line);
  box-shadow: var(--shadow-3);
}
.cookie-bar.is-visible { display: block; animation: cookieUp .38s var(--ease-out); }
@keyframes cookieUp { from { opacity: 0; transform: translateY(18px) } to { opacity: 1; transform: none } }

.cookie-inner {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  gap: 12px;
  align-items: center;
  grid-template-columns: 1fr auto;
}
.cookie-bar.is-open .cookie-inner { grid-template-columns: 1fr; }

.cookie-copy h2 { font-size: 15px; letter-spacing: -0.02em; margin-bottom: 4px; }
.cookie-copy p { margin: 0; font-size: 13.5px; color: var(--muted); max-width: 78ch; }
.cookie-copy a { color: var(--accent-ink); text-underline-offset: 2px; }

.cookie-choices { display: grid; gap: 7px; grid-column: 1 / -1; }
.cookie-row {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: var(--shadow-1), var(--hi);
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.cookie-row.is-locked { opacity: .75; cursor: default; }
.cookie-row input { margin: 2px 0 0; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.cookie-row b { display: block; color: var(--ink); font-weight: 600; font-size: 13.5px; margin-bottom: 1px; }

.cookie-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.cookie-bar.is-open .cookie-actions { grid-column: 1 / -1; }

@media (max-width: 760px) {
  .cookie-inner { grid-template-columns: 1fr; }
  .cookie-actions { justify-content: stretch; }
  .cookie-actions .btn { flex: 1 1 auto; }
}

/* ------------------------------------------------------------ responsive */
@media (max-width: 760px) {
  .atlas-bar { padding: 10px 14px; gap: 10px; }
  .atlas-bar .brand span:not(.brand-mark) { display: none; }
  .atlas-main h2 { margin-top: 34px; }
  .country-grid { grid-template-columns: 1fr; }
  .topbar { padding: 10px 14px; gap: 8px; }
  .brand span:not(.brand-mark) { display: none; }
  .wrap { padding: 0 14px; }
  .hero { padding: 34px 0 22px; }
  .hero-logo { width: 56px; height: 56px; border-radius: 17px; margin-bottom: 18px; }
  .hero-logo svg { width: 33px; height: 33px; }
  /* the smallest tiles are just noise at this size, and the big ones sit too
     close to the type, so thin the layer out rather than scale it */
  .hero-flag.l1 { display: none; }
  .hero-flag.l3 { opacity: calc(var(--flag-a3) * .62); }
  .region { padding: 7px 11px; font-size: 12.5px; }
  .launch { padding: 18px; margin-top: 26px; }
  .btn-play { height: 54px; }
  .nav button { padding: 6px 11px; font-size: 13px; }
  .chip { display: none; }
  .section-head { flex-wrap: wrap; }
  .quiz { padding: 18px 14px 48px; }
  .question { margin: 20px 0 16px; }
  .opt { min-height: 56px; font-size: 15.5px; }
  .result { padding: 40px 16px; }
  .section { padding: 22px 0 34px; }
  .map-float { right: 8px; bottom: 8px; }
  .legend { font-size: 11.5px; gap: 10px; }
  .map-shell { border-radius: var(--r-lg); }
  .map-shell::before { inset: 5px; border-radius: calc(var(--r-lg) - 5px); }
}

@media (max-width: 420px) {
  .options.flags { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .opt-flag { padding: 9px; }
  .level { padding: 11px 5px; }
  .level .name { font-size: 12.5px; }
  .sheet-foot { flex-wrap: wrap; }
}

/* The universal selector does not reach pseudo elements, and the Play button's
   drift is an infinite animation on one, so both have to be named explicitly. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .wm-ring { display: none; }
  .btn-play::after { display: none; }
}
