/* =========================================
   1. DESIGN TOKENS & RESET
   ========================================= */
:root {
  /* Primary Colors (Unified) */
  --primary: #0f2bab;
  --primary-dark: #0a1f7d;
  --primary-light: #3a51c6;
  --primary-color: #0066cc; /* Kept for legacy JS/CSS compatibility */
  --secondary: #ff3b30;
  --secondary-color: #0077c2;
  --dark-blue: #1a3a8a;
  --dark-blue-hover: #0d2c6e;
  --hover-color: #0077c2; /* Used by .audio-button:hover in the location-hunt player */
  
  /* Status Colors */
  --success-color: #28a745;
  --warning-color: #ffc107;
  --error-color: #dc3545;
  
  /* Neutrals */
  --dark: #333333;
  --text-color: #333333;
  --light: #f8f9fa;
  --background-color: #f8f9fa;
  --gray: #6c757d;
  --gray-light: #e9ecef;
  --white: #ffffff;
  
  /* Shadows & Radii */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 14px;
  
  /* Transitions */
  --transition-normal: all 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; }
body, html {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Inter', 'Roboto', Arial, sans-serif;
  color: var(--text-color);
  background-color: var(--background-color);
  font-size: 16px;
  line-height: 1.5;
}

button, a, [role="button"], .map-button, .modal-button, .audio-button, .btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* =========================================
   2. MAP CANVAS & CONTROLS
   ========================================= */
#map {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100vw;
  height: 100vh; /* Fallback */
  height: 100dvh; /* Modern dynamic viewport */
  touch-action: pan-x pan-y pinch-zoom;
  -webkit-user-select: none;
  user-select: none;
  contain: layout paint;
  will-change: transform;
}

.map-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 500;
}

.control-button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--white);
  border: none;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-normal);
  color: var(--primary);
}

.control-button:hover { transform: scale(1.05); box-shadow: var(--shadow-lg); }
.control-button.active { background-color: var(--primary); color: var(--white); }

.map-buttons {
  position: fixed;
  bottom: 30px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  gap: 0.5rem;
  padding: 0 25px;
  z-index: 1000;
}

.map-button {
  background-color: var(--white);
  border: 1px solid var(--primary-color);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow-md);
  font-size: 2rem;
  color: var(--primary-color);
  transition: all 0.3s ease;
}

.map-button:hover {
  background-color: var(--primary-color);
  color: var(--white);
  transform: scale(1.1);
}

/* =========================================
   3. MARKERS & CLUSTERS
   ========================================= */
.user-marker { z-index: 1000; }

.user-marker-icon {
  width: 22px;
  height: 22px;
  background: radial-gradient(circle, #dc3545 0%, #a71e2a 70%);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  backface-visibility: hidden;
  position: relative;
}

/* Double pulse effect */
.user-marker-icon::before,
.user-marker-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 100, 100, 0.6);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(1.5);
  z-index: -1;
}

.user-marker-icon::before { animation: pulse1 4.5s infinite; }
.user-marker-icon::after { animation: pulse2 4.5s infinite; animation-delay: 2.5s; }
/*.user-marker-icon.moving { animation: pulse 2s infinite; } */

    .marker-cluster-custom {
      background-color: rgba(0, 100, 0, 0.6);
      border-radius: 50%;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      width: 40px;
      height: 40px;
    }

    .marker-cluster-custom div {
      background-color: rgba(47, 99, 47, 1);
      width: 30px;
      height: 30px;
      border-radius: 50%;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      margin: 0 !important; /* Crucial: overrides Leaflet's default 5px offset */
    }

    .marker-cluster-custom span {
      color: #ffffff;
      font-weight: 600;
      font-size: 12px;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      width: 100%;
      height: 100%;
      line-height: 30px; /* Fallback centering */
      text-align: center;
      margin: 0 !important;
    }

#accuracyIndicator {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  transition: background-color 0.3s ease;
  contain: layout paint;
}

#accuracyIndicator.accuracy-high { background-color: #4CAF50; }
#accuracyIndicator.accuracy-medium { background-color: #FF9800; }
#accuracyIndicator.accuracy-low { background-color: #F44336; }

.gps-reacquiring .user-marker-icon {
    animation: pulse 1s ease-in-out infinite;
    opacity: 0.6;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.2); opacity: 1; }
}

/* =========================================
   4. POPUPS & PINS
   ========================================= */
/* ── Popup Modal ── */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 150ms ease-out;
}

.popup-container {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 280px;
    max-width: 85%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.popup-container h3 {
    margin: 0 0 12px 0;
    color: #1a1a1a;
    font-size: 18px;
    font-weight: 600;
}

.popup-container p {
    margin: 0 0 20px 0;
    color: #555;
    font-size: 15px;
    line-height: 1.5;
}

.popup-close-btn {
    display: block;
    width: 100%;
    padding: 14px 0;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.popup-close-btn[data-type="info"]    { background: #2c5282; }
.popup-close-btn[data-type="success"] { background: #276749; }
.popup-close-btn[data-type="warning"] { background: #c05621; }
.popup-close-btn[data-type="error"]   { background: #c53030; }

/* ── Leaflet Popup ── */
.custom-popup .leaflet-popup-content-wrapper {
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}

.custom-popup .leaflet-popup-content {
  margin: 0;
  width: 280px !important;
}

.popup-content {
  text-align: center;
  background-color: white;
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
}

.location-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.location-name {
  margin: 0;
  padding: 12px 16px;
  font-size: 18px;
  font-weight: 600;
  color: var(--dark);
}

.popup-buttons {
  display: flex;
  border-top: 1px solid var(--gray-light);
}

.popup-buttons .button {
  flex: 1;
  padding: 12px 0;
  font-size: 17px;
  font-weight: 500;
  color: white;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

.button.route-button { background-color: #1b5e20 !important; }
.button.summary-button { background-color: #0f2bab !important; }
.button.route-button:hover { background-color: #0d3c12 !important; }
.button.summary-button:hover { background-color: #0a1f80 !important; }

.pin-head {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) rotate(-45deg);
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 0;
  border: 3px solid white;
  box-shadow: var(--shadow-sm);
  background-color: #191970;
  transition: all 0.3s ease;
  overflow: hidden;
}

.pin-head:hover {
  transform: translateX(-50%) rotate(-45deg) scale(1.1);
  box-shadow: 0 0 15px var(--shadow-sm);
}

.pin-head::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background-color: rgba(245, 245, 245, 0.9);
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
}

.directions-link {
  display: inline-block;
  margin-top: 15px;
  padding: 10px 20px;
  background-color: #006400;
  color: white;
  border-radius: 25px;
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 600;
  font-size: 1.1rem;
}

.directions-link:hover {
  background-color: #037f51;
  transform: translateY(-2px);
  box-shadow: 0 6px 8px var(--shadow-sm);
}

/* =========================================
   5. DISTANCE BOX & INDICATORS
   ========================================= */
#distanceBox {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1003;
  background: #fff;
  padding: 12px 24px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 20px;
  text-align: center;
  min-width: 200px;
  box-shadow: var(--shadow-md);
  border: 3px solid var(--dark-blue);
  color: var(--dark-blue);
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  contain: layout paint;
}

#distanceBox.show { opacity: 1; visibility: visible; }
#distanceBox.proximity-close { background: linear-gradient(135deg, #28a745, #20c997); color: #fff; border-color: transparent; animation: pulse 1.5s infinite; }
#distanceBox.proximity-medium { background: linear-gradient(135deg, #ffc107, #fd7e14); color: #fff; border-color: transparent; }
#distanceBox.proximity-far { background: #fff; color: var(--dark-blue); border-color: var(--dark-blue); }

/* =========================================
   6. MODALS & OVERLAYS
   ========================================= */
/* Generic Modal */
.modal {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: none; /* Hidden by default, toggled via JS */
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-content {
  background-color: var(--white);
  padding: 24px;
  border-radius: 12px;
  max-width: 90%;
  width: 320px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.modal-content h3 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--dark);
}

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.modal-button, .modal-buttons button {
  padding: 12px;
  border-radius: 8px;
  border: none;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-normal);
  font-size: 16px;
}

.modal-button, #mapButton, #continueButton {
  background-color: var(--primary);
  color: var(--white);
}

.modal-button:hover, #mapButton:hover, #continueButton:hover {
  background-color: var(--primary-dark);
}

.modal-button.cancel, #cancelButton {
  background-color: var(--gray-light);
  color: var(--dark);
}

.modal-button.cancel:hover, #cancelButton:hover {
  background-color: var(--gray);
  color: var(--white);
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}
.close:hover, .close:focus { color: black; text-decoration: none; }

/* Lochunt Container */
.lochunt-container {
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: 2000;
  display: none;
  flex-direction: column;
  overflow-y: auto;
}

.lochunt-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* Additional Info */
.additional-info-container {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--primary-color);
  width: 90%;
  max-width: 600px;
  z-index: 2001;
  font-size: 20px;
}

/* Raised above the backdrop overlay added below it; the popup itself
   must sit above its own scrim. See showAdditionalInfo() in lochunt.js. */
.additional-info-container {
  z-index: 2003 !important;
  pointer-events: auto !important;
}

/* Backdrop scrim behind the additional-info popup. Previously injected
   at runtime via a <style> tag in showAdditionalInfo() — now lives here
   permanently, and that injection code has been removed from the JS. */
.additional-info-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 2002;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: auto;
}

.additional-info-overlay.show {
  display: block;
  opacity: 1;
}

body.additional-info-open .lochunt-container,
body.additional-info-open .audio-button,
body.additional-info-open .audio-controls,
body.additional-info-open .progress,
body.additional-info-open .map-buttons {
  pointer-events: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.additional-info-title { font-size: 18px; font-weight: 600; margin: 0 0 12px 0; color: var(--dark); }
.additional-info-text { font-size: 14px; line-height: 1.6; color: var(--dark); margin-bottom: 20px; }

.continue-button {
  display: block;
  width: 100%;
  padding: 12px;
  background-color: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-normal);
}
.continue-button:hover { background-color: var(--primary-dark); }

/* =========================================
   6a. NAVIGATION TIPS (class-based modal)
   ========================================= */
.nav-tips-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: safe center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 20px;
  overflow-y: auto;
}

.nav-tips-overlay.show {
  opacity: 1;
}

.nav-tips-content {
  background-color: white;
  border-radius: 16px;
  width: 97%;
  max-width: 520px;
  max-height: 90dvh;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
  transform: translateY(20px);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.nav-tips-overlay.show .nav-tips-content {
  transform: translateY(0);
}

.nav-tips-header {
  text-align: center;
  padding: 24px 32px 0;
  flex-shrink: 0;
}

.nav-tips-title {
  margin: 0 0 12px 0;
  color: var(--dark-blue);
  font-size: 1.45rem;
  font-weight: 600;
}

.nav-tips-body {
  padding: 0 32px;
  color: #4a5a6a;
  line-height: 1.6;
  font-size: 1.05rem;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.nav-tips-list {
  list-style-type: none;
  padding: 0;
  margin: 0 0 12px 0;
}

.nav-tip-item {
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
}

.nav-tip-bullet {
  color: var(--dark-blue);
  margin-right: 12px;
  font-size: 1.2rem;
  margin-top: 2px;
  flex-shrink: 0;
}

.nav-tips-footer {
  padding: 18px 32px 24px;
  text-align: center;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  margin-top: 12px;
  flex-shrink: 0;
}

.nav-tips-close-btn {
  padding: 12px 28px;
  background-color: var(--dark-blue);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 600;
  width: 100%;
  max-width: 220px;
  transition: background-color 0.2s ease;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.nav-tips-close-btn:hover {
  background-color: var(--dark-blue-hover);
}

/* Congratulations */
#congratulations {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.98);
  z-index: 3000;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 30px;
  text-align: center;
}

#congratulations h2 { font-size: 32px; color: var(--primary-color); margin-bottom: 20px; }
#congratulations button {
  padding: 12px 24px;
  font-size: 18px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
}
#congratulations button:hover { background-color: var(--primary-light); }

/* =========================================
   6b. SUMMARY MODAL (class-based)
   ========================================= */
.summary-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 16px;
}

.summary-modal-overlay.show {
  opacity: 1;
}

.summary-modal-card {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
}

.summary-modal-overlay.show .summary-modal-card {
  transform: translateY(0);
}

.summary-modal-header {
  background: var(--dark-blue);
  color: #fff;
  text-align: center;
  padding: 20px 24px;
}

.summary-modal-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.2;
}

.summary-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  -webkit-overflow-scrolling: touch;
}

.summary-description {
  color: #5c6c7c;
  line-height: 1.6;
  font-size: 1rem;
  margin: 0 0 20px;
}

.summary-difficulty-box {
  background: var(--difficulty-bg);
  border: 1px solid var(--difficulty-border);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 18px;
  position: relative;
}

.summary-difficulty-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--difficulty-color);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 3px solid #fff;
}

.summary-access-label {
  font-weight: 600;
  color: #374151;
  font-size: 0.95rem;
  margin-bottom: 10px;
  padding-right: 80px;
}

.summary-difficulty-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.summary-difficulty-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--difficulty-color);
  flex-shrink: 0;
}

.summary-difficulty-label {
  color: var(--difficulty-color);
  font-weight: 600;
  font-size: 1rem;
}

.summary-difficulty-desc {
  color: #6b7280;
  font-size: 0.9rem;
  padding-left: 22px;
  line-height: 1.4;
}

.summary-today-box {
  border: 2px solid var(--dark-blue);
  border-radius: 12px;
  padding: 16px;
  background: rgba(26, 58, 138, 0.05);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
}

.summary-today-label {
  font-weight: 600;
  color: #2c3e50;
  padding-right: 15px;
  min-width: 80px;
}

.summary-today-text {
  flex: 1;
  color: #2c3e50;
  border-left: 1px solid rgba(26, 58, 138, 0.2);
  padding-left: 15px;
  font-size: 0.95rem;
}

.summary-button-row {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.continue-btn {
  padding: 16px 32px;
  background: var(--dark-blue);
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 600;
  min-width: 140px;
  transition: background 0.2s;
  box-shadow: 0 4px 14px rgba(26, 58, 138, 0.3);
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.continue-btn:hover {
  background: var(--dark-blue-hover);
}


/* =========================================
   7. LOADING, PRELOADERS & GPS STATES
   ========================================= */
/* Loading Message */
#loadingMessage {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: url('https://mnthen.com/images/splash_screen.webp');
  background-size: cover;
  background-position: center;
  z-index: 10000;
  transition: opacity 0.5s ease;
}

#loadingMessage .loading-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  background-color: white;
  padding: 35px 30px;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), 0 2px 10px rgba(0, 0, 0, 0.2);
  width: 450px;
  height: 500px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

#loadingMessage.fade-out {
  opacity: 0;
}

#loadingMessage .loading-logo { width: 180px; height: auto; margin: 0 auto 25px; border-radius: 12px; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(0, 40, 85, 0.2)); }
#loadingMessage .loading-title { margin: 0 0 8px 0; font-size: 22px; font-weight: 700; color: #002855; line-height: 1.2; letter-spacing: -0.02em; }
#loadingMessage .loading-subtitle { margin: 0 0 40px 0; font-size: 18px; font-weight: 500; color: #0066cc; line-height: 1.3; opacity: 0.9; }
#loadingMessage .loading-status { min-height: 60px; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
#loadingMessage .loading-status p { margin: 0; font-size: 18px; font-weight: 500; color: #0077dd; animation: pulse 2s infinite; }
#loadingMessage .loading-progress-track { width: 100%; height: 10px; background-color: rgba(0, 51, 102, 0.08); border-radius: 10px; overflow: hidden; margin-bottom: 12px; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.12); }
#loadingMessage .loading-progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, #0066cc, #0099ff, #00aaff, #0099ff, #0066cc); background-size: 200% auto; border-radius: 10px; transition: width 0.3s cubic-bezier(0.4, 0.0, 0.2, 1); box-shadow: 0 0 10px rgba(0, 120, 255, 0.6); animation: gradientShift 3s ease infinite; }
#loadingMessage .loading-note { min-height: 50px; display: flex; align-items: center; justify-content: center; }
#loadingMessage .loading-note p { margin: 0; font-size: 16px; color: #555; font-weight: 500; opacity: 0.8; }

/* Preloader */
#preloader {
  position: fixed;
  inset: 0;
  background-image: url('https://www.mnthen.com/images/header/mnthen_splash_page.webp'); 
  background-size: cover;
  background-position: center;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  color: white;
  font-family: 'Montserrat', sans-serif;
}

#preloader::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: -1;
}

.preloader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 80%;
  text-align: center;
  padding: 40px;
  border-radius: 12px;
  background-color: rgba(20, 20, 20, 0.4);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

#preloader .logo { width: 140px; height: auto; margin-bottom: 25px; }
#preloader h1 { font-size: 48px; font-weight: 800; margin-bottom: 15px; color: #ffffff; }
#preloader h2 { font-size: 20px; font-weight: 400; margin-bottom: 40px; max-width: 700px; line-height: 1.5; color: rgba(255, 255, 255, 0.9); }
#preloader p { margin-top: 20px; font-size: 16px; color: rgba(255, 255, 255, 0.85); font-style: italic; font-weight: 600; }
#preloader .progress-container { width: 90%; max-width: 320px; height: 6px; background-color: rgba(255, 255, 255, 0.1); border-radius: 6px; margin-top: 30px; overflow: hidden; }
#preloader .progress-bar { height: 100%; background: #ffffff; width: 0; transition: width 0.4s ease; border-radius: 6px; }
#preloader .status-message { margin-top: 15px; font-size: 13px; color: rgba(255, 255, 255, 0.6); }

/* Stabilizing Modal */
.stabilizing-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(255, 255, 255, 0.95);
  padding: 24px;
  border-radius: 12px;
  z-index: 2000;
  text-align: center;
  box-shadow: var(--shadow-lg);
  max-width: 80%;
  width: 320px;
  opacity: 0;
  transition: opacity 0.3s ease-out;
  pointer-events: none;
  will-change: opacity;
}

.stabilizing-modal.visible { opacity: 1; pointer-events: auto; }
.stabilizing-modal h3 { margin: 12px 0; font-size: 18px; font-weight: 600; color: var(--dark); }
.stabilizing-modal p { margin-bottom: 0; font-size: 14px; color: var(--gray); line-height: 1.5; }

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(15, 43, 171, 0.2);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  margin: 0 auto 15px;
  animation: spin 1s linear infinite;
}

/* GPS Searching State */
.gps-loading-overlay, #gps-searching-indicator { display: none; }
body.gps-searching .gps-loading-overlay, body.gps-searching #gps-searching-indicator { display: block; }
body.gps-searching [data-disabled-during-gps-search] { pointer-events: none; opacity: 0.5; }

/* Geo Retry Modal */
.geo-retry-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
}

.geo-retry-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 28px 24px;
  width: 90%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.geo-retry-title { font-size: 26px; margin: 0 0 6px 0; }
.geo-retry-text { margin: 16px 0; color: #4a5568; line-height: 1.5; font-size: 15px; }
.geo-retry-btn { background: #2c5282; color: white; border: none; padding: 14px 28px; border-radius: 8px; font-size: 17px; font-weight: 600; margin-top: 12px; cursor: pointer; width: 100%; }
.geo-retry-cancel { margin-top: 20px; background: none; border: none; color: #718096; font-size: 14px; cursor: pointer; }

/* =========================================
   8. PWA BANNERS
   ========================================= */
#pwaInstallBanner {
  position: fixed;
  inset: auto 20px 20px 20px;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0, 0, 0, 0.05);
  padding: 20px;
  z-index: 2000;
  display: none;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  border: 1px solid #e2e8f0;
  contain: layout paint;
}

#pwaInstallBanner.show { display: block; }
.banner-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px; }
.banner-title { display: flex; align-items: center; gap: 12px; }
.app-icon { width: 40px; height: 40px; border-radius: 10px; background-color: #2c5282; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 20px; flex-shrink: 0; }
#pwaInstallBanner h3 { margin: 0; color: #2d3748; font-size: 18px; font-weight: 600; }
.close-btn { background: #f7fafc; border: none; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #718096; font-size: 20px; transition: all 0.2s ease; flex-shrink: 0; }
.close-btn:hover { background: #edf2f7; color: #4a5568; }
.banner-content { margin-bottom: 20px; }
.banner-content p { margin: 0; color: #4a5568; line-height: 1.5; font-size: 15px; }
.pwa-ios-instructions { font-size: 14px !important; margin-top: 10px !important; }
.banner-actions { display: flex; justify-content: flex-end; gap: 12px; }
.cancel-btn { background: transparent; border: 1px solid #e2e8f0; border-radius: var(--radius-sm); padding: 10px 18px; font-size: 14px; font-weight: 500; cursor: pointer; color: #718096; transition: all 0.2s ease; }
.cancel-btn:hover { background: #f7fafc; border-color: #cbd5e0; }
.install-btn { background: #2c5282; color: #fff; border: none; border-radius: var(--radius-sm); padding: 10px 22px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); position: relative; overflow: hidden; backface-visibility: hidden; }
.install-btn::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent); transition: left 0.7s ease; }
.install-btn:hover { background: #1a3a8a; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); transform: translateY(-1px); }
.install-btn:hover::before { left: 100%; }
.install-btn:active { transform: translateY(0); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); }

.pwa-post-install-notice {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  background: #1a1a1a;
  color: #f8f9fa;
  border-radius: var(--radius-lg);
  padding: 16px;
  width: 90%;
  max-width: 360px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  z-index: 10001;
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s ease-out, opacity 0.3s ease-out, visibility 0.3s;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  contain: layout paint;
}

.pwa-post-install-notice.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; -webkit-overflow-scrolling: touch; }
.pwa-notice-content p:first-of-type { margin-top: 0; font-weight: 600; color: #66d9ef; }
.pwa-notice-content ol { margin: 10px 0 14px 18px; padding-left: 4px; }
.pwa-notice-content li { margin-bottom: 6px; }
.pwa-notice-button { background: #007bff; color: #fff; border: none; border-radius: var(--radius-sm); padding: 8px 16px; font-size: 14px; font-weight: 600; cursor: pointer; width: 100%; transition: background 0.2s; }
.pwa-notice-button:hover, .pwa-notice-button:focus-visible { background: #0056b3; outline: 2px solid #66d9ef; outline-offset: 2px; }

/* =========================================
   9. AUDIO PLAYER & LOCATION HUNT DETAIL
   ========================================= */
/* Replaces the older/stale audio-player rules that predate the
   inline-style era of lochunt.js — those inline styles always won
   over these selectors, so the values below are the ones actually
   extracted from what renders today. */

/* ─── Scrollable content wrapper (image + text + audio player) ──── */
.lochunt-scrollable {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    will-change: scroll-position;
}

.lochunt-image {
    width: 100%;
    height: 45vh;
    object-fit: cover;
    object-position: center;
}

/* Inner text/audio container. Named distinctly from .lochunt-content
   (Section 6), which is a different element (the outer scroll wrapper). */
.lochunt-detail-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
}

.lochunt-info {
    text-align: center;
    width: 100%;
    margin-bottom: 15px;
}

.lochunt-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
    line-height: 1.2;
}

.lochunt-city {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    color: #2c5282;
    font-weight: 600;
    margin-bottom: 4px;
}

.lochunt-creator {
    font-size: calc(0.9rem + 0.4vw);
    color: #666666;
    font-weight: 500;
}

/* ─── Audio player ───────────────────────────────────────────────── */
.audio-player {
    width: 100%;
    max-width: 400px;
    margin-bottom: 15px;
}

.audio-progress {
    width: 100%;
    margin-bottom: 15px;
}

.progress {
    height: 8px;
    background-color: #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 12px;
    overflow: hidden;
    touch-action: manipulation; /* Instant taps on progress bar */
    user-select: none;          /* Prevent text selection on fast taps */
}

.progress-bar {
    height: 100%;
    background-color: #2c5282;
    width: var(--progress-percent, 0%);
    transition: width 0.1s linear;
    pointer-events: none; /* Prevents taps on the bar itself from fighting the container */
}

.audio-time {
    display: flex;
    justify-content: space-between;
    color: #4a5568;
    font-size: 0.875rem;
    margin-bottom: 16px;
    font-weight: 500;
}

.audio-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 24px;
    touch-action: manipulation; /* Instant taps on controls */
    user-select: none;          /* Prevent text selection on fast taps */
}

.audio-button {
    background-color: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
    touch-action: manipulation; /* Removes 300ms click delay on mobile */
    user-select: none;          /* Prevents text selection on rapid taps */
    -webkit-tap-highlight-color: transparent; /* Removes default iOS tap flash */
}

.audio-button:hover {
    background-color: var(--hover-color);
}

/* Applied briefly on click/tap — reproduces the original 200ms press-flash */
.audio-button--active {
    background-color: var(--primary-color);
    color: white;
    transform: scale(0.95);
}

/* ─── Bottom action bar ──────────────────────────────────────────── */
.location-action-bar {
    width: 100%;
    height: 60px;
    background: linear-gradient(to right, #2c5282, #2b6cb0);
    margin-top: auto;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.025);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    position: sticky;
    bottom: 0;
}

.source-info-button {
    background: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.source-info-button i {
    font-size: 1.2rem;
    color: #2b6cb0;
}

.support-info {
    color: white;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    flex: 1;
    padding: 0 20px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.support-info a {
    color: white;
    text-decoration: underline;
}

.feedback-email-button {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.feedback-email-button i {
    font-size: 1.5rem;
}

/* ─── Source info popup ──────────────────────────────────────────── */
.source-info-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.source-info-popup-overlay.show {
    opacity: 1;
}

.source-info-content {
    background-color: white;
    border-radius: 8px;
    padding: 24px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.source-info-popup-overlay.show .source-info-content {
    transform: translateY(0);
}

.source-popup-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c5282;
    margin-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 12px;
}

.source-popup-content {
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 1rem;
}

.source-close-button {
    background: linear-gradient(to right, #2c5282, #2b6cb0);
    border: none;
    color: white;
    padding: 8px 24px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    align-self: flex-end;
    transition: opacity 0.2s ease;
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.source-close-button:hover {
    opacity: 0.9;
}

/* =========================================
   10. KEYFRAMES
   ========================================= */
@keyframes pulse { 0%, 100% { opacity: 0.8; } 50% { opacity: 1; } }
@keyframes pulse1 { 0% { transform: translate(-50%, -50%) scale(1.5); opacity: 0.8; } 100% { transform: translate(-50%, -50%) scale(3.5); opacity: 0; } }
@keyframes pulse2 { 0% { transform: translate(-50%, -50%) scale(1.5); opacity: 0.8; } 100% { transform: translate(-50%, -50%) scale(3.5); opacity: 0; } }
@keyframes slideUp { from { transform: translateY(100px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes gradientShift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.fade-in { animation: fadeIn 0.3s ease forwards; }
.fade-out { animation: fadeOut 0.3s ease forwards; }

/* =========================================
   11. UTILITIES & ACCESSIBILITY
   ========================================= */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.leaflet-control-attribution {
    background: transparent !important;
    color: rgba(0, 0, 0, 0.45) !important;
    font-size: 10px !important;
    padding: 2px 4px !important;
    line-height: 1.2 !important;
}

.leaflet-control-attribution a {
    color: rgba(0, 0, 0, 0.55) !important;
}

.leaflet-marker-icon { transition: opacity 0.5s ease !important; }
.map-tiles { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .user-marker-icon, .map-button, #distanceBox, #pwaInstallBanner, .fade-in, .fade-out, #loadingMessage .loading-status p, #loadingMessage .loading-progress-bar {
    transition: none !important;
    animation: none !important;
  }
}

/* =========================================
   12. RESPONSIVE
   ========================================= */
@media (min-width: 768px) {
  .modal-content { width: 400px; }
  .modal-buttons { flex-direction: row; justify-content: center; }
  .lochunt-content { max-width: 600px; }
  .lochunt-image { height: 300px; }
}

@media (max-width: 768px) {
  body, html { font-size: 18px; }
  #distanceBox { font-size: 1.3rem; padding: 6px 10px; top: 10px; right: 10px; }
  .map-buttons { bottom: 20px; }
  .map-button { width: 50px; height: 50px; font-size: 1.7rem; }
  #congratulations h2 { font-size: 24px; }
  #congratulations button { font-size: 16px; padding: 10px 20px; }
  .audio-player { max-width: 100%; }
  .lochunt-container img { height: 30vh; }
  .additional-info-container { width: 95%; padding: 20px; font-size: 16px; }
  
  #preloader h1 { font-size: 36px; }
  #preloader h2 { font-size: 18px; margin-bottom: 30px; }
  .preloader-content { padding: 30px; max-width: 90%; }
}

@media (max-width: 640px) {
  #pwaInstallBanner { inset: auto 15px 15px 15px; padding: 18px; }
  #pwaInstallBanner h3 { font-size: 16px; }
  .banner-content p { font-size: 14px; }
  .banner-actions { flex-direction: column-reverse; gap: 10px; }
  .cancel-btn, .install-btn { width: 100%; text-align: center; padding: 12px; }
}

@media (max-width: 500px) {
  #loadingMessage .loading-card { width: 85%; height: auto; min-height: 480px; padding: 25px 20px; }
  #preloader h1 { font-size: 30px; }
  #preloader h2 { font-size: 16px; }
  .preloader-content { padding: 20px; max-width: 95%; }
}

@media (max-width: 360px) {
  #accuracyIndicator { display: none; }
}

@supports (-webkit-touch-callout: none) {
  .map-button:active { background-color: white !important; color: var(--primary-color) !important; }
  #map, .lochunt-container { height: -webkit-fill-available; }
}

@supports not (height: 100dvh) {
  #map { height: 100vh; }
}

/* =========================================
   13. EXIT MODAL & CREDITS MODAL
   ========================================= */
.exit-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.exit-modal-overlay.show { opacity: 1; }

.exit-modal-card {
  background-color: white;
  border-radius: 16px;
  padding: 28px;
  width: 90%;
  max-width: 420px;
  max-height: 90vh;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  margin: auto;
  transform: translateY(20px);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.exit-modal-overlay.show .exit-modal-card { transform: translateY(0); }

.exit-modal-icon-wrap { text-align: center; margin-bottom: 25px; }

.exit-modal-title {
  text-align: center;
  margin: 0 0 15px 0;
  color: #2c3e50;
  font-size: 1.5rem;
  font-weight: 600;
}

.exit-modal-message-wrap { flex-grow: 1; overflow-y: auto; padding: 0 10px; }

.exit-modal-message {
  text-align: center;
  margin: 0 0 30px 0;
  color: #5c6c7c;
  line-height: 1.5;
  font-size: 1rem;
}

.exit-modal-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 15px;
}

.exit-modal-confirm-btn {
  padding: 14px 24px;
  background-color: var(--dark-blue);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  min-width: 130px;
  transition: background-color 0.2s ease;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.exit-modal-confirm-btn:hover { background-color: var(--dark-blue-hover); }

.exit-modal-cancel-btn {
  padding: 14px 24px;
  background-color: transparent;
  color: var(--dark-blue);
  border: 1.5px solid var(--dark-blue);
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  min-width: 130px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.exit-modal-cancel-btn:hover { background-color: rgba(26, 58, 138, 0.05); }

.exit-modal-credits-wrap { text-align: center; margin-top: 15px; }

.exit-modal-credits-link {
  display: inline-block;
  text-align: center;
  color: #64748b;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 8px 20px;
  border-radius: 100px;
  border: 1px solid rgba(100, 116, 139, 0.2);
  background-color: rgba(100, 116, 139, 0.05);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.exit-modal-credits-link:hover {
  background-color: rgba(100, 116, 139, 0.1);
  border-color: rgba(100, 116, 139, 0.3);
}

.credits-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1001;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.credits-modal-overlay.show { opacity: 1; }

.credits-modal-card {
  background-color: white;
  border-radius: 16px;
  width: 92%;
  max-width: 450px;
  max-height: 80vh;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  margin: auto;
  transform: translateY(20px);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.credits-modal-overlay.show .credits-modal-card { transform: translateY(0); }

.credits-modal-header {
  background-color: var(--dark-blue);
  padding: 20px;
  color: white;
  text-align: center;
}

.credits-modal-header h3 { margin: 0; font-size: 1.5rem; font-weight: 600; }

.credits-modal-body { padding: 20px; flex-grow: 1; overflow-y: auto; }

.credits-modal-list { list-style-type: none; padding: 0; margin: 0; }

.credits-modal-list li { margin-bottom: 20px; }
.credits-modal-list li:last-child { margin-bottom: 0; }

.credits-modal-item-title { color: #1e293b; font-size: 1.05rem; }

.credits-modal-item-desc {
  color: #64748b;
  margin: 5px 0 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.credits-modal-footer { padding: 15px; text-align: center; border-top: 1px solid #eee; }

.credits-modal-close-btn {
  padding: 12px 30px;
  background-color: var(--dark-blue);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background-color 0.2s ease;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.credits-modal-close-btn:hover { background-color: var(--dark-blue-hover); }

/* =========================================
   14. LOCATION SUMMARY MODAL (map-briefing card)
   Formerly injected at runtime by showLocationSummary() in
   summaryModal.js via a <style id="summaryModalStyles"> tag.
   That injection code has been removed from the JS; these rules
   now live here permanently instead.
   ========================================= */
#summaryModal {
  position: fixed; inset: 0; z-index: 1000;
  box-sizing: border-box;
  padding: 24px 16px;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
           max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; min-height: 100dvh;
  background: rgba(7,15,33,.62);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .28s ease;
  font-family: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
#summaryModal.is-open { opacity: 1; }
#summaryModal * { box-sizing: border-box; }

.sm-card {
  width: 100%; max-width: 440px; margin: auto;
  max-height: min(88vh,760px); max-height: min(88dvh,760px);
  display: flex; flex-direction: column; overflow: hidden;
  background: #fbfcfe; border-radius: 20px; color: #33445c;
  box-shadow: 0 24px 60px -20px rgba(3,10,30,.5), 0 4px 14px -6px rgba(3,10,30,.28);
  transform: translateY(20px) scale(.97);
  transition: transform .5s cubic-bezier(.16,1,.3,1);
}
#summaryModal.is-open .sm-card { transform: none; }

/* ---- header: the living map ---- */
.sm-header { position: relative; min-height: 150px; padding: 26px 24px 38px; color: #fff;
  background: linear-gradient(155deg,#0d2560 0%,#1a3a8a 55%,#2550ad 100%); }
.sm-card.has-chips .sm-header { padding-bottom: 0; }

.sm-topo { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.sm-topo::before { content: ''; position: absolute; inset: -28px;
  background:
    repeating-radial-gradient(circle at 88% -25%, transparent 0 30px, rgba(255,255,255,.06) 30px 32px),
    repeating-radial-gradient(circle at -12% 130%, transparent 0 26px, rgba(255,255,255,.04) 26px 28px);
  animation: smDrift 38s ease-in-out infinite alternate; }
.sm-topo::after { content: ''; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 0% 0%, rgba(130,170,255,.24), transparent 55%); }
@keyframes smDrift { to { transform: translate(-18px,-12px); } }

.sm-start { position: absolute; left: 20px; bottom: 24px; z-index: 1; width: 10px; height: 10px;
  border: 2px solid rgba(255,255,255,.8); border-radius: 50%;
  opacity: 0; animation: smFadeIn .4s .5s ease forwards; }
@keyframes smFadeIn { to { opacity: 1; } }

.sm-trail { position: absolute; left: 0; bottom: 8px; width: 100%; height: 58px; z-index: 1; pointer-events: none; }
.sm-trail path { stroke-dasharray: 100; stroke-dashoffset: 100;
  animation: smDraw 1.4s .45s cubic-bezier(.45,0,.2,1) forwards; }
@keyframes smDraw { to { stroke-dashoffset: 0; } }

.sm-pin { position: absolute; right: 24px; bottom: 14px; z-index: 2; width: 26px; height: 26px;
  opacity: 0; transform-origin: 50% 100%;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.25));
  animation: smPin .5s 1.7s cubic-bezier(.34,1.56,.64,1) forwards; }
.sm-pin svg { display: block; width: 100%; height: 100%; }
.sm-pin::after { content: ''; position: absolute; left: 50%; bottom: -3px; width: 9px; height: 9px;
  margin-left: -4.5px; border-radius: 50%; background: rgba(255,255,255,.45);
  animation: smPing 3s 2.4s ease-out infinite; }
@keyframes smPin { 0% { opacity: 0; transform: translateY(-8px) scale(.4); }
                   100% { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes smPing { 0% { transform: scale(.4); opacity: .5; }
                    35%,100% { transform: scale(2.4); opacity: 0; } }

.sm-close { position: absolute; top: 14px; right: 14px; z-index: 5;
  width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer;
  color: #fff; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.24);
  border-radius: 50%; transition: background .2s ease, transform .3s cubic-bezier(.34,1.56,.64,1); }
.sm-close:hover { background: rgba(255,255,255,.22); transform: rotate(90deg); }
.sm-close:focus-visible { outline: 2px solid #86a5ff; outline-offset: 2px; }

.sm-ghost { position: absolute; top: -14px; right: 14px; z-index: 1; pointer-events: none;
  font-family: 'Fraunces', Georgia, serif; font-weight: 800; line-height: 1;
  font-size: clamp(56px,18vw,92px); color: rgba(255,255,255,.1); user-select: none; }

.sm-eyebrow { position: relative; z-index: 3; display: flex; align-items: center; gap: 9px;
  margin-right: 40px; font-size: .58rem; font-weight: 800; letter-spacing: .2em;
  text-transform: uppercase; color: #a9c0f2; }
.sm-eyebrow::before { content: ''; width: 16px; height: 2px; border-radius: 2px; flex-shrink: 0; background: #5f83d9; }
.sm-title { position: relative; z-index: 3; margin: 10px 40px 0 0;
  font-family: 'Fraunces', Georgia, serif; font-weight: 600; letter-spacing: -.01em;
  font-size: clamp(1.35rem, 3.4vw + .5rem, 1.8rem); line-height: 1.12; text-wrap: balance; }

.sm-stats { position: relative; z-index: 4; display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 -20px; }
.sm-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px;
  background: #fff; color: #3d4c61; border: 1px solid #e6ebf3; border-radius: 999px;
  font-size: .78rem; font-weight: 700; line-height: 1;
  box-shadow: 0 6px 16px -8px rgba(8,20,50,.35);
  transition: transform .18s ease, box-shadow .18s ease; }
.sm-chip:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -8px rgba(8,20,50,.4); }
.sm-chip svg { color: #8593a8; flex-shrink: 0; }

/* ---- body ---- */
.sm-scrollwrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sm-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 24px 0 22px; -webkit-overflow-scrolling: touch; }
.sm-body:focus-visible { outline: 2px solid #86a5ff; outline-offset: -2px; }
.sm-card.has-chips .sm-body { padding-top: 32px; }
.sm-body::-webkit-scrollbar { width: 7px; }
.sm-body::-webkit-scrollbar-track { background: transparent; }
.sm-body::-webkit-scrollbar-thumb { background: #d7dfea; border-radius: 8px; }
.sm-body::-webkit-scrollbar-thumb:hover { background: #c3cee0; }

.sm-fade { position: absolute; left: 0; right: 0; bottom: 0; height: 48px; pointer-events: none;
  background: linear-gradient(180deg, rgba(251,252,254,0), #fbfcfe 78%);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px;
  opacity: 0; transition: opacity .3s ease; }
.sm-fade.is-visible { opacity: 1; }
.sm-fade svg { color: #95a3b6; animation: smBob 1.6s ease-in-out infinite; }
@keyframes smBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(3px); } }

.sm-summary { padding: 0 24px; }
.sm-summary p { margin: 0; font-size: 1rem; line-height: 1.7; color: #3d4c61; }
.sm-summary p + p { margin-top: .9em; }
.sm-summary p:first-child::first-letter {
  font-family: 'Fraunces', Georgia, serif; font-weight: 700; color: #1a3a8a;
  font-size: 2.9em; line-height: .75; float: left; padding: 4px 8px 0 0; }

.sm-gauge { margin: 18px 24px 0; padding: 16px 18px 14px;
  background: #fff; border: 1px solid #e7ecf3; border-radius: 14px;
  box-shadow: 0 6px 16px -12px rgba(15,30,70,.3); }
.sm-gauge-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.sm-gauge-label { font-size: .62rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: #8593a8; }
.sm-gauge-score { font-weight: 800; font-size: .92rem; color: var(--diff); font-variant-numeric: tabular-nums; }
.sm-gauge-score small { color: #9aa8bc; font-weight: 700; }
.sm-segs { display: flex; gap: 5px; margin-bottom: 12px; }
.sm-seg { flex: 1; height: 7px; border-radius: 99px; background: #eef1f7; overflow: hidden; }
.sm-seg i { display: block; height: 100%; border-radius: inherit; background: var(--diff);
  transform: scaleX(0); transform-origin: left; }
.sm-seg.filled i { animation: smFill .5s cubic-bezier(.25,.8,.3,1) forwards;
  animation-delay: calc(var(--i) * 80ms + .3s); }
@keyframes smFill { to { transform: scaleX(1); } }
.sm-gauge-value { font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 1.15rem; color: var(--diff); line-height: 1.1; }
.sm-gauge-desc { margin-top: 4px; font-size: .84rem; line-height: 1.5; color: #69788d; }

.sm-today { margin: 16px 24px 0; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start;
  background: linear-gradient(135deg, rgba(26,58,138,.07), rgba(26,58,138,.02));
  border: 1px solid rgba(26,58,138,.14); border-left: 3px solid #1a3a8a; border-radius: 12px; }
.sm-today-icon { flex-shrink: 0; margin-top: 1px; color: #1a3a8a; }
.sm-today-label { font-size: .62rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: #1a3a8a; margin-bottom: 4px; }
.sm-today-text { font-size: .92rem; line-height: 1.55; color: #37475e; }

/* staggered reveal */
.sm-reveal { opacity: 0; transform: translateY(12px);
  animation: smUp .55s cubic-bezier(.16,1,.3,1) forwards; animation-delay: var(--d,0s); }
@keyframes smUp { to { opacity: 1; transform: none; } }

@media (max-width: 380px) { .sm-ghost { display: none; } }
@media (prefers-reduced-motion: reduce) {
  #summaryModal, .sm-card, .sm-chip, .sm-close, .sm-fade { transition: none; }
  .sm-reveal { animation: none; opacity: 1; transform: none; }
  .sm-seg i { animation: none; transform: none; }
  .sm-trail path { animation: none; stroke-dashoffset: 0; }
  .sm-topo::before { animation: none; }
  .sm-pin { animation: none; opacity: 1; transform: none; }
  .sm-pin::after { animation: none; opacity: 0; }
  .sm-start { animation: none; opacity: 1; }
  .sm-fade svg { animation: none; }
}

/* =========================================
   15. NAVIGATION TIPS MODAL
   Formerly injected at runtime by showNavigationTips() in
   navigationTips.js via a <style id="navTipsStyles"> tag.
   That injection code has been removed from the JS; these rules
   now live here permanently instead.
   ========================================= */
#navTipsModal {
  position: fixed; inset: 0; z-index: 1000;
  box-sizing: border-box;
  padding: 24px 16px;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
           max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; min-height: 100dvh;
  background: rgba(7,15,33,.62);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .28s ease;
  font-family: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
#navTipsModal.is-open { opacity: 1; }
#navTipsModal * { box-sizing: border-box; }

.nt-card {
  width: 100%; max-width: 460px; margin: auto;
  max-height: min(88vh,720px); max-height: min(88dvh,720px);
  display: flex; flex-direction: column; overflow: hidden;
  background: #fbfcfe; border-radius: 20px; color: #33445c;
  box-shadow: 0 24px 60px -20px rgba(3,10,30,.5), 0 4px 14px -6px rgba(3,10,30,.28);
  transform: translateY(20px) scale(.97);
  transition: transform .5s cubic-bezier(.16,1,.3,1);
}
#navTipsModal.is-open .nt-card { transform: none; }

/* ---- header ---- */
.nt-header { position: relative; min-height: 128px; padding: 26px 24px 34px; color: #fff;
  background: linear-gradient(155deg,#0d2560 0%,#1a3a8a 55%,#2550ad 100%); }
.nt-topo { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.nt-topo::before { content: ''; position: absolute; inset: -28px;
  background:
    repeating-radial-gradient(circle at 88% -25%, transparent 0 30px, rgba(255,255,255,.06) 30px 32px),
    repeating-radial-gradient(circle at -12% 130%, transparent 0 26px, rgba(255,255,255,.04) 26px 28px);
  animation: ntDrift 38s ease-in-out infinite alternate; }
.nt-topo::after { content: ''; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 0% 0%, rgba(130,170,255,.24), transparent 55%); }
@keyframes ntDrift { to { transform: translate(-18px,-12px); } }

/* quiet compass watermark — one smooth settle, nothing else */
.nt-compass { position: absolute; right: 22px; bottom: 12px; z-index: 2; width: 54px; height: 54px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.2)); }
.nt-needle { transform-box: fill-box; transform-origin: center;
  animation: ntSettle 1.2s .6s cubic-bezier(.22,1,.36,1) both; }
@keyframes ntSettle { from { transform: rotate(-120deg); } to { transform: rotate(0); } }

.nt-close { position: absolute; top: 14px; right: 14px; z-index: 5;
  width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer;
  color: #fff; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.24);
  border-radius: 50%; transition: background .2s ease, transform .3s cubic-bezier(.34,1.56,.64,1); }
.nt-close:hover { background: rgba(255,255,255,.22); transform: rotate(90deg); }
.nt-close:active { background: rgba(255,255,255,.28); }
.nt-close:focus-visible { outline: 2px solid #86a5ff; outline-offset: 2px; }

.nt-eyebrow { position: relative; z-index: 3; display: flex; align-items: center; gap: 9px;
  margin-right: 40px; font-size: .58rem; font-weight: 800; letter-spacing: .2em;
  text-transform: uppercase; color: #a9c0f2; }
.nt-eyebrow::before { content: ''; width: 16px; height: 2px; border-radius: 2px; flex-shrink: 0; background: #5f83d9; }
.nt-title { position: relative; z-index: 3; margin: 10px 40px 0 0;
  font-family: 'Fraunces', Georgia, serif; font-weight: 600; letter-spacing: -.01em;
  font-size: clamp(1.35rem, 3.4vw + .5rem, 1.8rem); line-height: 1.12; text-wrap: balance; }

/* ---- body ---- */
.nt-scrollwrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.nt-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 22px 0 20px; -webkit-overflow-scrolling: touch; }
.nt-body::-webkit-scrollbar { width: 7px; }
.nt-body::-webkit-scrollbar-track { background: transparent; }
.nt-body::-webkit-scrollbar-thumb { background: #d7dfea; border-radius: 8px; }
.nt-body::-webkit-scrollbar-thumb:hover { background: #c3cee0; }

.nt-fade { position: absolute; left: 0; right: 0; bottom: 0; height: 44px; pointer-events: none;
  background: linear-gradient(180deg, rgba(251,252,254,0), #fbfcfe 78%);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 4px;
  opacity: 0; transition: opacity .3s ease; }
.nt-fade.is-visible { opacity: 1; }
.nt-fade svg { color: #95a3b6; animation: ntBob 1.6s ease-in-out infinite; }
@keyframes ntBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(3px); } }

.nt-lead { margin: 0 24px 14px; font-size: .94rem; line-height: 1.55; color: #69788d; }

.nt-tips { list-style: none; margin: 0; padding: 0 16px; display: flex; flex-direction: column; gap: 2px; }
.nt-tip { display: flex; align-items: flex-start; gap: 14px; padding: 11px 10px; border-radius: 12px;
  transition: background .2s ease, transform .2s cubic-bezier(.16,1,.3,1); }
.nt-tip:not(:last-child) { border-bottom: 1px solid #eef1f6; }
.nt-tip-icon { flex-shrink: 0; width: 38px; height: 38px; margin-top: 1px; border-radius: 11px; display: grid; place-items: center;
  background: rgba(26,58,138,.08); color: #1a3a8a;
  transition: background .2s ease, transform .2s cubic-bezier(.16,1,.3,1); }
.nt-tip-icon svg { width: 19px; height: 19px; }
.nt-tip-copy { display: flex; flex-direction: column; gap: 2px; padding-top: 2px; }
.nt-tip-title { font-size: .9rem; font-weight: 700; color: #243250; line-height: 1.4; }
.nt-tip-text { font-size: .87rem; line-height: 1.5; color: #69788d; }

/* Hover feedback only on devices with a real pointer (mouse/trackpad).
   On touch, :hover sticks after a tap until the user taps elsewhere,
   which read as a stuck/broken highlight — so touch gets its own
   :active state below instead, which releases cleanly on tap-up. */
@media (hover: hover) and (pointer: fine) {
  .nt-tip:hover { background: rgba(26,58,138,.05); transform: translateX(2px); }
  .nt-tip:hover .nt-tip-icon { background: rgba(26,58,138,.15); transform: scale(1.05); }
}
.nt-tip:active { background: rgba(26,58,138,.08); }
.nt-tip:active .nt-tip-icon { background: rgba(26,58,138,.18); transform: scale(1.05); }

/* staggered reveal */
.nt-reveal { opacity: 0; transform: translateY(12px);
  animation: ntUp .55s cubic-bezier(.16,1,.3,1) forwards; animation-delay: var(--d,0s); }
@keyframes ntUp { to { opacity: 1; transform: none; } }

@media (max-width: 380px) { .nt-compass { width: 44px; height: 44px; } }
@media (prefers-reduced-motion: reduce) {
  #navTipsModal, .nt-card, .nt-tip, .nt-tip-icon, .nt-close, .nt-fade { transition: none; }
  .nt-reveal { animation: none; opacity: 1; transform: none; }
  .nt-needle, .nt-topo::before { animation: none; }
  .nt-fade svg { animation: none; }
}

/* =========================================
   16. EXIT PROMPT & ACKNOWLEDGEMENTS MODALS
   Formerly injected at runtime by returnToIndex() in
   returnToIndex.js via a <style id="returnModalsStyles"> tag.
   That injection code has been removed from the JS; these rules
   now live here permanently instead.
   ========================================= */
/* ============ shared overlay base ============ */
#exitModal, #creditsModal {
  position: fixed; inset: 0; box-sizing: border-box;
  padding: 24px 16px;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
           max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; min-height: 100dvh;
  background: rgba(7,15,33,.62);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .28s ease;
  font-family: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
#exitModal { z-index: 1000; }
#creditsModal { z-index: 1001; background: rgba(7,15,33,.7); }
#exitModal.is-open, #creditsModal.is-open { opacity: 1; }
#exitModal *, #creditsModal * { box-sizing: border-box; }

.ex-card, .cr-card {
  width: 100%; margin: auto;
  max-height: min(88vh,720px); max-height: min(88dvh,720px);
  display: flex; flex-direction: column; overflow: hidden;
  background: #fbfcfe; border-radius: 20px; color: #33445c;
  box-shadow: 0 24px 60px -20px rgba(3,10,30,.5), 0 4px 14px -6px rgba(3,10,30,.28);
  transform: translateY(20px) scale(.97);
  transition: transform .5s cubic-bezier(.16,1,.3,1);
}
.ex-card { max-width: 400px; }
.cr-card { max-width: 460px; }
#exitModal.is-open .ex-card, #creditsModal.is-open .cr-card { transform: none; }

/* ============ blue topo header (shared look) ============ */
.ex-header, .cr-header { position: relative; color: #fff;
  background: linear-gradient(155deg,#0d2560 0%,#1a3a8a 55%,#2550ad 100%); }
.ex-topo, .cr-topo { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.ex-topo::before, .cr-topo::before { content: ''; position: absolute; inset: -28px;
  background:
    repeating-radial-gradient(circle at 88% -25%, transparent 0 30px, rgba(255,255,255,.06) 30px 32px),
    repeating-radial-gradient(circle at -12% 130%, transparent 0 26px, rgba(255,255,255,.04) 26px 28px);
  animation: rmDrift 38s ease-in-out infinite alternate; }
.ex-topo::after, .cr-topo::after { content: ''; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 0% 0%, rgba(130,170,255,.24), transparent 55%); }
@keyframes rmDrift { to { transform: translate(-18px,-12px); } }

/* ---- exit prompt: centered header ---- */
.ex-header { padding: 30px 24px 26px; text-align: center; }
.ex-icon { position: relative; z-index: 2; width: 54px; height: 54px; margin: 0 auto 14px;
  display: grid; place-items: center; border-radius: 50%; color: #fff;
  background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.28); }
.ex-icon svg { width: 26px; height: 26px; }
.ex-eyebrow { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-bottom: 8px; font-size: .58rem; font-weight: 800; letter-spacing: .22em;
  text-transform: uppercase; color: #a9c0f2; }
.ex-eyebrow::before, .ex-eyebrow::after { content: ''; width: 16px; height: 2px; border-radius: 2px; background: #5f83d9; }
.ex-title { position: relative; z-index: 2; margin: 0; font-family: 'Fraunces', Georgia, serif; font-weight: 600;
  font-size: clamp(1.4rem, 4vw + .5rem, 1.85rem); line-height: 1.1; letter-spacing: -.01em; text-wrap: balance; }

.ex-body { padding: 24px 26px 26px; text-align: center; overflow-y: auto; }
.ex-message { margin: 0 0 24px; color: #5c6c7c; line-height: 1.6; font-size: 1rem; }
.ex-actions { display: flex; gap: 12px; }
.ex-btn { flex: 1; padding: 13px 18px; border-radius: 12px; cursor: pointer;
  font: 700 .96rem/1 'Public Sans', system-ui, sans-serif;
  transition: background .2s ease, transform .15s ease, box-shadow .2s ease, border-color .2s ease, filter .2s ease;
  touch-action: manipulation; user-select: none; -webkit-tap-highlight-color: transparent; }
.ex-btn:active { transform: scale(.97); }
.ex-btn:focus-visible { outline: 2px solid #86a5ff; outline-offset: 2px; }
.ex-primary { color: #fff; border: none;
  background: linear-gradient(135deg,#1a3a8a,#2550ad);
  box-shadow: 0 10px 22px -10px rgba(26,58,138,.55); }
.ex-primary:hover { transform: translateY(-1px); filter: brightness(1.06);
  box-shadow: 0 14px 26px -10px rgba(26,58,138,.6); }
.ex-secondary { background: transparent; color: #1a3a8a; border: 1.5px solid rgba(26,58,138,.35); }
.ex-secondary:hover { background: rgba(26,58,138,.06); border-color: #1a3a8a; transform: translateY(-1px); }
.ex-credits { display: inline-flex; align-items: center; margin-top: 20px; padding: 8px 18px;
  border-radius: 999px; border: 1px solid rgba(100,116,139,.22); background: rgba(100,116,139,.05);
  color: #64748b; font: 600 .85rem/1 'Public Sans', system-ui, sans-serif; cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease; }
.ex-credits:hover { background: rgba(100,116,139,.1); border-color: rgba(100,116,139,.35); color: #475569; }
.ex-credits:focus-visible { outline: 2px solid #86a5ff; outline-offset: 2px; }
@media (max-width: 380px) { .ex-actions { flex-direction: column; } }

/* ---- acknowledgements: content header (matches tips) ---- */
.cr-header { min-height: 120px; padding: 26px 24px 34px; }
.cr-medal { position: absolute; right: 22px; bottom: 14px; z-index: 2; width: 52px; height: 52px;
  color: #fff; opacity: .9; filter: drop-shadow(0 4px 6px rgba(0,0,0,.2)); }
.cr-close { position: absolute; top: 14px; right: 14px; z-index: 5;
  width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer;
  color: #fff; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.24);
  border-radius: 50%; transition: background .2s ease, transform .3s cubic-bezier(.34,1.56,.64,1); }
.cr-close:hover { background: rgba(255,255,255,.22); transform: rotate(90deg); }
.cr-close:focus-visible { outline: 2px solid #86a5ff; outline-offset: 2px; }
.cr-eyebrow { position: relative; z-index: 3; display: flex; align-items: center; gap: 9px;
  margin-right: 40px; font-size: .58rem; font-weight: 800; letter-spacing: .2em;
  text-transform: uppercase; color: #a9c0f2; }
.cr-eyebrow::before { content: ''; width: 16px; height: 2px; border-radius: 2px; flex-shrink: 0; background: #5f83d9; }
.cr-title { position: relative; z-index: 3; margin: 10px 40px 0 0;
  font-family: 'Fraunces', Georgia, serif; font-weight: 600; letter-spacing: -.01em;
  font-size: clamp(1.35rem, 3.4vw + .5rem, 1.8rem); line-height: 1.12; text-wrap: balance; }

.cr-scrollwrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cr-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 22px 0 20px; -webkit-overflow-scrolling: touch; }
.cr-body::-webkit-scrollbar { width: 7px; }
.cr-body::-webkit-scrollbar-track { background: transparent; }
.cr-body::-webkit-scrollbar-thumb { background: #d7dfea; border-radius: 8px; }
.cr-body::-webkit-scrollbar-thumb:hover { background: #c3cee0; }
.cr-fade { position: absolute; left: 0; right: 0; bottom: 0; height: 44px; pointer-events: none;
  background: linear-gradient(180deg, rgba(251,252,254,0), #fbfcfe 78%);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 4px;
  opacity: 0; transition: opacity .3s ease; }
.cr-fade.is-visible { opacity: 1; }
.cr-fade svg { color: #95a3b6; animation: crBob 1.6s ease-in-out infinite; }
@keyframes crBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(3px); } }

.cr-list { list-style: none; margin: 0; padding: 0 16px; display: flex; flex-direction: column; gap: 2px; }
.cr-item { display: flex; align-items: flex-start; gap: 14px; padding: 13px 10px; border-radius: 12px;
  transition: background .2s ease, transform .2s cubic-bezier(.16,1,.3,1); }
.cr-item:not(:last-child) { border-bottom: 1px solid #eef1f6; }
.cr-item:hover { background: rgba(26,58,138,.05); transform: translateX(2px); }
.cr-badge { flex-shrink: 0; width: 42px; height: 42px; margin-top: 1px; border-radius: 11px; display: grid; place-items: center;
  background: rgba(26,58,138,.08); color: #1a3a8a;
  font-family: 'Fraunces', Georgia, serif; font-weight: 700; font-size: .78rem; letter-spacing: .02em;
  transition: background .2s ease, transform .2s cubic-bezier(.16,1,.3,1); }
.cr-item:hover .cr-badge { background: rgba(26,58,138,.15); transform: scale(1.05); }
.cr-meta { padding-top: 1px; }
.cr-link { display: inline-flex; align-items: center; gap: 5px; color: #1a3a8a; font-weight: 700;
  font-size: .96rem; text-decoration: none; }
.cr-link:hover { text-decoration: underline; }
.cr-link:focus-visible { outline: 2px solid #86a5ff; outline-offset: 2px; border-radius: 4px; }
.cr-link svg { color: #8593a8; flex-shrink: 0; transition: transform .2s ease, color .2s ease; }
.cr-item:hover .cr-link svg { transform: translate(2px,-2px); color: #1a3a8a; }
.cr-plainname { color: #1f2d40; font-weight: 700; font-size: .96rem; }
.cr-desc { margin: 3px 0 0; color: #69788d; font-size: .87rem; line-height: 1.5; }

/* staggered reveal (shared) */
.ex-reveal, .cr-reveal { opacity: 0; transform: translateY(12px);
  animation: rmUp .55s cubic-bezier(.16,1,.3,1) forwards; animation-delay: var(--d,0s); }
@keyframes rmUp { to { opacity: 1; transform: none; } }

@media (max-width: 380px) { .cr-medal { width: 44px; height: 44px; } }
@media (prefers-reduced-motion: reduce) {
  #exitModal, #creditsModal, .ex-card, .cr-card, .ex-btn, .ex-credits,
  .cr-close, .cr-item, .cr-badge, .cr-link svg, .cr-fade { transition: none; }
  .ex-reveal, .cr-reveal { animation: none; opacity: 1; transform: none; }
  .ex-topo::before, .cr-topo::before { animation: none; }
  .cr-fade svg { animation: none; }
}
