:root {
  --sky-50: #eefaff;
  --sky-100: #d8f1fb;
  --mint-50: #e8faf0;
  --mint-100: #d4f5e2;

  --ocean-400: #3aa8e0;
  --ocean-500: #1e8fcf;
  --ocean-700: #0f5f8c;
  --leaf-400: #4cc47a;
  --leaf-500: #33b36b;
  --leaf-700: #1f7d4a;

  --ink: #0d3b52;
  --ink-soft: #4a7285;
  --map-ink: #1c6f8f;

  --font: "Fredoka", "Segoe UI", system-ui, sans-serif;
}

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

[hidden] {
  display: none !important;
}

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

body {
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(160deg, var(--sky-50) 0%, var(--sky-100) 40%, var(--mint-100) 100%);
  overflow: hidden;
}

/* ---------- Loading screen ---------- */

.loading-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

.loading-screen.is-leaving {
  opacity: 0;
  visibility: hidden;
}

/* Background map */
.bg-map {
  position: fixed;
  inset: -4%;
  width: 108%;
  height: 108%;
  opacity: 0;
  transition: opacity 1.6s ease;
  animation: map-drift 40s ease-in-out infinite alternate;
  pointer-events: none;
}

.bg-map.is-ready {
  opacity: 1;
}

.bg-map .land-dot {
  fill: var(--map-ink);
  opacity: 0.22;
}

.bg-map .land {
  fill: url(#land-dots);
  stroke: var(--map-ink);
  stroke-opacity: 0.14;
  stroke-width: 0.6;
}

.bg-map .graticule {
  fill: none;
  stroke: var(--map-ink);
  stroke-opacity: 0.07;
  stroke-width: 0.5;
}

@keyframes map-drift {
  from { transform: translate(-1.5%, 0) scale(1); }
  to   { transform: translate(1.5%, -1%) scale(1.03); }
}

.bg-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(238, 250, 255, 0.75) 0%, rgba(238, 250, 255, 0.25) 45%, rgba(238, 250, 255, 0) 75%);
}

/* ---------- Brand / logo ---------- */

.brand {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(24px, 5vh, 48px);
  text-align: center;
}

.logo {
  margin: 0;
  font-size: clamp(4.25rem, 18vw, 12rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: 0.01em;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo-line {
  display: block;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(0.25em);
  animation: rise-in 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.logo-hunt {
  animation-delay: 0.18s;
}

.logo-geo .letters {
  background: linear-gradient(180deg, var(--ocean-400) 0%, var(--ocean-700) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo-hunt .letters {
  background: linear-gradient(180deg, var(--leaf-400) 0%, var(--leaf-700) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.letters {
  filter: drop-shadow(0 0.03em 0.04em rgba(13, 59, 82, 0.18));
}

/* The Earth "O" — sized to match the cap height of the letters */
.globe {
  position: relative;
  display: inline-block;
  width: 0.74em;
  height: 0.74em;
  margin: 0 0.03em;
  vertical-align: -0.015em;
  border-radius: 50%;
  /* Fallback look if the map data can't load */
  background: radial-gradient(circle at 35% 30%, #8fdcff 0%, var(--ocean-500) 55%, var(--ocean-700) 100%);
  box-shadow:
    0 0 0 0.012em rgba(255, 255, 255, 0.6),
    0 0 0.12em rgba(90, 190, 240, 0.55),
    0 0.04em 0.08em rgba(13, 59, 82, 0.25);
  animation: globe-bob 5s ease-in-out infinite;
}

.globe canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

@keyframes globe-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-0.025em); }
}

@keyframes rise-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Loader ---------- */

.loader {
  width: min(340px, 78vw);
  opacity: 0;
  animation: fade-in 0.8s ease 0.5s forwards;
}

.loader-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 3px rgba(13, 59, 82, 0.15);
  overflow: hidden;
}

.loader-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ocean-400), var(--leaf-500));
  transition: width 0.3s ease;
}

.loader-text {
  margin: 12px 0 0;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  min-height: 1.4em;
}

.loader.is-done {
  animation: fade-out 0.4s ease forwards;
}

/* ---------- Buttons ---------- */

.primary-btn {
  font: inherit;
  font-size: clamp(1.1rem, 3.5vw, 1.35rem);
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #fff;
  padding: 0.75em 2em;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--ocean-500), var(--leaf-500));
  box-shadow: 0 8px 20px rgba(30, 143, 207, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(30, 143, 207, 0.38);
}

.primary-btn:active {
  transform: translateY(0);
}

.primary-btn:focus-visible {
  outline: 3px solid var(--ocean-700);
  outline-offset: 4px;
}

.start-btn {
  animation: fade-in 0.6s ease forwards;
}

/* ---------- Screens ---------- */

.screen {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  align-items: safe center;
  padding: 24px 16px;
}

.screen.is-leaving {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* ---------- Rules screen ---------- */

.rules-card {
  width: 100%;
  max-width: 620px;
  margin: auto 0;
  padding: clamp(24px, 5vw, 44px);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 50px rgba(13, 59, 82, 0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: clamp(1rem, 2.6vw, 1.12rem);
  line-height: 1.6;
  animation: fade-in 0.6s ease both;
}

.rules-title {
  margin: 0 0 4px;
  font-size: clamp(2.6rem, 9vw, 3.6rem);
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  background: linear-gradient(90deg, var(--ocean-500), var(--leaf-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.rules-title:focus {
  outline: none;
}

.rules-subtitle {
  margin: 0 0 20px;
  font-size: clamp(1.2rem, 4vw, 1.45rem);
  font-weight: 700;
  text-align: center;
  color: var(--ocean-700);
}

.rules-card p {
  margin: 0 0 16px;
}

.rules-card strong {
  font-weight: 700;
  color: var(--ocean-700);
}

.rules-callout {
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--mint-50);
  border-left: 4px solid var(--leaf-500);
}

.rules-callout strong {
  color: var(--leaf-700);
}

/* The numbered rules on the intro screen */
.rules-list {
  margin: 0 0 18px;
  padding-left: 1.4em;
}

.rules-list li {
  margin-bottom: 10px;
  padding-left: 4px;
}

.rules-list li::marker {
  font-weight: 700;
  color: var(--ocean-500);
}

/* How streaks work: a stronger highlight than the other callouts */
.rules-streak {
  margin: 0 0 16px;
  background: #fff6dc;
  border-left-color: #e0a100;
}

.rules-streak p {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.rules-streak ul {
  margin: 0;
  padding-left: 1.2em;
}

.rules-streak li {
  margin-bottom: 6px;
}

.rules-streak li:last-child {
  margin-bottom: 0;
}

.rules-streak strong {
  color: #8a5a00;
  font-weight: 700;
}

.rules-signoff {
  text-align: center;
  font-weight: 600;
  color: var(--leaf-700);
}

.rules-card .primary-btn {
  display: block;
  margin: 24px auto 0;
}

.text-btn:disabled {
  cursor: default;
  opacity: 0.55;
  text-decoration: none;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-out {
  to { opacity: 0; }
}

/* ---------- Shared screen text ---------- */

.screen-title {
  margin: 0;
  font-size: clamp(2.2rem, 7vw, 3.2rem);
  font-weight: 700;
  line-height: 1.1;
  background: linear-gradient(90deg, var(--ocean-500), var(--leaf-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.screen-title:focus {
  outline: none;
}

.screen-subtitle {
  margin: 8px 0 0;
  font-size: clamp(1rem, 2.6vw, 1.12rem);
  color: var(--ink-soft);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Difficulty screen ---------- */

.difficulty-panel {
  width: 100%;
  max-width: 1040px;
  margin: auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  animation: fade-in 0.6s ease both;
}

.difficulty-header {
  text-align: center;
}

/* Reminder under the level picker that streaks are per level */
.streak-reminder {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 14px;
  border-radius: 12px;
  background: #fff6dc;
  color: var(--ink);
  font-size: 0.95rem;
}

.streak-reminder strong {
  color: #8a5a00;
}

.difficulty-scale {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.difficulty-scale-bar {
  position: relative;
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #33b36b, #22a59a, #1e8fcf, #1b4f8a);
}

.difficulty-scale-bar::after {
  content: "";
  position: absolute;
  right: -2px;
  top: 50%;
  transform: translateY(-50%);
  border-left: 10px solid #1b4f8a;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}

.difficulty-options {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.level-card {
  --level-color: var(--leaf-500);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 20px 24px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-top: 6px solid var(--level-color);
  box-shadow: 0 12px 30px rgba(13, 59, 82, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.level-card[data-level="2"] { --level-color: #22a59a; }
.level-card[data-level="3"] { --level-color: #1e8fcf; }
.level-card[data-level="4"] { --level-color: #1b4f8a; }

.level-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(13, 59, 82, 0.16);
}

.level-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.level-card:has(input:focus-visible) {
  outline: 3px solid var(--ocean-700);
  outline-offset: 4px;
}

.level-card:has(input:checked) {
  border-color: var(--level-color);
  background: #fff;
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(13, 59, 82, 0.18), 0 0 0 4px color-mix(in srgb, var(--level-color) 20%, transparent);
}

.level-card:has(input:checked)::after {
  content: "✓";
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 700;
  color: #fff;
  background: var(--level-color);
}

.level-rank {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--level-color);
}

.level-name {
  font-size: clamp(1.5rem, 3vw, 1.8rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
}

.level-meter {
  display: flex;
  gap: 5px;
}

.level-meter i {
  flex: 1;
  max-width: 34px;
  height: 8px;
  border-radius: 999px;
  background: rgba(13, 59, 82, 0.1);
}

.level-card[data-level="1"] .level-meter i:nth-child(-n+1),
.level-card[data-level="2"] .level-meter i:nth-child(-n+2),
.level-card[data-level="3"] .level-meter i:nth-child(-n+3),
.level-card[data-level="4"] .level-meter i:nth-child(-n+4) {
  background: var(--level-color);
}

.level-desc {
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.difficulty-start {
  margin-top: 8px;
}

.primary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

@media (max-width: 900px) {
  .difficulty-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .difficulty-options {
    grid-template-columns: 1fr;
  }
}

/* ---------- Game screen ---------- */

.game-panel {
  --level-color: var(--leaf-500);
  width: 100%;
  max-width: 640px;
  margin: auto 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(20px, 4vw, 36px);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 50px rgba(13, 59, 82, 0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fade-in 0.6s ease both;
}

.game-panel[data-level="medium"] { --level-color: #22a59a; }
.game-panel[data-level="expert"] { --level-color: #1e8fcf; }
.game-panel[data-level="geographer"] { --level-color: #1b4f8a; }

.game-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.mini-logo {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.mini-geo { color: var(--ocean-500); }
.mini-hunt { color: var(--leaf-500); }

.level-badge {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: var(--level-color);
}

.text-btn {
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ocean-700);
  background: none;
  border: none;
  padding: 6px 4px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(15, 95, 140, 0.35);
}

.text-btn:hover {
  text-decoration-color: currentColor;
}

.text-btn:focus-visible {
  outline: 3px solid var(--ocean-700);
  outline-offset: 2px;
  border-radius: 6px;
}

.game-header .text-btn {
  margin-left: auto;
}

.game-intro {
  text-align: center;
}

/* 5-step progress bar */
.clue-progress {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.clue-progress i {
  height: 8px;
  border-radius: 999px;
  background: rgba(13, 59, 82, 0.1);
  transition: background-color 0.3s ease;
}

.clue-progress i.is-current { background: var(--level-color); animation: pulse 1.6s ease-in-out infinite; }
.clue-progress i.is-wrong { background: #e0665c; }
.clue-progress i.is-skipped { background: #a9bcc6; }
.clue-progress i.is-correct { background: var(--leaf-500); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}

/* Clue cards */
.clue-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.clue-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(13, 59, 82, 0.08);
  border-left: 5px solid var(--level-color);
  box-shadow: 0 4px 12px rgba(13, 59, 82, 0.06);
}

.clue-card.is-new {
  animation: clue-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.clue-card.is-bonus {
  opacity: 0.6;
  border-left-color: rgba(13, 59, 82, 0.2);
}

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

.clue-num {
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 700;
  color: #fff;
  background: var(--level-color);
}

.clue-card.is-bonus .clue-num {
  background: #a9bcc6;
}

.clue-body {
  min-width: 0;
}

.clue-category {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--level-color);
}

.clue-card.is-bonus .clue-category {
  color: var(--ink-soft);
}

.clue-text {
  margin: 2px 0 0;
  font-size: clamp(1rem, 2.6vw, 1.1rem);
  line-height: 1.45;
  color: var(--ink);
}

.clue-guess {
  display: inline-block;
  margin: 8px 0 0;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.clue-guess.is-wrong { color: #b8433a; background: #fdeceb; }
.clue-guess.is-skipped { color: var(--ink-soft); background: #eef3f6; }
.clue-guess.is-correct { color: var(--leaf-700); background: var(--mint-50); }

/* Guess form */
.guess-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.guess-form {
  width: 100%;
  display: flex;
  gap: 10px;
}

.guess-input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 1.05rem;
  padding: 0.7em 1em;
  border-radius: 999px;
  border: 2px solid rgba(13, 59, 82, 0.15);
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.guess-input:focus {
  outline: none;
  border-color: var(--level-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--level-color) 18%, transparent);
}

.guess-btn {
  padding: 0.7em 1.6em;
}

.guess-feedback {
  margin: 0;
  min-height: 1.4em;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  color: var(--ink-soft);
}

.guess-feedback[data-tone="wrong"] {
  color: #b8433a;
}

/* Result */
.result-card {
  text-align: center;
  padding: 24px 16px 8px;
  border-top: 2px dashed rgba(13, 59, 82, 0.12);
  animation: fade-in 0.5s ease both;
}

.result-emoji {
  margin: 0;
  font-size: 2.6rem;
  line-height: 1;
}

.result-title {
  margin: 10px 0 6px;
  font-size: clamp(1.6rem, 5vw, 2rem);
  font-weight: 700;
  color: var(--ink);
}

.result-text {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

.result-squares {
  margin: 12px 0 0;
  font-size: 1.5rem;
  letter-spacing: 0.15em;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}

.secondary-btn {
  font: inherit;
  font-size: clamp(1.1rem, 3.5vw, 1.35rem);
  font-weight: 600;
  padding: 0.75em 1.6em;
  border-radius: 999px;
  cursor: pointer;
  color: var(--ocean-700);
  background: #fff;
  border: 2px solid rgba(15, 95, 140, 0.25);
  transition: border-color 0.15s ease;
}

.secondary-btn:hover {
  border-color: var(--ocean-700);
}

.secondary-btn:focus-visible {
  outline: 3px solid var(--ocean-700);
  outline-offset: 4px;
}

.result-countdown {
  margin: 22px 0 0;
  font-size: clamp(1.3rem, 4.5vw, 1.6rem);
  font-weight: 700;
  color: var(--leaf-700);
}

#result-countdown-time {
  font-variant-numeric: tabular-nums;
}

/* Stats */
.stats {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 2px dashed rgba(13, 59, 82, 0.12);
}

.stats-title {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 0;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat dd {
  order: -1;
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.stat dt {
  font-size: 0.8rem;
  line-height: 1.25;
  color: var(--ink-soft);
}

.stats-subtitle {
  margin: 18px 0 8px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.stats-dist {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.dist-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dist-label {
  width: 1em;
  font-weight: 600;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.dist-track {
  flex: 1;
  min-width: 0;
}

.dist-bar {
  display: block;
  min-width: 24px;
  padding: 1px 8px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: right;
  color: #fff;
  background: #a9bcc6;
  font-variant-numeric: tabular-nums;
}

.dist-row.is-today .dist-bar {
  background: var(--leaf-500);
}

.stats-note {
  margin: 12px 0 0;
  font-size: 0.85rem;
  text-align: center;
  color: var(--ink-soft);
}

.stats-note a {
  color: inherit;
}

/* The player's support ID: easy to read out and select */
.player-id {
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  user-select: all;
  white-space: nowrap;
}

/* ---------- Privacy Policy and Terms pages ---------- */

body.legal-page {
  height: auto;
  min-height: 100%;
  overflow: auto;
  padding: 24px 16px;
}

.legal-card {
  margin: 0 auto;
}

.legal-card a:not(.text-btn) {
  color: var(--ocean-700);
}

.legal-back {
  display: inline-block;
  margin-bottom: 12px;
  text-decoration: none;
}

.legal-updated {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.legal-heading {
  margin: 28px 0 8px;
  font-size: clamp(1.15rem, 3.6vw, 1.35rem);
  font-weight: 700;
  color: var(--ocean-700);
}

.legal-card ul {
  margin: 0 0 16px;
  padding-left: 1.3em;
}

.legal-card li {
  margin-bottom: 8px;
}

.legal-links {
  margin: 28px 0 0;
  text-align: center;
}

/* Small print under the Rules card */
.legal-footer {
  margin: 14px 0 0;
  font-size: 0.85rem;
  text-align: center;
  color: var(--ink-soft);
}

.legal-footer a {
  color: inherit;
}

.practice-note {
  margin: 14px 0 0;
  font-size: 0.95rem;
  text-align: center;
  color: var(--ink-soft);
}

.rules-card .rules-login {
  margin: 18px 0 0;
  font-size: 0.95rem;
  text-align: center;
  color: var(--ink-soft);
}

@media (max-width: 400px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 14px;
  }
}

/* Unlabeled world map */
.map-card {
  margin-top: 20px;
}

.map-frame {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid rgba(15, 95, 140, 0.15);
  background: var(--sky-50);
}

.world-map {
  display: block;
  width: 100%;
  height: auto;
  cursor: grab;
  touch-action: none;
}

.world-map:active {
  cursor: grabbing;
}

.map-ocean {
  fill: var(--sky-100);
}

.map-graticule {
  fill: none;
  stroke: rgba(15, 95, 140, 0.1);
  stroke-width: 0.5;
  vector-effect: non-scaling-stroke;
}

.map-land {
  fill: #7fd3a0;
}

.map-borders {
  fill: none;
  stroke: #ffffff;
  stroke-width: 0.8;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.map-controls {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.map-btn {
  width: 34px;
  height: 34px;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1;
  color: var(--ocean-700);
  background: #fff;
  border: 2px solid rgba(15, 95, 140, 0.25);
  border-radius: 10px;
  cursor: pointer;
}

.map-btn:hover {
  border-color: var(--ocean-700);
}

.map-btn:focus-visible {
  outline: 3px solid var(--ocean-700);
  outline-offset: 2px;
}

.map-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  font-weight: 500;
  color: var(--ink-soft);
}

.map-hint {
  margin: 8px 0 0;
  font-size: 0.9rem;
  text-align: center;
  color: var(--ink-soft);
}

@media (max-width: 460px) {
  .guess-form {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-map,
  .globe,
  .rules-card,
  .difficulty-panel,
  .game-panel,
  .clue-card.is-new,
  .clue-progress i.is-current {
    animation: none;
  }
}
