[hidden] { display: none !important; }
:root {
  --bg: #f6efe3;
  --karte: #fffaf1;
  --rand: #e3d3b8;
  --text: #3b2a1a;
  --leise: #8a7560;
  --rot: #c0392b;
  --rot-dunkel: #96281b;
  --gruen: #3f8f4f;
  --gelb: #e8a33d;
  --holz: #6b4423;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.4 system-ui, "Segoe UI", Roboto, sans-serif;
}
h2 { font-size: 15px; margin: 18px 0 8px; color: var(--holz); }
h2 small { font-weight: normal; color: var(--leise); font-size: 12px; }
button {
  font: inherit; cursor: pointer; border: 1px solid var(--rand); background: #fff;
  color: var(--text); border-radius: 8px; padding: 6px 10px; transition: background .1s, transform .05s;
}
button:hover:not(:disabled) { background: #fdf0dc; }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primaer { background: var(--rot); border-color: var(--rot-dunkel); color: #fff; font-weight: 600; }
button.primaer:hover:not(:disabled) { background: var(--rot-dunkel); }
button.klein { padding: 3px 8px; font-size: 12px; }

/* Kopfleiste */
header {
  position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  padding: 10px 18px; background: var(--holz); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
header .logo { font-weight: 800; font-size: 18px; margin-right: auto; }
header .stat { font-weight: 600; white-space: nowrap; }
header .geld { color: #ffe08a; }
header .minus { color: #ff9b8f; }
header button { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25); }
header button:hover:not(:disabled) { background: rgba(255,255,255,.22); }
.tagbar { width: 120px; height: 8px; border-radius: 4px; background: rgba(255,255,255,.2); overflow: hidden; }
.tagbar div { height: 100%; background: #ffe08a; }

main {
  display: grid; grid-template-columns: minmax(260px, 1fr) minmax(380px, 1.2fr) minmax(300px, 1fr);
  gap: 18px; padding: 8px 18px 40px; max-width: 1500px; margin: 0 auto;
}
@media (max-width: 1100px) { main { grid-template-columns: 1fr 1fr; } .col:nth-child(2) { grid-row: span 2; } }
@media (max-width: 760px) { main { grid-template-columns: 1fr; padding: 8px 12px 40px; } header { padding: 10px 12px; } }

.karte, .kunde, .slot, .station, .lieferung {
  background: var(--karte); border: 1px solid var(--rand); border-radius: 10px; padding: 10px;
}
.leer { color: var(--leise); font-style: italic; padding: 6px 2px; }

/* Kunden */
#kunden { display: grid; gap: 8px; }
.kunde { display: grid; grid-template-columns: 42px 1fr auto; gap: 8px; align-items: center; }
.kunde .avatar { font-size: 30px; text-align: center; }
.kunde .name { font-weight: 600; }
.kunde .bestellt { font-size: 13px; }
.kunde .zut { font-size: 13px; color: var(--leise); }
.balken { height: 6px; border-radius: 3px; background: #eadcc4; overflow: hidden; margin-top: 5px; }
.balken div { height: 100%; border-radius: 3px; }

/* Ausgabe */
#ausgabe { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.fertig {
  background: var(--karte); border: 2px solid var(--rand); border-radius: 10px; padding: 6px;
  text-align: center; cursor: pointer; position: relative;
}
.fertig.gewaehlt { border-color: var(--rot); box-shadow: 0 0 0 3px rgba(192,57,43,.2); }
.fertig img { width: 80px; height: 80px; display: block; margin: 0 auto 4px; }
.fertig .titel { font-weight: 600; font-size: 13px; }
.fertig .info { font-size: 11px; color: var(--leise); }
.fertig .weg { position: absolute; top: 3px; right: 3px; padding: 0 5px; font-size: 11px; }

/* Arbeitstisch */
.brett {
  background: repeating-linear-gradient(90deg, #b07a46 0 38px, #a8723f 38px 40px);
  border-radius: 14px; padding: 14px; display: flex; justify-content: center;
  box-shadow: inset 0 0 0 4px #8d5a2c;
}
#pizza { width: 100%; max-width: 360px; aspect-ratio: 1; }
#tisch { margin-top: 10px; }
.belaege { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; margin: 8px 0; }
.belaege button { text-align: left; display: flex; justify-content: space-between; gap: 6px; }
.belaege button.drauf { background: #e9f5ea; border-color: #9fcca8; }
.aktionen { display: flex; gap: 8px; flex-wrap: wrap; }
.hinweis { font-size: 13px; color: var(--leise); margin: 6px 0; }
.hinweis b { color: var(--gruen); }

/* Ofen */
#ofen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slot { text-align: center; min-height: 92px; background: #3a2418; color: #f4e3c8; border-color: #24150d; }
.slot .flamme { font-size: 22px; }
.slot .zustand { font-weight: 700; font-size: 13px; }
.ofenbalken { position: relative; height: 10px; border-radius: 5px; margin: 6px 0;
  background: linear-gradient(90deg, #6b6b6b 0 33.3%, #d9b45a 33.3% 46.6%, #4caf50 46.6% 66.6%, #b46a2a 66.6% 83.3%, #222 83.3%); }
.ofenbalken .zeiger { position: absolute; top: -3px; width: 3px; height: 16px; background: #fff; border-radius: 2px; box-shadow: 0 0 3px #000; }
.slot button { background: #f4e3c8; }

.speisekarte { margin-top: 16px; }
.speisekarte summary { cursor: pointer; font-weight: 600; }
.gericht { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--rand); font-size: 13px; }
.gericht.gesperrt { opacity: .45; }

/* Vorbereitung */
#vorb .stationen { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.station { padding: 7px 8px; font-size: 12px; }
.station b { display: block; font-size: 13px; }
.station.busy { background: #fff3dc; border-color: var(--gelb); }
.aufgaben { display: grid; gap: 5px; }
.aufgaben button { display: flex; justify-content: space-between; text-align: left; gap: 8px; font-size: 13px; }
.aufgaben .formel { color: var(--leise); white-space: nowrap; }
.lager { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 4px; margin-top: 8px; font-size: 12px; }
.lager div { background: #fff; border: 1px solid var(--rand); border-radius: 6px; padding: 3px 6px; display: flex; justify-content: space-between; }
.lager div.null { opacity: .45; }
.lager div.knapp { border-color: var(--rot); }

/* Shop */
.artikel { display: grid; grid-template-columns: 28px 1fr auto; gap: 6px; align-items: center; padding: 5px 0; border-bottom: 1px dashed var(--rand); }
.artikel .em { font-size: 20px; }
.artikel .n { font-weight: 600; font-size: 13px; }
.artikel .i { font-size: 11px; color: var(--leise); }
.menge { display: flex; align-items: center; gap: 4px; }
.menge span { min-width: 22px; text-align: center; font-weight: 700; }
.menge button { padding: 1px 8px; }
.kasse { margin-top: 8px; display: grid; gap: 6px; }
.kasse .summe { display: flex; justify-content: space-between; font-weight: 700; }
.schalter { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.schalter.an { background: #fff3dc; border-color: var(--gelb); }

#lief { display: grid; gap: 6px; }
.lieferung { font-size: 12px; }

/* Toasts */
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 6px; z-index: 50; max-width: min(360px, calc(100vw - 32px)); }
.toast { background: #2e2118; color: #fff; padding: 9px 12px; border-radius: 9px; box-shadow: 0 3px 10px rgba(0,0,0,.25); font-size: 13px; animation: rein .2s ease-out; }
.toast.gut { background: var(--gruen); }
.toast.fehler { background: var(--rot); }
@keyframes rein { from { transform: translateY(8px); opacity: 0; } }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(30,18,8,.55); display: none; align-items: center; justify-content: center; z-index: 40; padding: 16px; }
.modal.offen { display: flex; }
.dialog { background: var(--karte); border-radius: 14px; padding: 22px; width: min(440px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.dialog h3 { margin: 0 0 12px; font-size: 20px; }
.dialog table { width: 100%; border-collapse: collapse; margin: 8px 0 14px; }
.dialog td { padding: 4px 2px; border-bottom: 1px dashed var(--rand); }
.dialog td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.dialog .gesamt td { font-weight: 800; border-bottom: none; }
.dialog input { font: inherit; padding: 7px 10px; border: 1px solid var(--rand); border-radius: 8px; width: 100%; margin-bottom: 10px; }
.dialog .knoepfe { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pos { color: var(--gruen); } .neg { color: var(--rot); }

/* ===== Lobby ===== */
#lobby { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(circle at 30% 20%, #fff6e6, var(--bg)); }
.lobby-box { background: var(--karte); border: 1px solid var(--rand); border-radius: 16px; padding: 26px; width: min(520px, 100%);
  box-shadow: 0 10px 30px rgba(107,68,35,.15); display: grid; gap: 10px; }
.lobby-box h1 { margin: 0; color: var(--holz); }
.feld { display: grid; gap: 4px; font-weight: 600; font-size: 13px; }
.feld input, .zeile input, .zeile select, .zwei input { font: inherit; font-weight: normal; padding: 8px 10px; border: 1px solid var(--rand); border-radius: 8px; background: #fff; width: 100%; }
.rollenwahl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 520px) { .rollenwahl { grid-template-columns: 1fr; } }
.rolle { display: grid; gap: 2px; text-align: center; padding: 10px 6px; }
.rolle .em { font-size: 26px; }
.rolle small { color: var(--leise); font-size: 11px; }
.rolle.aktiv { border: 2px solid var(--rot); background: #fff3ec; }
button.gross { padding: 11px; font-size: 15px; }
.oder { text-align: center; color: var(--leise); font-size: 13px; }
.zeile { display: flex; gap: 8px; }
.zeile button { white-space: nowrap; }
#lFehler { color: var(--rot); min-height: 18px; font-size: 13px; }
button.link { background: none; border: none; color: var(--holz); text-decoration: underline; justify-self: center; }

/* ===== Kopf-Erweiterungen ===== */
header .code { font-weight: 800; letter-spacing: 1px; }
header .spieler { font-weight: 500; font-size: 13px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.rollenumschalter { display: flex; border-radius: 8px; overflow: hidden; border: 1px solid rgba(255,255,255,.25); }
.rollenumschalter button { border: none; border-radius: 0; padding: 6px 9px; }
.rollenumschalter button.aktiv { background: rgba(255,224,138,.45); }
.tagbar.vorb div { background: #9fd3ff; }

/* Rollen-Hinweise */
.rbadge { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 10px; background: #eadcc4; color: var(--holz); vertical-align: middle; }
.rbadge[data-rolle=back]::after { content: '🍕 Bäcker'; }
.rbadge[data-rolle=vorb]::after { content: '🔪 Vorbereitung'; }
body[data-rolle=alle] .rbadge { display: none; }
body[data-rolle=vorb] #colBack, body[data-rolle=vorb] #colTisch { opacity: .72; }
body[data-rolle=back] #colVorb { opacity: .72; }

/* Phase & Warteschlange */
.banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; background: linear-gradient(90deg, #e3f2ff, #fff6e6);
  border: 1px solid #b9dcf7; border-radius: 10px; padding: 10px 12px; margin-top: 12px; font-size: 13px; }
.warte { margin-top: 8px; background: #f3ecff; border: 1px solid #d5c4f5; border-radius: 10px; padding: 8px 10px; font-size: 12px; }
.kunde.stream.twitch { border-color: #9147ff; background: #f7f2ff; }
.kunde.stream.tiktok { border-color: #ff2d55; background: #fff1f4; }
.kunde .tag { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 8px; color: #fff; background: #9147ff; }
.kunde.tiktok .tag { background: #ff2d55; }
.toast.stream { background: #6c3fc5; }

/* Stationen & Mitarbeiter */
#vorb .stationen { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.station small { color: var(--leise); }
.station.ma { background: #eef7ee; border-color: #9fcca8; }
.mitarbeiter { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--rand); font-size: 13px; }
.mitarbeiter .em { font-size: 22px; }
.mitarbeiter small { color: var(--leise); }
.mitarbeiter.aktiv small:last-child { color: var(--gruen); }
.einstellen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0; }
.einstellen button { display: grid; font-size: 12px; text-align: center; }
.einstellen small { color: var(--leise); font-size: 10px; }
details summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.ziele { display: grid; gap: 4px; }
.ziel { display: flex; justify-content: space-between; align-items: center; font-size: 12px; padding: 2px 0; }
.ziel.unter > span:first-child { color: var(--rot); }
.ziel .menge span { min-width: 44px; }

/* Einstellungs-Dialog */
fieldset { border: 1px solid var(--rand); border-radius: 10px; margin: 0 0 10px; display: grid; gap: 8px; padding: 10px 12px; }
legend { font-weight: 700; padding: 0 4px; }
.check { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.status { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 8px; background: #eee; color: #666; }
.status.an { background: #dff3e2; color: var(--gruen); }
.status.warn { background: #fff0d6; color: #a86500; }
.dialog code { background: #f1e6d4; padding: 1px 5px; border-radius: 4px; }
.dialog ol { padding-left: 20px; font-size: 14px; }
.dialog ol li { margin-bottom: 6px; }
.dialog .dialog-breit { width: min(560px, 100%); }

/* ===== Login & Anfragen ===== */
.tabs { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--rand); border-radius: 10px; overflow: hidden; }
.tabs button { border: none; border-radius: 0; padding: 9px; font-weight: 600; background: #fff; }
.tabs button.aktiv { background: var(--rot); color: #fff; }
.fehlertext { color: var(--rot); min-height: 18px; font-size: 13px; }
.kopfzeile { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.kopfzeile .link { font-size: 12px; }
#angemeldet { font-size: 13px; }
.meine { display: grid; gap: 6px; }
.meine button { display: grid; text-align: left; gap: 1px; padding: 8px 12px; }
.meine button span { font-size: 12px; color: var(--leise); }
.meine button small { font-size: 11px; color: var(--holz); }
.online { color: var(--gruen); font-weight: 600; font-size: 12px; }
.lader { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--rand) 0 40%, var(--rot) 40% 60%, var(--rand) 60%); background-size: 200% 100%; animation: laden 1.4s linear infinite; }
@keyframes laden { from { background-position: 100% 0; } to { background-position: -100% 0; } }
header button.spieler { position: relative; font-size: 13px; font-weight: 500; }
header .punkt { position: absolute; top: -6px; right: -6px; background: #ffcc33; color: #3b2a1a; border-radius: 10px; font-size: 11px; font-weight: 800; padding: 0 6px; }
#anfragen { position: fixed; top: 70px; right: 16px; z-index: 45; display: grid; gap: 8px; width: min(320px, calc(100vw - 32px)); }
.anfrage { background: #fff; border: 2px solid var(--gelb); border-radius: 12px; padding: 10px 12px; box-shadow: 0 6px 20px rgba(0,0,0,.18);
  display: grid; gap: 8px; font-size: 13px; animation: rein .2s ease-out; }
.anfrage small { color: var(--leise); }
.toast.anfrage { background: #a86500; display: block; border: none; width: auto; }
