/* Route 1 Guide — Styles */
:root {
  --ocean: #1a6b8a;
  --ocean-dark: #0d4f68;
  --ocean-light: #4a9eba;
  --sand: #f5e6c8;
  --sand-dark: #e8d4a8;
  --cliff: #8b6f47;
  --sage: #6b8c6b;
  --sage-light: #a8c5a0;
  --fog: #e8eef2;
  --text: #1a1a2e;
  --text-light: #4a4a6a;
  --white: #ffffff;
  --card-bg: #ffffff;
  --border: #d8e4ea;
  --warning: #c0392b;
  --warning-bg: #fdf0ee;
  --success: #27ae60;
  --tag-bg: #e8f4f8;
  --tag-text: #1a6b8a;
  --shadow: 0 2px 12px rgba(26,107,138,0.12);
  --shadow-lg: 0 4px 24px rgba(26,107,138,0.18);
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

:root {
  --surface: #ffffff;
  --surface-raised: #f5f8fa;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: #fff;
  color: var(--text);
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

/* === HEADER === */
#app-header {
  background: linear-gradient(135deg, var(--ocean-dark) 0%, var(--ocean) 60%, var(--ocean-light) 100%);
  color: white;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.2);
}

.header-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
}

.header-top > div { flex: 1; min-width: 0; }

.header-top h1 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.header-top .subtitle {
  font-size: 0.72rem;
  opacity: 0.8;
  font-weight: 400;
}

.route-sign {
  flex-shrink: 0;
  width: 38px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.4));
}

.hero-banner-wrap {
  margin: 0 -16px 0;
  padding: 12px 8px 8px;
  background: white;
}

.hero-banner-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.hero-banner-nav::-webkit-scrollbar { display: none; }

.hero-banner-btn {
  flex-shrink: 0;
  width: 88px;
  scroll-snap-align: start;
  background: white;
  border: 2px solid #e8edf0;
  border-radius: 12px;
  cursor: pointer;
  padding: 10px 4px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.hero-btn-graphic {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.hero-btn-label {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.2;
  color: #2c3e50;
}

.hero-banner-btn[data-tab="poi"]    .hero-btn-label { color: #1a6b5a; }
.hero-banner-btn[data-tab="nature"] .hero-btn-label { color: #2d7a2d; }
.hero-banner-btn[data-tab="map"]    .hero-btn-label { color: #1a5f8a; }
.hero-banner-btn[data-tab="tips"]   .hero-btn-label { color: #c47b00; }

.hero-banner-btn:active {
  background: #f5f8fa;
}

.hero-banner-btn.banner-active {
  border-color: currentColor;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.hero-banner-btn[data-tab="poi"].banner-active    { border-color: #1a6b5a; }
.hero-banner-btn[data-tab="nature"].banner-active { border-color: #2d7a2d; }
.hero-banner-btn[data-tab="map"].banner-active    { border-color: #1a5f8a; }
.hero-banner-btn[data-tab="tips"].banner-active   { border-color: #c47b00; }

.offline-badge {
  margin-left: auto;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  padding: 3px 8px;
  font-size: 0.65rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.03em;
}

/* === NAV TABS === */
/* tab-btn kept minimal — nav replaced by hero banner */
.tab-btn { display: none; }

/* === MAIN CONTENT === */
#main-content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 24px;
  min-height: 0;
}

/* Map-active state: flex column so the map fills all remaining space */
#main-content.map-active {
  overflow: hidden;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
}

#main-content.map-active #tab-poi {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

#main-content.map-active .poi-list-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

#main-content.map-active #poi-map-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

/* Detail view overlays the map without hiding it */
#main-content.map-active .poi-detail-view {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: white;
  overflow-y: auto;
  display: none;
  flex-direction: column;
}
#main-content.map-active .poi-detail-view.open {
  display: flex;
}

/* Nature map-active state */
#main-content.nature-map-active {
  overflow: hidden;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
}

#main-content.nature-map-active #tab-nature {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#main-content.nature-map-active #nature-map-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Amenity map-active state */
#main-content.amen-map-active {
  overflow: hidden;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
}

#main-content.amen-map-active #tab-map {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#main-content.amen-map-active #amen-map-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.2s ease;
}

.tab-panel.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === HERO SECTION === */
.hero {
  background: linear-gradient(180deg, var(--ocean) 0%, var(--ocean-dark) 100%);
  color: white;
  padding: 24px 16px 20px;
  text-align: center;
}

.hero h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.hero p {
  font-size: 0.85rem;
  opacity: 0.85;
  line-height: 1.5;
  max-width: 340px;
  margin: 0 auto 16px;
}

.hero-stats {
  display: flex;
  gap: 0;
  justify-content: center;
  border-top: 1px solid rgba(255,255,255,0.2);
  padding-top: 14px;
}

.hero-stat {
  flex: 1;
  text-align: center;
  padding: 0 8px;
  border-right: 1px solid rgba(255,255,255,0.2);
}

.hero-stat:last-child { border-right: none; }

.hero-stat .val {
  font-size: 1.3rem;
  font-weight: 800;
  display: block;
}

.hero-stat .lbl {
  font-size: 0.65rem;
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* === SEARCH BAR === */
.search-bar {
  padding: 12px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.search-input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--fog) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%234a4a6a' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.868-3.834zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E") no-repeat 12px center;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus { border-color: var(--ocean); }

/* === SECTION HEADERS === */
.section-header {
  padding: 16px 16px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-light);
}

/* === POI CARDS === */
.poi-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.poi-card {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  overflow: hidden;
}

.poi-card:first-child { border-top: 1px solid var(--border); }

.poi-card:active { background: var(--fog); }

.poi-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px 10px;
}

.poi-emoji {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--fog);
  border-radius: 10px;
  color: var(--ocean);
}
.poi-emoji svg { width: 26px; height: 26px; }

.poi-thumb {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 10px;
}

/* Category-tinted icon backgrounds */
.poi-emoji.cat-viewpoint  { background: rgba(22,160,133,.12);  color: #16a085; }
.poi-emoji.cat-landmark   { background: rgba(139,69,19,.12);   color: #8b4513; }
.poi-emoji.cat-beach      { background: rgba(41,128,185,.12);  color: #2980b9; }
.poi-emoji.cat-historic   { background: rgba(125,60,152,.12);  color: #7d3c98; }
.poi-emoji.cat-hiking     { background: rgba(39,174,96,.12);   color: #27ae60; }
.poi-emoji.cat-park       { background: rgba(39,174,96,.12);   color: #27ae60; }
.poi-emoji.cat-wildlife   { background: rgba(230,126,34,.12);  color: #e67e22; }
.poi-emoji.cat-town       { background: rgba(192,57,43,.12);   color: #c0392b; }

.map-card-emoji { color: var(--ocean); }
.map-card-emoji.cat-viewpoint  { color: #16a085; }
.map-card-emoji.cat-landmark   { color: #8b4513; }
.map-card-emoji.cat-beach      { color: #2980b9; }
.map-card-emoji.cat-historic   { color: #7d3c98; }
.map-card-emoji.cat-hiking     { color: #27ae60; }
.map-card-emoji.cat-park       { color: #27ae60; }
.map-card-emoji.cat-wildlife   { color: #e67e22; }
.map-card-emoji.cat-town       { color: #c0392b; }

.poi-info { flex: 1; min-width: 0; }

.poi-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 2px;
}

.poi-miles {
  font-size: 0.72rem;
  color: var(--ocean);
  font-weight: 600;
  margin-bottom: 4px;
}

.poi-summary {
  font-size: 0.8rem;
  color: var(--text-light);
  line-height: 1.4;
}

.poi-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 16px 12px;
}

.tag {
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: capitalize;
}

.amenity-row {
  display: flex;
  gap: 10px;
  padding: 0 16px 12px;
}

.amenity-dot {
  font-size: 0.75rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 3px;
}

.amenity-dot.yes { color: var(--success); }
.amenity-dot.no { color: var(--border); text-decoration: line-through; }

/* === POI DETAIL VIEW === */
#detail-view {
  display: none;
  flex-direction: column;
  min-height: 100%;
}

#detail-view.active { display: flex; }

.detail-header {
  background: var(--white);
  color: var(--text);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.detail-header-text { flex: 1; min-width: 0; }
.detail-header-map-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent, #1a6b8a);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: inherit;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.detail-header-map-btn:active { opacity: 0.8; }

.back-btn {
  background: var(--fog);
  border: none;
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: background 0.15s;
}

.back-btn:active { background: var(--border); }

.detail-title-row { display: flex; align-items: center; gap: 8px; }
.detail-title { font-size: 1.05rem; font-weight: 700; line-height: 1.3; flex: 1; min-width: 0; }

.speak-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 4px 6px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ocean);
  opacity: 0.7;
  transition: opacity 0.15s, background 0.15s;
  display: flex;
  align-items: center;
}
.speak-btn:hover, .speak-btn:active { opacity: 1; background: var(--fog); }
.detail-subtitle { font-size: 0.78rem; color: var(--text-light); margin-top: 2px; }

.detail-photo { width: 100%; max-height: 286px; object-fit: cover; display: block; }

.detail-body { padding: 16px; display: flex; flex-direction: column; gap: 16px; }

.detail-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ocean);
  margin-bottom: 6px;
}

.detail-description {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text);
}
.detail-description p { margin: 0 0 0.85em; }
.detail-description p:last-child { margin-bottom: 0; }

.tips-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tip-item {
  display: flex;
  gap: 8px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text);
}

.tip-item::before {
  content: '→';
  color: var(--ocean);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.amenities-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.amenity-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
}

.amenity-chip.yes { background: #e8f5e9; color: #2e7d32; }
.amenity-chip.no { background: var(--fog); color: var(--text-light); }

/* === MAP TAB === */
.map-container {
  padding: 0;
}

.map-legend {
  display: flex;
  gap: 12px;
  padding: 10px 16px;
  background: white;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.map-legend::-webkit-scrollbar { display: none; }

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  color: var(--text-light);
  white-space: nowrap;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  transition: all 0.15s;
}

.legend-item.active {
  border-color: var(--ocean);
  color: var(--ocean);
  background: var(--tag-bg);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Route map SVG */
#route-map-svg {
  width: 100%;
  display: block;
  background: #d4e9f7;
}

.amenity-list-items {
  padding: 0 0 8px;
}

.amenity-group { margin-bottom: 4px; }

.amenity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  background: white;
}

.amenity-icon { flex-shrink: 0; margin-top: 1px; color: var(--ocean); }
.amenity-icon svg { width: 22px; height: 22px; }

.amenity-thumb {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 10px;
}
.section-header svg { width: 18px; height: 18px; vertical-align: middle; margin-right: 4px; }

.amenity-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.amenity-note {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 2px;
  line-height: 1.4;
}

.warning-item {
  background: var(--warning-bg);
  border-left: 3px solid var(--warning);
  margin: 8px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 12px;
}

.warning-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--warning);
}

.warning-text {
  font-size: 0.8rem;
  color: #7f1c1c;
  margin-top: 3px;
  line-height: 1.4;
}

/* === NATURE TAB === */
.nature-tabs {
  display: flex;
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: var(--section-header-h, 54px);
  z-index: 5;
}

.nature-tab {
  flex: 1;
  padding: 10px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.15s;
}

.nature-tab.active {
  color: var(--ocean);
  border-bottom-color: var(--ocean);
}

.nature-card {
  background: white;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.nature-card:first-child { border-top: 1px solid var(--border); }

.nature-card:active { background: var(--fog); }

.nature-card-inner {
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.nature-emoji {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--fog);
  border-radius: 10px;
  flex-shrink: 0;
  color: #27ae60;
}
.nature-emoji svg { width: 26px; height: 26px; }

.nature-thumb {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 10px;
}

.nature-info { flex: 1; }

.nature-name {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.nature-scientific {
  font-size: 0.72rem;
  color: var(--text-light);
  font-style: italic;
  margin-bottom: 4px;
}

.nature-range {
  font-size: 0.78rem;
  color: var(--ocean);
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 4px;
}

.nature-status {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--tag-bg);
  color: var(--tag-text);
}

.nature-status.threatened { background: #fff3e0; color: #e65100; }
.nature-status.endangered { background: #fce4ec; color: #b71c1c; }
.nature-status.recovering { background: #e8f5e9; color: #1b5e20; }
.nature-status.invasive { background: #fce4ec; color: #b71c1c; }

/* Nature detail additions */
.nature-where, .nature-season, .nature-tip {
  background: var(--fog);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.nature-where-label, .nature-season-label, .nature-tip-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ocean);
  margin-bottom: 3px;
}

.nature-where-text, .nature-season-text, .nature-tip-text {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text);
}

/* === TIPS TAB === */
.tips-section {
  background: white;
  border-radius: var(--radius);
  margin: 12px 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.tips-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  background: white;
  border: none;
  width: 100%;
  text-align: left;
  transition: background 0.15s;
  border-bottom: 1px solid transparent;
}

.tips-section-header:active { background: var(--fog); }

.tips-section-header.open { border-bottom-color: var(--border); }

.tips-icon { display: inline-flex; align-items: center; }
.tips-icon svg { width: 22px; height: 22px; }

.tips-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  flex: 1;
}

.tips-chevron {
  font-size: 0.75rem;
  color: var(--text-light);
  transition: transform 0.2s;
}

.tips-section-header.open .tips-chevron { transform: rotate(180deg); }

.tips-section-body {
  display: none;
  padding: 12px 16px 14px;
}

.tips-section-body.open { display: block; }

.tips-section-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tips-section-list li {
  font-size: 0.83rem;
  line-height: 1.6;
  color: var(--text);
  padding-left: 14px;
  position: relative;
}

.tips-section-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--ocean);
  font-weight: 700;
}

/* === VIEW TOGGLE === */
.view-toggle-bar {
  display: flex;
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 10px 16px 8px;
  gap: 8px;
}

.view-toggle-btn {
  flex: 1;
  padding: 7px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--text-light);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.view-toggle-btn.active {
  background: var(--ocean);
  border-color: var(--ocean);
  color: white;
}

/* === MAPBOX MAP === */

#mapbox-map {
  width: 100%;
  flex: 1;
  min-height: 0;
}

/* Follow Me button */
.map-track-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 20;
  background: white;
  color: var(--ocean);
  border: 2px solid var(--ocean);
  border-radius: 24px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.map-track-btn.active {
  background: var(--ocean);
  color: white;
}

/* User location dot */
#user-location-dot {
  position: relative;
  width: 22px;
  height: 22px;
}

.user-dot-pulse {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: rgba(41, 128, 185, 0.25);
  animation: pulse-ring 2s ease-out infinite;
}

.user-dot-core {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: #2980b9;
  border: 2.5px solid white;
  box-shadow: 0 2px 8px rgba(41,128,185,0.6);
}

.user-dot-arrow {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 10px solid #2980b9;
  transform-origin: 50% calc(100% + 11px);
}

@keyframes pulse-ring {
  0%   { transform: scale(0.6); opacity: 0.8; }
  70%  { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* Mapbox POI marker SVG sizing */
.mbx-poi-marker svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
}

/* Keep old zoom controls style in case referenced elsewhere */
/* === INTERACTIVE MAP (legacy) === */
.map-zoom-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 10;
}

.zoom-btn {
  width: 36px;
  height: 36px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  color: var(--text);
  transition: background 0.15s;
  line-height: 1;
}

.zoom-reset { font-size: 0.85rem; }

.zoom-btn:active { background: var(--fog); }

.map-info-card {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.18);
  z-index: 20;
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.map-info-card-inner {
  padding: 6px 16px 16px;
}

.map-info-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
}

.map-card-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 12px;
}

.map-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.map-card-emoji {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--fog);
  border-radius: 10px;
  flex-shrink: 0;
}
.map-card-emoji svg { width: 26px; height: 26px; }

.map-card-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.map-card-miles {
  font-size: 0.75rem;
  color: var(--ocean);
  font-weight: 600;
  margin-top: 2px;
}

.map-card-summary {
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.45;
  margin-bottom: 12px;
}

.map-card-actions {
  display: flex;
  gap: 8px;
}

.map-card-btn {
  flex: 1;
  padding: 9px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}

.map-card-btn:active { opacity: 0.75; }

.map-card-btn.primary {
  background: var(--ocean);
  color: white;
}

.map-card-btn.secondary {
  background: var(--fog);
  color: var(--text);
  border: 1px solid var(--border);
}

/* Map marker styles (SVG embedded) */
.map-marker-pulse {
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; r: 8; }
  50% { opacity: 0.6; r: 11; }
}

/* === FILTER CHIPS === */
.filter-row {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  background: white;
  border-bottom: 1px solid var(--border);
}

.filter-row::-webkit-scrollbar { display: none; }

.filter-chip {
  flex-shrink: 0;
  padding: 5px 12px;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 600;
  background: white;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.15s;
}

.filter-chip.active {
  background: var(--ocean);
  border-color: var(--ocean);
  color: white;
}

/* === INSTALL BANNER === */
#install-banner {
  display: none;
  background: linear-gradient(135deg, var(--ocean-dark), var(--ocean));
  color: white;
  padding: 12px 16px;
  align-items: center;
  gap: 10px;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  z-index: 200;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
}

#install-banner p { font-size: 0.82rem; flex: 1; line-height: 1.3; }

.install-btn {
  background: white;
  color: var(--ocean-dark);
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.dismiss-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 2px;
  flex-shrink: 0;
}

/* === EMPTY STATE === */
.empty-state {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-light);
}

.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { font-size: 0.9rem; line-height: 1.5; }

/* === RESPONSIVE === */
@media (min-width: 480px) {
  body {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
  }

  #install-banner { border-radius: 0 0 var(--radius) var(--radius); }
}

/* Print */
@media print {
  #nav-tabs, #install-banner, .back-btn { display: none !important; }
}

/* ── Photo carousel ──────────────────────────────────────────────────────── */
.carousel {
  position: relative;
  overflow: hidden;
  width: 100%;
  background: #000;
  max-height: 338px;
}
.carousel-track {
  display: flex;
  transition: transform 0.3s ease;
  will-change: transform;
}
.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  max-height: 338px;
  object-fit: cover;
  display: block;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.45);
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 2;
}
.carousel-btn:hover { background: rgba(0,0,0,0.65); }
.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }
.carousel-dots {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 2;
}
.carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: background 0.2s;
}
.carousel-dot.active { background: #fff; }

/* ── Photo carousel (detail views) ──────────────────────────────────────── */
.photo-carousel { position: relative; width: 100%; overflow: hidden; }
.photo-carousel .carousel-img { width: 100%; max-height: 286px; object-fit: cover; display: none; }
.photo-carousel .carousel-img.active { display: block; }
.photo-carousel .carousel-dots { display: flex; justify-content: center; gap: 6px; padding: 6px 0 2px; }
.carousel-prev, .carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.45);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  padding: 0;
}
.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }

/* Overlay bar: caption (left) + credit (right) on top of photo */
.carousel-overlay-bar, .photo-overlay-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  align-items: flex-end;
  padding: 20px 10px 6px;
  background: linear-gradient(to top, rgba(0,0,0,0.52) 0%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}
.photo-overlay-bar { position: absolute; border-radius: 0; }
.single-photo-wrap { position: relative; display: block; }
.single-photo-wrap .detail-photo { display: block; width: 100%; }
.carousel-caption, .photo-caption-text {
  font-size: 12px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  flex: 1;
  pointer-events: none;
}

/* Photo credit link below photos */
.photo-credit-bar {
  display: flex;
  justify-content: flex-end;
  padding: 4px 10px 0;
}
.photo-credit-link {
  font-size: 11px;
  color: var(--text-secondary, #888);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.photo-credit-link:hover { color: var(--primary); }

/* Photo rights modal */
.photo-rights-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.photo-rights-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}
.photo-rights-box {
  position: relative;
  background: var(--card-bg, #fff);
  border-radius: 14px;
  padding: 20px 22px 22px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
}
.photo-rights-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--text-primary, #111);
}
.photo-rights-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none; border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-secondary, #888);
  line-height: 1;
}
.pr-row {
  display: flex;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border, #eee);
  font-size: 0.85rem;
  line-height: 1.4;
}
.pr-row:last-child { border-bottom: none; }
.pr-label {
  color: var(--text-secondary, #888);
  flex: 0 0 130px;
  font-weight: 500;
}
.pr-val {
  color: var(--text-primary, #111);
  flex: 1;
  word-break: break-word;
}
.pr-val a { color: var(--primary); text-decoration: underline; }
.pr-unaltered { margin: 12px 0 0; font-size: 0.78rem; color: var(--text-muted); text-align: center; }

/* ── Map header button ────────────────────────────────────────────────────── */
.map-header-btn { background: none; border: none; font-size: 1.3rem; cursor: pointer; padding: 4px; line-height: 1; margin-left: auto; flex-shrink: 0; }
.btn-find-on-map { display: block; margin: 16px auto 0; background: var(--primary); color: #fff; border: none; border-radius: 20px; padding: 10px 24px; font-size: 0.95rem; font-weight: 600; cursor: pointer; }

/* ── POI Highlights ──────────────────────────────────────────────────────── */
.highlights-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.highlight-item {
  font-size: 0.9rem;
  color: var(--ocean-dark);
  font-weight: 500;
  padding: 6px 10px;
  background: var(--tag-bg);
  border-radius: 8px;
  line-height: 1.4;
}

/* ── Nearest POI banner (Follow Me mode) ────────────────────────────────── */
.poi-nearby-banner {
  position: absolute;
  bottom: 16px;
  left: 12px;
  right: 12px;
  background: white;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.22);
  padding: 0;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  cursor: pointer;
  z-index: 10;
  overflow: hidden;
  transform: translateY(120%);
  transition: transform 0.35s cubic-bezier(0.34, 1.26, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
}
.poi-nearby-banner.visible {
  transform: translateY(0);
}
.poi-nearby-banner:active {
  background: var(--fog);
}
.poi-nearby-photo {
  width: 80px;
  flex-shrink: 0;
  object-fit: cover;
  display: block;
}
.poi-nearby-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
  padding: 12px 12px;
  justify-content: center;
}
.poi-nearby-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ocean);
}
.poi-nearby-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.poi-nearby-meta {
  font-size: 0.75rem;
  color: var(--text-light);
  display: flex;
  gap: 5px;
  align-items: center;
}
.poi-nearby-dot { opacity: 0.4; }
.poi-nearby-arrow {
  font-size: 1.4rem;
  color: var(--ocean);
  flex-shrink: 0;
  padding-right: 14px;
  font-weight: 300;
  display: flex;
  align-items: center;
}

/* ── Language switcher ───────────────────────────────────────────────────── */
/* ── Narrator button ── */
.narrator-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  color: rgba(255,255,255,0.75);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.narrator-btn .narrator-wave { opacity: 0.35; }
.narrator-btn.narrator-on {
  background: rgba(255,255,255,0.9);
  border-color: transparent;
  color: var(--ocean-dark);
}
.narrator-btn.narrator-on .narrator-wave { opacity: 1; }
/* pulse animation when on */
@keyframes narrator-pulse { 0%,100% { opacity:1 } 50% { opacity:0.55 } }
.narrator-btn.narrator-on svg { animation: narrator-pulse 2.4s ease-in-out infinite; }

.hamburger-btn {
  margin-left: 0;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}
.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: white;
  border-radius: 2px;
}
.hamburger-menu {
  background: white;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255,255,255,0.15);
  margin: 0 -16px;
}
.hamburger-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a9bab;
  margin-bottom: 8px;
}
.hamburger-lang {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lang-btn {
  background: #f0f4f7;
  border: none;
  color: #2c3e50;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.15s;
  width: 100%;
}
.lang-btn.active {
  background: #1a6b8a;
  color: white;
}
.hamburger-divider {
  border-top: 1px solid #e8edf0;
  margin: 12px 0;
}
.hamburger-link {
  display: block;
  width: 100%;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1a6b8a;
  text-decoration: none;
  padding: 6px 0;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
}


/* ── Legends & Lore ─────────────────────────────────────────────────────── */
.hero-banner-btn--lore .hero-btn-label { color: #6b21a8; }
.hero-btn-graphic--emoji {
  width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
}
.lore-list { padding: 8px 16px 80px; }
.lore-card {
  background: white; border: 1px solid var(--border); border-radius: 12px;
  margin-bottom: 12px; padding: 14px; cursor: pointer; position: relative;
  transition: box-shadow 0.15s, transform 0.1s;
}
.lore-card:active { transform: scale(0.98); }
.lore-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.lore-card-inner { display: flex; gap: 12px; align-items: flex-start; }
.lore-emoji { font-size: 2rem; line-height: 1; flex-shrink: 0; width: 40px; text-align: center; padding-top: 2px; }
.lore-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
.lore-info { flex: 1; min-width: 0; }
.lore-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.lore-category {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: #7d3c98; margin-bottom: 6px;
}
.lore-summary { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.45; }
/* Detail */
.lore-detail-view .detail-photo,
.lore-detail-view .carousel-img { max-height: none; }
.lore-detail-emoji { font-size: 4rem; text-align: center; padding: 32px 16px 16px; }
.lore-detail-category {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: #7d3c98; margin-bottom: 6px;
}
.lore-story {
  font-size: 0.92rem; line-height: 1.7; color: var(--text-primary);
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--border);
}
.lore-location { font-size: 0.82rem; color: var(--text-secondary); margin-top: 14px; }
/* Lore map active */
.lore-map-active { overflow: hidden; }
.lore-map-active #tab-lore { height: 100%; display: flex; flex-direction: column; }

/* ── Premium / IAP ──────────────────────────────────────────────────────── */
.premium-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: #92400e;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #f59e0b; border-radius: 4px;
  padding: 2px 6px; margin-bottom: 4px; pointer-events: none;
}
.is-premium-locked { position: relative; opacity: 0.78; cursor: pointer; }
.is-premium-locked::after {
  content: '🔒'; position: absolute; top: 8px; right: 10px;
  font-size: 1rem; pointer-events: none;
}
.premium-lock-tip {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; background: #fffbeb;
  border-top: 1px solid #fde68a; font-size: 0.82rem; color: #78350f;
}
.premium-unlock-btn {
  flex-shrink: 0;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white; border: none; border-radius: 6px;
  padding: 6px 14px; font-size: 0.8rem; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
/* Upgrade modal */
.premium-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  z-index: 9000; display: flex; align-items: flex-end; justify-content: center;
}
.premium-modal {
  background: white; border-radius: 20px 20px 0 0;
  padding: 28px 24px 40px; width: 100%; max-width: 480px;
  text-align: center; animation: slideUp 0.25s ease;
}
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.premium-modal-icon { font-size: 2.5rem; margin-bottom: 10px; }
.premium-modal h2, .premium-modal-title {
  font-size: 1.2rem; font-weight: 800; margin: 0 0 8px; color: #1a1a2e;
}
.premium-modal p, .premium-modal-desc {
  font-size: 0.88rem; color: #555; margin: 0 0 12px; line-height: 1.5;
}
.premium-modal-features {
  list-style: none; padding: 0; margin: 0 0 20px;
  text-align: left; font-size: 0.85rem; color: #333;
}
.premium-modal-features li { padding: 4px 0; }
.premium-modal-buy, .premium-modal-cta {
  display: block; width: 100%;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white; border: none; border-radius: 12px;
  padding: 14px; font-size: 1rem; font-weight: 800;
  cursor: pointer; font-family: inherit; margin-bottom: 10px;
}
.premium-modal-close, .premium-modal-dismiss {
  background: none; border: none; color: #888;
  font-size: 0.85rem; cursor: pointer; font-family: inherit; padding: 6px;
}

/* ── Find on Map button ─────────────────────────────────────────────────── */
.find-on-map-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent, #1a6b8a);
  color: white;
  text-decoration: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: inherit;
  transition: opacity 0.15s;
}
.find-on-map-btn:active { opacity: 0.8; }

/* ── Lore emoji hero (no image) ─────────────────────────────────────────── */
.lore-detail-emoji-hero {
  font-size: 5rem;
  text-align: center;
  padding: 28px 16px 8px;
  background: #f8f4ff;
  border-bottom: 1px solid var(--border);
}

/* ── Games nav button ───────────────────────────────────────────────────── */
.hero-banner-btn[data-tab="games"] .hero-btn-label { color: #b45309; }
.hero-banner-btn[data-tab="games"].banner-active   { border-color: #b45309; }

/* ── Scavenger Hunt ─────────────────────────────────────────────────────── */
.hunt-score-bar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 14px 16px 10px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.hunt-badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.hunt-badge-icon { font-size: 2rem; line-height: 1; flex-shrink: 0; }
.hunt-badge-info { flex: 1; min-width: 0; }
.hunt-badge-label { font-size: 1rem; font-weight: 800; line-height: 1.2; }
.hunt-badge-sub { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }
.hunt-pts-big {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
  flex-shrink: 0;
}
.hunt-pts-max { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); }
.hunt-progress-track {
  height: 8px;
  background: #e8edf0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}
.hunt-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.hunt-next-badge {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Groups */
.hunt-list { padding: 8px 0 80px; }
.hunt-group { margin-bottom: 4px; }
.hunt-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 6px;
  background: #f8fafc;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.hunt-diff-dots { font-size: 0.7rem; letter-spacing: -1px; }
.hunt-group-label { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; flex: 1; }
.hunt-group-count { font-size: 0.72rem; color: var(--text-secondary); font-weight: 600; }

/* Items */
.hunt-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: white;
  transition: background 0.15s;
}
.hunt-item--done { background: #f0fdf4; }
.hunt-item--done .hunt-item-name { text-decoration: line-through; color: var(--text-secondary); }
.hunt-item--done .hunt-item-desc,
.hunt-item--done .hunt-item-hint { opacity: 0.5; }

.hunt-check {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  background: white;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  transition: background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.hunt-check.checked {
  background: #16a34a;
  border-color: #16a34a;
}

.hunt-item-body { flex: 1; min-width: 0; }
.hunt-item-top {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
}
.hunt-item-emoji { font-size: 1.1rem; flex-shrink: 0; }
.hunt-item-name  { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); flex: 1; }
.hunt-item-pts   { font-size: 0.78rem; font-weight: 800; flex-shrink: 0; }
.hunt-item-desc  { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.4; margin-bottom: 5px; }
.hunt-item-hint  { font-size: 0.75rem; color: #0369a1; line-height: 1.4; font-style: italic; }

/* Toast */
.hunt-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1a1a2e;
  color: white;
  border-radius: 14px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  min-width: 220px;
  max-width: 320px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.hunt-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.hunt-toast-emoji { font-size: 1.6rem; flex-shrink: 0; }
.hunt-toast-name { font-size: 0.88rem; font-weight: 700; }
.hunt-toast-pts  { font-size: 0.75rem; color: #94a3b8; margin-top: 2px; }

/* ── Section Header Bar ─────────────────────────────────────────────────── */
.tab-sticky-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
}

.section-header-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}
.section-header-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.section-header-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  flex: 1;
}
.view-icon-toggle {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.view-icon-btn {
  background: none;
  border: none;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.view-icon-btn:hover { background: var(--border); }
.view-icon-btn.active { color: var(--primary); background: var(--tag-bg); }


.search-icon-btn {
  background: none;
  border: none;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.search-icon-btn:hover { background: var(--border); }
.search-icon-btn.active { color: var(--primary); background: var(--tag-bg); }

.search-collapse {
  padding: 8px 12px 4px;
  border-bottom: 1px solid var(--border);
  animation: searchSlideDown 0.18s ease;
}
.search-collapse[hidden] { display: none; }
@keyframes searchSlideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Games menu ──────────────────────────────────────────────────────────── */
.games-menu-intro {
  margin: 16px 16px 12px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.games-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 16px 24px;
}
.game-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  box-sizing: border-box;
}
.game-card:not(.game-card-coming-soon):hover,
.game-card:not(.game-card-coming-soon):active {
  border-color: #b45309;
  box-shadow: 0 2px 12px rgba(180, 83, 9, 0.12);
}
.game-card-coming-soon {
  opacity: 0.55;
  cursor: default;
}
.game-card-icon  { font-size: 2rem; margin-bottom: 4px; }
.game-card-name  { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.game-card-meta  { font-size: 0.78rem; color: #b45309; font-weight: 600; margin-bottom: 2px; }
.game-card-desc  { font-size: 0.83rem; color: var(--text-secondary); line-height: 1.4; }

/* back bar inside game view */
.game-back-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}
.game-back-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── Route 1 Trivia ─────────────────────────────────────────────────────── */
.trivia-start {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 24px 40px;
  text-align: center;
}
.trivia-start-icon  { font-size: 3.5rem; margin-bottom: 12px; }
.trivia-start-title { font-size: 1.4rem; font-weight: 800; color: var(--text-primary); margin: 0 0 10px; }
.trivia-start-desc  { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.5; margin: 0 0 20px; }
.trivia-badge-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 28px;
}
.trivia-badge-chip {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 20px;
}
.trivia-start-btn {
  background: #6d28d9;
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px 36px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  max-width: 320px;
}
.trivia-q-wrap {
  padding: 16px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.trivia-progress-wrap { display: flex; flex-direction: column; gap: 6px; }
.trivia-progress-text { font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); }
.trivia-progress-bar-bg {
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.trivia-progress-bar-fill {
  height: 100%;
  background: #7c3aed;
  border-radius: 4px;
  transition: width 0.3s ease;
}
.trivia-meta { display: flex; gap: 8px; align-items: center; }
.trivia-category-chip {
  font-size: 0.72rem;
  font-weight: 700;
  background: #ede9fe;
  color: #5b21b6;
  padding: 3px 9px;
  border-radius: 20px;
}
.trivia-difficulty-chip {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
}
.trivia-diff-easy   { background: #dcfce7; color: #15803d; }
.trivia-diff-medium { background: #fef3c7; color: #92400e; }
.trivia-diff-hard   { background: #fee2e2; color: #991b1b; }
.trivia-question {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.45;
}
.trivia-options { display: flex; flex-direction: column; gap: 10px; }
.trivia-option-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 13px 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  width: 100%;
}
.trivia-option-btn:not(:disabled):hover,
.trivia-option-btn:not(:disabled):active {
  border-color: #7c3aed;
  background: #f5f3ff;
}
.trivia-option-letter {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  font-size: 0.78rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}
.trivia-option-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.35;
}
.trivia-option-btn.trivia-correct {
  border-color: #16a34a;
  background: #f0fdf4;
}
.trivia-option-btn.trivia-correct .trivia-option-letter {
  background: #16a34a;
  border-color: #16a34a;
  color: white;
}
.trivia-option-btn.trivia-wrong {
  border-color: #dc2626;
  background: #fef2f2;
}
.trivia-option-btn.trivia-wrong .trivia-option-letter {
  background: #dc2626;
  border-color: #dc2626;
  color: white;
}
.trivia-feedback {
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.trivia-feedback-correct { background: #f0fdf4; border: 1.5px solid #86efac; }
.trivia-feedback-wrong   { background: #fef2f2; border: 1.5px solid #fca5a5; }
.trivia-feedback-verdict {
  font-size: 0.88rem;
  font-weight: 800;
}
.trivia-feedback-correct .trivia-feedback-verdict { color: #15803d; }
.trivia-feedback-wrong   .trivia-feedback-verdict { color: #991b1b; }
.trivia-feedback-fact {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.trivia-next-btn {
  align-self: flex-end;
  background: #7c3aed;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
}
.trivia-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 36px 24px 48px;
  text-align: center;
  gap: 6px;
}
.trivia-result-badge-icon  { font-size: 4rem; margin-bottom: 4px; }
.trivia-result-badge-name  { font-size: 1.1rem; font-weight: 800; margin-bottom: 8px; }
.trivia-result-score       { font-size: 3rem; font-weight: 900; color: var(--text-primary); line-height: 1; }
.trivia-result-score-denom { font-size: 1.4rem; font-weight: 600; color: var(--text-secondary); }
.trivia-result-pct         { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 4px; }
.trivia-result-desc        { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.4; margin-bottom: 20px; }
.trivia-result-actions     { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 320px; }
.trivia-back-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

/* ── Family code sharing ────────────────────────────────────────────────── */
.family-code-box {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 12px 0 8px;
  text-align: center;
}
.family-code-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.family-code-value {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  font-family: 'Courier New', monospace;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.family-code-copy-btn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 7px 18px;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
}
.family-code-hint {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-align: center;
  margin: 4px 0 12px;
  line-height: 1.4;
}
.family-code-entry-wrap {
  margin: 10px 0 4px;
  text-align: center;
}
.family-code-toggle-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px 0;
}
#family-code-entry-form {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.family-code-input {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
  background: var(--surface);
  color: var(--text-primary);
}
.family-code-submit-btn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}
.family-code-submit-btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.family-code-error {
  color: #dc2626;
  font-size: 0.8rem;
  text-align: center;
  padding: 2px 0;
}

/* ── Bottom Tab Bar ─────────────────────────────────────────────────────── */
#bottom-tab-bar {
  display: flex;
  background: white;
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  flex-shrink: 0;
  z-index: 200;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.07);
}

.bottom-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 2px 7px;
  border: none;
  background: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 0.56rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1.25;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s;
  position: relative;
}

.bottom-tab-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  opacity: 0.35;
  transition: opacity 0.15s;
}

/* Active states — each tab gets its own color */
.bottom-tab[data-tab="poi"].active    { color: #1a6b5a; }
.bottom-tab[data-tab="nature"].active { color: #2d7a2d; }
.bottom-tab[data-tab="lore"].active   { color: #7c3aed; }
.bottom-tab[data-tab="map"].active    { color: #1a5f8a; }
.bottom-tab[data-tab="games"].active  { color: #b45309; }

.bottom-tab.active .bottom-tab-icon { opacity: 1; }

/* Active indicator bar at the top of the tab */
.bottom-tab.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 16%;
  right: 16%;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: currentColor;
}

/* ── Food & Fun tab ─────────────────────────────────────────────────────── */
.bottom-tab[data-tab="foodfun"].active { color: #c0392b; }

.bottom-tab-emoji-icon {
  font-size: 1.45rem;
  line-height: 1;
  opacity: 0.4;
  transition: opacity 0.15s;
}
.bottom-tab.active .bottom-tab-emoji-icon { opacity: 1; }

.section-header-emoji-icon {
  font-size: 1.4rem;
  line-height: 1;
}

/* Filter chips */
.foodfun-filter-bar {
  display: flex;
  gap: 6px;
  padding: 4px 12px 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.foodfun-filter-bar::-webkit-scrollbar { display: none; }

.foodfun-filter-chip {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: none;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.foodfun-filter-chip.active {
  background: #c0392b;
  border-color: #c0392b;
  color: #fff;
}

/* List */
.foodfun-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.foodfun-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  background: var(--surface);
  transition: background 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.foodfun-card:active { background: var(--surface-raised); }

.foodfun-emoji {
  font-size: 1.8rem;
  flex-shrink: 0;
  line-height: 1;
  padding-top: 2px;
}

.foodfun-info { flex: 1; min-width: 0; }

.foodfun-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.foodfun-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.foodfun-location-tag {
  background: var(--surface-raised);
  border-radius: 4px;
  padding: 1px 5px;
  font-weight: 600;
}

.foodfun-price {
  color: #c0392b;
  font-weight: 700;
}

.foodfun-summary {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Detail view */
.foodfun-detail-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.foodfun-detail-emoji-hero {
  font-size: 4rem;
  text-align: center;
  padding: 24px 0 8px;
}

.foodfun-must-try {
  background: #fff3f0;
  border-left: 3px solid #c0392b;
  border-radius: 0 6px 6px 0;
  padding: 10px 14px;
  margin: 0 0 16px;
  font-size: 0.82rem;
  color: var(--text-primary);
}
.foodfun-must-try strong { color: #c0392b; display: block; margin-bottom: 2px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; }
