/* ===========================================================================
   Sticker-Tauschbörse — „Flutlicht auf Rasen"
   Einzige Stilquelle. Keine externen Schriften (Google-Fonts-Abmahnlage),
   keine externen Bilder, kein CDN. Farbe UND Symbol tragen jede Aussage.
   =========================================================================== */

:root {
  /* Farbe — hell („Kreide auf Rasen") */
  --rasen:        #1c7a3d;   /* Leitfarbe, Aktionen, aktiver Tab */
  --rasen-tief:   #135c2d;   /* gedrückt */
  --rasen-zart:   #e3f2e7;   /* getönte Flächen, Chips, Hinweise */
  --gold:         #f2b135;   /* doppelt/mehrfach, Fair-Waage */
  --gold-tinte:   #6b4a00;   /* Schrift auf Gold */
  --papier:       #f6f7f4;
  --karte:        #ffffff;
  --tinte:        #182420;
  --tinte-blass:  #5c6b60;
  --linie:        #dde3dc;
  --fehlt-kontur: #b9c2ba;
  --rot:          #c9384a;   /* Rückgängig und Fehler — NIE für „fehlt" */
  --info:         #2f6fb4;
  --sync-gruen:   #2fa858;  --sync-grau: #9aa79e;  --sync-rot: #c9384a;

  /* Typografie — nur System */
  --schrift: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
             "Helvetica Neue", Arial, sans-serif;
  --fs-h1: 1.5rem;  --fs-h2: 1.1875rem;  --fs-basis: 1rem;
  --fs-klein: 0.8125rem;  --fs-input: 1.0625rem;   /* 17px — iOS-Zoom-Sperre */
  --fs-zahl: 1.375rem;    --fs-riesig: 2.5rem;

  --radius: 14px;  --radius-s: 10px;  --radius-pille: 999px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;

  --schatten-1: 0 1px 2px rgba(16, 32, 22, 0.08);
  --schatten-2: 0 6px 20px rgba(16, 32, 22, 0.16);

  --tipp-min: 44px;
  --leisten-h: 58px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --rasen: #46c072; --rasen-tief: #2f9e54; --rasen-zart: #1a2f22;
    --gold: #f4b840; --gold-tinte: #3d2a00;
    --papier: #0f1613; --karte: #17211b;
    --tinte: #e8efe9; --tinte-blass: #93a398; --linie: #26332b;
    --fehlt-kontur: #46564b; --rot: #e05a6a; --info: #6ea6e0;
    --sync-gruen: #46c072; --sync-grau: #5c6b60; --sync-rot: #e05a6a;
    --schatten-1: none;
    --schatten-2: 0 6px 24px rgba(0, 0, 0, 0.55);
  }
}
:root[data-thema="dunkel"] {
  --rasen: #46c072; --rasen-tief: #2f9e54; --rasen-zart: #1a2f22;
  --gold: #f4b840; --gold-tinte: #3d2a00;
  --papier: #0f1613; --karte: #17211b;
  --tinte: #e8efe9; --tinte-blass: #93a398; --linie: #26332b;
  --fehlt-kontur: #46564b; --rot: #e05a6a; --info: #6ea6e0;
  --sync-gruen: #46c072; --sync-grau: #5c6b60; --sync-rot: #e05a6a;
  --schatten-1: none; --schatten-2: 0 6px 24px rgba(0, 0, 0, 0.55);
}
:root[data-thema="hell"] {
  --rasen: #1c7a3d; --rasen-tief: #135c2d; --rasen-zart: #e3f2e7;
  --gold: #f2b135; --gold-tinte: #6b4a00;
  --papier: #f6f7f4; --karte: #ffffff;
  --tinte: #182420; --tinte-blass: #5c6b60; --linie: #dde3dc;
  --fehlt-kontur: #b9c2ba; --rot: #c9384a; --info: #2f6fb4;
  --sync-gruen: #2fa858; --sync-grau: #9aa79e; --sync-rot: #c9384a;
  --schatten-1: 0 1px 2px rgba(16, 32, 22, 0.08);
  --schatten-2: 0 6px 20px rgba(16, 32, 22, 0.16);
}

/* --------------------------------------------------------------- Grundlagen */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--papier); color: var(--tinte);
  font-family: var(--schrift); font-size: var(--fs-basis);
  font-variant-numeric: tabular-nums;
  overscroll-behavior-y: none;
  -webkit-text-size-adjust: 100%;
}
body { padding-bottom: calc(var(--leisten-h) + env(safe-area-inset-bottom, 0px)); }

/* Jedes Eingabefeld 17px: darunter zoomt iOS-Safari das Layout kaputt. */
input, select, textarea, button { font-family: inherit; font-size: var(--fs-input); }

h1, h2, h3 { margin: 0 0 var(--sp-2); line-height: 1.25; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
p  { margin: 0 0 var(--sp-3); line-height: 1.5; }
a  { color: var(--info); }

.verborgen { display: none !important; }
.nur-lesen { color: var(--tinte-blass); font-size: var(--fs-klein); }

/* --------------------------------------------------------------- Kopfzeile */
.kopf {
  position: sticky; top: 0; z-index: 20;
  background: var(--karte); border-bottom: 1px solid var(--linie);
  padding: calc(env(safe-area-inset-top, 0px) + var(--sp-3)) var(--sp-4) var(--sp-3);
  display: flex; align-items: center; gap: var(--sp-3);
}
.kopf h1 { flex: 1; margin: 0; font-size: var(--fs-h2); }
.punkt {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--sync-grau); flex: none;
}
.punkt[data-stand="an"]     { background: var(--sync-gruen); }
.punkt[data-stand="fehler"] { background: var(--sync-rot); }
.punkt[data-stand="arbeit"] { background: var(--gold); }

/* --------------------------------------------------------------- Flächen */
main { padding: var(--sp-4); max-width: 760px; margin: 0 auto; }
.karte {
  background: var(--karte); border: 1px solid var(--linie);
  border-radius: var(--radius); box-shadow: var(--schatten-1);
  padding: var(--sp-4); margin-bottom: var(--sp-3);
}
.karte.zart { background: var(--rasen-zart); border-color: transparent; }

/* --------------------------------------------------------------- Knöpfe */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--tipp-min); padding: 0 var(--sp-4);
  border: 1px solid var(--linie); border-radius: var(--radius);
  background: var(--karte); color: var(--tinte);
  font-weight: 600; cursor: pointer;
  transition: transform 90ms ease, background 120ms ease;
}
.knopf:active { transform: scale(0.97); }
a.knopf { text-decoration: none; }
.knopf.haupt { background: var(--rasen); border-color: var(--rasen); color: #fff; }
.knopf.haupt:active { background: var(--rasen-tief); }
.knopf.gold { background: var(--gold); border-color: var(--gold); color: var(--gold-tinte); }
.knopf.still { background: transparent; border-color: transparent; color: var(--tinte-blass); }
.knopf.breit { width: 100%; }
.knopf[disabled] { opacity: 0.45; pointer-events: none; }

.knopfreihe { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

/* --------------------------------------------------------------- Chips */
.chipreihe { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-3); }
.chip {
  min-height: var(--tipp-min); padding: 0 var(--sp-3);
  border: 1px solid var(--linie); border-radius: var(--radius-pille);
  background: var(--karte); color: var(--tinte-blass);
  font-size: var(--fs-klein); font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip[aria-pressed="true"] {
  background: var(--rasen); border-color: var(--rasen); color: #fff;
}

/* --------------------------------------------------------------- Fortschritt */
.balken {
  height: 8px; border-radius: var(--radius-pille);
  background: var(--linie); overflow: hidden;
}
.balken > i { display: block; height: 100%; background: var(--rasen); }

.zaehler-gross { font-size: var(--fs-riesig); font-weight: 800; line-height: 1; }
.zaehler-gross small { font-size: var(--fs-basis); font-weight: 600; color: var(--tinte-blass); }

/* --------------------------------------------------------------- Länderliste */
.land-karte { padding: var(--sp-3) var(--sp-4); }
.land-kopf {
  display: flex; align-items: center; gap: var(--sp-3);
  width: 100%; background: none; border: 0; padding: 0;
  min-height: var(--tipp-min); color: inherit; cursor: pointer; text-align: left;
}
.land-kopf .flagge { font-size: 1.4rem; flex: none; }
.land-kopf .name { flex: 1; font-weight: 700; font-size: var(--fs-h2); }
.land-kopf .stand { color: var(--tinte-blass); font-size: var(--fs-klein); font-weight: 600; }

/* --------------------------------------------------------------- Raster */
.raster {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-2); margin-top: var(--sp-3);
  touch-action: none;                       /* sonst klaut iOS die Wischgeste */
  -webkit-user-select: none; user-select: none;
  overscroll-behavior: contain;
}
.raster.schmal { grid-template-columns: repeat(4, 1fr); }

.kachel {
  position: relative; aspect-ratio: 1 / 1; min-height: var(--tipp-min);
  border-radius: var(--radius-s); border: 2px dashed var(--fehlt-kontur);
  background: var(--karte); color: var(--tinte);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: var(--fs-zahl); font-weight: 800; cursor: pointer;
  transition: transform 90ms ease;
  padding: 0;
}
.kachel:active { transform: scale(0.94); }
.kachel .marke { font-size: var(--fs-klein); font-weight: 700; line-height: 1; margin-top: 2px; }

.kachel[data-a="1"] {
  background: var(--rasen); border: 2px solid var(--rasen); color: #fff;
}
.kachel[data-a="2"], .kachel[data-a="mehr"] {
  background: var(--gold); border: 2px solid var(--gold); color: var(--gold-tinte);
}
.kachel[data-a="mehr"] { border-width: 3px; border-color: var(--gold-tinte); }
.kachel[data-frisch="1"] { animation: kippen 300ms ease; }
@keyframes kippen {
  0%   { transform: rotateX(0deg)   scale(1); }
  45%  { transform: rotateX(70deg)  scale(0.92); }
  100% { transform: rotateX(0deg)   scale(1); }
}

/* --------------------------------------------------------------- Fehlliste */
.fehlzeile {
  display: flex; align-items: center; gap: var(--sp-3);
  min-height: var(--tipp-min); padding: var(--sp-2) 0;
  border-top: 1px solid var(--linie); width: 100%;
  background: none; border-left: 0; border-right: 0; border-bottom: 0;
  color: inherit; text-align: left; cursor: pointer;
}
.fehlzeile .nr {
  flex: none; min-width: 46px; height: 40px; border-radius: var(--radius-s);
  border: 2px dashed var(--fehlt-kontur);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-zahl); font-weight: 800;
}
.fehlzeile .bez { flex: 1; }
.fehlzeile .bez em { color: var(--tinte-blass); font-style: normal; }
.fehlzeile .tausch {
  flex: none; font-size: var(--fs-klein); font-weight: 700;
  color: var(--gold-tinte); background: var(--gold);
  border-radius: var(--radius-pille); padding: 4px 10px;
}

/* Chip-Fluss: greift, wenn ein Block kaum Namen hat — 20 „Name folgt"-Zeilen
   wären hässlich, die Nummer war immer der eigentliche Inhalt. */
.nummernfluss { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }
.nummernfluss .nr-chip {
  min-width: var(--tipp-min); min-height: var(--tipp-min); padding: 0 var(--sp-2);
  border: 2px dashed var(--fehlt-kontur); border-radius: var(--radius-s);
  background: var(--karte); color: var(--tinte);
  font-size: var(--fs-zahl); font-weight: 800; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
}
.nr-chip .stift { font-size: var(--fs-klein); color: var(--tinte-blass); }

/* --------------------------------------------------------------- Vorlesemodus */
.vorlesen { text-align: center; }
.vorlesen .land { font-size: var(--fs-h1); font-weight: 800; margin-bottom: var(--sp-4); }
.vorlesen .zahlen { display: flex; flex-direction: column; gap: var(--sp-2); }
.vorlesen .zahl {
  font-size: var(--fs-riesig); font-weight: 800; padding: var(--sp-2);
  border-radius: var(--radius); border: 2px dashed var(--fehlt-kontur);
  background: var(--karte); cursor: pointer;
}
.vorlesen .zahl[data-weg="1"] {
  text-decoration: line-through; color: var(--tinte-blass);
  border-style: solid; border-color: var(--linie); opacity: 0.6;
}

/* --------------------------------------------------------------- Tausch */
.tausch-spalten { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.tausch-spalten h3 { font-size: var(--fs-klein); color: var(--tinte-blass); text-transform: uppercase; }
.tauschkarte {
  display: flex; align-items: center; gap: var(--sp-2);
  min-height: var(--tipp-min); width: 100%;
  padding: var(--sp-2); margin-bottom: var(--sp-2);
  border: 1px solid var(--linie); border-radius: var(--radius-s);
  background: var(--karte); color: inherit; cursor: pointer; text-align: left;
}
.tauschkarte[aria-pressed="true"] { border-color: var(--rasen); background: var(--rasen-zart); }
.tauschkarte .code { font-weight: 800; font-size: var(--fs-basis); }
.tauschkarte .anz { font-size: var(--fs-klein); color: var(--gold-tinte);
                    background: var(--gold); border-radius: var(--radius-pille); padding: 1px 7px; }
.waage { text-align: center; font-weight: 800; font-size: var(--fs-h2); margin: var(--sp-4) 0; }
.waage[data-fair="nein"] { color: var(--gold-tinte); }

/* --------------------------------------------------------------- Blatt (Bottom-Sheet) */
/* Über der Meldung: ein offenes Blatt muss die Snackbar verdecken,
   sonst liegt „Rückgängig" auf dem Übernehmen-Knopf. */
.schleier {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(8, 18, 12, 0.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.blatt {
  background: var(--karte); width: 100%; max-width: 560px;
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--schatten-2);
  padding: var(--sp-5) var(--sp-4)
           calc(var(--sp-5) + env(safe-area-inset-bottom, 0px));
  max-height: 88vh; overflow-y: auto;
}
.blatt .antwort { font-size: var(--fs-riesig); font-weight: 800; text-align: center;
                  margin-bottom: var(--sp-4); line-height: 1.1; }
.blatt .antwort.nehmen { color: var(--rasen); }
.blatt .antwort.haben  { color: var(--tinte-blass); }
.blatt .antwort.doppelt{ color: var(--gold-tinte); }

/* --------------------------------------------------------------- Meldung */
.meldung {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--leisten-h) + env(safe-area-inset-bottom, 0px) + var(--sp-3));
  z-index: 50; max-width: 92vw;
  background: var(--tinte); color: var(--papier);
  border-radius: var(--radius-pille); box-shadow: var(--schatten-2);
  padding: var(--sp-3) var(--sp-4);
  display: flex; align-items: center; gap: var(--sp-4);
  font-size: var(--fs-klein); font-weight: 600;
}
.meldung button {
  background: none; border: 0; color: var(--gold);
  font-weight: 800; font-size: var(--fs-klein); cursor: pointer;
  min-height: var(--tipp-min); padding: 0 var(--sp-2);
}

/* --------------------------------------------------------------- Tab-Leiste */
.leiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--karte); border-top: 1px solid var(--linie);
  box-shadow: var(--schatten-2);
  /* Ohne dieses Polster liegt „Leute"/„Mehr" auf iPhones halb unter dem
     Home-Indikator und jeder Tipp löst die Wisch-Geste aus. */
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.leiste button {
  background: none; border: 0; cursor: pointer;
  min-height: var(--leisten-h); padding: var(--sp-1) 0 var(--sp-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--tinte-blass); font-size: var(--fs-klein); font-weight: 600;
  position: relative;
}
.leiste button .sinn { font-size: 1.25rem; line-height: 1; }
.leiste button[aria-selected="true"] { color: var(--rasen); font-weight: 800; }
.leiste .mitte .sinn {
  width: 52px; height: 52px; margin-top: -18px;
  border-radius: 50%; background: var(--rasen); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--schatten-2);
}
.leiste button[aria-selected="true"].mitte .sinn { background: var(--rasen-tief); }
/* Bewusst nicht rot: „noch 991" ist kein Alarm, sondern der Normalzustand
   am Anfang. Rot bleibt für Rückgängig und Fehler reserviert. */
.abzeichen {
  position: absolute; top: 2px; right: 50%; margin-right: -24px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--radius-pille);
  background: var(--tinte-blass); color: var(--karte);
  font-size: 11px; font-weight: 800; line-height: 18px;
}
.leiste button[data-blick="tausch"] .abzeichen {
  background: var(--gold); color: var(--gold-tinte);   /* Treffer sind eine gute Nachricht */
}

/* --------------------------------------------------------------- Spenden */
.spende { display: flex; align-items: center; gap: var(--sp-3); }
.spende .text { flex: 1; font-size: var(--fs-klein); color: var(--tinte-blass); line-height: 1.45; }
.fusszeile {
  text-align: center; font-size: var(--fs-klein); color: var(--tinte-blass);
  padding: var(--sp-5) var(--sp-4); line-height: 1.6;
}
.fusszeile a { color: var(--tinte-blass); }

/* --------------------------------------------------------------- Erklärvideo */
.erklaervideo {
  width: 100%; max-width: 300px; margin: 0 auto var(--sp-3);
  display: block; border-radius: var(--radius); background: #000;
  aspect-ratio: 9 / 16;
}

/* --------------------------------------------------------------- Drucken */
@media print {
  .kopf, .leiste, .meldung, .chipreihe, .knopf, .erklaervideo { display: none !important; }
  /* Auf Papier gehört alles hin — eingeklappte Länder werden aufgeklappt. */
  .fehl-inhalt.verborgen { display: block !important; }
  .land-kopf .stand:last-child { display: none; }        /* das ▸-Zeichen */
  body { background: #fff; color: #000; padding: 0; }
  main { max-width: none; padding: 0; }
  .karte { border: 0; box-shadow: none; padding: 0; margin: 0 0 6mm; break-inside: avoid; }
  .druck-spalten { column-count: 3; column-gap: 8mm; }
  .fehlzeile { border-top: 0; min-height: 0; padding: 1mm 0; }
  .fehlzeile .nr { border: 1px solid #000; min-width: 34px; height: 22px; font-size: 11pt; }
  .nummernfluss .nr-chip { min-width: 26px; min-height: 22px; font-size: 11pt; border: 1px solid #000; }
}

/* ------------------------------------------------- Erstkontakt (Onboarding)
   Bewusst als Klassen und nicht als style="…" am Element: die CSP steht auf
   `style-src 'self'` ohne unsafe-inline, und die verbietet auch das
   style-Attribut. Live gemessen am 02.08.2026 — im Browser stand ein Dutzend
   Mal „Applying inline style violates…", die Regeln kamen schlicht nicht an. */

/* Das Attribut `hidden` allein reicht nicht: `.leiste { display:grid }` ist
   spezifischer als die Vorgabe des Browsers und gewinnt. Ohne diese Zeile
   steht die Reiterleiste unter der Anmeldung, obwohl sie versteckt sein soll —
   und lädt zum Tippen ein, bevor überhaupt jemand angemeldet ist. */
.leiste[hidden] { display: none; }

.marke        { font-size: 3rem; line-height: 1; }
.mittig       { text-align: center; }
.feld         {
  width: 100%; padding: var(--sp-3);
  border: 1px solid var(--linie); border-radius: 10px;
  background: var(--papier); color: var(--tinte);
}
.zeichenwahl  { margin-top: var(--sp-3); }
.zeichenwahl .chip { font-size: 1.3rem; }
.weiter       { margin-top: var(--sp-4); }
.zurueck      { margin-top: var(--sp-2); }

/* Ein Platz in „Wer bist du?" — Zeichen, Name, rechts der Hinweis. */
.platz {
  justify-content: flex-start; text-align: left;
  gap: var(--sp-3); margin-top: var(--sp-2);
}
.platz .sinn   { font-size: 1.3rem; }
.platz .zusatz {
  margin-left: auto; color: var(--tinte-blass);
  font-size: var(--fs-klein); font-weight: 500;
}
.platz.neu     { margin-top: var(--sp-4); }

/* ------------------------------------------------- Rechtstexte
   Eigene Seiten ohne die App drumherum. Auch hier keine style-Attribute: die
   Inhaltsrichtlinie gilt für jede Seite dieser Domain, und ein verworfener
   Stil auf der Datenschutzerklärung sieht aus wie ein kaputtes Impressum. */
.rechtstext        { padding-bottom: var(--sp-5); }
.angaben           { width: 100%; border-collapse: collapse; }
.angaben td        { padding: var(--sp-1) 0; vertical-align: top; }
.angaben td:first-child { padding-right: var(--sp-3); }
.nachsatz          { margin-top: var(--sp-3); }

/* --------------------------------------------------------------- Bewegung aus */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
