/* Worldsearch — the globe fills the window, everything else floats over it. */

:root {
  /* Title-safe inset. Zero on a monitor; a real margin once a controller is
     driving, because televisions overscan and anything within a few percent of
     the edge can be physically off the panel. Consoles require it. */
  --tv-safe: 0px;
  --ink: #eaf2ff;
  --ink-dim: #93a7c4;
  --cyan: #43e8ff;
  --gold: #ffcc4d;
  --panel: rgba(10, 18, 32, 0.82);
  --panel-line: rgba(120, 175, 235, 0.22);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --r: 16px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #050914;
  color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  /* The globe handles its own gestures; browser pan/zoom on top of that fights
     the camera and, on iOS, bounces the whole page. */
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

#globe {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

.hidden { display: none !important; }

/* ── loading ─────────────────────────────────────────────────────────────── */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 50% 40%, #0d1a30 0%, #050914 70%);
  transition: opacity 0.6s ease;
}
.overlay.out { opacity: 0; pointer-events: none; }

.loading-inner { text-align: center; width: min(320px, 78vw); }

.wordmark {
  margin: 0 0 22px;
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 700;
  letter-spacing: 0.42em;
  text-indent: 0.42em; /* letter-spacing pads the right; this re-centres it */
  color: var(--ink);
}

.progress {
  height: 3px;
  border-radius: 3px;
  background: rgba(120, 175, 235, 0.16);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--cyan), #8ad4ff);
  transition: width 0.35s ease;
}

.loading-note {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--ink-dim);
}

/* ── HUD ─────────────────────────────────────────────────────────────────── */

#hud {
  position: fixed;
  top: calc(var(--safe-t) + 14px + var(--tv-safe));
  left: calc(14px + var(--tv-safe));
  z-index: 20;
  display: flex;
  gap: 8px;
}

.stat {
  min-width: 72px;
  padding: 8px 12px 9px;
  border: 1px solid var(--panel-line);
  border-radius: 12px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.stat-value {
  display: block;
  margin-top: 2px;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

#stat-streak-wrap.hot .stat-value { color: var(--gold); }

/* A controller means a television, in all likelihood: inset everything into the
   title-safe area and enlarge the touch-free furniture a little for couch
   distance. */
html.pad-active {
  --tv-safe: 2.5vmin;
}
html.pad-active .stat-value { font-size: 23px; }
html.pad-active .stat-label { font-size: 11px; }
html.pad-active .prompt-name { font-size: clamp(21px, 4.6vw, 29px); }
html.pad-active .prompt-hint { font-size: 13.5px; }

/* ── controller reticle ──────────────────────────────────────────────────── */

#reticle {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 15;
  margin: -24px 0 0 -24px;
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
  transition: opacity 0.2s ease;
}

/* Focus ring for controller and keyboard navigation. The game is playable on a
   TV from across a room, so this has to be visible at a glance rather than the
   hairline outline a mouse user never looks for. */
:focus-visible,
.gp-focus {
  outline: 2px solid var(--cyan) !important;
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(67, 232, 255, 0.18) !important;
}

.gp-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  margin-right: 5px;
  padding: 0 5px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  opacity: 0.85;
  vertical-align: middle;
}

/* ── prompt ──────────────────────────────────────────────────────────────── */

#prompt {
  position: fixed;
  top: calc(var(--safe-t) + 14px + var(--tv-safe));
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  padding: 10px 22px 12px;
  border: 1px solid var(--panel-line);
  border-radius: var(--r);
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  text-align: center;
  max-width: min(440px, calc(100vw - 28px));
  animation: drop 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes drop {
  from { opacity: 0; transform: translate(-50%, -14px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.prompt-kicker {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
}

.prompt-name {
  display: block;
  margin-top: 1px;
  font-size: clamp(19px, 4.6vw, 25px);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.prompt-hint {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--ink-dim);
}

/* ── result ──────────────────────────────────────────────────────────────── */

#result {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-b) + 18px + var(--tv-safe));
  transform: translateX(-50%);
  z-index: 20;
  width: min(420px, calc(100vw - 28px));
  padding: 16px 18px 18px;
  border: 1px solid var(--panel-line);
  border-radius: var(--r);
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  animation: rise 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes rise {
  from { opacity: 0; transform: translate(-50%, 18px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.result-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.result-band {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.result-band[data-key="bullseye"],
.result-band[data-key="pinpoint"] { color: var(--gold); }
.result-band[data-key="wayoff"]   { color: #ff8a8a; }

.result-points {
  font-size: 21px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--cyan);
}

.result-dist {
  margin-top: 2px;
  font-size: 14px;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}

.result-detail {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid rgba(120, 175, 235, 0.14);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-dim);
}
.result-detail b { color: var(--ink); font-weight: 600; }
.result-detail b.lost { color: #ff8a8a; }

.btn {
  margin-top: 14px;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(180deg, #3ad2ea, #1ba7d4);
  color: #04121c;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.08s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }

kbd {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.22);
  font: inherit;
  font-size: 12px;
  opacity: 0.75;
}


/* ── modal, options, saves ───────────────────────────────────────────────── */

#modal { z-index: 60; background: rgba(3, 7, 15, 0.72); }
.modal-card { width: min(440px, 100%); text-align: left; }

.modal-title {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 700;
  text-align: center;
}
.modal-sub {
  margin: 0 0 16px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-dim);
  text-align: center;
}

.opts { display: grid; gap: 8px; margin: 16px 0 18px; }

.opt {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--panel-line);
  border-radius: 12px;
  background: rgba(8, 16, 30, 0.5);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.opt:hover { border-color: rgba(67, 232, 255, 0.4); }
.opt-text { flex: 1; min-width: 0; }
.opt-label { display: block; font-size: 14px; font-weight: 600; }
.opt-note { display: block; margin-top: 2px; font-size: 11.5px; line-height: 1.4; color: var(--ink-dim); }

.switch {
  flex: none;
  width: 42px;
  height: 24px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 0 0 1px rgba(120, 175, 235, 0.2);
  transition: background 0.18s ease;
}
.switch .knob {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ink-dim);
  transition: transform 0.18s ease, background 0.18s ease;
}
.switch.on { background: linear-gradient(180deg, #3ad2ea, #1ba7d4); }
.switch.on .knob { transform: translateX(18px); background: #04121c; }

/* save slots */

.slots { display: grid; gap: 7px; margin: 4px 0 16px; }

.slot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--panel-line);
  border-radius: 11px;
  background: rgba(8, 16, 30, 0.5);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.slot:hover { border-color: rgba(67, 232, 255, 0.45); }
.slot-n {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(67, 232, 255, 0.14);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}
.slot-text { flex: 1; min-width: 0; }
.slot-desc { display: block; font-size: 13px; }
.slot-when { display: block; font-size: 11px; color: var(--ink-dim); }
.slot-action { flex: none; font-size: 11px; color: var(--cyan); }

.modal-actions { display: grid; gap: 7px; }

/* continue list on the menu */

.saves { margin-bottom: 18px; text-align: left; }
.saves-title {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  text-align: center;
}
.save { display: flex; gap: 6px; margin-bottom: 6px; }
.save-main {
  flex: 1;
  padding: 10px 13px;
  border: 1px solid rgba(67, 232, 255, 0.3);
  border-radius: 11px;
  background: rgba(16, 34, 52, 0.6);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.save-main:hover { border-color: rgba(67, 232, 255, 0.6); }
.save-desc { display: block; font-size: 13px; font-weight: 600; }
.save-when { display: block; font-size: 11px; color: var(--ink-dim); }
.save-del {
  flex: none;
  width: 38px;
  border: 1px solid var(--panel-line);
  border-radius: 11px;
  background: transparent;
  color: var(--ink-dim);
  cursor: pointer;
}
.save-del:hover { color: #ff8a8a; border-color: rgba(255, 138, 138, 0.4); }

.link-btn {
  margin-top: 16px;
  padding: 6px 14px;
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-dim);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.link-btn:hover { color: var(--ink); border-color: rgba(67, 232, 255, 0.45); }

/* ── attribution ─────────────────────────────────────────────────────────── */

#attribution {
  position: fixed;
  left: calc(14px + var(--tv-safe));
  bottom: calc(var(--safe-b) + 8px + var(--tv-safe));
  z-index: 10;
  font-size: 10px;
  color: rgba(147, 167, 196, 0.5);
  pointer-events: none;
}



/* ── difficulty ──────────────────────────────────────────────────────────── */

.difficulty { margin-bottom: 22px; }

.difficulty-label {
  display: block;
  margin-bottom: 7px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--panel-line);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.35);
}

.seg {
  padding: 6px 18px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-dim);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease;
}
.seg:hover { color: var(--ink); }
.seg.on {
  background: linear-gradient(180deg, #3ad2ea, #1ba7d4);
  color: #04121c;
}

.difficulty-note {
  display: block;
  margin-top: 7px;
  font-size: 11.5px;
  color: rgba(147, 167, 196, 0.72);
}

/* ── who runs the place ──────────────────────────────────────────────────── */

.leader {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 11px;
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(120, 175, 235, 0.14);
}

.leader-photo {
  width: 46px;
  height: 58px;
  flex: none;
  border: 1px solid rgba(120, 175, 235, 0.22);
  border-radius: 7px;
  object-fit: cover;
  /* Portraits arrive from every kind of source; a consistent crop and a slight
     desaturation stop the card looking like a ransom note. */
  filter: saturate(0.92);
  background: rgba(0, 0, 0, 0.3);
}

.leader-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }

.leader-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}
.leader-role {
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--ink-dim);
}
.leader-term {
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--cyan);
}

.leader-credit {
  margin: -4px 0 10px;
  font-size: 9.5px;
  line-height: 1.4;
  color: rgba(147, 167, 196, 0.55);
}

.leader-asof {
  margin: -6px 0 10px;
  font-size: 9.5px;
  color: rgba(147, 167, 196, 0.45);
}
/* Folded into the openable detail on phones, where every line costs globe. */
@media (max-width: 899px) {
  .leader-asof { display: none; }
  .facts.open .leader-asof { display: block; margin: 10px 0 0; }
  .leader { margin-bottom: 9px; padding-bottom: 9px; }
}

/* ── facts about the place ───────────────────────────────────────────────── */

.facts {
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid rgba(120, 175, 235, 0.14);
  /* Scrolls on its own so the score, the distance and the Next button are never
     pushed off the bottom of a phone screen by a long religion breakdown. */
  max-height: 34vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.facts:empty { display: none; }

/* Fades the last line out rather than guillotining it, so it reads as "there is
   more below" instead of as a rendering bug. */
.facts {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent 100%);
}

.facts::-webkit-scrollbar { width: 4px; }
.facts::-webkit-scrollbar-thumb {
  border-radius: 2px;
  background: rgba(120, 175, 235, 0.25);
}

.facts-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}
.facts-flag { font-size: 19px; line-height: 1; }
.facts-country { font-size: 14px; font-weight: 700; }
.facts-capital {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--ink-dim);
}

.facts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
}

.fact,
.fact-wide { display: flex; flex-direction: column; gap: 1px; }
.fact-wide { margin-top: 9px; }

.fk {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: rgba(147, 167, 196, 0.75);
}

.fv {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink);
}
.fv.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Collapsible detail. Wide screens have the room, so the toggle is hidden and
   the body is always open; phones start collapsed. */
.facts-toggle { display: none; }

@media (max-width: 899px) {
  .facts-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 4px;
    padding: 9px 11px;
    border: 1px solid var(--panel-line);
    border-radius: 10px;
    background: rgba(8, 16, 30, 0.5);
    color: var(--ink-dim);
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
  }
  .facts-toggle .chev { transition: transform 0.2s ease; }
  .facts.open .facts-toggle .chev { transform: rotate(180deg); }
  .facts-body { display: none; }
  .facts.open .facts-body { display: block; margin-top: 10px; }
}

/* ── full-screen panels (menu, game over) ────────────────────────────────── */

.screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  overflow-y: auto;
  /* Dark enough to read against, sheer enough that the globe still turns behind
     it — the menu should feel like it is sitting on the planet, not replacing it. */
  background: radial-gradient(ellipse at 50% 35%, rgba(9, 20, 38, 0.72) 0%, rgba(5, 9, 20, 0.93) 70%);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade 0.4s ease;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.screen-inner { width: min(560px, 100%); text-align: center; }

.screen-inner.card {
  padding: 26px 24px 24px;
  border: 1px solid var(--panel-line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

/* ── menu ────────────────────────────────────────────────────────────────── */

.menu-wordmark { margin-bottom: 6px; }

.menu-sub {
  margin: 0 0 26px;
  color: var(--ink-dim);
  font-size: 14px;
}

.modes { display: grid; gap: 10px; }

.mode {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 14px;
  padding: 15px 17px;
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  background: var(--panel);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.08s ease, background 0.15s ease;
}
.mode:hover {
  border-color: rgba(67, 232, 255, 0.5);
  background: rgba(16, 30, 50, 0.9);
}
.mode:active { transform: translateY(1px); }

.mode-name { font-size: 17px; font-weight: 700; }
.mode-tag { font-size: 12px; color: var(--cyan); }
.mode-blurb {
  grid-column: 1 / -1;
  margin-top: 5px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-dim);
}

.mode-best {
  align-self: center;
  text-align: right;
  font-size: 11px;
  color: var(--ink-dim);
  white-space: nowrap;
}
.mode-best b {
  display: block;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}

.menu-totals {
  margin: 22px 0 0;
  font-size: 12px;
  color: rgba(147, 167, 196, 0.72);
}

/* ── lives + quit ────────────────────────────────────────────────────────── */

.lives { letter-spacing: 2px; font-size: 15px; line-height: 1.55; }
.life-gone { opacity: 0.28; }
#stat-lives-wrap.low .stat-value { color: #ff8a8a; }

.icon-btn {
  align-self: stretch;
  width: 38px;
  border: 1px solid var(--panel-line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink-dim);
  font-size: 15px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover { color: var(--ink); border-color: rgba(67, 232, 255, 0.45); }

/* ── game over ───────────────────────────────────────────────────────────── */

.go-badge {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), #ffb020);
  color: #2a1c00;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.go-mode {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
}

.go-score {
  margin: 2px 0 0;
  font-size: clamp(44px, 12vw, 62px);
  font-weight: 800;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.go-sub { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-dim); }

.go-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 8px;
  margin-top: 20px;
}

.go-cell {
  padding: 10px 8px 11px;
  border: 1px solid rgba(120, 175, 235, 0.16);
  border-radius: 11px;
  background: rgba(8, 16, 30, 0.5);
}
.go-cell-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.go-cell-value {
  display: block;
  margin-top: 3px;
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.go-cell-note { display: block; font-size: 11px; color: var(--ink-dim); }

.go-section { margin-top: 20px; text-align: left; }
.go-h3 {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.go-regions { display: grid; gap: 6px; }

.go-region {
  display: grid;
  grid-template-columns: 104px 1fr 44px;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}
.go-region-name { color: var(--ink-dim); }
.go-region-bar {
  height: 6px;
  border-radius: 3px;
  /* Darker than the surrounding panel: an empty track that reads as light was
     being mistaken for a full bar. */
  background: rgba(0, 0, 0, 0.42);
  box-shadow: inset 0 0 0 1px rgba(120, 175, 235, 0.10);
  overflow: hidden;
}
.go-region-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--cyan), #8ad4ff);
}
.go-region-score {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.go-actions { display: grid; gap: 8px; margin-top: 22px; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--panel-line);
  color: var(--ink-dim);
}
.btn-ghost:hover { color: var(--ink); filter: none; border-color: rgba(67, 232, 255, 0.45); }

/* On anything wider than a phone the result card docks to the right, so the
   globe keeps the full height of the window and the reveal can zoom in close
   without pushing a pin off the top. */
@media (min-width: 900px) {
  #result {
    left: auto;
    right: calc(18px + var(--tv-safe));
    top: 50%;
    bottom: auto;
    width: 370px;
    max-height: calc(100vh - 36px);
    transform: translateY(-50%);
    animation: slide-in 0.42s cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes slide-in {
    from { opacity: 0; transform: translate(22px, -50%); }
    to   { opacity: 1; transform: translate(0, -50%); }
  }
  .facts { max-height: 42vh; }
}

/* On a phone the result card owns the bottom of the screen. */
/* Narrow phones: the HUD was using 90% of a 390px width, which leaves nothing
   for a safe-area inset and crowds the guess label underneath it. */
@media (max-width: 440px) {
  #hud { gap: 4px; left: 10px; right: 10px; }
  .stat { min-width: 0; flex: 1; padding: 5px 4px 6px; }
  .stat-label { font-size: 8.5px; letter-spacing: 0.06em; }
  .stat-value { font-size: 15px; }
  .lives { font-size: 12px; letter-spacing: 1px; }
  .icon-btn { width: 30px; font-size: 13px; }
  #prompt { max-width: calc(100vw - 20px); padding: 8px 14px 10px; }
}

@media (max-width: 620px) {
  /* Below the HUD, not across it. Centring the prompt at the top of the window
     put it straight over Round, Lives and Streak on a narrow phone. */
  #prompt {
    /* Overridden from JS with the HUD's measured height — the HUD changes size
       across breakpoints and a hardcoded offset was 7px short. This is the
       fallback for the frame before that runs. */
    top: calc(var(--safe-t) + 80px);
    left: 10px;
    right: 10px;
    transform: none;
    max-width: none;
    animation: drop-narrow 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes drop-narrow {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: none; }
  }

  #attribution { display: none; }
  #hud { gap: 6px; }
  .stat { min-width: 56px; padding: 6px 8px 7px; }
  .stat-value { font-size: 16px; }
  .stat-label { font-size: 9px; letter-spacing: 0.1em; }
  .icon-btn { width: 32px; }
  .go-region { grid-template-columns: 84px 1fr 40px; }
  .facts-grid { gap: 7px 12px; }
  .facts { max-height: 30vh; }
  .seg { padding: 6px 13px; font-size: 12.5px; }
  .screen { padding: 16px 12px; }
  .screen-inner.card { padding: 20px 16px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
