/* Layout: one full-bleed scene; a few quiet plates float at the edges like film subtitles. */
:root {
  color-scheme: dark;
  --night: #15132b;          /* page ground, the colour of the street after dark */
  --plate: rgba(24, 21, 52, 0.5);
  --plate-strong: rgba(24, 21, 52, 0.8);
  --line: rgba(255, 222, 186, 0.2);
  --ink: #fdf1df;            /* warm paper white */
  --ink-dim: rgba(253, 241, 223, 0.68);
  --lamp: #ffb86b;           /* shop-light orange */
  --lamp-ink: #2a1c2f;
  --teal: #7fd6c8;           /* stripe on the shop sign */
  --rose: #f39ab4;           /* the belt of pink in the sky */
  --shadow: rgba(8, 6, 24, 0.5);
  --font-jp: 'Zen Maru Gothic', 'Yu Gothic', 'Hiragino Maru Gothic ProN', 'Microsoft YaHei', sans-serif;
  --font-ui: 'PingFang SC', 'Microsoft YaHei UI', 'Microsoft YaHei', 'Noto Sans SC', 'Zen Maru Gothic', sans-serif;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --pad-t: calc(14px + env(safe-area-inset-top, 0px));
  --pad-b: calc(14px + env(safe-area-inset-bottom, 0px));
}

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
p, h1 { margin: 0; }
[hidden] { display: none !important; }

#app { position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--night); user-select: none; -webkit-user-select: none; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; cursor: grab; }
#view.dragging { cursor: grabbing; }
#view.hot { cursor: pointer; }

/* ---------- HUD ---------- */
.hud {
  position: absolute; inset: 0; pointer-events: none;
  padding-block: var(--pad-t) var(--pad-b);
  padding-left: var(--gutter-l); padding-right: var(--gutter-r);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "plate pocket" "toasts toasts" "time dock";
  gap: 12px;
  transition: opacity 0.6s ease;
}
.hud > * { pointer-events: auto; }
.cinema .hud, .cinema .tip { opacity: 0; pointer-events: none; }
.cinema .hud > * { pointer-events: none; }

.plate { grid-area: plate; align-self: start; justify-self: start; min-width: 0; padding-left: 12px; border-left: 2px solid var(--lamp); text-shadow: 0 1px 10px var(--shadow), 0 0 2px var(--shadow); pointer-events: none; }
.plate-jp { font-family: var(--font-jp); font-weight: 900; font-size: clamp(18px, 2.4vw, 24px); letter-spacing: 0.16em; line-height: 1.25; }
.plate-sub { display: flex; align-items: center; gap: 8px; margin-top: 2px; font-size: 12px; letter-spacing: 0.2em; color: var(--ink-dim); }
.plate-sub #clock { font-family: var(--font-jp); font-weight: 700; font-size: 14px; letter-spacing: 0.08em; color: var(--ink); font-variant-numeric: tabular-nums; }
.dot { width: 4px; height: 4px; border-radius: 50%; background: var(--rose); }

.pocket {
  grid-area: pocket; align-self: start; justify-self: end; display: grid; gap: 4px;
  padding: 8px 12px; border-radius: 12px; background: var(--plate); border: 1px solid var(--line);
  backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2);
}
.pocket-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 20px; }
.pocket-k { font-size: 11px; letter-spacing: 0.24em; color: var(--ink-dim); }
.pocket b { font-family: var(--font-jp); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--lamp); }
.pocket b.bump { animation: bump 0.5s ease; }
.cans { display: flex; gap: 4px; }
.can { width: 9px; height: 15px; border-radius: 3px; background: rgba(253, 241, 223, 0.14); border: 1px solid var(--line); transition: background 0.4s ease, box-shadow 0.4s ease; }
.can.got { background: var(--c); border-color: transparent; box-shadow: 0 0 8px var(--c); }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.22); } 100% { transform: scale(1); } }

.toasts { grid-area: toasts; align-self: start; justify-self: center; display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 4px; pointer-events: none; min-width: 0; max-width: 100%; }
.toast {
  max-width: min(100%, 30em); padding: 8px 16px; border-radius: 999px; background: var(--plate-strong); border: 1px solid var(--line);
  font-size: 14px; letter-spacing: 0.06em; text-align: center; box-shadow: 0 6px 24px var(--shadow);
  animation: toast-in 0.45s ease both;
}
.toast b { color: var(--lamp); font-weight: 700; }
.toast.out { animation: toast-out 0.6s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { from { opacity: 1; } to { opacity: 0; transform: translateY(-8px); } }

.hint {
  position: absolute; left: 50%; bottom: calc(var(--pad-b) + 62px); transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 6px 14px; border-radius: 999px; background: var(--plate);
  font-size: 12px; letter-spacing: 0.16em; color: var(--ink-dim); text-align: center; text-wrap: balance; pointer-events: none;
  transition: opacity 1.2s ease;
}
.hint.gone { opacity: 0; }

.timebar {
  grid-area: time; align-self: end; justify-self: start; display: flex; align-items: center; gap: 10px;
  padding: 0 14px; height: 44px; border-radius: 999px; background: var(--plate); border: 1px solid var(--line);
  backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2);
  font-size: 12px; letter-spacing: 0.18em; color: var(--ink-dim); min-width: 0;
}
.timebar input { -webkit-appearance: none; appearance: none; width: clamp(110px, 20vw, 220px); height: 22px; background: transparent; cursor: pointer; margin: 0; }
.timebar input::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, #ffb86b 0%, #f39ab4 30%, #7a6ad0 58%, #232a6e 82%, #0d1233 100%); }
.timebar input::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, #ffb86b 0%, #f39ab4 30%, #7a6ad0 58%, #232a6e 82%, #0d1233 100%); }
.timebar input::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; background: var(--ink); border: 0; box-shadow: 0 0 0 3px rgba(255, 184, 107, 0.35), 0 2px 8px var(--shadow); }
.timebar input::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--ink); border: 0; box-shadow: 0 0 0 3px rgba(255, 184, 107, 0.35), 0 2px 8px var(--shadow); }
.timebar input:focus-visible { outline: 2px solid var(--lamp); outline-offset: 4px; border-radius: 8px; }

.dock { grid-area: dock; align-self: end; justify-self: end; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.dock-btn {
  position: relative; width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--plate); color: var(--ink);
  display: grid; place-items: center; cursor: pointer; font: inherit;
  backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2);
  transition: background 0.25s ease, color 0.25s ease, transform 0.15s ease, border-color 0.25s ease;
}
.dock-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dock-btn:hover { background: var(--plate-strong); border-color: rgba(255, 184, 107, 0.6); color: var(--lamp); }
.dock-btn:active { transform: scale(0.94); }
.dock-btn:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
.dock-btn[aria-pressed="false"] { color: var(--ink-dim); }
.dock-btn[aria-pressed="false"]::after { content: ""; position: absolute; width: 26px; height: 1.7px; background: currentColor; transform: rotate(-45deg); border-radius: 1px; }
.dock-btn.busy { color: var(--rose); border-color: var(--rose); }
.dock-btn::before {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); right: 0; padding: 4px 10px; border-radius: 8px; white-space: nowrap;
  background: var(--plate-strong); border: 1px solid var(--line); color: var(--ink); font-size: 12px; letter-spacing: 0.1em;
  opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease;
}
.dock-btn:hover::before, .dock-btn:focus-visible::before { opacity: 1; transform: none; }

.tip {
  position: absolute; left: 0; top: 0; z-index: 5; padding: 5px 12px; border-radius: 999px; background: var(--plate-strong); border: 1px solid rgba(255, 184, 107, 0.5);
  color: var(--ink); font-size: 12px; letter-spacing: 0.1em; white-space: nowrap; pointer-events: none; box-shadow: 0 4px 18px var(--shadow);
  transition: opacity 0.4s ease;
}

/* ---------- first-person work UI ---------- */
.simbar { grid-area: pocket; }
.todo { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 5px; max-width: min(21em, 60vw); pointer-events: none; }
.todo li { padding: 4px 10px; border-radius: 8px; background: var(--plate-strong); border-left: 3px solid var(--lamp); font-size: 12px; letter-spacing: 0.06em; text-shadow: none; }
.todo li.bad { border-left-color: var(--rose); }
.todo li.ok { border-left-color: var(--teal); }
.cross { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--ink); opacity: 0.55; box-shadow: 0 0 0 1px var(--shadow); pointer-events: none; transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease; }
.cross.on { transform: scale(2.2); opacity: 0.95; background: var(--lamp); }
.work { position: absolute; left: 50%; top: calc(50% + 34px); transform: translateX(-50%); display: grid; justify-items: center; gap: 6px; pointer-events: none; max-width: calc(100% - 32px); }
.prompt { padding: 5px 14px; border-radius: 999px; background: var(--plate-strong); border: 1px solid rgba(255, 184, 107, 0.5); font-size: 13px; letter-spacing: 0.08em; text-align: center; box-shadow: 0 4px 18px var(--shadow); }
.prog { width: 150px; height: 6px; border-radius: 3px; background: var(--plate-strong); border: 1px solid var(--line); overflow: hidden; }
.prog i { display: block; height: 100%; width: 0; background: var(--lamp); }
.cinema .cross, .cinema .work { opacity: 0; }
.stick { grid-area: time; align-self: end; justify-self: start; width: 104px; height: 104px; border-radius: 50%; background: var(--plate); border: 1px solid var(--line); display: grid; place-items: center; touch-action: none; }
.stick span { width: 44px; height: 44px; border-radius: 50%; background: var(--lamp); opacity: 0.85; box-shadow: 0 4px 14px var(--shadow); }
.fp #view { cursor: crosshair; }
.tacts { position: absolute; right: var(--gutter-r); bottom: calc(var(--pad-b) + 128px); display: flex; align-items: center; gap: 10px; pointer-events: none; }
.tact { pointer-events: auto; width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--line); background: var(--plate-strong); color: var(--ink); font: inherit; font-weight: 700; font-size: 15px; letter-spacing: 0.06em; touch-action: none; }
.tact.go { width: 76px; height: 76px; background: var(--lamp); color: var(--lamp-ink); border-color: transparent; font-family: var(--font-jp); font-size: 24px; }
.tact:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
.scanning .tacts { display: none; }
/* the clerk restocks by walking to the shelf (or by hiring a stocker), not from the ledger */
#simpanel [data-act="restock"], #simpanel [data-act="restock-all"] { display: none !important; }

/* ---------- scanning at the till ---------- */
.scan { position: absolute; inset: 0; z-index: 4; pointer-events: none; padding-block: var(--pad-t) var(--pad-b); padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.scan-frame { position: absolute; left: 50%; top: 46%; width: min(300px, 62vw); height: min(210px, 34vh); transform: translate(-50%, -50%); border-radius: 18px; border: 2px solid rgba(253, 241, 223, 0.28); transition: border-color 0.2s ease; }
.scan-frame i { position: absolute; left: 8%; right: 8%; top: 50%; height: 2px; background: #ff4a3a; box-shadow: 0 0 12px 2px rgba(255, 74, 58, 0.75); opacity: 0.75; }
.scan-frame.near { border-color: var(--lamp); }
.scan-frame.near i { opacity: 1; }
.scan-frame.ok { animation: scan-ok 0.45s ease; }
.scan-frame b { position: absolute; left: 0; bottom: -12px; height: 5px; width: 0; border-radius: 3px; background: var(--lamp); }
@keyframes scan-ok { 0% { border-color: var(--teal); box-shadow: 0 0 0 0 rgba(127, 214, 200, 0.7), inset 0 0 40px rgba(127, 214, 200, 0.45); } 100% { border-color: rgba(253, 241, 223, 0.28); box-shadow: 0 0 0 26px rgba(127, 214, 200, 0), inset 0 0 0 rgba(127, 214, 200, 0); } }
.scan-card { position: absolute; left: var(--gutter-l); top: calc(var(--pad-t) + 70px); width: min(250px, 46vw); padding: 12px 14px; border-radius: 14px; background: var(--plate-strong); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.scan-title { font-family: var(--font-jp); font-weight: 900; letter-spacing: 0.12em; color: var(--lamp); }
.scan-title span { font-family: var(--font-ui); font-weight: 400; font-size: 12px; letter-spacing: 0.08em; color: var(--ink-dim); margin-left: 6px; }
.scan-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 3px; min-height: 1.6em; font-size: 13px; }
.scan-list li { display: flex; justify-content: space-between; gap: 10px; }
.scan-list b, .scan-total b { font-variant-numeric: tabular-nums; font-weight: 700; }
.scan-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 8px; border-top: 1px solid var(--line); letter-spacing: 0.2em; }
.scan-total b { font-family: var(--font-jp); font-size: 20px; color: var(--lamp); letter-spacing: 0.02em; }
.scan-combo { min-height: 1.5em; margin-top: 4px; font-family: var(--font-jp); font-weight: 900; letter-spacing: 0.1em; color: var(--teal); }
.scan-combo.hot { color: var(--rose); }
.scan-hint { position: absolute; left: 50%; bottom: calc(var(--pad-b) + 122px); transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); padding: 6px 14px; border-radius: 999px; background: var(--plate-strong); font-size: 12px; letter-spacing: 0.1em; text-align: center; text-wrap: balance; }
.scan-actions { position: absolute; left: 50%; bottom: calc(var(--pad-b) + 66px); transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: max-content; max-width: calc(100% - 32px); pointer-events: auto; }
.scan-actions button { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--plate-strong); color: var(--ink); font: inherit; font-size: 13px; letter-spacing: 0.08em; cursor: pointer; }
.scan-actions button:hover { border-color: var(--lamp); color: var(--lamp); }
.scan-actions button:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
.scan-actions button.go { background: var(--lamp); color: var(--lamp-ink); border-color: transparent; font-weight: 700; }
.scanning .cross, .scanning .work, .scanning .hint, .scanning .dock, .scanning .todo { display: none; }
.scan-list li.pos span { color: var(--teal); }
.scan-hint b { color: var(--lamp); }
@media (max-width: 640px) { .scan-card { top: calc(var(--pad-t) + 118px); } .scan-hint { bottom: calc(var(--pad-b) + 150px); } }
@media (prefers-reduced-motion: reduce) { .scan-frame.ok { animation: none; } }

/* ---------- talking with a regular (src/talk.js): a paper dialogue box, their colour on the name ---------- */
.talk {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; justify-content: center; pointer-events: none;
  padding: 0 var(--gutter-r) calc(var(--pad-b) + 10px) var(--gutter-l);
  opacity: 0; transform: translateY(16px); transition: opacity 0.22s ease, transform 0.26s cubic-bezier(0.2, 0.85, 0.25, 1.04);
}
.talk[hidden] { display: none; }
.talk.on { opacity: 1; transform: none; }
.talk-box {
  --c: #2a9d94;
  position: relative; width: min(760px, 100%); padding: 16px 22px 12px 100px; border-radius: 22px; pointer-events: auto; cursor: pointer;
  background: rgba(255, 250, 240, 0.97); color: #2a2433; font-family: var(--font-ui);
  box-shadow: 0 14px 40px rgba(8, 6, 24, 0.5), inset 0 0 0 1px rgba(42, 36, 51, 0.08), inset 0 3px 0 color-mix(in srgb, var(--c) 55%, transparent);
  -webkit-tap-highlight-color: transparent;
}
.talk-face {
  position: absolute; left: 20px; top: 18px; display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%;
  background: var(--c); color: #fff; font-family: var(--font-jp); font-weight: 900; font-size: 26px;
  box-shadow: 0 0 0 3px #fffaf0, 0 0 0 5px color-mix(in srgb, var(--c) 45%, #fffaf0), inset 0 -4px 0 rgba(0, 0, 0, 0.12);
}
.talk-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 4px; }
.talk-name b { font-family: var(--font-jp); font-weight: 900; font-size: 17px; letter-spacing: 0.04em; color: color-mix(in srgb, var(--c) 82%, #2a2433); }
.talk-name small { color: #6e6678; font-size: 12.5px; }
.talk-hearts { color: #e5486d; font-size: 14px; letter-spacing: 1px; }
.talk-hearts i { color: #e9c6cf; font-style: normal; }
.talk-text { min-height: 3.4em; margin: 0; font-size: 17px; line-height: 1.72; letter-spacing: 0.02em; text-wrap: pretty; }
.talk-text.narr { color: #7a6f66; font-style: italic; }
.talk-text.me { color: #23877f; }
.talk-text.me::before { content: '你'; display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 999px; background: #dcefeb; color: #23877f; font-size: 12px; font-weight: 800; font-style: normal; vertical-align: 2px; }
.talk-choices { display: grid; gap: 8px; margin: 12px 0 2px; }
.talk-choices[hidden] { display: none; }
.talk-choice {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; border: 1.5px solid rgba(42, 36, 51, 0.14); border-radius: 14px;
  background: #fff; color: #2a2433; font: inherit; font-size: 15.5px; line-height: 1.45; text-align: left; cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}
.talk-choice:hover, .talk-choice:focus-visible { outline: none; border-color: var(--c); background: color-mix(in srgb, var(--c) 9%, #fff); transform: translateX(3px); }
.talk-choice kbd { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--c); color: #fff; font: 800 13px var(--font-ui); }
.talk-hint { min-height: 1.3em; margin: 4px 0 0; text-align: right; color: #9a90a4; font-size: 12.5px; animation: talk-blink 1.4s ease-in-out infinite; }
.talk-box.story::after {
  content: '♥ 新的故事'; position: absolute; right: 20px; top: -11px; padding: 3px 11px; border-radius: 999px;
  background: #e5486d; color: #fff; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; box-shadow: 0 4px 12px rgba(229, 72, 109, 0.35);
}
@keyframes talk-blink { 50% { opacity: 0.45; } }
@media (max-width: 560px) {
  .talk-box { padding: 14px 14px 10px; }
  .talk-face { position: static; float: left; width: 44px; height: 44px; margin: 0 10px 2px 0; font-size: 19px; }
  .talk-text { font-size: 15.5px; }
  .talk-choice { font-size: 14.5px; }
}
@media (prefers-reduced-motion: reduce) { .talk { transition: none; } .talk-hint { animation: none; } }

/* ---------- shop level on the name plate ---------- */
.plate-lv { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 11px; letter-spacing: 0.06em; color: var(--ink-dim); }
.plate-lv b { font-family: var(--font-jp); font-weight: 900; font-size: 13px; letter-spacing: 0.04em; color: var(--lamp); }
.plate-lv em { font-style: normal; font-variant-numeric: tabular-nums; }
.lv-bar { position: relative; width: 88px; height: 5px; border-radius: 3px; background: rgba(253, 241, 223, 0.18); overflow: hidden; }
.lv-bar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--teal), var(--lamp)); transition: width 0.5s ease; }
.plate-lv.up b { display: inline-block; animation: lv-up 1.4s ease; }
.plate-date { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 4px 0 0; font-size: 11.5px; letter-spacing: 0.04em; color: var(--ink-dim); }
.plate-date b { padding: 1px 8px; border-radius: 999px; background: rgba(255, 140, 110, 0.85); color: #2a1410; font-weight: 800; letter-spacing: 0.02em; }
.toast .hearts { color: #ff8fa8; letter-spacing: 1px; }
.tact.eat { background: rgba(255, 184, 107, 0.92); color: #2a1d10; font-weight: 800; font-size: 13px; }
.plate-buff { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.plate-buff[hidden] { display: none; }
.plate-buff span { padding: 2px 8px; border-radius: 999px; font-size: 11px; letter-spacing: 0.05em; color: #2a1d10; background: linear-gradient(90deg, #ffd9a0, #ffc27a); box-shadow: 0 0 10px rgba(255, 190, 110, 0.35); }
.plate-buff em { font-style: normal; font-variant-numeric: tabular-nums; opacity: 0.75; margin-left: 2px; }
@keyframes lv-up { 0% { transform: scale(1); } 25% { transform: scale(1.6); color: #fff; } 100% { transform: scale(1); } }

/* ---------- working a station (microwave, oden, coffee, fryer, tongs) ---------- */
.station { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.st-card {
  position: absolute; left: 50%; bottom: calc(var(--pad-b) + 8px); transform: translateX(-50%);
  width: min(600px, calc(100% - 32px)); max-height: 54%; overflow: auto; padding: 14px 16px 16px; border-radius: 18px;
  background: var(--plate-strong); border: 1px solid var(--line); box-shadow: 0 12px 40px var(--shadow);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); pointer-events: auto;
}
.st-card header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.st-title { font-family: var(--font-jp); font-weight: 900; font-size: 16px; letter-spacing: 0.1em; color: var(--lamp); }
.st-x { flex: none; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink-dim); font: inherit; font-size: 12px; cursor: pointer; }
.st-x:hover { color: var(--ink); border-color: var(--ink-dim); }
.st-sub { margin-top: 4px; font-size: 13px; letter-spacing: 0.05em; color: var(--ink-dim); }
.st-sub b { color: var(--ink); }
.st-body { display: grid; gap: 10px; margin-top: 12px; }
.st-body:empty { display: none; }
.st-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.st-actions:empty { display: none; }
.st-btn {
  position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(253, 241, 223, 0.06); color: var(--ink); font: inherit; font-size: 13px; letter-spacing: 0.05em; cursor: pointer;
}
.st-btn:hover { border-color: var(--lamp); color: var(--lamp); }
.st-btn:active { transform: scale(0.97); }
.st-btn:focus-visible, .st-x:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
.st-btn.go { background: var(--lamp); color: var(--lamp-ink); border-color: transparent; font-weight: 700; }
.st-btn.go:hover { color: var(--lamp-ink); box-shadow: 0 0 0 4px rgba(255, 184, 107, 0.22); }
.st-btn.menu { border-color: rgba(176, 122, 74, 0.6); }
.st-btn kbd { font: 600 10px/1.4 var(--font-ui); padding: 0 5px; border-radius: 4px; background: rgba(0, 0, 0, 0.28); color: inherit; opacity: 0.75; }
.st-btn em { margin-left: auto; font-style: normal; font-weight: 700; color: var(--lamp); }
.st-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.st-grid .st-btn { justify-content: flex-start; padding: 0 10px; }
.st-row { display: flex; flex-wrap: wrap; gap: 8px; }
.st-label { font-size: 11px; letter-spacing: 0.2em; color: var(--ink-dim); margin-bottom: -4px; }
.st-cup { font-size: 13px; letter-spacing: 0.05em; min-height: 1.4em; }
.st-display { justify-self: start; padding: 8px 18px; border-radius: 10px; background: #0c120e; color: #7fffb0; font: 700 34px/1 ui-monospace, Consolas, monospace; letter-spacing: 0.06em; text-shadow: 0 0 12px rgba(127, 255, 176, 0.55); }
.st-bar { height: 8px; border-radius: 4px; background: rgba(253, 241, 223, 0.12); overflow: hidden; }
.st-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--lamp); }
.st-bar.brown i { background: #b07a4a; }
.st-bar.steam i { background: var(--teal); }
.st-meter { position: relative; display: flex; height: 22px; border-radius: 11px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.st-meter .z1 { width: 35.7%; background: #e9dcc2; }
.st-meter .z2 { width: 17.9%; background: #e8b862; }
.st-meter .z3 { width: 22.3%; background: linear-gradient(180deg, #ffcf6a, #d8902a); }
.st-meter .z4 { width: 24.1%; background: linear-gradient(90deg, #8a5a2a, #2a1a10); }
.st-meter i { position: absolute; top: -2px; bottom: -2px; left: 0; width: 4px; margin-left: -2px; border-radius: 2px; background: #fff; box-shadow: 0 0 8px rgba(255, 255, 255, 0.9); }
.st-scale { display: grid; grid-template-columns: 53.6% 22.3% 1fr; font-size: 11px; color: var(--ink-dim); margin-top: -6px; }
.st-scale span:nth-child(2) { color: var(--lamp); text-align: center; }
.st-scale span:nth-child(3) { text-align: right; }
/* tongs over a tray */
.st-tray { position: relative; display: flex; gap: 6px; padding: 30px 6px 8px; border-radius: 12px; background: rgba(0, 0, 0, 0.28); }
.st-tray .slot { flex: 1 1 0; min-width: 0; display: grid; justify-items: center; gap: 6px; padding: 10px 2px; border-radius: 10px; border: 1px dashed var(--line); font-size: 12px; text-align: center; overflow-wrap: anywhere; }
.st-tray .slot.hit { animation: st-hit 0.45s ease; }
.st-tray .slot.miss { animation: st-miss 0.45s ease; }
.st-tray .tongs { position: absolute; top: 4px; width: 22px; height: 26px; transform: translateX(-50%); pointer-events: none; }
.st-tray .tongs::before, .st-tray .tongs::after { content: ''; position: absolute; top: 0; width: 4px; height: 26px; border-radius: 2px; background: linear-gradient(180deg, #e4e7eb, #8d939c); }
.st-tray .tongs::before { left: 4px; transform: rotate(-9deg); transform-origin: top; }
.st-tray .tongs::after { right: 4px; transform: rotate(9deg); transform-origin: top; }
@keyframes st-hit { 0% { background: rgba(127, 214, 200, 0.5); transform: translateY(-4px); } 100% { background: transparent; transform: none; } }
@keyframes st-miss { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); background: rgba(255, 154, 148, 0.3); } 75% { transform: translateX(5px); } }
/* little drawn icons for food */
.st-ico { flex: none; display: inline-block; position: relative; width: 20px; height: 16px; border-radius: 50%; background: var(--c, #d89040); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12); }
.st-ico.oden-daikon { border-radius: 45% / 35%; }
.st-ico.oden-egg { width: 15px; height: 19px; }
.st-ico.oden-konnyaku { border-radius: 2px; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.st-ico.oden-chikuwa { width: 24px; height: 10px; border-radius: 5px; box-shadow: inset 4px 0 0 #8a5a2a, inset -4px 0 0 #8a5a2a; }
.st-ico.oden-atsuage { width: 16px; height: 16px; border-radius: 3px; }
.st-ico.oden-kombu { width: 18px; height: 10px; }
.st-ico.bun { width: 22px; height: 18px; border-radius: 50% 50% 44% 44%; background: radial-gradient(circle at 50% 30%, #fff, var(--c) 70%); }
.st-ico.bun.dot::after { content: ''; position: absolute; left: 50%; top: 30%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: #6b3a22; }
.st-ico.kara { width: 22px; height: 18px; border-radius: 42% 58% 52% 48% / 55% 45% 55% 45%; background: radial-gradient(circle at 40% 35%, #f2c070, var(--c) 70%); }
.st-ico.patty { width: 24px; height: 15px; border-radius: 6px; }
.st-ico.dog { width: 26px; height: 11px; border-radius: 6px; }
.st-ico.dog::after { content: ''; position: absolute; right: -6px; top: 4px; width: 8px; height: 3px; background: #d8c09a; border-radius: 1px; }
.st-ico.fries { width: 18px; height: 20px; border-radius: 2px 2px 6px 6px; background: repeating-linear-gradient(90deg, #f6d260 0 3px, #e8a830 3px 5px); }
.st-ico.can { width: 12px; height: 20px; border-radius: 3px; background: linear-gradient(90deg, rgba(255, 255, 255, 0.35), transparent 40%, rgba(0, 0, 0, 0.18)), linear-gradient(180deg, #d9dde4 0 2px, var(--c) 2px calc(100% - 2px), #b9bec6 calc(100% - 2px)); }
.st-btn small { font-size: 11px; opacity: 0.65; margin-left: 2px; }
.st-btn.out { opacity: 0.5; }
.st-btn.out em { color: #ff6a55; }
/* the open drinks machine: one row per column with how full it is */
.vend-cols { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; }
.vend-cols li { display: grid; grid-template-columns: 12px 1fr auto; grid-template-rows: auto 4px; align-items: center; column-gap: 7px; row-gap: 3px; font-size: 12px; }
.vend-cols i { grid-row: span 2; width: 10px; height: 18px; border-radius: 2px; background: var(--c); }
.vend-cols b { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--lamp); }
.vend-cols s { grid-column: 2 / 4; position: relative; height: 4px; border-radius: 2px; background: rgba(253, 241, 223, 0.15); overflow: hidden; text-decoration: none; }
.vend-cols u { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(90deg, var(--teal), var(--lamp)); transition: width 0.2s ease; }
.vend-cols li.out b { color: #ff6a55; }
.working .cross, .working .work, .working .hint, .working .tacts, .working .stick, .working .dock { display: none; }
/* the tablet in your hands: no crosshair or prompts behind it; in the camera the viewfinder has its own */
#app:has(#tablet.up) .cross, #app:has(#tablet.up) .work, #app:has(#tablet.up) .hint, #app:has(#tablet.up) .tacts { display: none; }

/* ---------- local test panel (only when the game runs on this computer) ---------- */
.dev-toggle {
  position: absolute; z-index: 6; left: var(--gutter-l); top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px;
  border: 1px dashed rgba(127, 214, 200, 0.7); background: var(--plate-strong); color: var(--teal);
  font: 700 12px/1 var(--font-ui); letter-spacing: 0.12em; cursor: pointer;
}
.dev-toggle:hover, .dev-toggle.on { background: var(--teal); color: var(--lamp-ink); border-style: solid; }
.dev-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.dev-panel {
  position: absolute; z-index: 6; left: calc(var(--gutter-l) + 84px); top: 50%; transform: translateY(-50%);
  width: min(420px, calc(100% - var(--gutter-l) - var(--gutter-r) - 84px)); max-height: 82%; overflow: auto; padding: 12px 14px;
  border-radius: 16px; background: var(--plate-strong); border: 1px solid rgba(127, 214, 200, 0.45); box-shadow: 0 12px 36px var(--shadow);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-size: 12px;
}
.dev-panel header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.dev-panel header b { font-family: var(--font-jp); font-size: 15px; letter-spacing: 0.12em; color: var(--teal); }
.dev-panel header span { flex: 1; min-width: 0; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.dev-x { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 16px; cursor: pointer; }
.dev-row { padding: 8px 0; border-top: 1px solid var(--line); }
.dev-row > p { margin-bottom: 6px; color: var(--ink-dim); letter-spacing: 0.06em; }
.dev-row > div { display: flex; flex-wrap: wrap; gap: 6px; }
.dev-row button {
  min-height: 32px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line); background: rgba(253, 241, 223, 0.06);
  color: var(--ink); font: inherit; font-size: 12px; cursor: pointer;
}
.dev-row button:hover { border-color: var(--teal); color: var(--teal); }
.dev-row button.on { background: var(--teal); border-color: var(--teal); color: var(--lamp-ink); font-weight: 700; }
.dev-row button.go { background: var(--lamp); border-color: transparent; color: var(--lamp-ink); font-weight: 700; }
.dev-row button.warn { border-color: rgba(255, 154, 148, 0.6); color: #ff9a94; }
.dev-row button:focus-visible, .dev-x:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.dev-note { margin-top: 6px; color: var(--ink-dim); font-size: 11px; }
.scanning .dev-toggle, .scanning .dev-panel, .cinema .dev-toggle, .cinema .dev-panel, .working .dev-toggle { display: none; }
@media (max-width: 640px) { .dev-toggle { top: auto; bottom: calc(var(--pad-b) + 190px); transform: none; } .dev-panel { left: var(--gutter-l); width: calc(100% - var(--gutter-l) - var(--gutter-r)); } }

/* ---------- the order ticket (a paper slip on the right) ---------- */
.ticket { position: absolute; right: var(--gutter-r); top: calc(var(--pad-t) + 96px); z-index: 3; display: grid; gap: 8px; width: min(250px, 46vw); pointer-events: none; }
.tk { padding: 10px 12px 10px; border-radius: 6px 6px 10px 10px; background: #fff8ea; color: #2a2226; box-shadow: 0 10px 26px var(--shadow); font-size: 12px; transform: rotate(-0.8deg); }
.tk + .tk { transform: rotate(0.6deg); }
.tk-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding-bottom: 5px; border-bottom: 1px dashed rgba(42, 34, 38, 0.3); font-family: var(--font-jp); letter-spacing: 0.08em; }
.tk-title span { font-size: 11px; color: rgba(42, 34, 38, 0.6); }
.tk ul { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 5px; }
.tk li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; align-items: baseline; }
.tk li b { font-weight: 700; }
.tk li span { grid-column: 1; font-size: 11px; color: rgba(42, 34, 38, 0.72); }
.tk li i { grid-column: 2; grid-row: 1; font-style: normal; font-size: 11px; padding: 0 7px; border-radius: 999px; background: rgba(42, 34, 38, 0.08); white-space: nowrap; }
.tk li.done b { text-decoration: line-through; opacity: 0.5; }
.tk li.done i { background: #2a9d94; color: #fff; }
.tk li.busy i { background: #f28a35; color: #fff; }
.tk-foot { font-size: 11px; color: rgba(42, 34, 38, 0.72); }
.tk-bar { height: 4px; margin-top: 6px; border-radius: 2px; background: rgba(42, 34, 38, 0.12); overflow: hidden; }
.tk-bar i { display: block; height: 100%; border-radius: inherit; background: #2a9d94; transition: width 0.5s linear; }
.tk-bar.low i { background: #d8402f; }
@media (max-width: 640px) {
  .st-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-card { max-height: 60%; padding: 12px; }
  .ticket { top: auto; bottom: calc(var(--pad-b) + 150px); width: min(220px, 60vw); }
  .working .ticket { display: none; }
}
@media (prefers-reduced-motion: reduce) { .st-tray .slot.hit, .st-tray .slot.miss, .plate-lv.up b { animation: none; } }

/* ---------- title card ---------- */
.boot {
  position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; text-align: center;
  padding-block: var(--pad-t) var(--pad-b); padding-left: var(--gutter-l); padding-right: var(--gutter-r);
  background: radial-gradient(120% 90% at 50% 100%, #3a2f6b 0%, var(--night) 62%);
  transition: opacity 1.4s ease, background 1.6s ease;
}
.boot.ready { background: linear-gradient(180deg, rgba(21, 19, 43, 0.28) 0%, rgba(21, 19, 43, 0.08) 38%, rgba(21, 19, 43, 0.62) 100%); }
.boot.gone { opacity: 0; pointer-events: none; }
.boot-card { display: grid; justify-items: center; gap: 10px; text-shadow: 0 2px 18px var(--shadow), 0 0 3px var(--shadow); }
.boot-kicker { font-size: 12px; letter-spacing: 0.42em; color: var(--ink-dim); padding-left: 0.42em; }
.boot-jp { font-family: var(--font-jp); font-weight: 900; font-size: clamp(34px, 8vw, 68px); letter-spacing: 0.14em; padding-left: 0.14em; line-height: 1.15; color: var(--lamp); text-wrap: balance; }
.boot-sub { font-size: clamp(14px, 2vw, 17px); letter-spacing: 0.28em; padding-left: 0.28em; color: var(--ink); }
.boot-msg { min-height: 1.5em; font-size: 12px; letter-spacing: 0.22em; color: var(--ink-dim); }
.boot-side {
  position: absolute; top: var(--pad-t); right: var(--gutter-r); writing-mode: vertical-rl; font-family: var(--font-jp); font-weight: 500;
  font-size: 13px; letter-spacing: 0.5em; color: var(--ink-dim); text-shadow: 0 1px 10px var(--shadow);
}
.enter {
  margin-top: 14px; padding: 12px 34px 12px 38px; border-radius: 999px; border: 0; background: var(--lamp); color: var(--lamp-ink);
  font-family: var(--font-ui); font-size: 16px; font-weight: 700; letter-spacing: 0.3em; cursor: pointer;
  box-shadow: 0 0 0 6px rgba(255, 184, 107, 0.16), 0 10px 34px rgba(255, 150, 70, 0.35);
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}
.enter:hover { transform: translateY(-1px); box-shadow: 0 0 0 9px rgba(255, 184, 107, 0.2), 0 14px 40px rgba(255, 150, 70, 0.45); }
.enter:active { transform: scale(0.97); }
.enter:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  .hud { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto auto; grid-template-areas: "plate" "pocket" "toasts" "time" "dock"; gap: 10px; }
  .pocket { justify-self: start; grid-auto-flow: column; gap: 14px; }
  .timebar { justify-self: stretch; }
  .timebar input { flex: 1; width: auto; min-width: 0; }
  .dock { justify-self: stretch; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); justify-items: center; gap: 3px; }
  .stick { justify-self: start; }
  .dock-btn { width: min(44px, 100%); height: auto; aspect-ratio: 1; }
  .hint { bottom: calc(var(--pad-b) + 112px); letter-spacing: 0.08em; }
  .dock-btn::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .toast, .toast.out, .pocket b.bump { animation: none; }
  .boot, .hud, .hint, .dock-btn { transition: none; }
}
