:root {
  --flasche: #1f3d30;
  --flasche-hell: #2c5644;
  --bernstein: #c8871a;
  --grund: #f4f6f3;
  --flaeche: #ffffff;
  --tinte: #17201b;
  --leise: #5b6961;
  --linie: #d9dfda;
  --sperre: #a8322d;
  --sperre-grund: #f8e7e5;
  --gut: #2f7a4b;
  --gut-grund: #e3f1e8;
  --deckel: #ece4d4;
  --deckel-rand: #d3c6ab;
  --deckel-tinte: #3a2d18;
  --radius: 14px;
  color-scheme: light dark;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #0f1713;
    --flaeche: #17221c;
    --tinte: #e4ebe6;
    --leise: #9aaba1;
    --linie: #2a3a31;
    --flasche: #6fb592;
    --flasche-hell: #86c7a5;
    --sperre: #f08b84;
    --sperre-grund: #3a1c1a;
    --gut: #7cd19c;
    --gut-grund: #173222;
    --deckel: #cfc4ad;
  }
}
*, *::before, *::after { box-sizing: inherit; }
html, body { margin: 0; }
body {
  background: var(--grund);
  color: var(--tinte);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
a { color: var(--flasche); }
.leise { color: var(--leise); font-size: .9rem; }
.zahl { font-variant-numeric: tabular-nums; }

/* ---------- Grundgerüst */
.kopf {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem 1rem; background: var(--flasche); color: #fff;
}
@media (prefers-color-scheme: dark) { .kopf { background: #13241b; } }
.kopf .verein { font-weight: 650; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopf button { color: #fff; border-color: rgba(255,255,255,.35); background: transparent; min-height: 36px; padding: .3rem .8rem; }
.reiter {
  display: flex; gap: .25rem; overflow-x: auto; padding: .5rem 1rem 0;
  border-bottom: 1px solid var(--linie); background: var(--flaeche);
  scrollbar-width: none;
}
.reiter a {
  padding: .55rem .8rem; text-decoration: none; color: var(--leise);
  border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 550;
}
.reiter a[aria-current="page"] { color: var(--tinte); border-color: var(--bernstein); }
main { max-width: 980px; margin: 0 auto; padding: 1.25rem 1rem 4rem; }
.spalten { display: grid; gap: 1.25rem; }
@media (min-width: 800px) { .spalten { grid-template-columns: 340px 1fr; align-items: start; } }

.block { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem; }
.block > h2:first-child, .block > h3:first-child { margin-top: 0; }

/* ---------- Formulare */
label { display: block; font-weight: 550; font-size: .92rem; margin: .7rem 0 .25rem; }
input, select, textarea {
  width: 100%; font: inherit; color: inherit; background: var(--grund);
  border: 1px solid var(--linie); border-radius: 10px; padding: .6rem .7rem; min-height: 44px;
}
input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--flasche); }
.schalter { display: flex; gap: .6rem; align-items: flex-start; font-weight: 450; margin: .6rem 0; }
.schalter input { flex: none; margin-top: .1rem; }
button, .knopf {
  font: inherit; font-weight: 600; cursor: pointer; min-height: 44px;
  padding: .55rem 1rem; border-radius: 10px; border: 1px solid var(--linie);
  background: var(--flaeche); color: var(--tinte); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
}
button.haupt, .knopf.haupt { background: var(--flasche); border-color: var(--flasche); color: #fff; }
@media (prefers-color-scheme: dark) { button.haupt, .knopf.haupt { color: #0f1713; } }
button.gefahr { color: var(--sperre); border-color: currentColor; background: transparent; }
button:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--bernstein); outline-offset: 2px; }
.reihe { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.reihe > * { flex: 1 1 auto; }
.feld2 { display: grid; gap: 0 .8rem; }
@media (min-width: 560px) { .feld2 { grid-template-columns: 1fr 1fr; } }

/* ---------- Bierdeckel */
.deckel {
  --g: min(78vw, 280px);
  width: var(--g); height: var(--g); margin: .5rem auto 1rem; border-radius: 50%;
  background: var(--deckel); color: var(--deckel-tinte);
  box-shadow: inset 0 0 0 6px var(--deckel), inset 0 0 0 8px var(--deckel-rand), 0 2px 0 var(--deckel-rand);
  display: grid; place-items: center; text-align: center; position: relative;
}
.deckel .innen { display: grid; gap: .15rem; justify-items: center; padding: 0 12%; }
.deckel .wer { font-weight: 650; font-size: 1.05rem; }
.deckel .betrag { font-size: clamp(2rem, 11vw, 2.8rem); font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.deckel .betrag.minus { color: #8f2a23; }
.deckel .art { font-size: .85rem; }
.striche { display: flex; flex-wrap: wrap; gap: .45rem; justify-content: center; max-width: 170px; min-height: 26px; margin-top: .35rem; }
.fuenfer { width: 30px; height: 24px; }
.fuenfer line { stroke: var(--deckel-tinte); stroke-width: 2.4; stroke-linecap: round; }
.deckel.klein { --g: 190px; }
.deckel.klein .betrag { font-size: 1.8rem; }
.deckel.frisch { animation: tippen .45s ease-out; }
@keyframes tippen { 40% { transform: scale(1.035) rotate(-2deg); } }
@media (prefers-reduced-motion: reduce) { .deckel.frisch { animation: none; } }

/* ---------- Theke */
.scanfeld { text-align: center; padding: 1.6rem 1rem; border: 2px dashed var(--linie); border-radius: var(--radius); background: var(--flaeche); }
.scanfeld.aktiv { border-color: var(--flasche); }
.scanfeld svg { width: 64px; height: 64px; color: var(--flasche); }
.modus { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin-bottom: 1rem; }
.modus button[aria-pressed="true"] { background: var(--flasche); color: #fff; border-color: var(--flasche); }
@media (prefers-color-scheme: dark) { .modus button[aria-pressed="true"] { color: #0f1713; } }
.gruppe { margin: 1rem 0 .4rem; font-weight: 650; color: var(--leise); font-size: .9rem; }
.produkte { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.produkt {
  display: grid; gap: .1rem; text-align: left; justify-content: stretch; align-content: start;
  min-height: 72px; padding: .6rem .7rem;
}
.produkt .preis { font-variant-numeric: tabular-nums; color: var(--leise); font-weight: 500; }
.produkt.gesperrt { background: var(--sperre-grund); border-color: transparent; color: var(--sperre); cursor: not-allowed; }
.produkt.gesperrt .preis { color: inherit; font-size: .8rem; font-weight: 500; }

/* ---------- Listen */
.liste { list-style: none; margin: 0; padding: 0; }
.liste li { display: flex; gap: .75rem; align-items: center; padding: .6rem 0; border-top: 1px solid var(--linie); }
.liste li:first-child { border-top: 0; }
.liste .rest { flex: 1; min-width: 0; }
.liste .rechts { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.plus { color: var(--gut); }
.storno { text-decoration: line-through; color: var(--leise); }
a.zeile { display: flex; text-decoration: none; color: inherit; }

.marke { display: inline-block; font-size: .78rem; font-weight: 600; padding: .1rem .5rem; border-radius: 99px; background: var(--grund); border: 1px solid var(--linie); white-space: nowrap; }
.marke.gut { background: var(--gut-grund); color: var(--gut); border-color: transparent; }
.marke.warn { background: #fbefd9; color: #7a4f06; border-color: transparent; }
.marke.sperre { background: var(--sperre-grund); color: var(--sperre); border-color: transparent; }

/* ---------- Einlass */
.einlass { text-align: center; padding: 2rem 1rem; border-radius: var(--radius); color: #fff; }
.einlass .name { font-size: 1.8rem; font-weight: 750; }
.einlass .stufe { font-size: 3rem; font-weight: 800; letter-spacing: -.02em; }
.einlass.u18 { background: #9a5b00; }
.einlass.u16 { background: var(--sperre); }
.einlass.ab18 { background: #245c42; }
.einlass.stop { background: #5a1f1c; }

/* ---------- Fotos */
.galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.galerie figure { margin: 0; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; overflow: hidden; }
.galerie img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: var(--linie); }
.galerie figcaption { padding: .4rem .55rem; font-size: .85rem; }

/* ---------- Meldungen */
.meldung { position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--tinte); color: var(--grund); padding: .75rem 1rem; border-radius: 12px; max-width: calc(100% - 2rem);
  display: flex; gap: .75rem; align-items: center; z-index: 20; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.meldung.fehler { background: var(--sperre); color: #fff; }
.meldung button { min-height: 34px; padding: .2rem .7rem; background: transparent; color: inherit; border-color: currentColor; }
.hinweis { padding: .8rem 1rem; border-radius: 12px; background: #fbefd9; color: #5c3b04; margin-bottom: 1rem; }
@media (prefers-color-scheme: dark) { .hinweis { background: #33270f; color: #f1d9a8; } }
.leer { text-align: center; padding: 2rem 1rem; color: var(--leise); }

.anmelden { max-width: 400px; margin: 8vh auto 0; }
.anmelden .deckel { --g: 150px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .45rem .4rem; border-top: 1px solid var(--linie); vertical-align: top; }
.tabelle { overflow-x: auto; }
dialog { border: 0; border-radius: var(--radius); padding: 1.2rem; max-width: min(520px, calc(100vw - 2rem)); width: 100%; background: var(--flaeche); color: var(--tinte); }
dialog::backdrop { background: rgba(0,0,0,.45); }
.reihe > .marke { flex: 0 0 auto; }

/* ---------- Crew & Bereiche */
.bereich-chip { color: #fff; text-decoration: none; font-weight: 650; font-size: .9rem; padding: .3rem .75rem; border-radius: 99px; background: var(--bernstein); white-space: nowrap; }
.bereiche { display: grid; gap: .75rem; }
@media (min-width: 640px) { .bereiche { grid-template-columns: repeat(3, 1fr); } }
.bereich-knopf { display: grid; gap: .3rem; text-align: left; justify-content: stretch; padding: 1.3rem 1.2rem; min-height: 110px; }
.bereich-knopf strong { font-size: 1.4rem; }
.bereich-knopf span { font-weight: 450; color: var(--leise); }
.bereich-knopf.aktiv { border: 2px solid var(--bernstein); }
.modus.drei { grid-template-columns: repeat(3, 1fr); margin: 0; }
input.pin { font-size: 1.8rem; letter-spacing: .5em; text-align: center; }
.gross { font-size: 1.35rem; font-weight: 700; margin: 0 0 .6rem; font-variant-numeric: tabular-nums; }
button.breit { width: 100%; }
.einlass-status { margin-top: .8rem; font-size: 1.2rem; font-weight: 700; padding: .35rem .9rem; border-radius: 99px; background: rgba(255,255,255,.2); display: inline-block; }
.qr { background: #fff; padding: .6rem; border-radius: 10px; width: min(240px, 70vw); margin: .5rem auto 0; }
.qr svg { width: 100%; height: auto; display: block; }

/* ---------- Kasse */
.zaehlung { display: grid; gap: .45rem 1rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .zaehlung { grid-template-columns: 1fr 1fr; } }
.zaehl-zeile { display: grid; grid-template-columns: 1fr 6.5rem; align-items: center; gap: .6rem; margin: 0; font-weight: 500; }
.zaehl-zeile input { text-align: right; font-variant-numeric: tabular-nums; }
td.rechts { text-align: right; }
table.abrechnung tr.summe td { font-weight: 700; border-top: 2px solid var(--tinte); }
details.block summary { cursor: pointer; font-weight: 600; }
@media print {
  .kopf, .reiter, .reihe, .meldung { display: none !important; }
  body { background: #fff; color: #000; }
  .block { border: 0; }
}

/* ---------- Drucker, Gäste, Kamera */
.drucker-status { align-items: center; }
.drucker-status .rest { flex: 1 1 auto; font-weight: 550; }
.drucker-status button { flex: 0 0 auto; }
.einlass-gast { display: inline-block; margin: .3rem 0; padding: .1rem .7rem; border-radius: 99px; background: rgba(255,255,255,.25); font-weight: 700; }
video.kamera { width: 100%; border-radius: 10px; background: #000; aspect-ratio: 3/4; object-fit: cover; }
.produkt-zeile { display: grid !important; gap: .4rem; }
.kopf select.stammtisch-wahl { flex: 1; min-width: 0; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.35);
  font-weight: 650; min-height: 36px; padding: .25rem .5rem; }
.kopf select.stammtisch-wahl option { color: #17201b; }

/* ---------- Kamera, Kennzahlen */
.kamera-rahmen { position: relative; }
.kamera-ziel { position: absolute; inset: 18%; border: 3px solid rgba(255,255,255,.85); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0,0,0,.25); pointer-events: none; }
.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.kennzahl { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: .8rem 1rem; display: grid; gap: .1rem; }
.kennzahl strong { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.kennzahl span { color: var(--leise); font-size: .88rem; }
th.rechts { text-align: right; }

/* ---------- Offline, Aktionen */
.offline-leiste { display: flex; gap: .75rem; align-items: center; justify-content: center; padding: .5rem 1rem;
  background: #fbefd9; color: #5c3b04; font-weight: 600; font-size: .92rem; }
.offline-leiste.aus { background: var(--sperre); color: #fff; }
.offline-leiste button { min-height: 32px; padding: .15rem .7rem; }
.produkt s { opacity: .7; font-weight: 400; }
.aktionspreis { color: var(--bernstein); }
.hinweis ul { margin: .4rem 0 .6rem; padding-left: 1.2rem; }

[hidden] { display: none !important; }

/* ---------- Extras */
textarea { width: 100%; font: inherit; color: inherit; background: var(--grund); border: 1px solid var(--linie); border-radius: 10px; padding: .6rem .7rem; }
.hinweis-block { border-color: var(--bernstein); }
.umfrage-option { position: relative; display: flex; width: 100%; gap: .6rem; justify-content: space-between; margin-top: .45rem; overflow: hidden; text-align: left; }
.umfrage-option .balken { position: absolute; inset: 0 auto 0 0; background: var(--gut-grund); z-index: 0; transition: width .3s; }
.umfrage-option > span, .umfrage-option > strong { position: relative; z-index: 1; }
.umfrage-option.gewaehlt { border: 2px solid var(--flasche); }
.produkt.vorbestellen { cursor: default; }
.produkt.vorbestellen .reihe { flex-wrap: nowrap; margin-top: .3rem; }
.produkt.vorbestellen .reihe button { min-height: 36px; padding: 0 .6rem; flex: 0 0 auto; }
.tipp-zeile input { text-align: center; min-height: 40px; padding: .3rem; }
.liste.lager li { flex-wrap: wrap; }
.liste.lager li .rest { flex: 1 1 100%; }
.liste.lager li input { flex: 0 0 5rem; }
.einlass .echter-name { font-size: 1rem; opacity: .85; margin-top: -.2rem; }
.team-mini { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: var(--grund); border: 1px solid var(--linie); font-weight: 700; flex: 0 0 auto; }

/* Gerätetest: A4-Testseite nur beim Drucken */
.testseite { display: none; }
@media print {
  body.drucke-testseite > *:not(.testseite) { display: none !important; }
  body.drucke-testseite .testseite { display: block; font: 14pt/1.5 system-ui, sans-serif; color: #000; }
}

/* Jugendschutz-Uhr */
.js-leiste { background: #fbefd9; color: #5c3b04; padding: .6rem 1rem; display: grid; gap: .25rem; border-bottom: 2px solid #e2b04a; font-weight: 600; }
.js-leiste[hidden] { display: none; }
.js-leiste.rot { background: var(--sperre-grund); color: var(--sperre); border-bottom-color: var(--sperre); }
.js-leiste button { justify-self: start; margin-top: .2rem; padding: .3rem .8rem; min-height: 36px; font-size: .9rem; }
.einlass-frist { margin-top: .6rem; font-weight: 700; font-size: 1.1rem; }
