/* Delesiden – kart i fullskjerm med et kort nederst. */

html, body { height: 100%; }

.tracker { position: relative; height: 100dvh; overflow: hidden; background: #DCE9E2; }
.tracker__map { position: absolute; inset: 0; }

.tracker__top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px;
  pointer-events: none;
}

.chip-brand {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  padding: 8px 15px;
  box-shadow: 0 4px 16px rgba(18, 33, 29, 0.12);
  pointer-events: auto;
  text-decoration: none;
  color: var(--ink);
}
.chip-brand span { font-weight: 800; font-size: 16px; }

.promo {
  display: flex; align-items: center; gap: 8px;
  background: rgba(18, 33, 29, 0.9);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 600; font-size: 12.5px;
  box-shadow: 0 4px 16px rgba(18, 33, 29, 0.2);
  pointer-events: auto;
}
.promo:hover { color: #fff; }
.promo strong { color: var(--orange-light); font-weight: 700; }

.tracker__bottom {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: center;
  padding: 0 12px 18px;
  pointer-events: none;
}

.sheet {
  width: 100%;
  max-width: 480px;
  min-width: 0;
  background: #fff;
  border-radius: 26px;
  box-shadow: 0 12px 40px rgba(18, 33, 29, 0.22);
  padding: 8px 22px 22px;
  pointer-events: auto;
}
.sheet .handle { margin: 6px auto 16px; }

.sheet__head { display: flex; align-items: center; gap: 13px; }
.sheet__head .avatar { width: 48px; height: 48px; font-size: 19px; }
.sheet__title { flex: 1; min-width: 0; }
.sheet__name { font-weight: 800; font-size: 17px; }
.sheet__meta { font-size: 12.5px; color: var(--muted); }

.tag {
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12px; font-weight: 700;
  white-space: nowrap;
}
.tag--live { background: var(--tint); color: var(--success); }
.tag--live .dot { width: 8px; height: 8px; }
.tag--ended { background: var(--chip-neutral); color: var(--secondary); }

.sheet__stats {
  display: flex; justify-content: space-between; gap: 8px;
  border-top: 1px solid var(--hairline);
  margin-top: 16px;
  padding-top: 16px;
}
.sheet__stats > :nth-child(2) { text-align: center; }
.sheet__stats > :nth-child(3) { text-align: right; }
.sheet__stats .stat__value { font-size: 28px; }
.sheet__stats .stat__label { font-size: 11px; letter-spacing: 0.85px; }

/* Markøren for gjeldende posisjon (settes på Mapbox-markøren). */
.glid-marker {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--orange);
  border: 4px solid #fff;
  box-shadow: 0 2px 8px rgba(18, 33, 29, 0.3);
  animation: pulseMarker 2s infinite;
}

/* Tilstander før turen er lastet, eller når lenka ikke gjelder lenger. */

.tracker__state {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px;
  padding: 32px 24px;
  text-align: center;
  background: var(--bg);
  z-index: 5;
}
.tracker__state h1 { font-size: clamp(22px, 4vw, 30px); }
.tracker__state p { margin: 0; max-width: 46ch; color: var(--body-alt); font-size: 15.5px; line-height: 1.6; }
.tracker__state[hidden] { display: none; }

.spinner {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 3px solid var(--handle);
  border-top-color: var(--brand);
  animation: spin 0.9s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
}

@media (max-width: 420px) {
  .promo { font-size: 11.5px; padding: 8px 13px; }
  .sheet__stats .stat__value { font-size: 24px; }
}

/* Mapbox-kontrollene i toppen må under vår egen topprad. */
.mapboxgl-ctrl-top-left,
.mapboxgl-ctrl-top-right { margin-top: 48px; }
