/* 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); }
.scan-frame { transition: border-color 0.2s ease, left 0.08s linear, top 0.08s linear; }
/* turning the item: a cross of four big buttons by the right thumb; the turn that finds the code glows */
.scan-turns { position: absolute; right: calc(var(--gutter-r) + 8px); top: 50%; transform: translateY(-50%); display: grid; grid-template: repeat(3, 54px) / repeat(3, 54px); gap: 4px; pointer-events: auto; }
.scan-turns[hidden] { display: none; }
.scan-turns button { border-radius: 16px; border: 1px solid var(--line); background: var(--plate-strong); color: var(--ink); font: 700 22px/1 var(--font-ui); cursor: pointer; touch-action: manipulation; }
.scan-turns button[data-k="w"] { grid-area: 1 / 2; } .scan-turns button[data-k="a"] { grid-area: 2 / 1; }
.scan-turns button[data-k="d"] { grid-area: 2 / 3; } .scan-turns button[data-k="s"] { grid-area: 3 / 2; }
.scan-turns button:hover { border-color: var(--lamp); color: var(--lamp); }
.scan-turns button.glow { border-color: var(--lamp); color: var(--lamp-ink); background: var(--lamp); animation: turn-hint 0.9s ease-in-out infinite; }
@keyframes turn-hint { 50% { transform: scale(1.1); box-shadow: 0 0 18px rgba(255, 184, 107, 0.7); } }
.scanning .stick { visibility: hidden; }
@media (max-height: 520px) {
  .scan-turns { grid-template: repeat(3, 48px) / repeat(3, 48px); }
  .scan-hint { bottom: calc(var(--pad-b) + 60px); } .scan-actions { bottom: var(--pad-b); }
  .scan-card { top: var(--pad-t); width: min(200px, 34vw); padding: 8px 10px; }
  .scan-list { margin: 4px 0; font-size: 12px; } .scan-total b { font-size: 16px; }
}
@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; } }

/* ---------- the rest of the job at the till (counter.js): what the customer says, and short "beats" ---------- */
.scan[data-phase="beat"] .scan-frame, .scan[data-phase="tobacco"] .scan-frame, .scan[data-phase="tobacco"] .scan-card { display: none; }
.scan-say { position: absolute; left: 50%; top: calc(var(--pad-t) + 64px); transform: translateX(-50%); width: max-content; max-width: min(560px, calc(100% - 40px)); padding: 8px 16px; border-radius: 16px 16px 16px 4px; background: rgba(253, 241, 223, 0.95); color: var(--lamp-ink); font-size: 15px; font-weight: 700; line-height: 1.45; letter-spacing: 0.03em; box-shadow: 0 6px 18px var(--shadow); text-wrap: balance; }
.scan-say.pop { animation: say-pop 0.22s ease; }
@keyframes say-pop { from { opacity: 0; transform: translateX(-50%) translateY(6px) scale(0.96); } }
.beat { position: absolute; left: 50%; bottom: calc(var(--pad-b) + 120px); transform: translateX(-50%); width: min(580px, calc(100% - 32px)); display: grid; gap: 8px; padding: 12px 14px; border-radius: 16px; background: var(--plate-strong); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); pointer-events: auto; }
.beat header { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.beat header b { font-family: var(--font-jp); font-weight: 900; font-size: 15px; letter-spacing: 0.1em; color: var(--lamp); }
.beat header span { font-size: 12px; letter-spacing: 0.04em; color: var(--ink-dim); }
.bt-line { font-size: 16px; font-weight: 700; letter-spacing: 0.03em; }
.bt-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.bt-opt { flex: 1 1 0; min-width: 92px; min-height: 46px; display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); color: var(--ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer; touch-action: manipulation; transition: border-color 0.15s ease, background 0.15s ease; }
.bt-opt:hover { border-color: var(--lamp); }
.bt-opt:focus-visible, .coin:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
.bt-opt kbd, .coin kbd { flex: none; display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 6px; background: rgba(255, 255, 255, 0.12); color: var(--ink-dim); font: 700 11px/1 var(--font-ui); }
.bt-opt span { display: grid; line-height: 1.25; }
.bt-opt small { font-size: 11px; color: var(--ink-dim); }
.bt-opt.ok { border-color: var(--teal); background: rgba(127, 214, 200, 0.22); }
.bt-opt.bad { border-color: var(--rose); background: rgba(243, 154, 180, 0.2); }
.bt-opt.go { background: var(--lamp); border-color: transparent; color: var(--lamp-ink); font-weight: 700; }
.bt-opt.go kbd { background: rgba(0, 0, 0, 0.14); color: var(--lamp-ink); }
.bt-opt.slim { flex: 0 0 auto; min-width: 0; }
.bt-opt[disabled] { opacity: 0.3; cursor: default; }
/* the age check, a parcel's size, the tobacco selection */
.bt-measure { font-size: 14px; letter-spacing: 0.04em; }
.bt-measure b, .bt-sel b { font-family: var(--font-jp); font-size: 20px; color: var(--lamp); font-variant-numeric: tabular-nums; }
.bt-pick { margin-left: auto; font-size: 13px; color: var(--ink-dim); }
.beat header .bt-pick b { font-family: var(--font-jp); font-size: 20px; letter-spacing: 0.02em; color: var(--lamp); }
.bt-tip { font-size: 12px; letter-spacing: 0.03em; color: var(--ink-dim); }
.bt-tip b { color: var(--lamp); }
/* counting out change */
.bt-pos { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13px; color: var(--ink-dim); }
.bt-pos b { font-family: var(--font-jp); font-size: 19px; color: var(--ink); font-variant-numeric: tabular-nums; }
.bt-pos .due b { color: var(--lamp); }
.tray { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 36px; padding: 4px 8px; border-radius: 10px; background: rgba(0, 0, 0, 0.26); }
.tray em { margin-left: auto; font-style: normal; font-size: 13px; color: var(--ink-dim); }
.tray em b { color: var(--lamp); }
.tray.shake { animation: tray-shake 0.35s ease; }
@keyframes tray-shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.coins { display: flex; flex-wrap: wrap; gap: 6px; align-items: stretch; }
.coins .bt-opt.go { flex: 1 1 80px; }
.coin { position: relative; width: 50px; height: 46px; display: grid; place-items: center; padding: 10px 0 0; border-radius: 50%; border: 2px solid rgba(0, 0, 0, 0.25); font: 800 13px/1 var(--font-ui); color: #2a2228; cursor: pointer; touch-action: manipulation; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18); }
.coin kbd { position: absolute; top: 3px; left: 50%; transform: translateX(-50%); height: 14px; min-width: 14px; font-size: 9px; background: rgba(0, 0, 0, 0.14); color: rgba(0, 0, 0, 0.6); }
.coin.note { width: 60px; border-radius: 6px; }
.coin:active { transform: translateY(1px); }
.c5000 { background: #d9c7e6; } .c1000 { background: #a9c9e8; } .c500 { background: #e6c45c; } .c100, .c50 { background: #d5d9de; }
.c10 { background: #c98a54; } .c5 { background: #e2c25a; } .c1 { background: #eef0f2; }
.coin-chip { display: inline-grid; place-items: center; min-width: 30px; height: 26px; padding: 0 6px; border-radius: 13px; font: 800 11px/1 var(--font-ui); font-style: normal; color: #2a2228; }
.coin-chip.c5000, .coin-chip.c1000 { border-radius: 4px; }
/* packing the bag */
.bt-bag { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: end; }
.bagv { display: flex; align-items: flex-end; gap: 6px; }
.bag-main, .bag-hot { display: flex; flex-direction: column-reverse; gap: 3px; padding: 6px 5px 5px; border: 2px solid rgba(253, 241, 223, 0.55); border-top-style: dashed; border-radius: 6px 6px 16px 16px; }
.bag-main { width: 88px; min-height: 104px; }
.bag-hot { width: 60px; min-height: 58px; border-color: rgba(255, 150, 100, 0.8); }
.bag-chip { display: block; padding: 2px 4px; border-radius: 5px; font-size: 11px; font-style: normal; line-height: 1.3; text-align: center; color: #1c1a22; background: #e6dcc8; animation: bag-in 0.22s ease; }
.bag-chip.w3 { background: #9fb4d8; } .bag-chip.w2 { background: #b9d3a8; } .bag-chip.w1 { background: #f2d7a0; } .bag-chip.hot { background: #ffb08a; }
.bag-chip.crushed { outline: 2px solid var(--rose); }
.bag-chip.squashed { transform: scaleY(0.7); background: #e9a7b6; }
@keyframes bag-in { from { transform: translateY(-14px); opacity: 0; } }
.bt-items .bt-opt { flex: 0 1 auto; min-width: 0; }
.bt-opt.w3 small { color: #9fc0ff; } .bt-opt.w2 small { color: #b9e0a0; } .bt-opt.w1 small { color: #ffd890; } .bt-opt.hot small { color: #ffb08a; }
/* a utility bill and its date stamp */
.slip { position: relative; display: grid; grid-template-columns: 1.3fr 1fr 1fr; height: 86px; border-radius: 6px; background: #f6f3e8; color: #2f4a44; overflow: hidden; cursor: pointer; touch-action: manipulation; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
.slip-p { display: grid; align-content: start; gap: 2px; padding: 6px 9px; border-left: 1px dashed rgba(40, 80, 70, 0.4); font-family: var(--font-jp); font-size: 12px; }
.slip-p:first-of-type { border-left: 0; }
.slip-p em { font-style: normal; font-size: 13px; font-weight: 900; }
.slip-box { position: absolute; top: 40px; height: 40px; border: 1.5px dashed rgba(200, 48, 42, 0.7); border-radius: 50%; }
.slip-cur { position: absolute; top: 4px; bottom: 4px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: #e23a2e; box-shadow: 0 0 8px rgba(255, 90, 70, 0.9); }
.slip-mark { position: absolute; top: 42px; width: 36px; height: 36px; margin-left: -18px; display: grid; place-items: center; border: 2px solid #c8302a; border-radius: 50%; color: #c8302a; font: 900 9px/1.15 var(--font-jp); font-style: normal; text-align: center; transform: rotate(-8deg); opacity: 0.85; }
.slip-mark.off { transform: rotate(18deg) translateY(7px); opacity: 0.55; }
/* packing in the picture: a tag over each thing on the counter (the bill card steps aside) */
.scan[data-view="bag"] .scan-card { display: none; }
.bag-tags { position: absolute; inset: 0; pointer-events: none; }
.bag-tag { position: absolute; left: 0; top: 0; display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px 3px 4px; border-radius: 999px; background: rgba(24, 21, 52, 0.82); border: 1px solid var(--line); font-size: 12px; font-style: normal; white-space: nowrap; color: var(--ink); transition: opacity 0.2s ease; }
.bag-tag kbd { display: inline-grid; place-items: center; min-width: 18px; height: 18px; border-radius: 9px; background: var(--lamp); color: var(--lamp-ink); font: 800 11px/1 var(--font-ui); }
.bag-tag small { font-size: 11px; color: var(--ink-dim); }
.bag-tag.w3 small { color: #9fc0ff; } .bag-tag.w2 small { color: #b9e0a0; } .bag-tag.w1 small { color: #ffd890; } .bag-tag.hot small { color: #ffb08a; }
.bag-tag.gone { opacity: 0; }
/* the scanner's aim over a customer's phone */
.qr-aim { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border: 2px solid rgba(255, 255, 255, 0.85); border-radius: 10px; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25); pointer-events: none; transition: border-color 0.15s ease, transform 0.15s ease; }
.qr-aim i { position: absolute; left: -10px; right: -10px; top: 50%; height: 2px; margin-top: -1px; background: #ff4a3a; box-shadow: 0 0 10px 2px rgba(255, 74, 58, 0.8); }
.qr-aim.on { border-color: var(--lamp); transform: scale(1.1); }
.qr-aim.hit { border-color: #7fffb0; }
.qr-aim.hit i { background: #7fffb0; box-shadow: 0 0 12px 3px rgba(127, 255, 176, 0.9); }
/* while a beat is up: no scan frame or turn pad, and on short screens the bill card makes room */
@media (max-height: 520px) {
  .scanning .plate, .scanning .simbar { visibility: hidden; }
  .scan-say { top: calc(var(--pad-t) + 2px); padding: 5px 12px; font-size: 13px; }
  .scan[data-phase="beat"] .scan-card, .scan[data-phase="tobacco"] .scan-card { display: none; }
  .beat { bottom: calc(var(--pad-b) + 50px); gap: 5px; padding: 8px 10px; width: min(640px, calc(100% - 24px)); }
  .beat header b { font-size: 13px; } .beat header span { font-size: 11px; }
  .bt-line { font-size: 14px; }
  .bt-opt { min-height: 40px; padding: 4px 10px; font-size: 13px; }
  .coin { width: 44px; height: 40px; } .coin.note { width: 54px; }
  .tray { min-height: 30px; }
  .bag-main { min-height: 80px; } .slip { height: 74px; } .slip-box { top: 32px; } .slip-mark { top: 34px; }
  .bag-tag { font-size: 11px; padding: 2px 7px 2px 3px; }
  /* at the tobacco shelf the card shrinks to one line and a button: the shelf needs the room */
  .beat[data-beat="tobacco"] { width: min(520px, calc(100% - 24px)); }
  .beat[data-beat="tobacco"] header span:not(.bt-pick) { display: none; }
  .beat[data-beat="tobacco"] .bt-tip:not(.on) { display: none; }
  .beat[data-beat="tobacco"] .bt-opt { min-height: 36px; }
}

/* ---------- 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; } }
/* while you talk, the walking stick, the action buttons and the test button step aside */
#app:has(.talk.on) .dev-toggle, #app:has(.talk.on) .tacts, #app:has(.talk.on) .work, #app:has(.talk.on) .hint { display: none; }
#app:has(.talk.on) .stick, #app:has(.talk.on) .dock { visibility: hidden; }
@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); }
/* stations worked in the picture (coffee machine, oden pot): the card moves to a corner, out of the way */
.station.hands .st-card { left: var(--gutter-l); top: calc(var(--pad-t) + 64px); bottom: auto; transform: none; width: min(300px, 40vw); max-height: calc(100% - var(--pad-t) - var(--pad-b) - 80px); padding: 12px 14px; }
.station.hands.right .st-card { left: auto; right: var(--gutter-r); }
.hands-on .ticket { display: none; }
.station.hands .st-actions { justify-content: flex-start; margin-top: 8px; }
.station.hands .st-btn { min-height: 34px; padding: 0 12px; font-size: 12px; }
.st-tip { font-size: 12px; letter-spacing: 0.04em; color: var(--ink-dim); }
.st-hover { min-height: 1.4em; font-size: 13px; font-weight: 700; color: var(--lamp); }
/* the delivery note while checking a delivery in */
.st-note { list-style: none; margin: 0; padding: 6px 8px; display: grid; gap: 3px; border-radius: 8px; background: #fff8ea; color: #2a2226; font-size: 12px; }
.st-note li { display: grid; grid-template-columns: minmax(0, 1fr) auto 4.2em; gap: 8px; align-items: baseline; padding: 1px 0; border-bottom: 1px dashed rgba(42, 34, 38, 0.18); }
.st-note li:last-child { border-bottom: 0; }
.st-note em { font-style: normal; color: rgba(42, 34, 38, 0.6); }
.st-note b { text-align: right; font-variant-numeric: tabular-nums; }
.st-note li.ok b { color: #2a9d94; }
.st-note li.off b, .st-note b.miss { color: #d8402f; }
.st-step { font-size: 14px; font-weight: 700; letter-spacing: 0.03em; color: var(--ink); }
.st-step span { display: inline-flex; gap: 4px; margin-right: 8px; vertical-align: 2px; }
.st-step i { width: 8px; height: 8px; border-radius: 50%; background: rgba(253, 241, 223, 0.2); }
.st-step i.done { background: var(--teal); }
.st-step i.now { background: var(--lamp); box-shadow: 0 0 6px var(--lamp); }
@media (max-height: 520px) {
  /* landscape phone: a small card in the top corner, the name plate and money out of the way */
  .working .plate, .working .simbar { visibility: hidden; }
  .station.hands .st-card { top: var(--pad-t); width: min(220px, 31vw); max-height: calc(100% - var(--pad-t) - var(--pad-b)); padding: 7px 9px; border-radius: 12px; }
  .station.hands .st-card header { gap: 6px; }
  .station.hands .st-title { font-size: 12px; letter-spacing: 0.04em; }
  .station.hands .st-x { min-height: 26px; padding: 0 8px; font-size: 11px; }
  .station.hands .st-sub, .station.hands .st-cup, .station.hands .st-hover { font-size: 11px; }
  .station.hands .st-step { font-size: 11.5px; }
  .station.hands .st-body { gap: 4px; margin-top: 4px; }
  .station.hands .st-tip { display: none; }
  .station.hands .st-actions { margin-top: 4px; }
  .station.hands .st-btn { min-height: 28px; padding: 0 9px; font-size: 11px; }
}
.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; }
}

/* ---------- landscape only: a phone held upright is asked to turn ---------- */
.rotate-card { display: none; }
@media (orientation: portrait) and (pointer: coarse) and (max-width: 900px) {
  .rotate-card { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: var(--night); color: var(--ink); text-align: center; }
  .rotate-card p { margin: 18px 0 6px; font-family: var(--font-jp); font-weight: 900; font-size: 20px; letter-spacing: 0.16em; }
  .rotate-card span { font-size: 12px; letter-spacing: 0.2em; color: var(--ink-dim); }
  .rotate-card i { display: block; width: 46px; height: 78px; margin: 0 auto; border: 3px solid var(--lamp); border-radius: 10px; animation: turn-phone 2.4s ease-in-out infinite; }
}
@keyframes turn-phone { 0%, 25% { transform: rotate(0deg); } 55%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(0deg); } }

/* ---------- purchases and rewarded ads (src/monetize.js): one small card over a dimmed screen ---------- */
.mz { position: absolute; inset: 0; z-index: 9; display: grid; place-items: center; padding: 16px; background: rgba(14, 11, 34, 0.55); }
.mz[hidden] { display: none; }
.mz-card { width: min(380px, 100%); max-height: calc(100% - 16px); overflow: auto; padding: 18px 18px 16px; border-radius: 20px; background: #fffaf0; color: #2a2433; box-shadow: 0 18px 48px rgba(8, 6, 24, 0.55); font-family: var(--font-ui); text-align: center; }
.mz-kicker { margin: 0 0 6px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.2em; color: #9a90a4; }
.mz-title { margin: 0; font-family: var(--font-jp); font-weight: 900; font-size: 19px; letter-spacing: 0.04em; }
.mz-price { margin: 4px 0 0; font-size: 22px; font-weight: 800; color: #d0473a; }
.mz-sub { margin: 8px 0 0; font-size: 13.5px; line-height: 1.6; color: #4a4254; }
.mz-note { margin: 10px 0 0; padding: 8px 10px; border-radius: 10px; background: #fdf0d8; color: #7a5a20; font-size: 12px; line-height: 1.55; text-align: left; }
.mz-row { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.mz-col { display: grid; gap: 8px; margin-top: 14px; }
.mz-btn { min-height: 42px; padding: 0 16px; border-radius: 999px; border: 1.5px solid rgba(42, 36, 51, 0.16); background: #fff; color: #2a2433; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.mz-btn:hover:not(:disabled) { border-color: #d8a23a; }
.mz-btn.go { border-color: transparent; background: var(--lamp); color: var(--lamp-ink); }
.mz-btn.ghost { border-color: transparent; background: transparent; color: #8a8094; font-weight: 600; }
.mz-btn:disabled { opacity: 0.5; cursor: default; }
.mz-ad { display: grid; place-items: center; gap: 6px; height: 150px; margin-top: 4px; border-radius: 14px; background: linear-gradient(160deg, #f6b38a, #e88aa8 45%, #6a5ab0); color: #fff; }
.mz-ad b { font-family: var(--font-jp); font-size: 24px; letter-spacing: 0.16em; text-shadow: 0 2px 10px rgba(40, 20, 60, 0.35); }
.mz-ad span { font-size: 12px; letter-spacing: 0.1em; opacity: 0.9; }

/* ---------- phones (portrait, or landscape with little height): a slim HUD that keeps the view clear ---------- */
.dock-more { display: none; }
@media (max-width: 640px), (max-height: 520px) {
  .hud { 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: 8px; }
  /* name plate: title and level on one line, the clock and the date small under it */
  .plate { display: grid; grid-template-columns: auto auto; justify-content: start; align-items: center; column-gap: 8px; padding-left: 8px; }
  .plate-jp { font-size: 15px; letter-spacing: 0.1em; }
  .plate-lv { grid-column: 2; grid-row: 1; gap: 5px; margin: 0; }
  .plate-lv b { font-size: 11.5px; }
  .plate-lv em { display: none; }
  .lv-bar { width: 40px; height: 4px; }
  .plate-sub { grid-column: 1 / -1; margin-top: 1px; font-size: 11px; letter-spacing: 0.08em; }
  .plate-sub #clock { font-size: 12.5px; }
  .plate-date { grid-column: 1 / -1; margin-top: 1px; font-size: 10.5px; }
  .plate-date b { padding: 0 6px; }
  .plate-buff, .todo { grid-column: 1 / -1; }
  .plate-buff { margin-top: 4px; }
  .todo { gap: 4px; margin-top: 6px; max-width: min(17em, 52vw); }
  .todo li { padding: 3px 8px; font-size: 11px; }
  .todo li:nth-child(n + 3) { display: none; }
  /* status bar: money and the tablet on top, the stars and the clock's speed under (the date and time are on the plate) */
  #hud .simbar { justify-self: end; grid-template-columns: auto auto; grid-template-areas: "money open" "rep speed"; align-items: center; gap: 4px 8px; padding: 5px 6px 5px 10px; border-radius: 12px; }
  #hud .sb-row { display: contents; }
  #hud .sb-day, #hud .sb-clock, #hud .sb-served { display: none; }
  #hud .sb-money { grid-area: money; font-size: 14px; }
  #hud .sb-rep { grid-area: rep; }
  #hud .sb-stars { font-size: 11px; }
  #hud .sb-open { grid-area: open; justify-self: end; height: 32px; padding: 0 12px; font-size: 12px; letter-spacing: 0.12em; text-indent: 0.12em; }
  #hud .sb-speed { grid-area: speed; justify-self: end; margin: 0; }
  #hud .sb-speed button { min-width: 27px; height: 26px; padding: 0 4px; font-size: 11px; }
  /* notes: small, and never more than two at a time (game.js) */
  .toasts { gap: 6px; margin-top: 0; }
  .toast { max-width: min(100%, 25em); padding: 5px 12px; border-radius: 12px; font-size: 12.5px; line-height: 1.45; letter-spacing: 0.03em; }
  .hint { bottom: calc(var(--pad-b) + 112px); padding: 4px 12px; font-size: 11px; letter-spacing: 0.06em; }
  /* the dock folds into one button; the walking stick and the action buttons sit lower and smaller */
  .dock { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: flex-end; gap: 6px; max-width: min(100%, 430px); }
  .dock:not(.open) .dock-btn:not(.dock-more) { display: none; }
  .dock-more { display: grid; }
  .dock.open .dock-more { background: var(--lamp); color: var(--lamp-ink); border-color: transparent; }
  .dock-btn { width: 42px; height: 42px; }
  .dock-btn::before { display: none; }
  .stick { width: 96px; height: 96px; }
  .tacts { bottom: calc(var(--pad-b) + 56px); gap: 8px; }
  .tact { width: 54px; height: 54px; font-size: 13px; }
  .tact.go { width: 64px; height: 64px; font-size: 21px; }
  /* the order slip: small, under the status bar */
  .ticket { top: calc(var(--pad-t) + 80px); bottom: auto; width: min(196px, 44vw); }
  .tk { padding: 7px 9px; font-size: 11px; }
  /* a conversation keeps to the lower part of the screen */
  .talk-text { min-height: 2.6em; font-size: 15px; line-height: 1.6; }
  .talk-choices { gap: 6px; margin-top: 8px; }
  .talk-choice { padding: 7px 12px; font-size: 14px; }
}
@media (max-width: 640px) {
  /* portrait phone: the name stays on one line beside the status bar */
  .plate-jp { font-size: 14px; letter-spacing: 0.06em; white-space: nowrap; }
  .lv-bar { width: 26px; }
}
@media (max-height: 520px) {
  /* landscape phone: notes go up into the gap between the name plate and the status bar, clear of the crosshair */
  .toasts { grid-area: auto; position: absolute; top: var(--pad-t); left: 50%; transform: translateX(-50%); width: max(240px, calc(100% - 440px)); margin: 0; }
  .toast { max-width: 100%; font-size: 12px; }
  .talk-box { width: min(680px, 100%); padding: 10px 16px 8px 84px; }
  .talk-face { left: 16px; top: 12px; width: 52px; height: 52px; font-size: 22px; }
  .talk-name { margin-bottom: 2px; }
  .talk-hint { margin-top: 2px; }
}

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

/* ---------------------------------------------------------------- 見切り: the hand-held terminal */
.station .handy { margin: 6px 0 4px; padding: 8px 10px 9px; border-radius: 12px; background: linear-gradient(#2c3a33, #1f2a25); box-shadow: inset 0 0 0 2px #46564d, 0 2px 0 rgba(0,0,0,.25); color: #cfeadb; font-variant-numeric: tabular-nums; }
.station .handy p { margin: 0; }
.station .handy .hd-top { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .06em; color: #8fc2a6; border-bottom: 1px dashed #46564d; padding-bottom: 4px; margin-bottom: 5px; }
.station .handy .hd-top em { font-style: normal; }
.station .handy .hd-name { font-size: 15px; font-weight: 800; color: #eafff2; }
.station .handy .hd-line { font-size: 12.5px; line-height: 1.55; }
.station .handy .hd-line b { color: #ffd76a; font-size: 14px; }
.station .handy .hd-msg { margin-top: 5px; font-size: 12px; color: #a6ffcf; min-height: 1.4em; }
.station .st-sub s { opacity: .55; }
.station .st-sub .bad { color: #ff8a7a; }
.st-btn.warn { box-shadow: inset 0 0 0 2px #f2a23a; }
@media (max-width: 640px), (max-height: 520px) {
  .station .handy { padding: 6px 8px 7px; }
  .station .handy .hd-name { font-size: 13px; }
  .station .handy .hd-line { font-size: 11.5px; }
}

/* the capsule toy that came out (play.js) */
.station .pl-prize { display: flex; align-items: center; gap: 10px; min-height: 0; }
.station .pl-prize img { width: 72px; height: 72px; flex: none; animation: plPop .45s cubic-bezier(.2,1.6,.4,1); }
.station .pl-prize p { margin: 0; font-size: 13.5px; line-height: 1.45; }
.station .pl-prize em { color: #ff6a4a; font-style: normal; font-weight: 900; }
@keyframes plPop { from { transform: scale(.2) rotate(-20deg); } to { transform: none; } }
