/* The World Capitals look: a full-bleed map, the name top-centre, the country list and the view card down the left,
   the settings on the right (sheets on phones). The sizes, fonts and gaps here are World Capitals' own, rule for
   rule: a change to how one of the two looks is made in both. What is this tool's own: the country list (wider than
   the regions list, for the names) and its filter. */

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; }
button, input { font: inherit; }

#map { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; outline: none; }

.ui {
  position: fixed; inset: 0; pointer-events: none;
  padding-block: calc(env(safe-area-inset-top, 0px) + 14px) calc(env(safe-area-inset-bottom, 0px) + 14px);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid; gap: 12px;
  grid-template-columns: minmax(248px, 1fr) minmax(0, calc(560px * var(--card-w, 1))) minmax(322px, 1fr);   /* (322: the settings' width, so they never cover the name, as in the shell) */
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.glass { background: var(--panel); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: var(--r); }
.label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }   /* (a card's title, a settings row's title) */
/* 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; }

/* brand */
.brand { grid-column: 1; grid-row: 1; align-self: start; justify-self: start; display: grid; gap: 5px; min-width: 0; text-shadow: 0 1px 10px rgba(5, 8, 11, 0.85); }
.lockup { display: flex; align-items: center; gap: 11px; min-width: 0; }
.home { display: inline-flex; color: var(--scan); flex: none; border-radius: 4px; }
.home svg { height: 21px; width: auto; filter: drop-shadow(0 1px 5px rgba(5, 8, 11, 0.85)); }
.mark { direction: ltr; font-weight: 800; font-stretch: 125%; letter-spacing: -0.01em; font-size: 20px; color: var(--bone); line-height: 1; white-space: nowrap; }
.mark span { color: var(--scan); }
.mark sup { font-family: var(--f-mono); font-size: 9.5px; font-weight: 600; letter-spacing: 0.1em; color: var(--close); border: 1px solid currentColor; border-radius: 4px; padding: 1px 4px; margin-inline-start: 6px; vertical-align: 6px; text-shadow: none; filter: drop-shadow(0 1px 3px rgba(5, 8, 11, 0.9)); }
/* the small line under the name is thin and grey: over land it needs a closer, denser shadow than the name */

/* prompt */
.prompt { grid-column: 2; grid-row: 1 / 3; align-self: start; justify-self: center; width: 100%; box-sizing: border-box; padding: 12px 18px; display: grid; gap: 4px; text-align: center; position: relative; }
.prompt.glass { border-color: var(--line-strong); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }   /* (the name's card) */
.prompt.is-ok { border-color: var(--ok); }
.prompt.is-bad { border-color: var(--bad); }
.prompt.is-close { border-color: var(--close); }

.pname { font-weight: 750; font-stretch: 112%; font-size: calc(clamp(22px, 2.6vw, 34px) * var(--card-scale, 1)); line-height: 1.1; color: var(--bone); text-wrap: balance; overflow-wrap: anywhere; overflow: visible; }   /* (a long name wraps: never cut) */
.pmeta { font-family: var(--f-mono); font-size: calc(11.5px * var(--card-soft, 1)); min-height: 1.3em; color: var(--muted); font-variant-numeric: tabular-nums; }

.answer { display: flex; gap: 6px; margin-top: 8px; }
.answer input { flex: 1; min-width: 0; font-size: 16px; color: var(--fg); background: var(--bg); text-align: center; border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 12px; }

.row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

/* stats */
.stats { grid-column: 3; grid-row: 1; align-self: start; justify-self: end; display: flex; gap: 6px; }

/* country list */
.left { grid-column: 1; grid-row: 2 / 4; justify-self: start; width: 100%; max-width: 290px; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 10px; min-height: 0; }   /* (290: wider than the other atlases' 248, for the country names) */
.countries { display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 8px; padding: 10px 8px; min-height: 0; }
.countries > .label { margin: 2px 4px 0; }
.countries input { width: 100%; box-sizing: border-box; font-size: 13px; color: var(--fg); background: var(--bg); border: 1px solid var(--line-strong); border-radius: 7px; padding: 8px 10px; }
.countries input:focus { outline: none; border-color: var(--scan); }
.list { overflow-y: auto; overscroll-behavior: contain; min-height: 0; margin-inline-end: -6px; padding-inline-end: 6px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.list h3 { position: sticky; top: 0; z-index: 1; margin: 0; background: #0f171e; }
.list h3 button { width: 100%; display: flex; justify-content: space-between; align-items: center; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--scan); font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; padding: 8px 4px 6px; cursor: pointer; }
.list h3 button em { font-style: normal; color: var(--muted); letter-spacing: 0; }
.list ul { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 2px; }
.list li button { width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; text-align: start; background: transparent; color: var(--fg); border: 1px solid transparent; border-radius: 7px; padding: 7px 9px; font-weight: 650; font-size: 13.5px; cursor: pointer; }
.list li button em { font-style: normal; font-family: var(--f-mono); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.list li button:hover { background: var(--bg-lift); }
.list li button[aria-pressed="true"] { border-color: var(--scan); background: rgba(111, 208, 232, 0.09); }
.list li button[aria-pressed="true"] em { color: var(--scan); }
.list .none { color: var(--muted); font-size: 12px; line-height: 1.45; padding: 4px 4px 10px; margin: 0; }
.viewcard { padding: 10px 10px 11px; display: grid; gap: 8px; }

/* (Names: every region's name on the map, in Explore) */
.voice-btn { font-size: 11.5px; font-weight: 600; color: var(--muted); background: transparent; cursor: pointer; border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px 9px 2px 7px; display: inline-flex; align-items: center; gap: 6px; }

.voice-btn[aria-pressed="true"] i { background: var(--scan); }
.voice-btn:disabled { border-style: dashed; color: var(--line-strong); border-color: var(--line-strong); cursor: default; }
.voice-btn:disabled i { background: var(--line); }
.vc-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.vc-tools .btn { padding: 6px 4px; font-size: 12px; white-space: nowrap; min-width: 0; overflow-wrap: anywhere; }

/* settings */
.right { grid-column: 3; grid-row: 2 / 4; justify-self: end; align-self: start; width: 322px; max-height: 100%; overflow-y: auto; box-sizing: border-box; scrollbar-gutter: stable; padding: 14px; display: grid; gap: 16px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

.seg button { font-weight: 600; font-size: 13px; color: var(--muted); background: transparent; border: 0; border-radius: 6px; padding: 7px 6px; cursor: pointer; }

.hint a { color: var(--fg); }
.credit a { color: var(--muted); text-underline-offset: 2px; }   /* (after .hint a: the credits are a hint too) */
.credit a:hover { color: var(--fg); }
.keys { font-family: var(--f-mono); font-size: 11px; color: var(--muted); line-height: 1.9; margin: 0; }
kbd { font-family: var(--f-mono); font-size: 10.5px; border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 4px; color: var(--fg); }
.btn { font-size: 12.5px; font-weight: 600; color: var(--fg); background: var(--bg-lift); border: 1px solid var(--line-strong); border-radius: 7px; padding: 7px 10px; cursor: pointer; }

/* Images mode (I): the row of picture buttons in the name card, as on World Capitals */
.pinbar { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; align-items: center; margin-top: 6px; }

/* A row's title with its "i" beside it (what the row does: app.js shows it in .helpbox, floating, so nothing moves) */

   /* (easier to hit than it looks) */

   /* (the one in use) */
/* (a row that doesn't apply in this mode: the kind of question, in Explore) */
.right section.is-off .label, .right section.is-off .seg button { color: var(--line-strong); }
.right section.is-off .seg { border-style: dashed; }
.right section.is-off .seg button { cursor: default; background: none; box-shadow: none; }

/* Preferences and Keys (dialogs) */

/* the first-visit card (as in the other atlases) */

.start-modes button { display: grid; gap: 3px; text-align: start; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 10px; color: var(--fg); cursor: pointer; }

.right section.is-off .seg button[aria-pressed="true"] { color: var(--muted); }
.right .best { margin-top: 8px; font-family: var(--f-mono); font-size: 12px; line-height: 1.5; color: var(--muted); font-variant-numeric: tabular-nums; }   /* (under the buttons: one line where it fits on one) */
/* The result of a round stands in the name's place, not on a card over the map (so the map, coloured by how it
   went, stays in view): the score, big; the time, the accuracy and the longest streak in three boxes beside it; Go
   again, with Practise the misses beside it when there are any; then the key to the colours. While it shows, the
   name's own lines make way (.prompt.is-review) and the score boxes at the top are off (on a phone, where they sit
   right under it, they go: body.reviewing). The same in every atlas: a change here is made in all three stylesheets. */

.prompt > .pill { position: absolute; top: 10px; inset-inline-end: 18px; }

.res-main { display: flex; align-items: center; gap: 18px; }

.res-score b { font-weight: 800; font-size: 68px; color: var(--bone); }
.res-score span { font-weight: 700; font-size: 28px; color: var(--muted); }

.res-actions .btn { flex: 1 1 0; min-width: 0; padding: 11px 14px; font-size: 14px; font-weight: 700; border-radius: 9px; }

 
 
 
.res-foot .rhint { margin: 0; margin-inline-start: auto; font-size: 12.5px; color: var(--muted); }

@media (max-width: 900px) {
  
  .prompt > .pill { top: 7px; inset-inline-end: 14px; }
  .res-main { gap: 12px; }
  .res-score b { font-size: 52px; } .res-score span { font-size: 22px; }
  .res-actions .btn { padding: 10px 8px; font-size: 13px; }
  .res-foot .rhint { display: none; }
}
.right .best:empty::before, .right .know:empty::before { content: "\00a0"; }   /* (the globe, with no country open: the line keeps its room, so the panel doesn't grow when one is opened) */
   /* ("You know 12 of 51": under the best line, always there in a country) */
#quizRow { display: contents; }

.overlay { position: fixed; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; z-index: 20; background: rgba(6, 10, 14, 0.62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); padding-inline: 16px; }

.wide-only { }
/* Previous and Next (Explore) stand either side of the name, level with its middle: round buttons beside a card, the
   arrows alone where the name has no card. Where there is no room beside the name (app.js says: body.flank-in, and
   always on a phone) they sit inside its edges. */
.flank { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; padding: 0; display: grid; place-items: center; color: var(--fg); background: var(--panel); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid var(--line-strong); border-radius: 50%; cursor: pointer; }

.flank.prev { inset-inline-start: -52px; }
.flank.next { inset-inline-end: -52px; }

/* (in Explore the score stays where it is, greyed out: nothing appears or goes as the mode changes) */

/* The name's size (Preferences): the name grows with --card-scale, saved for every atlas on the site. Its place: at
   the top or under the map (Top, Bottom). Its style: Card, or Gradient (body.name-flat; the map tools start with
   Card): no card, the name straight on the map, on a dark bar that fades into the map, so the name reads whatever is
   behind it. app.js sets where the bar ends and how long the fade is (--run); the steps ease it in so no edge shows.
   At the top the name keeps a little room above it, and an answer flashes the small line over the name green, red,
   or yellow for a misspelling, as a card's frame does. */
body { --card-soft: calc(0.5 + 0.5 * var(--card-scale, 1)); }

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

body.name-flat .flank svg { width: 26px; height: 26px; }

@media (min-width: 901px) {
     /* (Preferences: Bottom. The name under the map) */
  body.name-flat .prompt { margin-top: 12px; }
  
  
}

/* bottom: the sheet buttons on phones */
.dock { grid-column: 2; grid-row: 3; justify-self: center; align-self: end; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; min-height: 36px; }   /* (its row keeps its height where it has no button, so nothing changes size with the mode) */
.dock .btn { background: var(--panel); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 9px 14px; font-size: 13px; }
.only-phone { display: none; }
.sheet-close { display: none; }
/* Clean view (C): the map and the name alone, for showing or filming it */
body.clean .left, body.clean .right, body.clean .brand .sub, body.clean .flank, body.clean .dock .btn:not(#cleanExit) { display: none !important; }

/* shorter laptop screens (940px of height and less, as in the other atlases): the left cards sit a little closer */
@media (min-width: 901px) and (max-height: 940px) {
  .left { gap: 8px; }
  .countries { padding-block: 7px; }
  .list li button { padding: 5px 9px; }
  .vc-tools .btn { padding-block: 5px; }
}
/* (a short window: the settings' rows sit a little closer, so the panel needn't scroll) */
@media (min-width: 901px) and (max-height: 760px) {
  .right { gap: 11px; padding-block: 11px; }
  .right .sec-h { margin-bottom: 5px; }
}

  

.loading { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 9; }
.loading div { text-align: center; display: grid; gap: 8px; padding: 24px; }
.loading b { font-weight: 800; font-stretch: 118%; font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--scan); }
.loading span { color: var(--muted); }

@media (max-width: 900px) {
  .ui { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr) auto; gap: 8px; }
  /* a slim logo row on top, the name, the score, then the map (as in the other atlases) */
  .brand { grid-column: 1; grid-row: 1; justify-self: center; }
  .lockup { gap: 9px; }
  .home svg { height: 16px; }
  .mark { font-size: 15px; }
  .keys { display: none; }
  .countries { grid-template-rows: auto auto auto minmax(0, 1fr); }
  .prompt { grid-column: 1; grid-row: 2; align-self: stretch; padding: 10px 14px; }
  /* (Previous and Next are inside the card's edges) */
  
  .flank { width: 38px; height: 44px; background: none; border-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
  body.name-flat .flank svg { width: 20px; height: 20px; }
  .flank.prev { inset-inline-start: 3px; }
  .flank.next { inset-inline-end: 3px; }
  .wide-only { display: none !important; }
  .pname { font-size: calc(clamp(19px, 5.6vw, 26px) * var(--card-scale, 1)); }
  .stats { grid-column: 1; grid-row: 3; justify-self: center; }
  .dock { grid-column: 1; grid-row: 5; }
  .dock .btn { padding: 9px 12px; }
  .only-phone { display: inline-block; }
  /* the countries (with the view buttons) and the settings are bottom sheets */
  .left, .right { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; justify-self: stretch; width: auto; max-width: none; max-height: 72vh; box-sizing: border-box; border-radius: 16px 16px 0 0; border: 1px solid var(--line); border-bottom: 0; background: var(--panel); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding-block: 16px calc(env(safe-area-inset-bottom, 0px) + 16px); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); transform: none; transition: none; }   /* (shown and hidden, not slid as the shell's sheets are) */
  body.sheet-countries .left { display: grid; height: 72vh; }
  body.sheet-options .right { display: grid; }
  .left .glass { background: none; border: 0; padding: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .sheet-close { display: block; justify-self: end; }
  .list li button { padding: 9px 8px; font-size: 15px; }
  body.sheet-countries .dock, body.sheet-options .dock { visibility: hidden; }
}
/* ---------- spinning globe (S on the world globe, not in the key hints): everything but the globe fades away ---------- */
.ui { transition: opacity .4s; }
body.spinning .ui, body.spinning .toast { opacity: 0; visibility: hidden; transition: opacity .5s, visibility 0s .5s; }

