/* Kristallstüberl – Kreidetafel-Design */
:root {
  --chalk: #2c2c2c;
  --chalk-2: #353535;
  --line: rgba(255, 255, 255, 0.55);
  --white: #f6f4ef;
  --muted: #bdb9b0;
  --orange: #f47a20;
  --yellow: #ffd43b;
  --red: #c62f2a;
  --green: #8bc34a;
  --danger: #ff6b5e;
  --radius: 14px;
  --marker: 'Permanent Marker', 'Comic Sans MS', cursive;
  --script: 'Pacifico', cursive;
  --hand: 'Patrick Hand', 'Segoe Print', cursive;
  --ui: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--chalk) url('../media/chalk.jpg') center / cover fixed;
  color: var(--white);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
.marker { font-family: var(--marker); letter-spacing: 0.02em; }
.script { font-family: var(--script); }
.hand { font-family: var(--hand); }
.hidden { display: none !important; }

/* ---------- Kopf ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(36, 36, 36, 0.92); backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.topbar-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 8px 14px; }
.logo { height: 52px; width: auto; }
.brand { font-family: var(--marker); font-size: 1.5rem; line-height: 1; }
.brand small { display: block; font-family: var(--ui); font-size: 0.75rem; color: var(--muted); margin-top: 4px; letter-spacing: 0; }
.status-pill {
  margin-left: auto; text-align: right; padding: 6px 12px; border-radius: 999px;
  border: 2px solid var(--green); color: var(--white); font-weight: 700; font-size: 0.85rem; line-height: 1.2;
}
.status-pill small { display: block; font-weight: 400; color: var(--muted); }
.status-pill.closed { border-color: var(--danger); }

.cat-nav { display: flex; gap: 8px; overflow-x: auto; padding: 6px 14px 10px; max-width: 1100px; margin: 0 auto; scrollbar-width: none; }
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav a {
  flex: none; text-decoration: none; color: var(--white); font-family: var(--marker); font-size: 1rem;
  padding: 6px 14px; border: 1.5px solid var(--line); border-radius: 999px;
}
.cat-nav a.active { background: var(--orange); border-color: var(--orange); color: #1d1d1d; }

/* ---------- Speisekarte ---------- */
main { max-width: 1100px; margin: 0 auto; padding: 10px 14px 140px; }
.closed-banner {
  margin: 14px 0; padding: 18px; border: 2px dashed var(--danger); border-radius: var(--radius); text-align: center;
}
.closed-banner h2 { font-family: var(--marker); margin: 0 0 4px; font-size: 1.8rem; }
.cat { scroll-margin-top: 130px; margin-top: 26px; }
.cat-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; min-height: 90px; }
.cat-head h2 { font-family: var(--marker); font-size: 2.4rem; margin: 0; line-height: 1; transform: rotate(-2deg); }
.cat-head .slogan { font-family: var(--script); color: var(--yellow); font-size: 1.05rem; margin-top: 6px; }
.cat-head img { max-height: 110px; max-width: 45%; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)); }
.menu-hint { font-family: var(--script); color: var(--yellow); font-size: 0.95rem; margin: 6px 0 0; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-top: 12px; }
.item {
  position: relative; display: flex; gap: 12px; align-items: stretch; text-align: left; width: 100%;
  background: rgba(255, 255, 255, 0.03); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 12px 12px 12px 14px; transition: transform 0.08s, background 0.15s;
}
.item:active { transform: scale(0.985); }
.item:hover { background: rgba(255, 255, 255, 0.07); }
.item-body { flex: 1; min-width: 0; }
.item-name { font-family: var(--marker); font-size: 1.15rem; line-height: 1.15; }
.item-desc { font-family: var(--hand); font-size: 1.05rem; color: var(--muted); margin-top: 3px; line-height: 1.2; }
.item-price { font-family: var(--marker); color: var(--orange); font-size: 1.35rem; margin-top: 6px; }
.item-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 6px; }
.item-side img { width: 84px; height: 64px; object-fit: contain; }
.add-btn {
  width: 42px; height: 42px; border-radius: 50%; border: none; background: var(--orange); color: #1d1d1d;
  font-size: 1.6rem; font-weight: 800; line-height: 1; display: grid; place-items: center;
}
.tag { display: inline-block; font-size: 0.7rem; font-weight: 800; padding: 1px 6px; border-radius: 6px; margin-left: 6px; vertical-align: middle; font-family: var(--ui); }
.tag.neu { border: 1.5px solid var(--white); }
.tag.veg { color: var(--green); font-size: 1rem; padding: 0; }
.tag.scharf { font-size: 1rem; padding: 0; }
.item.soldout { opacity: 0.45; }
.item.soldout .add-btn { display: none; }
.soldout-label { font-family: var(--marker); color: var(--danger); transform: rotate(-6deg); }
.allergens { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }

/* ---------- Warenkorb-Leiste ---------- */
.cartbar {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 30;
  width: min(560px, calc(100% - 24px)); display: flex; align-items: center; gap: 12px;
  background: var(--orange); color: #1d1d1d; border: none; border-radius: 999px; padding: 14px 22px;
  font-weight: 800; font-size: 1.05rem; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.cartbar .count { background: #1d1d1d; color: var(--orange); border-radius: 999px; min-width: 30px; height: 30px; display: grid; place-items: center; }
.cartbar .sum { margin-left: auto; }

/* ---------- Sheets / Dialoge ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: min(620px, 100%); max-height: 92vh; overflow: auto; background: #2a2a2a url('../media/chalk.jpg') center / cover;
  border-radius: 22px 22px 0 0; border: 1.5px solid var(--line); border-bottom: none; padding: 20px 18px 24px;
  animation: up 0.18s ease-out;
}
@media (min-width: 700px) { .overlay { align-items: center; } .sheet { border-radius: 22px; border-bottom: 1.5px solid var(--line); } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet h3 { font-family: var(--marker); font-size: 1.7rem; margin: 0 0 4px; }
.sheet .close { float: right; background: none; border: 1.5px solid var(--line); border-radius: 50%; width: 38px; height: 38px; font-size: 1.2rem; }
.group { margin-top: 16px; }
.group-label { font-weight: 800; margin-bottom: 8px; }
.group-label .req { color: var(--muted); font-weight: 400; font-size: 0.85rem; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  border: 1.5px solid var(--line); background: transparent; border-radius: 12px; padding: 10px 14px; text-align: left;
}
.choice.on { background: var(--white); color: #1d1d1d; border-color: var(--white); font-weight: 700; }
.choice .plus { color: var(--orange); font-weight: 800; margin-left: 6px; }
.choice.on .plus { color: var(--red); }
.field { margin-top: 14px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: rgba(0, 0, 0, 0.25); color: var(--white); font-size: 1.05rem;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--orange); border-color: transparent; }
.row { display: flex; align-items: center; gap: 12px; }
.qty { display: inline-flex; align-items: center; gap: 4px; border: 1.5px solid var(--line); border-radius: 999px; }
.qty button { width: 40px; height: 40px; border: none; background: none; font-size: 1.4rem; font-weight: 800; }
.qty span { min-width: 26px; text-align: center; font-weight: 800; font-size: 1.1rem; }
.primary {
  display: block; width: 100%; margin-top: 20px; padding: 16px; border: none; border-radius: 999px;
  background: var(--orange); color: #1d1d1d; font-weight: 800; font-size: 1.1rem;
}
.primary:disabled { opacity: 0.5; }
.secondary { background: none; border: 1.5px solid var(--line); border-radius: 999px; padding: 10px 16px; }
.error { color: var(--danger); font-weight: 700; margin-top: 12px; }
.cart-line { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.25); }
.cart-line .info { flex: 1; }
.cart-line .name { font-weight: 800; }
.cart-line .det { color: var(--muted); font-size: 0.9rem; }
.cart-line .price { font-family: var(--marker); color: var(--orange); white-space: nowrap; }
.total { display: flex; justify-content: space-between; font-family: var(--marker); font-size: 1.5rem; margin-top: 14px; }
.small { font-size: 0.85rem; color: var(--muted); }
.small a { color: var(--white); }

/* ---------- Bestätigung / Status ---------- */
.center-card { max-width: 560px; margin: 40px auto; text-align: center; padding: 26px 20px; border: 2px solid var(--line); border-radius: 22px; background: rgba(0, 0, 0, 0.15); }
.big-number { font-family: var(--marker); font-size: 5rem; color: var(--orange); line-height: 1; margin: 10px 0; }
.steps { display: flex; justify-content: center; gap: 8px; margin: 18px 0; }
.steps span { padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.steps span.on { background: var(--green); border-color: var(--green); color: #1d1d1d; font-weight: 800; }

/* Fake-Zahlseite im Demo-Modus */
.demo-pay { background: #fff; color: #222; border-radius: 18px; padding: 22px; max-width: 420px; margin: 40px auto; font-family: var(--ui); }
.demo-pay h3 { margin-top: 0; }
.demo-pay .ok { background: #1b8f3a; color: #fff; }
.demo-pay .no { background: #ddd; color: #222; }
.demo-pay button { width: 100%; padding: 14px; border: none; border-radius: 10px; margin-top: 10px; font-weight: 800; }

.demo-flag { position: fixed; left: 50%; top: 0; transform: translateX(-50%); z-index: 95; background: var(--yellow); color: #1d1d1d; font-weight: 800; font-size: 0.75rem; padding: 4px 10px; border-radius: 0 0 10px 10px; white-space: nowrap; }
.toast { position: fixed; top: 80px; left: 50%; transform: translateX(-50%); background: var(--white); color: #1d1d1d; padding: 10px 18px; border-radius: 999px; font-weight: 800; z-index: 70; box-shadow: 0 8px 20px rgba(0,0,0,.4); }

/* ---------- Terminal (Tablet im Bistro) ---------- */
body.terminal { font-size: 18px; user-select: none; }
body.terminal .item-name { font-size: 1.3rem; }
body.terminal .add-btn { width: 52px; height: 52px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.keypad button { padding: 18px; font-size: 1.6rem; font-weight: 800; border-radius: 14px; border: 1.5px solid var(--line); background: rgba(0,0,0,.2); }
.pager-display { font-family: var(--marker); font-size: 3rem; text-align: center; color: var(--orange); min-height: 64px; border-bottom: 2px solid var(--line); }

/* ---------- Sprache / Modus ---------- */
.tools-row { padding-top: 0; padding-bottom: 0; }
.tools { display: flex; align-items: center; gap: 8px; width: 100%; justify-content: flex-end; }
.langs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.lang { flex: none; padding: 5px 9px; border-radius: 10px; border: 1.5px solid transparent; background: none; font-size: .8rem; font-weight: 800; line-height: 1; color: var(--muted); }
.lang.on { border-color: var(--line); color: var(--white); }
.mode-chip { border: 1.5px solid var(--line); background: rgba(0,0,0,.25); border-radius: 999px; padding: 6px 14px; font-weight: 800; }
.tools .mode-chip:first-child { margin-right: auto; }
.mode-line { font-weight: 800; margin-bottom: 6px; }
.allergens { display: inline-flex; align-items: center; gap: 5px; margin-top: 5px; padding: 2px 8px 2px 0; font-size: .78rem; color: var(--muted); cursor: pointer; }
.allergens:hover .al-letters { color: var(--white); }
.al-i { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--muted); font-size: .65rem; font-weight: 800; font-style: italic; }
.al-list { display: grid; gap: 8px; }
.al-entry { display: grid; grid-template-columns: 34px 22px 1fr; align-items: center; gap: 8px; font-size: 1.05rem; }
.al-entry img, .al-noicon { width: 30px; height: 30px; background: #fff; border-radius: 50%; }
.al-icon { width: 20px; height: 20px; background: #fff; border-radius: 50%; }
.al-letters { letter-spacing: .08em; font-weight: 700; }
.sheet-img { display: block; max-height: 140px; max-width: 70%; margin: 0 auto 8px; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0,0,0,.5)); }

/* ---------- Terminal-Vollbildseiten (Start, Hier essen/Mitnehmen, Spende, Danke) ---------- */
.screen { position: fixed; inset: 0; z-index: 70; overflow: auto; background: #2a2a2a url('../media/chalk.jpg') center / cover; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 40px 28px; text-align: center; }
.start-logo { width: min(78vw, 560px); height: auto; }
.start-logo.small { width: min(40vw, 260px); }
.start-greet { color: var(--yellow); font-size: clamp(2.2rem, 7vw, 4rem); min-height: 1.4em; }
.start-title { font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1.1; }
.start-food { display: flex; justify-content: center; align-items: flex-end; gap: 10px; }
.start-food img { width: 30%; max-width: 230px; filter: drop-shadow(0 10px 14px rgba(0,0,0,.6)); }
.start-hint { color: var(--muted); font-size: 1.1rem; }
.start-langs { display: grid; grid-template-columns: 1fr; gap: 14px; width: min(92vw, 640px); }
.start-langs button { padding: 22px 12px; border-radius: 20px; border: 2px solid var(--line); background: rgba(0,0,0,.3); font-size: 1.35rem; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 12px; }
.eat-where { display: grid; grid-template-columns: 1fr; gap: 20px; width: min(92vw, 640px); }
.eat-where button { padding: 34px 20px; border-radius: 26px; border: 3px solid var(--orange); background: rgba(0,0,0,.3); font-family: var(--marker); font-size: 2.3rem; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.eat-where .big { font-size: 4.2rem; line-height: 1; }
.eat-where small { font-family: var(--ui); font-size: 1rem; color: var(--muted); }
.quail-img { width: min(80vw, 520px); height: auto; filter: drop-shadow(0 12px 16px rgba(0,0,0,.55)); transition: transform .4s; }
.quail-img.happy { animation: hop .5s ease-in-out 3; }
.quail-img.small { width: min(50vw, 260px); }
@keyframes hop { 50% { transform: translateY(-14px) rotate(-2deg); } }
.donate-text { font-size: 1.4rem; max-width: 640px; line-height: 1.4; margin: 0; }
.donate-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: min(92vw, 640px); }
.donate-btns .primary { margin: 0; font-size: 1.4rem; }
.big-secondary { padding: 16px 30px; font-size: 1.15rem; }
.greetings { color: var(--yellow); font-size: 1.3rem; margin-top: 10px; }

/* Terminal hochkant: größere Bedienelemente, 2 Spalten */
body.terminal .items { grid-template-columns: 1fr 1fr; }
@media (max-width: 700px) { body.terminal .items { grid-template-columns: 1fr; } }
body.terminal .item { flex-direction: column-reverse; align-items: stretch; }
body.terminal .item-side { flex-direction: row; align-items: center; }
body.terminal .item-side img { width: 120px; height: 90px; }
body.terminal .cat-nav a { font-size: 1.2rem; padding: 10px 18px; }
body.terminal .lang { padding: 10px 12px; font-size: 1rem; }
body.terminal .cartbar { padding: 20px 26px; font-size: 1.25rem; }
.mode-chip { white-space: nowrap; }
body.terminal .tools { flex-wrap: wrap; }
body.terminal .langs { overflow: visible; flex-wrap: wrap; }
