:root {
  color-scheme: dark;
  --background: #070707;
  --surface: rgba(18, 18, 18, 0.88);
  --surface-strong: #131313;
  --text: #fffdf8;
  --muted: rgba(255, 253, 248, 0.66);
  --border: rgba(255, 255, 255, 0.10);
  --red: #ff2d1a;
  --orange: #ff6a00;
  --yellow: #ffe500;
  --green: #57dc88;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% -5%, rgba(255, 45, 26, 0.17), transparent 31rem),
    radial-gradient(circle at 100% 22%, rgba(255, 229, 0, 0.11), transparent 27rem),
    var(--background);
  color: var(--text);
  overflow-x: hidden;
}

button, a { font: inherit; }

.ambient {
  position: fixed;
  border-radius: 999px;
  filter: blur(90px);
  pointer-events: none;
  opacity: 0.28;
}

.ambient-one { width: 260px; height: 260px; background: var(--red); left: -140px; top: 38%; }
.ambient-two { width: 240px; height: 240px; background: var(--yellow); right: -150px; bottom: 4%; }

.shell {
  position: relative;
  width: min(100%, 760px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-decoration: none;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: #070707;
  background: linear-gradient(135deg, var(--red), var(--orange) 50%, var(--yellow));
  box-shadow: 0 8px 24px rgba(255, 76, 19, 0.24);
}

.private-pill, .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.01em;
  background: rgba(255, 255, 255, 0.055);
}

.lock { color: var(--orange); font-size: 8px; }

.hidden { display: none !important; }

.state-card, .hero-card, .map-card, .route-card, .detail-card, .privacy-card {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.state-card {
  min-height: 260px;
  border-radius: 30px;
  padding: 32px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.state-card h1, .hero-card h1 { margin: 3px 0 8px; letter-spacing: -0.05em; line-height: 0.98; }
.state-card h1 { font-size: clamp(28px, 7vw, 42px); }
.state-card p { margin: 0; color: var(--muted); line-height: 1.5; }

.loader {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.09);
  border-top-color: var(--orange);
  animation: spin 0.9s linear infinite;
}

.state-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 24px;
  font-weight: 900;
  color: #080808;
  background: linear-gradient(135deg, var(--red), var(--yellow));
}

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

.secondary-button {
  margin-top: 18px;
  border: 1px solid rgba(255, 122, 0, 0.42);
  border-radius: 14px;
  padding: 11px 16px;
  color: var(--text);
  background: rgba(255, 106, 0, 0.12);
  font-weight: 850;
  cursor: pointer;
}

.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(112, 0, 7, 0.92), rgba(255, 58, 10, 0.86) 42%, rgba(137, 125, 0, 0.72)),
    var(--surface-strong);
}

.hero-card::after {
  content: "";
  position: absolute;
  width: 210px;
  height: 210px;
  right: -95px;
  bottom: -130px;
  border-radius: 50%;
  background: rgba(255, 229, 0, 0.24);
  filter: blur(8px);
}

.hero-status-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 24px; }
.status-pill { position: relative; z-index: 1; background: rgba(0, 0, 0, 0.29); }
.status-pill.ended .pulse { background: rgba(255, 255, 255, 0.45); box-shadow: none; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(87, 220, 136, 0.16); }
.last-updated { font-size: 11px; color: rgba(255, 255, 255, 0.76); font-weight: 750; text-align: right; }
.eyebrow { margin: 0; color: rgba(255, 255, 255, 0.72); font-size: 11px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; }
.hero-card h1 { position: relative; z-index: 1; max-width: 590px; font-size: clamp(36px, 9vw, 66px); }
.hero-copy { position: relative; z-index: 1; margin: 12px 0 0; max-width: 560px; color: rgba(255, 255, 255, 0.84); font-size: 14px; line-height: 1.45; font-weight: 720; }

.map-card {
  position: relative;
  overflow: hidden;
  height: min(54vh, 430px);
  min-height: 315px;
  margin-top: 14px;
  border-radius: 28px;
}

#map { width: 100%; height: 100%; background: #171717; }
#map .gm-style .gm-style-cc,
#map .gm-style .gmnoprint { font-size: 9px !important; }

.map-state-badge {
  position: absolute;
  z-index: 4;
  top: 13px;
  left: 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  color: white;
  background: rgba(8,8,8,.82);
  box-shadow: 0 8px 22px rgba(0,0,0,.28);
  backdrop-filter: blur(12px);
  font-size: 11px;
  font-weight: 850;
}

.map-state-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(87,220,136,.15);
}

.map-state-badge.delayed::before {
  background: var(--yellow);
  box-shadow: 0 0 0 4px rgba(255,229,0,.13);
}

.map-overlay {
  position: absolute;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  text-align: center;
  background: radial-gradient(circle at 50% 35%, rgba(255, 91, 21, 0.14), transparent 16rem), rgba(10, 10, 10, 0.91);
}
.map-overlay-icon { font-size: 42px; color: var(--orange); }
.map-overlay strong { margin-top: 8px; font-size: 19px; }
.map-overlay span:last-child { max-width: 380px; margin-top: 7px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.map-overlay .secondary-button { margin-top: 14px; }

.route-card { margin-top: 14px; border-radius: 24px; padding: 18px; }
.route-point { display: grid; grid-template-columns: 22px 1fr; gap: 11px; align-items: center; }
.route-point span:not(.route-dot) { display: block; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.route-point strong { display: block; margin-top: 3px; font-size: 14px; line-height: 1.3; }
.route-dot { width: 13px; height: 13px; border-radius: 50%; justify-self: center; }
.route-dot-start { background: var(--orange); box-shadow: 0 0 0 5px rgba(255, 106, 0, 0.12); }
.route-dot-end { background: var(--yellow); box-shadow: 0 0 0 5px rgba(255, 229, 0, 0.10); }
.route-line { display: block; width: 2px; height: 27px; margin: 2px 0 2px 10px; background: linear-gradient(var(--orange), var(--yellow)); opacity: 0.6; }

.details-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.detail-card { display: flex; flex-direction: column; min-width: 0; border-radius: 22px; padding: 16px; }
.detail-card-wide { grid-column: 1 / -1; }
.detail-icon { color: var(--orange); font-size: 20px; margin-bottom: 13px; }
.detail-card > span:nth-child(2) { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.detail-card strong { margin-top: 5px; font-size: 16px; overflow-wrap: anywhere; }
.detail-card small { margin-top: 5px; color: var(--muted); font-size: 12px; }

.privacy-card { display: flex; gap: 13px; margin-top: 14px; border-radius: 22px; padding: 16px; }
.privacy-card > span { color: var(--orange); font-size: 22px; }
.privacy-card strong { font-size: 14px; }
.privacy-card p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.48; }

footer { display: flex; justify-content: space-between; gap: 18px; padding: 22px 4px 4px; color: rgba(255,255,255,.42); font-size: 11px; font-weight: 750; }
footer a { color: rgba(255,255,255,.64); text-decoration: none; }

@media (max-width: 520px) {
  .shell { padding-left: 12px; padding-right: 12px; }
  .private-pill { padding: 7px 9px; font-size: 10px; }
  .state-card { min-height: 230px; padding: 23px; align-items: flex-start; flex-direction: column; }
  .hero-card { padding: 20px; border-radius: 26px; }
  .hero-status-row { align-items: flex-start; }
  .map-card { border-radius: 24px; min-height: 300px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
