:root {
  --ink: #2a1a12;
  --ink-2: #5a4234;
  --paper: #fffaf2;
  --cream: #fff1dc;
  --orange: #ff7a3d;
  --orange-d: #d9541c;
  --yellow: #ffc93c;
  --green: #4cc35a;
  --red: #e8452f;
  --blue: #4a9bd8;
  --muted: #8a6f5c;
  --shadow: 0 4px 0 var(--ink);
  --font: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #1c1310;
  color: var(--ink);
  font-family: var(--font);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

#app { position: fixed; inset: 0; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.05em 0.45em;
  border: 2px solid var(--ink);
  border-bottom-width: 4px;
  border-radius: 7px;
  background: #fff;
  font: 600 0.85em var(--font);
  text-align: center;
  color: var(--ink);
}

.stars { color: #f2a51a; letter-spacing: 1px; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15); }

/* ------------------------------------------------------------ Buttons */
button { font-family: inherit; }
.btn {
  appearance: none;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 10px 20px;
  font: 600 17px var(--font);
  color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s, background 0.15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--ink); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.btn.primary { background: var(--orange); color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18); }
.btn.primary:hover { background: #ff8a52; }
.btn.big { font-size: 21px; padding: 13px 28px; }
.btn.ghost { background: var(--cream); }
.row-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ------------------------------------------------------------ Screens */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: radial-gradient(ellipse at center, rgba(28, 19, 16, 0.25), rgba(28, 19, 16, 0.7));
  animation: fadeIn 0.25s ease;
  overflow-y: auto;
}
#scr-title { justify-content: flex-start; padding-left: max(16px, 6vw); background: linear-gradient(90deg, rgba(28, 19, 16, 0.7), rgba(28, 19, 16, 0.05) 70%); }

.panel {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100% - 8px);
  overflow-y: auto;
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 24px;
  box-shadow: 0 8px 0 var(--ink), 0 24px 60px rgba(0, 0, 0, 0.45);
  padding: 26px 28px;
  text-align: center;
  animation: pop 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.panel h1 { margin: 2px 0 12px; font-size: 40px; line-height: 1.05; font-weight: 700; }
.panel h3 { margin: 14px 0 8px; font-size: 18px; text-align: left; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 13px; font-weight: 600; color: var(--orange-d); }
.muted { color: var(--muted); font-size: 14px; }
.center { text-align: center; }

@keyframes pop { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Titel */
.title-panel { width: min(440px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.logo { display: flex; flex-direction: column; line-height: 0.88; margin: 4px 0 2px; transform: rotate(-3deg); }
.logo .l1 { font-size: 46px; font-weight: 600; color: var(--ink); }
.logo .l2 {
  font-size: 84px;
  font-weight: 700;
  color: var(--orange);
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 6px 0 var(--ink);
  display: inline-flex;
  align-items: center;
}
.logo .l2 svg { width: 56px; height: 56px; color: var(--yellow); filter: drop-shadow(0 4px 0 var(--ink)); margin-left: 2px; }
.tagline { margin: 0 0 6px; color: var(--ink-2); font-size: 17px; }
.controls { display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); margin-top: 8px; text-align: left; }
.controls span { color: var(--muted); margin-left: 4px; }
.best { font-size: 14px; color: var(--muted); padding-top: 6px; border-top: 2px dashed #e6d3bd; width: 100%; }
.howto { text-align: left; margin: 0; padding-left: 20px; font-size: 14.5px; color: var(--ink-2); display: grid; gap: 4px; }

/* Intro */
.intro-meta { display: flex; gap: 10px; justify-content: center; margin-bottom: 6px; flex-wrap: wrap; }
.intro-meta div { background: var(--cream); border: 3px solid var(--ink); border-radius: 14px; padding: 6px 14px; min-width: 120px; }
.intro-meta span { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.intro-meta b { font-size: 22px; }
.tip { font-size: 14.5px; color: var(--ink-2); background: #fff4d6; border-radius: 12px; padding: 10px 14px; margin: 14px 0 18px; }

.recipe { display: flex; gap: 12px; align-items: center; text-align: left; background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 8px 12px; margin-bottom: 8px; }
.recipe .dish { width: 76px; height: 76px; flex: none; }
.recipe .r-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.recipe .r-head b { font-size: 18px; }
.recipe .price { font-weight: 700; color: #2f9e44; }
.recipe .r-ings { display: flex; align-items: center; gap: 2px; margin: 2px 0; }
.recipe .r-ings img { width: 34px; height: 34px; }
.recipe .plus { font-weight: 700; color: var(--muted); }
.recipe p { margin: 2px 0 0; font-size: 13.5px; color: var(--ink-2); }
.recipe.small .dish { width: 60px; height: 60px; }

/* Stats */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 10px; }
.stats div { background: var(--cream); border-radius: 12px; padding: 7px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stats span { color: var(--muted); font-size: 14px; }
.stats b { font-size: 18px; }
.bonus { background: #fff1b8; border-radius: 12px; padding: 8px; font-weight: 600; margin: 4px 0; }
.reason { font-size: 17px; color: var(--ink-2); }
.record { font-size: 22px; font-weight: 700; color: var(--orange-d); animation: pop 0.5s; }

/* Shop */
.shop-head { display: flex; justify-content: space-between; align-items: baseline; }
.shop-head span { font-size: 15px; }
.shop { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.up {
  appearance: none;
  text-align: left;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 8px 10px 8px;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--ink);
  transition: transform 0.08s;
}
.up:hover:not(:disabled) { transform: translateY(-2px); background: #fffbea; }
.up:disabled { opacity: 0.55; cursor: default; box-shadow: none; }
.up.max { opacity: 0.8; background: #eaf8ec; }
.up-head { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.up-head b { font-size: 15px; }
.up small { font-size: 12.5px; color: var(--ink-2); line-height: 1.2; }
.up .cost { align-self: flex-end; font-weight: 700; color: #2f9e44; font-size: 15px; }
.pips { display: flex; gap: 3px; }
.pips i { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; }
.pips i.on { background: var(--green); }

.end-panel { width: min(780px, 100%); padding-bottom: 0; }
.end-panel #btn-next { position: sticky; bottom: 14px; margin-bottom: 14px; z-index: 2; }
.end-panel #end-next { margin-bottom: 6px; }
.cashline { margin: 10px 0 2px; font-size: 18px; background: #eaf8ec; border-radius: 12px; padding: 7px; }
.cashline b { font-size: 22px; color: #2f9e44; }
.stats b.neg { color: var(--red); }
.quits { background: #ffe1da; border-radius: 12px; padding: 8px; font-weight: 600; margin: 4px 0; font-size: 14.5px; }
.team { font-size: 14.5px; background: #eef5fb; border-radius: 12px; padding: 9px 14px; margin: 10px 0 0; color: var(--ink-2); }
.team small { color: var(--muted); }

.staff { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 4px; }
.staff-card {
  text-align: left;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 3px 0 var(--ink);
}
.staff-card.locked { opacity: 0.6; box-shadow: none; border-style: dashed; }
.sc-head { display: flex; align-items: center; gap: 7px; }
.sc-head b { font-size: 16px; }
.sc-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); flex: none; }
.sc-count { margin-left: auto; font-weight: 700; font-size: 14px; background: var(--cream); border-radius: 8px; padding: 1px 7px; }
.staff-card small { font-size: 12.5px; color: var(--ink-2); line-height: 1.25; }
.sc-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.sc-meta b { color: var(--ink); }
.sc-names { color: var(--ink); font-weight: 600; }
.sc-btns { display: flex; gap: 6px; align-items: center; margin-top: auto; flex-wrap: wrap; }
.sc-note { font-size: 13px; color: var(--muted); font-style: italic; }
.btn.small { font-size: 14px; padding: 5px 12px; border-radius: 10px; box-shadow: 0 3px 0 var(--ink); }
.btn.small:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn.small.ghost { margin-left: auto; font-size: 12.5px; padding: 4px 9px; }

.ntag {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  will-change: transform;
}
.ntag > * { transform: translate(-50%, -100%); }
.ntag b {
  font-size: 12px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-left: 7px solid var(--c, var(--ink));
  border-radius: 8px;
  padding: 0 6px;
  white-space: nowrap;
}
.ntag small {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, 2px);
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  -webkit-text-stroke: 3px rgba(42, 26, 18, 0.85);
  paint-order: stroke fill;
  white-space: nowrap;
}

.pause-panel { width: min(400px, 100%); display: flex; flex-direction: column; gap: 12px; }
.book-panel { width: min(620px, 100%); }
.book-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.book-list .recipe { margin: 0; }

/* ------------------------------------------------------------ HUD */
#hud { position: absolute; inset: 0; pointer-events: none; }
.hud-top {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.card {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 7px 12px 9px;
}
.day-card { width: 170px; flex: none; }
.day-row, .money-row { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.day-row b { font-size: 20px; }
.day-row span { font-size: 15px; color: var(--ink-2); font-weight: 500; }
.money-card { width: 200px; flex: none; margin-left: auto; }
.money-row b { font-size: 22px; }
.money-row .goal { color: var(--muted); font-size: 15px; margin-right: auto; }
.money-row .lbl { font-size: 13px; color: var(--muted); }
.money-row.small { margin-top: 3px; font-size: 15px; }
.money-row.small b { font-size: 15px; color: var(--ink); }
.bar { height: 10px; border: 2px solid var(--ink); border-radius: 8px; background: #efe3d2; overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; width: 0; background: var(--blue); border-radius: 6px; transition: width 0.25s; }
.bar.gold i { background: var(--yellow); }
.bar.gold i.reached { background: var(--green); }

#tickets { flex: 1; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; min-width: 0; }
.ticket {
  width: 118px;
  background: #fffef8;
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 3px 0 var(--ink);
  padding: 4px 7px 6px;
  animation: ticketIn 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
  transition: transform 0.2s, opacity 0.2s;
  position: relative;
}
.ticket::before { content: ''; position: absolute; top: -3px; left: 10px; right: 10px; height: 5px; background: repeating-linear-gradient(90deg, var(--ink) 0 4px, transparent 4px 9px); opacity: 0.25; }
.ticket.out { transform: translateY(-20px) scale(0.8); opacity: 0; }
.ticket.urgent { animation: shake 0.5s infinite; background: #fff0ec; }
.ticket.match { border-color: #2f9e44; box-shadow: 0 3px 0 #2f9e44, 0 0 0 3px rgba(76, 195, 90, 0.35); }
.t-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.t-dish { width: 46px; height: 46px; flex: none; margin: -2px 0 -4px -4px; }
.t-table { display: flex; flex-direction: column; align-items: center; line-height: 0.95; font-size: 22px; font-weight: 700; }
.t-table small { font-size: 10.5px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.t-name { display: block; font-size: 13.5px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-ings { display: flex; gap: 0; margin: 1px 0 2px; }
.t-ings img { width: 21px; height: 21px; }
.pbar { height: 7px; border: 2px solid var(--ink); border-radius: 6px; background: #efe3d2; overflow: hidden; }
.pbar i { display: block; height: 100%; width: 100%; background: var(--green); }

@keyframes ticketIn { from { transform: translateY(-30px) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-2.5deg); } 75% { transform: rotate(2.5deg); } }

.hud-btns { position: absolute; right: 12px; top: calc(max(10px, env(safe-area-inset-top)) + 96px); display: flex; gap: 6px; pointer-events: auto; }
.icon-btn {
  width: 42px;
  height: 42px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 3px 0 var(--ink);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.icon-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.icon-btn svg { width: 22px; height: 22px; }
#btn-sound .cross { display: none; }
#btn-sound.off .cross { display: inline; }
#btn-sound.off .wave { display: none; }

#prompt {
  position: absolute;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow);
  padding: 7px 18px 7px 8px;
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  max-width: calc(100% - 24px);
}
#prompt span { overflow: hidden; text-overflow: ellipsis; }
#prompt kbd { background: var(--yellow); font-size: 15px; }
#prompt.blocked { background: #efe6da; color: var(--muted); }
#prompt.blocked kbd { background: #ddd; color: var(--muted); }
#prompt.good { background: #e3f7e6; }
#prompt.good kbd { background: var(--green); color: #fff; }

#hint {
  position: absolute;
  left: 50%;
  bottom: calc(max(22px, env(safe-area-inset-bottom)) + 62px);
  transform: translateX(-50%);
  background: rgba(42, 26, 18, 0.86);
  color: #fff3dc;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 15px;
  max-width: min(640px, calc(100% - 24px));
  text-align: center;
}
#hint::before { content: '💡 '; }

#toast {
  position: absolute;
  left: 50%;
  top: 34%;
  transform: translate(-50%, -10px) scale(0.9);
  opacity: 0;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 9px 18px;
  font-size: 19px;
  font-weight: 600;
  transition: opacity 0.2s, transform 0.25s cubic-bezier(0.2, 1.4, 0.4, 1);
  pointer-events: none;
  text-align: center;
  max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
#toast.bad { background: #ffe1da; }
#toast.good { background: #e3f7e6; }

/* ------------------------------------------------------------ 3D-Overlays */
.bubble, .sbar, .float { position: absolute; left: 0; top: 0; will-change: transform; }
.bubble { pointer-events: none; }
.bubble > * { transform: translate(-50%, -100%); }
.bubble .b-in {
  position: relative;
  width: 58px;
  height: 52px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 16px;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 0 var(--ink);
  transform: translate(-50%, calc(-100% - 12px));
}
.bubble .b-in::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -11px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-right: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  transform: translateX(-50%) rotate(45deg);
}
.bubble .b-in img { width: 48px; height: 48px; position: relative; z-index: 1; }
.bubble .pbar { position: absolute; left: 0; top: 0; width: 50px; transform: translate(-50%, -6px); }
.bubble.eat .pbar, .bubble.angry .pbar { display: none; }
.bubble .excl { font-size: 34px; font-weight: 700; color: var(--orange); line-height: 1; animation: bounce 0.8s infinite; }
.bubble .heart { font-size: 30px; color: #ef476f; animation: bounce 0.6s infinite; }
.bubble .grr { font-size: 28px; color: var(--red); font-weight: 700; }
.bubble.angry .b-in { background: #ffe1da; }
.bubble.angry .b-in::after { background: #ffe1da; }
.bubble.order .b-in { background: #fff6cf; }
.bubble.order .b-in::after { background: #fff6cf; }
.bubble.urgent .b-in { animation: shake 0.45s infinite; }
.bubble .tn {
  position: absolute;
  right: -10px;
  top: -10px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

.sbar > * { transform: translate(-50%, -100%); }
.sbar { display: flex; flex-direction: column; align-items: center; }
.sbar .pbar { width: 54px; height: 11px; background: rgba(255, 255, 255, 0.9); }
.sbar .pbar i { background: var(--blue); transition: width 0.1s linear; }
.sbar.cook .pbar i { background: var(--orange); }
.sbar.chop .pbar i { background: var(--green); }
.sbar.pour .pbar i { background: #8b4a2b; }
.sbar.done .pbar i { background: var(--green); }
.sbar.burn .pbar i { background: var(--red); }
.sbar.burn { animation: blink 0.35s infinite; }
.sbar.burnt .pbar { background: #444; }
.sbar span:empty { display: none; }
.sbar span {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, calc(-100% - 14px));
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: var(--green);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: grid;
  place-items: center;
}
.sbar.burn span { background: var(--red); }
.sbar.burnt span { background: #333; }
@keyframes blink { 50% { opacity: 0.45; } }

.float {
  font-weight: 700;
  font-size: 22px;
  color: #fff;
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
  white-space: nowrap;
}
.float.money { color: #7dff8a; font-size: 24px; }
.float.bad { color: #ff7b66; }
.float.info { color: #ffe08a; font-size: 18px; }

/* ------------------------------------------------------------ Touch */
#touch { position: absolute; inset: 0; pointer-events: none; display: none; }
body.touch #touch:not([hidden]) { display: block; }
#joy {
  position: absolute;
  left: max(22px, env(safe-area-inset-left));
  bottom: max(26px, env(safe-area-inset-bottom));
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: rgba(255, 250, 242, 0.22);
  border: 3px solid rgba(255, 250, 242, 0.6);
  pointer-events: auto;
  touch-action: none;
}
#knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
}
#act {
  position: absolute;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(34px, env(safe-area-inset-bottom));
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 4px solid var(--ink);
  background: var(--yellow);
  box-shadow: 0 5px 0 var(--ink);
  pointer-events: auto;
  touch-action: none;
  color: var(--ink);
  display: grid;
  place-items: center;
}
#act svg { width: 44px; height: 44px; }
#act.down { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); background: #ffb627; }
body.touch #prompt { bottom: 150px; }
body.touch #hint { bottom: 205px; }
body.touch .controls { display: none; }

/* ------------------------------------------------------------ Laden */
#loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  justify-content: center;
  background: #1c1310;
  color: #fff1dc;
  font-size: 18px;
  transition: opacity 0.5s;
  z-index: 10;
}
#loading.done { opacity: 0; pointer-events: none; }
#loading.error { gap: 8px; padding: 24px; text-align: center; }
#loading.error b { font-size: 32px; color: var(--orange); }
.spinner { width: 46px; height: 46px; border: 5px solid rgba(255, 241, 220, 0.2); border-top-color: var(--orange); border-radius: 50%; animation: spin 0.8s linear infinite; }
#loading.error .spinner { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ Responsive */
@media (max-width: 820px) {
  .hud-top { flex-wrap: wrap; gap: 6px; left: 8px; right: 8px; }
  .day-card { width: auto; flex: 1; padding: 5px 10px 7px; }
  .money-card { width: auto; flex: 1; padding: 5px 10px 7px; margin-left: 0; }
  #tickets { order: 3; flex-basis: 100%; gap: 5px; }
  .ticket { width: 100px; padding: 3px 5px 5px; }
  .t-dish { width: 34px; height: 34px; }
  .t-table { font-size: 18px; }
  .t-name { font-size: 12px; }
  .t-ings img { width: 16px; height: 16px; }
  .day-row b, .money-row b { font-size: 17px; }
  .hud-btns { top: auto; bottom: auto; top: calc(max(10px, env(safe-area-inset-top)) + 64px); right: 8px; flex-direction: column; }
  .icon-btn { width: 38px; height: 38px; }
  .panel { padding: 20px 16px; border-radius: 20px; }
  .panel h1 { font-size: 32px; }
  .shop, .book-list, .staff { grid-template-columns: 1fr; }
  #scr-title { justify-content: center; padding-left: 16px; background: radial-gradient(ellipse at center, rgba(28, 19, 16, 0.25), rgba(28, 19, 16, 0.75)); }
  .logo .l2 { font-size: 66px; }
  .bubble .b-in { width: 46px; height: 42px; }
  .bubble .b-in img { width: 38px; height: 38px; }
  #prompt { font-size: 15px; }
  #hint { font-size: 13.5px; }
}
@media (max-height: 520px) {
  .panel { padding: 14px 18px; }
  .panel h1 { font-size: 28px; margin-bottom: 6px; }
  .logo .l2 { font-size: 54px; }
  .controls, .best { display: none; }

  /* Kompaktes HUD für Handys im Querformat */
  .hud-top { top: 6px; left: 8px; right: 8px; flex-wrap: nowrap; gap: 6px; }
  .card { border-width: 2px; border-radius: 12px; box-shadow: 0 2px 0 var(--ink); padding: 3px 8px 5px; }
  .day-card { width: 120px; flex: none; }
  .money-card { width: 150px; flex: none; margin-left: 0; }
  .day-row b, .money-row b { font-size: 15px; }
  .day-row span, .money-row .goal { font-size: 12px; }
  .money-row.small { font-size: 12px; margin-top: 1px; }
  .money-row.small b { font-size: 12px; }
  .bar { height: 7px; margin-top: 2px; border-width: 1.5px; }
  #tickets { order: 0; flex-basis: auto; flex-wrap: nowrap; gap: 4px; overflow: hidden; }
  .ticket { width: 84px; border-width: 2px; padding: 2px 4px 4px; box-shadow: 0 2px 0 var(--ink); }
  .t-dish { width: 26px; height: 26px; }
  .t-table { font-size: 15px; }
  .t-table small { font-size: 8.5px; }
  .t-name { font-size: 11px; }
  .t-ings img { width: 13px; height: 13px; }
  .pbar { height: 6px; border-width: 1.5px; }
  .hud-btns { top: 64px; right: 8px; flex-direction: column; gap: 5px; }
  .icon-btn { width: 32px; height: 32px; border-width: 2px; box-shadow: 0 2px 0 var(--ink); }
  .icon-btn svg { width: 17px; height: 17px; }
  #prompt { font-size: 13.5px; padding: 4px 12px 4px 5px; bottom: 10px; border-width: 2px; }
  #hint { font-size: 12.5px; bottom: 48px; padding: 5px 12px; }
  body.touch #prompt { bottom: 10px; }
  body.touch #hint { bottom: 48px; max-width: calc(100% - 300px); }
  #joy { width: 104px; height: 104px; left: 16px; bottom: 16px; }
  #knob { width: 46px; height: 46px; margin: -23px 0 0 -23px; }
  #act { width: 76px; height: 76px; right: 18px; bottom: 20px; }
  #act svg { width: 34px; height: 34px; }
  #toast { font-size: 15px; padding: 6px 14px; }
  .bubble .b-in { width: 40px; height: 36px; border-width: 2px; border-radius: 12px; }
  .bubble .b-in img { width: 32px; height: 32px; }
  .bubble .pbar { width: 38px; }
  .bubble .excl { font-size: 24px; }
  .bubble .heart { font-size: 22px; }
  .sbar .pbar { width: 40px; height: 9px; }
  .float { font-size: 17px; }
  .float.money { font-size: 18px; }
}

.rotate-tip { display: none; font-size: 14px; background: #fff4d6; border-radius: 12px; padding: 8px 12px; color: var(--ink-2); }
@media (orientation: portrait) and (pointer: coarse) {
  .rotate-tip { display: block; }
}
