/* SAVE Learning Co. — Globe Hub
   Expedition palette, locked to brand */
:root {
  --paper: #F5F1E8;
  --ink: #1F1A14;
  --deep: #1B3A2F;
  --gold: #C8A24B;
  --rust: #A8432A;
  --sky: #6B8CAE;
  --cream: #EEE6D3;
  --space: #05080C;
  --space-2: #0b111a;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: radial-gradient(1200px 1200px at 50% 40%, #0e1826 0%, #05080C 55%, #02040a 100%);
  color: var(--paper);
  font-family: 'Source Sans 3', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* ===== Header ===== */
.hub-header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) 18px 10px;
  background: linear-gradient(to bottom, rgba(5,8,12,0.85), rgba(5,8,12,0));
  pointer-events: none;
}
.hub-header > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(200,162,75,0.18);
}
.nameplate {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--paper);
}
.icon-btn, .icon-btn-small {
  background: rgba(245,241,232,0.1);
  border: 1px solid rgba(245,241,232,0.15);
  color: var(--paper);
  border-radius: 999px;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background .15s;
}
.icon-btn:hover, .icon-btn-small:hover { background: rgba(245,241,232,0.18); }
.icon-btn-small { width: 32px; height: 32px; }

/* ===== Stage ===== */
.stage { position: fixed; inset: 0; overflow: hidden; }
#globe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  touch-action: none;
  cursor: grab;
}
#globe:active { cursor: grabbing; }

.hero-copy {
  position: absolute;
  left: 20px; right: 20px;
  bottom: calc(120px + env(safe-area-inset-bottom));
  text-align: center;
  pointer-events: none;
  text-shadow: 0 2px 18px rgba(0,0,0,0.6);
  transition: opacity .4s ease;
}
.hero-copy.fade { opacity: 0; }
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin: 0 0 6px;
}
.hero-copy h1 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: clamp(30px, 8vw, 46px);
  margin: 0 0 8px;
  color: var(--paper);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.hero-copy .sub {
  font-size: 15px;
  color: rgba(245,241,232,0.86);
  max-width: 360px;
  margin: 0 auto;
  text-wrap: balance;
}

.legend {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  bottom: calc(32px + env(safe-area-inset-bottom));
  display: flex; gap: 18px;
  font-size: 12px;
  color: rgba(245,241,232,0.8);
  background: rgba(5,8,12,0.5);
  border: 1px solid rgba(245,241,232,0.08);
  border-radius: 999px;
  padding: 8px 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.chip { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.chip-gold { background: var(--gold); box-shadow: 0 0 0 2px rgba(200,162,75,0.28); }
.chip-outline { border: 1.5px solid var(--gold); background: transparent; }

.fab {
  position: absolute;
  right: 16px;
  bottom: calc(90px + env(safe-area-inset-bottom));
  width: 42px; height: 42px;
  border-radius: 999px;
  background: rgba(5,8,12,0.7);
  border: 1px solid rgba(245,241,232,0.18);
  color: var(--paper);
  display: grid; place-items: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ===== Bottom sheet ===== */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(5,8,12,0.55);
  z-index: 40;
  opacity: 0; transition: opacity .25s;
}
.sheet-backdrop.show { opacity: 1; }

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  background: var(--paper);
  color: var(--ink);
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  padding: 10px 22px calc(28px + env(safe-area-inset-bottom));
  transform: translateY(110%);
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 -12px 40px rgba(0,0,0,0.35);
  max-height: 80vh;
  overflow-y: auto;
}
.sheet.show { transform: translateY(0); }

.sheet-handle {
  width: 44px; height: 4px; border-radius: 2px;
  background: rgba(31,26,20,0.18);
  margin: 6px auto 14px;
}
.sheet .eyebrow {
  color: var(--rust);
}
.sheet h2 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 28px;
  margin: 2px 0 10px;
  color: var(--ink);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.sheet-sub {
  margin: 0 0 18px;
  color: rgba(31,26,20,0.78);
  font-size: 15px;
  text-wrap: pretty;
}
.sheet-actions {
  display: flex; flex-direction: column; gap: 10px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600;
  padding: 14px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  min-height: 48px;
  text-decoration: none;
  font-size: 15px;
}
.btn-primary {
  background: var(--deep); color: var(--paper);
  border-color: var(--deep);
}
.btn-primary:hover { background: #244e41; }
.btn-gold {
  background: var(--gold); color: var(--ink);
  border-color: var(--gold);
}
.btn-gold:hover { background: #d4b162; }
.btn-ghost {
  background: transparent; color: var(--ink);
  border-color: rgba(31,26,20,0.22);
}
.btn-ghost:hover { background: rgba(31,26,20,0.05); }

.sheet-note {
  margin: 14px 0 0;
  font-size: 13px;
  color: rgba(31,26,20,0.7);
  background: var(--cream);
  padding: 10px 12px;
  border-radius: 10px;
  border-left: 3px solid var(--gold);
}

/* ===== Library drawer ===== */
.drawer {
  position: fixed;
  top: 0; bottom: 0; right: 0;
  width: min(340px, 88vw);
  background: var(--paper);
  color: var(--ink);
  z-index: 60;
  padding: max(16px, env(safe-area-inset-top)) 20px 20px;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
  overflow-y: auto;
  box-shadow: -12px 0 40px rgba(0,0,0,0.3);
}
.drawer.show { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.drawer h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 22px;
  margin: 2px 0 16px;
  color: var(--ink);
}
.drawer .icon-btn-small {
  background: rgba(31,26,20,0.06);
  border-color: rgba(31,26,20,0.12);
  color: var(--ink);
}
.lib-list { list-style: none; padding: 0; margin: 0 0 18px; }
.lib-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid rgba(31,26,20,0.1);
  text-decoration: none; color: var(--ink);
  cursor: pointer;
}
.lib-item .num {
  font-family: 'Playfair Display', serif;
  color: var(--gold);
  font-size: 13px;
  width: 22px;
  font-weight: 600;
}
.lib-item .lib-name {
  font-weight: 600;
  font-size: 16px;
  flex: 1;
}
.lib-item .lib-vol {
  font-size: 12px;
  color: rgba(31,26,20,0.6);
  letter-spacing: 0.04em;
}
.drawer-note {
  font-size: 13px;
  color: rgba(31,26,20,0.6);
  line-height: 1.5;
  padding-top: 8px;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  left: 50%; transform: translateX(-50%) translateY(16px);
  bottom: calc(100px + env(safe-area-inset-bottom));
  background: rgba(27,58,47,0.96);
  color: var(--paper);
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  border: 1px solid rgba(200,162,75,0.3);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 70;
  max-width: 88vw;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* hide hero copy after first gesture */
body.interacted .hero-copy { opacity: 0; }
body.interacted .legend { opacity: 0.75; }

/* Global hidden override — our CSS sets display:grid etc., so [hidden] needs to still work */
[hidden] { display: none !important; }

/* ===== Daily Quest banner (top center) ===== */
.quest-banner {
  position: fixed;
  top: max(66px, calc(env(safe-area-inset-top) + 62px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 11;
  width: min(440px, calc(100vw - 28px));
  background: linear-gradient(180deg, rgba(27,58,47,0.92), rgba(20,44,36,0.92));
  color: var(--paper);
  border: 1px solid rgba(200,162,75,0.45);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(200,162,75,0.15);
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.15s, box-shadow 0.15s;
  animation: quest-breath 3.5s ease-in-out infinite;
}
.quest-banner:hover { transform: translateX(-50%) translateY(-1px); }
.quest-banner.solved {
  background: linear-gradient(180deg, rgba(200,162,75,0.92), rgba(170,135,55,0.92));
  color: var(--ink);
  animation: none;
}
@keyframes quest-breath {
  0%, 100% { box-shadow: 0 12px 30px rgba(0,0,0,0.4), 0 0 0 0 rgba(200,162,75,0); }
  50%      { box-shadow: 0 12px 30px rgba(0,0,0,0.4), 0 0 24px 2px rgba(200,162,75,0.35); }
}
.quest-banner-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 14px;
}
.quest-scroll-icon {
  flex-shrink: 0;
  color: var(--gold);
  display: grid; place-items: center;
  width: 32px; height: 32px;
  background: rgba(200,162,75,0.12);
  border: 1px solid rgba(200,162,75,0.35);
  border-radius: 8px;
}
.quest-banner.solved .quest-scroll-icon {
  color: var(--ink);
  background: rgba(31,26,20,0.1);
  border-color: rgba(31,26,20,0.2);
}
.quest-text { flex: 1; min-width: 0; }
.quest-label {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 2px;
}
.quest-banner.solved .quest-label { color: rgba(31,26,20,0.65); }
.quest-clue {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: -0.005em;
  text-wrap: balance;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.quest-hint-btn {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(200,162,75,0.35);
  background: rgba(200,162,75,0.08);
  color: var(--gold);
  display: grid; place-items: center;
  cursor: pointer;
}
.quest-hint-btn:hover { background: rgba(200,162,75,0.18); }
.quest-banner.solved .quest-hint-btn { display: none; }

@media (max-width: 420px) {
  .quest-banner { top: max(58px, calc(env(safe-area-inset-top) + 54px)); }
  .quest-clue { font-size: 13px; }
}

/* ===== Bottom dock (Passport + Trophies) ===== */
.dock {
  position: fixed;
  right: 14px;
  bottom: calc(30px + env(safe-area-inset-bottom));
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}
.dock-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 13px 10px 11px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(200,162,75,0.95), rgba(170,135,55,0.95));
  color: var(--ink);
  border: 1px solid rgba(255,230,170,0.5);
  cursor: pointer;
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 0.15s;
}
.dock-btn:hover { transform: translateY(-1px); }
.dock-btn-alt {
  background: linear-gradient(180deg, rgba(27,58,47,0.95), rgba(18,40,32,0.95));
  color: var(--paper);
  border-color: rgba(200,162,75,0.45);
}
.dock-icon { display: grid; place-items: center; width: 20px; height: 20px; }
.dock-count {
  font-family: 'Playfair Display', serif;
  font-size: 13px;
  margin-left: 4px;
  padding-left: 8px;
  border-left: 1px solid rgba(31,26,20,0.3);
}
.dock-btn-alt .dock-count {
  border-left-color: rgba(245,241,232,0.25);
  color: var(--gold);
}

/* ===== Explorer panel tabs ===== */
.explorer-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 14px;
  padding: 4px;
  background: rgba(31,26,20,0.06);
  border-radius: 999px;
}
.explorer-tab {
  flex: 1;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  border-radius: 999px;
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(31,26,20,0.55);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.explorer-tab:hover { color: rgba(31,26,20,0.85); }
.explorer-tab.active {
  background: var(--deep);
  color: var(--paper);
  box-shadow: 0 2px 6px rgba(27,58,47,0.3);
}
.explorer-tabpanel { animation: fadein 0.25s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ===== Missions list ===== */
.missions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mission-item {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.45);
  border: 1px solid rgba(31,26,20,0.08);
  border-radius: 12px;
  transition: background 0.15s;
}
.mission-item.done {
  background: rgba(200,162,75,0.12);
  border-color: rgba(200,162,75,0.35);
}
.mission-icon {
  flex-shrink: 0;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  font-size: 22px;
  color: rgba(31,26,20,0.35);
  font-family: 'Playfair Display', serif;
}
.mission-item.done .mission-icon { color: var(--gold); font-size: 24px; }
.mission-body { flex: 1; min-width: 0; }
.mission-title {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--deep);
  line-height: 1.2;
  margin-bottom: 2px;
}
.mission-desc {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 13px;
  color: rgba(31,26,20,0.72);
  line-height: 1.35;
  margin-bottom: 8px;
}
.mission-progress {
  display: flex; align-items: center; gap: 10px;
}
.mission-bar {
  flex: 1;
  height: 6px;
  background: rgba(31,26,20,0.08);
  border-radius: 999px;
  overflow: hidden;
}
.mission-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #e0c070);
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(.2,.8,.2,1);
}
.mission-item.done .mission-bar span { background: linear-gradient(90deg, var(--deep), #2a5a48); }
.mission-pct {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(31,26,20,0.55);
  white-space: nowrap;
}

/* ===== Trophy shelf ===== */
.trophy-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 14px 10px;
  padding: 16px 10px 20px;
  background: linear-gradient(180deg, rgba(120,85,50,0.08), rgba(120,85,50,0.18));
  border-radius: 10px 10px 0 0;
  border: 1px solid rgba(120,85,50,0.18);
  border-bottom: 0;
}
.shelf-plank {
  height: 14px;
  margin: -1px 0 0;
  background:
    linear-gradient(180deg, #8a6a3e, #6a4e2a 60%, #4e3a20);
  border-radius: 0 0 10px 10px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,220,160,0.2);
  position: relative;
}
.shelf-plank::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg,
      rgba(255,255,255,0.05) 0 12px,
      transparent 12px 24px);
  border-radius: 0 0 10px 10px;
}
.trophy-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.trophy-medal {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #f7dc8a, var(--gold) 60%, #8a6a2a);
  color: #3a2a10;
  box-shadow:
    0 4px 10px rgba(0,0,0,0.35),
    inset 0 -3px 6px rgba(0,0,0,0.2),
    inset 0 2px 4px rgba(255,255,255,0.5);
  position: relative;
}
.trophy-medal::after {
  content: '';
  position: absolute;
  bottom: -10px;
  width: 4px; height: 14px;
  background: linear-gradient(180deg, #a8432a, #5a2414);
  transform: translateY(4px);
}
.trophy-cell.locked .trophy-medal {
  background: linear-gradient(180deg, rgba(31,26,20,0.18), rgba(31,26,20,0.28));
  color: rgba(245,241,232,0.4);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15), inset 0 -2px 4px rgba(0,0,0,0.2);
}
.trophy-cell.locked .trophy-medal::after { display: none; }
.trophy-title {
  font-family: 'Playfair Display', serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--deep);
  margin-top: 6px;
  text-wrap: balance;
}
.trophy-cell.locked .trophy-title { color: rgba(31,26,20,0.45); }
.trophy-sub {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(31,26,20,0.45);
}

/* ===== Badge earned toast ===== */
.badge-toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) translateY(-30px) scale(0.9);
  z-index: 110;
  max-width: 360px;
  width: calc(100vw - 40px);
  padding: 18px 20px;
  background: var(--paper);
  border: 3px solid var(--gold);
  border-radius: 14px;
  display: flex; align-items: center; gap: 14px;
  color: var(--ink);
  opacity: 0;
  transition: opacity 0.3s, transform 0.5s cubic-bezier(.2,1.5,.3,1);
  box-shadow: 0 20px 50px rgba(0,0,0,0.45), 0 0 60px rgba(200,162,75,0.35);
  pointer-events: none;
}
.badge-toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.badge-toast-medal {
  flex-shrink: 0;
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #f7dc8a, var(--gold) 60%, #8a6a2a);
  color: #3a2a10;
  box-shadow:
    0 4px 10px rgba(0,0,0,0.35),
    inset 0 -3px 6px rgba(0,0,0,0.2),
    inset 0 2px 4px rgba(255,255,255,0.5);
  animation: medal-spin 0.9s ease-out;
}
@keyframes medal-spin {
  from { transform: rotate(-180deg) scale(0.4); }
  to   { transform: rotate(0deg)    scale(1);   }
}
.badge-toast-body { flex: 1; min-width: 0; }
.badge-toast-label {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 2px;
}
.badge-toast-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--deep);
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-bottom: 3px;
}
.badge-toast-desc {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 12px;
  color: rgba(31,26,20,0.72);
  line-height: 1.35;
}

/* ===== Globe 2D labels (country + capital) ===== */
.globe-label {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  color: var(--gold);
  text-align: center;
  pointer-events: none;
  transform: translate(-50%, -100%);
  opacity: 0;
  transition: opacity 0.25s ease;
  text-shadow: 0 1px 6px rgba(0,0,0,0.9), 0 0 14px rgba(0,0,0,0.7);
  white-space: nowrap;
  line-height: 1;
  padding: 4px 8px;
  background: rgba(5,8,12,0.35);
  border: 1px solid rgba(200,162,75,0.35);
  border-radius: 6px;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.globe-label .country-name {
  display: block;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.globe-label .capital {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: rgba(245,241,232,0.82);
}

/* ===== Mute button (top-right fab) ===== */
.mute-btn {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: 70px;
  z-index: 12;
  width: 40px; height: 40px;
  border-radius: 999px;
  background: rgba(5,8,12,0.55);
  border: 1px solid rgba(245,241,232,0.18);
  color: var(--paper);
  display: grid; place-items: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.15s, color 0.15s;
}
.mute-btn:hover { background: rgba(5,8,12,0.75); }
.mute-btn.muted { color: rgba(245,241,232,0.6); }

/* ===== Passport button (bottom-right) ===== */
.passport-btn {
  position: fixed;
  right: 16px;
  bottom: calc(32px + env(safe-area-inset-bottom));
  z-index: 12;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px 10px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(200,162,75,0.95), rgba(170,135,55,0.95));
  color: var(--ink);
  border: 1px solid rgba(255,230,170,0.5);
  cursor: pointer;
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45), 0 0 0 1px rgba(200,162,75,0.2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 0.15s;
}
.passport-btn:hover { transform: translateY(-1px); }
.passport-btn .passport-icon { display: grid; place-items: center; width: 22px; height: 22px; }
.passport-btn .passport-count {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 13px;
  margin-left: 4px;
  padding-left: 8px;
  border-left: 1px solid rgba(31,26,20,0.3);
}

/* ===== Passport panel ===== */
.passport-backdrop {
  position: fixed; inset: 0;
  background: rgba(5,8,12,0.65);
  z-index: 80;
  opacity: 0; transition: opacity 0.22s;
}
.passport-backdrop.show { opacity: 1; }
.passport-panel {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  z-index: 90;
  width: min(560px, 94vw);
  max-height: 88vh;
  background: var(--paper);
  color: var(--ink);
  border-radius: 18px;
  padding: 22px 22px 24px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.55), inset 0 0 0 1px rgba(200,162,75,0.15);
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s cubic-bezier(.2,.8,.2,1);
  overflow-y: auto;
  background-image:
    radial-gradient(rgba(200,162,75,0.08) 1px, transparent 1px);
  background-size: 14px 14px;
}
.passport-panel.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.passport-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.passport-head .eyebrow { color: var(--rust); margin-bottom: 4px; }
.passport-head h2 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 26px;
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.passport-head .progress {
  font-size: 13px;
  color: rgba(31,26,20,0.6);
  margin-top: 4px;
  letter-spacing: 0.04em;
}
.passport-close {
  background: rgba(31,26,20,0.06);
  border: 1px solid rgba(31,26,20,0.12);
  color: var(--ink);
  border-radius: 999px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.passport-close:hover { background: rgba(31,26,20,0.12); }
.passport-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.stamp-cell {
  aspect-ratio: 1 / 1;
  display: grid; place-items: center;
  cursor: pointer;
  position: relative;
}
.stamp-ring {
  width: 100%; height: 100%;
  border: 2.5px dashed rgba(31,26,20,0.22);
  border-radius: 50%;
  display: grid; place-items: center;
  padding: 10px;
  text-align: center;
  transition: transform 0.18s;
  background: rgba(255,255,255,0.35);
}
.stamp-cell:hover .stamp-ring { transform: scale(1.03); }
.stamp-inner {
  font-family: 'Playfair Display', serif;
  color: rgba(31,26,20,0.3);
}
.stamp-vol {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}
.stamp-country {
  font-size: 16px;
  font-weight: 700;
  margin: 3px 0 4px;
  text-wrap: balance;
}
.stamp-date {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}
.stamp-cell.stamped .stamp-ring {
  border: 3px solid var(--gold);
  border-style: solid;
  background: rgba(200,162,75,0.08);
  box-shadow: inset 0 0 0 1px rgba(200,162,75,0.2), 0 4px 14px rgba(200,162,75,0.18);
  transform: rotate(-4deg);
}
.stamp-cell.stamped .stamp-inner {
  color: var(--rust);
  transform: rotate(2deg);
}
.stamp-cell.stamped .stamp-vol { color: var(--gold); }
.stamp-cell.stamped .stamp-country { color: var(--deep); }

@media (max-width: 480px) {
  .passport-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .stamp-vol { font-size: 9px; }
  .stamp-country { font-size: 13px; }
  .stamp-date { font-size: 8px; }
  .passport-head h2 { font-size: 22px; }
}

/* ===== First-visit stamp burst ===== */
.stamp-burst {
  position: fixed; inset: 0;
  z-index: 95;
  pointer-events: none;
  display: grid; place-items: center;
  opacity: 0;
  transition: opacity 0.18s;
}
.stamp-burst.show { opacity: 1; }
.stamp-burst-card {
  background: var(--paper);
  color: var(--ink);
  padding: 22px 34px 22px;
  border: 3px solid var(--gold);
  border-radius: 10px;
  font-family: 'Playfair Display', serif;
  text-align: center;
  transform: rotate(-6deg) scale(0.4);
  transition: transform 0.55s cubic-bezier(.2,1.6,.3,1);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
  position: relative;
}
.stamp-burst.show .stamp-burst-card { transform: rotate(-6deg) scale(1); }
.stamp-burst-card::before, .stamp-burst-card::after {
  content: '';
  position: absolute;
  inset: -8px;
  border: 1.5px dashed var(--gold);
  border-radius: 14px;
  pointer-events: none;
  opacity: 0.5;
}
.stamp-burst-card::after { inset: -14px; opacity: 0.3; }
.stamp-burst-vol {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rust);
  font-weight: 600;
  margin-bottom: 4px;
}
.stamp-burst-country {
  font-size: 32px;
  font-weight: 700;
  color: var(--deep);
  letter-spacing: -0.01em;
  margin: 2px 0 6px;
}
.stamp-burst-label {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 4px;
}
.stamp-burst-date {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 12px;
  color: rgba(31,26,20,0.6);
  letter-spacing: 0.08em;
}

/* ===== Celebration — all 9 collected ===== */
.celebration {
  position: fixed; inset: 0;
  z-index: 100;
  display: grid; place-items: center;
  background: radial-gradient(ellipse at center, rgba(200,162,75,0.18), rgba(5,8,12,0.85) 55%);
  opacity: 0;
  transition: opacity 0.45s;
  overflow: hidden;
  cursor: pointer;
}
.celebration.show { opacity: 1; }
.celebration-burst {
  position: absolute; inset: 0;
  background:
    conic-gradient(from 0deg,
      rgba(200,162,75,0) 0deg,
      rgba(200,162,75,0.25) 15deg,
      rgba(200,162,75,0) 30deg,
      rgba(200,162,75,0.25) 45deg,
      rgba(200,162,75,0) 60deg,
      rgba(200,162,75,0.25) 75deg,
      rgba(200,162,75,0) 90deg,
      rgba(200,162,75,0.25) 105deg,
      rgba(200,162,75,0) 120deg,
      rgba(200,162,75,0.25) 135deg,
      rgba(200,162,75,0) 150deg,
      rgba(200,162,75,0.25) 165deg,
      rgba(200,162,75,0) 180deg,
      rgba(200,162,75,0.25) 195deg,
      rgba(200,162,75,0) 210deg,
      rgba(200,162,75,0.25) 225deg,
      rgba(200,162,75,0) 240deg,
      rgba(200,162,75,0.25) 255deg,
      rgba(200,162,75,0) 270deg,
      rgba(200,162,75,0.25) 285deg,
      rgba(200,162,75,0) 300deg,
      rgba(200,162,75,0.25) 315deg,
      rgba(200,162,75,0) 330deg,
      rgba(200,162,75,0.25) 345deg,
      rgba(200,162,75,0) 360deg
    );
  animation: spin-burst 18s linear infinite;
  mask-image: radial-gradient(ellipse, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse, black 30%, transparent 75%);
}
.celebration-card {
  position: relative;
  text-align: center;
  color: var(--paper);
  padding: 40px 50px;
  transform: scale(0.6);
  transition: transform 0.75s cubic-bezier(.2,1.6,.3,1);
  max-width: 92vw;
}
.celebration.show .celebration-card { transform: scale(1); }
.celebration-eyebrow {
  font-family: 'Source Sans 3', sans-serif;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 12px;
}
.celebration-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(38px, 9vw, 68px);
  font-weight: 700;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
  text-shadow: 0 4px 30px rgba(200,162,75,0.55);
  line-height: 1.05;
  color: var(--gold);
}
.celebration-sub {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  color: rgba(245,241,232,0.88);
  max-width: 440px;
  margin: 10px auto 0;
  line-height: 1.5;
  text-wrap: balance;
}
.celebration-hint {
  margin-top: 20px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(245,241,232,0.5);
}
@keyframes spin-burst {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* small screens */
@media (max-width: 380px) {
  .hero-copy h1 { font-size: 28px; }
  .hero-copy .sub { font-size: 14px; }
  .legend { font-size: 11px; padding: 7px 12px; gap: 12px; }
  .passport-btn { font-size: 12px; padding: 9px 12px 9px 10px; }
  .globe-label .country-name { font-size: 10px; }
  .globe-label .capital { font-size: 9px; }
}

/* ===== Zoom bar (right-edge vertical control) ===== */
.zoom-bar {
  position: fixed;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 11;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 6px;
  border-radius: 22px;
  background: rgba(5,8,12,0.45);
  border: 1px solid rgba(245,241,232,0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
  pointer-events: auto;
}
.zoom-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(245,241,232,0.10);
  border: 1px solid rgba(245,241,232,0.24);
  color: var(--paper);
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
  padding: 0;
  transition: background 0.15s, transform 0.1s;
}
.zoom-btn:hover { background: rgba(245,241,232,0.20); }
.zoom-btn:active { transform: scale(0.94); }
.zoom-bar input[type="range"] {
  -webkit-appearance: slider-vertical;
  appearance: slider-vertical;
  writing-mode: bt-lr; /* legacy */
  width: 30px;
  height: 140px;
  background: transparent;
  cursor: pointer;
}
/* Webkit track + thumb (vertical via appearance above) */
.zoom-bar input[type="range"]::-webkit-slider-runnable-track {
  width: 4px;
  background: rgba(245,241,232,0.22);
  border-radius: 2px;
}
.zoom-bar input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--gold, #C8A24B);
  border: 2px solid rgba(31,26,20,0.6);
  cursor: pointer;
  margin-left: -5px;
}
.zoom-bar input[type="range"]::-moz-range-track {
  width: 4px;
  background: rgba(245,241,232,0.22);
  border-radius: 2px;
}
.zoom-bar input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--gold, #C8A24B);
  border: 2px solid rgba(31,26,20,0.6);
  cursor: pointer;
}

@media (max-width: 520px) {
  .zoom-bar { right: 8px; padding: 8px 4px; gap: 6px; }
  .zoom-btn { width: 26px; height: 26px; font-size: 16px; }
  .zoom-bar input[type="range"] { height: 110px; width: 26px; }
}
