@font-face {
  font-family: "General Sans";
  src: url("/fonts/general-sans-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "General Sans";
  src: url("/fonts/general-sans-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --asphalt: #2B2F33;
  --fahrbahn: #F3F4F2;
  --weiss: #FDFDFC;         /* leicht getoent, kein reines Weiss */
  --kartengrund: #E6E8E4;
  --fz-alt: #B9BDC1;
  --grau: #5F656C;          /* 5.6:1 auf Weiss */
  --linie: #DDE0DC;
  --orange: #F19A3A;
  --orange-tief: #B8650F;   /* Text-taugliches Orange, 4.6:1 auf Weiss */
  --gelb: #F4BF36;
  --rand: 16px;
  --tafel-breite: 400px;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  background: var(--fahrbahn);
  color: var(--asphalt);
  font-family: "General Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 500;
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.seite {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  min-height: 100dvh;
}

/* ── Karte ─────────────────────────────────────────────── */
.karte {
  flex: 1 1 auto;
  min-height: 52dvh;
  background: var(--kartengrund);
}
.leaflet-container { font: inherit; background: var(--kartengrund); }
.leaflet-touch .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; }
.leaflet-control-attribution { font-size: 11px; }

/* Ohne Fahrt keine Karte */
body[data-zustand="angekommen"] .karte,
body[data-zustand="abgelaufen"] .karte,
body[data-zustand="laden"] .karte { display: none; }

/* ── Tafel ─────────────────────────────────────────────── */
.tafel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--weiss);
  padding: 20px var(--rand) calc(16px + env(safe-area-inset-bottom));
  border-top: 4px solid var(--orange);
}
body[data-zustand="angekommen"] .tafel,
body[data-zustand="abgelaufen"] .tafel,
body[data-zustand="laden"] .tafel {
  flex: 1 1 auto;
  justify-content: center;
  border-top: 0;
  max-width: 34rem;
  width: 100%;
  margin: 0 auto;
  background: transparent;
}

.logo { display: block; height: 30px; width: auto; }

.inhalt { display: flex; flex-direction: column; gap: 6px; }

.satz {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.45;
  max-width: 30ch;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.zeit { margin: 0; }
.zeit-wert {
  display: block;
  font-weight: 600;
  font-size: clamp(3.4rem, 17vw, 4.6rem);
  line-height: 1;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

.hinweis {
  margin: 4px 0 0;
  color: var(--grau);
  font-size: 0.95rem;
  min-height: 1.4em;
}
.hinweis[data-art="warten"] { color: var(--orange-tief); }

/* Angekommen: der Satz ist die Nachricht */
body[data-zustand="angekommen"] .satz {
  font-size: clamp(2rem, 9vw, 2.8rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.fuss {
  color: var(--grau);
  font-size: 0.82rem;
  line-height: 1.4;
  border-top: 1px solid var(--linie);
  padding-top: 12px;
}
.fuss p { margin: 0 0 6px; max-width: 60ch; }
.fuss-links { display: flex; gap: 18px; margin-bottom: 0; }
.fuss a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;   /* Tippflaeche */
  color: var(--asphalt);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--linie);
}
.fuss a:hover { text-decoration-color: currentColor; }

a:focus-visible,
.leaflet-container a:focus-visible,
.leaflet-container:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Fahrzeug- und Ziel-Markierung ─────────────────────── */
.fz {
  position: relative;
  width: 22px;
  height: 22px;
}
.fz-punkt {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--orange);
  border: 3px solid var(--weiss);
  box-shadow: 0 1px 4px rgba(43, 47, 51, 0.35);
}
.fz-ring {
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  border: 2px solid var(--orange);
  opacity: 0;
  animation: ring 3s cubic-bezier(0.25, 1, 0.5, 1) infinite;  /* ease-out-quart, ruhiger Takt */
}
.fz-alt .fz-punkt { background: var(--fz-alt); }
.fz-alt .fz-ring { display: none; }

@keyframes ring {
  0%   { transform: scale(0.55); opacity: 0.45; }
  100% { transform: scale(1.25); opacity: 0; }
}

.ziel {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--weiss);
  border: 4px solid var(--asphalt);
}

/* ── Desktop: Karte links, Tafel rechts ────────────────── */
@media (min-width: 860px) {
  body[data-zustand="unterwegs"] .seite { flex-direction: row; }
  body[data-zustand="unterwegs"] .karte { min-height: 100dvh; }
  body[data-zustand="unterwegs"] .tafel {
    flex: 0 0 var(--tafel-breite);
    border-top: 0;
    border-left: 1px solid var(--linie);
    padding: 32px 28px;
    justify-content: space-between;
  }
  .zeit-wert { font-size: 5rem; }
}

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