/* World Capitals' own look, after the shell every tool shares (../shell/shell.css): the globe and the map, the typed
   answer, its own rows. A few of the shell's values are put back here where this page has always differed (its
   segments are a grid, its zoom chips wrap rather than cut). World Countries and World Flags are made from this page. */
/* Same look as Bone Atlas: a full-bleed stage (here a globe or a flat map), the prompt tag top-centre,
   regions and view controls down the left, settings on the right (bottom sheets on phones). */
:root {
  --bg: #0a0f14;
  --bg-lift: #121b23;
  --panel: rgba(13, 20, 27, 0.86);
  --line: #223140;
  --line-strong: #33475a;
  --fg: #e8edf0;
  --muted: #8d9ca9;
  --bone: #ecdec2;
  --scan: #6fd0e8;
  --ok: #5fd39a;
  --bad: #ff7a6b;
  --close: #f5d04e; /* Easy typing: right but misspelled */
  --f-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r: 10px;
  color-scheme: dark;
}

html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-display);
  font-size: 14px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
#stage {
  position: fixed; inset: 0;
  background: radial-gradient(120% 80% at 50% 45%, #121e28 0%, #0d151c 45%, var(--bg) 78%);
}
#stage canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
#fx, #labels { pointer-events: none; }
#stage.hovering #map { cursor: pointer; }
#stage.dragging #map { cursor: grabbing; }

/* name callout pinned to a capital (Study, the reveal in Practice, review) */
#leader { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
#leader line { stroke: var(--scan); stroke-width: 1.5; }
.callout {
  position: fixed; left: 0; top: 0; pointer-events: none; white-space: nowrap;
  background: var(--panel); border: 1px solid var(--scan); border-radius: 6px;
  color: var(--bone); font-weight: 700; font-stretch: 106%; font-size: 14px; padding: 5px 10px;
}
.callout small { display: block; font-weight: 500; font-size: 11.5px; color: var(--muted); font-stretch: 100%; }
/* World Flags runs on this page code: its flags in the prompt and the callout (nothing here uses them) */
.callout img.flag { display: block; height: 30px; width: auto; margin-bottom: 5px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(236, 222, 194, 0.3); }
.pname img.flag { height: 0.9em; width: auto; vertical-align: -0.08em; margin-inline-end: 0.35em; border-radius: 2px; box-shadow: 0 0 0 1px rgba(236, 222, 194, 0.3); }
.pname.flag-only { line-height: 1 !important; padding: 3px 1px; }
.pname.flag-only img.flag { height: 2.2em; margin: 0; vertical-align: top; }

/* The name card's size (Preferences): the name grows with --card-scale, saved for every atlas on the site */
body { --card-soft: calc(0.5 + 0.5 * var(--card-scale, 1)); }   /* (the card's small print grows half as fast as the name) */

/* ---------- brand ---------- */
.brand {
  grid-column: 1; grid-row: 1; align-self: start; justify-self: start; display: grid; gap: 5px; min-width: 0;
  /* a soft shadow behind the words and the logo, as on every tool, so the name stays readable when land is behind it */
  text-shadow: 0 1px 10px rgba(5, 8, 11, 0.85);
}

/* ---------- prompt tag ---------- */
.prompt {
  grid-column: 2; grid-row: 1 / 3; align-self: start; justify-self: center; width: 100%; box-sizing: border-box;
  background: var(--panel); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line-strong); border-radius: var(--r);
  padding: 12px 18px; display: grid; gap: 4px; text-align: center; position: relative;
}
/* Arabic, Persian and Urdu letters join: spacing them out, or a monospaced font, breaks the words */
:is(html[lang=ar], html[lang=fa], html[lang=ur]) { --f-mono: system-ui, sans-serif; }
:is(html[lang=ar], html[lang=fa], html[lang=ur]) * { letter-spacing: 0 !important; }

.ptip { font-size: 12.5px; line-height: 1.45; color: var(--muted); max-width: 62ch; justify-self: center; text-wrap: pretty; margin-top: 2px; min-height: 0; }

.pbar.is-off { visibility: hidden; }

/* What goes with the name (a tip, the answer box, the results) hangs under it, over the map, as the card's lower
   half. With the name under the map (Preferences: Bottom) it is part of the name's block, so that grows upward. */
.pmore {
  position: absolute; left: -1px; right: -1px; top: calc(100% - 1px); z-index: 2;
  background: var(--panel); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line-strong); border-top: 0; border-radius: 0 0 var(--r) var(--r);
  padding: 2px 18px 12px; display: grid; gap: 6px;
}
.prompt.has-more { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-color: transparent; }
.prompt.is-ok, .prompt.is-ok .pmore { border-color: var(--ok); }
.prompt.is-bad, .prompt.is-bad .pmore { border-color: var(--bad); }
.prompt.is-close, .prompt.is-close .pmore { border-color: var(--close); }
.prompt.has-more.is-ok, .prompt.has-more.is-bad, .prompt.has-more.is-close { border-bottom-color: transparent; }

body.name-flat .prompt, body.name-flat .prompt .pmore { background: none; border-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }

body.name-flat .prompt.is-close .eyebrow { color: var(--close); }

body.name-flat:not(.spinning) .card-fade { display: block; position: fixed; left: 0; right: 0; top: 0; height: 34vh; pointer-events: none; background: linear-gradient(to top, rgba(5, 8, 11, 0) 0, rgba(5, 8, 11, 0.02) calc(var(--run, 160px) * 0.15), rgba(5, 8, 11, 0.07) calc(var(--run, 160px) * 0.3), rgba(5, 8, 11, 0.18) calc(var(--run, 160px) * 0.45), rgba(5, 8, 11, 0.36) calc(var(--run, 160px) * 0.6), rgba(5, 8, 11, 0.58) calc(var(--run, 160px) * 0.75), rgba(5, 8, 11, 0.77) calc(var(--run, 160px) * 0.88), rgba(5, 8, 11, 0.9) calc(var(--run, 160px) * 1), rgba(5, 8, 11, .97) 100%); }
@media (min-width: 901px) {
     /* (Preferences: Bottom. The name under the map) */
  body.card-bottom .prompt .pmore { position: static; background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 4px 0 0; }
  body.card-bottom:not(.name-flat) .prompt.has-more { border-radius: var(--r); border-bottom-color: var(--line-strong); }
  body.name-flat .prompt { margin-top: 12px; }
  
  body.name-flat.card-bottom:not(.spinning) .card-fade { bottom: 0; top: 60vh; height: auto; background: linear-gradient(to bottom, rgba(5, 8, 11, 0) 0, rgba(5, 8, 11, 0.02) calc(var(--run, 300px) * 0.15), rgba(5, 8, 11, 0.07) calc(var(--run, 300px) * 0.3), rgba(5, 8, 11, 0.18) calc(var(--run, 300px) * 0.45), rgba(5, 8, 11, 0.36) calc(var(--run, 300px) * 0.6), rgba(5, 8, 11, 0.58) calc(var(--run, 300px) * 0.75), rgba(5, 8, 11, 0.77) calc(var(--run, 300px) * 0.88), rgba(5, 8, 11, 0.9) calc(var(--run, 300px) * 1), rgba(5, 8, 11, .97) 100%); }
}

/* typed answers */
.answer { display: flex; gap: 6px; margin-top: 2px; }
.answer input {
  flex: 1; min-width: 0; font: inherit; font-size: 16px; color: var(--fg); background: var(--bg); text-align: center;
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 12px;
}
.answer input:focus { outline: none; border-color: var(--scan); }
.answer input.is-bad { border-color: var(--bad); }
.answer .btn { flex: none; }
/* Images mode buttons */
.pinbar { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; align-items: center; margin-top: 2px; }
.pinsize { display: inline-flex; align-items: center; gap: 4px; margin-inline-start: 4px; font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.pinsize .btn { padding: 5px 10px; line-height: 1; }

.prompt.is-review .pmore { padding-top: 6px; }

.res-foot .bad i { background: var(--bad); } .res-foot .bad b { color: var(--bad); }

.rail button {
  font: inherit; color: var(--fg); background: transparent; border: 1px solid transparent; border-radius: 7px;
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px; text-align: start; cursor: pointer;
  padding: 7px 9px; font-size: 13.5px; font-weight: 650;
}

/* subregions, listed under their continent */
.rail button.sub { margin-inline-start: 12px; padding-block: 5px; font-size: 12.5px; font-weight: 600; }

/* (desktop: the columns either side run down past the row of buttons under the model, to the bottom of the window:
   more room for the region list and the settings, and their height doesn't depend on what that row holds) */

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 3px; }
.seg button { font: inherit; font-weight: 600; font-size: 13px; color: var(--muted); background: transparent; border: 0; border-radius: 6px; padding: 7px 6px; cursor: pointer; flex: 0 1 auto; white-space: normal; }

#search { width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; color: var(--fg); background: var(--bg); border: 1px solid var(--line-strong); border-radius: 7px; padding: 8px 10px; }
#search:focus { outline: none; border-color: var(--scan); }
.results-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; max-height: 190px; overflow-y: auto; }
.results-list button { width: 100%; text-align: start; font: inherit; font-size: 12.5px; color: var(--fg); background: transparent; border: 0; border-radius: 6px; padding: 6px 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.results-list button span:last-child { color: var(--muted); }
.results-list button:hover { background: var(--bg-lift); }

   /* ("You know 41 of 206": under the best line, always there, so nothing appears as answers come in) */

#search:disabled { border-style: dashed; opacity: .5; }

   /* (its row keeps its height in Explore, where it has no button, so the columns beside the map don't change size with the mode) */
.dock .btn { background: var(--panel); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 9px 14px; font-size: 13px; line-height: normal; }

.names-btn[aria-pressed="true"] i { background: var(--scan); animation: none; }

.vc-head h3 { margin: 0; margin-inline-start: 4px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

.zp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.zchip {
  font: inherit; font-size: 12.5px; color: var(--fg); background: transparent; border: 1px solid var(--line); border-radius: 7px;
  padding: 4px 8px; cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; gap: 6px; text-align: start; white-space: nowrap; min-width: 0;
}
/* a longer name in another language wraps rather than pushing the card wider */
.zchip span { white-space: normal; min-width: 0; overflow-wrap: anywhere; overflow: visible; text-overflow: clip; }

.vc-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; flex-wrap: nowrap; }
.viewcard #search { margin-top: 1px; }
.vc-tools .btn { padding: 6px 4px; font-size: 12px; white-space: nowrap; min-width: 0; flex: 0 1 auto; }
.vc-tools .btn, .viewcard .seg button { overflow-wrap: anywhere; }
html:not([lang="en"]) .vc-tools .btn { white-space: normal; } 

/* shorter laptop screens (940px of height and less, as in the 3D atlases): tighten the regions and the view card */
@media (min-width: 901px) and (max-height: 940px) {

  .rail button { padding: 5px 9px; }
  
  .zchip { padding-block: 3px; }
  
  .vc-tools .btn { padding-block: 5px; }
}
/* (a short window: the settings' rows sit a little closer, so the panel needn't scroll) */

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 72px);
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 8px 16px; font-size: 13.5px; max-width: min(560px, calc(100% - 32px)); text-align: center; box-sizing: border-box;
  opacity: 0; transition: opacity .2s ease; pointer-events: none; z-index: 12;
}

.toast.close { border-color: var(--close); }

#loading .card { text-align: center; }

#loading progress { width: 100%; height: 6px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 3px; background: var(--line); }
#loading progress::-webkit-progress-bar { background: var(--line); border-radius: 3px; }
#loading progress::-webkit-progress-value { background: var(--scan); border-radius: 3px; }
#loading progress::-moz-progress-bar { background: var(--scan); }

/* ---------- clean recording view ---------- */
body.clean .panel, body.clean .leftcol, body.clean .brand .sub, body.clean .flank, body.clean .dock .btn:not(#cleanExit) { display: none !important; }

/* ---------- spinning globe (S on the globe, not in the key hints): everything but the globe fades away ---------- */
.ui, #leader { transition: opacity .4s; }
body.spinning .ui, body.spinning .callout, body.spinning #leader { opacity: 0; visibility: hidden; transition: opacity .5s, visibility 0s .5s; }

/* ---------- phones / narrow ---------- */
@media (max-width: 900px) {
  
  .brand { grid-column: 1; grid-row: 1; justify-self: center; }

  .prompt { grid-column: 1; grid-row: 2; align-self: stretch; padding: 10px 14px; z-index: 3; }

  .wide-only { display: none !important; }
  .pmore { padding: 2px 14px 10px; }
  .prompt.is-review .pmore { background: var(--bg-lift); }   /* (a result lies over the row of regions: solid, so they don't show through the numbers) */
  /* (Gradient: what hangs under the name lies over the score and the row of regions: the dark bar goes on down behind it) */
  body.name-flat .prompt .pmore { left: -16px; right: -16px; padding: 0 30px 22px; background: linear-gradient(to bottom, rgba(5, 8, 11, .97) calc(100% - 22px), rgba(5, 8, 11, 0)); }
  
  .ptip { font-size: 12px; }

  .rail button { flex: none; background: var(--panel); border-color: var(--line); white-space: nowrap; padding: 6px 10px; font-size: 13px; }
  .rail button.sub { margin-inline-start: 0; font-size: 12px; font-weight: 600; }
  
  .dock .btn { padding: 9px 12px; }

  .zp-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 5px; }
  .zchip { padding: 8px 9px; }

  .callout { font-size: 13px; }
}

