/* ABSV Jugend – Vereinsfarben Blau und Weiß */
:root {
  --blau: #1565c0;
  --blau-dunkel: #0d47a1;
  --blau-hell: #e3effc;
  --blau-mittel: #90bdf0;
  --weiss: #ffffff;
  --grund: #f3f7fc;
  --text: #16243a;
  --text-leise: #5b6b82;
  --linie: #d6e2f0;
  --gruen: #1b8a4a;
  --gruen-hell: #e2f5ea;
  --rot: #c62828;
  --rot-hell: #fdecec;
  --gelb: #8a5a00;
  --gelb-hell: #fff4d6;
  --radius: 14px;
  --schatten: 0 1px 3px rgba(13, 71, 161, .10), 0 4px 14px rgba(13, 71, 161, .06);
  /* Abstand zu Status- und Navigationsleiste; die Android-App liefert --safe-area-inset-* */
  --oben: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  --unten: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font: 18px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(76px + var(--unten));
}
a { color: var(--blau); }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Kopfzeile ---------- */
.kopf {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--oben)) 12px 10px;
  background: var(--blau); color: var(--weiss);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}
.kopf h1 { flex: 1; margin: 0; font-size: 21px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopf-logo { width: 40px; height: 40px; border-radius: 50%; background: var(--weiss); padding: 2px; }
.kopf-zurueck, .kopf-knopf {
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: 50%; background: transparent; color: var(--weiss); cursor: pointer;
}
.kopf-zurueck:active, .kopf-knopf:active { background: rgba(255, 255, 255, .2); }
.kopf-zurueck svg { width: 28px; height: 28px; stroke-width: 2.5; }
.sync-zeichen { color: var(--weiss); font-size: 20px; font-weight: 700; text-decoration: none; width: 28px; text-align: center; }
.sync-zeichen.dreht { animation: drehen 1s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }

/* ---------- Untere Leiste ---------- */
.leiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; background: var(--weiss); border-top: 1px solid var(--linie);
  padding-bottom: var(--unten);
}
.leiste a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 7px; color: var(--text-leise); text-decoration: none; font-size: 13px; font-weight: 600;
}
.leiste a svg { width: 26px; height: 26px; }
.leiste a.aktiv { color: var(--blau); }
.leiste a.aktiv svg { background: var(--blau-hell); border-radius: 12px; width: 52px; padding: 0 13px; }

/* ---------- Inhalt ---------- */
main { max-width: 720px; margin: 0 auto; padding: 14px 16px 24px; }
h2 { font-size: 19px; margin: 22px 4px 10px; color: var(--blau-dunkel); }
h2:first-child { margin-top: 4px; }
.leer { color: var(--text-leise); text-align: center; padding: 20px 8px; }
.leise { color: var(--text-leise); font-size: 15px; }

.karte {
  background: var(--weiss); border-radius: var(--radius); box-shadow: var(--schatten);
  padding: 14px 16px; margin-bottom: 12px;
}
.karte h3 { margin: 0 0 6px; font-size: 17px; color: var(--text-leise); font-weight: 600; }
.gross { font-size: 30px; font-weight: 800; color: var(--blau-dunkel); }
.gross.minus { color: var(--rot); }

.raster2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.raster2 .karte { margin-bottom: 0; }

/* ---------- Knöpfe ---------- */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 20px; border: 0; border-radius: 12px;
  background: var(--blau); color: var(--weiss); font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; white-space: nowrap;
}
.knopf:active { background: var(--blau-dunkel); }
.knopf.breit { display: flex; width: 100%; }
.knopf.zweit { background: var(--blau-hell); color: var(--blau-dunkel); }
.knopf.gefahr { background: var(--rot-hell); color: var(--rot); }
.knopf.gruen { background: var(--gruen); }
.knopf.klein { min-height: 40px; padding: 0 14px; font-size: 16px; border-radius: 10px; }
.knopf.riesig { min-height: 68px; font-size: 21px; border-radius: 16px; }
.knopfreihe { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.knopfreihe .knopf { flex: 1; }

/* ---------- Listen ---------- */
.liste { background: var(--weiss); border-radius: var(--radius); box-shadow: var(--schatten); overflow: hidden; margin-bottom: 12px; }
.zeile {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px; min-height: 60px;
  border-bottom: 1px solid var(--linie); color: inherit; text-decoration: none;
}
.zeile:last-child { border-bottom: 0; }
a.zeile:active, button.zeile:active { background: var(--blau-hell); }
button.zeile { width: 100%; border: 0; border-bottom: 1px solid var(--linie); background: none; font: inherit; text-align: left; cursor: pointer; }
.zeile-text { flex: 1; min-width: 0; }
.zeile-titel { font-weight: 650; }
.zeile-unter { font-size: 15px; color: var(--text-leise); }
.zeile-rechts { font-weight: 700; white-space: nowrap; }
.zeile-rechts.plus { color: var(--gruen); }
.zeile-rechts.minus { color: var(--rot); }

.avatar {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--blau-hell); color: var(--blau-dunkel); font-weight: 800; font-size: 17px;
}
.datumsbox {
  flex: none; width: 52px; text-align: center; border-radius: 10px; background: var(--blau-hell);
  color: var(--blau-dunkel); padding: 4px 0; line-height: 1.15;
}
.datumsbox b { display: block; font-size: 21px; }
.datumsbox small { font-size: 13px; font-weight: 600; }

/* ---------- Kennzeichen ---------- */
.chip { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--blau-hell); color: var(--blau-dunkel); margin-right: 4px; }
.chip.gruen { background: var(--gruen-hell); color: var(--gruen); }
.chip.rot { background: var(--rot-hell); color: var(--rot); }
.chip.gelb { background: var(--gelb-hell); color: var(--gelb); }

.hinweis { display: block; padding: 12px 14px; border-radius: 12px; margin-bottom: 10px; font-size: 16px; }
.hinweis.gelb { background: var(--gelb-hell); color: var(--gelb); }
.hinweis.rot { background: var(--rot-hell); color: var(--rot); }
.hinweis.blau { background: var(--blau-hell); color: var(--blau-dunkel); }
.hinweis.gruen { background: var(--gruen-hell); color: var(--gruen); }

/* ---------- Anwesenheit / Bezahlt-Schalter ---------- */
.schalter {
  flex: none; min-width: 112px; min-height: 46px; padding: 0 12px; border-radius: 12px;
  border: 2px solid var(--linie); background: var(--weiss); color: var(--text-leise);
  font: inherit; font-size: 16px; font-weight: 800; cursor: pointer;
}
.schalter.an { background: var(--gruen); border-color: var(--gruen); color: var(--weiss); }
.schalter.aus-rot { border-color: #f1b8b8; color: var(--rot); }

.betreuer-wahl { display: flex; flex-wrap: wrap; gap: 8px; }
.betreuer-wahl button {
  min-height: 46px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--blau-mittel);
  background: var(--weiss); color: var(--blau-dunkel); font: inherit; font-weight: 700; cursor: pointer;
}
.betreuer-wahl button.an { background: var(--blau); border-color: var(--blau); color: var(--weiss); }

/* ---------- Formulare ---------- */
form .feld { margin-bottom: 14px; }
label.titel { display: block; font-size: 15px; font-weight: 700; color: var(--text-leise); margin: 0 2px 5px; }
input[type=text], input[type=tel], input[type=date], input[type=time], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 52px; padding: 10px 14px; border: 2px solid var(--linie); border-radius: 12px;
  background: var(--weiss); color: var(--text); font: inherit;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blau); }
.feldreihe { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.haken { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 4px 2px; cursor: pointer; }
.haken input { width: 26px; height: 26px; accent-color: var(--blau); flex: none; }
.auswahl { display: flex; flex-wrap: wrap; gap: 8px; }
.auswahl label {
  display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px;
  border: 2px solid var(--linie); border-radius: 12px; background: var(--weiss); cursor: pointer; font-weight: 600;
}
.auswahl input { width: 22px; height: 22px; accent-color: var(--blau); }
.auswahl label:has(input:checked) { border-color: var(--blau); background: var(--blau-hell); }

.segment { display: flex; background: var(--blau-hell); border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.segment button {
  flex: 1; min-height: 46px; border: 0; border-radius: 9px; background: transparent;
  font: inherit; font-weight: 700; color: var(--blau-dunkel); cursor: pointer;
}
.segment button.an { background: var(--weiss); box-shadow: var(--schatten); }

/* ---------- Diagramm ---------- */
.verlauf { width: 100%; height: auto; display: block; }
.verlauf .gitter { stroke: var(--linie); stroke-width: 1; }
.verlauf .linie { stroke: var(--blau); stroke-width: 3; fill: none; }
.verlauf .flaeche { fill: var(--blau-hell); stroke: none; }
.verlauf .punkt { fill: var(--weiss); stroke: var(--blau); stroke-width: 2.5; }
.verlauf .bester { fill: var(--gruen); stroke: var(--gruen); }
.verlauf text { fill: var(--text-leise); font-size: 12px; stroke: none; font-family: inherit; }

/* ---------- Meldung ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(90px + var(--unten)); transform: translateX(-50%);
  z-index: 20; background: var(--text); color: var(--weiss); padding: 12px 22px; border-radius: 999px;
  font-weight: 600; box-shadow: 0 4px 16px rgba(0, 0, 0, .25); max-width: calc(100% - 32px);
}

/* ---------- Volljährigkeit ---------- */
.name-ja { color: var(--rot); }
.name-bald { background: #ffe9a8; color: var(--gelb); padding: 0 5px; border-radius: 6px; }
.plus { color: var(--gruen); }
.minus { color: var(--rot); }
.schalter:disabled { opacity: .45; }

/* ---------- Abschluss-Tabellen ---------- */
.tabelle { width: 100%; border-collapse: collapse; font-size: 16px; }
.tabelle td { padding: 7px 4px; border-bottom: 1px solid var(--linie); }
.tabelle tr:last-child td { border-bottom: 0; }
.tabelle .re { text-align: right; white-space: nowrap; }
.tabelle .tkopf td { font-weight: 700; color: var(--text-leise); font-size: 14px; }
.tabelle .summe td { font-weight: 800; font-size: 18px; color: var(--blau-dunkel); border-top: 2px solid var(--blau-mittel); }

/* ---------- Kassenkorrektur ---------- */
.korrektur-karte { border-left: 6px solid #e0a400; }
.zeile.korrektur { background: var(--gelb-hell); }

/* ---------- Belege ---------- */
.beleg-bild { display: block; width: 100%; max-height: 380px; object-fit: contain; border-radius: 12px; background: var(--weiss); border: 2px solid var(--linie); }
.belege { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.beleg-karte { background: var(--weiss); border-radius: var(--radius); box-shadow: var(--schatten); overflow: hidden; color: inherit; text-decoration: none; }
.beleg-karte img { display: block; width: 100%; height: 150px; object-fit: cover; background: var(--blau-hell); }
.beleg-karte div { padding: 8px 10px; font-size: 15px; line-height: 1.35; }

/* ---------- Sperrbildschirm ---------- */
body.gesperrt .kopf, body.gesperrt main, body.gesperrt .leiste { visibility: hidden; }
.sperre {
  position: fixed; inset: 0; z-index: 50; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 24px 16px calc(24px + var(--unten));
  background: linear-gradient(180deg, var(--blau) 0%, var(--blau-dunkel) 100%); color: var(--weiss);
}
.sperre-logo { width: 84px; height: 84px; border-radius: 50%; background: var(--weiss); padding: 4px; margin-bottom: 6px; }
.sperre-titel { font-size: 24px; font-weight: 800; }
.sperre-text { font-size: 17px; opacity: .85; min-height: 24px; text-align: center; }
.sperre-punkte { display: flex; gap: 16px; margin: 16px 0 4px; }
.sperre-punkte i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--weiss); }
.sperre-punkte i.voll { background: var(--weiss); }
.sperre-fehler { min-height: 26px; color: #ffd6d6; font-weight: 700; text-align: center; }
.sperre-tasten { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px 26px; margin: 6px 0 12px; }
.sperre-tasten button {
  display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .14); color: var(--weiss); font: inherit; font-size: 30px; font-weight: 600; cursor: pointer;
}
.sperre-tasten button:active { background: rgba(255, 255, 255, .35); }
.sperre-tasten svg { width: 36px; height: 36px; }
.sperre-unten { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 300px; }
.knopf.sperre-ok { background: var(--weiss); color: var(--blau-dunkel); }
.sperre-link { background: none; border: 0; color: var(--weiss); font: inherit; text-decoration: underline; opacity: .85; padding: 8px; cursor: pointer; }
.sperre.wackeln .sperre-punkte { animation: wackeln .4s; }
@keyframes wackeln { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }

/* ---------- Startanimation (ca. 2,3 s) ---------- */
#intro {
  position: fixed; inset: 0; z-index: 60; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px;
  background: radial-gradient(circle at 50% 42%, #1e78d6 0%, var(--blau) 45%, var(--blau-dunkel) 100%);
  animation: intro-weg .45s ease-in 1.95s forwards;
}
#intro.weg { animation: intro-schnell .22s ease-in forwards; }
@keyframes intro-schnell { to { opacity: 0; visibility: hidden; } }
.intro-mitte { position: relative; width: 170px; height: 170px; }
.intro-mitte > * { position: absolute; inset: 0; margin: auto; border-radius: 50%; }

/* Visier: gleitet von unten links zur Mitte, zieht sich zusammen, verschwindet beim Treffer */
.intro-visier {
  width: 150px; height: 150px; border: 3px solid rgba(255, 255, 255, .9);
  animation: intro-visier 1s cubic-bezier(.45, .05, .3, 1) both;
}
.intro-visier::before, .intro-visier::after {
  content: ''; position: absolute; background: rgba(255, 255, 255, .9); left: 50%; top: 50%;
}
.intro-visier::before { width: 2px; height: 190px; margin: -95px 0 0 -1px; }
.intro-visier::after { width: 190px; height: 2px; margin: -1px 0 0 -95px; }
.intro-visier span { position: absolute; inset: 0; margin: auto; width: 10px; height: 10px; border-radius: 50%; background: #ff5252; box-shadow: 0 0 12px #ff5252; }

/* Treffer: Blitz und Ringe wie auf einer Zielscheibe */
.intro-blitz { width: 60px; height: 60px; background: #fff; opacity: 0; animation: intro-blitz .45s ease-out .92s forwards; }
.intro-ringe { width: 170px; height: 170px; }
.intro-ringe i {
  position: absolute; inset: 0; margin: auto; width: 170px; height: 170px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .8); opacity: 0; animation: intro-ring 1s ease-out .95s forwards;
}
.intro-ringe i:nth-child(2) { animation-delay: 1.07s; }
.intro-ringe i:nth-child(3) { animation-delay: 1.19s; }

/* Logo springt auf */
.intro-logo {
  width: 150px; height: 150px; background: #fff; padding: 6px; box-shadow: 0 10px 34px rgba(0, 0, 0, .3);
  animation: intro-logo .6s cubic-bezier(.2, 1.6, .4, 1) .95s both;
}
.intro-logo img { width: 100%; height: 100%; display: block; }

.intro-text { text-align: center; color: #fff; animation: intro-text .5s ease-out 1.3s both; }
.intro-text b { display: block; font-size: 30px; letter-spacing: .5px; }
.intro-text small { display: block; margin-top: 4px; font-size: 15px; opacity: .85; line-height: 1.35; }

@keyframes intro-visier {
  0%   { transform: translate(-120px, 160px) scale(1.5); opacity: 0; }
  15%  { opacity: 1; }
  70%  { transform: translate(0, 0) scale(1.15); opacity: 1; }
  88%  { transform: scale(.82); opacity: 1; }
  100% { transform: scale(.6); opacity: 0; }
}
@keyframes intro-blitz { 0% { transform: scale(.4); opacity: .95; } 100% { transform: scale(5); opacity: 0; } }
@keyframes intro-ring { 0% { transform: scale(.85); opacity: .95; } 100% { transform: scale(3); opacity: 0; } }
@keyframes intro-logo { 0% { transform: scale(0) rotate(-25deg); opacity: 0; } 40% { opacity: 1; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes intro-text { 0% { transform: translateY(16px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes intro-weg { to { opacity: 0; visibility: hidden; } }

/* „Animationen reduzieren“ am Handy: nur kurz Logo und Text zeigen */
@media (prefers-reduced-motion: reduce) {
  .intro-visier, .intro-blitz, .intro-ringe { display: none; }
  .intro-logo, .intro-text { animation: none; }
  #intro { animation: intro-weg .3s ease-in .6s forwards; }
}

.fuss { text-align: center; color: var(--text-leise); font-size: 14px; margin-top: 26px; }
.fuss img { width: 64px; height: 64px; display: block; margin: 0 auto 6px; }
