/* ============================================================================
   Screens — Layout je Ansicht. Nutzt ausschliesslich Tokens und Components.
   ========================================================================== */

/* --- Topbar ---------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: var(--z-top);
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  min-height: var(--h-topbar);
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-ink-500);
}
.topbar__brand {
  display: flex; align-items: center; gap: var(--s-2); flex: 1; min-width: 0;
  font-family: var(--f-serif); letter-spacing: .04em; font-size: 15px;
}
.topbar__mark { color: var(--c-accent); display: flex; }
.topbar__title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__right { display: flex; align-items: center; gap: var(--s-2); }
.topbar select {
  background: var(--c-ink-600); color: var(--c-bone-100);
  border: 1px solid var(--c-ink-500); border-radius: var(--r-sm);
  padding: var(--s-1) var(--s-1); min-height: 34px;
}

/* --- 1. Genre -------------------------------------------------------------- */
.hero { padding: var(--s-6) 0 var(--s-8); border-bottom: 1px solid var(--c-ink-500); margin-bottom: var(--s-6); }

.genre {
  display: flex; align-items: center; gap: var(--s-4);
  padding: var(--s-4); background: var(--c-ink-700);
  border: none; color: inherit; text-align: left; width: 100%;
  min-height: var(--hit-min); cursor: pointer;
  transition: background var(--m-fast) var(--m-ease);
}
.genre:hover:not([disabled]) { background: var(--c-ink-600); }
.genre[disabled] { cursor: not-allowed; opacity: .45; }
.genre__glyph { display: flex; flex: 0 0 auto; }
.genre[disabled] .genre__glyph { color: var(--c-bone-400) !important; }
.genre__text { flex: 1; min-width: 0; }
.genre__name { font-family: var(--f-serif); font-size: 18px; display: block; }
.genre__tag { font-size: 12.5px; color: var(--c-bone-400); }
.genre__state {
  font-size: 10px; letter-spacing: var(--track-chip); text-transform: uppercase;
  color: var(--c-bone-400); border: 1px solid var(--c-ink-500);
  border-radius: var(--r-pill); padding: 3px var(--s-2); white-space: nowrap;
}
.genre__state[data-live] { color: var(--c-accent); border-color: var(--c-accent-dim); }

/* --- 2. Route -------------------------------------------------------------- */
.cover {
  background: radial-gradient(120% 90% at 30% 0%, color-mix(in srgb, var(--accent) 16%, var(--bg)) 0%, var(--bg-2) 70%);
  margin: calc(var(--s-6) * -1) calc(var(--s-5) * -1) var(--s-5);
  padding: var(--s-12) var(--s-5) var(--s-8);
  border-bottom: 1px solid var(--c-ink-500);
}
.meta-row { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-4); }

/* Vorschaukarte auf dem Routen-Screen. Nicht bedienbar (siehe map.js), also
   auch keine Zeigerhand und kein Fangen von Touch-Gesten — der Finger soll
   ueber die Karte hinweg weiterscrollen koennen. Bedient wird sie im
   Kartenblatt, und dorthin fuehrt der Knopf oben rechts. */
.route-preview { position: relative; margin-top: var(--s-2); }
.route-preview__canvas {
  height: 200px;
  border: 1px solid var(--c-ink-500); border-radius: var(--r-sm);
  overflow: hidden; background: var(--c-ink-700);
  touch-action: pan-y;
}
.route-preview__canvas .maplibregl-canvas { cursor: default; }

/* Der Knopf sagt, dass hier mehr ist. Eine Karte ohne diesen Hinweis sieht
   aus wie ein Bild, und niemand tippt auf ein Bild. */
.route-preview__open {
  position: absolute; right: var(--s-2); top: var(--s-2);
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: var(--hit-min); padding: 0 var(--s-3);
  font-size: var(--t-micro); letter-spacing: .04em; text-transform: uppercase;
  color: var(--text); background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line); border-radius: var(--r-pill);
  backdrop-filter: blur(8px); cursor: pointer;
}
.route-preview__open:hover { color: var(--accent); }
.route-preview__open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- Kartenblatt ----------------------------------------------------------
   Vollbild, weil es um Orientierung geht: Wer vergleicht, wo etwas liegt,
   braucht Flaeche, nicht ein Guckloch. Liegt unter dem Dev-Drawer (70) und
   ueber allem anderen. */
.mapsheet {
  position: fixed; inset: 0; z-index: 65;
  display: flex; flex-direction: column; background: var(--bg);
}
.mapsheet__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: var(--s-2) var(--s-3) var(--s-2) var(--s-4);
  min-height: var(--h-topbar); border-bottom: 1px solid var(--c-ink-500);
}
.mapsheet__title {
  font-family: var(--f-serif); font-size: 16px; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mapsheet__close {
  flex: none; width: var(--hit-min); height: var(--hit-min);
  display: grid; place-items: center; font-size: 17px; line-height: 1;
  color: var(--text); background: var(--c-ink-600);
  border: 1px solid var(--c-ink-500); border-radius: var(--r-md); cursor: pointer;
}
.mapsheet__close:hover { color: var(--accent); }
.mapsheet__close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mapsheet__body { position: relative; flex: 1; min-height: 0; }
.mapsheet__map { position: absolute; inset: 0; }
.mapsheet__foot {
  display: flex; align-items: center; min-height: 68px;
  padding: var(--s-3) var(--s-4); border-top: 1px solid var(--c-ink-500);
}
.mapsheet__card { display: flex; align-items: center; gap: var(--s-3); width: 100%; }
.mapsheet__glyph { display: flex; flex: none; }
.mapsheet__text { flex: 1; min-width: 0; font-size: 14.5px; }
.mapsheet__card .btn { flex: none; }

/* Startpunkte der anderen Routen. Knoepfe, keine Dekoration — deshalb
   Zielgroesse, Fokusring und Genre-Farbe. */
.map-start {
  width: 34px; height: 34px; padding: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  color: var(--pin, var(--accent)); background: var(--surface);
  border: 1.5px solid var(--pin, var(--accent));
  box-shadow: 0 1px 5px rgb(0 0 0 / .28);
  transition: transform var(--m-fast) var(--m-ease), background var(--m-fast) var(--m-ease);
}
.map-start:hover { transform: scale(1.1); }
.map-start[data-active] { background: var(--pin, var(--accent)); color: var(--bg); transform: scale(1.15); }
.map-start:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Zusatzkosten unterwegs. Bewusst NICHT die Warnfarbe der Inhaltswarnung —
   das hier ist kein Risiko, sondern eine Information, die vor dem Kauf
   sichtbar sein muss (Redaktionsstatut Regel 7). */
.extra-costs {
  margin-top: var(--s-3); padding: var(--s-3);
  border: 1px solid var(--c-ink-500); border-left: 3px solid var(--c-accent-dim, var(--accent));
  border-radius: var(--r-sm); background: var(--c-ink-700);
  font-size: 13.5px;
}
.extra-costs__head {
  font-size: var(--t-micro); letter-spacing: var(--track-chip, .08em);
  text-transform: uppercase; color: var(--c-bone-400); margin-bottom: var(--s-1);
}

/* Gruppengroesse in der Kasse. Ziffern statt Auswahlliste: Es sind hoechstens
   sechs, und im Gehen trifft der Daumen einen Knopf besser als ein Menue. */
.party { margin: var(--s-4) 0; }
.party__row { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-2); }
.party__btn {
  min-width: var(--hit-min); min-height: var(--hit-min);
  display: grid; place-items: center; padding: 0 var(--s-2);
  font-family: var(--f-serif); font-size: 17px;
  color: var(--text); background: var(--c-ink-700);
  border: 1px solid var(--c-ink-500); border-radius: var(--r-md); cursor: pointer;
}
.party__btn[aria-pressed="true"] {
  background: var(--c-accent); color: var(--accent-ink, var(--bg)); border-color: var(--c-accent);
}
.party__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.stop-list { margin-top: var(--s-6); border-top: 1px solid var(--c-ink-500); }
.stop { display: flex; gap: var(--s-4); padding: var(--s-3) 0; border-bottom: 1px solid var(--c-ink-500); align-items: baseline; }
.stop__n { font-family: var(--f-serif); color: var(--c-accent); width: 22px; flex: none; font-size: 14px; }
.stop__name { font-size: 14.5px; }
.stop__hint { font-size: var(--t-meta); color: var(--c-bone-400); }

.bottom-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--w-app); z-index: var(--z-bar);
  display: flex; align-items: center; gap: var(--s-4);
  padding: var(--s-3) var(--s-5) calc(var(--s-3) + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(12px);
  border-top: 1px solid var(--c-ink-500);
}
.bottom-bar__price { flex: 1; line-height: 1.25; }
.bottom-bar__price strong { font-family: var(--f-serif); font-size: 20px; display: block; font-weight: 400; }
.bottom-bar__price span { font-size: 11.5px; color: var(--c-bone-400); }

/* --- 3. Kasse -------------------------------------------------------------- */
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.pay-grid .btn { padding: var(--s-4); }

.code-box {
  border: 1px dashed var(--c-accent-dim); border-radius: var(--r-lg);
  padding: var(--s-4); margin-top: var(--s-5); text-align: center; background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
.code-box strong {
  font-family: var(--f-serif); font-size: 28px; letter-spacing: .22em;
  display: block; margin: var(--s-2) 0; color: var(--c-bone-100); font-weight: 400;
}
.progress-line { height: 2px; background: var(--c-ink-500); border-radius: 2px; overflow: hidden; margin-top: var(--s-3); }
.progress-line > i { display: block; height: 100%; width: 0; background: var(--c-signal-ok); transition: width var(--m-base) linear; }

/* --- 4. Einwilligung ------------------------------------------------------- */
.consent-list { margin: var(--s-5) 0; }
.consent-item {
  display: flex; gap: var(--s-3); align-items: flex-start;
  padding: var(--s-3) 0; border-bottom: 1px solid var(--c-ink-500);
}
.consent-item input { margin-top: 3px; width: 20px; height: 20px; accent-color: var(--c-accent); flex: none; }
.consent-item label { font-size: 13.5px; color: var(--c-bone-200); }
.consent-item label b { color: var(--c-bone-100); font-weight: 500; }

/* --- 5. Player ------------------------------------------------------------- */
.map { position: absolute; inset: 0; z-index: var(--z-map); }
.maplibregl-ctrl-attrib { font-size: 9px !important; background: color-mix(in srgb, var(--bg) 70%, transparent) !important; }
.maplibregl-ctrl-attrib a { color: var(--c-bone-400) !important; }

.hud {
  position: absolute; inset-inline: 0; top: 0; z-index: var(--z-hud);
  padding: var(--s-3) var(--s-4);
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 92%, transparent), transparent);
  pointer-events: none;
}
.hud__bar { height: 2px; background: var(--c-ink-500); border-radius: 2px; overflow: hidden; }
.hud__fill { height: 100%; width: 0; background: var(--c-accent); transition: width .45s var(--m-ease); }
.hud__row {
  display: flex; justify-content: space-between; margin-top: 7px;
  font-size: 11.5px; color: var(--c-bone-300); letter-spacing: .03em;
}
.hud__dist { color: var(--c-bone-100); }

.controls {
  position: absolute; inset-inline: var(--s-3); bottom: calc(var(--h-sheet) + var(--s-3));
  z-index: var(--z-hud); display: flex; gap: var(--s-2); align-items: center;
}
.controls .btn { font-size: var(--t-meta); padding: var(--s-2) var(--s-3); min-height: 38px;
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px); }
.controls input[type="range"] { flex: 1; max-width: 120px; accent-color: var(--c-accent); }
/* Ausgegraut, sobald die Simulation aus ist — sonst sieht ein wirkungsloser
   Regler nach einem kaputten aus (Feldtest 7.9.2026, Befund B). */
.controls input[type="range"]:disabled { opacity: .4; cursor: not-allowed; }

/* Die Steuerung sass fest auf Hoehe des kleinen Blattes und verschwand darunter,
   sobald es aufging — GPS-Knopf, Simulation und Regler waren dann unerreichbar
   (Feldtest 7.9.2026, Befund F). Sie wandert jetzt mit. */
[data-sheet="tall"] .controls { bottom: calc(var(--h-sheet-tall) + var(--s-3)); }

.wp-head { display: flex; align-items: baseline; gap: var(--s-3); margin-bottom: 2px; }
.wp-head__n { font-family: var(--f-serif); color: var(--c-accent); font-size: 13px; }
.narration {
  font-family: var(--f-serif); font-size: var(--t-narrate); line-height: var(--t-narrate-lh);
  color: var(--text); margin: var(--s-3) 0 var(--s-4);
}
.audio-row { display: flex; gap: var(--s-2); align-items: center; margin-bottom: var(--s-4); flex-wrap: wrap; }
.audio-row .footnote { flex: 1; min-width: 160px; }

.locked { text-align: center; padding: var(--s-3) 0; }
.locked__dist { font-family: var(--f-serif); font-size: 40px; color: var(--c-bone-100); line-height: 1; }
.locked__dist small { font-size: 15px; color: var(--c-bone-400); }

.challenge { border-top: 1px solid var(--c-ink-500); margin-top: var(--s-4); padding-top: var(--s-4); }

/* --- 6. Protokoll ---------------------------------------------------------- */
.log-head { padding: var(--s-5) 0 var(--s-4); border-bottom: 1px solid var(--c-ink-500); margin-bottom: var(--s-4); }
.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--c-ink-500); border: 1px solid var(--c-ink-500);
  border-radius: var(--r-lg); overflow: hidden; margin-bottom: var(--s-5);
}
.stat { background: var(--c-ink-700); padding: var(--s-3); text-align: center; }
.stat b { font-family: var(--f-serif); font-size: 24px; font-weight: 400; display: block; }
.stat span { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--c-bone-400); }

.trace { width: 100%; height: auto; border: 1px solid var(--c-ink-500); border-radius: var(--r-lg); background: var(--surface); display: block; }

.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); margin-top: var(--s-4); }
.photo-grid figure { margin: 0; }
.photo-grid img { width: 100%; border-radius: var(--r-md); display: block; border: 1px solid var(--c-ink-500); }
.photo-grid figcaption { font-size: var(--t-micro); color: var(--c-bone-400); margin-top: 5px; }

.log-actions { display: flex; gap: var(--s-3); margin-top: var(--s-6); }
.log-actions .btn { flex: 1; }

/* Zoom an der Karte. Ohne diese Knoepfe blieb nur Pinch — und ein Doppeltipp
   zoomte in den unscharfen Bereich, aus dem man mit einer Hand kaum zurueckfand
   (Feldtest 7.9.2026). Rechts oben, weil unten links die Steuerung sitzt. */
.zoom {
  position: absolute; right: var(--s-3); top: calc(var(--s-3) + 34px);
  display: flex; flex-direction: column; gap: var(--s-1);
  z-index: var(--z-controls, 3);
}
.zoom__btn {
  width: 44px; height: 44px;          /* Zielgroesse fuer den Daumen im Gehen */
  display: grid; place-items: center;
  font-size: 20px; line-height: 1; font-family: var(--f-ui, inherit);
  color: var(--text); background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line); border-radius: var(--r-md);
  backdrop-filter: blur(8px); cursor: pointer;
}
.zoom__btn:active { background: var(--surface-2); }
.zoom__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
