/* ============================================================================
   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); }

.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; }
