/* ==========================================================================
   OMPRESENT SANCTUARY — QUIET LUXURY MASTER STYLESHEET (V3.0 REAL MAP & HERITAGE)
   Tác phẩm: Hạc Thiêng Hiện Diện — Hành trình từ Đất Mẹ Hào Hùng đến Nước Cha Vô Lượng
   Tác giả: Hà Viết Sâm (Pháp Hoa) | OMPRESENT.COM
   ========================================================================== */

:root {
  --bg-dark: #06080C;
  --bg-slate: #12151D;
  --bg-card: rgba(18, 22, 30, 0.82);
  --gold-bronze: #C5A059;
  --gold-champagne: #E6CA85;
  --gold-celestial: #FFF4D4;
  --text-pure: #F4F4F6;
  --text-muted: #8E95A5;
  --border-gold: rgba(230, 202, 133, 0.28);
  --border-gold-glow: rgba(230, 202, 133, 0.58);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  color: var(--text-pure);
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.5;
  touch-action: none;
}

/* ==========================================================================
   LAYER 1: REAL GIS MAP VIEW (CARTO DARK MATTER NO-LABELS)
   ========================================================================== */
#mapView {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  background-color: #06080C;
  pointer-events: none; /* Let canvas capture breath & mindful touch input */
}

/* Dark Luxury Map Tile Tuning */
.leaflet-tile {
  filter: brightness(0.88) contrast(1.18) saturate(0.85);
}

.leaflet-container {
  background-color: #06080C !important;
}

/* Hide Default Leaflet Clutter (Quiet Luxury Clean) */
.leaflet-control-attribution,
.leaflet-control-zoom {
  display: none !important;
}

/* Custom Gold Marker Glow */
.sovereignty-flag-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.sovereignty-flag-icon {
  font-size: 18px;
  filter: drop-shadow(0 0 6px rgba(230, 202, 133, 0.8));
  animation: flagFloat 3s ease-in-out infinite alternate;
}

.sovereignty-flag-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--gold-champagne);
  background: rgba(6, 8, 12, 0.85);
  border: 1px solid var(--border-gold);
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.6);
  margin-top: 2px;
}

@keyframes flagFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-4px); }
}

/* Waypoint Constellation Node Marker */
.custom-waypoint-container {
  display: flex !important;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible !important;
}

.waypoint-node-marker {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle, #FFF4D4 0%, #E6CA85 60%, #C5A059 100%);
  box-shadow: 0 0 16px #FFF4D4, 0 0 30px rgba(230, 202, 133, 0.8);
  border: 2px solid #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.3s ease;
}

.waypoint-node-marker::after {
  content: '';
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
  border: 1.5px dashed rgba(255, 244, 212, 0.7);
  border-radius: 50%;
  animation: ensoPulse 3s infinite linear;
}

@keyframes ensoPulse {
  0% { transform: rotate(0deg) scale(1); opacity: 0.8; }
  50% { transform: rotate(180deg) scale(1.25); opacity: 0.3; }
  100% { transform: rotate(360deg) scale(1); opacity: 0.8; }
}

.waypoint-node-marker.active {
  background: #FFFFFF;
  box-shadow: 0 0 25px #FFFFFF, 0 0 50px #FFF4D4;
  transform: scale(1.35);
}

.waypoint-node-marker.approaching {
  transform: scale(1.45);
  box-shadow: 0 0 35px #FFF4D4, 0 0 65px rgba(230, 202, 133, 0.95);
  animation: beaconPulse 1.2s infinite ease-in-out;
}

@keyframes beaconPulse {
  0%, 100% { transform: scale(1.35); box-shadow: 0 0 25px #FFF4D4, 0 0 40px rgba(230, 202, 133, 0.7); }
  50% { transform: scale(1.6); box-shadow: 0 0 50px #FFF4D4, 0 0 80px rgba(230, 202, 133, 1); }
}

.waypoint-pin-name {
  position: absolute;
  top: 26px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #FFF4D4;
  background: rgba(10, 14, 23, 0.88);
  border: 1px solid rgba(230, 202, 133, 0.55);
  padding: 3px 8px;
  border-radius: 6px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.75);
  pointer-events: none;
  backdrop-filter: blur(4px);
}

/* ==========================================================================
   LAYER 2: FULLSCREEN FLIGHT CANVAS
   ========================================================================== */
#gameCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2;
  display: block;
  pointer-events: auto;
}

/* ==========================================================================
   TOP MINIMALIST HUD HEADER
   ========================================================================== */
.hud-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 20;
  pointer-events: none;
}

.hud-left, .hud-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: auto;
}

.hud-left {
  align-items: flex-start;
}

.hud-right {
  align-items: flex-end;
}

/* Brand Capsule */
.brand-capsule {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-full);
  padding: 6px 14px 6px 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.brand-mandala {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--gold-champagne);
  animation: spinSlow 36s linear infinite;
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.brand-text-col {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--gold-champagne);
  text-transform: uppercase;
}

.brand-slogan {
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* Current Landmark Minimalist Badge */
.landmark-badge {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  max-width: 320px;
  transition: var(--transition-smooth);
}

.landmark-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--gold-champagne);
  margin-bottom: 2px;
}

.landmark-altitude-tag {
  background: rgba(230, 202, 133, 0.15);
  border-radius: 4px;
  padding: 1px 5px;
}

.landmark-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-pure);
  line-height: 1.3;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.landmark-location {
  font-size: 10px;
  color: var(--text-muted);
}

/* Collective Breath Pill */
.collective-breath-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 11px;
  color: var(--text-pure);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.enso-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #5D9E7E;
  box-shadow: 0 0 8px #5D9E7E;
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.collective-num {
  color: var(--gold-champagne);
  font-weight: 700;
}

/* Audio Toggle Button */
.mode-btn {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  color: var(--gold-champagne);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.mode-btn:hover {
  background: rgba(230, 202, 133, 0.2);
}

/* ==========================================================================
   CENTER GUIDANCE & SOMATIC BREATH PACER
   ========================================================================== */
.center-guidance {
  position: fixed;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 10;
  pointer-events: none;
  width: 90%;
  max-width: 580px;
}

.pacer-breath-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(230, 202, 133, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  background: rgba(18, 22, 30, 0.6);
  backdrop-filter: blur(8px);
  animation: pacerExpand 10s infinite ease-in-out;
}

.pacer-icon {
  font-size: 18px;
}

@keyframes pacerExpand {
  0%   { transform: scale(1.0); box-shadow: 0 0 10px rgba(230, 202, 133, 0.1); }
  40%  { transform: scale(1.28); box-shadow: 0 0 28px rgba(230, 202, 133, 0.4); }
  100% { transform: scale(1.0); box-shadow: 0 0 10px rgba(230, 202, 133, 0.1); }
}

.pacer-instruction {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--gold-celestial);
  text-transform: uppercase;
  margin-bottom: 4px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.pacer-somatic-quote {
  font-size: 11px;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.4;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

/* ==========================================================================
   BOTTOM FLOATING BREATH METER FILAMENT
   ========================================================================== */
.meter-floating-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 460px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  z-index: 20;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.meter-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.meter-pressure-val {
  color: var(--gold-champagne);
  font-size: 11px;
}

.meter-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 5px;
}

.meter-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #C5A059, #FFF4D4);
  box-shadow: 0 0 8px var(--gold-champagne);
  border-radius: 2px;
  transition: width 0.12s ease-out;
}

.meter-sub-tip {
  font-size: 9px;
  color: var(--text-muted);
  text-align: center;
}

/* ==========================================================================
   BOTTOM LEFT SOVEREIGNTY ATTRIBUTION
   ========================================================================== */
.map-sovereign-tag {
  position: fixed;
  bottom: 8px;
  left: 18px;
  font-size: 9px;
  color: rgba(142, 149, 165, 0.65);
  z-index: 20;
  pointer-events: none;
  letter-spacing: 0.3px;
}

/* ==========================================================================
   BOTTOM RIGHT SETTINGS TRIGGER BUTTON
   ========================================================================== */
.settings-trigger-btn {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-gold);
  color: var(--gold-champagne);
  font-size: 18px;
  cursor: pointer;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  transition: var(--transition-smooth);
}

.settings-trigger-btn:hover {
  transform: rotate(45deg) scale(1.08);
  border-color: var(--gold-champagne);
  box-shadow: 0 0 16px var(--border-gold-glow);
}

/* ==========================================================================
   SLIDE-IN SETTINGS DRAWER (QUIET LUXURY)
   ========================================================================== */
.settings-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 35;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.settings-drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.settings-drawer {
  position: fixed;
  top: 0;
  right: -360px;
  width: 340px;
  height: 100vh;
  background: rgba(14, 18, 26, 0.96);
  backdrop-filter: blur(24px);
  border-left: 1px solid var(--border-gold);
  z-index: 40;
  display: flex;
  flex-direction: column;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.7);
}

.settings-drawer.active {
  right: 0;
}

.drawer-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-gold);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--gold-champagne);
}

.drawer-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
}

.drawer-close-btn:hover {
  color: #FFF;
}

.drawer-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.setting-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--gold-champagne);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.setting-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: #FFF;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.setting-input:focus {
  border-color: var(--gold-champagne);
}

.setting-hint {
  font-size: 9px;
  color: var(--text-muted);
}

.setting-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-pure);
  cursor: pointer;
}

.gateway-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.gateway-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(230, 202, 133, 0.2);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-pure);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  transition: all 0.2s;
}

.gateway-btn strong {
  font-size: 11px;
  color: var(--gold-champagne);
}

.gateway-btn span {
  font-size: 10px;
  color: var(--text-muted);
}

.gateway-btn.active, .gateway-btn:hover {
  background: rgba(230, 202, 133, 0.12);
  border-color: var(--gold-champagne);
}

.setting-select {
  background: rgba(18, 22, 30, 0.9);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--gold-champagne);
  font-size: 11px;
  outline: none;
  width: 100%;
}

.btn-gold-primary {
  background: linear-gradient(135deg, #C5A059 0%, #E6CA85 100%);
  color: #06080C;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(197, 160, 89, 0.35);
  transition: var(--transition-smooth);
  width: 100%;
}

.btn-gold-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(197, 160, 89, 0.5);
}

/* ==========================================================================
   THE SACRED HERITAGE LIVING PORTAL (CỬA SỔ HIỆN DIỆN DI SẢN THỰC TẠI)
   ========================================================================== */
.heritage-portal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 6, 10, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.heritage-portal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.heritage-portal-card {
  width: 90%;
  max-width: 480px;
  background: rgba(14, 18, 26, 0.92);
  border: 1.5px solid var(--border-gold);
  border-radius: 28px;
  padding: 26px 24px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8), 0 0 32px rgba(230, 202, 133, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transform: translateY(20px) scale(0.96);
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.heritage-portal-backdrop.active .heritage-portal-card {
  transform: translateY(0) scale(1.0);
}

.portal-arch-header {
  margin-bottom: 12px;
}

.portal-arch-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--gold-champagne);
  background: rgba(230, 202, 133, 0.12);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-full);
  padding: 3px 12px;
  text-transform: uppercase;
}

.portal-hero-figure {
  width: 110px;
  height: 110px;
  margin: 6px 0 14px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hero-medallion-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(230, 202, 133, 0.45));
  animation: medallionGlow 4s ease-in-out infinite alternate;
}

@keyframes medallionGlow {
  0% { transform: scale(0.97); filter: drop-shadow(0 0 10px rgba(230, 202, 133, 0.3)); }
  100% { transform: scale(1.03); filter: drop-shadow(0 0 24px rgba(230, 202, 133, 0.65)); }
}

.portal-landmark-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--gold-celestial);
  margin-bottom: 3px;
  line-height: 1.2;
}

.portal-hero-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-champagne);
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.portal-hero-title {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.portal-quote-box {
  background: rgba(230, 202, 133, 0.05);
  border-left: 2.5px solid var(--gold-champagne);
  border-radius: 4px;
  padding: 10px 14px;
  margin-bottom: 12px;
  text-align: left;
  width: 100%;
}

.portal-quote-text {
  font-size: 12px;
  font-style: italic;
  color: var(--text-pure);
  line-height: 1.5;
}

.portal-somatic-guide {
  font-size: 11px;
  color: #8CB8A5;
  line-height: 1.4;
  margin-bottom: 14px;
  padding: 0 8px;
}

.portal-breath-hint {
  font-size: 10px;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 10px;
  width: 100%;
}

.portal-breath-hint strong {
  color: var(--gold-celestial);
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE & RETINA TUNING)
   ========================================================================== */
@media (max-width: 600px) {
  .hud-header {
    padding: 12px 14px;
  }
  .brand-slogan {
    display: none;
  }
  .landmark-badge {
    max-width: 240px;
    padding: 6px 10px;
  }
  .landmark-title {
    font-size: 11px;
  }
  .center-guidance {
    top: 16%;
  }
  .pacer-instruction {
    font-size: 11px;
  }
  .pacer-somatic-quote {
    font-size: 10px;
  }
  .meter-floating-bar {
    bottom: 18px;
    padding: 8px 14px;
  }
  .settings-trigger-btn {
    bottom: 18px;
    right: 14px;
    width: 38px;
    height: 38px;
    font-size: 16px;
  }
  .heritage-portal-card {
    padding: 20px 16px;
  }
  .portal-hero-figure {
    width: 90px;
    height: 90px;
  }
  .portal-landmark-name {
    font-size: 15px;
  }
}

/* ==========================================================================
   PROVEN SOVEREIGN MAP TILE ENGINE (STANDARDIZED FROM THODIA.HAVIETSAM.COM)
   ========================================================================== */
.map-dark-tiles .leaflet-tile-pane {
  filter: brightness(0.95) contrast(1.18) saturate(1.15) !important;
}

.map-sat-tiles .leaflet-tile-pane {
  filter: brightness(88%) contrast(110%) saturate(95%) !important;
}


/* Hide intrusive center guidance to maintain pure sacred flight view */
.center-guidance {
  display: none !important;
}


/* ==========================================================================
   3D LIVING FLIGHT PERSPECTIVE & DEPTH OF FIELD
   ========================================================================== */
#mapView {
  perspective: 1100px;
  overflow: hidden;
}

#mapView .leaflet-map-pane {
  transform: rotateX(28deg) scale(1.18);
  transform-origin: 50% 68%;
  transition: none !important;
}



/* Floating Heritage Landing Trigger Pill */
.heritage-land-trigger-btn {
  position: fixed;
  bottom: 86px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.92), rgba(217, 119, 6, 0.95));
  border: 1px solid #FFF4D4;
  color: #FFFFFF;
  padding: 8px 24px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.6);
  cursor: pointer;
  z-index: 50;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.heritage-land-trigger-btn:hover {
  transform: translateX(-50%) scale(1.06);
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.9);
}

.heritage-land-trigger-btn:active {
  transform: translateX(-50%) scale(0.96);
}

/* ==========================================================================
   FULL-SCREEN LIVING HERITAGE SANCTUARY (ZERO POPUPS - FULL-BLEED IMMERSION)
   ========================================================================== */
.living-heritage-sanctuary {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.0s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.living-heritage-sanctuary.active {
  opacity: 1;
  pointer-events: auto;
}

.heritage-scenic-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(1.08);
  transition: transform 8s ease-out, filter 1.0s ease;
  filter: brightness(0.68) contrast(1.15) saturate(1.1);
}

.living-heritage-sanctuary.active .heritage-scenic-bg {
  transform: scale(1.0);
}

.heritage-scenic-vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(6, 8, 12, 0.35) 0%, rgba(6, 8, 12, 0.88) 85%);
  pointer-events: none;
}

.google-thuc-dia-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  border: none;
  background: #06080C;
}

.google-thuc-dia-layer iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.heritage-bottom-dock {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  width: calc(100% - 48px);
  max-width: 960px;
  background: rgba(8, 12, 18, 0.88);
  border: 1px solid rgba(230, 202, 133, 0.45);
  border-radius: 18px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85), 0 0 30px rgba(230, 202, 133, 0.12);
  padding: 16px 24px;
  z-index: 10;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
  opacity: 0;
  pointer-events: auto;
}

.living-heritage-sanctuary.active .heritage-bottom-dock {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.heritage-bottom-dock.dock-hidden {
  transform: translateX(-50%) translateY(120%);
  opacity: 0;
  pointer-events: none;
}

.dock-header-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}

.dock-seal-box {
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid rgba(230, 202, 133, 0.8);
  box-shadow: 0 0 20px rgba(230, 202, 133, 0.4);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(230, 202, 133, 0.2) 0%, rgba(10, 14, 23, 0.9) 100%);
}

.dock-seal-img {
  width: 90%;
  height: 90%;
  object-fit: contain;
}

.dock-title-group {
  flex: 1;
  min-width: 0;
}

.dock-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.heritage-station-pill {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #FFF4D4;
  background: rgba(230, 202, 133, 0.15);
  border: 1px solid rgba(230, 202, 133, 0.45);
  border-radius: 9999px;
  padding: 3px 12px;
  backdrop-filter: blur(8px);
}

.heritage-altitude-pill {
  font-size: 11px;
  font-weight: 700;
  color: #E6CA85;
  background: rgba(18, 22, 30, 0.6);
  border: 1px solid rgba(230, 202, 133, 0.25);
  border-radius: 9999px;
  padding: 3px 10px;
  backdrop-filter: blur(8px);
}

.dock-landmark-title {
  font-size: 18px;
  font-weight: 800;
  color: #FFF4D4;
  letter-spacing: 1px;
  margin: 0 0 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dock-hero-line {
  font-size: 13px;
  color: #E6CA85;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dock-hero-name {
  font-weight: 700;
  color: #E6CA85;
}

.dock-hero-sep {
  color: rgba(230, 202, 133, 0.5);
}

.dock-hero-epoch {
  color: #8E95A5;
  font-size: 12px;
}

.dock-wisdom-row {
  background: rgba(14, 18, 26, 0.6);
  border-left: 3px solid #E6CA85;
  padding: 8px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.dock-quote-text {
  font-size: 13.5px;
  font-style: italic;
  color: #F4F4F6;
  margin: 0 0 4px 0;
  line-height: 1.4;
}

.dock-somatic-guide {
  font-size: 12px;
  color: #E6CA85;
  line-height: 1.3;
}

.dock-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.heritage-ascend-btn {
  background: linear-gradient(135deg, #E6CA85 0%, #C5A059 100%);
  color: #06080C;
  border: none;
  border-radius: 9999px;
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.5px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(230, 202, 133, 0.45);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.heritage-ascend-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(230, 202, 133, 0.7);
  background: linear-gradient(135deg, #FFF4D4 0%, #E6CA85 100%);
}

.dock-navigation-hint {
  font-size: 11.5px;
  color: #8E95A5;
  text-align: right;
  letter-spacing: 0.5px;
}

@media (max-width: 768px) {
  .heritage-bottom-dock {
    bottom: 12px;
    width: calc(100% - 24px);
    padding: 12px 16px;
  }
  .dock-landmark-title {
    font-size: 15px;
  }
  .dock-action-row {
    flex-direction: column;
    align-items: stretch;
  }
  .dock-navigation-hint {
    text-align: center;
  }
}

.heritage-ascend-btn:active {
  transform: translateY(1px) scale(0.97);
}

/* ==========================================================================
/* ==========================================================================
   PANNELLUM 360 & SOVEREIGN VIEW MODE BAR
   ========================================================================== */

.pannellum-360-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.heritage-view-mode-bar {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(14, 18, 26, 0.85);
  border: 1px solid rgba(230, 202, 133, 0.45);
  border-radius: 9999px;
  padding: 6px 18px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7), 0 0 20px rgba(230, 202, 133, 0.15);
  pointer-events: auto;
}

.view-mode-btn {
  background: rgba(18, 22, 30, 0.7);
  border: 1px solid rgba(230, 202, 133, 0.35);
  color: #E6CA85;
  border-radius: 9999px;
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-mode-btn.active, .view-mode-btn:hover {
  background: rgba(230, 202, 133, 0.28);
  border-color: #FFF4D4;
  color: #FFFFFF;
  box-shadow: 0 0 15px rgba(230, 202, 133, 0.45);
  transform: scale(1.04);
}

.view-mode-link {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.55);
  color: #FFF4D4;
  border-radius: 9999px;
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-mode-link:hover {
  background: rgba(245, 158, 11, 0.35);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
  transform: scale(1.04);
}


/* ==========================================================================
   V4.0 SOVEREIGN SPATIAL ENGINE — 3D PERSPECTIVE STAGE, QUICK NAV & DEPTH TABS
   ========================================================================== */

.map-stage-wrapper {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  perspective: 1400px;
  overflow: hidden;
  background: #06080C;
}

.map-stage-wrapper #mapView {
  width: 100%;
  height: 100%;
  transform-origin: 50% 55%;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), filter 0.5s ease, opacity 0.5s ease;
  will-change: transform;
}

.map-stage-wrapper.diving-into-landmark #mapView {
  transform: rotateX(46deg) scale(1.68);
  filter: brightness(1.12) contrast(1.08) saturate(1.18);
}

.map-stage-wrapper.follow-3d-tilt #mapView {
  transform: rotateX(24deg) scale(1.16);
}

.hud-nav-mini-btn {
  background: rgba(230, 202, 133, 0.14);
  border: 1px solid rgba(230, 202, 133, 0.4);
  color: #FFF4D4;
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hud-nav-mini-btn:hover {
  background: rgba(230, 202, 133, 0.35);
  border-color: #FFF4D4;
  transform: scale(1.08);
}

.landmark-title {
  cursor: pointer;
  transition: color 0.2s ease;
}

.landmark-title:hover {
  color: #FFFFFF;
  text-decoration: underline;
  text-decoration-color: rgba(230, 202, 133, 0.6);
}

.portal-station-select {
  background: rgba(10, 14, 22, 0.92);
  border: 1px solid rgba(230, 202, 133, 0.55);
  color: #FFF4D4;
  border-radius: 9999px;
  padding: 5px 14px;
  font-size: 11.5px;
  font-weight: 700;
  max-width: 260px;
  cursor: pointer;
  outline: none;
}

.portal-station-select:hover,
.portal-station-select:focus {
  border-color: #FFFFFF;
  box-shadow: 0 0 14px rgba(230, 202, 133, 0.45);
}

.mode-bar-divider {
  width: 1px;
  height: 18px;
  background: rgba(230, 202, 133, 0.35);
  margin: 0 2px;
}

.heritage-view-mode-bar {
  max-width: calc(100vw - 24px);
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 7px 16px;
}

/* Clean 3D Satellite Layer inside Portal (Zero Commercial Homestay Clutter) */
.google-thuc-dia-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  background: #05080E;
  overflow: hidden;
  perspective: 1200px;
}

.sat3d-perspective-stage {
  position: absolute;
  inset: -18%;
  width: 136%;
  height: 136%;
  transform: rotateX(48deg) scale(1.18);
  transform-origin: 50% 52%;
  filter: contrast(1.12) saturate(1.18) brightness(0.96);
}

.portal-sat3d-map {
  width: 100%;
  height: 100%;
  background: #060A12;
}

.sat3d-target-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.sat3d-compass-ring {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  border: 1.5px dashed rgba(230, 202, 133, 0.65);
  box-shadow: 0 0 50px rgba(230, 202, 133, 0.25), inset 0 0 35px rgba(230, 202, 133, 0.18);
  transform: rotateX(48deg);
  animation: satCompassSpin 28s linear infinite;
}

@keyframes satCompassSpin {
  from { transform: rotateX(48deg) rotateZ(0deg); }
  to { transform: rotateX(48deg) rotateZ(360deg); }
}

.sat3d-coords-pill {
  margin-top: 16px;
  background: rgba(8, 12, 18, 0.86);
  border: 1px solid rgba(230, 202, 133, 0.55);
  color: #FFF4D4;
  border-radius: 9999px;
  padding: 5px 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  backdrop-filter: blur(10px);
}

/* 4K Scenic Backdrop Gentle Breathing Motion */
.heritage-scenic-bg {
  animation: kenBurnsBreath 24s ease-in-out infinite alternate;
}

@keyframes kenBurnsBreath {
  0% { transform: scale(1.0); }
  100% { transform: scale(1.07); }
}

.heritage-location-pill {
  font-size: 11px;
  font-weight: 600;
  color: #CBD5E1;
  background: rgba(18, 22, 30, 0.65);
  border: 1px solid rgba(230, 202, 133, 0.22);
  border-radius: 9999px;
  padding: 3px 10px;
}

/* 3 Interactive Depth Tabs (Chiều Sâu Di Sản) */
.dock-depth-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.depth-tab-btn {
  background: rgba(16, 22, 32, 0.78);
  border: 1px solid rgba(230, 202, 133, 0.3);
  color: #CBD5E1;
  border-radius: 9999px;
  padding: 5px 14px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
}

.depth-tab-btn:hover,
.depth-tab-btn.active {
  background: rgba(230, 202, 133, 0.24);
  border-color: #E6CA85;
  color: #FFF4D4;
  box-shadow: 0 0 12px rgba(230, 202, 133, 0.3);
}

.heritage-passport-mini-btn {
  background: rgba(230, 202, 133, 0.16);
  border: 1px solid rgba(230, 202, 133, 0.55);
  color: #FFF4D4;
  border-radius: 9999px;
  padding: 9px 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.heritage-passport-mini-btn:hover {
  background: rgba(230, 202, 133, 0.32);
  border-color: #FFFFFF;
  box-shadow: 0 0 16px rgba(230, 202, 133, 0.45);
}


/* Full-Luminance 4K Canvas Override */
.heritage-scenic-bg {
  z-index: 2 !important;
  background-color: #060911 !important;
  filter: brightness(1.04) contrast(1.06) saturate(1.08) !important;
}

.heritage-scenic-vignette {
  z-index: 3 !important;
  background: linear-gradient(180deg, rgba(6, 8, 12, 0.36) 0%, transparent 18%, transparent 72%, rgba(6, 8, 12, 0.65) 100%) !important;
}
