:root {
  --grund: #12161c;
  --flaeche: #1b212a;
  --rand: #2b3340;
  --schrift: #e8ecf2;
  --leise: #9aa6b6;
  --gold: #f0b429;
  --rot: #d94436;
  --blau: #3b82c4;
  --gut: #4ba36a;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--grund);
  color: var(--schrift);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
  overscroll-behavior-y: contain;
}

.kopf {
  position: sticky; top: 0; z-index: 5;
  background: var(--grund);
  border-bottom: 1px solid var(--rand);
  padding: max(env(safe-area-inset-top), 8px) 12px 0;
}
.kopf h1 {
  margin: 0 0 6px; font-size: 20px; letter-spacing: .04em;
  font-weight: 600;
}
.kopf h1::before { content: "◎ "; color: var(--gold); }

.reiter { display: flex; gap: 4px; }
.reiter button {
  flex: 1; padding: 10px 4px; font-size: 14px;
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--leise); cursor: pointer;
}
.reiter button.aktiv { color: var(--schrift); border-bottom-color: var(--gold); }

main { padding: 14px 12px 40px; max-width: 720px; margin: 0 auto; }
.ansicht { display: none; }
.ansicht.aktiv { display: block; }
.schritt[hidden] { display: none; }

.hinweis { color: var(--leise); font-size: 14px; margin: 6px 0 14px; }

.knopf {
  display: block; width: 100%; padding: 14px; margin: 8px 0;
  border-radius: 12px; border: 1px solid var(--rand);
  background: var(--flaeche); color: var(--schrift);
  font-size: 16px; text-align: center; cursor: pointer;
}
.knopf.gross { background: var(--gold); color: #17202b; border-color: var(--gold); font-weight: 600; }
.knopf.gross:disabled { background: var(--rand); color: var(--leise); border-color: var(--rand); }
.knopf.leise { background: var(--flaeche); }
.knopf.schmal { padding: 10px; font-size: 14px; color: var(--leise); }
.knopfreihe { display: flex; gap: 8px; }
.knopfreihe .knopf { margin: 8px 0 4px; }

.leinwand-huelle {
  position: relative; touch-action: none;
  display: flex; justify-content: center;
}
/* Hoehe begrenzen, damit Trefferliste und Knoepfe ohne Scrollen erreichbar
   bleiben. Bewusst proportional statt object-fit: sonst entstehen Raender im
   Kasten, und getroffen wird dann neben dem, was man antippt. */
#leinwand {
  max-width: 100%; max-height: 58vh; width: auto; height: auto;
  display: block; border-radius: 12px; border: 1px solid var(--rand);
  touch-action: none;
}
#lupe {
  position: absolute; top: 8px; right: 8px;
  width: 110px; height: 110px;
  border-radius: 50%; border: 2px solid var(--gold);
  box-shadow: 0 6px 20px #0009; pointer-events: none; background: #000;
}

.treffer {
  list-style: none; margin: 10px 0 0; padding: 0;
  display: flex; gap: 8px; flex-wrap: wrap;
  /* Feste Hoehe: die Liste waechst beim Tippen, das Bild darf dabei nicht
     unter dem Finger wegrutschen. */
  min-height: 62px; align-items: flex-start;
}
.treffer li {
  display: flex; flex-direction: column; align-items: center;
  padding: 6px 12px; min-width: 62px;
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: 10px;
}
.treffer .ring { font-size: 24px; font-weight: 700; line-height: 1.1; color: var(--gold); }
.treffer .detail { font-size: 11px; color: var(--leise); }
.anmerkung {
  min-height: 2.6em; margin: 6px 0 0; font-size: 13px; color: var(--gold);
}
.treffer li.knapp { border-color: #6b5a1f; }
.treffer li.knapp .ring { color: #ffd75e; }

.summe {
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: 12px;
  padding: 14px; margin-bottom: 14px;
}
.summe .zahl { font-size: 30px; font-weight: 700; }
.summe .zeile { display: flex; justify-content: space-between; padding: 3px 0; }
.summe .zeile span:last-child { color: var(--leise); }

.tag { margin-bottom: 18px; }
.tag h3 {
  font-size: 14px; color: var(--leise); font-weight: 600;
  margin: 0 0 6px; text-transform: none;
}
.passe {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 6px;
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: 10px;
}
.passe .ringe { font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.passe .punkte { margin-left: auto; font-weight: 700; }
.passe button {
  background: none; border: none; color: var(--leise); font-size: 18px;
  cursor: pointer; padding: 0 4px;
}

.feld {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px; margin-bottom: 8px;
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: 10px;
}
.feld small { display: block; color: var(--leise); font-size: 12px; }
.feld select, .feld input[type=number] {
  background: var(--grund); color: var(--schrift);
  border: 1px solid var(--rand); border-radius: 8px; padding: 8px;
  font-size: 15px; min-width: 7em;
}
.feld.schalter input { width: 22px; height: 22px; }
.block { margin-top: 18px; }
.fusszeile { color: var(--leise); font-size: 12px; text-align: center; margin-top: 20px; }

#streubild { width: 100%; height: auto; background: var(--flaeche);
  border: 1px solid var(--rand); border-radius: 12px; }

.leer { color: var(--leise); text-align: center; padding: 40px 10px; }
