:root {
  --bg: #fdf6ec;
  --card: #fffdf8;
  --ink: #3b2a1f;
  --muted: #8a7462;
  --line: #ead9c4;
  --brand: #d9480f;
  --brand-2: #f08c00;
  --wood: #c08552;
  --wood-dark: #8d5a2b;
  --grass: #d8f0c8;
  --good: #2f9e44;
  --warn: #f59f00;
  --bad: #e03131;
  --radius: 16px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Fredoka', system-ui, sans-serif; font-size: 16px;
}
button { font: inherit; cursor: pointer; border: 0; border-radius: 12px; }
button:disabled { opacity: .45; cursor: not-allowed; }
small { color: var(--muted); }
h2, h3 { margin: 0 0 8px; }
h3 { font-size: 1.05rem; }

/* Kopfzeile */
#top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 16px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); color: #fff;
  position: sticky; top: 0; z-index: 5; box-shadow: 0 2px 8px #0002;
}
#top h1 { font-size: 1.4rem; margin: 0 auto 0 0; }
.pill { background: #fff3; padding: 6px 12px; border-radius: 999px; font-weight: 600; }
.pill.money { background: #fff; color: var(--good); font-size: 1.15rem; }
.pill.money.neg { color: var(--bad); }
.speed { display: flex; gap: 4px; }
.speed button { background: #fff3; color: #fff; width: 42px; height: 36px; font-size: 1.1rem; }
.speed button.on { background: #fff; color: var(--brand); }

#branches { display: flex; gap: 6px; padding: 8px 16px 0; flex-wrap: wrap; }
#branches button { background: var(--card); border: 2px solid var(--line); padding: 6px 12px; }
#branches button.on { border-color: var(--brand); background: #fff0e6; font-weight: 600; }

main { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; padding: 16px; align-items: start; }
@media (max-width: 860px) { main { grid-template-columns: 1fr; } }
section, aside { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 14px; }
.left { display: grid; gap: 16px; min-width: 0; }

/* Restaurant */
.tip { display: flex; gap: 10px; align-items: center; background: #fff4d6; border: 2px solid #ffd77a; border-radius: var(--radius); padding: 8px 12px; margin-bottom: 12px; }
.tip p { margin: 0; }
.big { font-size: 2rem; line-height: 1; }
.area { border-radius: var(--radius); padding: 10px; margin-bottom: 10px; }
.door { background: #f3e9dc; }
.inside { background: repeating-linear-gradient(45deg, #f7ead8, #f7ead8 14px, #f3e3cd 14px, #f3e3cd 28px); }
.terrace { background: var(--grass); }
.team { background: #eef3fb; margin-bottom: 0; }
.decor { font-size: 1.2rem; margin-left: 6px; }
.queue { display: flex; gap: 8px; flex-wrap: wrap; min-height: 10px; }
.qg { background: #fff; border-radius: 12px; padding: 4px 8px; font-size: 1.4rem; }
.tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.table {
  background: #fff; border-radius: 14px; padding: 8px; text-align: center; min-height: 120px;
  display: flex; flex-direction: column; justify-content: center; gap: 4px; border: 3px solid transparent;
}
.table .top {
  background: var(--wood); border-bottom: 5px solid var(--wood-dark); border-radius: 50%;
  padding: 8px 4px; font-size: 1.35rem; min-height: 46px; display: flex; align-items: center; justify-content: center;
}
.table .people { font-size: 1.6rem; letter-spacing: -2px; }
.table.empty { opacity: .7; }
.table.closed { opacity: .5; }
.table.waitOrder { border-color: #74c0fc; }
.table.waitFood { border-color: var(--warn); }
.table.eating { border-color: var(--good); }
.table.waitPay { border-color: #9775fa; }
.bar { height: 7px; background: #0001; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; transition: width .25s; }
.bar.wide { height: 12px; margin-top: 4px; }
.workers { display: flex; flex-wrap: wrap; gap: 8px; }
.worker { background: #fff; border-radius: 12px; padding: 6px 10px; display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; min-width: 170px; }
.worker .big { grid-row: span 2; font-size: 1.8rem; }
.worker.working { box-shadow: inset 0 0 0 2px var(--warn); }

/* Gäste-Feedback */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 8px 0; }
.stat { background: var(--bg); border-radius: 12px; padding: 8px 10px; }
.stat span { display: block; font-size: .8rem; color: var(--muted); }
.stat b { font-size: 1.3rem; }
.stat.warnbox { background: #fff0f0; }
.stars { color: var(--brand-2); letter-spacing: 1px; }
.legend { font-size: .85rem; color: var(--muted); margin: 4px 0; }
.fb { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.fb li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; background: var(--bg); border-radius: 12px; padding: 6px 10px; }
.fb li.empty { display: block; color: var(--muted); }
.face { font-size: 2rem; }
.wishes { display: flex; flex-wrap: wrap; gap: 3px; justify-content: flex-end; }
.w { background: #fff; border-radius: 8px; padding: 2px 4px; font-size: .9rem; white-space: nowrap; }
.w.no { background: #ffe3e3; }
@media (max-width: 520px) { .fb li { grid-template-columns: auto 1fr; } .wishes { grid-column: 1 / -1; justify-content: flex-start; } }

/* Laden */
aside { position: sticky; top: 70px; max-height: calc(100vh - 86px); display: flex; flex-direction: column; }
@media (max-width: 860px) { aside { position: static; max-height: none; } }
#tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
#tabs button { background: var(--bg); padding: 8px 10px; }
#tabs button.on { background: var(--brand); color: #fff; }
#shop { overflow-y: auto; flex: 1; padding-right: 4px; }
#shop h3 { margin-top: 12px; }
.hint { font-size: .88rem; color: var(--muted); margin: 4px 0 8px; }
.row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.ri { font-size: 1.7rem; width: 36px; text-align: center; }
.rt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.buy { background: var(--good); color: #fff; padding: 6px 12px; display: flex; flex-direction: column; align-items: center; line-height: 1.15; font-size: .85rem; }
.buy b { font-size: 1rem; }
.done { color: var(--good); font-weight: 600; }
.locked { font-size: .8rem; color: var(--muted); text-align: right; max-width: 130px; }
.lvs { display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; }
.lv { background: var(--bg); padding: 5px 7px; font-size: .8rem; }
.lv.on.lo { background: var(--good); color: #fff; }
.lv.on.mid { background: var(--warn); color: #fff; }
.lv.on.hi { background: var(--bad); color: #fff; }
.star { background: var(--bg); padding: 4px 7px; filter: grayscale(1); opacity: .6; }
.star.on { background: #fff4d6; filter: none; opacity: 1; }
.toggle { background: var(--bg); padding: 8px 14px; font-weight: 700; color: var(--muted); }
.toggle.on { background: var(--good); color: #fff; }
.reset { margin-top: 10px; background: transparent; color: var(--muted); font-size: .85rem; }
.costs { width: 100%; border-collapse: collapse; }
.costs td, .costs th { padding: 4px 6px; text-align: left; border-bottom: 1px solid var(--line); }
.costs td:last-child, .costs th:last-child { text-align: right; white-space: nowrap; }
.costs .plus { color: var(--good); }
.costs .minus { color: var(--bad); }
.costs .total th { font-size: 1.15rem; border-top: 2px solid var(--ink); }

/* Fenster */
#modal { position: fixed; inset: 0; background: #3b2a1f99; display: grid; place-items: center; z-index: 20; padding: 16px; }
#modal[hidden] { display: none; }
.card { background: var(--card); border-radius: 22px; padding: 22px; max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 10px 40px #0004; }
.big-msg { font-size: 1.15rem; font-weight: 600; }
.steps { padding-left: 20px; } .steps li { margin-bottom: 6px; }
.go { background: var(--brand); color: #fff; font-size: 1.2rem; padding: 12px 20px; width: 100%; margin-top: 10px; font-weight: 600; }
.foot { display: flex; justify-content: space-between; }
.code { font-size: 1.6rem; font-weight: 700; letter-spacing: 2px; text-align: center; background: #fff4d6; border-radius: 12px; padding: 10px; user-select: all; }
.codein { display: flex; gap: 8px; }
.codein input { flex: 1; min-width: 0; font: inherit; font-size: 1.1rem; padding: 8px 10px; border: 2px solid var(--line); border-radius: 12px; text-transform: uppercase; }
