:root {
  --bg: #07111f;
  --panel: rgba(9, 20, 37, 0.78);
  --panel-strong: rgba(7, 14, 26, 0.92);
  --text: #f7fbff;
  --muted: rgba(247, 251, 255, 0.72);
  --line: rgba(255, 255, 255, 0.16);
  --accent: #38d5ff;
  --accent-2: #8b5cf6;
  --good: #32e67d;
  --bad: #ff4d6d;
  --gold: #ffd166;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 20% 10%, #163f75 0, transparent 38%),
              radial-gradient(circle at 80% 80%, #4b1d73 0, transparent 34%),
              var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

.app-shell {
  position: relative;
  min-height: 100dvh;
  width: 100%;
  overflow: hidden;
  background: #06101e;
}

.mapillary-viewer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 35%, rgba(56,213,255,0.18), transparent 35%),
    #101827;
}

.mapillary-viewer::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.36), transparent 26%, transparent 52%, rgba(0,0,0,0.72)),
    radial-gradient(circle at center, transparent 0, rgba(0,0,0,0.14) 100%);
}

.glass {
  background: linear-gradient(145deg, rgba(8, 22, 41, 0.82), rgba(8, 18, 34, 0.66));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: max(18px, var(--safe-top)) 18px max(18px, var(--safe-bottom));
  background:
    radial-gradient(circle at 50% 20%, rgba(56, 213, 255, 0.18), transparent 36%),
    linear-gradient(180deg, rgba(2, 7, 15, 0.70), rgba(2, 7, 15, 0.86));
}

.hero-card,
.end-card,
.leaderboard-card {
  width: min(960px, 100%);
  border-radius: 32px;
  padding: clamp(20px, 4vw, 38px);
}

.brand-row,
.leaderboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.brand-row {
  justify-content: flex-start;
}

.brand-icon {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(56, 213, 255, 0.28), rgba(139, 92, 246, 0.26));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
  font-size: 38px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(38px, 7vw, 74px);
  letter-spacing: -0.06em;
  line-height: 0.95;
}

.brand-row p,
.leaderboard-head p {
  color: var(--muted);
  margin-top: 8px;
  font-size: clamp(15px, 2vw, 18px);
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 24px 0;
}

.mode-card {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--text);
  padding: 18px 12px;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.mode-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.12);
}

.mode-card.selected {
  border-color: rgba(56, 213, 255, 0.95);
  background: linear-gradient(145deg, rgba(56, 213, 255, 0.24), rgba(139, 92, 246, 0.18));
  box-shadow: 0 0 0 4px rgba(56, 213, 255, 0.12);
}

.mode-emoji {
  font-size: 34px;
}

.mode-card strong {
  font-size: 16px;
}

.mode-card small {
  color: var(--muted);
}

.player-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.player-row input {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.10);
  color: var(--text);
  padding: 0 18px;
  outline: none;
}

.player-row input:focus {
  border-color: rgba(56, 213, 255, 0.9);
}

.primary-btn,
.secondary-btn {
  border: 0;
  border-radius: 18px;
  padding: 15px 20px;
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
}

.primary-btn {
  color: #03101e;
  background: linear-gradient(135deg, var(--accent), #a7f3ff);
  box-shadow: 0 12px 32px rgba(56, 213, 255, 0.22);
}

.secondary-btn {
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.08);
}

.rules-box {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
}

.rules-box span,
.rules-box b {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
}

.mapillary-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(56, 213, 255, 0.22);
  background: rgba(56, 213, 255, 0.08);
  color: var(--muted);
  line-height: 1.35;
  font-size: 14px;
}

.ranking-link,
.back-link {
  display: inline-flex;
  margin-top: 18px;
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.game-hud {
  position: fixed;
  z-index: 8;
  top: max(14px, var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  width: min(820px, calc(100% - 22px));
  display: grid;
  grid-template-columns: 1fr 1fr 1.25fr auto;
  gap: 10px;
  pointer-events: none;
}

.hud-pill,
.sound-btn {
  border: 1px solid var(--line);
  background: rgba(3, 12, 24, 0.72);
  backdrop-filter: blur(14px);
  color: var(--text);
  border-radius: 18px;
  min-height: 58px;
  box-shadow: 0 10px 34px rgba(0,0,0,0.22);
}

.hud-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hud-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.10em;
}

.hud-pill b {
  font-size: clamp(18px, 4vw, 28px);
  line-height: 1;
}

.sound-btn {
  width: 58px;
  cursor: pointer;
  pointer-events: auto;
  font-size: 24px;
}

.place-badge {
  position: fixed;
  z-index: 8;
  top: calc(max(14px, var(--safe-top)) + 72px);
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, calc(100% - 22px));
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(3, 12, 24, 0.58);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 34px rgba(0,0,0,0.22);
  pointer-events: none;
}

.place-badge span {
  color: var(--accent);
  font-weight: 950;
  font-size: 12px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.place-badge b {
  font-size: 13px;
  color: var(--muted);
}

.question-panel {
  position: fixed;
  z-index: 8;
  left: 50%;
  bottom: max(14px, var(--safe-bottom));
  transform: translateX(-50%);
  width: min(920px, calc(100% - 22px));
  border-radius: 28px;
  padding: 16px;
  transition: opacity 160ms ease, transform 160ms ease;
}

.question-panel.is-loading {
  opacity: 0.72;
  transform: translateX(-50%) translateY(6px);
  pointer-events: none;
}

.question-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.eyebrow {
  color: var(--accent);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 11px;
}

.question-top h2 {
  font-size: clamp(20px, 4vw, 30px);
  letter-spacing: -0.04em;
}

.round-clock {
  --size: 62px;
  width: var(--size);
  height: var(--size);
  display: grid;
  place-items: center;
  position: relative;
  flex: 0 0 auto;
}

.round-clock-fill {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--gold) var(--progress, 360deg), rgba(255,255,255,0.12) 0);
}

.round-clock::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: rgba(5, 14, 27, 0.92);
}

.round-clock span {
  position: relative;
  z-index: 1;
  font-weight: 1000;
  font-size: 20px;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.option-btn {
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,0.10);
  color: var(--text);
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 12px;
  overflow: hidden;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.option-btn:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,0.15);
}

.option-btn .flag {
  font-size: 38px;
  line-height: 1;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,0.32));
}

.option-btn .country {
  font-weight: 950;
  font-size: clamp(14px, 2.3vw, 18px);
  line-height: 1.1;
}

.option-btn.correct {
  border-color: rgba(50, 230, 125, 0.95);
  background: rgba(50, 230, 125, 0.22);
  animation: pop 420ms ease;
}

.option-btn.wrong {
  border-color: rgba(255, 77, 109, 0.95);
  background: rgba(255, 77, 109, 0.22);
  animation: shake 360ms ease;
}

.round-toast {
  position: fixed;
  z-index: 20;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 16px 22px;
  border-radius: 22px;
  background: rgba(4, 16, 29, 0.86);
  border: 1px solid rgba(50, 230, 125, 0.6);
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
  backdrop-filter: blur(14px);
  font-size: clamp(20px, 6vw, 42px);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toastIn 280ms ease;
}

.round-toast.bad {
  border-color: rgba(255, 77, 109, 0.72);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(circle at 50% 30%, rgba(56,213,255,0.16), transparent 36%),
              rgba(2, 7, 15, 0.92);
}

.loader-card {
  width: min(430px, 100%);
  border-radius: 28px;
  padding: 28px;
  text-align: center;
  background: rgba(8, 18, 34, 0.86);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.loader-card h1 {
  font-size: 48px;
  margin-bottom: 10px;
}

.loader-card p,
.loader-card small {
  color: var(--muted);
}

.geo-orb {
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, #fff, transparent 12%),
    linear-gradient(135deg, var(--accent), var(--accent-2));
  animation: spin 1.2s linear infinite;
}

.api-warning {
  position: fixed;
  z-index: 40;
  top: 14px;
  right: 14px;
  width: min(420px, calc(100% - 28px));
  padding: 14px 16px;
  border-radius: 16px;
  background: #32120f;
  border: 1px solid rgba(255, 209, 102, 0.65);
  color: #fff7df;
  box-shadow: var(--shadow);
  display: grid;
  gap: 6px;
}

.api-warning code {
  background: rgba(255,255,255,0.12);
  padding: 2px 5px;
  border-radius: 6px;
}

.end-card {
  max-width: 680px;
  text-align: center;
}

.trophy {
  font-size: 74px;
  margin-bottom: 12px;
}

.end-card h2 {
  font-size: clamp(34px, 6vw, 58px);
  letter-spacing: -0.06em;
}

.end-card p {
  color: var(--muted);
  margin-top: 8px;
  font-size: 18px;
}

.end-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 24px 0;
}

.end-stats div {
  border-radius: 22px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--line);
  padding: 16px;
}

.end-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
}

.end-stats b {
  display: block;
  margin-top: 6px;
  font-size: 28px;
}

.save-status {
  min-height: 24px;
  color: var(--gold);
  font-weight: 800;
}

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

.leaderboard-body {
  min-height: 100dvh;
}

.leaderboard-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.leaderboard-card {
  width: min(1100px, 100%);
}

.leaderboard-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0;
}

.rank-tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  cursor: pointer;
  font-weight: 850;
}

.rank-tab.selected {
  background: rgba(56, 213, 255, 0.22);
  border-color: rgba(56, 213, 255, 0.85);
}

.table-wrap {
  overflow-x: auto;
  border-radius: 22px;
  border: 1px solid var(--line);
}

.rank-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  background: rgba(255,255,255,0.05);
}

.rank-table th,
.rank-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.rank-table th {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rank-table tr:last-child td {
  border-bottom: 0;
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.86); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes pop {
  50% { transform: scale(1.04); }
}

@keyframes shake {
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 820px) {
  .mode-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .options-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .game-hud {
    grid-template-columns: 1fr 1fr auto;
  }

  .big-timer {
    grid-column: span 2;
    order: -1;
  }

  .place-badge {
    top: calc(max(8px, var(--safe-top)) + 108px);
  }
}

@media (max-width: 560px) {
  .screen {
    align-items: start;
    padding-top: max(18px, var(--safe-top));
    overflow-y: auto;
  }

  .hero-card,
  .end-card {
    border-radius: 26px;
    padding: 18px;
  }

  .brand-row {
    align-items: flex-start;
  }

  .brand-icon {
    width: 58px;
    height: 58px;
    border-radius: 20px;
    font-size: 30px;
  }

  h1 {
    font-size: 44px;
  }

  .mode-grid {
    gap: 10px;
  }

  .mode-card {
    min-height: 108px;
    border-radius: 20px;
    padding: 12px 8px;
  }

  .mode-emoji {
    font-size: 28px;
  }

  .player-row {
    grid-template-columns: 1fr;
  }

  .player-row input,
  .primary-btn,
  .secondary-btn {
    min-height: 52px;
  }

  .game-hud {
    top: max(8px, var(--safe-top));
    width: calc(100% - 14px);
    gap: 7px;
  }

  .hud-pill,
  .sound-btn {
    min-height: 48px;
    border-radius: 15px;
  }

  .hud-label {
    font-size: 9px;
  }

  .hud-pill b {
    font-size: 18px;
  }

  .sound-btn {
    width: 48px;
    font-size: 20px;
  }

  .place-badge {
    width: calc(100% - 14px);
    top: calc(max(8px, var(--safe-top)) + 102px);
  }

  .place-badge b {
    font-size: 12px;
  }

  .question-panel {
    width: calc(100% - 14px);
    padding: 12px;
    border-radius: 22px;
  }

  .question-top {
    margin-bottom: 10px;
  }

  .round-clock {
    --size: 54px;
  }

  .option-btn {
    min-height: 68px;
    border-radius: 18px;
    gap: 8px;
    padding: 9px;
  }

  .option-btn .flag {
    font-size: 30px;
  }

  .option-btn .country {
    font-size: 14px;
  }

  .end-stats {
    grid-template-columns: 1fr;
  }

  .leaderboard-page {
    padding: 12px;
  }

  .leaderboard-card {
    padding: 16px;
    border-radius: 24px;
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  .game-hud {
    left: 10px;
    right: auto;
    top: 10px;
    transform: none;
    width: 300px;
    grid-template-columns: 1fr 1fr;
  }

  .sound-btn {
    position: fixed;
    top: 10px;
    right: 10px;
  }

  .place-badge {
    top: 140px;
    left: 10px;
    transform: none;
    width: 300px;
  }

  .question-panel {
    right: 10px;
    left: auto;
    bottom: 10px;
    transform: none;
    width: min(560px, calc(100% - 330px));
  }

  .options-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .option-btn {
    min-height: 58px;
  }
}

/* Geo Boss v3: transición entre lugares + banderas reales FlagCDN */
.mapillary-viewer {
  transition: filter 220ms ease, transform 220ms ease;
}

.mapillary-viewer.is-changing-place {
  filter: blur(4px) saturate(1.2) brightness(0.74);
  transform: scale(1.014);
}

.question-panel.is-loading {
  opacity: 0.55;
  transform: translateX(-50%) translateY(8px) scale(0.99);
  pointer-events: none;
  filter: blur(1px);
}

.round-loader {
  position: fixed;
  inset: 0;
  z-index: 16;
  display: grid;
  place-items: center;
  pointer-events: auto;
  background:
    radial-gradient(circle at 50% 36%, rgba(56, 213, 255, 0.24), transparent 34%),
    linear-gradient(180deg, rgba(2,7,15,0.30), rgba(2,7,15,0.62));
  backdrop-filter: blur(8px);
  animation: roundLoaderIn 220ms ease both;
}

.round-loader.closing {
  animation: roundLoaderOut 220ms ease both;
}

.round-loader-card {
  width: min(390px, calc(100% - 36px));
  min-height: 236px;
  border-radius: 32px;
  padding: 26px 22px;
  display: grid;
  justify-items: center;
  align-content: center;
  text-align: center;
  background: linear-gradient(145deg, rgba(5, 16, 31, 0.86), rgba(9, 29, 52, 0.74));
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 28px 90px rgba(0,0,0,0.50);
}

.loader-globe {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  background:
    radial-gradient(circle at 32% 26%, rgba(255,255,255,0.90), transparent 12%),
    linear-gradient(135deg, rgba(56,213,255,0.95), rgba(139,92,246,0.92));
  box-shadow:
    0 16px 36px rgba(56,213,255,0.18),
    inset 0 0 0 1px rgba(255,255,255,0.24);
  animation: travelGlobe 1.15s ease-in-out infinite;
  position: relative;
}

.loader-globe::before,
.loader-globe::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.28);
  inset: 12px;
  transform: rotate(22deg);
}

.loader-globe::after {
  inset: -8px;
  border-color: rgba(56,213,255,0.24);
  animation: orbitPulse 1.15s ease-in-out infinite;
}

.loader-globe span {
  font-size: 44px;
  animation: globeSpin 1.4s linear infinite;
}

.round-loader-card strong {
  font-size: clamp(20px, 4vw, 26px);
  letter-spacing: -0.04em;
}

.round-loader-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.loader-bar {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.10);
  margin-top: 20px;
  position: relative;
}

.loader-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--accent), #fff, var(--accent-2), transparent);
  animation: loaderBar 1.05s ease-in-out infinite;
}

.option-btn {
  min-height: 92px;
}

.flag-frame {
  width: 64px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  background: rgba(255,255,255,0.12);
  box-shadow:
    0 10px 20px rgba(0,0,0,0.24),
    inset 0 0 0 1px rgba(255,255,255,0.18);
  flex: 0 0 auto;
}

.flag-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
}

.flag-fallback {
  display: none;
  width: 100%;
  height: 100%;
  place-items: center;
  font-size: 34px;
  line-height: 1;
}

.flag-fallback.always {
  display: grid;
}

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

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

@keyframes travelGlobe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-7px) scale(1.035); }
}

@keyframes globeSpin {
  to { transform: rotate(360deg); }
}

@keyframes orbitPulse {
  0%, 100% { opacity: 0.22; transform: scale(0.94); }
  50% { opacity: 0.68; transform: scale(1.08); }
}

@keyframes loaderBar {
  0% { left: -45%; }
  100% { left: 104%; }
}

@media (max-width: 560px) {
  .option-btn {
    min-height: 76px;
  }

  .flag-frame {
    width: 54px;
    height: 39px;
    border-radius: 10px;
  }

  .flag-fallback {
    font-size: 29px;
  }

  .round-loader-card {
    width: calc(100% - 28px);
    min-height: 220px;
    border-radius: 28px;
  }

  .loader-globe {
    width: 74px;
    height: 74px;
  }

  .loader-globe span {
    font-size: 38px;
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  .flag-frame {
    width: 50px;
    height: 36px;
  }
}

/* === Geo Boss v4: mobile transparency, compact HUD and admin === */
.mode-grid.two-modes { grid-template-columns: repeat(2, 1fr); }
.game-hud {
  top: max(10px, var(--safe-top));
  width: min(650px, calc(100% - 20px));
  grid-template-columns: 1fr .8fr 1.1fr auto;
  gap: 7px;
}
.hud-pill, .sound-btn { min-height: 46px; border-radius: 15px; background: rgba(3,12,24,.58); }
.hud-label { font-size: 9px; }
.hud-pill b { font-size: clamp(16px,3vw,22px); }
.sound-btn { width: 46px; font-size: 20px; }
.place-badge { top: calc(max(10px, var(--safe-top)) + 54px); width: min(340px, calc(100% - 20px)); padding: 7px 10px; background: rgba(3,12,24,.44); }
.place-badge span { font-size: 10px; }
.place-badge b { font-size: 12px; }
.question-panel { width: min(880px, calc(100% - 22px)); padding: 14px; border-radius: 26px; }
.question-top { margin-bottom: 12px; }
.round-clock { --size: 56px; }
.option-btn { min-height: 84px; border-radius: 20px; padding: 10px; gap: 10px; }
.flag-frame { width: 60px; height: 42px; border-radius: 11px; }
.option-btn .country { font-size: clamp(14px,2.3vw,17px); }

.admin-body, .leaderboard-body { min-height: 100dvh; }
.admin-login-page, .admin-page { min-height: 100dvh; padding: 22px; }
.admin-login-page { display: grid; place-items: center; }
.admin-login-card { width: min(520px, 100%); border-radius: 32px; padding: 28px; }
.admin-login-card h1 { margin-top: 14px; font-size: clamp(34px,7vw,58px); }
.admin-login-card p { margin-top: 8px; color: var(--muted); }
.admin-login-form { display: grid; gap: 12px; margin-top: 18px; }
.admin-login-form input, .admin-toolbar input, .admin-toolbar select, .coords-editor input { min-width:0; width:100%; border:1px solid var(--line); border-radius:18px; background:rgba(255,255,255,.10); color:var(--text); padding:0 18px; outline:none; min-height:54px; }
.admin-toolbar select option { color:#111827; }
.admin-error { margin-top:14px; padding:12px; border-radius:14px; background:rgba(255,77,109,.16); border:1px solid rgba(255,77,109,.35); }
.admin-page { display:grid; place-items:start center; }
.admin-shell { width:min(1380px,100%); border-radius:32px; padding:clamp(16px,3vw,28px); }
.admin-head { display:flex; gap:18px; justify-content:space-between; align-items:start; }
.admin-head h1 { margin-top:10px; font-size:clamp(36px,6vw,64px); }
.admin-head p { color:var(--muted); margin-top:8px; }
.admin-head-actions { display:flex; gap:10px; flex-wrap:wrap; }
.admin-toolbar { display:grid; grid-template-columns:1fr 220px; gap:12px; margin:22px 0 12px; }
.admin-status { color:var(--muted); padding:10px 0; font-weight:800; }
.admin-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.admin-empty { grid-column:1/-1; padding:22px; border-radius:22px; border:1px solid var(--line); background:rgba(255,255,255,.07); color:var(--muted); }
.admin-location-card { display:grid; grid-template-columns:170px 1fr; gap:14px; border:1px solid var(--line); border-radius:24px; padding:12px; background:rgba(255,255,255,.07); }
.admin-location-thumb, .candidate-thumb { min-height:150px; border-radius:18px; overflow:hidden; background:rgba(255,255,255,.07); display:grid; place-items:center; }
.admin-location-thumb img, .candidate-thumb img { width:100%; height:100%; object-fit:cover; }
.no-thumb { color:var(--muted); font-weight:900; text-align:center; padding:12px; }
.admin-location-title { display:flex; gap:10px; align-items:center; }
.admin-flag { width:44px; height:31px; object-fit:cover; border-radius:7px; box-shadow:0 8px 18px rgba(0,0,0,.22); }
.admin-emoji { font-size:30px; }
.admin-location-title h3 { font-size:19px; line-height:1.08; }
.admin-location-title p { color:var(--muted); margin-top:3px; }
.admin-meta, .admin-coords { display:flex; flex-wrap:wrap; gap:7px; margin-top:10px; }
.badge { display:inline-flex; align-items:center; min-height:26px; padding:4px 8px; border-radius:999px; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.10); color:var(--muted); font-size:12px; font-weight:900; }
.badge-good { color:#b7ffd4; background:rgba(50,230,125,.14); }
.badge-bad { color:#ffd0d9; background:rgba(255,77,109,.14); }
.badge-hidden { color:#d7dce7; background:rgba(255,255,255,.10); }
.badge-unchecked, .badge-warn { color:#fff0bf; background:rgba(255,209,102,.12); }
.badge-pano { color:#c7f5ff; background:rgba(56,213,255,.12); }
.admin-coords span { color:var(--muted); font-size:12px; }
.admin-image-id { margin-top:9px; display:grid; gap:3px; color:var(--muted); font-size:12px; }
.admin-image-id code, .candidate-info code { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#d8f7ff; }
.coords-editor { margin-top:10px; color:var(--muted); }
.coords-editor summary { cursor:pointer; font-weight:900; color:var(--accent); }
.coords-editor div { display:grid; grid-template-columns:1fr 1fr auto; gap:8px; margin-top:8px; }
.coords-editor input { min-height:40px; border-radius:12px; padding:0 10px; }
.admin-actions { display:flex; flex-wrap:wrap; gap:7px; margin-top:12px; }
.mini-btn, .icon-btn { border:1px solid rgba(255,255,255,.13); background:rgba(255,255,255,.08); color:var(--text); border-radius:12px; min-height:36px; padding:8px 10px; cursor:pointer; font-weight:900; font-size:12px; }
.primary-mini { background:rgba(56,213,255,.18); border-color:rgba(56,213,255,.34); }
.danger-soft { background:rgba(255,77,109,.13); border-color:rgba(255,77,109,.28); }
.danger { background:rgba(255,77,109,.22); border-color:rgba(255,77,109,.42); }
.admin-modal { position:fixed; inset:0; z-index:50; padding:18px; display:grid; place-items:center; background:rgba(2,7,15,.78); backdrop-filter:blur(10px); }
.admin-modal-card { width:min(1180px,100%); max-height:calc(100dvh - 36px); overflow:auto; border-radius:28px; padding:20px; }
.admin-modal-head { display:flex; align-items:start; justify-content:space-between; gap:16px; }
.admin-modal-head h2 { font-size:clamp(26px,5vw,42px); letter-spacing:-.04em; }
.admin-modal-head p { color:var(--muted); margin-top:4px; }
.icon-btn { width:42px; height:42px; border-radius:50%; font-size:24px; line-height:1; }
.candidate-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-top:12px; }
.candidate-card { border:1px solid var(--line); border-radius:20px; padding:10px; background:rgba(255,255,255,.07); }
.candidate-thumb { height:180px; min-height:180px; }
.candidate-info { display:grid; gap:4px; margin:9px 0; }
.candidate-info span { color:var(--muted); font-size:13px; }

@media (max-width:1080px) { .admin-grid { grid-template-columns:1fr; } .candidate-grid { grid-template-columns:repeat(2,1fr); } }
@media (max-width:820px) {
  .mode-grid, .mode-grid.two-modes { grid-template-columns:repeat(2,1fr); }
  .game-hud { width:calc(100% - 14px); grid-template-columns:.8fr .65fr 1fr auto; gap:5px; }
  .hud-pill, .sound-btn { min-height:40px; border-radius:12px; }
  .sound-btn { width:40px; font-size:18px; }
  .hud-label { font-size:8px; }
  .hud-pill b { font-size:15px; }
  .place-badge { top:calc(max(8px, var(--safe-top)) + 48px); }
}
@media (max-width:560px) {
  .place-badge { display:none !important; }
  .question-panel.glass { width:calc(100% - 12px); padding:9px; border-radius:20px; background:linear-gradient(145deg, rgba(5,15,30,.36), rgba(5,14,28,.26)); border-color:rgba(255,255,255,.10); box-shadow:0 14px 46px rgba(0,0,0,.20); backdrop-filter:blur(7px); }
  .question-top { margin-bottom:7px; gap:10px; }
  .eyebrow { font-size:9px; }
  .question-top h2 { font-size:18px; }
  .round-clock { --size:46px; }
  .round-clock::after { inset:5px; }
  .round-clock span { font-size:15px; }
  .options-grid { gap:7px; }
  .option-btn { min-height:66px; border-radius:16px; gap:7px; padding:7px; background:rgba(3,12,24,.35); border-color:rgba(255,255,255,.12); backdrop-filter:blur(3px); }
  .flag-frame { width:48px; height:34px; border-radius:9px; }
  .flag-fallback { font-size:27px; }
  .option-btn .country { font-size:13px; }
  .admin-page, .admin-login-page { padding:12px; }
  .admin-shell, .admin-login-card { padding:16px; border-radius:24px; }
  .admin-head { display:grid; }
  .admin-head-actions { width:100%; }
  .admin-head-actions .secondary-btn { flex:1; }
  .admin-toolbar { grid-template-columns:1fr; }
  .admin-location-card { grid-template-columns:1fr; }
  .admin-location-thumb { min-height:190px; }
  .coords-editor div { grid-template-columns:1fr; }
  .candidate-grid { grid-template-columns:1fr; }
  .candidate-thumb { height:190px; }
}
