:root {
  /* Surfaces — dark red chrome; gold/red accents */
  --color-bg: #0f0605;
  --color-bg-deep: #0a0303;
  --color-bg-raised: #1c0e0c;
  --color-bg-mid: #261412;
  --color-bg-overlay: rgba(12, 4, 3, 0.92);
  --color-bg-overlay-strong: rgba(10, 3, 3, 0.98);
  --color-bg-scrim: rgba(8, 3, 2, 0.72);
  --color-bg-scrim-heavy: rgba(6, 2, 2, 0.88);
  --color-border-chrome: rgba(255, 255, 255, 0.1);

  /* Gold */
  --color-gold: #ffd54a;
  --color-gold-dark: #f5b800;
  --color-gold-muted: rgba(255, 213, 74, 0.35);
  --color-gold-soft: rgba(255, 213, 74, 0.12);
  --color-gold-glow: rgba(255, 213, 74, 0.55);
  --color-on-gold: #1a1200;

  /* Dark red */
  --color-red: #8b2e28;
  --color-red-deep: #5c1814;
  --color-red-bright: #b84840;
  --color-red-muted: rgba(140, 46, 40, 0.45);
  --color-red-soft: rgba(166, 61, 53, 0.22);

  /* Warm neutrals */
  --color-text: #faf5f0;
  --color-text-secondary: #e8d5cc;
  --color-text-muted: rgba(250, 245, 240, 0.65);
  --color-text-dim: rgba(250, 245, 240, 0.45);
  --color-border: rgba(212, 140, 100, 0.2);
  --color-border-strong: rgba(212, 140, 100, 0.35);

  /* Active / success — warm gold (no blue/green) */
  --color-active: #e6b84a;
  --color-active-soft: rgba(255, 213, 74, 0.22);
  --color-active-border: rgba(255, 213, 74, 0.55);
  --color-active-text: #ffe9a8;

  /* Partner wordmark — modal size is ~20% larger than default */
  --partner-wordmark-width: min(73px, 18vw);
  --partner-wordmark-width-modal: min(88px, 22vw);

  --pin-fill: #c9a227;
  --pin-stroke: #f0d080;
}

.partner-wordmark {
  display: block;
  flex: 0 0 auto;
  width: var(--partner-wordmark-width);
  height: auto;
  margin: 0;
  object-fit: contain;
}

.partner-wordmark--modal {
  width: var(--partner-wordmark-width-modal);
}

.partner-brand-row {
  display: flex;
  align-items: center;
  gap: 10px 12px;
  min-width: 0;
}

.partner-brand-row__copy {
  min-width: 0;
  flex: 1;
}

.app-brand-mark {
  display: inline-flex;
  align-items: flex-start;
  flex: 0 0 auto;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #ffffff;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
}

.app-brand-mark__tm {
  font-size: 0.58em;
  line-height: 1;
  margin-left: 0.02em;
  font-weight: 700;
  letter-spacing: 0;
}

.app-brand-mark--header {
  font-size: 1.02rem;
}

.app-brand-mark--welcome {
  font-size: clamp(1.85rem, 7vw, 2.55rem);
  letter-spacing: 0.04em;
}

.app-brand-mark--welcome .app-brand-mark__tm {
  font-size: 0.48em;
}

.app-top-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
}

.welcome-screen__header {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  z-index: 2;
}

.nav-top-bar__brand {
  flex: 0 0 auto;
}

.permission-gate-modal__brand {
  display: block;
  margin: 0 auto 10px;
  text-align: center;
}

.treasure-chest__brand {
  flex: 0 0 auto;
}

.spirit-talk-overlay__brand {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  z-index: 2;
  pointer-events: none;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --fab-stack-offset: 0px;
  --fab-stack-step: 56px;
  --fab-stack-count: 1;
  --fab-size: 44px;
  --fab-edge: max(12px, env(safe-area-inset-right));
  /* Width reserved so bottom sheets do not sit under the FAB column */
  --fab-column-reserve: calc(var(--fab-size) + var(--fab-edge) + 8px);
  --app-bottom-dock-bar-height: 60px;
  --app-bottom-dock-height: calc(
    var(--app-bottom-dock-bar-height) + max(6px, env(safe-area-inset-bottom))
  );
  --app-bottom-footer-height: 40px;
  --app-bottom-chrome-height: calc(var(--app-bottom-dock-height) + var(--app-bottom-footer-height));
  --nav-bottom-bar-height: 44px;
}

body.spirit-voice-dock-visible {
  --fab-column-reserve: 0px;
  --spirit-dock-edge: max(12px, env(safe-area-inset-left));
  --spirit-dock-action-count: 5;
  --spirit-dock-icon-size: clamp(
    52px,
    calc((100vw - (2 * var(--spirit-dock-edge)) - 30px) / var(--spirit-dock-action-count)),
    64px
  );
  --app-bottom-dock-bar-height: calc(
    12px + 36px + 10px + var(--spirit-dock-icon-size) + max(12px, env(safe-area-inset-bottom))
  );
  --app-bottom-dock-height: var(--app-bottom-dock-bar-height);
  --app-bottom-footer-height: 0px;
  --app-bottom-chrome-height: var(--app-bottom-dock-height);
  --app-sheet-top-gap: max(12px, env(safe-area-inset-top));
  --app-sheet-side-gap: 12px;
  --app-sheet-bottom-gap: 12px;
  --app-sheet-bottom-inset: calc(var(--app-bottom-chrome-height) + var(--app-sheet-bottom-gap));
  --app-sheet-max-height: calc(
    100dvh - var(--app-sheet-top-gap) - var(--app-sheet-bottom-inset)
  );
}

@media (orientation: landscape) and (min-width: 600px) {
  body.spirit-voice-dock-visible {
    --spirit-dock-icon-size: clamp(
      48px,
      calc((100vw - (2 * var(--spirit-dock-edge)) - 30px) / var(--spirit-dock-action-count)),
      56px
    );
  }
}

@media (min-width: 900px) {
  body.spirit-voice-dock-visible {
    --spirit-dock-icon-size: 56px;
  }
}

body.ar-active,
body.photo-camera-active {
  --fab-stack-offset: 72px;
}

body.navigating {
  --fab-stack-offset: 76px;
}

body.navigating.map-travel {
  --fab-stack-offset: 132px;
}

#cameraContainer {
  position: fixed;
  inset: 0;
  z-index: 0;
}

body:not(.ar-active):not(.photo-camera-active) #cameraContainer,
body:not(.ar-active):not(.photo-camera-active) #cameraContainer canvas,
body:not(.ar-active):not(.photo-camera-active) #cameraContainer video {
  pointer-events: none;
}

body.photo-camera-active #cameraContainer {
  z-index: 90;
  background: #000;
}

body.photo-camera-active .photo-camera__video {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.photo-camera-active #hud,
body.photo-camera-active #navPanel,
body.photo-camera-active .fab-btn {
  display: none !important;
}

#cameraContainer canvas,
#cameraContainer video {
  position: absolute;
}

.fab-btn {
  position: fixed;
  top: auto;
  bottom: calc(
    max(18px, env(safe-area-inset-bottom)) + var(--fab-stack-offset) +
      (var(--fab-index, 0) * var(--fab-stack-step))
  );
  right: max(12px, env(safe-area-inset-right));
  left: auto;
  z-index: 200;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 213, 74, 0.35);
  border-radius: 999px;
  background: var(--color-bg-overlay);
  color: #ffd54a;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  touch-action: manipulation;
  pointer-events: auto;
}

.fab-btn[hidden] {
  display: none;
}

.fab-btn__icon {
  display: block;
}

.fab-btn__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--color-red-bright);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}

.fab-btn__badge[hidden] {
  display: none;
}

.team-btn--join-pulse {
  animation: team-join-pulse 0.55s ease-in-out 4;
  border-color: rgba(255, 213, 74, 0.9);
  box-shadow:
    0 0 0 0 rgba(255, 213, 74, 0.55),
    0 4px 16px rgba(0, 0, 0, 0.35);
}

@keyframes team-join-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow:
      0 0 0 0 rgba(255, 213, 74, 0.45),
      0 4px 16px rgba(0, 0, 0, 0.35);
  }

  50% {
    transform: scale(1.08);
    box-shadow:
      0 0 0 10px rgba(255, 213, 74, 0),
      0 4px 20px rgba(255, 213, 74, 0.35);
  }
}

.team-join-toast {
  position: fixed;
  top: calc(max(12px, env(safe-area-inset-top)) + 56px);
  left: 50%;
  z-index: 150;
  max-width: min(92vw, 360px);
  padding: 10px 16px;
  border: 1px solid rgba(255, 213, 74, 0.45);
  border-radius: 999px;
  background: rgba(18, 18, 22, 0.92);
  color: #ffd54a;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transform: translateX(-50%);
  pointer-events: none;
}

.team-join-toast[hidden] {
  display: none;
}

.reward-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 165;
  overflow: hidden;
  width: min(88vw, 320px);
  padding: 22px 20px 18px;
  border: 2px solid rgba(255, 213, 74, 0.55);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(24, 20, 10, 0.97) 0%, rgba(10, 10, 12, 0.98) 100%);
  box-shadow:
    0 0 0 1px rgba(255, 213, 74, 0.15),
    0 20px 60px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(255, 196, 72, 0.18);
  text-align: center;
  transform: translate(-50%, -48%) scale(0.88);
  opacity: 0;
  transition:
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.25s ease;
  pointer-events: auto;
}

.reward-toast--visible {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.reward-toast--join.reward-toast--visible {
  animation: reward-toast-join-enter 0.55s cubic-bezier(0.34, 1.45, 0.64, 1);
}

.reward-toast--join {
  width: min(92vw, 380px);
  padding: 28px 22px 22px;
  border-color: rgba(255, 213, 74, 0.82);
  box-shadow:
    0 0 0 1px rgba(255, 213, 74, 0.28),
    0 24px 70px rgba(0, 0, 0, 0.62),
    0 0 60px rgba(255, 196, 72, 0.35),
    0 0 120px rgba(255, 152, 0, 0.12);
}

.reward-toast__burst {
  position: absolute;
  inset: -30%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 213, 74, 0.42) 0%, rgba(255, 152, 0, 0.12) 38%, transparent 68%);
  opacity: 0;
  transform: scale(0.4);
  pointer-events: none;
}

.reward-toast__burst--active {
  animation: reward-burst 1.1s ease-out forwards;
}

.reward-toast__icon--join {
  width: 92px;
  height: 92px;
  font-size: 36px;
  animation: reward-join-pop 0.75s cubic-bezier(0.34, 1.56, 0.64, 1), reward-join-glow 1.6s ease-in-out 0.2s infinite;
}

.reward-toast--join .reward-toast__title {
  font-size: 26px;
  text-shadow: 0 0 24px rgba(255, 213, 74, 0.35);
}

.reward-toast__title--stacked {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.05;
}

.reward-toast__title-line {
  display: block;
}

.reward-toast--join .reward-toast__detail {
  font-size: 16px;
  font-weight: 700;
  color: #ffe082;
}

.reward-confetti {
  position: fixed;
  inset: 0;
  z-index: 164;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.reward-confetti--active {
  opacity: 1;
}

.reward-toast[hidden] {
  display: none;
}

.reward-toast__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-secondary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.reward-toast__icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  border-radius: 999px;
  background: rgba(255, 213, 74, 0.18);
  border: 2px solid rgba(255, 213, 74, 0.45);
  color: #ffd54a;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 0 28px rgba(255, 196, 72, 0.25);
  animation: reward-pop 0.55s ease-out;
}

.reward-toast__icon--treasure {
  font-size: 34px;
}

.reward-toast__title {
  margin: 0 0 6px;
  color: #ffd54a;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}

.reward-toast__detail {
  margin: 0;
  color: var(--color-text-primary);
  font-size: 15px;
  line-height: 1.4;
}

.reward-toast__detail[hidden] {
  display: none;
}

@keyframes reward-pop {
  0% {
    transform: scale(0.55);
  }

  70% {
    transform: scale(1.12);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes reward-toast-join-enter {
  0% {
    transform: translate(-50%, -46%) scale(0.72);
    opacity: 0;
  }

  65% {
    transform: translate(-50%, -50%) scale(1.06);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

@keyframes reward-join-pop {
  0% {
    transform: scale(0.35) rotate(-12deg);
  }

  55% {
    transform: scale(1.18) rotate(6deg);
  }

  100% {
    transform: scale(1) rotate(0deg);
  }
}

@keyframes reward-join-glow {
  0%,
  100% {
    box-shadow:
      0 0 24px rgba(255, 196, 72, 0.35),
      0 0 0 0 rgba(255, 213, 74, 0.45);
  }

  50% {
    box-shadow:
      0 0 42px rgba(255, 196, 72, 0.55),
      0 0 0 10px rgba(255, 213, 74, 0);
  }
}

@keyframes reward-burst {
  0% {
    opacity: 0;
    transform: scale(0.35);
  }

  35% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.35);
  }
}

.fab-tour-builder-btn {
  --fab-index: 0;
}

.fab-map-btn,
.fab-chest-btn,
.fab-switch-tour-btn,
.fab-team-btn,
.fab-spirit-btn {
  display: none !important;
}

.fab-spirit-btn.is-live {
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.95),
    0 0 0 4px rgba(255, 213, 74, 0.55);
}

.fab-switch-tour-btn[hidden],
.fab-team-btn[hidden],
.fab-map-btn[hidden],
.fab-chest-btn[hidden],
.fab-spirit-btn[hidden],
.fab-tour-builder-btn[hidden] {
  display: none;
}

body.photo-camera-active .fab-btn {
  display: none !important;
}

.photo-album-modal {
  position: fixed;
  inset: 0;
  z-index: 160;
}

.photo-album-modal[hidden] {
  display: none;
}

.photo-album-modal__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  background: var(--color-bg-scrim);
  cursor: pointer;
}

.photo-album-modal__sheet {
  position: absolute;
  inset: auto 12px max(18px, env(safe-area-inset-bottom));
  left: 12px;
  right: calc(12px + var(--fab-column-reserve));
  max-height: min(72vh, 640px);
  padding: 16px 18px 18px;
  border-radius: 14px;
  background: var(--color-bg-overlay-strong);
  border: 1px solid rgba(255, 213, 74, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.photo-album-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.photo-album-modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--color-text-secondary);
}

.photo-album-modal__close {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-secondary);
  font-size: 22px;
  line-height: 1;
}

.photo-album-modal__empty {
  margin: 0 0 12px;
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1.45;
}

.photo-album-modal__empty[hidden] {
  display: none;
}

.photo-album-modal__actions {
  flex: 0 0 auto;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.photo-album-modal__camera {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 213, 74, 0.45);
  background: rgba(255, 213, 74, 0.14);
  color: #ffd54a;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.photo-album-modal__camera:hover,
.photo-album-modal__camera:focus-visible {
  background: rgba(255, 213, 74, 0.22);
  outline: none;
}

.photo-album-modal__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}

.photo-album-modal__item {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid rgba(212, 140, 100, 0.18);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

.photo-album-modal__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-album-modal__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 6px 6px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  color: var(--color-text);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(0, 0, 0, 0.92);
  overflow: hidden;
}

body.photo-viewer-open .photo-viewer {
  z-index: 10200;
}

.photo-viewer[hidden] {
  display: none;
}

.photo-viewer__close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 3;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 24px;
  line-height: 1;
}

.photo-viewer__image {
  position: absolute;
  inset: 0;
  bottom: calc(76px + max(18px, env(safe-area-inset-bottom)));
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.photo-viewer__status {
  position: absolute;
  left: 50%;
  bottom: calc(88px + max(18px, env(safe-area-inset-bottom)));
  transform: translateX(-50%);
  z-index: 3;
  max-width: min(calc(100% - 32px), 420px);
  margin: 0;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--color-bg-overlay);
  border: 1px solid rgba(255, 213, 74, 0.35);
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
}

.photo-viewer__status[hidden] {
  display: none;
}

.photo-viewer__status--error {
  border-color: rgba(255, 130, 130, 0.45);
  color: #fecaca;
}

.photo-viewer__actions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  gap: 10px;
  padding: 12px 14px max(18px, env(safe-area-inset-bottom));
  background: var(--color-bg-overlay-strong);
  border-top: 1px solid rgba(212, 140, 100, 0.18);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
}

.photo-viewer__actions button {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
}

.photo-viewer__save {
  background: linear-gradient(180deg, #ffd54a 0%, #f5b800 100%);
  color: #1a1200;
  border: 1px solid rgba(255, 213, 74, 0.65);
}

.photo-viewer__delete {
  background: rgba(120, 32, 32, 0.88);
  border: 1px solid rgba(255, 130, 130, 0.45);
}

.photo-viewer--read-only .photo-viewer__image {
  bottom: max(18px, env(safe-area-inset-bottom));
}

.photo-viewer--read-only .photo-viewer__actions {
  display: none;
}

.spirit-talk-overlay {
  position: fixed;
  inset: 0;
  z-index: 10340;
  pointer-events: none;
}

.spirit-talk-overlay[hidden] {
  display: none;
}

body.photo-camera-active .spirit-talk-overlay {
  display: none !important;
}

.spirit-talk-overlay__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: spirit-talk-scrim-in 0.28s ease-out;
  pointer-events: none;
}

.overlay-close {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 2px solid rgba(255, 213, 74, 0.55);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 213, 74, 0.28), rgba(180, 130, 20, 0.18));
  color: #fff7d6;
  font-size: 1.65rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 8px 24px rgba(255, 213, 74, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.overlay-close[hidden] {
  display: none !important;
}

.overlay-close:active {
  transform: scale(0.96);
}

.overlay-close--viewport {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 120;
}

.spirit-talk-overlay__brand {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  z-index: 2;
  pointer-events: none;
}

.spirit-talk-overlay__close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 2;
}

.spirit-talk-overlay__stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 56px 20px max(24px, env(safe-area-inset-bottom));
  pointer-events: none;
}

.spirit-talk-overlay__voice {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(88vw, 360px);
  pointer-events: auto;
}

.spirit-talk-overlay__voice[hidden] {
  display: none;
}

.spirit-talk-overlay__voice-label {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 213, 74, 0.82);
}

.spirit-talk-overlay__voice-select {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 36px 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 213, 74, 0.34);
  background: rgba(8, 6, 16, 0.88) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23ffd54a' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: #fff7d6;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.spirit-talk-overlay__voice-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.spirit-talk-overlay__transcript {
  width: min(88vw, 360px);
  max-height: min(24vh, 180px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: auto;
}

.spirit-talk-overlay__msg {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.spirit-talk-overlay__msg--user {
  align-self: flex-end;
  max-width: 92%;
  background: rgba(255, 213, 74, 0.16);
  color: #fff7d6;
}

.spirit-talk-overlay__msg--assistant {
  align-self: flex-start;
  max-width: 96%;
  background: var(--color-red-soft);
  color: rgba(255, 232, 228, 0.95);
}

.spirit-talk-overlay__msg--system {
  align-self: center;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.84rem;
}

.spirit-talk-overlay__mesh {
  width: min(68vw, 280px);
  height: min(68vw, 280px);
  color: #ffd54a;
  filter: drop-shadow(0 0 18px rgba(255, 213, 74, 0.35));
  transition: color 0.45s ease, filter 0.45s ease;
}

.spirit-talk-overlay.is-spirit .spirit-talk-overlay__mesh {
  color: #e8a8a0;
  filter: drop-shadow(0 0 22px rgba(184, 72, 64, 0.42));
}

.spirit-talk-overlay.is-thinking .spirit-talk-overlay__mesh {
  color: #ffd08a;
  filter: drop-shadow(0 0 18px rgba(255, 180, 80, 0.38));
}

.spirit-talk-overlay.is-spirit .spirit-talk-overlay__mesh-spin {
  animation-duration: 12s;
}

.spirit-talk-overlay.is-thinking .spirit-talk-overlay__mesh-spin {
  animation-duration: 24s;
}

.spirit-talk-overlay__mesh-spin {
  transform-origin: 120px 120px;
  animation: spirit-talk-mesh-spin 18s linear infinite;
}

.spirit-talk-overlay__eq {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  width: min(72vw, 320px);
  height: 88px;
}

.spirit-talk-overlay__eq-bar {
  flex: 1 1 0;
  min-width: 4px;
  max-width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff4b8 0%, #ffd54a 45%, #f59b00 100%);
  box-shadow: 0 0 12px rgba(255, 213, 74, 0.45);
  transform-origin: bottom center;
  transition:
    height 0.08s linear,
    opacity 0.08s linear,
    background 0.45s ease,
    box-shadow 0.45s ease;
}

.spirit-talk-overlay.is-spirit .spirit-talk-overlay__eq-bar {
  background: linear-gradient(180deg, #ffd4cc 0%, #d4847c 42%, var(--color-red) 100%);
  box-shadow: 0 0 14px rgba(184, 72, 64, 0.5);
}

.spirit-talk-overlay.is-thinking .spirit-talk-overlay__eq-bar {
  background: linear-gradient(180deg, #ffe8c8 0%, #e6a060 45%, var(--color-red-bright) 100%);
  box-shadow: 0 0 10px rgba(230, 160, 96, 0.4);
  opacity: 0.72;
}

.spirit-talk-overlay__label {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(255, 247, 214, 0.92);
  text-shadow: 0 0 20px rgba(255, 213, 74, 0.35);
  transition: color 0.45s ease, text-shadow 0.45s ease;
}

.spirit-talk-overlay.is-spirit .spirit-talk-overlay__label {
  color: rgba(255, 232, 228, 0.95);
  text-shadow: 0 0 20px rgba(184, 72, 64, 0.4);
}

.spirit-talk-overlay.is-thinking .spirit-talk-overlay__label {
  color: rgba(255, 236, 210, 0.92);
  text-shadow: 0 0 18px rgba(255, 180, 80, 0.35);
}

.spirit-talk-overlay.is-awaiting .spirit-talk-overlay__mesh {
  color: #ffe08a;
  filter: drop-shadow(0 0 20px rgba(255, 213, 74, 0.4));
}

.spirit-talk-overlay.is-awaiting .spirit-talk-overlay__mesh-spin {
  animation-duration: 20s;
}

.spirit-talk-overlay.is-awaiting .spirit-talk-overlay__eq-bar {
  background: linear-gradient(180deg, #fff8d6 0%, #ffd54a 50%, #e6a800 100%);
  box-shadow: 0 0 12px rgba(255, 213, 74, 0.42);
}

.spirit-talk-overlay.is-awaiting .spirit-talk-overlay__label {
  color: rgba(255, 247, 214, 0.95);
  text-shadow: 0 0 20px rgba(255, 213, 74, 0.38);
}

.spirit-voice-dock__mic[hidden] {
  display: none !important;
}

@keyframes spirit-talk-scrim-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes spirit-talk-mesh-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.spirit-voice-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10070;
  pointer-events: none;
  display: flex;
  justify-content: stretch;
}

.spirit-voice-dock[hidden] {
  display: none;
}

/* Keep bottom dock persistent — only hide for full-screen modes that replace the map */
body.tour-builder-open .spirit-voice-dock {
  display: none !important;
}

body:has(#spiritTalkOverlay:not([hidden])) .spirit-voice-dock__controls {
  display: none !important;
}

body:has(#spiritTalkOverlay:not([hidden])) .spirit-voice-dock {
  z-index: 10350;
}

body:has(#spiritTalkOverlay:not([hidden])) .spirit-voice-dock__map-tools {
  pointer-events: auto;
}

.spirit-voice-dock__panel {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 12px max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-right));
  border: none;
  border-top: 1px solid var(--color-border-chrome);
  border-radius: 0;
  background: var(--color-bg-overlay-strong);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.45);
  overflow: visible;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: auto;
}

.spirit-voice-dock__aurora,
.spirit-voice-dock__hint {
  display: none;
}

.spirit-voice-dock__aurora {
  position: absolute;
  inset: -55%;
  pointer-events: none;
  opacity: 0.42;
  filter: blur(30px) saturate(1.35);
  transition: opacity 0.45s ease, filter 0.45s ease;
}

.spirit-voice-dock__mesh {
  position: absolute;
  inset: 0;
  border-radius: 42%;
  mix-blend-mode: screen;
  animation: spirit-mesh-drift 14s ease-in-out infinite;
}

.spirit-voice-dock__mesh--a {
  background:
    radial-gradient(circle at 28% 38%, rgba(186, 104, 255, 0.78), transparent 56%),
    radial-gradient(circle at 72% 62%, rgba(255, 213, 74, 0.62), transparent 52%);
}

.spirit-voice-dock__mesh--b {
  animation-duration: 18s;
  animation-direction: reverse;
  background:
    radial-gradient(circle at 62% 28%, rgba(72, 187, 255, 0.55), transparent 54%),
    radial-gradient(circle at 18% 72%, rgba(255, 140, 90, 0.48), transparent 50%);
}

.spirit-voice-dock__mesh--c {
  animation-duration: 22s;
  background: conic-gradient(
    from 120deg,
    rgba(255, 213, 74, 0.34),
    rgba(147, 51, 234, 0.42),
    rgba(72, 187, 255, 0.28),
    rgba(255, 213, 74, 0.34)
  );
  opacity: 0.38;
}

.spirit-voice-dock.is-live .spirit-voice-dock__aurora {
  opacity: 0.58;
}

.spirit-voice-dock.is-connecting .spirit-voice-dock__aurora,
.spirit-voice-dock.is-thinking .spirit-voice-dock__aurora {
  opacity: 0.68;
  animation: spirit-mesh-connect-pulse 2.8s ease-in-out infinite;
}

.spirit-voice-dock.is-speaking .spirit-voice-dock__aurora {
  opacity: 0.92;
  filter: blur(24px) saturate(1.85);
  animation: spirit-mesh-speak-pulse 2.2s ease-in-out infinite;
}

.spirit-voice-dock.is-speaking .spirit-voice-dock__mesh {
  animation-duration: 4.5s;
}

.spirit-voice-dock.is-listening .spirit-voice-dock__aurora {
  opacity: 0.72;
  filter: blur(26px) saturate(1.5);
}

@keyframes spirit-mesh-drift {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }

  33% {
    transform: translate(8%, -7%) rotate(10deg) scale(1.08);
  }

  66% {
    transform: translate(-7%, 6%) rotate(-8deg) scale(0.94);
  }
}

@keyframes spirit-mesh-speak-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.78;
  }

  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes spirit-mesh-connect-pulse {
  0%,
  100% {
    opacity: 0.55;
  }

  50% {
    opacity: 0.82;
  }
}

.spirit-voice-dock__hint {
  position: relative;
  z-index: 1;
  display: none;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #ffd54a;
  text-align: center;
  text-shadow: 0 1px 12px rgba(255, 213, 74, 0.35);
}

.spirit-voice-dock.is-connecting .spirit-voice-dock__hint,
.spirit-voice-dock.is-thinking .spirit-voice-dock__hint,
.spirit-voice-dock.is-speaking .spirit-voice-dock__hint,
.spirit-voice-dock.is-listening .spirit-voice-dock__hint,
.spirit-voice-dock.is-live .spirit-voice-dock__hint,
body.spirit-talk-active .spirit-voice-dock__hint {
  display: block;
}

.spirit-voice-dock__map-tools {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
  width: 100%;
  max-width: min(100%, calc((var(--spirit-dock-action-count) * var(--spirit-dock-icon-size)) + 120px));
  margin-inline: auto;
}

.spirit-voice-dock__map-tools .nav-map-attribution-slot {
  flex: 0 0 auto;
}

.spirit-voice-dock__map-tools .nav-map-style-slot {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: center;
}

.spirit-voice-dock__map-tools .nav-map-style-slot:empty {
  display: none;
}

.spirit-voice-dock__map-tools .nav-map-attribution-slot:empty {
  display: none;
}

.spirit-voice-dock__controls svg {
  width: 58%;
  height: 58%;
  max-width: 36px;
  max-height: 36px;
}

.lucide-icon {
  display: block;
  flex-shrink: 0;
}

.spirit-voice-dock__controls {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: calc((var(--spirit-dock-action-count) * var(--spirit-dock-icon-size)) + 30px);
  margin-inline: auto;
}

.spirit-voice-dock__mic,
.spirit-voice-dock__camera,
.spirit-voice-dock__map,
.spirit-voice-dock__chest,
.spirit-voice-dock__filter {
  width: var(--spirit-dock-icon-size);
  height: var(--spirit-dock-icon-size);
  flex: 0 0 var(--spirit-dock-icon-size);
}

.spirit-voice-dock__chest {
  position: relative;
}

.spirit-voice-dock__chest > .spirit-voice-dock__chest-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62%;
  height: 62%;
  max-width: 38px;
  max-height: 38px;
}

.spirit-voice-dock__chest > .spirit-voice-dock__chest-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.spirit-voice-dock__badge {
  position: absolute;
  top: 8%;
  right: 8%;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--color-red-bright);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
  pointer-events: none;
}

.spirit-voice-dock__badge[hidden] {
  display: none;
}

.spirit-voice-dock__camera[hidden],
.spirit-voice-dock__map[hidden],
.spirit-voice-dock__chest[hidden],
.spirit-voice-dock__filter[hidden] {
  display: none !important;
}

/* Dock toolbar: every action button keeps the same yellow chrome in all states */
.spirit-voice-dock__controls .spirit-agent-modal__mic,
.spirit-voice-dock__controls .spirit-agent-modal__mic:active,
.spirit-voice-dock__controls .spirit-agent-modal__mic:focus,
.spirit-voice-dock__controls .spirit-agent-modal__mic:focus-visible,
.spirit-voice-dock__controls .spirit-agent-modal__mic:disabled,
.spirit-voice-dock__controls .spirit-agent-modal__mic.is-locked,
.spirit-voice-dock__controls .spirit-agent-modal__mic.is-listening,
.spirit-voice-dock__controls .spirit-agent-modal__mic.is-speaking,
.spirit-voice-dock__controls .spirit-agent-modal__mic.is-muted,
.spirit-voice-dock__controls .spirit-agent-modal__mic.is-live,
.spirit-voice-dock__controls .spirit-agent-modal__mic.is-ready {
  width: var(--spirit-dock-icon-size);
  height: var(--spirit-dock-icon-size);
  flex: 0 0 var(--spirit-dock-icon-size);
  aspect-ratio: 1;
  min-height: 0;
  border: 2px solid rgba(255, 213, 74, 0.45);
  background: linear-gradient(180deg, rgba(255, 213, 74, 0.24), rgba(255, 213, 74, 0.1));
  color: #ffd54a;
  box-shadow: 0 6px 18px rgba(255, 213, 74, 0.16);
  animation: none;
  opacity: 1;
  transform: none;
  -webkit-tap-highlight-color: transparent;
}

body.spirit-voice-dock-visible .spirit-agent-modal__sheet {
  bottom: var(--app-sheet-bottom-gap);
  max-height: var(--app-sheet-max-height);
}

body.spirit-voice-dock-visible .photo-album-modal__sheet {
  bottom: var(--app-sheet-bottom-gap);
  max-height: var(--app-sheet-max-height);
  padding-bottom: 18px;
}

body.spirit-voice-dock-visible.photo-viewer-open .photo-viewer__image {
  bottom: var(--app-sheet-bottom-inset);
}

body.spirit-voice-dock-visible.photo-viewer-open .photo-viewer--read-only .photo-viewer__image {
  bottom: var(--app-sheet-bottom-inset);
}

body.spirit-voice-dock-visible #navPanel {
  padding-bottom: var(--app-bottom-chrome-height);
}

body.spirit-voice-dock-visible #navMapStage {
  padding-bottom: 0;
}

body.spirit-voice-dock-visible #navBottomBar {
  padding: 0;
  background: transparent;
  border-top: none;
}

/* Full-screen sheets stop above the spirit dock (map tools + icon row). */
body.spirit-voice-dock-visible:not(.tour-carousel-open):not(.tour-builder-open) .treasure-chest,
body.spirit-voice-dock-visible:not(.tour-carousel-open):not(.tour-builder-open) .app-modal,
body.spirit-voice-dock-visible:not(.tour-carousel-open):not(.tour-builder-open) .panel-modal,
body.spirit-voice-dock-visible:not(.tour-carousel-open):not(.tour-builder-open) .tour-select-modal,
body.spirit-voice-dock-visible:not(.tour-carousel-open):not(.tour-builder-open) .photo-album-modal,
body.spirit-voice-dock-visible:not(.tour-carousel-open):not(.tour-builder-open) .spirit-agent-modal,
body.spirit-voice-dock-visible:not(.tour-carousel-open):not(.tour-builder-open) .permission-gate-modal,
body.spirit-voice-dock-visible:not(.tour-carousel-open):not(.tour-builder-open) .tour-modal {
  bottom: var(--app-bottom-chrome-height);
}

body.spirit-voice-dock-visible:not(.tour-carousel-open):not(.tour-builder-open) .app-modal__sheet {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: min(90vh, var(--app-sheet-max-height));
  max-height: var(--app-sheet-max-height);
}

body.spirit-voice-dock-visible:not(.tour-carousel-open):not(.tour-builder-open) #filterModal .app-modal__sheet {
  height: var(--app-sheet-max-height);
  max-height: var(--app-sheet-max-height);
}

body.spirit-voice-dock-visible:not(.tour-carousel-open):not(.tour-builder-open) .panel-modal__sheet,
body.spirit-voice-dock-visible:not(.tour-carousel-open):not(.tour-builder-open) .tour-select-modal__sheet {
  height: 100%;
  max-height: none;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

body.spirit-voice-dock-visible:not(.tour-carousel-open):not(.tour-builder-open) .stop-sheet {
  padding-bottom: var(--app-sheet-bottom-inset);
}

.spirit-agent-modal {
  position: fixed;
  inset: 0;
  z-index: 165;
}

.spirit-agent-modal[hidden] {
  display: none;
}

.spirit-agent-modal__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  background: var(--color-bg-scrim);
  cursor: pointer;
}

.spirit-agent-modal__sheet {
  position: absolute;
  inset: auto 12px max(18px, env(safe-area-inset-bottom));
  left: 12px;
  right: calc(12px + var(--fab-column-reserve));
  max-height: min(78vh, 680px);
  padding: 16px 18px 18px;
  border-radius: 14px;
  background: var(--color-bg-overlay-strong);
  border: 1px solid rgba(255, 213, 74, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.spirit-agent-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.spirit-agent-modal__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffd54a;
}

.spirit-agent-modal__subtitle {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
}

.spirit-agent-modal__voice {
  display: flex;
  align-items: center;
  gap: 10px;
}

.spirit-agent-modal__voice[hidden] {
  display: none;
}

.spirit-agent-modal__voice-label {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 213, 74, 0.82);
}

.spirit-agent-modal__voice-select {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 36px 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 213, 74, 0.34);
  background: rgba(8, 6, 16, 0.88) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23ffd54a' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: #fff7d6;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.spirit-agent-modal__voice-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.spirit-agent-modal__voice-select:focus-visible {
  outline: 2px solid rgba(255, 213, 74, 0.65);
  outline-offset: 2px;
}

.spirit-agent-modal__header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.spirit-agent-modal__end {
  width: 84px;
  height: 84px;
  flex: 0 0 auto;
  padding: 0;
  border: 2px solid rgba(255, 130, 130, 0.45);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 130, 130, 0.24), rgba(140, 46, 40, 0.16));
  color: #ffb4ae;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 10px 28px rgba(140, 46, 40, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.spirit-agent-modal__end:active {
  transform: scale(0.98);
}

.spirit-agent-modal__close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.spirit-agent-modal__status {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.spirit-agent-modal__thinking {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 8px 0 4px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 213, 74, 0.1);
  border: 1px solid rgba(255, 213, 74, 0.28);
  color: #ffe9a8;
  font-size: 0.9rem;
  text-align: center;
}

.spirit-agent-modal__thinking[hidden] {
  display: none !important;
}

.spirit-agent-modal__thinking-dots {
  width: 28px;
  height: 10px;
  flex-shrink: 0;
  background:
    radial-gradient(circle, #ffd54a 2px, transparent 2.5px) 0 50%,
    radial-gradient(circle, #ffd54a 2px, transparent 2.5px) 50% 50%,
    radial-gradient(circle, #ffd54a 2px, transparent 2.5px) 100% 50%;
  background-size: 33.33% 100%;
  background-repeat: no-repeat;
  animation: spirit-thinking-dots 1.1s ease-in-out infinite;
}

@keyframes spirit-thinking-dots {
  0%,
  80%,
  100% {
    opacity: 0.35;
  }
  40% {
    opacity: 1;
  }
}

.spirit-agent-modal__timing {
  margin: 0 0 8px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.spirit-agent-modal__timing[hidden] {
  display: none !important;
}

.spirit-agent-modal__voice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 4px 0 2px;
}

.spirit-agent-modal__voice-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
}

.spirit-agent-modal__mic-hint {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #ffd54a;
}

.spirit-agent-modal__transcript {
  flex: 1 1 auto;
  min-height: 88px;
  max-height: min(34vh, 280px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.spirit-agent-modal__msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.spirit-agent-modal__msg--user {
  align-self: flex-end;
  background: rgba(140, 46, 40, 0.28);
  border: 1px solid rgba(166, 61, 53, 0.35);
}

.spirit-agent-modal__msg--assistant {
  align-self: flex-start;
  background: rgba(255, 213, 74, 0.12);
  border: 1px solid rgba(255, 213, 74, 0.28);
}

.spirit-agent-modal__msg--system {
  align-self: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.82rem;
}

.spirit-agent-modal__composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.spirit-agent-modal__mic {
  width: 84px;
  height: 84px;
  border: 2px solid rgba(255, 213, 74, 0.45);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 213, 74, 0.24), rgba(255, 213, 74, 0.1));
  color: #ffd54a;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 10px 28px rgba(255, 213, 74, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.spirit-agent-modal__mic.is-ready {
  animation: spirit-mic-ready 2.4s ease-in-out infinite;
}

.spirit-agent-modal__mic.is-listening {
  background: linear-gradient(180deg, rgba(255, 213, 74, 0.34), rgba(255, 213, 74, 0.16));
  border-color: rgba(255, 213, 74, 0.72);
  color: var(--color-active-text);
  animation: spirit-mic-pulse 1.2s ease-in-out infinite;
}

.spirit-agent-modal__mic.is-locked {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.45);
  animation: none;
  cursor: not-allowed;
  box-shadow: none;
}

.spirit-agent-modal__mic.is-live {
  border-color: rgba(255, 213, 74, 0.55);
}

.spirit-agent-modal__mic.is-speaking {
  border-color: rgba(186, 104, 255, 0.72);
  color: #e9d5ff;
  box-shadow:
    0 0 0 2px rgba(186, 104, 255, 0.22),
    0 12px 32px rgba(120, 72, 180, 0.28);
  animation: spirit-mic-speak-glow 1.6s ease-in-out infinite;
}

@keyframes spirit-mic-speak-glow {
  0%,
  100% {
    transform: scale(1);
    box-shadow:
      0 0 0 2px rgba(186, 104, 255, 0.18),
      0 10px 28px rgba(120, 72, 180, 0.22);
  }

  50% {
    transform: scale(1.04);
    box-shadow:
      0 0 0 8px rgba(186, 104, 255, 0.08),
      0 14px 36px rgba(120, 72, 180, 0.36);
  }
}

.spirit-agent-modal__mic.is-muted {
  color: #fff7d6;
}

@keyframes spirit-mic-ready {
  0%,
  100% {
    box-shadow: 0 10px 28px rgba(255, 213, 74, 0.18), 0 0 0 0 rgba(255, 213, 74, 0.28);
  }
  50% {
    box-shadow: 0 12px 32px rgba(255, 213, 74, 0.24), 0 0 0 10px rgba(255, 213, 74, 0);
  }
}

@keyframes spirit-mic-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 213, 74, 0.35);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(255, 213, 74, 0);
  }
}

.spirit-agent-modal__mic:disabled,
.spirit-agent-modal__send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.spirit-agent-modal__mic.is-locked:disabled {
  opacity: 1;
}

.spirit-agent-modal__input {
  width: 100%;
  min-height: 44px;
  max-height: 96px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font: inherit;
  resize: vertical;
}

.spirit-agent-modal__input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.spirit-agent-modal__send {
  min-width: 64px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(255, 213, 74, 0.45);
  border-radius: 10px;
  background: rgba(255, 213, 74, 0.18);
  color: #ffd54a;
  font-weight: 700;
  cursor: pointer;
}

body.spirit-agent-open .fab-btn:not(.fab-spirit-btn) {
  pointer-events: none;
}

.tour-modal {
  position: fixed;
  inset: 0;
  z-index: 150;
}

.permission-gate-modal {
  position: fixed;
  inset: 0;
  z-index: 10060;
}

.permission-gate-modal[hidden] {
  display: none;
}

.permission-gate-modal__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  background: var(--color-bg-scrim);
  cursor: pointer;
}

.permission-gate-modal__sheet {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(calc(100% - 32px), 380px);
  padding: 20px 20px 18px;
  border-radius: 16px;
  background: var(--color-bg-overlay-strong);
  border: 1px solid rgba(255, 213, 74, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.permission-gate-modal__title,
.permission-gate-modal__lead,
.permission-gate-modal__list {
  text-align: left;
}

.permission-gate-modal__title {
  margin: 0 0 10px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-gold, #ffd54a);
}

.permission-gate-modal__lead {
  margin: 0 0 14px;
  font-size: 0.92rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.88);
}

.permission-gate-modal__list {
  margin: 0 0 16px;
  padding-left: 1.1rem;
  font-size: 0.88rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.82);
}

.permission-gate-modal__list li + li {
  margin-top: 6px;
}

.permission-gate-modal__list strong {
  color: #fff;
}

.permission-gate-modal__allow {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffe082 0%, #ffc107 100%);
  color: #1a1200;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.permission-gate-modal__skip {
  display: block;
  width: 100%;
  padding: 8px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.88rem;
  cursor: pointer;
}

.permission-gate-modal__skip:hover,
.permission-gate-modal__skip:focus-visible {
  color: rgba(255, 255, 255, 0.9);
}

.tour-modal[hidden] {
  display: none;
}

.tour-modal__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  background: var(--color-bg-scrim);
  cursor: pointer;
}

.tour-modal__sheet {
  position: absolute;
  top: auto;
  bottom: calc(
    max(18px, env(safe-area-inset-bottom)) + var(--fab-stack-offset) +
      (var(--fab-stack-count) * var(--fab-stack-step))
  );
  right: max(12px, env(safe-area-inset-right));
  left: auto;
  width: min(calc(100% - 24px), 360px);
  max-width: 360px;
  margin-left: 0;
  padding: 16px 18px 18px;
  border-radius: 14px;
  background: var(--color-bg-overlay-strong);
  border: 1px solid rgba(255, 213, 74, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.tour-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.tour-modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--color-text-secondary);
}

.tour-modal__close {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-secondary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.tour-modal__name {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text);
}

.tour-modal__name:empty {
  display: none;
}

.tour-modal__code {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffd54a;
}

.tour-modal__members-heading {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.tour-modal__roster {
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--color-text-secondary);
}

.tour-modal__roster li + li {
  margin-top: 4px;
}

.tour-modal__roster-empty {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
}

.tour-modal__sync {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-active-text);
}

.tour-modal__invite {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
  padding-top: 4px;
}

.tour-modal__invite[hidden] {
  display: none;
}

.tour-modal__invite-btn {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 213, 74, 0.35);
  background: rgba(255, 213, 74, 0.12);
  color: #ffd54a;
  font-size: 15px;
  font-weight: 700;
}

.tour-modal__invite-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-active-text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  justify-self: start;
}

.tour-modal__invite-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-text-secondary);
}

.tour-modal__invite-note[hidden] {
  display: none;
}

#hud {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 20;
  background: var(--color-bg-scrim);
  border-radius: 10px;
  padding: 12px;
  line-height: 1.4;
  font-size: 15px;
}

/* Splash: full viewport scroll so Join/Start stay reachable on small / high-DPI phones */
#hud:not(.started) {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 300;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  max-height: 100dvh;
  max-height: 100svh;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  border-radius: 0;
  background: var(--color-bg-overlay-strong);
  overflow: hidden;
  box-sizing: border-box;
}

#hud:not(.started) #locationLabel,
#hud:not(.started) #distanceLabel {
  display: none;
}

#hud:not(.started) #status:empty {
  display: none;
  margin: 0;
}

body.app-booting #hud:not(.started) {
  visibility: hidden;
  pointer-events: none;
}

#hud:not(.started) #controls {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  visibility: hidden;
}

body.splash-ready:not(.tour-select-open) #hud:not(.started) #controls {
  visibility: visible;
}

#hud.started #controls {
  display: none;
}

.splash-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
  padding-bottom: max(96px, calc(72px + env(safe-area-inset-bottom)));
  box-sizing: border-box;
}

.splash-panel__logo {
  align-self: flex-start;
  margin-bottom: 2px;
}

.tour-modal__header-brand {
  flex: 1;
  min-width: 0;
}

.tour-modal__header-brand .tour-modal__title {
  margin: 0;
}

.tour-builder__header-brand {
  flex: 1;
  min-width: 0;
}

.tour-builder__header-brand .tour-builder__title {
  margin: 0;
}

.photo-album-modal__header-brand {
  flex: 1;
  min-width: 0;
}

.photo-album-modal__header-brand .photo-album-modal__title {
  margin: 0;
}

.treasure-chest__brand {
  flex: 0 0 auto;
}

.tour-select-profile-step__intro {
  margin-bottom: 4px;
}

.tour-select-profile-step__intro .tour-select-profile-step__title {
  margin: 0;
}

.tour-select-profile-step__intro .tour-select-profile-step__hint {
  margin: 3px 0 0;
}

.splash-panel.is-team-rejoin > label[for="playerNameInput"],
.splash-panel.is-team-rejoin > #playerNameInput,
.splash-panel.is-team-rejoin #playerOriginField,
.splash-panel.is-team-rejoin #tourModeField,
.splash-panel.is-team-rejoin #teamSetupFields,
.splash-panel.is-team-rejoin .splash-panel__permissions-details,
.splash-panel.is-team-rejoin #inviteTeamAction,
.splash-panel.is-team-rejoin > label[for="playerPhoneInput"],
.splash-panel.is-team-rejoin > #playerPhoneInput,
.splash-panel.is-team-rejoin .splash-panel__code,
.splash-panel.is-team-rejoin .splash-panel__members,
.splash-panel.is-team-rejoin .splash-panel__note {
  display: none !important;
}

/* Normal splash: one CTA opens the tour picker. Direct-start only for rejoin/join links. */
.splash-panel:not(.is-direct-start) #startBtn {
  display: none !important;
}

.splash-panel.is-direct-start #startNewTourBtn {
  display: none !important;
}

#startBtn[hidden],
#startNewTourBtn[hidden] {
  display: none !important;
}

/* Progressive splash steps — same rules in JS + CSS so local/prod stay in sync */
.splash-panel.is-progressive:not(.is-splash-has-name) #playerOriginField,
.splash-panel.is-progressive:not(.is-splash-has-name) #tourModeField,
.splash-panel.is-progressive:not(.is-splash-has-name) #teamSetupFields,
.splash-panel.is-progressive:not(.is-splash-has-name) #splashActions,
.splash-panel.is-progressive:not(.is-splash-has-name) #splashPermissionsDetails {
  display: none !important;
}

.splash-panel.is-progressive.is-splash-has-name:not(.is-splash-has-origin) #tourModeField,
.splash-panel.is-progressive.is-splash-has-name:not(.is-splash-has-origin) #teamSetupFields,
.splash-panel.is-progressive.is-splash-has-name:not(.is-splash-has-origin) #splashActions,
.splash-panel.is-progressive.is-splash-has-name:not(.is-splash-has-origin) #splashPermissionsDetails {
  display: none !important;
}

.splash-panel.is-progressive.is-splash-has-origin:not(.is-splash-has-mode):not(.is-splash-invited) #splashActions,
.splash-panel.is-progressive.is-splash-has-origin:not(.is-splash-has-mode):not(.is-splash-invited) #splashPermissionsDetails {
  display: none !important;
}

.splash-panel.is-progressive.is-splash-has-origin:not(.is-splash-has-actions) #splashActions,
.splash-panel.is-progressive.is-splash-has-origin:not(.is-splash-has-actions) #splashPermissionsDetails {
  display: none !important;
}

.splash-panel.is-progressive.is-splash-invited.is-splash-has-name:not(.is-splash-has-origin) #splashActions,
.splash-panel.is-progressive.is-splash-invited.is-splash-has-name:not(.is-splash-has-origin) #splashPermissionsDetails {
  display: none !important;
}

.splash-panel.is-progressive.is-splash-team-mode:not(.is-splash-has-mode) #teamSetupFields {
  display: none !important;
}

#splashActions[hidden],
#splashPermissionsDetails[hidden],
#playerOriginField[hidden],
#tourModeField[hidden],
#teamSetupFields[hidden] {
  display: none !important;
}

.splash-panel__title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: #ffd54a;
  letter-spacing: 0.02em;
}

.app-footer {
  flex-shrink: 0;
  padding: 10px 0 2px;
  text-align: center;
}

.app-footer__sponsor {
  margin: 0 0 4px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-text-secondary);
}

.app-footer__sponsor a {
  color: #ffd54a;
  font-weight: 700;
  text-decoration: none;
}

.app-footer__sponsor a:hover,
.app-footer__sponsor a:focus-visible {
  text-decoration: underline;
}

.app-footer__copyright {
  margin: 0 0 4px;
  font-size: 11px;
  color: var(--color-text-dim);
}

.app-footer__version {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-dim);
}

#hud.started .app-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--app-bottom-dock-height);
  z-index: 10340;
  padding: 5px 12px 4px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(140, 46, 40, 0.9), rgba(92, 24, 20, 0.96));
  border-top: 1px solid rgba(184, 72, 64, 0.42);
}

body.spirit-voice-dock-visible #hud.started .app-footer {
  padding: 4px 12px 3px;
}

body.spirit-voice-dock-visible #hud.started .app-footer__sponsor {
  margin-bottom: 2px;
  font-size: 12px;
  line-height: 1.25;
}

body.spirit-voice-dock-visible #hud.started .app-footer__copyright,
body.spirit-voice-dock-visible #hud.started .app-footer__version {
  margin-bottom: 0;
  font-size: 10px;
  line-height: 1.2;
}

body:not(.spirit-voice-dock-visible) #hud.started .app-footer {
  bottom: max(8px, env(safe-area-inset-bottom));
  background: transparent;
  border-top: none;
}

body:has(#treasureChest:not([hidden])) #hud.started .app-footer,
body:has(#teamModal:not([hidden])) #hud.started .app-footer,
body:has(#panelModal:not([hidden])) #hud.started .app-footer,
body:has(#tourSelectModal:not([hidden])) #hud.started .app-footer,
body:has(#photoAlbumModal:not([hidden])) #hud.started .app-footer,
body:has(#photoViewer:not([hidden])) #hud.started .app-footer,
body:has(#spiritTalkOverlay:not([hidden])) #hud.started .app-footer,
body:has(#stopSheet:not([hidden])) #hud.started .app-footer,
body.photo-camera-active #hud.started .app-footer,
body.tour-builder-open #hud.started .app-footer {
  display: none !important;
}

.splash-panel__permissions {
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(212, 140, 100, 0.22);
}

.splash-panel__permissions-details {
  margin-top: 4px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(212, 140, 100, 0.22);
}

.splash-panel__permissions-details > summary {
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-secondary);
  cursor: pointer;
  list-style: none;
  touch-action: manipulation;
}

.splash-panel__permissions-details > summary::-webkit-details-marker {
  display: none;
}

.splash-panel__permissions-details > summary::after {
  content: " ▾";
  color: var(--color-gold);
}

.splash-panel__permissions-details[open] > summary::after {
  content: " ▴";
}

.splash-panel__permissions-details .splash-panel__permissions {
  margin-top: 0;
  padding-top: 0;
  border: none;
  background: transparent;
}

@media (max-height: 740px) {
  .splash-panel__title {
    font-size: 20px;
  }

  .splash-panel__permissions-note {
    display: none;
  }
}

.splash-panel__permissions-heading {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-active-text);
}

.splash-panel__permissions-list {
  margin: 0;
  padding: 0 0 0 1.1em;
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text-secondary);
}

.splash-panel__permissions-list li + li {
  margin-top: 6px;
}

.splash-panel__permissions-list strong {
  color: var(--color-text-secondary);
  font-weight: 700;
}

.splash-panel__permissions-note {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: #8b5a4a;
}

.splash-panel__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-active-text);
}

.splash-panel__input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(212, 140, 100, 0.35);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font: inherit;
}

.splash-panel__origin-field {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.splash-panel__origin-field.is-open {
  z-index: 40;
}

.splash-panel__origin-field.is-locked .splash-panel__origin-input {
  opacity: 0.88;
  cursor: not-allowed;
}

.splash-panel__origin-input {
  padding-right: 36px;
}

.splash-panel__origin-list {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  z-index: 2000;
  margin: 0;
  padding: 6px;
  list-style: none;
  max-height: min(40vh, 240px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border-radius: 10px;
  border: 1px solid rgba(212, 140, 100, 0.45);
  background: rgba(8, 8, 8, 0.98);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.splash-panel__origin-list.is-portaled {
  position: fixed;
  top: var(--origin-list-top, 0);
  left: var(--origin-list-left, 0);
  right: auto;
  width: var(--origin-list-width, min(100vw - 24px, 420px));
  max-height: var(--origin-list-max-height, min(40vh, 240px));
  z-index: 10000;
}

.splash-panel__origin-list[hidden] {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden;
}

.splash-panel__origin-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.splash-panel__origin-option:hover,
.splash-panel__origin-option.is-active {
  background: rgba(255, 213, 74, 0.14);
}

.splash-panel__origin-option-primary {
  font-size: 15px;
  font-weight: 700;
  color: #ffd54a;
}

.splash-panel__origin-option-secondary {
  font-size: 12px;
  line-height: 1.35;
  color: var(--color-text-secondary);
}

.splash-panel__origin-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--color-text-dim);
}

.splash-panel__origin-hint[hidden] {
  display: none;
}

.splash-panel__share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}

.splash-panel__share-row .splash-panel__secondary {
  flex: 1 1 140px;
}

.splash-panel__join {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 213, 74, 0.12);
  border: 1px solid rgba(255, 213, 74, 0.28);
  font-size: 14px;
}

.splash-panel__join p {
  margin: 0;
}

.splash-panel__join p + p {
  margin-top: 0.35rem;
}

.splash-panel__leader-note {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.72);
}

.splash-panel__mode-field {
  margin: 0 0 12px;
}

.splash-panel__mode-toggle {
  display: flex;
  gap: 8px;
}

.splash-panel__mode-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.splash-panel__mode-btn-icon {
  flex-shrink: 0;
  display: block;
}

.splash-panel__mode-btn.active {
  background: rgba(255, 213, 74, 0.18);
  border-color: rgba(255, 213, 74, 0.55);
  color: #fff8e1;
}

.splash-panel__mode-btn:disabled,
.splash-panel__mode-btn.is-disabled,
.splash-panel__mode-btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}

.splash-panel__select {
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.6) 50%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.6) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% + 2px), calc(100% - 12px) calc(50% + 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.tour-modal__leader-field {
  margin: 0 0 10px;
}

.tour-modal__leader-label {
  display: block;
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.tour-modal__select {
  width: 100%;
  padding: 10px 32px 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--color-text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.6) 50%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.6) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% + 2px), calc(100% - 12px) calc(50% + 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.tour-modal__leader {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
}

.splash-panel__code {
  margin: -4px 0 0;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.splash-panel__code code {
  font-size: 15px;
  color: #ffd54a;
}

.splash-panel__members {
  margin: 0;
  min-height: 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

.splash-panel__members:empty {
  display: none;
}

.splash-panel__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  bottom: 0;
  z-index: 310;
  margin-top: 4px;
  padding: 12px 0 max(8px, env(safe-area-inset-bottom));
  pointer-events: auto;
  touch-action: manipulation;
  background: linear-gradient(
    to top,
    var(--color-bg-overlay-strong) 72%,
    rgba(0, 0, 0, 0.92) 88%,
    transparent
  );
}

.splash-panel__action-slot[hidden] {
  display: none !important;
}

#inviteTeamBtn[hidden] {
  display: none !important;
}

.splash-panel__actions .splash-panel__primary {
  margin-top: 0;
}

.splash-panel__primary--with-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.splash-panel__btn-icon {
  flex-shrink: 0;
  display: block;
}

.splash-panel__note {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #8b5a4a;
}

.splash-panel__note:empty {
  display: none;
}

.splash-panel__error {
  margin: 0;
  font-size: 13px;
  color: #e8a090;
}

.splash-panel__error[hidden] {
  display: none;
}

.splash-panel__primary,
.splash-panel__secondary {
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.splash-panel__primary {
  width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
  background: linear-gradient(180deg, #ffd54a, #f59e0b);
  color: #1a1410;
}

.splash-panel__primary:disabled,
.splash-panel__primary.is-disabled,
.splash-panel__primary[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}

.splash-panel__secondary {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-secondary);
  border: 1px solid rgba(212, 140, 100, 0.25);
  padding: 12px 14px;
  font-size: 14px;
}

.splash-panel__secondary:disabled,
.splash-panel__secondary.is-disabled,
.splash-panel__secondary[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}

#startNewTourBtn.splash-panel__primary {
  margin-top: 0;
}

.tour-select-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
}

body.tour-select-open #hud:not(.started) {
  visibility: hidden;
  pointer-events: none;
}

body.tour-select-open:not(.tour-select-profile-gate) #controls {
  visibility: hidden;
}

body.tour-select-initial .tour-select-modal__backdrop[hidden] {
  display: none;
}

.tour-select-modal__main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.tour-select-modal__main[hidden] {
  display: none;
}

.tour-select-modal__intro {
  flex: 1;
  min-width: 0;
}

.tour-select-modal__intro-copy {
  min-width: 0;
}

.tour-select-modal__welcome {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}

.tour-select-modal__welcome strong {
  color: #ffd54a;
  font-weight: 800;
}

.tour-select-modal__welcome[hidden] {
  display: none;
}

.tour-select-modal__footer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(560px, 100%);
  width: 100%;
  margin: 12px auto 0;
  padding-top: 4px;
}

.tour-select-panel__edit-tours {
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid rgba(255, 213, 74, 0.38);
  border-radius: 14px;
  background: rgba(255, 213, 74, 0.08);
  color: #ffd54a;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  touch-action: manipulation;
}

.tour-select-panel__edit-tours[hidden] {
  display: none;
}

.tour-select-panel__edit-tours:hover,
.tour-select-panel__edit-tours:focus-visible {
  border-color: rgba(255, 213, 74, 0.62);
  background: rgba(255, 213, 74, 0.14);
}

.tour-select-panel__edit-tours.is-builder-active {
  border-color: rgba(255, 213, 74, 0.75);
  box-shadow: 0 0 0 2px rgba(255, 213, 74, 0.2);
}

.tour-select-panel__start-team {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 14px 18px;
  border: 2px solid rgba(255, 213, 74, 0.45);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 213, 74, 0.22) 0%, rgba(255, 213, 74, 0.1) 100%);
  color: #fff7d6;
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.tour-select-panel__start-team:hover,
.tour-select-panel__start-team:focus-visible {
  border-color: rgba(255, 213, 74, 0.75);
  background: linear-gradient(180deg, rgba(255, 213, 74, 0.32) 0%, rgba(255, 213, 74, 0.16) 100%);
}

.tour-select-panel__start-team.is-active {
  border-color: rgba(255, 213, 74, 0.95);
  background: linear-gradient(180deg, rgba(255, 213, 74, 0.42) 0%, rgba(255, 213, 74, 0.22) 100%);
  box-shadow: 0 0 0 2px rgba(255, 213, 74, 0.35), 0 10px 28px rgba(0, 0, 0, 0.28);
}

.tour-select-panel__start-team-icon {
  flex: 0 0 auto;
}

.tour-select-detail-step {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: min(560px, 100%);
  margin: 0 auto;
  gap: 12px;
}

.tour-select-detail-step[hidden] {
  display: none;
}

.tour-select-detail-step__masthead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex: 0 0 auto;
}

.tour-select-detail-step__intro {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.tour-select-detail-step__close {
  flex: 0 0 auto;
  align-self: flex-start;
}

.tour-select-detail-step__header {
  flex: 0 0 auto;
}

.tour-select-detail-step__hero {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.tour-select-detail-step__hero-copy {
  flex: 1;
  min-width: 0;
}

.tour-select-detail-step__mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 1px solid rgba(255, 213, 74, 0.35);
  background: rgba(255, 213, 74, 0.14);
  color: #ffd54a;
}

.tour-select-detail-step__mark[hidden] {
  display: none !important;
}

.tour-select-panel__card-mark--image {
  overflow: hidden;
  padding: 0;
}

.tour-select-detail-step__mark.explore-mode-mark--custom {
  border-color: rgba(201, 168, 58, 0.45);
  background: rgba(201, 168, 58, 0.16);
  color: #e8c96a;
}

.tour-select-detail-step__mark-icon {
  display: block;
}

.tour-select-detail-step__title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: #ffd54a;
  line-height: 1.2;
}

.tour-select-detail-step__summary {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--color-text-secondary);
}

.tour-select-detail-step__summary[hidden] {
  display: none;
}

.tour-select-detail-step__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.tour-select-detail-step__stats[hidden] {
  display: none;
}

.tour-select-detail-step__stat {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 213, 74, 0.16);
  border: 1px solid rgba(255, 213, 74, 0.35);
  color: #fff7d6;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.tour-select-detail-step__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}

.tour-select-detail-step__stops-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.tour-select-detail-step__stops-title[hidden] {
  display: none;
}

.tour-select-detail-step__loading {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.tour-select-detail-step__loading[hidden] {
  display: none;
}

.skeleton-block {
  display: block;
  border-radius: 8px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(255, 255, 255, 0.14) 50%,
    rgba(255, 255, 255, 0.06) 100%
  );
  background-size: 200% 100%;
  animation: tour-select-skeleton-shimmer 1.2s ease-in-out infinite;
}

@keyframes tour-select-skeleton-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.tour-select-detail-stop--skeleton {
  pointer-events: none;
}

.tour-select-detail-stop--skeleton .tour-select-detail-stop__order {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: transparent;
}

.tour-select-detail-stop--skeleton .tour-select-detail-stop__thumb-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 10px;
}

.tour-select-detail-stop--skeleton .tour-select-detail-stop__head {
  display: contents;
}

.tour-select-detail-stop--skeleton .tour-select-detail-stop__name {
  width: min(72%, 220px);
  height: 16px;
}

.tour-select-detail-stop--skeleton .tour-select-detail-stop__actions {
  width: 72px;
  height: 28px;
  border-radius: 999px;
}

.tour-select-detail-stop--skeleton .tour-select-detail-stop__meta {
  width: min(58%, 180px);
  height: 12px;
  margin-top: 8px;
}

.tour-select-detail-stop--skeleton .tour-select-detail-stop__description {
  width: 100%;
  height: 36px;
  margin-top: 8px;
}

.tour-select-detail-step__stops {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tour-select-detail-stop {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 213, 74, 0.12);
  border: 1px solid rgba(255, 213, 74, 0.28);
}

.tour-select-detail-stop:has(.tour-select-detail-stop__media) {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.tour-select-detail-stop__media {
  position: relative;
  width: 104px;
  aspect-ratio: 1;
  flex-shrink: 0;
  min-width: 0;
}

.tour-select-detail-stop__order {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffd54a;
  color: #1a1208;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.tour-select-detail-stop__media .tour-select-detail-stop__order {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.tour-select-detail-stop__thumb-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 1px solid rgba(255, 213, 74, 0.28);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  touch-action: manipulation;
}

.tour-select-detail-stop__thumb-wrap:hover,
.tour-select-detail-stop__thumb-wrap:focus-visible {
  border-color: rgba(255, 213, 74, 0.55);
  box-shadow: 0 0 0 2px rgba(255, 213, 74, 0.18);
  outline: none;
}

.tour-select-detail-stop__thumb-wrap::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M15 3h6v6h-2V6.41l-7.29 7.3-1.42-1.42 7.3-7.29H15V3zM5 5h8v2H7v10h10v-6h2v8H5V5z'/%3E%3C/svg%3E") center / 12px no-repeat;
  pointer-events: none;
}

.tour-select-detail-stop__thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

button.tour-select-detail-stop__thumb-wrap {
  min-height: 0;
  font: inherit;
  color: inherit;
}

.tour-select-detail-stop__body {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 8px;
  row-gap: 1px;
}

.tour-select-detail-stop__head {
  display: contents;
}

.tour-select-detail-stop__name {
  grid-column: 1;
  grid-row: 1;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.tour-select-detail-stop__actions {
  grid-column: 2;
  grid-row: 1 / span 3;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex: 0 0 auto;
  align-self: start;
}

.tour-select-detail-stop__meta {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 247, 214, 0.82);
  line-height: 1.2;
}

.tour-select-detail-stop__address {
  grid-column: 1;
  grid-row: 3;
  margin: 0;
  font-size: 12px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.68);
}

.tour-select-detail-stop__description {
  grid-column: 1 / -1;
  grid-row: 4;
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.82);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tour-select-detail-stop__mic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-height: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #ffd54a;
  color: #1a1208;
  cursor: pointer;
  touch-action: manipulation;
  flex-shrink: 0;
}

.tour-select-detail-stop__mic:hover,
.tour-select-detail-stop__mic:focus-visible {
  background: #ffe082;
  box-shadow: 0 0 0 2px rgba(255, 213, 74, 0.35);
  outline: none;
}

.tour-select-detail-stop__edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff7d6;
  text-decoration: none;
  touch-action: manipulation;
}

.tour-select-detail-stop__edit:hover,
.tour-select-detail-stop__edit:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  outline: none;
}

.tour-select-detail-stop__coins {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 213, 74, 0.22);
  border: 1px solid rgba(255, 213, 74, 0.45);
  color: #ffd54a;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.tour-select-detail-stop--personalized {
  border-color: rgba(129, 199, 255, 0.35);
  background: rgba(66, 165, 245, 0.08);
}

.tour-select-detail-stop__remove {
  flex: 0 0 auto;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 247, 214, 0.9);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.tour-select-detail-stop__remove:hover,
.tour-select-detail-stop__remove:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  outline: none;
}

.tour-select-detail-stop__remove:disabled {
  opacity: 0.55;
  cursor: default;
}

/* Mobile tour detail — denser list rows (map list view + tour picker) */
@media (max-width: 899px) {
  .tour-select-detail-step {
    gap: 8px;
  }

  .tour-select-detail-step__close {
    margin-bottom: 0;
  }

  .tour-select-detail-step__header {
    display: block;
  }

  .tour-select-detail-step__stats {
    margin-top: 6px;
  }

  .tour-select-detail-step__title {
    font-size: 18px;
    line-height: 1.15;
  }

  .tour-select-detail-step__summary {
    font-size: 13px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .tour-select-detail-step__stats {
    gap: 5px;
  }

  .tour-select-detail-step__stat {
    padding: 3px 8px;
    font-size: 11px;
  }

  .tour-select-detail-step__stops-title {
    margin: 0 0 6px;
    font-size: 11px;
    letter-spacing: 0.06em;
  }

  .tour-select-detail-step__stops {
    gap: 6px;
  }

  .tour-select-detail-stop {
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
  }

  .tour-select-detail-stop:has(.tour-select-detail-stop__media) {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  .tour-select-detail-stop__media {
    width: 88px;
  }

  .tour-select-detail-stop__order {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }

  .tour-select-detail-stop__media .tour-select-detail-stop__order {
    top: 5px;
    left: 5px;
  }

  .tour-select-detail-stop__thumb-wrap {
    border-radius: 8px;
  }

  .tour-select-detail-stop__thumb-wrap::after {
    width: 16px;
    height: 16px;
    background-size: 10px;
  }

  .tour-select-detail-stop__name {
    font-size: 14px;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .tour-select-detail-stop__mic {
    width: 28px;
    height: 28px;
  }

  .tour-select-detail-stop__mic svg {
    width: 15px;
    height: 15px;
  }

  .tour-select-detail-stop__coins {
    padding: 2px 6px;
    font-size: 10px;
  }

  .tour-select-detail-stop__meta {
    font-size: 11px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .tour-select-detail-stop__address {
    font-size: 11px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .tour-select-detail-stop__description {
    font-size: 12px;
    line-height: 1.35;
    -webkit-line-clamp: 2;
  }

  body.tour-select-open:has(.tour-select-detail-step:not([hidden])) .tour-select-modal__sheet {
    padding-top: max(6px, env(safe-area-inset-top));
    padding-inline: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}

.tour-select-profile-step {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
  gap: 12px;
}

.tour-select-profile-step[hidden] {
  display: none;
}

.tour-select-profile-step__close {
  align-self: flex-end;
  flex: 0 0 auto;
}

.tour-select-profile-step__title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: #ffd54a;
}

.tour-select-profile-step__hint {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--color-text-secondary);
}

.tour-select-profile-step__fields {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.tour-select-panel__continue {
  width: 100%;
  min-height: 52px;
  border: none;
  border-radius: 14px;
  background: #c0392b;
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}

.tour-select-panel__continue:hover,
.tour-select-panel__continue:focus-visible {
  background: #d64535;
}

.tour-select-detail-step__footer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: max(4px, env(safe-area-inset-bottom));
}

.tour-select-detail-step__overview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 213, 74, 0.45);
  border-radius: 14px;
  background: rgba(255, 213, 74, 0.12);
  color: #ffd54a;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.tour-select-detail-step__overview:hover,
.tour-select-detail-step__overview:focus-visible {
  border-color: rgba(255, 213, 74, 0.7);
  background: rgba(255, 213, 74, 0.2);
  outline: none;
}

.tour-select-detail-step__overview[hidden] {
  display: none;
}

.splash-panel.is-tour-profile-gate {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.splash-panel.is-tour-profile-gate > * {
  display: none !important;
}

.splash-panel.is-tour-profile-gate > label[for="playerNameInput"],
.splash-panel.is-tour-profile-gate > #playerNameInput,
.splash-panel.is-tour-profile-gate > #playerOriginField,
.splash-panel.is-tour-profile-gate > #splashError {
  display: block !important;
}

.splash-panel.is-tour-profile-gate > #playerOriginField {
  display: flex !important;
}

.splash-panel.is-tour-team-setup-gate {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.splash-panel.is-tour-team-setup-gate > * {
  display: none !important;
}

.splash-panel.is-tour-team-setup-gate > label[for="playerNameInput"],
.splash-panel.is-tour-team-setup-gate > #playerNameInput,
.splash-panel.is-tour-team-setup-gate > #playerOriginField,
.splash-panel.is-tour-team-setup-gate > #teamSetupFields,
.splash-panel.is-tour-team-setup-gate > #splashActions,
.splash-panel.is-tour-team-setup-gate > #splashError {
  display: block !important;
}

.splash-panel.is-tour-team-setup-gate > #playerOriginField,
.splash-panel.is-tour-team-setup-gate > #teamSetupFields {
  display: flex !important;
  flex-direction: column;
}

.splash-panel.is-tour-team-setup-gate > #splashActions {
  display: flex !important;
  flex-direction: column;
}

.splash-panel__invite-link-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.splash-panel__invite-link-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.splash-panel__invite-link-input {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
}

.splash-panel__invite-link-copy {
  flex: 0 0 auto;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(26, 20, 16, 0.2);
  background: rgba(255, 255, 255, 0.9);
  color: #1a1410;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.splash-panel__invite-link-field[hidden],
.splash-panel__invite-link-copy[hidden] {
  display: none !important;
}

body.tour-select-profile-gate .splash-panel__origin-list.is-portaled {
  z-index: 10160;
}

body.tour-select-profile-gate .splash-panel__origin-field.is-open {
  z-index: 10150;
}

body.tour-select-profile-gate #hud:not(.started) {
  pointer-events: auto;
}

body.tour-select-profile-gate .tour-select-modal {
  pointer-events: auto;
}

.tour-select-modal[hidden] {
  display: none;
}

.tour-select-modal__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  background: var(--color-bg-overlay);
  cursor: pointer;
}

.tour-select-modal__sheet {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  overflow: hidden;
  background: linear-gradient(180deg, var(--color-bg-deep) 0%, var(--color-bg-deep) 100%);
}

.tour-select-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex: 0 0 auto;
  margin-bottom: 10px;
  max-width: min(560px, 100%);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.tour-select-modal__title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  color: #ffd54a;
}

.tour-select-modal__subtitle {
  margin: 3px 0 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--color-text-secondary);
}

.tour-select-modal__overview {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 213, 74, 0.45);
  border-radius: 999px;
  background: rgba(255, 213, 74, 0.12);
  color: #ffd54a;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.tour-select-modal__overview:hover,
.tour-select-modal__overview:focus-visible {
  border-color: rgba(255, 213, 74, 0.7);
  background: rgba(255, 213, 74, 0.2);
  outline: none;
}

.tour-select-modal__overview-icon {
  flex: 0 0 auto;
  display: block;
}

.tour-select-modal__close {
  flex: 0 0 auto;
}

.tour-select-modal__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(560px, 100%);
  width: 100%;
  margin: 0 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  box-sizing: border-box;
}

body.tour-select-open {
  overflow: hidden;
}

.tour-select-panel__section-title {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-dim);
}

.tour-select-panel__filters {
  position: relative;
  margin: 0 0 10px;
}

.tour-select-category {
  position: relative;
}

.tour-select-category__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.tour-select-category__trigger:hover,
.tour-select-category__trigger:focus-visible {
  border-color: rgba(255, 213, 74, 0.45);
}

.tour-select-category__trigger[aria-expanded="true"] {
  border-color: rgba(255, 213, 74, 0.55);
  background: rgba(255, 213, 74, 0.08);
}

.tour-select-category__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tour-select-category__chevron {
  flex: 0 0 auto;
  font-size: 14px;
  opacity: 0.8;
}

.tour-select-category__panel {
  position: absolute;
  z-index: 5;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 213, 74, 0.28);
  background: #1a1410;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.tour-select-category__panel[hidden] {
  display: none;
}

.tour-select-category__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tour-select-category__pill {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.88);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  padding: 8px 12px;
  cursor: pointer;
}

.tour-select-category__pill::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  flex: 0 0 auto;
}

.tour-select-category__pill.is-active {
  border-color: rgba(255, 213, 74, 0.55);
  background: rgba(255, 213, 74, 0.14);
  color: #fff7d6;
}

.tour-select-category__pill.is-active::before {
  content: "✓";
  display: grid;
  place-items: center;
  border-color: #ffd54a;
  background: #ffd54a;
  color: #1a1410;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  box-shadow: none;
}

.tour-select-panel__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tour-select-panel__item {
  min-width: 0;
}

.tour-select-panel__card {
  width: 100%;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 9px 10px 8px;
  border-radius: 12px;
  border: 1px solid rgba(26, 20, 16, 0.12);
  background: #ffd54a;
  color: #1a1410;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.16);
}

.tour-select-panel__card:hover:not(:disabled) {
  background: #ffe082;
  border-color: rgba(26, 20, 16, 0.18);
  transform: translateY(-1px);
}

.tour-select-panel__card:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.tour-select-panel__list--modes .tour-select-panel__card--mode {
  position: relative;
  min-height: 0;
  gap: 5px;
}

.tour-select-panel__card--free-roam {
  background: linear-gradient(145deg, #ffe082 0%, #ffd54a 58%, #f5c518 100%);
  border-color: rgba(26, 20, 16, 0.1);
}

.tour-select-panel__card--custom {
  background: linear-gradient(145deg, #e0c96a 0%, #c9a83a 58%, #a8872c 100%);
  border-color: rgba(26, 20, 16, 0.14);
}

.tour-select-panel__card-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(26, 20, 16, 0.1);
  color: #1a1410;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.tour-select-panel__card-mark-icon {
  display: block;
}

.tour-select-panel__card-title {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  color: #1a1410;
}

.tour-select-panel__card-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
}

.tour-select-panel__card-category {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(26, 20, 16, 0.12);
  color: #1a1410;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tour-select-panel__card-summary {
  font-size: 11px;
  line-height: 1.3;
  color: rgba(26, 20, 16, 0.72);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tour-select-panel__card-stats {
  margin-top: auto;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.3;
  color: rgba(26, 20, 16, 0.92);
}

.tour-select-panel__card-duration {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  color: rgba(26, 20, 16, 0.88);
}

.tour-select-panel__card-duration[hidden] {
  display: none;
}

.tour-select-panel__card-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(26, 20, 16, 0.55);
}

.tour-select-panel__card-trial-link {
  align-self: flex-start;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  color: rgba(26, 20, 16, 0.9);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tour-select-panel__card-trial-link:hover,
.tour-select-panel__card-trial-link:focus-visible {
  color: #1a1410;
}

.tour-select-panel__empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text-secondary);
}

.tour-select-panel__error {
  margin: 0;
  font-size: 13px;
  color: #e8a090;
}

.tour-select-panel__error[hidden] {
  display: none;
}

#hud.compact #status {
  margin-top: 0;
  font-weight: 600;
}

#hud.compact.navigating {
  background: rgba(0, 0, 0, 0.88);
  border: 1px solid rgba(255, 213, 74, 0.35);
}

#hud.compact.approach {
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 213, 74, 0.45);
}

#locationLabel {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-active-text);
}

#distanceLabel {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--color-text-secondary);
}

#navPanel {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
}

#navPanel[hidden] {
  display: none;
}

#mapLoadingOverlay {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--color-bg-scrim-heavy);
  color: var(--color-text-secondary);
  text-align: center;
  pointer-events: none;
}

#mapLoadingOverlay[hidden] {
  display: none;
}

#mapLoadingOverlay p {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.map-loading__spinner {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255, 213, 74, 0.25);
  border-top-color: var(--color-active-text);
  border-radius: 50%;
  animation: map-loading-spin 0.85s linear infinite;
}

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

#arScanOverlay {
  position: fixed;
  left: 50%;
  bottom: max(96px, calc(env(safe-area-inset-bottom) + 72px));
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(255, 213, 74, 0.35);
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 600;
  pointer-events: none;
}

#arScanOverlay.ar-scan--motion-retry {
  pointer-events: auto;
  cursor: pointer;
  border-color: rgba(255, 213, 74, 0.75);
}

.ar-scan__spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 213, 74, 0.25);
  border-top-color: var(--color-active-text);
  border-radius: 50%;
  animation: map-loading-spin 0.85s linear infinite;
  flex-shrink: 0;
}

#navTopBar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: max(8px, env(safe-area-inset-top)) 12px 10px;
  background: var(--color-bg-overlay-strong);
  border-bottom: none;
}

#navBackBtn {
  display: none;
  flex: 0 0 auto;
  width: auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-secondary);
  font-size: 13px;
}

body.map-travel #navBackBtn {
  display: inline-flex;
}

#navTargetName {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-secondary);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-top-bar__title-wrap {
  flex: 1;
  min-width: 0;
}

.nav-top-bar__title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.nav-explore-mode-mark {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(255, 213, 74, 0.35);
  color: #1a1410;
}

.nav-explore-mode-mark[hidden] {
  display: none !important;
}

.nav-explore-mode-mark--image {
  overflow: hidden;
  background: rgba(255, 213, 74, 0.12);
}

.nav-explore-mode-mark__photo,
.tour-select-panel__card-mark--image .nav-explore-mode-mark__photo,
.tour-select-detail-step__mark--image .nav-explore-mode-mark__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nav-explore-mode-mark.explore-mode-mark--free-roam {
  background: linear-gradient(145deg, #ffe082, #ffd54a);
}

.nav-explore-mode-mark.explore-mode-mark--custom {
  background: linear-gradient(145deg, #e0c96a, #b8922f);
}

.nav-explore-mode-mark__icon {
  display: block;
}

.nav-top-bar__meta {
  flex: 0 0 auto;
  margin: 0 0 0 auto;
  padding-left: 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  color: rgba(255, 213, 74, 0.82);
  white-space: nowrap;
}

.nav-top-bar__meta[hidden] {
  display: none;
}

.nav-top-bar__tools {
  display: none;
}

.nav-map-attribution-slot {
  flex: 0 0 auto;
}

.nav-map-attribution-slot:empty {
  display: none;
}

.nav-map-style-slot {
  flex: 0 0 auto;
}

.nav-map-style-slot:empty {
  display: none;
}

.spirit-voice-dock__map-tools .nav-map-style-control__group {
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--color-border-chrome);
  box-shadow: none;
}

.spirit-voice-dock__map-tools .nav-map-style-control__group button {
  min-width: 4.75em;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.spirit-voice-dock__map-tools .nav-map-style-control__group button.active {
  background: rgba(255, 213, 74, 0.2);
  color: #ffd54a;
}

.spirit-voice-dock__map-tools .nav-map-style-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.spirit-voice-dock__map-tools .nav-map-recenter-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 2px solid rgba(255, 213, 74, 0.55);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 213, 74, 0.28), rgba(180, 130, 20, 0.18));
  color: #fff7d6;
  box-shadow: 0 4px 12px rgba(255, 213, 74, 0.16);
  cursor: pointer;
  touch-action: manipulation;
}

.spirit-voice-dock__map-tools .nav-map-recenter-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.spirit-voice-dock__map-tools .nav-map-recenter-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.spirit-voice-dock__map-tools .nav-map-recenter-btn__icon {
  display: block;
}

.spirit-voice-dock__map-tools .map-attribution-info {
  position: relative;
}

.spirit-voice-dock__map-tools .map-attribution-info__toggle {
  width: 36px;
  height: 36px;
  font-size: 0.95rem;
}

.spirit-voice-dock__map-tools .map-attribution-info__panel {
  bottom: calc(100% + 8px);
  top: auto;
  left: 0;
  right: auto;
}

#navChestBtn {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  width: auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 213, 74, 0.12);
  color: #ffd54a;
  border: 1px solid rgba(255, 213, 74, 0.35);
  font-size: 12px;
  font-weight: 700;
}

#navChestBtn:not([hidden]) {
  display: inline-flex;
}

#navModeToggle {
  display: none;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

body.map-travel #navModeToggle {
  display: inline-flex;
}

body.map-route-preview #navModeToggle {
  display: inline-flex;
}

#navModeToggle button {
  width: auto;
  padding: 8px 14px;
  border-radius: 999px;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 13px;
}

#navModeToggle button.active {
  background: var(--color-red-bright);
  color: #fff;
}

.profile-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 213, 74, 0.35);
  background: rgba(255, 213, 74, 0.12);
  color: #ffd54a;
}

.profile-btn:active {
  transform: scale(0.96);
}

.profile-btn[hidden],
body:has(#treasureChest:not([hidden])) .profile-btn,
body:has(#teamModal:not([hidden])) .profile-btn,
body:has(#panelModal:not([hidden])) .profile-btn,
body:has(#tourSelectModal:not([hidden])) .profile-btn,
body:has(#tourCarouselModal:not([hidden])) .profile-btn,
body:has(#filterModal:not([hidden])) .profile-btn,
body:has(#onboardingProfileModal:not([hidden])) .profile-btn,
body:has(#onboardingJoinTeamModal:not([hidden])) .profile-btn,
body:has(#onboardingTeamModal:not([hidden])) .profile-btn,
body:has(#profileModal:not([hidden])) .profile-btn,
body:has(#photoAlbumModal:not([hidden])) .profile-btn,
body:has(#photoViewer:not([hidden])) .profile-btn,
body:has(#stopSheet:not([hidden])) .profile-btn,
body:has(#permissionGateModal:not([hidden])) .profile-btn,
body:has(#spiritTalkOverlay:not([hidden])) .profile-btn,
body.tour-builder-open .profile-btn,
body.photo-camera-active .profile-btn,
body.ar-active .profile-btn {
  display: none !important;
}

.profile-btn--welcome,
.profile-btn--float {
  position: fixed;
  z-index: 10055;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
}

.profile-btn--nav {
  width: 36px;
  height: 36px;
}

.profile-btn__icon {
  display: block;
}

.profile-modal__sheet {
  height: auto;
  max-height: min(92vh, 640px);
}

.profile-modal__body {
  flex: 0 1 auto;
  min-height: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#profileModal .app-modal__actions--profile-modes .app-modal__primary,
#profileModal .app-modal__actions--profile-modes .app-modal__secondary {
  width: 100%;
}

.profile-teams[hidden] {
  display: none !important;
}

.profile-teams__list[hidden] {
  display: none !important;
}

.profile-teams {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 213, 74, 0.14);
}

.profile-teams__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text-secondary);
}

.profile-teams__empty {
  margin: 0;
  font-size: 0.88rem;
  color: var(--color-text-muted);
}

.profile-teams__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-teams__item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-teams__item.is-active {
  border-color: rgba(255, 213, 74, 0.42);
  background: rgba(255, 213, 74, 0.08);
}

.profile-teams__item-main {
  min-width: 0;
  flex: 1;
}

.profile-teams__item-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-teams__item-meta {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.profile-teams__item-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
  max-width: 52%;
}

.profile-teams__item-btn {
  width: auto;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-secondary);
}

.profile-teams__item-btn--leave {
  color: #ffb4a8;
  background: rgba(255, 120, 100, 0.12);
}

.profile-teams__active-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #1a1410;
  background: #ffd54a;
}

.profile-teams__block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-teams__block[hidden] {
  display: none !important;
}

.profile-teams__input--code {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.profile-teams__error {
  margin: 0;
}

.nav-category-filters {
  display: none !important;
}

.nav-category-filters__row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 12px 1px;
  scroll-padding-inline: 12px;
}

.nav-category-filters__row--categories::after {
  content: "";
  flex: 0 0 8px;
}

.nav-category-filters__row--treasure {
  flex-wrap: nowrap;
  overflow: visible;
  padding-top: 0;
  padding-bottom: 0;
}

.nav-treasure-sites-toggle--inline {
  flex: 0 0 auto;
  margin-left: 2px;
}

.nav-treasure-sites-toggle--inline .nav-treasure-sites-toggle__icon {
  width: 20px;
  height: 20px;
}

.nav-treasure-sites-toggle--inline .nav-treasure-sites-toggle__chest {
  width: 18px;
  height: 18px;
}

body.map-tour-overview .nav-explore-mode-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

.nav-treasure-sites-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: auto;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  opacity: 0.55;
  box-shadow: none;
  transition:
    color 120ms ease,
    opacity 120ms ease;
}

.nav-treasure-sites-toggle__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-treasure-sites-toggle__chest {
  width: 18px;
  height: 18px;
  display: block;
}

.nav-treasure-sites-toggle__label {
  white-space: nowrap;
}

.nav-treasure-sites-toggle.active {
  opacity: 1;
  border: none;
  background: transparent;
  color: #ffe566;
  box-shadow: none;
}

.nav-treasure-sites-toggle.active .treasure-chest-icon__body,
.nav-treasure-sites-toggle.active .treasure-chest-icon__lid {
  filter: drop-shadow(0 0 4px rgba(255, 220, 80, 0.45));
}

.nav-category-filters__panel-layer {
  position: relative;
  z-index: 201;
  pointer-events: none;
}

.nav-category-filters__row::-webkit-scrollbar {
  display: none;
}

.nav-category-dropdown {
  position: relative;
  flex: 0 0 auto;
}

.nav-category-dropdown__trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.nav-category-dropdown__caret {
  font-size: 9px;
  line-height: 1;
  opacity: 0.75;
  transition: transform 120ms ease;
}

.nav-category-dropdown__trigger.is-open .nav-category-dropdown__caret {
  transform: rotate(180deg);
}

.nav-category-dropdown__panel {
  position: fixed;
  z-index: 1200;
  min-width: min(280px, calc(100vw - 28px));
  max-width: min(360px, calc(100vw - 28px));
  max-height: min(52vh, 320px);
  overflow: auto;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(212, 140, 100, 0.22);
  background: var(--color-bg-deep);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  pointer-events: auto;
}

.nav-category-dropdown__panel[hidden] {
  display: none;
}

.nav-category-dropdown__panel-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.nav-category-filters button.nav-category-chip--branch {
  width: 100%;
  margin-bottom: 2px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.nav-category-filters[hidden] {
  display: none;
}

body.map-travel .nav-category-filters {
  display: none;
}

.nav-category-filters button.nav-category-chip {
  width: auto;
  padding: 5px 11px;
  border-radius: 999px;
  border: 2px solid var(--cat-stroke, rgba(212, 140, 100, 0.45));
  background: color-mix(in srgb, var(--cat-fill, #8b5a4a) 18%, transparent);
  color: var(--cat-stroke, var(--color-text-secondary));
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 0 0 0 transparent;
  transition:
    background 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease,
    color 120ms ease,
    opacity 120ms ease;
}

.nav-category-filters button.nav-category-chip:not(.active) {
  opacity: 0.45;
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text-muted);
  box-shadow: none;
}

.nav-category-filters button.nav-category-chip.active {
  background: var(--cat-fill);
  border-color: var(--cat-stroke);
  color: var(--color-bg-deep);
  opacity: 1;
  box-shadow: 0 0 12px color-mix(in srgb, var(--cat-fill) 55%, transparent);
}

.nav-category-filters button.nav-category-chip--all {
  --cat-fill: var(--color-text-muted);
  --cat-stroke: var(--color-text-secondary);
}

.nav-category-filters button.nav-category-chip--all.active {
  color: var(--color-bg-deep);
}

.nav-category-filters button.nav-category-chip--parent {
  font-weight: 800;
}

.nav-category-filters button.nav-category-chip--child.nav-category-chip--depth-2 {
  font-size: 12px;
  padding: 5px 11px;
}

.nav-category-filters button.nav-category-chip--child.nav-category-chip--depth-3 {
  font-size: 11px;
  padding: 4px 10px;
  margin-left: 8px;
}

.nav-category-filters button.nav-category-chip.is-partial:not(.active) {
  opacity: 0.82;
  background: color-mix(in srgb, var(--cat-fill, #8b5a4a) 42%, transparent);
  border-color: var(--cat-stroke, rgba(212, 140, 100, 0.45));
  color: var(--cat-stroke, var(--color-text-secondary));
}

.nav-category-filters button.nav-category-chip--child {
  margin-left: 0;
}

.nav-category-filters button.nav-category-chip[hidden] {
  display: none;
}

@media (min-width: 900px) {
  #navTopBar {
    gap: 10px;
    padding: max(14px, env(safe-area-inset-top)) 14px 8px;
  }

  #navTargetName {
    font-size: 15px;
    line-height: 1.2;
  }

  .nav-top-bar__title-wrap {
    display: block;
  }

  .nav-top-bar__title-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .nav-top-bar__meta {
    margin-left: 0;
    padding-left: 0;
    font-size: 12px;
  }

  .nav-category-filters {
    gap: 8px;
    padding-bottom: 10px;
  }

  .nav-category-filters__row {
    gap: 8px;
    padding-inline: 14px;
    scroll-padding-inline: 14px;
  }

  .nav-category-filters button.nav-category-chip {
    padding: 7px 14px;
    border-width: 3px;
    font-size: 13px;
  }

  .nav-treasure-sites-toggle {
    gap: 5px;
    font-size: 13px;
  }
}

#navMapStage {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--color-bg-deep);
}

.tour-builder {
  position: absolute;
  top: 12px;
  left: 12px;
  bottom: 12px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(88vw, 300px);
  padding: 14px;
  border: 1px solid var(--color-border-chrome);
  border-radius: 16px;
  background: rgba(12, 12, 16, 0.94);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  overflow: hidden;
  pointer-events: auto;
}

.tour-builder[hidden] {
  display: none;
}

.tour-builder__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.tour-builder__title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #ffd54a;
}

.tour-builder__close {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-secondary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.tour-builder__field {
  display: grid;
  gap: 4px;
}

.tour-builder__field--inline {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.tour-builder__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.tour-builder__input,
.tour-builder__textarea,
.tour-builder__select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(212, 140, 100, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-primary);
  font: inherit;
}

.tour-builder__input--number {
  width: 72px;
}

.tour-builder__hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--color-text-muted);
}

.tour-builder__stops {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  display: grid;
  gap: 8px;
  align-content: start;
}

.tour-builder__message {
  flex: 0 0 auto;
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--color-text-muted);
}

.tour-builder__message.is-error {
  color: #fca5a5;
}

.tour-builder__empty {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--color-text-muted);
}

.tour-builder__stop {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.tour-builder__stop-order {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 213, 74, 0.18);
  color: #ffd54a;
  font-size: 11px;
  font-weight: 800;
}

.tour-builder__stop-name {
  font-size: 13px;
  line-height: 1.3;
  color: var(--color-text-primary);
}

.tour-builder__stop-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tour-builder__stop-move,
.tour-builder__stop-remove {
  padding: 2px 6px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-secondary);
  font-size: 11px;
  cursor: pointer;
}

.tour-builder__actions {
  flex: 0 0 auto;
  margin-top: auto;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding-top: 4px;
  background: rgba(12, 12, 16, 0.98);
  pointer-events: auto;
}

.tour-builder__actions button {
  padding: 10px 8px;
  border: 1px solid rgba(212, 140, 100, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.tour-builder__actions button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.tour-builder__primary:not(:disabled) {
  background: rgba(255, 213, 74, 0.16);
  border-color: rgba(255, 213, 74, 0.45);
  color: #ffd54a;
}

body.tour-builder-open .tour-select-panel__edit-tours.fab-tour-builder-btn {
  border-color: rgba(255, 213, 74, 0.75);
  box-shadow: 0 0 0 2px rgba(255, 213, 74, 0.2);
}

.nav-poi-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 450;
  padding: 8px 12px;
  border: 1px solid rgba(212, 140, 100, 0.28);
  border-radius: 999px;
  background: var(--color-bg-scrim-heavy);
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  backdrop-filter: blur(8px);
}

.nav-poi-toggle.active {
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(251, 191, 36, 0.16);
  color: var(--color-active-text);
}

.nav-poi-toggle--art {
  top: 48px;
}

.nav-poi-toggle--art.active {
  border-color: rgba(192, 132, 252, 0.55);
  background: rgba(192, 132, 252, 0.16);
  color: #f0dcc8;
}

.leaflet-tooltip.map-pin-tooltip {
  background: linear-gradient(180deg, var(--color-bg-deep) 0%, var(--color-bg-deep) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--color-text-secondary);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  white-space: normal;
  max-width: min(240px, calc(100vw - 32px));
}

.leaflet-tooltip-top.map-pin-tooltip::before {
  border-top-color: var(--color-bg-deep);
}

body.map-block-zoom-labels .leaflet-tooltip.map-pin-tooltip {
  pointer-events: none;
  padding: 4px 8px;
  border-radius: 8px;
  max-width: min(148px, 42vw);
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

body.map-block-zoom-labels .map-pin-label {
  display: block;
  overflow: hidden;
}

body.map-block-zoom-labels .map-pin-label__title {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.map-block-zoom-labels .map-pin-label__address {
  display: none;
}

.map-pin-label {
  display: grid;
  gap: 0;
}

.map-pin-label__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
}

.map-pin-label__address {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--color-text-muted);
}

#navMapRotate {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
}

#navMap {
  position: absolute;
  inset: 0;
}

#navMap .leaflet-container {
  width: 100%;
  height: 100%;
  background: var(--color-bg-deep);
  touch-action: pan-x pan-y pinch-zoom;
}

#navMap .leaflet-pane,
#navMap .leaflet-tile-pane,
#navMap .leaflet-map-pane {
  touch-action: pan-x pan-y pinch-zoom;
}

#navUserDot {
  display: none;
}

body.map-travel #navUserDot {
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 999px;
  background: var(--color-gold);
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 6px rgba(255, 213, 74, 0.18), 0 0 18px rgba(255, 213, 74, 0.45);
  pointer-events: none;
}

#navIndicator {
  display: none;
}

body.map-travel #navIndicator,
body.how-it-works-tutorial-open.how-it-works-tutorial-travel-preview #navIndicator {
  display: flex;
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  z-index: 6;
  width: 132px;
  margin-left: -66px;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 10px 10px;
  border-radius: 18px;
  background: var(--color-bg-scrim-heavy);
  border: 1px solid rgba(255, 213, 74, 0.35);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

#navIndicatorArrow {
  width: 56px;
  height: 56px;
  transform-origin: 50% 50%;
  transition: transform 120ms linear;
}

#navIndicatorArrow::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin: 0 auto;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-bottom: 34px solid #ffd54a;
  filter: drop-shadow(0 0 10px rgba(255, 213, 74, 0.45));
}

#navIndicatorDistance {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}

#navIndicatorDirection {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-align: center;
}

#navBottomBar {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  background: transparent;
  border-top: 1px solid var(--color-border-chrome);
}

body.map-overview #navBottomBar:has(.nav-approach-zone:not(.nav-approach-zone--has-action)):has(#navBoundaryStatus[hidden]),
body.map-tour-overview #navBottomBar:has(.nav-approach-zone:not(.nav-approach-zone--has-action)):has(#navBoundaryStatus[hidden]) {
  display: none;
  border-top: none;
}

.nav-approach-zone {
  display: flex;
  flex-direction: column;
}

#navBoundaryStatus {
  margin: 0;
  padding: 10px 14px;
  border-radius: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  cursor: default;
}

#navBoundaryStatus.nav-approach-zone__status--action {
  padding-bottom: 8px;
}

#navBoundaryStatus[hidden] {
  display: none !important;
}

.nav-approach-zone--inside #navBoundaryStatus.inside {
  background: rgba(72, 48, 8, 0.96);
  color: #ffd54a;
  border-top: 1px solid rgba(255, 213, 74, 0.35);
  border-bottom: none;
}

.nav-approach-zone--inside.nav-approach-zone--has-action #navBoundaryStatus.inside {
  border-bottom: none;
}

#navBoundaryStatus.inside {
  background: rgba(72, 48, 8, 0.96);
  color: #ffd54a;
  border-top: 1px solid rgba(255, 213, 74, 0.35);
  border-bottom: none;
  cursor: pointer;
}

#navBoundaryStatus.outside {
  background: rgba(16, 16, 18, 0.98);
  color: var(--color-text-secondary);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: none;
}

#startCameraBtn,
.nav-approach-zone__action {
  width: 100%;
  margin: 0;
  padding: 12px 16px 14px;
  border: none;
  border-radius: 0;
  background: linear-gradient(180deg, var(--color-red-bright) 0%, var(--color-red-deep) 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.nav-approach-zone--inside #startCameraBtn,
.nav-approach-zone--inside .nav-approach-zone__action {
  border-top: 1px solid rgba(255, 213, 74, 0.35);
  background: rgba(0, 0, 0, 0.28);
  color: #ffe082;
}

.nav-approach-zone--inside.nav-approach-zone--has-action #startCameraBtn:not(:disabled):active,
.nav-approach-zone--inside.nav-approach-zone--has-action .nav-approach-zone__action:not(:disabled):active {
  background: rgba(0, 0, 0, 0.4);
}

#startCameraBtn[hidden] {
  display: none !important;
}

#startCameraBtn:disabled {
  background: rgba(140, 46, 40, 0.35);
}

.stop-sheet {
  position: fixed;
  inset: 0;
  z-index: 155;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 16px;
  padding-right: calc(16px + var(--fab-column-reserve));
  background: transparent;
  pointer-events: none;
}

.stop-sheet__row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: min(520px, calc(100vw - 32px - var(--fab-column-reserve)));
  margin-right: auto;
  pointer-events: none;
}

.stop-sheet__row > .stop-sheet__card,
.stop-sheet__row > .stop-sheet__tour-arrow {
  pointer-events: auto;
}

.stop-sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  right: var(--fab-column-reserve);
  background: rgba(0, 0, 0, 0.55);
  pointer-events: auto;
}

.stop-sheet[hidden] {
  display: none;
}

.stop-sheet__card {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  max-width: min(420px, calc(100vw - 32px - var(--fab-column-reserve) - 108px));
  margin-right: 0;
  margin-left: 0;
  border-radius: 18px 18px 14px 14px;
  padding: 18px 18px 16px;
  background: linear-gradient(180deg, var(--color-bg-deep) 0%, var(--color-bg-deep) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.stop-sheet__tour-arrow {
  position: static;
  z-index: 2;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #ffc107;
  color: #1a1410;
  box-shadow:
    0 0 0 1px rgba(26, 20, 16, 0.12),
    0 6px 18px rgba(0, 0, 0, 0.35);
  transform: none;
  touch-action: manipulation;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 140ms ease,
    opacity 140ms ease,
    box-shadow 140ms ease;
}

.stop-sheet__tour-arrow--prev,
.stop-sheet__tour-arrow--next {
  left: auto;
  right: auto;
}

.stop-sheet__tour-arrow[hidden] {
  display: none;
}

.stop-sheet__tour-arrow:disabled {
  opacity: 0.32;
  cursor: default;
  box-shadow: 0 0 0 1px rgba(26, 20, 16, 0.08);
}

@media (hover: hover) {
  .stop-sheet__tour-arrow:not(:disabled):hover {
    transform: scale(1.04);
    box-shadow:
      0 0 0 1px rgba(26, 20, 16, 0.16),
      0 8px 22px rgba(0, 0, 0, 0.4);
  }
}

.stop-sheet__tour-arrow:not(:disabled):active {
  transform: scale(0.97);
}

.stop-sheet__title-wrap {
  flex: 1;
  min-width: 0;
}

.stop-sheet__tour-progress {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffc107;
}

.stop-sheet__tour-progress[hidden] {
  display: none;
}

.stop-sheet__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.stop-sheet__header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.stop-sheet__title {
  margin: 0;
  font-size: 22px;
  color: #fff;
  flex: 1;
  min-width: 0;
}

.stop-sheet__edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
  touch-action: manipulation;
}

.stop-sheet__edit[hidden] {
  display: none !important;
}

.stop-sheet__edit:hover,
.stop-sheet__edit:focus-visible {
  background: rgba(255, 213, 74, 0.22);
  color: var(--color-active-text, #ffd54a);
  outline: none;
}

.stop-sheet__reposition[hidden] {
  display: none !important;
}

.stop-sheet__mic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-height: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #ffd54a;
  color: #1a1208;
  cursor: pointer;
  touch-action: manipulation;
  flex-shrink: 0;
}

.stop-sheet__mic:hover,
.stop-sheet__mic:focus-visible {
  background: #ffe082;
  box-shadow: 0 0 0 2px rgba(255, 213, 74, 0.35);
  outline: none;
}

.pin-reposition-bar {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 1200;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(12, 18, 28, 0.92);
  border: 1px solid rgba(255, 213, 74, 0.35);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}

.pin-reposition-bar[hidden] {
  display: none !important;
}

body.pin-reposition-active .stop-sheet {
  display: none !important;
}

.pin-reposition-bar__status {
  margin: 0;
  flex: 1;
  min-width: 180px;
  font-size: 0.95rem;
  color: #fff;
}

.pin-reposition-bar__actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.pin-reposition-bar__primary,
.pin-reposition-bar__secondary {
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.9rem;
  touch-action: manipulation;
  cursor: pointer;
}

.pin-reposition-bar__primary {
  background: var(--color-active-text, #ffd54a);
  color: #1a1200;
  font-weight: 600;
}

.pin-reposition-bar__secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav-stop-pin--repositioning {
  animation: pin-reposition-pulse 1.4s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(255, 213, 74, 0.75));
}

@keyframes pin-reposition-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

.stop-sheet__close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.stop-sheet__status {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-active-text);
}

.stop-sheet__status.completed {
  color: var(--color-text-muted);
}

.stop-sheet__status.current {
  color: #ffd54a;
}

.stop-sheet__status.available {
  color: var(--color-active-text);
}

.stop-sheet__status.treasure-site {
  color: #ffd54a;
}

.stop-sheet__status.upcoming {
  color: var(--pin-fill);
}

.stop-sheet__description {
  margin: 0 0 16px;
  max-height: min(28vh, 172px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
}

.stop-sheet__description:focus {
  outline: none;
}

.stop-sheet__description:focus-visible {
  box-shadow: inset 0 0 0 1px rgba(255, 213, 74, 0.35);
  border-radius: 8px;
}

.stop-sheet__description::-webkit-scrollbar {
  width: 6px;
}

.stop-sheet__description::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.24);
  border-radius: 999px;
}

.stop-sheet__location-meta {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 14px;
}

.stop-sheet__location-meta[hidden] {
  display: none;
}

.stop-sheet__thumb-wrap {
  flex: 0 0 100px;
  width: 100px;
  height: 100px;
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  touch-action: manipulation;
  position: relative;
}

.stop-sheet__thumb-wrap[hidden] {
  display: none;
}

.stop-sheet__thumb-wrap:hover,
.stop-sheet__thumb-wrap:focus-visible {
  border-color: rgba(255, 213, 74, 0.45);
  box-shadow: 0 0 0 2px rgba(255, 213, 74, 0.18);
  outline: none;
}

.stop-sheet__thumb-wrap::after {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M15 3h6v6h-2V6.41l-7.29 7.3-1.42-1.42 7.3-7.29H15V3zM5 5h8v2H7v10h10v-6h2v8H5V5z'/%3E%3C/svg%3E") center / 14px no-repeat;
  pointer-events: none;
}

.stop-sheet__thumb {
  display: block;
  width: 100px;
  height: 100px;
  object-fit: cover;
  pointer-events: none;
}

.stop-sheet__address {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding-top: 2px;
  font-size: 14px;
  line-height: 1.45;
  color: #fff;
}

.stop-sheet__address[hidden] {
  display: none;
}

.stop-sheet__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stop-sheet__action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 64px;
  padding: 10px 12px;
  width: 100%;
  background: linear-gradient(180deg, var(--color-red-bright) 0%, var(--color-red-deep) 100%);
  color: #fff;
  font-weight: 700;
}

.stop-sheet__action-btn--drive {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-secondary);
  border: 1px solid rgba(212, 140, 100, 0.2);
}

.stop-sheet__action-label {
  font-size: 15px;
  line-height: 1.1;
}

.stop-sheet__action-meta {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  opacity: 0.92;
}

.stop-sheet__action-btn--drive .stop-sheet__action-meta {
  color: var(--color-text-secondary);
}

.stop-sheet__action-btn.is-loading .stop-sheet__action-meta {
  opacity: 0.7;
  font-style: italic;
}

.stop-sheet__actions[hidden] {
  display: none;
}

#stopSheetCamera {
  width: 100%;
  margin-top: 10px;
  background: linear-gradient(180deg, var(--color-red-bright) 0%, var(--color-red-deep) 100%);
  color: #fff;
  font-weight: 700;
}

#stopSheetCamera[hidden] {
  display: none;
}

.stop-sheet__secondary {
  margin-top: 10px;
}

.stop-sheet__secondary[hidden] {
  display: none;
}

#stopSheetAddToTourBtn {
  width: 100%;
  margin-bottom: 8px;
  background: rgba(120, 190, 255, 0.12);
  color: #9fd0ff;
  border: 1px solid rgba(120, 190, 255, 0.32);
}

#stopSheetAddToTourBtn.is-on-tour {
  opacity: 0.72;
  cursor: default;
}

#stopSheetAddToTourBtn.is-remove-tour {
  background: rgba(255, 138, 128, 0.12);
  color: #ffb4a8;
  border-color: rgba(255, 138, 128, 0.35);
  opacity: 1;
  cursor: pointer;
}

button.stop-sheet__thumb-wrap {
  width: 100px;
  min-height: 0;
  font: inherit;
  color: inherit;
}

button.stop-sheet__action-btn {
  width: 100%;
}

button.stop-sheet__mic {
  min-height: 0;
  font: inherit;
}

.treasure-chest {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding:
    max(12px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
}

.treasure-chest[hidden] {
  display: none;
}

.treasure-chest__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  background: var(--color-bg-scrim-heavy);
  cursor: pointer;
}

.treasure-chest__sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  margin: 0;
  max-height: none;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--color-bg-deep) 0%, var(--color-bg) 42%, var(--color-bg) 100%);
  border: 1px solid rgba(255, 213, 74, 0.28);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 213, 74, 0.12);
}

.treasure-chest__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 12px;
  background: linear-gradient(180deg, rgba(255, 213, 74, 0.14), rgba(255, 213, 74, 0.03));
  border-bottom: 1px solid rgba(255, 213, 74, 0.16);
}

.treasure-chest__title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.treasure-chest__header-coin {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
}

.treasure-chest__title {
  margin: 0;
  font-size: 22px;
  color: #ffd54a;
}

.treasure-chest__count {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.treasure-chest__close {
  flex: 0 0 auto;
}

.treasure-chest__subtitle {
  margin: 0;
  padding: 0 18px 12px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  font-size: 15px;
}

.treasure-chest__subtitle[hidden] {
  display: none;
}

.treasure-chest__bottom {
  flex: 0 0 auto;
  border-top: 1px solid rgba(212, 140, 100, 0.12);
  background: var(--color-bg-overlay);
}

.treasure-chest__tabs {
  display: flex;
  gap: 8px;
  padding: 10px 14px 0;
}

.treasure-chest__tabs[hidden] {
  display: none;
}

.treasure-chest--solo .treasure-chest__footer {
  padding-top: 10px;
}

.treasure-chest__tab {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 12px 10px;
  border-radius: 14px 14px 0 0;
  border: 1px solid rgba(212, 140, 100, 0.2);
  border-bottom: none;
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
}

.treasure-chest__tab.is-active {
  background: rgba(255, 213, 74, 0.16);
  border-color: rgba(255, 213, 74, 0.45);
  color: #ffd54a;
  box-shadow: inset 0 2px 0 #ffd54a;
}

.treasure-chest__panels {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.treasure-chest__panel {
  flex: 1;
  min-height: 0;
  display: none;
  flex-direction: column;
}

.treasure-chest__panel.is-active {
  display: flex;
}

.treasure-chest__panel[hidden] {
  display: none;
}

.treasure-chest__list-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px 18px;
}

.treasure-chest__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.treasure-chest__section {
  margin: 4px 0 0;
  padding: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.treasure-chest__section:first-child {
  margin-top: 0;
}

.treasure-chest__member-stats {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(212, 140, 100, 0.14);
}

.treasure-chest__member-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.treasure-chest__member-row--self .treasure-chest__member-name {
  color: #ffd54a;
}

.treasure-chest__member-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.treasure-chest__member-meta {
  font-size: 12px;
  color: var(--color-text-secondary);
  text-align: right;
  white-space: nowrap;
}

.treasure-chest__coin {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
}

.treasure-chest__coin-face {
  position: relative;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
}

.treasure-chest__coin-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.treasure-chest__coin-rim {
  fill: #9a6f00;
}

.treasure-chest__coin-body {
  fill: #ffd54a;
  stroke: #c99200;
  stroke-width: 0.7;
}

.treasure-chest__coin-inner {
  fill: none;
  stroke: rgba(122, 86, 0, 0.28);
  stroke-width: 0.65;
}

.treasure-chest__coin-value {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: #3d2a00;
  text-shadow: 0 1px 0 rgba(255, 248, 210, 0.65);
}

.treasure-chest__coin--lg {
  width: 42px;
  height: 42px;
}

.treasure-chest__coin--lg .treasure-chest__coin-face {
  width: 42px;
  height: 42px;
}

.treasure-chest__coin--lg .treasure-chest__coin-value {
  font-size: 15px;
}

.treasure-chest__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(212, 140, 100, 0.12);
}

.treasure-chest__photo {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 1px solid rgba(212, 140, 100, 0.18);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  touch-action: manipulation;
}

.treasure-chest__photo[hidden] {
  display: none;
}

.treasure-chest__photo-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.treasure-chest__photo-img[hidden] {
  display: none;
}

.treasure-chest__item--highlight {
  background: rgba(255, 213, 74, 0.1);
  border-color: rgba(255, 213, 74, 0.35);
  box-shadow: 0 0 24px rgba(255, 196, 72, 0.12);
}

.treasure-chest__gem {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--gem-fill, #ffd54a) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--gem-stroke, #fff7d6) 36%, transparent);
  color: var(--gem-fill, #ffd54a);
}

.treasure-chest__gem-icon {
  display: block;
}

.treasure-chest__item-category {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.treasure-chest__item-body {
  min-width: 0;
}

.treasure-chest__item-name {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.treasure-chest__item-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 213, 74, 0.16);
  color: #ffd54a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.treasure-chest__footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px max(14px, env(safe-area-inset-bottom));
}

#treasureChestNextBtn {
  width: 100%;
  background: rgba(255, 213, 74, 0.18);
  color: #ffd54a;
  border: 1px solid rgba(255, 213, 74, 0.45);
}

#treasureChestNextBtn[hidden] {
  display: none;
}

.treasure-chest__footer:has(#treasureChestNextBtn[hidden]) {
  display: none;
}

.nav-stop-pin-wrap,
.nav-map-pin-wrap {
  background: transparent;
  border: none;
}

.nav-map-pin,
.nav-stop-pin {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  pointer-events: auto;
  touch-action: manipulation;
}

.nav-map-pin span,
.nav-stop-pin__dot {
  width: var(--pin-dot, var(--pin-size, 18px));
  height: var(--pin-dot, var(--pin-size, 18px));
  border-radius: 999px;
  background: var(--pin-fill, var(--pin-fill));
  border: 1px solid var(--pin-stroke, var(--pin-stroke));
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.nav-map-pin--treasure-site svg,
.nav-stop-pin--treasure-site .nav-stop-pin__dot {
  box-shadow: 0 0 16px rgba(255, 193, 7, 0.75);
}

.treasure-chest-icon__body,
.treasure-chest-icon__lid {
  stroke: #92400e;
  stroke-width: 0.55;
  stroke-linejoin: round;
}

.treasure-chest-icon__foot,
.treasure-chest-icon__band {
  stroke: #78350f;
  stroke-width: 0.35;
}

.treasure-chest-icon__foot {
  fill: #eab308;
}

.treasure-chest-icon__lock {
  fill: #451a03;
  stroke: #fde68a;
  stroke-width: 0.35;
}

.treasure-chest-icon__highlight {
  fill: rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

.nav-map-pin__chest,
.nav-stop-pin__chest,
.nav-destination-pin__chest {
  display: block;
  width: calc(var(--pin-dot, var(--pin-size, 16px)) * 1.85);
  height: calc(var(--pin-dot, var(--pin-size, 16px)) * 1.85);
  overflow: visible;
  pointer-events: none;
  opacity: 1;
  filter:
    drop-shadow(0 0 3px rgba(255, 236, 140, 0.95))
    drop-shadow(0 0 10px rgba(255, 193, 7, 0.85))
    drop-shadow(0 0 16px rgba(245, 158, 11, 0.65))
    drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.nav-map-pin--treasure-site .nav-map-pin__chest,
.nav-stop-pin--treasure-site .nav-stop-pin__chest,
.nav-destination-pin--treasure-site .nav-destination-pin__chest {
  box-shadow: none;
}

.nav-stop-pin--numbered {
  position: relative;
}

/* Curated tour: VPS stops use the numbered dot (not chest) so the stop order stays readable. */
.nav-stop-pin--tour-treasure .nav-stop-pin__dot {
  box-shadow:
    0 0 0 2px rgba(255, 193, 7, 0.85),
    0 0 12px rgba(255, 193, 7, 0.55);
}

.nav-stop-pin__order {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  color: #1a1410;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  pointer-events: none;
  z-index: 1;
}

.nav-stop-pin--current .nav-stop-pin__dot {
  box-shadow: 0 0 16px rgba(255, 213, 74, 0.55);
}

.nav-stop-pin--upcoming .nav-stop-pin__dot {
  opacity: 0.82;
}

.nav-map-pin--collected span,
.nav-stop-pin--completed .nav-stop-pin__dot {
  opacity: 0.72;
  filter: grayscale(0.9);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
}

.nav-map-pin--collected.nav-map-pin--treasure-site svg,
.nav-stop-pin--completed.nav-stop-pin--treasure-site .nav-stop-pin__dot {
  box-shadow: none;
  filter: grayscale(0.9);
  opacity: 0.72;
}

/* Treasure chest pins stay gold unless off the active curated tour. */
.nav-map-pin--treasure-site.nav-map-pin--off-tour .nav-map-pin__chest,
.nav-stop-pin--treasure-site.nav-stop-pin--off-tour .nav-stop-pin__chest,
.nav-destination-pin--treasure-site.nav-destination-pin--off-tour .nav-destination-pin__chest,
body.map-tour-overview #navPanel .nav-map-pin--treasure-site.nav-map-pin--off-tour .nav-map-pin__chest {
  opacity: 0.55 !important;
  filter: grayscale(1) !important;
  box-shadow: none !important;
}

.nav-map-pin--treasure-site:not(.nav-map-pin--off-tour) .nav-map-pin__chest,
.nav-stop-pin--treasure-site:not(.nav-stop-pin--off-tour) .nav-stop-pin__chest,
.nav-destination-pin--treasure-site:not(.nav-destination-pin--off-tour) .nav-destination-pin__chest,
body.map-tour-overview #navPanel .nav-map-pin--treasure-site:not(.nav-map-pin--off-tour) .nav-map-pin__chest,
body.map-route-preview #navPanel .nav-map-pin--treasure-site:not(.nav-map-pin--off-tour) .nav-map-pin__chest,
body.map-travel #navPanel .nav-map-pin--treasure-site:not(.nav-map-pin--off-tour) .nav-map-pin__chest,
body.map-route-preview #navPanel .nav-stop-pin--treasure-site:not(.nav-stop-pin--off-tour) .nav-stop-pin__chest,
body.map-travel #navPanel .nav-stop-pin--treasure-site:not(.nav-stop-pin--off-tour) .nav-stop-pin__chest,
.nav-map-pin--collected.nav-map-pin--treasure-site:not(.nav-map-pin--off-tour) .nav-map-pin__chest,
.nav-stop-pin--completed.nav-stop-pin--treasure-site:not(.nav-stop-pin--off-tour) .nav-stop-pin__chest {
  opacity: 1 !important;
  filter:
    drop-shadow(0 0 3px rgba(255, 236, 140, 0.95))
    drop-shadow(0 0 10px rgba(255, 193, 7, 0.85))
    drop-shadow(0 0 16px rgba(245, 158, 11, 0.65))
    drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)) !important;
  box-shadow: none !important;
}

#navPanel .leaflet-marker-icon.nav-map-pin-wrap,
#navPanel .leaflet-marker-icon.nav-stop-pin-wrap,
#navPanel .leaflet-marker-icon.nav-destination-pin-wrap {
  background: transparent;
  border: none;
  pointer-events: auto !important;
}

#navPanel .leaflet-marker-icon.nav-destination-pin-wrap {
  display: grid;
  place-items: center;
  overflow: visible;
  box-sizing: border-box;
}

.nav-destination-pin {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  pointer-events: auto;
  touch-action: manipulation;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nav-destination-pin__dot {
  width: var(--pin-dot, 20px);
  height: var(--pin-dot, 20px);
  aspect-ratio: 1;
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--pin-fill, #ffd54a);
  border: 1px solid var(--pin-stroke, #0b1220);
  box-shadow:
    0 0 0 2px rgba(11, 18, 32, 0.9),
    0 0 12px rgba(251, 191, 36, 0.6);
  pointer-events: none;
}

.nav-destination-pin--inside .nav-destination-pin__dot {
  border-color: #fff;
  box-shadow:
    0 0 0 3px rgba(11, 18, 32, 0.95),
    0 0 0 6px rgba(74, 222, 128, 0.5),
    0 0 14px rgba(74, 222, 128, 0.75);
}

/* Nearby discovery while filters are off during a curated tour */
body.map-tour-overview #navPanel .nav-map-pin-wrap .nav-map-pin--proximity-discovered,
body.map-travel #navPanel .nav-map-pin-wrap .nav-map-pin--proximity-discovered {
  opacity: 1;
  filter: none;
}

body.map-tour-overview #navPanel .nav-map-pin-wrap .nav-map-pin--proximity-discovered span,
body.map-travel #navPanel .nav-map-pin-wrap .nav-map-pin--proximity-discovered span {
  background: var(--pin-fill) !important;
  border-color: var(--pin-stroke) !important;
  box-shadow:
    0 0 0 4px rgba(255, 213, 74, 0.28),
    0 0 14px rgba(255, 213, 74, 0.45);
  animation: proximity-pin-pulse 1.8s ease-in-out infinite;
}

body.map-tour-overview #navPanel .nav-map-pin-wrap .nav-map-pin--proximity-discovered.nav-map-pin--treasure-site,
body.map-travel #navPanel .nav-map-pin-wrap .nav-map-pin--proximity-discovered.nav-map-pin--treasure-site {
  opacity: 1;
  filter: none;
}

@keyframes proximity-pin-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

/* Curated tour: explore pins subdued — dark fill, mid-grey border */
body.map-tour-overview #navPanel .nav-map-pin-wrap .nav-map-pin span,
body.map-route-preview #navPanel .nav-map-pin-wrap .nav-map-pin span,
body.map-travel #navPanel .nav-map-pin-wrap .nav-map-pin span,
body.map-route-preview #navPanel .nav-stop-pin-wrap .nav-stop-pin__dot,
body.map-travel #navPanel .nav-stop-pin-wrap .nav-stop-pin__dot {
  background: #3a3a3a !important;
  border-color: #8a8a8a !important;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
  opacity: 1;
  filter: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

@media (hover: hover) {
  body.map-tour-overview #navPanel .nav-map-pin-wrap:hover .nav-map-pin span,
  body.map-route-preview #navPanel .nav-map-pin-wrap:hover .nav-map-pin span,
  body.map-travel #navPanel .nav-map-pin-wrap:hover .nav-map-pin span,
  body.map-route-preview #navPanel .nav-stop-pin-wrap:hover .nav-stop-pin__dot,
  body.map-travel #navPanel .nav-stop-pin-wrap:hover .nav-stop-pin__dot {
    background: #4a4a4a !important;
    border-color: #a0a0a0 !important;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.45);
  }
}

body.map-tour-overview #navPanel .nav-map-pin-wrap:active .nav-map-pin span,
body.map-route-preview #navPanel .nav-map-pin-wrap:active .nav-map-pin span,
body.map-travel #navPanel .nav-map-pin-wrap:active .nav-map-pin span,
body.map-route-preview #navPanel .nav-stop-pin-wrap:active .nav-stop-pin__dot,
body.map-travel #navPanel .nav-stop-pin-wrap:active .nav-stop-pin__dot {
  background: #525252 !important;
  border-color: #b0b0b0 !important;
}

.nav-tour-member-wrap {
  background: transparent;
  border: none;
}

.nav-tour-member {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}

.nav-tour-member__dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--tour-color, #f472b6);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 0 12px color-mix(in srgb, var(--tour-color, #f472b6) 70%, transparent);
}

.nav-tour-member__label {
  max-width: 72px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--color-bg-scrim-heavy);
  border: 1px solid color-mix(in srgb, var(--tour-color, #f472b6) 55%, transparent);
  color: var(--color-text);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#navPanel .leaflet-marker-icon.nav-tour-member-wrap {
  background: transparent;
  border: none;
  pointer-events: none !important;
}

.nav-user-marker-wrap {
  background: transparent;
  border: none;
}

.nav-user-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}

.nav-user-marker__dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--color-gold);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 0 12px rgba(255, 213, 74, 0.65);
}

.nav-user-marker__label {
  max-width: 72px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--color-bg-scrim-heavy);
  border: 1px solid rgba(255, 213, 74, 0.45);
  color: #faf0e6;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#navPanel .leaflet-marker-icon.nav-user-marker-wrap {
  background: transparent;
  border: none;
  pointer-events: none !important;
}

body.navigating #hud {
  top: 12px;
  bottom: auto;
  left: 12px;
  right: 12px;
}

body.navigating #hud #controls {
  display: none;
}

#navPanel .leaflet-marker-icon.nav-route-arrow-wrap,
#navPanel .leaflet-marker-icon.nav-route-end-label-wrap {
  background: transparent;
  border: none;
  overflow: visible;
  pointer-events: auto !important;
}

.nav-route-end-label {
  position: relative;
  width: max-content;
  max-width: 148px;
  padding: 14px 8px 6px;
  border-radius: 8px;
  background: var(--color-bg-overlay-strong);
  border: 1px solid rgba(251, 191, 36, 0.42);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.38);
  text-align: center;
  pointer-events: auto;
  cursor: pointer;
}

.nav-route-end-label__close {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text-secondary);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.nav-route-end-label__close:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.nav-route-end-label__time {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  color: #ffd54a;
}

.nav-route-end-label__meta {
  margin: 3px 0 0;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-text-secondary);
}

.nav-route-end-label__name {
  margin: 2px 0 0;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-route-arrow {
  display: block;
  transform-origin: 8px 8px;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.45));
}

#navPanel .leaflet-control-attribution {
  display: none !important;
}

#navPanel .leaflet-bottom.leaflet-left .leaflet-control {
  margin-bottom: max(10px, env(safe-area-inset-bottom));
  margin-left: 10px;
}

body.spirit-voice-dock-visible #navPanel .leaflet-bottom.leaflet-left .leaflet-control {
  margin-bottom: calc(var(--app-bottom-chrome-height) + 8px);
}

.map-attribution-info {
  position: relative;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.map-attribution-info__toggle {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 2px solid rgba(255, 213, 74, 0.55);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 213, 74, 0.28), rgba(180, 130, 20, 0.18));
  color: #fff7d6;
  font-size: 1rem;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 6px 18px rgba(255, 213, 74, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.map-attribution-info__toggle.is-open {
  border-color: rgba(255, 213, 74, 0.85);
  box-shadow: 0 0 0 2px rgba(255, 213, 74, 0.18);
}

.map-attribution-info__toggle:active {
  transform: scale(0.96);
}

.map-attribution-info__panel {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 2;
  min-width: min(280px, calc(100vw - 48px));
  max-width: min(340px, calc(100vw - 32px));
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 213, 74, 0.35);
  background: var(--color-bg-overlay-strong);
  color: var(--color-text-secondary);
  font-size: 11px;
  line-height: 1.5;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}

.map-attribution-info__actions {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.map-attribution-info__tutorial-btn {
  width: 100%;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 213, 74, 0.45);
  background: rgba(255, 213, 74, 0.12);
  color: #ffd54a;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.map-attribution-info__tutorial-btn:active {
  transform: scale(0.98);
}

.map-attribution-info__credits {
  color: var(--color-text-secondary);
  font-size: 11px;
  line-height: 1.5;
}

.map-attribution-info__panel[hidden] {
  display: none !important;
}

.map-attribution-info__panel a {
  color: #ffd54a;
  font-weight: 600;
  text-decoration: none;
}

.map-attribution-info__panel a:hover,
.map-attribution-info__panel a:focus-visible {
  text-decoration: underline;
}

#navPanel .leaflet-top.leaflet-left .leaflet-control {
  margin-top: 10px;
  margin-left: 10px;
}

#navPanel .leaflet-top.leaflet-right .leaflet-control {
  margin-top: 10px;
  margin-right: 10px;
}

#navPanel .leaflet-bottom.leaflet-right .leaflet-control {
  margin-bottom: max(10px, env(safe-area-inset-bottom));
  margin-right: 10px;
}

body.spirit-voice-dock-visible #navPanel .leaflet-bottom.leaflet-right .leaflet-control {
  margin-bottom: calc(var(--app-bottom-chrome-height) + 8px);
}

.nav-map-style-control {
  background: transparent;
  border: none;
  box-shadow: none;
}

.nav-map-style-control__group {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--color-bg-overlay-strong);
  border: 1px solid var(--color-border-chrome);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
}

.nav-map-style-control__group button {
  min-width: 72px;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.nav-map-style-control__group button.active {
  background: rgba(255, 213, 74, 0.18);
  color: #ffd54a;
}

body.map-style-satellite .nav-stop-pin__dot,
body.map-style-satellite .nav-map-pin span {
  box-shadow: 0 0 0 2px rgba(10, 10, 14, 0.55), 0 2px 8px rgba(0, 0, 0, 0.45);
}

#huntPromptActions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

#huntPromptActions[hidden],
#huntPromptBtn[hidden] {
  display: none;
}

#huntDriveBtn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-secondary);
}

#huntPrompt {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--color-bg-scrim-heavy);
}

#huntPrompt[hidden] {
  display: none;
}

#huntPromptCard {
  width: min(100%, 420px);
  border-radius: 16px;
  padding: 20px;
  background: linear-gradient(180deg, var(--color-bg-deep) 0%, var(--color-bg-deep) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

#huntPromptTitle {
  margin: 0 0 8px;
  font-size: 24px;
  color: #ffd54a;
}

#huntPromptMessage {
  margin: 0 0 16px;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

#huntPromptBtn {
  width: 100%;
}

#hud.compact.locked {
  background: rgba(72, 32, 8, 0.82);
  border: 1px solid rgba(255, 213, 74, 0.35);
}

#hud.compact.found {
  background: rgba(72, 48, 8, 0.92);
  border: 1px solid rgba(255, 196, 72, 0.65);
}

#hud.compact.found #status {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #ffd54a;
  text-shadow: 0 0 18px rgba(255, 196, 72, 0.45);
}

#hud.searching {
  display: none;
}

#hud.compact.lost {
  background: rgba(120, 32, 32, 0.88);
  border: 1px solid rgba(255, 130, 130, 0.45);
}

#controls {
  margin-top: 10px;
}

#arExitBtn {
  display: none;
}

#arExitBtn.overlay-close--viewport {
  left: auto;
  bottom: auto;
  transform: none;
}

.ar-snapshot-btn {
  position: fixed;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 3px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  touch-action: manipulation;
}

.ar-snapshot-btn[hidden] {
  display: none;
}

.ar-snapshot-btn__ring {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.08);
}

.ar-snapshot-btn:active .ar-snapshot-btn__ring {
  transform: scale(0.92);
}

.ar-snapshot-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

body.ar-active .ar-snapshot-btn:not([hidden]),
body.photo-camera-active .ar-snapshot-btn:not([hidden]) {
  display: inline-flex;
}

body.ar-active:has(#treasureChest:not([hidden])) .ar-snapshot-btn {
  display: none !important;
}

@keyframes ar-snapshot-flash {
  from {
    opacity: 0.85;
  }

  to {
    opacity: 0;
  }
}

body.ar-snapshot-flash::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #fff;
  pointer-events: none;
  animation: ar-snapshot-flash 0.35s ease-out forwards;
}

body.ar-active #tapLayer {
  bottom: 72px;
}

body.ar-active #arExitBtn:not([hidden]),
body.photo-camera-active #arExitBtn:not([hidden]) {
  display: inline-flex;
}

body.photo-camera-active #arExitBtn:not([hidden]) {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  left: auto;
  bottom: auto;
  width: 44px;
  transform: none;
}

body.photo-camera-active.spirit-voice-dock-visible .ar-snapshot-btn:not([hidden]) {
  bottom: calc(var(--app-bottom-chrome-height, 0px) + 12px);
}

body.ar-active:has(#treasureChest:not([hidden])) #arExitBtn {
  display: none !important;
}

body.ar-active:has(#panelModal:not([hidden])) #arExitBtn,
body.ar-active:has(#panelModal:not([hidden])) #arSnapshotBtn {
  display: none !important;
}

button {
  border: none;
  border-radius: 8px;
  padding: 11px 16px;
  font-size: 15px;
  cursor: pointer;
  background: var(--color-red-bright);
  color: #fff;
  font-weight: 600;
  width: 100%;
}

button:disabled {
  opacity: 0.55;
  cursor: default;
}

button.ar-snapshot-btn {
  width: 56px;
}

button.fab-btn,
button.photo-viewer__close {
  width: auto;
}

button.spirit-agent-modal__mic {
  width: 84px;
  padding: 0;
  background: linear-gradient(180deg, rgba(255, 213, 74, 0.24), rgba(255, 213, 74, 0.1));
  color: #ffd54a;
}

button.map-attribution-info__toggle {
  width: 32px;
  padding: 0;
  background: linear-gradient(180deg, rgba(255, 213, 74, 0.28), rgba(180, 130, 20, 0.18));
  color: #fff7d6;
}

button.overlay-close,
#arExitBtn.overlay-close {
  width: 44px;
  max-width: none;
  padding: 0;
  border: 2px solid rgba(255, 213, 74, 0.55);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 213, 74, 0.28), rgba(180, 130, 20, 0.18));
  color: #fff7d6;
  font-size: 1.65rem;
  font-weight: 500;
  line-height: 1;
  box-shadow: 0 8px 24px rgba(255, 213, 74, 0.22);
}

body.photo-camera-active #arExitBtn.overlay-close:not([hidden]),
body.ar-active #arExitBtn.overlay-close:not([hidden]) {
  display: inline-flex;
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  left: auto;
  bottom: auto;
  transform: none;
  z-index: 120;
}

button.fab-btn {
  width: 44px;
}

button.photo-viewer__save,
button.photo-viewer__delete {
  width: auto;
}

button.photo-album-modal__close,
button.photo-album-modal__item,
button.photo-album-modal__camera {
  width: 100%;
}

#tapLayer {
  position: fixed;
  inset: 0;
  z-index: 15;
  touch-action: manipulation;
  cursor: pointer;
}

#tapLayer.disabled {
  pointer-events: none;
  cursor: default;
}

body.modal-open #hud,
body.modal-open #tapLayer {
  display: none;
}

.panel-modal {
  position: fixed;
  inset: 0;
  z-index: 150;
}

.panel-modal[hidden] {
  display: none;
}

.panel-modal__backdrop {
  position: absolute;
  inset: 0;
  background: var(--color-bg-overlay);
  border: none;
  padding: 0;
  cursor: pointer;
}

.panel-modal__sheet {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  overflow-y: auto;
  background: linear-gradient(180deg, var(--color-bg-deep) 0%, var(--color-bg-deep) 100%);
}

.panel-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-modal__title {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.panel-modal__subtitle {
  margin: 6px 0 0;
  color: var(--color-text-muted);
  font-size: 15px;
}

.panel-modal__close {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  padding: 0;
}

.panel-modal__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-placeholder-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.modal-placeholder-card,
.modal-placeholder-video,
.modal-placeholder-copy {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-placeholder-card {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 14px;
  text-align: center;
  padding: 12px;
}

.modal-placeholder-video {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  font-size: 16px;
}

.modal-placeholder-copy {
  padding: 16px;
  color: var(--color-text-secondary);
  line-height: 1.55;
  font-size: 15px;
}

.modal-placeholder-copy h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: #fff;
}

.modal-placeholder-copy p {
  margin: 0 0 12px;
}

.modal-placeholder-copy p:last-child {
  margin-bottom: 0;
}

/* Welcome screen + shared app modals */
.welcome-screen {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: max(28px, env(safe-area-inset-top)) 24px max(20px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  background: linear-gradient(180deg, var(--color-bg-deep) 0%, var(--color-bg-mid) 48%, var(--color-bg-deep) 100%);
  color: #fff;
  text-align: center;
}

.welcome-screen[hidden] {
  display: none !important;
}

.welcome-screen__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  max-width: 420px;
  margin: 0 auto;
}

.welcome-screen__hero {
  width: min(100%, 420px);
}

.welcome-screen__hero svg {
  display: block;
  width: 100%;
  height: auto;
}

.welcome-screen__logo {
  width: min(320px, 88vw);
  height: auto;
}

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

.welcome-screen__title:not(.welcome-screen__title--a11y) {
  margin: 0;
  font-size: clamp(1.55rem, 5vw, 2rem);
  line-height: 1.15;
  font-weight: 700;
  color: var(--color-gold, #ffd54a);
}

.welcome-screen__lead {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.86);
}

.welcome-screen__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(100%, 320px);
  margin-top: 8px;
}

.welcome-screen__primary,
.welcome-screen__secondary,
.app-modal__primary,
.app-modal__secondary {
  width: 100%;
  border-radius: 999px;
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.welcome-screen__primary,
.app-modal__primary {
  border: none;
  background: linear-gradient(180deg, #ffe082 0%, #ffd54a 100%);
  color: #1a1200;
}

.welcome-screen__secondary,
.app-modal__secondary {
  border: 1px solid rgba(255, 213, 74, 0.45);
  background: transparent;
  color: #fff;
}

.welcome-screen__footer {
  display: flex;
  justify-content: center;
  padding-top: 12px;
}

.welcome-screen__partner {
  width: min(220px, 60vw);
  height: auto;
  opacity: 0.92;
}

.app-modal {
  position: fixed;
  inset: 0;
  z-index: 10060;
}

.app-modal[hidden] {
  display: none !important;
}

.app-modal__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  background: var(--color-bg-scrim, rgba(0, 0, 0, 0.62));
  cursor: pointer;
}

.app-modal__sheet {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  width: 90vw;
  height: 90vh;
  max-width: 520px;
  max-height: 720px;
  box-sizing: border-box;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  border-radius: 18px;
  background: linear-gradient(180deg, var(--color-bg-raised) 0%, var(--color-bg-deep) 100%);
  border: 1px solid rgba(255, 213, 74, 0.28);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.app-modal__close {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: 12px;
  z-index: 2;
}

.app-modal__title {
  margin: 0 36px 8px 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-gold, #ffd54a);
  text-align: left;
}

.app-modal__lead {
  margin: 0 0 14px;
  font-size: 0.92rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.84);
  text-align: left;
}

.app-modal__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.app-modal__body--scroll {
  padding-right: 4px;
}

.app-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.app-modal__actions--split {
  flex-direction: row;
}

.app-modal__actions--profile-modes {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-modal__label {
  display: block;
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 213, 74, 0.88);
}

.app-modal__input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 213, 74, 0.28);
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-modal__input::placeholder {
  color: rgba(255, 255, 255, 0.42);
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
}

.app-modal__error {
  margin: 10px 0 0;
  font-size: 0.88rem;
  line-height: 1.4;
  color: #ff8a80;
}

.app-modal__sheet--compact {
  height: auto;
  max-height: min(92vh, 640px);
}

#onboardingProfileModal .app-modal__body {
  flex: 0 1 auto;
  min-height: 0;
  overflow: visible;
}

.app-modal__primary.is-disabled,
.app-modal__secondary.is-disabled,
.app-modal__primary:disabled,
.app-modal__secondary:disabled,
.app-modal__primary[aria-disabled="true"],
.app-modal__secondary[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}

.app-modal__error[hidden] {
  display: none !important;
}

body.onboarding-join-team-open {
  overflow: hidden;
}

.app-modal__actions--split .app-modal__primary,
.app-modal__actions--split .app-modal__secondary {
  flex: 1;
}

.how-it-works-tutorial {
  position: fixed;
  inset: 0;
  z-index: 10180;
  pointer-events: none;
}

.how-it-works-tutorial[hidden] {
  display: none !important;
}

.how-it-works-tutorial__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 6, 10, 0.32);
  pointer-events: auto;
}

.how-it-works-tutorial__backdrop[hidden] {
  display: none !important;
}

.how-it-works-tutorial__spotlight {
  position: fixed;
  border-radius: 14px;
  background: transparent;
  box-shadow:
    0 0 0 9999px rgba(8, 6, 10, 0.34),
    0 0 24px rgba(255, 213, 74, 0.12);
  border: 2px solid rgba(255, 213, 74, 0.9);
  pointer-events: none;
  transition:
    left 0.24s ease,
    top 0.24s ease,
    width 0.24s ease,
    height 0.24s ease;
  z-index: 1;
}

.how-it-works-tutorial__spotlight[hidden] {
  display: none !important;
}

.how-it-works-tutorial__compass-preview {
  position: fixed;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 132px;
  padding: 12px 10px 10px;
  border-radius: 18px;
  background: var(--color-bg-scrim-heavy);
  border: 1px solid rgba(255, 213, 74, 0.35);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.how-it-works-tutorial__compass-preview[hidden] {
  display: none !important;
}

.how-it-works-tutorial__compass-arrow {
  width: 56px;
  height: 56px;
  transform: rotate(42deg);
  transform-origin: 50% 50%;
}

.how-it-works-tutorial__compass-arrow::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin: 0 auto;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-bottom: 34px solid #ffd54a;
  filter: drop-shadow(0 0 10px rgba(255, 213, 74, 0.45));
}

.how-it-works-tutorial__compass-distance {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}

.how-it-works-tutorial__compass-direction {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-align: center;
}

.how-it-works-tutorial__card {
  position: fixed;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: min(360px, calc(100vw - 24px));
  padding: 16px 16px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 213, 74, 0.42);
  background: linear-gradient(180deg, rgba(48, 36, 28, 0.97) 0%, rgba(28, 20, 16, 0.97) 100%);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}

.how-it-works-tutorial__card--center {
  top: 50%;
  left: 50%;
  width: min(380px, calc(100vw - 24px));
  transform: translate(-50%, -50%) !important;
}

.how-it-works-tutorial__card--anchored {
  max-height: min(42vh, 300px);
  overflow: auto;
}

.how-it-works-tutorial__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.how-it-works-tutorial__progress {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 213, 74, 0.78);
}

.how-it-works-tutorial__skip {
  margin-left: auto;
  padding: 6px 10px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.how-it-works-tutorial__title {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.2;
  color: var(--color-gold, #ffd54a);
}

.how-it-works-tutorial__body {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.88);
}

.how-it-works-tutorial__actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.how-it-works-tutorial__prev,
.how-it-works-tutorial__next {
  flex: 1 1 0;
  min-height: 44px;
}

.how-it-works-tutorial--preparing .how-it-works-tutorial__next {
  opacity: 0.72;
}

.splash-panel.is-onboarding-profile,
.splash-panel.is-onboarding-team,
.splash-panel.is-profile-settings {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
  max-width: none;
  padding-bottom: 0;
}

.splash-panel.is-profile-settings .splash-panel__logo,
.splash-panel.is-profile-settings .splash-panel__code,
.splash-panel.is-profile-settings #tourModeField,
.splash-panel.is-profile-settings #teamSetupFields,
.splash-panel.is-profile-settings #playerPhoneInput,
.splash-panel.is-profile-settings label[for="playerPhoneInput"],
.splash-panel.is-profile-settings #teamJoinBlock,
.splash-panel.is-profile-settings #teamMembersPreview,
.splash-panel.is-profile-settings #teamSyncNote,
.splash-panel.is-profile-settings #splashPermissionsDetails,
.splash-panel.is-profile-settings #splashActions {
  display: none !important;
}

.splash-panel.is-onboarding-profile .splash-panel__logo,
.splash-panel.is-onboarding-profile .splash-panel__code,
.splash-panel.is-onboarding-profile #tourModeField,
.splash-panel.is-onboarding-profile #teamSetupFields,
.splash-panel.is-onboarding-profile #playerPhoneInput,
.splash-panel.is-onboarding-profile label[for="playerPhoneInput"],
.splash-panel.is-onboarding-profile #teamJoinBlock,
.splash-panel.is-onboarding-profile #teamMembersPreview,
.splash-panel.is-onboarding-profile #teamSyncNote,
.splash-panel.is-onboarding-profile #splashPermissionsDetails,
.splash-panel.is-onboarding-profile #splashActions,
.splash-panel.is-onboarding-team .splash-panel__logo,
.splash-panel.is-onboarding-team label[for="playerNameInput"],
.splash-panel.is-onboarding-team #playerNameInput,
.splash-panel.is-onboarding-team #playerOriginField,
.splash-panel.is-onboarding-team #tourModeField,
.splash-panel.is-onboarding-team #playerPhoneInput,
.splash-panel.is-onboarding-team label[for="playerPhoneInput"],
.splash-panel.is-onboarding-team #teamJoinBlock,
.splash-panel.is-onboarding-team #splashPermissionsDetails,
.splash-panel.is-onboarding-team #splashActions {
  display: none !important;
}

body.onboarding-profile-open .splash-panel__origin-list.is-portaled,
body.onboarding-team-open .splash-panel__origin-list.is-portaled,
body.profile-settings-open .splash-panel__origin-list.is-portaled {
  z-index: 10180;
}

body.onboarding-profile-open .splash-panel__origin-field.is-open,
body.profile-settings-open .splash-panel__origin-field.is-open {
  z-index: 10170;
}

.tour-carousel__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 10px;
}

.tour-carousel__track {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
  cursor: grab;
  user-select: none;
}

.tour-carousel__track.is-dragging-x {
  touch-action: none;
  cursor: grabbing;
}

.tour-carousel__track:active {
  cursor: grabbing;
}

.tour-carousel__strip {
  display: flex;
  height: 100%;
  will-change: transform;
}

.tour-carousel__strip.is-animating {
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.tour-carousel__slide {
  flex: 0 0 100%;
  min-width: 0;
  display: flex;
  align-items: stretch;
  opacity: 0.72;
  transform: scale(0.985);
  transition: opacity 220ms ease, transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.tour-carousel__slide:not(.is-active) {
  pointer-events: none;
}

.tour-carousel__slide.is-active {
  opacity: 1;
  transform: scale(1);
}

.tour-carousel__card-wrap {
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: stretch;
}

.tour-carousel__card {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255, 213, 74, 0.28);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  text-align: left;
}

.tour-carousel__card--disabled {
  opacity: 0.55;
}

.tour-carousel__card-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tour-carousel__card-scroll.is-dragging-y {
  cursor: grabbing;
}

.tour-carousel__card-footer {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  padding: 10px 16px 16px;
  background: linear-gradient(
    180deg,
    rgba(18, 8, 7, 0) 0%,
    rgba(18, 8, 7, 0.94) 24%,
    rgba(18, 8, 7, 0.98) 100%
  );
}

.tour-carousel__card-stops-title {
  margin: 4px 0 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 213, 74, 0.88);
}

.tour-carousel__card-stops-title[hidden] {
  display: none !important;
}

.tour-carousel__card-stops {
  margin: 0;
}

.tour-carousel__card-stops-empty {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.68);
}

.tour-carousel__card-mark {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.tour-carousel__card-title {
  margin: 0;
  font-size: clamp(1.35rem, 4.8vw, 1.6rem);
  line-height: 1.15;
}

.tour-carousel__card-summary {
  margin: 0;
  font-size: clamp(0.95rem, 3.6vw, 1.05rem);
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.82);
}

.tour-carousel__card-stats {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(255, 213, 74, 0.9);
}

.tour-carousel__card-cta,
.tour-carousel__card-badge {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 14px 16px;
  border-radius: 14px;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-gold, #ffd54a);
}

.tour-carousel__card-cta {
  border: 1px solid rgba(255, 213, 74, 0.35);
  background: rgba(255, 213, 74, 0.12);
  cursor: pointer;
  transition: background 0.12s ease, transform 0.12s ease, opacity 0.12s ease;
  touch-action: manipulation;
}

.tour-carousel__card-cta:active:not(:disabled) {
  background: rgba(255, 213, 74, 0.24);
  transform: scale(0.98);
}

.tour-carousel__card-cta.is-busy,
.tour-carousel__card-cta:disabled {
  opacity: 0.88;
  cursor: wait;
  transform: none;
}

.tour-carousel__starting {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  box-sizing: border-box;
  background: rgba(8, 10, 16, 0.94);
  color: var(--color-text-secondary);
  text-align: center;
  pointer-events: all;
}

.tour-carousel__starting[hidden] {
  display: none !important;
}

.tour-carousel__starting-message {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
}

#tourCarouselModal.app-modal {
  z-index: 10120;
}

#tourCarouselModal .app-modal__sheet {
  position: relative;
  width: min(100vw - 16px, 520px);
  max-width: none;
  height: min(calc(100dvh - 24px), 860px);
  max-height: none;
  padding-left: max(14px, env(safe-area-inset-left));
  padding-right: max(14px, env(safe-area-inset-right));
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

#tourCarouselModal .tour-carousel__body {
  flex: 1;
  min-height: 0;
}

#tourCarouselModal.is-starting .app-modal__title,
#tourCarouselModal.is-starting .app-modal__lead,
#tourCarouselModal.is-starting .app-modal__close,
#tourCarouselModal.is-starting .tour-carousel__body,
#tourCarouselModal.is-starting .tour-carousel__footer {
  visibility: hidden;
}

.tour-carousel__footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-shrink: 0;
  position: relative;
  z-index: 4;
  padding: 10px 0 max(12px, env(safe-area-inset-bottom));
}

.tour-carousel__nav {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 213, 74, 0.35);
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  touch-action: manipulation;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.tour-carousel__nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.tour-carousel__dots {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0 4px;
}

.tour-carousel__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
}

.tour-carousel__dot.is-active {
  background: var(--color-gold, #ffd54a);
  transform: scale(1.2);
}

#tourCarouselModal .app-modal__title {
  font-size: clamp(1.3rem, 4.5vw, 1.45rem);
}

#tourCarouselModal .app-modal__lead {
  margin-bottom: 10px;
  font-size: clamp(0.9rem, 3.4vw, 0.98rem);
}

#filterModal .app-modal__sheet {
  width: min(100vw - 16px, 520px);
  max-width: none;
  height: min(90vh, 820px);
  max-height: none;
  padding-left: max(14px, env(safe-area-inset-left));
  padding-right: max(14px, env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
}

#filterModal .app-modal__lead {
  margin-bottom: 8px;
}

.filter-modal__toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.filter-modal__summary {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
}

.filter-modal__quick-actions {
  display: flex;
  gap: 8px;
}

.filter-modal__quick-action {
  flex: 1 1 0;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.filter-modal__quick-action:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.filter-modal__search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.22);
  color: rgba(255, 255, 255, 0.72);
}

.filter-modal__search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 0.95rem;
  outline: none;
}

.filter-modal__search-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.filter-modal__body {
  flex: 1;
  min-height: 0;
  padding-right: 2px;
}

.filter-modal__footer {
  flex-shrink: 0;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.filter-modal__footer .app-modal__primary,
.filter-modal__footer .app-modal__secondary {
  min-height: 48px;
}

.filter-modal__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-modal__section {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.filter-modal__section--leaf,
.filter-modal__section--treasure {
  border: none;
  background: transparent;
}

.filter-modal__section-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 4px;
  padding: 4px 4px 4px 0;
}

.filter-modal__section-select {
  grid-column: 1;
  min-height: 48px;
  padding-right: 8px;
  border: none;
  border-radius: 0;
  background: transparent;
}

.filter-modal__section-meta {
  grid-column: 2;
  flex-shrink: 0;
  min-width: 2.8em;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: right;
  color: rgba(255, 255, 255, 0.52);
}

.filter-modal__section-toggle {
  grid-column: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.filter-modal__section-toggle[aria-expanded="true"] {
  transform: rotate(180deg);
}

.filter-modal__section-panel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px 8px 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.filter-modal__section-panel[hidden] {
  display: none;
}

.filter-modal__row,
.filter-modal__section-select {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.filter-modal__row--depth-2 {
  margin-left: 8px;
}

.filter-modal__row--depth-3 {
  margin-left: 16px;
}

.filter-modal__row.active,
.filter-modal__section-select.active {
  border-color: var(--cat-stroke, rgba(255, 213, 74, 0.35));
  background: color-mix(in srgb, var(--cat-fill, #ffd54a) 12%, transparent);
}

.filter-modal__row.is-partial:not(.active),
.filter-modal__section-select.is-partial:not(.active) {
  border-color: rgba(255, 213, 74, 0.22);
  background: rgba(255, 213, 74, 0.05);
}

.filter-modal__checkbox {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.34);
  background: rgba(0, 0, 0, 0.18);
  color: #1a1200;
}

.filter-modal__checkbox.is-checked,
.filter-modal__checkbox.is-indeterminate {
  border-color: var(--cat-stroke, #ffd54a);
  background: var(--cat-fill, #ffd54a);
  color: #1a1200;
}

.filter-modal__icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.filter-modal__label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.25;
}

.filter-modal__category-icon,
.filter-modal__treasure-chest {
  display: block;
}

.filter-modal__empty {
  margin: 8px 0 0;
  padding: 18px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.92rem;
  text-align: center;
}

.filter-modal__empty[hidden] {
  display: none;
}

body.filter-modal-open,
body.tour-carousel-open,
body.onboarding-profile-open,
body.onboarding-team-open,
body.how-it-works-tutorial-open {
  overflow: hidden;
}

body.tour-carousel-open .spirit-voice-dock {
  display: none !important;
}

body:has(#tourCarouselModal:not([hidden])) .spirit-voice-dock {
  display: none !important;
}

body.how-it-works-tutorial-open .app-modal,
body.how-it-works-tutorial-open.how-it-works-tutorial-travel-preview #navModeToggle {
  display: inline-flex;
}

body.how-it-works-tutorial-open #stopSheet,
body.how-it-works-tutorial-open #treasureChest,
body.how-it-works-tutorial-open #filterModal,
body.how-it-works-tutorial-open #teamModal,
body.how-it-works-tutorial-open #photoAlbumModal,
body.how-it-works-tutorial-open #photoViewer,
body.how-it-works-tutorial-open #panelModal,
body.how-it-works-tutorial-open #permissionGateModal,
body.how-it-works-tutorial-open #spiritTalkOverlay,
body.how-it-works-tutorial-open #tourBuilderPanel {
  display: none !important;
}

.tour-card-preview {
  width: 100%;
}

.tour-card-preview__map {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(26, 20, 16, 0.14);
  background: var(--color-bg-raised);
}

.tour-card-preview--carousel .tour-card-preview__map {
  aspect-ratio: 16 / 9;
  min-height: clamp(180px, 38vw, 240px);
}

.tour-card-preview--list .tour-card-preview__map {
  aspect-ratio: 16 / 9;
  min-height: 72px;
}

.tour-carousel__card .tour-card-preview__map {
  border-color: rgba(255, 213, 74, 0.22);
}

.tour-card-preview__loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.62);
}

.tour-card-preview__svg {
  display: block;
}

.tour-card-preview__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.tour-card-preview__meta--carousel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 2px;
}

.tour-carousel__card .tour-card-preview__chip {
  min-width: 0;
  padding: 10px 12px;
}

.tour-card-preview__chip-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.72;
}

.tour-card-preview__chip-value {
  font-size: clamp(0.95rem, 3.8vw, 1.05rem);
  font-weight: 800;
  line-height: 1.15;
}

@media (min-width: 480px) {
  .tour-card-preview__meta--carousel {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.tour-carousel__card:has(.tour-card-preview__meta:not(:empty)) .tour-carousel__card-stats,
.tour-select-panel__card:has(.tour-card-preview__meta:not(:empty)) .tour-select-panel__card-stats,
.tour-select-panel__card:has(.tour-card-preview__meta:not(:empty)) .tour-select-panel__card-duration {
  display: none !important;
}

.tour-carousel__card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
}

.tour-carousel__card-header-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.tour-carousel__card-category {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #1a1410;
  background: rgba(255, 213, 74, 0.92);
}

.tour-card-preview__chip {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  min-width: 64px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(26, 20, 16, 0.08);
}

.tour-carousel__card .tour-card-preview__chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 213, 74, 0.16);
}

.tour-select-panel__card {
  gap: 6px;
}

