/* Spot den Leerstand — smartphone-first, dunkel, spielerisch.
   Kein Framework, kein CDN: eine Datei, die auf jedem Handy sofort da ist. */
:root {
  --bg: #0d1117;
  --bg2: #151b24;
  --card: #1b2230;
  --line: #2b3444;
  --fg: #e9eef6;
  --muted: #93a1b5;
  --accent: #ffb703;
  --accent2: #4cc9f0;
  --good: #3ddc84;
  --bad: #ff6b6b;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 50% -200px, #1d2836 0%, var(--bg) 60%);
  color: var(--fg);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  display: flex; flex-direction: column;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
main { flex: 1; width: 100%; max-width: 900px; margin: 0 auto; padding: 16px 16px 48px; }

/* Kopf */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: rgba(13,17,23,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--fg); font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 22px; }
.brand-text b { color: var(--accent); }
.topbar nav { display: flex; align-items: center; gap: 14px; font-size: 14px; flex-wrap: wrap; }
.nav-cta { background: var(--accent); color: #221a00 !important; padding: 7px 14px; border-radius: 999px; font-weight: 700; }
.nav-cta:hover { text-decoration: none; filter: brightness(1.08); }
.nav-staff { color: var(--accent) !important; }
.inline { display: inline; }
button.link { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0; }

.playerbar, .eventbar {
  max-width: 900px; margin: 10px auto 0; padding: 8px 16px;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px;
}
.eventbar { background: linear-gradient(90deg, #3a2a00, #1b2230); border: 1px solid #5a4300;
  border-radius: var(--radius); margin-top: 12px; }
.pts { font-weight: 700; color: var(--accent); }
.chip { background: var(--card); border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px; }
.chip.streak { border-color: #7a4a00; }
.chip.money { border-color: #1f6b3f; color: var(--good); }
.chip.pending { border-color: #5a4300; color: var(--accent); }
.muted { color: var(--muted); }

/* Karten & Raster */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 14px 0; }
.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-align: center; }
.stat b { display: block; font-size: 26px; color: var(--accent); line-height: 1.1; }
.stat span { font-size: 12px; color: var(--muted); }

h1 { font-size: 26px; margin: 8px 0 4px; line-height: 1.2; }
h2 { font-size: 19px; margin: 22px 0 8px; }
h3 { font-size: 16px; margin: 14px 0 6px; }
.lead { color: var(--muted); font-size: 15px; margin-top: 0; }

/* Hero */
.hero { text-align: center; padding: 22px 8px 6px; }
.hero h1 { font-size: 32px; }
.hero .big { font-size: 44px; display: block; margin-bottom: 6px; }
.btn {
  display: inline-block; background: var(--accent); color: #221a00; font-weight: 700;
  padding: 13px 22px; border-radius: 999px; border: 0; cursor: pointer; font-size: 16px;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--fg); }
.btn.small { padding: 7px 14px; font-size: 14px; }
.btn.danger { background: var(--bad); color: #2a0000; }
.btn.wide { width: 100%; }

/* Status-Leiter */
.ladder { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.step { flex: 1; min-width: 92px; text-align: center; padding: 8px 4px; border-radius: 10px;
  background: var(--bg2); border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.step .ic { display: block; font-size: 20px; filter: grayscale(1) opacity(.45); }
.step.done { border-color: #1f6b3f; color: var(--fg); }
.step.done .ic { filter: none; }
.step.now { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; color: var(--fg); }
.step.now .ic { filter: none; }

/* Listen */
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .t { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .s { display: block; font-size: 12px; color: var(--muted); }
.thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--bg2); flex: none; }

/* Tabellen */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 480px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
tr.me { background: #23303f; }

/* Formulare */
label { display: block; margin: 12px 0 4px; font-size: 14px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg2); color: var(--fg); font-size: 16px; font-family: inherit;
}
textarea { min-height: 84px; resize: vertical; }
input[type=file] { width: 100%; color: var(--muted); font-size: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1; min-width: 130px; }
.check { display: flex; gap: 9px; align-items: flex-start; margin: 12px 0; }
.check input { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.check label { margin: 0; color: var(--fg); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); margin: 14px 0; padding: 12px 14px; }
legend { color: var(--accent); font-size: 13px; padding: 0 6px; }

/* Foto-Aufnahme */
.shot { border: 2px dashed var(--line); border-radius: var(--radius); padding: 18px; text-align: center; background: var(--bg2); }
.shot.filled { border-style: solid; border-color: var(--good); }
.shot img { max-width: 100%; border-radius: 10px; margin-top: 10px; }
.shot .hint { font-size: 13px; color: var(--muted); }

/* Meldungen */
.flash { padding: 11px 14px; border-radius: 10px; margin: 12px 0; font-size: 14px; }
.flash.ok { background: #10301f; border: 1px solid #1f6b3f; }
.flash.err { background: #3a1a1a; border: 1px solid #7a2b2b; }
.badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.badge.ok { border-color: #1f6b3f; color: var(--good); }
.badge.warn { border-color: #5a4300; color: var(--accent); }
.badge.bad { border-color: #7a2b2b; color: var(--bad); }
.score { font-weight: 700; }
.score.hi { color: var(--good); } .score.mid { color: var(--accent); } .score.lo { color: var(--bad); }

/* Album */
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.trophy { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 6px; text-align: center; font-size: 11px; }
.trophy.have { border-color: var(--accent); }
.trophy .ic { font-size: 22px; display: block; }
.progress { height: 7px; background: var(--bg2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); }

/* Admin-Navigation */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.tabs a { background: var(--card); border: 1px solid var(--line); padding: 7px 13px; border-radius: 999px; font-size: 14px; color: var(--fg); }
.tabs a.active { border-color: var(--accent); color: var(--accent); }

footer {
  border-top: 1px solid var(--line); padding: 18px 16px 30px; text-align: center;
  font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 6px;
}
.powered b { color: var(--fg); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

@media (max-width: 520px) {
  .topbar nav { gap: 10px; font-size: 13px; }
  .brand-text { font-size: 15px; }
  .hero h1 { font-size: 26px; }
  main { padding: 12px 12px 40px; }
}

/* ===== Karten, Reviere, Umschau ===== */
.map-gross { height: 62vh; min-height: 380px; width: 100%; }
.map-mittel { height: 260px; width: 100%; }
.map-klein { height: 190px; width: 100%; border-radius: 12px; margin: 10px 0; border: 1px solid var(--line); }
.leaflet-container { background: #10161f; font: inherit; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--card); color: var(--fg); border: 1px solid var(--line); }
.leaflet-popup-content { margin: 10px 12px; font-size: 14px; line-height: 1.45; }
.leaflet-popup-content a { color: var(--accent2); }
.leaflet-control-layers, .leaflet-bar a, .leaflet-control-attribution {
  background: var(--card) !important; color: var(--fg) !important; border-color: var(--line) !important;
}
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-bar a { border-bottom-color: var(--line) !important; }
.revier-etikett span {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(13, 17, 23, .82); border: 2px solid var(--line);
  color: var(--fg); font-size: 12px; font-weight: 700;
}
.dot { width: 14px; height: 14px; border-radius: 50%; flex: none; border: 2px solid #0d1117; }
.dot-spotted { background: #93a1b5; } .dot-confirmed { background: #4cc9f0; }
.dot-lifeline { background: #ffb703; } .dot-rescue_running { background: #ff922b; }
.dot-rescued { background: #3ddc84; }
.revier-farbe { width: 14px; height: 14px; border-radius: 4px; flex: none; }

.ar-szene { position: relative; border-radius: var(--radius); overflow: hidden; background: #000;
  aspect-ratio: 3 / 4; max-height: 72vh; margin: 14px 0; border: 1px solid var(--line); }
.ar-szene video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ar-buehne { position: absolute; inset: 0; pointer-events: none; }
.ar-tag { position: absolute; display: flex; align-items: center; gap: 7px;
  background: rgba(13, 17, 23, .84); border: 1px solid var(--accent); border-radius: 999px;
  padding: 7px 13px; color: var(--fg); font-size: 13px; pointer-events: auto;
  white-space: nowrap; backdrop-filter: blur(3px); transition: left .12s linear, top .12s linear; }
.ar-tag:hover { text-decoration: none; }
.ar-ic { font-size: 16px; }
.ar-dist { color: var(--accent); font-weight: 700; }
.ar-kompass { position: absolute; left: 12px; bottom: 12px; background: rgba(13, 17, 23, .8);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 12px; }

/* ===== Melde-Strecke: antippen statt ausfüllen ===== */
.stufe { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin: 14px 0; }
.stufe-kopf { display: flex; align-items: center; gap: 10px; font-size: 16px;
  font-weight: 600; margin-bottom: 10px; }
.stufe-nr { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border-radius: 50%; background: var(--accent); color: #221a00; font-size: 14px; font-weight: 800; flex: none; }
.stufe.zusatz summary, .adress-fallback summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.adress-fallback { margin-top: 10px; }
.adress-fallback input { margin-top: 8px; }
.geo-zeile { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; }

.shot-flaeche { display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer; margin: 0; padding: 14px 8px; }
.shot-ic { font-size: 40px; line-height: 1; }
.shot-gross { font-size: 18px; font-weight: 700; color: var(--accent); }
.link-like { color: var(--accent2); cursor: pointer; text-decoration: underline; }

.wahl { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 9px; }
.kachel { position: relative; display: flex; flex-direction: column; align-items: center;
  justify-content: flex-start; gap: 5px; padding: 13px 8px 11px; border-radius: 12px;
  border: 2px solid var(--line); background: var(--bg2); color: var(--fg);
  font-size: 24px; cursor: pointer; font-family: inherit; line-height: 1.15;
  transition: border-color .12s, transform .08s, background .12s; }
.kachel span { font-size: 12px; color: var(--muted); text-align: center; }
.kachel:active { transform: scale(.97); }
.kachel.aktiv { border-color: var(--accent); background: #241d06; }
.kachel.aktiv span { color: var(--fg); }
.kachel em { position: absolute; top: -8px; right: -4px; background: var(--accent); color: #221a00;
  font-size: 10px; font-weight: 800; font-style: normal; padding: 2px 6px; border-radius: 999px; }

.beute { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  background: linear-gradient(90deg, #241d06, var(--card)); border: 1px solid #5a4300;
  border-radius: var(--radius); padding: 13px 16px; margin: 16px 0 10px; }
.beute-zahl { font-size: 22px; font-weight: 800; color: var(--accent); }
.beute-text { font-size: 12px; color: var(--muted); }
.btn.gross { padding: 16px 22px; font-size: 17px; }
.mini { font-size: 12px; }

/* ===== Diagramme (selbst gezeichnetes SVG) ===== */
.chart { width: 100%; height: auto; display: block; margin: 6px 0 2px; overflow: visible; }
.chart .c-label { fill: var(--muted); font-size: 12px; }
.chart .c-val { fill: var(--fg); font-size: 12px; font-weight: 700; }
.chart .c-icon { font-size: 15px; }
.chart .c-mitte { fill: var(--fg); font-size: 24px; font-weight: 800; text-anchor: middle; }
.chart .c-mitte-sub { fill: var(--muted); font-size: 11px; text-anchor: middle; }
.kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 12px; }
.kpi .k { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.kpi .k b { display: block; font-size: 25px; color: var(--accent); line-height: 1.1; }
.kpi .k span { font-size: 12px; color: var(--muted); }
.kpi .k.gut b { color: var(--good); }
.review-foto { width: 100%; border-radius: 12px; border: 1px solid var(--line); display: block; }
.list li.klickbar { cursor: pointer; }
.list li.klickbar:hover { background: #1f2937; }

/* ===== Daumen-Tauglichkeit =================================================
   Befund vom 26.07.2026 (gemessen mit tools/beweisbilder.py): 17 von 34
   Zielflächen unter 48 Pixel, die Hauptaktion "Melden" bei 34 — und sie sass
   oben, in der am schlechtesten erreichbaren Zone. Rund drei Viertel aller
   Berührungen passieren mit dem Daumen, etwa die Hälfte bedient einhändig.
   Untergrenze WCAG 2.2 SC 2.5.8: 24 Pixel. Apple empfiehlt 44, Material 48 —
   wir nehmen 48 als Mindestmass, weil im Gehen getippt wird.
   ========================================================================= */
:root { --tap: 48px; --thumbbar-h: 62px; }

.thumbbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: stretch;
  background: rgba(13, 17, 23, .96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.thumbbar .tb {
  position: relative;
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px;
  min-height: var(--thumbbar-h); padding: 7px 4px;
  color: var(--muted); font-size: 11px; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.thumbbar .tb:hover { text-decoration: none; }
.thumbbar .tb-ic { font-size: 22px; line-height: 1; }
.thumbbar .tb.aktiv { color: var(--fg); }
.thumbbar .tb.aktiv .tb-ic { filter: drop-shadow(0 0 7px rgba(255, 183, 3, .55)); }
.thumbbar .tb.aktiv::before {
  content: ""; position: absolute; top: 0; width: 34px; height: 3px;
  border-radius: 0 0 3px 3px; background: var(--accent);
}
.thumbbar .tb-cta { color: var(--accent); font-weight: 700; }

/* Hauptaktion auf die Daumenseite: rechts für Rechtshänder (Standard),
   links, wenn die Person auf Linkshand gestellt hat. */
:root[data-hand="left"] .thumbbar { flex-direction: row-reverse; }

body { padding-bottom: calc(var(--thumbbar-h) + env(safe-area-inset-bottom, 0px)); }

/* Oben nur noch wenige, dafür grosse Ziele */
.topnav { display: flex; align-items: center; gap: 6px; }
.topnav a {
  display: inline-flex; align-items: center;
  min-height: var(--tap); padding: 0 13px; font-size: 14px;
}
.topbar .brand { min-height: var(--tap); }

/* Alle Knöpfe auf Mindestmass */
.btn, button, .btn.small, .btn.ghost.small {
  min-height: var(--tap);
  display: inline-flex; align-items: center; justify-content: center;
}
.btn.small { padding: 0 16px; font-size: 14px; }
.btn.gross { min-height: 58px; }
.nav-cta { min-height: var(--tap); display: inline-flex; align-items: center; }

/* Listen-Zeilen sind Hauptziele */
.list li { min-height: var(--tap); padding: 12px 0; }

.list li.klickbar, .list li a { -webkit-tap-highlight-color: rgba(76, 201, 240, .12); }

/* Fusszeilen-Links: waren 14 Pixel hoch, jetzt echte Flächen */
.footlinks { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-bottom: 6px; }
.footlinks a {
  display: inline-flex; align-items: center; min-height: var(--tap);
  padding: 0 14px; font-size: 14px;
}
.logout-form { margin-top: 12px; }

summary { display: flex; align-items: center; min-height: var(--tap); }

/* Fremd-Standard von Leaflet: 30 Pixel sind zu klein für den Daumen */
.leaflet-touch .leaflet-bar a,
.leaflet-bar a { width: var(--tap) !important; height: var(--tap) !important;
                 line-height: var(--tap) !important; font-size: 20px !important; }
.leaflet-control-layers-toggle { width: var(--tap) !important; height: var(--tap) !important; }

.check input[type=checkbox] { width: 26px; height: 26px; }
.check { min-height: var(--tap); align-items: center; }

.hand-wahl { display: flex; gap: 10px; }
.hand-wahl button { flex: 1; min-height: 54px; }
.hand-wahl button.aktiv { border-color: var(--accent); background: #241d06; color: var(--fg); }

/* Auf grossen Bildschirmen ist die Daumen-Leiste unnötig */
@media (min-width: 860px) {
  .thumbbar { position: static; border-top: 0; border-bottom: 1px solid var(--line);
              max-width: 900px; margin: 0 auto; background: none; backdrop-filter: none; }
  body { padding-bottom: 0; }
  .thumbbar .tb { flex-direction: row; gap: 8px; font-size: 14px; }
  .thumbbar .tb-ic { font-size: 18px; }
}

/* Nachtrag nach der zweiten Messung: die letzten drei echten Verstösse */

/* Umschalter (Gesamt / Diese Woche) waren 38 Pixel hoch */
.tabs a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 16px; }

/* Verweise in Listen sind das Hauptziel der Zeile — sie müssen die Zeilenhöhe
   füllen, sonst tippt man knapp daneben ins Leere. */
/* Block statt flex: sonst greift text-overflow:ellipsis nicht und lange
   Adressen laufen unter das Etikett. Die Zielhoehe kommt aus dem Polster. */
.list a.t { display: block; min-height: var(--tap); padding: 12px 0; }
.list li > a { display: flex; align-items: center; min-height: var(--tap); }

/* Weiterführende Text-Links ("Ganze Rangliste →") */
.weiter { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 4px; }
