:root {
  --dark: #111827;
  --soft-dark: #1f2937;
  --gold: #c9a45c;
  --cream: #f7f2ea;
  --white: #ffffff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--dark);
  color: var(--white);
  overflow: hidden;
}

.screen {
  display: none;
  width: 100vw;
  height: 100vh;
  position: fixed;
  inset: 0;
}

.screen.active { display: block; }

.loader-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity .4s ease;
}

.loader-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.welcome-screen {
  background: url('assets/images/place.jpg') center/cover no-repeat;
}

.welcome-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,.82));
}

.welcome-content {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 56px;
  z-index: 2;
}

.brand-logo {
  display: inline-block;
  padding: 9px 14px;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 999px;
  font-size: .75rem;
  letter-spacing: .18em;
  margin-bottom: 20px;
}

.welcome-content h1 {
  font-size: clamp(2.2rem, 9vw, 4rem);
  line-height: .95;
  font-weight: 800;
  letter-spacing: -.04em;
  margin-bottom: 18px;
}

.welcome-content p {
  font-size: 1.05rem;
  opacity: .9;
  max-width: 520px;
}

.map-screen { background: #e5e7eb; }
#map { width: 100%; height: 100%; z-index: 1; }

.leaflet-control-attribution { font-size: 9px; }

.user-marker {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #2563eb;
  border: 4px solid #fff;
  box-shadow: 0 0 0 8px rgba(37,99,235,.18), 0 8px 24px rgba(0,0,0,.3);
}

.destination-marker {
  width: 30px;
  height: 30px;
  background: var(--dark);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 3px solid white;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}

.map-control-btn {
  position: absolute;
  z-index: 500;
  border: 0;
  border-radius: 999px;
  background: rgba(17,24,39,.92);
  color: white;
  box-shadow: 0 10px 30px rgba(0,0,0,.22);
  backdrop-filter: blur(12px);
}

.center-btn {
  right: 18px;
  top: 18px;
  width: 46px;
  height: 46px;
  font-size: 1.4rem;
}

.simulate-btn {
  left: 18px;
  top: 18px;
  padding: 11px 16px;
  font-size: .85rem;
}

.arrival-btn {
  left: 18px;
  top: 70px;
  padding: 11px 16px;
  font-size: .85rem;
  background: var(--gold);
}

.direction-chip {
  position: absolute;
  z-index: 500;
  top: 132px;
  left: 18px;
  right: 18px;
  background: rgba(255,255,255,.95);
  color: var(--dark);
  border-radius: 22px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 14px 40px rgba(0,0,0,.16);
  backdrop-filter: blur(14px);
}

.direction-chip .arrow {
  width: 42px;
  height: 42px;
  background: var(--dark);
  color: white;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
}

.direction-chip span {
  display: block;
  font-size: .8rem;
  color: #6b7280;
}

.navigation-card {
  position: absolute;
  z-index: 500;
  left: 14px;
  right: 14px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  padding: 20px;
  background: rgba(255,255,255,.96);
  color: var(--dark);
  border-radius: 28px;
  box-shadow: 0 20px 55px rgba(0,0,0,.24);
  backdrop-filter: blur(18px);
}

.navigation-card small {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .72rem;
  color: #6b7280;
}

.navigation-card h2 {
  margin: 6px 0 4px;
  font-size: 1.45rem;
  font-weight: 800;
}

.navigation-card p {
  margin: 0;
  color: #4b5563;
}

.eta-box {
  min-width: 72px;
  background: var(--dark);
  color: white;
  border-radius: 20px;
  padding: 10px;
  text-align: center;
}

.eta-box strong {
  display: block;
  font-size: 1.25rem;
  line-height: 1;
}

.eta-box span { font-size: .75rem; opacity: .75; }

.route-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.progress {
  height: 8px;
  border-radius: 99px;
  background: #e5e7eb;
}

.progress-bar { background: var(--dark); }

.arrival-screen {
  background: var(--cream);
  color: var(--dark);
  overflow-y: auto;
}

.arrival-image {
  width: 100%;
  height: 42vh;
  object-fit: cover;
  display: block;
}

.arrival-content {
  padding: 24px 20px calc(32px + env(safe-area-inset-bottom));
  background: var(--cream);
  border-radius: 28px 28px 0 0;
  margin-top: -26px;
  position: relative;
  z-index: 2;
}

.arrival-content small {
  text-transform: uppercase;
  letter-spacing: .16em;
  color: #6b7280;
  font-size: .72rem;
}

.arrival-content h1 {
  font-size: 2rem;
  font-weight: 850;
  letter-spacing: -.04em;
  margin: 10px 0 14px;
}

.arrival-content p {
  color: #374151;
  font-size: 1rem;
  line-height: 1.65;
}

.audio-card, .info-box, .mission-box {
  background: white;
  border-radius: 22px;
  padding: 16px;
  margin-top: 14px;
  box-shadow: 0 12px 30px rgba(17,24,39,.08);
}

.audio-card label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}

audio { width: 100%; }

.info-box strong, .mission-box strong { display: block; margin-bottom: 6px; }
.info-box p, .mission-box p { margin: 0; }

.final-screen {
  background: radial-gradient(circle at top, #374151, #111827 55%);
  color: white;
  text-align: center;
}

.final-content {
  height: 100%;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.confetti {
  font-size: 5rem;
  animation: pop 1.2s ease infinite alternate;
}

.final-content h1 {
  font-size: 2.4rem;
  font-weight: 850;
  letter-spacing: -.04em;
}

.final-content p {
  opacity: .86;
  max-width: 420px;
}

@keyframes pop {
  from { transform: scale(.9) rotate(-5deg); }
  to { transform: scale(1.08) rotate(5deg); }
}
