/* ===================================================================
   Lions-Adventskalender - Gestaltung
   Zuerst fuer das Handy entworfen, dann fuer groessere Bildschirme
   erweitert. Bewusst ohne Framework, damit nichts gepflegt werden muss.
   =================================================================== */

:root {
  --blau: #00338d;
  --blau-hell: #1d4fb5;
  --blau-sehr-hell: #eef2fb;
  --gold: #ffc72c;
  --gold-dunkel: #c99400;
  --text: #16181d;
  --text-leise: #5b6270;
  --rand: #d7dbe3;
  --flaeche: #ffffff;
  --hintergrund: #f4f6fa;
  --gruen: #1a7f4b;
  --gruen-hell: #e6f5ec;
  --rot: #b3261e;
  --rot-hell: #fdeceb;
  --orange: #9a5b00;
  --orange-hell: #fff6e3;
  --radius: 10px;
  --schatten: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--hintergrund);
}

/* ------------------------------------------------------------- Kopfzeile */

.kopf {
  background: var(--blau);
  color: #fff;
  padding: 0.6rem 1rem;
  position: sticky;
  top: 0;
  z-index: 20;
}

.kopf-oben {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
}

.marke {
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.marke::before {
  content: "";
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: var(--gold);
  flex: none;
}

.kopf-rechts {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.875rem;
}

.kopf-rechts a { color: #fff; }

.saison-wahl select {
  font-size: 0.875rem;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.saison-wahl select option { color: var(--text); }

/* -------------------------------------------------------------- Navigation */

.navi {
  background: var(--blau-hell);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: sticky;
  top: 3.1rem;
  z-index: 19;
}

.navi ul {
  display: flex;
  gap: 0.15rem;
  list-style: none;
  margin: 0 auto;
  padding: 0 0.5rem;
  max-width: 1200px;
  white-space: nowrap;
}

.navi a {
  display: block;
  padding: 0.7rem 0.75rem;
  color: #e8eeff;
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 3px solid transparent;
}

.navi a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

.navi a.aktiv {
  color: #fff;
  font-weight: 600;
  border-bottom-color: var(--gold);
}

/* ------------------------------------------------------------------ Inhalt */

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1rem 4rem;
}

h1 { font-size: 1.4rem; margin: 0.4rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.6rem 0 0.6rem; }
h3 { font-size: 1rem; margin: 1.2rem 0 0.4rem; }

a { color: var(--blau); }

p.leise, .leise { color: var(--text-leise); font-size: 0.9rem; }

.karte {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--schatten);
}

.karte > h2:first-child, .karte > h3:first-child { margin-top: 0; }

.gitter {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

/* -------------------------------------------------------------- Kennzahlen */

.kennzahl {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  padding: 0.85rem;
  box-shadow: var(--schatten);
}

.kennzahl .wert { font-size: 1.6rem; font-weight: 700; line-height: 1.15; }
.kennzahl .name { font-size: 0.8rem; color: var(--text-leise); text-transform: uppercase; letter-spacing: 0.03em; }
.kennzahl .zusatz { font-size: 0.8rem; color: var(--text-leise); }

.kennzahl.betont { border-left: 4px solid var(--gold); }
.kennzahl.gut .wert { color: var(--gruen); }
.kennzahl.warnung .wert { color: var(--orange); }
.kennzahl.schlecht .wert { color: var(--rot); }

/* ------------------------------------------------------------------ Balken */

.balken {
  display: flex;
  height: 1.5rem;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--rand);
  background: var(--flaeche);
}

.balken span { display: block; }
.balken .b-verkauft { background: var(--gruen); }
.balken .b-ausgegeben { background: var(--gold); }
.balken .b-lager { background: #c3cad6; }
.balken .b-zurueck { background: #8a93a3; }
.balken .b-verloren { background: var(--rot); }

.legende { display: flex; flex-wrap: wrap; gap: 0.75rem; font-size: 0.85rem; margin-top: 0.5rem; }
.legende i { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 3px; margin-right: 0.3rem; vertical-align: -1px; }

/* ----------------------------------------------------------------- Formular */

form .feld { margin-bottom: 0.9rem; }

label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.25rem; }

label .leise { font-weight: 400; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="search"], select, textarea {
  width: 100%;
  padding: 0.6rem 0.7rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--rand);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(0, 51, 141, 0.25);
  outline-offset: 0;
  border-color: var(--blau);
}

textarea { min-height: 4.5rem; resize: vertical; }

.nummern-eingabe {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.feld-hinweis { font-size: 0.85rem; color: var(--text-leise); margin-top: 0.25rem; }

.feld-reihe { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

fieldset { border: 1px solid var(--rand); border-radius: var(--radius); padding: 0.8rem; margin: 0 0 1rem; }
legend { font-weight: 600; padding: 0 0.4rem; font-size: 0.9rem; }

.wahl { display: flex; flex-direction: column; gap: 0.1rem; }

.wahl label {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-weight: 400;
  padding: 0.55rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
}

.wahl label:hover { background: var(--blau-sehr-hell); }
.wahl input[type="radio"], .wahl input[type="checkbox"] { margin-top: 0.25rem; width: 1.1rem; height: 1.1rem; flex: none; }
.wahl label b { display: block; font-weight: 600; }
.wahl label .leise { font-size: 0.85rem; }

/* ------------------------------------------------------------------ Knoepfe */

.knopf, button {
  display: inline-block;
  padding: 0.7rem 1.1rem;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--blau);
  background: var(--blau);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
}

.knopf:hover, button:hover { background: var(--blau-hell); }

.knopf.zweit, button.zweit {
  background: #fff;
  color: var(--blau);
}
.knopf.zweit:hover, button.zweit:hover { background: var(--blau-sehr-hell); }

.knopf.gefahr, button.gefahr { background: var(--rot); border-color: var(--rot); }
.knopf.gefahr:hover, button.gefahr:hover { background: #8e1e17; }

.knopf.klein, button.klein { padding: 0.35rem 0.6rem; font-size: 0.85rem; }

.knopf-reihe { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }

button[disabled], .knopf.aus { opacity: 0.5; cursor: not-allowed; }

/* ------------------------------------------------------------------ Hinweise */

.hinweis {
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid;
}

.hinweis.erfolg { background: var(--gruen-hell); border-color: #a8d8bd; color: #0f5a33; }
.hinweis.fehler { background: var(--rot-hell); border-color: #f0b4b0; color: #8e1e17; }
.hinweis.warnung { background: var(--orange-hell); border-color: #ecc98a; color: #6d4100; }
.hinweis.hinweis-info { background: var(--blau-sehr-hell); border-color: #b9c8ea; color: #123; }

.hinweis ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.hinweis li { margin: 0.2rem 0; }
.hinweis strong { display: block; margin-bottom: 0.2rem; }

/* -------------------------------------------------------------- Tabellen */

.tabelle-rahmen {
  overflow-x: auto;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  margin-bottom: 1rem;
}

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }

th, td { padding: 0.55rem 0.7rem; text-align: left; border-bottom: 1px solid var(--rand); vertical-align: top; }

th {
  background: #f7f9fc;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-leise);
  white-space: nowrap;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfe; }

td.zahl, th.zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.nummern { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.88rem; }

/* ------------------------------------------------------------------ Marken */

.marker {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid;
}

.marker.lager      { background: #eef0f4; border-color: #d2d7e0; color: #4a515e; }
.marker.ausgegeben { background: var(--orange-hell); border-color: #ecc98a; color: #6d4100; }
.marker.verkauft   { background: var(--gruen-hell); border-color: #a8d8bd; color: #0f5a33; }
.marker.zurueck    { background: #eef0f4; border-color: #c3cad6; color: #4a515e; }
.marker.verloren   { background: var(--rot-hell); border-color: #f0b4b0; color: #8e1e17; }
.marker.storniert  { background: var(--rot-hell); border-color: #f0b4b0; color: #8e1e17; }

/* ------------------------------------------------------------------ Tuerchen */

.tuerchen-gitter {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
}

.tuerchen {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  padding: 0.7rem;
  text-decoration: none;
  color: inherit;
  display: block;
  box-shadow: var(--schatten);
}

.tuerchen:hover { border-color: var(--blau); }
.tuerchen .tag { font-size: 1.5rem; font-weight: 700; color: var(--blau); line-height: 1; }
.tuerchen .info { font-size: 0.82rem; color: var(--text-leise); margin-top: 0.3rem; }
.tuerchen.gezogen { border-left: 4px solid var(--gruen); }
.tuerchen.offen { border-left: 4px solid var(--gold); }
.tuerchen.leer { border-left: 4px solid var(--rand); opacity: 0.75; }

/* ------------------------------------------------------------- Gewinnerliste */

.gewinnernummern {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.gewinnernummer {
  background: var(--blau-sehr-hell);
  border: 1px solid #c6d2ee;
  border-radius: 6px;
  padding: 0.1rem 0.45rem;
}

.gewinnernummer.eingeloest { background: var(--gruen-hell); border-color: #a8d8bd; }

/* ------------------------------------------------------------------ Anmeldung */

.anmeldung-seite {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(160deg, var(--blau) 0%, #001f55 100%);
}

.anmeldung-karte {
  background: #fff;
  border-radius: 14px;
  padding: 1.8rem 1.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.anmeldung-karte h1 { margin-top: 0; font-size: 1.25rem; }
.anmeldung-karte .untertitel { color: var(--text-leise); font-size: 0.9rem; margin: -0.6rem 0 1.2rem; }
.anmeldung-karte button { width: 100%; margin-top: 0.4rem; }

/* ------------------------------------------------------------------- Pruefung */

.pruefung-zahl { font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; font-size: 0.9rem; }

/* -------------------------------------------------------------------- Fusszeile */

.fuss {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
  color: var(--text-leise);
  font-size: 0.82rem;
  border-top: 1px solid var(--rand);
}

/* ------------------------------------------------------------------- Hilfreich */

/* Befehle und Schluessel zum Abschreiben: feste Schrittweite, umbruchfest. */
code, pre {
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
}
code { background: var(--hintergrund); padding: 0.1rem 0.3rem; border-radius: 4px; }
pre {
  background: var(--hintergrund);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
pre code { background: none; padding: 0; }

.schmal { max-width: 620px; }
.mitte { text-align: center; }
.nowrap { white-space: nowrap; }
.abstand-oben { margin-top: 1.2rem; }
.verstecken { display: none; }

details.hilfe { margin: 0.5rem 0 1rem; font-size: 0.9rem; }
details.hilfe summary { cursor: pointer; color: var(--blau); font-weight: 600; }
details.hilfe > div { padding: 0.5rem 0 0; color: var(--text-leise); }

/* Ein Nebenfeld, das nur bei Bedarf aufgeht - etwa eine neue Aktion beim Buchen. */
details.einklapp { margin: 0.5rem 0 0; }
details.einklapp > summary {
  cursor: pointer;
  color: var(--blau);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0;
}
details.einklapp[open] > summary { margin-bottom: 0.4rem; }
details.einklapp .feld-reihe { margin-bottom: 0; }

/* ----------------------------------------------------- Zaehlliste der Kasse */
/* Zwei Spalten am Handy, vier am PC: eine Kasse zaehlt man in Haeufchen,
   und die Felder sollen ohne Scrollen zu ueberblicken sein. */

.zaehlliste {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem 0.6rem;
  margin: 0.6rem 0;
}

.zaehlliste label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  background: var(--blau-sehr-hell);
  border-radius: 8px;
  padding: 0.3rem 0.5rem;
}

.zaehlliste label span {
  flex: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.zaehlliste input {
  width: 3.4rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding: 0.35rem 0.4rem;
}

@media (min-width: 700px) {
  main { padding: 1.5rem 1.5rem 4rem; }
  h1 { font-size: 1.65rem; }
  .zaehlliste { grid-template-columns: repeat(4, 1fr); }
}

/* ------------------------------------------------------------------- Drucken */

@media print {
  .kopf, .navi, .knopf-reihe, .fuss, form { display: none !important; }
  body { background: #fff; }
  .karte, .tabelle-rahmen { box-shadow: none; border-color: #999; }
}
