/* ─────────────────────────────────────────────────────── */
/* Screecher Jones' Treasure Tour                          */
/* Shaka Guide-inspired: deep navy, warm gold, clean UI    */
/* ─────────────────────────────────────────────────────── */

/* Prevent browser pinch-zoom from shrinking the whole page. */
/* touch-action only on the map app, not the splash/payment screens */
#app {
  touch-action: pan-x pan-y;
}
/* Let the map handle its own pinch-zoom via Leaflet */
#map {
  touch-action: auto !important;
}

/* ── FONT LOADING ───────────────────────────────────────── */
@import url('https://api.fontshare.com/v2/css?f[]=satoshi@300,400,500,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&display=swap');

/* ── DESIGN TOKENS ─────────────────────────────────────── */
:root {
  --font-display: 'Instrument Serif', 'Georgia', serif;
  --font-body:    'Satoshi', 'Helvetica Neue', sans-serif;

  /* Brand palette */
  --navy:         #0b1929;
  --navy-mid:     #112238;
  --navy-light:   #1a3050;
  --navy-surface: #0f2035;

  --gold:         #c4862a;
  --gold-light:   #edb95a;
  --gold-dim:     #7a5218;
  --gold-faint:   rgba(196, 134, 42, 0.12);

  --white:        #ffffff;
  --text-primary: #f0e8d8;
  --text-muted:   rgba(240, 232, 216, 0.6);
  --text-faint:   rgba(240, 232, 216, 0.35);

  /* Surfaces */
  --surface-1: #0f2035;
  --surface-2: #142844;
  --surface-3: #1a3050;
  --border:    rgba(196, 134, 42, 0.18);

  /* Type scale (fluid) */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);

  /* Spacing (4px grid) */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Radii */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --ease: 200ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.6);
}

/* ── BASE RESET ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--navy);
  overflow-x: hidden;
  overflow-y: auto;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

ul[role='list'], ol[role='list'] { list-style: none; }

input, button, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
  line-height: 1.15;
}

button { cursor: pointer; background: none; border: none; }

.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════ */
/* SPLASH SCREEN                                              */
/* ═══════════════════════════════════════════════════════════ */

.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--navy);
}

.splash-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 60% at 50% 0%, rgba(196,134,42,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 80% 80% at 80% 100%, rgba(17,34,56,0.9) 0%, transparent 60%),
    linear-gradient(180deg, #0b1929 0%, #0f2035 100%);
  pointer-events: none;
}

/* Subtle animated shimmer lines */
.splash-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    135deg,
    transparent 0,
    transparent 60px,
    rgba(196,134,42,0.025) 60px,
    rgba(196,134,42,0.025) 61px
  );
}

.splash-phase {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  padding: var(--space-8) var(--space-6) var(--space-10);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-5);
}

/* ── Phase 1: Intro ───────────────────────────── */

.intro-mascot-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--surface-1);
  box-shadow: 0 0 0 6px rgba(196,134,42,0.08), var(--shadow-lg);
  flex-shrink: 0;
}

.intro-mascot-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: opacity 0.2s ease;
}

.intro-greeting {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-xl);
  color: var(--gold-light);
  letter-spacing: 0.02em;
}

.intro-speaking {
  font-size: var(--text-sm);
  color: var(--text-muted);
  min-height: 2.5em;
  line-height: 1.5;
  max-width: 36ch;
}

.intro-audio-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.intro-ctrl-btn {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: var(--text-xs);
  transition: all var(--ease);
}
.intro-ctrl-btn:hover {
  border-color: var(--gold);
  color: var(--gold-light);
  background: var(--surface-3);
}

.intro-pause-btn {
  background: var(--gold-faint);
  border-color: var(--gold);
  color: var(--gold-light);
  padding: var(--space-2) var(--space-5);
}
.intro-pause-btn:hover {
  background: rgba(196,134,42,0.2);
}

.intro-nav-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  transition: all var(--ease);
  box-shadow: 0 4px 16px rgba(196,134,42,0.35);
  flex-shrink: 0;
}
.intro-nav-btn:hover {
  background: var(--gold-light);
  transform: scale(1.05);
}

.intro-next-btn {
  margin-top: var(--space-2);
}

/* ── Phase 2: Direction Picker ────────────────── */

.mascot-splash {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--surface-1);
  box-shadow: 0 0 0 6px rgba(196,134,42,0.08), var(--shadow-lg);
  flex-shrink: 0;
}

.mascot-img-splash {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.splash-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-xl);
  color: var(--gold-light);
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.splash-subtitle {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: calc(-1 * var(--space-3));
}

.splash-tagline {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 38ch;
}

/* Direction picker */
.direction-picker {
  width: 100%;
}

.direction-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-3);
  font-style: italic;
}

.direction-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.dir-btn {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: left;
  transition: all var(--ease);
  width: 100%;
}
.dir-btn:hover {
  background: var(--surface-2);
  border-color: var(--gold);
  transform: translateX(2px);
}
.dir-btn:active {
  transform: translateX(0);
}

.dir-arrow {
  font-size: 1.5rem;
  width: 36px;
  text-align: center;
  flex-shrink: 0;
}

.dir-name {
  display: block;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
}

.dir-desc {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.gps-note {
  font-size: var(--text-xs);
  color: var(--text-faint);
  line-height: 1.5;
  max-width: 38ch;
}

/* CTA pill */
.plunder-cta {
  display: block;
  text-decoration: none;
  width: 100%;
}

.plunder-cta-inner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--gold-faint);
  border: 1px solid rgba(196,134,42,0.3);
  border-radius: var(--radius-lg);
  transition: all var(--ease);
}
.plunder-cta:hover .plunder-cta-inner {
  background: rgba(196,134,42,0.18);
  border-color: var(--gold);
}

.plunder-coin {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.plunder-cta-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.plunder-cta-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gold-light);
}

.plunder-cta-sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.plunder-cta-arrow {
  font-size: 1.25rem;
  color: var(--gold);
  flex-shrink: 0;
}

.intro-back-btn {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ease);
}
.intro-back-btn:hover {
  border-color: var(--gold);
  color: var(--gold-light);
}

/* ═══════════════════════════════════════════════════════════ */
/* MAIN APP SHELL                                             */
/* ═══════════════════════════════════════════════════════════ */

.app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--navy);
  overflow: hidden;
}

/* ── App Header ──────────────────────────────── */
.app-header {
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
  background: var(--navy);
  border-bottom: 1px solid var(--border);
  z-index: 10;
  position: relative;
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.header-mascot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}

.header-gull-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.header-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.25rem);
  color: var(--gold-light);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* Icon button */
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ease);
  border: 1px solid transparent;
  flex-shrink: 0;
}
.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text-primary);
  border-color: var(--border);
}

/* Deals coin button */
.deals-header-btn {
  font-size: 1.1rem;
  line-height: 1;
}

/* TTS toggle */
.tts-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ease);
}
.tts-toggle:hover { color: var(--gold-light); }
.tts-toggle.active { color: var(--gold); }

/* GPS indicator */
.gps-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  flex-shrink: 0;
}
/* Status classes land on the parent .gps-indicator, so target child .dot from there */
.gps-indicator.active .dot { background: #4ade80; box-shadow: 0 0 6px rgba(74,222,128,0.5); }
.gps-indicator.searching .dot { background: var(--gold); animation: pulse-dot 1.4s ease-in-out infinite; }
.gps-indicator.error .dot { background: #f87171; }
/* legacy: in case .dot class is set directly */
.dot.active { background: #4ade80; box-shadow: 0 0 6px rgba(74,222,128,0.5); }
.dot.searching { background: var(--gold); animation: pulse-dot 1.4s ease-in-out infinite; }
.dot.error { background: #f87171; }

/* ── User location marker on the map ── */
.user-location-marker {
  background: transparent !important;
  border: none !important;
}
.loc-dot {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #4a9eff;
  border: 2.5px solid #fff;
  box-shadow: 0 0 6px rgba(74,158,255,0.7);
  z-index: 2;
}
.loc-pulse-ring {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(74,158,255,0.5);
  animation: loc-pulse 2s ease-out infinite;
  z-index: 1;
}
@keyframes loc-pulse {
  0%   { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.gps-label {
  display: none;
}
@media (min-width: 480px) {
  .gps-label { display: inline; }
}

/* ── Map Area ────────────────────────────────── */
.map-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

#map {
  width: 100%;
  height: 100%;
}

/* Compass rose */
.map-deco-overlay {
  position: absolute;
  bottom: var(--space-4);
  left: var(--space-4);
  z-index: 5;
  pointer-events: none;
  opacity: 0.7;
}

.map-compass {
  width: 64px;
  height: 64px;
}

/* Map overlay card (mini stop card on map) */
.map-overlay-card {
  position: absolute;
  bottom: var(--space-4);
  right: var(--space-4);
  z-index: 5;
  max-width: 200px;
  background: rgba(11, 25, 41, 0.88);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
  display: none;
}
.map-overlay-card.visible { display: block; }

.stop-card-inner {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── Stop Panel (slides up from bottom) ──────── */
.stop-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--surface-1);
  border-top: 1px solid var(--border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  transform: translateY(calc(100% - 68px));
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 80dvh;
  will-change: transform;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
  overflow: hidden;
  pointer-events: none; /* don't block taps when peeking */
}
.stop-panel.open {
  transform: translateY(0);
  pointer-events: auto; /* restore when fully open */
}
/* Allow tapping anywhere in the 60px peek strip to open the panel */
.stop-panel .panel-drag-handle {
  pointer-events: auto;
  /* Expand tap target to cover the full peek strip */
  padding: 20px 0 16px;
  margin: 0 auto var(--space-2);
  cursor: pointer;
}

.panel-drag-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: var(--radius-full);
  margin: var(--space-3) auto var(--space-4);
  cursor: pointer;
  flex-shrink: 0;
}
.panel-drag-handle:hover { background: var(--gold-dim); }

.panel-scroll {
  overflow-y: auto;
  max-height: calc(80dvh - 24px);
  padding: 0 var(--space-5) max(var(--space-8), calc(env(safe-area-inset-bottom, 0px) + 80px));
  -webkit-overflow-scrolling: touch;
}

/* Panel header */
.panel-header {
  margin-bottom: var(--space-4);
}

.panel-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.stop-number-badge {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-faint);
  border: 1px solid rgba(196,134,42,0.25);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}

.panel-tts-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.tts-play-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--gold);
  color: var(--navy);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  transition: all var(--ease);
  border: none;
  white-space: nowrap;
}
.tts-play-btn:hover { background: var(--gold-light); }
.tts-play-btn.playing {
  background: var(--surface-3);
  color: var(--gold-light);
  border: 1px solid var(--border);
}

.tts-stop-btn,
.tts-skip-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ease);
}
.tts-stop-btn:hover,
.tts-skip-btn:hover {
  border-color: var(--gold);
  color: var(--gold-light);
}

.panel-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.panel-location {
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Pirate speech bubble */
.pirate-speech-bubble {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  margin-bottom: var(--space-5);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.bubble-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  background: var(--surface-1);
}
.bubble-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.bubble-text {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}

/* Stop facts */
.stop-facts {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.stop-fact-item {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.fact-icon {
  width: 28px;
  height: 28px;
  background: var(--gold-faint);
  border: 1px solid rgba(196,134,42,0.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.fact-text {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.5;
  padding-top: var(--space-1);
}

/* Stop actions */
.stop-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
  position: sticky;
  bottom: 0;
  background: var(--surface-1);
  padding: var(--space-3) 0 max(var(--space-4), env(safe-area-inset-bottom, 16px));
  margin-left: calc(-1 * var(--space-5));
  margin-right: calc(-1 * var(--space-5));
  padding-left: var(--space-5);
  padding-right: var(--space-5);
  border-top: 1px solid var(--border);
  z-index: 2;
}

/* ── Action Buttons ──────────────────────────── */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  border: none;
  transition: all var(--ease);
  white-space: nowrap;
  text-decoration: none;
}

.action-btn.primary {
  background: var(--gold);
  color: var(--navy);
  flex: 1;
}
.action-btn.primary:hover { background: var(--gold-light); }

.action-btn.secondary {
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border);
  flex: 1;
}
.action-btn.secondary:hover {
  background: var(--surface-3);
  border-color: var(--gold-dim);
}

.action-btn.full-width { width: 100%; }

/* ── Progress Bar ────────────────────────────── */
.progress-bar-wrap {
  position: fixed;
  bottom: 60px;
  left: var(--space-4);
  right: var(--space-4);
  z-index: 199;
  pointer-events: none; /* never block splash taps */
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: rgba(11, 25, 41, 0.88);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.progress-bar-track {
  flex: 1;
  height: 4px;
  background: var(--surface-3);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold-light));
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════ */
/* SIDEBAR MENUS                                              */
/* ═══════════════════════════════════════════════════════════ */

/* Overlay */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease);
}
.overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Stops sidebar */
.stops-menu {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 40;
  width: min(320px, 90vw);
  background: var(--navy-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.stops-menu.open { transform: translateX(0); }

/* Deals sidebar */
.deals-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  width: min(320px, 90vw);
  background: var(--navy-surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.deals-menu.open { transform: translateX(0); }

/* Menu header */
.stops-menu-header,
.deals-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.stops-menu-header h3,
.deals-menu-header h3 {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--gold-light);
}

/* Stops list */
.stops-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) 0;
  -webkit-overflow-scrolling: touch;
}

.stop-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-5);
  cursor: pointer;
  transition: background var(--ease);
  border-bottom: 1px solid rgba(196,134,42,0.06);
}
.stop-item:hover { background: var(--surface-2); }
.stop-item.active { background: var(--surface-2); }

.stop-num-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}
.stop-item.active .stop-num-circle,
.stop-item.visited .stop-num-circle {
  background: var(--gold-faint);
  border-color: var(--gold);
  color: var(--gold-light);
}

.stop-item-name {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.3;
}
.stop-item.active .stop-item-name { color: var(--text-primary); font-weight: 600; }

/* Menu footer */
.menu-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Deals list */
.deals-menu-intro {
  font-size: var(--text-sm);
  color: var(--text-muted);
  padding: var(--space-4) var(--space-5);
  line-height: 1.5;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.deals-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3) 0;
  -webkit-overflow-scrolling: touch;
}

.deal-item {
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid rgba(196,134,42,0.06);
}

.deal-item-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.deal-item-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.4;
}

.deal-item-badge {
  display: inline-block;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--gold);
  background: var(--gold-faint);
  border: 1px solid rgba(196,134,42,0.25);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
}

.deals-menu-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.deals-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--gold);
  color: var(--navy);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
  transition: all var(--ease);
  width: 100%;
  margin-bottom: var(--space-3);
}
.deals-cta-btn:hover { background: var(--gold-light); }

.deals-footer-note {
  font-size: var(--text-xs);
  color: var(--text-faint);
  text-align: center;
  line-height: 1.4;
}

/* ── Deal nudge pill ─────────────────────────── */
.deal-nudge {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  background: var(--gold);
  color: var(--navy);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(196,134,42,0.45);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}
.deal-nudge.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.deal-nudge:hover { background: var(--gold-light); }

.nudge-coin { font-size: 1rem; }
.nudge-arrow { font-size: 1rem; }

/* ═══════════════════════════════════════════════════════════ */
/* TREASURE FOUND OVERLAY                                     */
/* ═══════════════════════════════════════════════════════════ */

.treasure-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.treasure-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.treasure-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.treasure-content {
  position: relative;
  z-index: 2;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-6);
  max-width: 340px;
  width: 90%;
  text-align: center;
  box-shadow: 0 0 60px rgba(196,134,42,0.2), var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.treasure-mascot {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--surface-2);
  box-shadow: 0 0 0 6px rgba(196,134,42,0.08);
}

.treasure-gull-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.treasure-stop-name {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-faint);
  border: 1px solid rgba(196,134,42,0.25);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}

.treasure-headline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-xl);
  color: var(--gold-light);
  line-height: 1.2;
}

.treasure-sub {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.treasure-dismiss {
  width: 100%;
  margin-top: var(--space-2);
}

/* Coin burst particles */
.coins-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: var(--radius-xl);
}

.coin-particle {
  position: absolute;
  font-size: 1.25rem;
  animation: coin-fly 1.2s ease-out forwards;
  bottom: 20%;
  left: 50%;
}

@keyframes coin-fly {
  0% {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateX(calc(-50% + var(--dx, 0px))) translateY(var(--dy, -80px)) scale(0.5);
    opacity: 0;
  }
}

/* ═══════════════════════════════════════════════════════════ */
/* TOAST                                                      */
/* ═══════════════════════════════════════════════════════════ */

.toast {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 300;
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════════════════════════ */
/* LEAFLET MAP OVERRIDES                                      */
/* ═══════════════════════════════════════════════════════════ */

/* Keep Leaflet controls visible */
.leaflet-top, .leaflet-bottom { z-index: 5; }
.leaflet-control-zoom a {
  background: var(--surface-1) !important;
  color: var(--text-muted) !important;
  border-color: var(--border) !important;
}
.leaflet-control-zoom a:hover {
  background: var(--surface-2) !important;
  color: var(--gold-light) !important;
}

/* Stop markers */
.tour-stop-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--navy-mid);
  border: 2px solid var(--gold-dim);
  color: var(--gold-light);
  font-size: 0.625rem;
  font-weight: 700;
  font-family: var(--font-body);
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  cursor: pointer;
  transition: all 0.2s ease;
}
.tour-stop-marker.active {
  background: var(--gold);
  border-color: var(--gold-light);
  color: var(--navy);
  transform: scale(1.25);
  box-shadow: 0 4px 16px rgba(196,134,42,0.5);
  z-index: 10 !important;
}
.tour-stop-marker.visited {
  background: var(--surface-3);
  border-color: var(--gold-dim);
  opacity: 0.7;
}

/* User location dot */
.user-location-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #60a5fa;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 4px rgba(96,165,250,0.25), 0 2px 8px rgba(0,0,0,0.4);
  animation: location-pulse 2s ease-in-out infinite;
}

@keyframes location-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(96,165,250,0.25), 0 2px 8px rgba(0,0,0,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(96,165,250,0.1), 0 2px 8px rgba(0,0,0,0.4); }
}

/* ═══════════════════════════════════════════════════════════ */
/* RESPONSIVE                                                 */
/* ═══════════════════════════════════════════════════════════ */

@media (min-width: 640px) {
  .stop-panel {
    max-width: 420px;
    right: auto;
    left: var(--space-4);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    bottom: var(--space-4);
    transform: translateY(calc(100% + var(--space-4)));
  }
  .stop-panel.open {
    transform: translateY(0);
  }
  .progress-bar-wrap {
    bottom: var(--space-4);
    left: calc(420px + var(--space-8));
  }
}

@media (max-width: 380px) {
  .intro-mascot-wrap {
    width: 140px;
    height: 140px;
  }
  .splash-phase {
    padding: var(--space-6) var(--space-4);
    gap: var(--space-4);
  }
}

/* ═══════════════════════════════════════════════════════════ */
/* REDUCED MOTION                                             */
/* ═══════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════ */
/* CREW SIGN-UP OVERLAY                                       */
/* ═══════════════════════════════════════════════════════════ */

.crew-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.crew-overlay.hidden { display: none !important; }

.crew-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.crew-content {
  position: relative;
  z-index: 2;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-6) var(--space-5) var(--space-8);
  width: 100%;
  max-width: 520px;
  max-height: 92dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  text-align: center;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
}

/* Drag indicator */
.crew-content::before {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: var(--radius-full);
  flex-shrink: 0;
  margin-bottom: var(--space-2);
}

.crew-mascot {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--surface-2);
  box-shadow: 0 0 0 6px rgba(196,134,42,0.08);
  flex-shrink: 0;
}
.crew-mascot-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.crew-badge {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-faint);
  border: 1px solid rgba(196,134,42,0.25);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}

.crew-headline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-xl);
  color: var(--gold-light);
  line-height: 1.2;
}

.crew-sub {
  font-size: var(--text-sm);
  color: var(--text-muted);
  max-width: 36ch;
  line-height: 1.5;
  margin-top: calc(-1 * var(--space-2));
}

/* Form */
.crew-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  text-align: left;
}

.crew-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.crew-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.crew-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-family: var(--font-body);
  transition: border-color var(--ease);
  -webkit-appearance: none;
}
.crew-input:focus {
  outline: none;
  border-color: var(--gold);
}
.crew-input::placeholder { color: var(--text-faint); }

.crew-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c4862a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-10);
}

/* Local / Visitor toggle */
.crew-toggle-group {
  display: flex;
  gap: var(--space-2);
}

.crew-toggle-btn {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--ease);
}
.crew-toggle-btn.active {
  background: var(--gold-faint);
  border-color: var(--gold);
  color: var(--gold-light);
  font-weight: 700;
}
.crew-toggle-btn:hover:not(.active) {
  border-color: var(--gold-dim);
  color: var(--text-primary);
}

/* Vote grid */
.crew-vote-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.crew-vote-btn {
  padding: var(--space-3) var(--space-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--ease);
  text-align: center;
}
.crew-vote-btn.selected {
  background: var(--gold-faint);
  border-color: var(--gold);
  color: var(--gold-light);
  font-weight: 700;
}
.crew-vote-btn:hover:not(.selected) {
  border-color: var(--gold-dim);
  color: var(--text-primary);
}

.crew-other-input {
  margin-top: var(--space-2);
}

/* Error */
.crew-error {
  font-size: var(--text-sm);
  color: #f87171;
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.25);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  text-align: center;
}
.crew-error.hidden { display: none; }

/* Submit */
.crew-submit {
  margin-top: var(--space-2);
  font-size: var(--text-base);
  padding: var(--space-4);
}

/* Skip link */
.crew-skip {
  font-size: var(--text-xs);
  color: var(--text-faint);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--ease);
  padding: var(--space-1) 0;
}
.crew-skip:hover { color: var(--text-muted); }

/* Confirmation state */
.crew-confirm {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  text-align: center;
  padding: var(--space-4) 0;
}

.crew-confirm-icon {
  font-size: 3rem;
}

.crew-confirm-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-xl);
  color: var(--gold-light);
}

.crew-confirm-sub {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 34ch;
}

/* ═══════════════════════════════════════════════════════════ */
/* EMAIL GATE FORM (Phase 2)                                  */
/* ═══════════════════════════════════════════════════════════ */

.gate-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  text-align: left;
}

.gate-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.gate-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.gate-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-family: var(--font-body);
  transition: border-color var(--ease);
  -webkit-appearance: none;
}
.gate-input:focus {
  outline: none;
  border-color: var(--gold);
}
.gate-input::placeholder { color: var(--text-faint); }

.gate-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c4862a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  background-color: var(--surface-2);
  padding-right: var(--space-10);
}

.gate-error {
  font-size: var(--text-sm);
  color: #f87171;
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.25);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  text-align: center;
}
.gate-error.hidden { display: none; }

.gate-submit {
  font-size: var(--text-base);
  padding: var(--space-4);
  margin-top: var(--space-2);
}

.gate-fine-print {
  font-size: var(--text-xs);
  color: var(--text-faint);
  text-align: center;
  line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════ */
/* SELFIE SCREEN                                              */
/* ═══════════════════════════════════════════════════════════ */

.selfie-screen {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.selfie-screen.hidden { display: none !important; }

.selfie-step {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.selfie-step.hidden { display: none !important; }

/* ── Step 1: Prompt ── */
.selfie-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 60% at 50% 0%, rgba(196,134,42,0.08) 0%, transparent 70%),
    linear-gradient(180deg, #0b1929 0%, #0f2035 100%);
  pointer-events: none;
  z-index: 0;
}

.selfie-prompt-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  padding: var(--space-10) var(--space-6) var(--space-8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
  text-align: center;
}

.selfie-mascot {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--surface-1);
  box-shadow: 0 0 0 6px rgba(196,134,42,0.08), var(--shadow-lg);
  flex-shrink: 0;
}
.selfie-mascot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.selfie-badge {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-faint);
  border: 1px solid rgba(196,134,42,0.25);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}

.selfie-headline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-xl);
  color: var(--gold-light);
  line-height: 1.2;
}

.selfie-sub {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 36ch;
}
.selfie-sub strong { color: var(--gold-light); }

.selfie-prompt-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: center;
}

.selfie-cta {
  width: 100%;
  font-size: var(--text-base);
  padding: var(--space-4);
}

.selfie-skip-btn {
  font-size: var(--text-xs);
  color: var(--text-faint);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--ease);
  padding: var(--space-1) 0;
}
.selfie-skip-btn:hover { color: var(--text-muted); }

.selfie-vote-wrap {
  width: 100%;
  border-top: 1px solid var(--border);
  padding-top: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  text-align: left;
}

.selfie-vote-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.selfie-vote-grid {
  grid-template-columns: 1fr 1fr;
}

/* ── Step 2: Camera ── */
.selfie-camera-wrap {
  position: relative;
  width: 100%;
  height: 100dvh;
  background: #000;
  overflow: hidden;
}

#selfie-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* mirror front camera for natural selfie feel */
  transform: scaleX(-1);
}
#selfie-video.rear-cam { transform: scaleX(1); }

.selfie-border-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.selfie-border-overlay svg {
  width: 100%;
  height: 100%;
}

.selfie-shutter {
  position: absolute;
  bottom: max(40px, env(safe-area-inset-bottom, 40px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.selfie-shutter-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.85);
  transition: all 0.15s ease;
}
.selfie-shutter-dot {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  transition: all 0.15s ease;
}
.selfie-shutter:active .selfie-shutter-dot { transform: scale(0.88); background: #fff; }
.selfie-shutter:active .selfie-shutter-ring { border-color: var(--gold-light); }

.selfie-flip-btn {
  position: absolute;
  bottom: max(52px, calc(env(safe-area-inset-bottom, 40px) + 12px));
  right: var(--space-8);
  z-index: 10;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all var(--ease);
}
.selfie-flip-btn:hover { background: rgba(0,0,0,0.6); }

.selfie-cancel-btn {
  position: absolute;
  top: max(16px, env(safe-area-inset-top, 16px));
  left: var(--space-4);
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all var(--ease);
}
.selfie-cancel-btn:hover { background: rgba(0,0,0,0.65); }

/* ── Step 3: Share ── */
.selfie-share-wrap {
  width: 100%;
  max-width: 480px;
  padding: var(--space-8) var(--space-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
}

.selfie-preview-label {
  width: 100%;
  display: flex;
  justify-content: center;
}

.selfie-preview-img-wrap {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.selfie-preview-img {
  width: 100%;
  height: auto;
  display: block;
}

.selfie-share-actions {
  width: 100%;
  display: flex;
  gap: var(--space-3);
}
.selfie-share-actions .action-btn { flex: 1; }

.selfie-share-btn {
  font-size: var(--text-base);
  padding: var(--space-4);
}

/* ═══════════════════════════════════════════════════════════ */
/* VIDEO INTRO                                                 */
/* ═══════════════════════════════════════════════════════════ */

/* Phase 1 — full-bleed inside the splash container */
#phase-intro {
  position: absolute;
  inset: 0;
  max-width: none;
  width: 100%;
  height: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  z-index: 3;
}

.intro-video-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.intro-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
}

.intro-video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(11,25,41,0.25) 0%,
    rgba(11,25,41,0.15) 35%,
    rgba(11,25,41,0.7)  70%,
    rgba(11,25,41,0.97) 100%
  );
}

/* Content pinned to bottom, above video */
.intro-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  padding: 0 var(--space-6) max(var(--space-10), env(safe-area-inset-bottom, 2.5rem));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  text-align: center;
}

/* ── App dimmed while gate overlay shows ── */
.app.gated {
  pointer-events: none;
  filter: brightness(0.35) blur(2px);
  transition: filter 0.3s ease;
}

/* ═══════════════════════════════════════════════════════════ */
/* HERO SPLASH (Phase 1 redesign — marketing-site style)      */
/* ═══════════════════════════════════════════════════════════ */

.intro-location {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.intro-headline {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.4rem + 3vw, 3rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--white);
  text-shadow: 0 2px 16px rgba(0,0,0,0.5);
}
.intro-headline em {
  font-style: italic;
  color: var(--gold-light);
}

.intro-tagline {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.75);
  line-height: 1.6;
  max-width: 38ch;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}

.intro-hero-btns {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
  max-width: 320px;
}

.intro-start-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: var(--radius-full);
  font-size: var(--text-base);
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--ease);
  box-shadow: 0 4px 20px rgba(196,134,42,0.4);
}
.intro-start-btn:hover { background: var(--gold-light); transform: translateY(-1px); }

.intro-watch-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  background: rgba(255,255,255,0.12);
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,0.4);
  border-radius: var(--radius-full);
  font-size: var(--text-base);
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--ease);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.intro-watch-btn:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.7);
}

/* ═══════════════════════════════════════════════════════════ */
/* VIDEO MODAL                                                 */
/* ═══════════════════════════════════════════════════════════ */

.intro-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.intro-modal.hidden { display: none !important; }

.intro-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.intro-modal-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 520px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.7);
}

.intro-modal-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
}

.intro-modal-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}
.intro-modal-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.intro-modal-name {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--gold-light);
}
.intro-modal-sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.intro-modal-close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--ease);
  flex-shrink: 0;
}
.intro-modal-close:hover { color: var(--white); border-color: var(--gold); }

.intro-modal-video {
  width: 100%;
  display: block;
  max-height: 70dvh;
  background: #000;
}

/* ══════════════════════════════════════════════
   PAYMENT GATE
   ══════════════════════════════════════════════ */

.payment-value-wrap {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(196,134,42,0.35);
  border-radius: 16px;
  padding: var(--sp-5) var(--sp-6);
  margin: var(--sp-6) 0;
  text-align: left;
}

.payment-price-badge {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 3.2rem;
  font-weight: 400;
  color: var(--gold-light, #edb95a);
  line-height: 1;
  margin-bottom: var(--sp-4);
  text-align: center;
}

.payment-perks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.payment-perks li {
  font-size: 0.875rem;
  color: rgba(240,235,224,0.88);
  padding: 4px 0;
  border-bottom: 1px solid rgba(196,134,42,0.12);
}

.payment-perks li:last-child { border-bottom: none; }

.payment-stripe-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.payment-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 18px 24px;
  background: var(--gold, #c4862a);
  color: #0b1929;
  border: none;
  border-radius: 50px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  box-shadow: 0 4px 24px rgba(196,134,42,0.35);
}

.payment-btn:hover { background: #d4952e; }
.payment-btn:active { transform: scale(0.97); }
.payment-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.payment-secure-note {
  font-size: 0.72rem;
  color: rgba(240,235,224,0.5);
  text-align: center;
  letter-spacing: 0.02em;
}

.payment-gift-wrap {
  border-top: 1px solid rgba(196,134,42,0.18);
  padding-top: var(--sp-5);
  margin-top: var(--sp-2);
}

.payment-gift-label {
  font-size: 0.8rem;
  color: rgba(240,235,224,0.5);
  margin-bottom: var(--sp-3);
  text-align: center;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.payment-code-row {
  display: flex;
  gap: var(--sp-2);
}

.payment-code-input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(196,134,42,0.3);
  border-radius: 10px;
  color: #f0ebe0;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
}

.payment-code-input:focus {
  border-color: rgba(196,134,42,0.7);
}

.payment-code-btn {
  padding: 12px 18px;
  background: rgba(196,134,42,0.18);
  border: 1px solid rgba(196,134,42,0.4);
  border-radius: 10px;
  color: var(--gold-light, #edb95a);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.payment-code-btn:hover { background: rgba(196,134,42,0.28); }

.payment-code-error {
  margin-top: var(--sp-2);
  font-size: 0.8rem;
  color: #ff6b6b;
  text-align: center;
}

/* ── Hide fixed tour UI when app is not active (splash/gate/payment screens) ── */
.app.hidden ~ .stop-panel,
.app.hidden ~ .progress-bar-wrap {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}
