@font-face {
  font-family: 'Noto TC';
  src: url('./assets/noto-tc.woff') format('woff');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Noto TC';
  src: url('./assets/noto-tc-bold.woff') format('woff');
  font-weight: 700 900;
  font-display: swap;
}

@font-face {
  font-family: 'Noto Serif TC Local';
  src: url('./assets/noto-serif-tc-bold.woff') format('woff');
  font-weight: 700 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #34231c;
  --muted: #705343;
  --red: #a62b26;
  --red-dark: #75221d;
  --red-deep: #841f1c;
  --paper: #fbf2df;
  --cream: #fffaf0;
  --line: #e1c5a2;
  --brown: #503125;
  --body-font: 'Noto TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  --title-font: 'Noto Serif TC Local', 'Songti TC', 'Noto Serif CJK TC', Georgia, serif;
  --shell: 1200px;
}

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

html { min-width: 280px; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(ellipse at 52% 3%, #fff8e8 0%, transparent 68%), url('./assets/paper.png');
  font-family: var(--body-font);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-tap-highlight-color: transparent;
}

main { flex: 1; min-width: 0; }
main:focus { outline: none; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
h1, h2, h3 { font-weight: 900; line-height: 1.25; }
p { color: var(--muted); }
img { display: block; max-width: 100%; }
button, a { touch-action: manipulation; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }

button:focus-visible, a:focus-visible {
  outline: 3px solid #a75c1a;
  outline-offset: 3px;
}

.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  z-index: 15;
  left: 12px;
  top: 12px;
  padding: 10px 16px;
  background: var(--cream);
  border: 2px solid var(--red);
  border-radius: 8px;
}

.icon {
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  flex: 0 0 auto;
  background-color: currentColor;
  -webkit-mask: var(--glyph) center / contain no-repeat;
  mask: var(--glyph) center / contain no-repeat;
}
.icon-play { --glyph: url('./assets/icons/play.png'); }
.icon-book { --glyph: url('./assets/icons/book.png'); }
.icon-medal { --glyph: url('./assets/icons/medal.png'); }
.icon-pin { --glyph: url('./assets/icons/pin.png'); }
.icon-volume { --glyph: url('./assets/icons/volume.png'); }
.icon-muted { --glyph: url('./assets/icons/muted.png'); }
.icon-clock { --glyph: url('./assets/icons/clock.png'); }
.icon-flame { --glyph: url('./assets/icons/flame.png'); }
.icon-undo { --glyph: url('./assets/icons/undo.png'); }
.icon-trash { --glyph: url('./assets/icons/trash.png'); }
.icon-close { --glyph: url('./assets/icons/close.png'); }
.icon-check { --glyph: url('./assets/icons/check.png'); }
.icon-order { --glyph: url('./assets/icons/order.png'); }
.icon-bowl { --glyph: url('./assets/icons/bowl.png'); }
.icon-external { --glyph: url('./assets/icons/external.png'); }
.icon-threads { --glyph: none; background: url('./assets/icons/threads.png') center / contain no-repeat; }
.icon-phone { --glyph: url('./assets/icons/phone.png'); }
.icon-home { --glyph: url('./assets/icons/home.png'); }

.topbar {
  color: var(--cream);
  background: linear-gradient(115deg, #a02a25, #b0302b 57%, #992621);
  border-bottom: 4px solid #77211b;
  box-shadow: 0 2px 0 #d89464;
}

.header-inner, .page-shell, .footer-inner {
  width: min(calc(100% - 64px), var(--shell));
  margin-inline: auto;
}

.header-inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 42px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 11px;
  color: #fff4df;
  font-family: var(--title-font);
  font-weight: 900;
  font-size: 1.17rem;
  letter-spacing: .04em;
  line-height: 1.2;
}

.brand img {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid #f7d39c;
  background: #fff1cd;
}

.nav-links, .header-tools { display: flex; align-items: center; }
.nav-links { margin-inline-start: auto; gap: clamp(12px, 2.3vw, 32px); }

.nav-links a {
  min-height: 44px;
  display: grid;
  place-items: center;
  position: relative;
  font-size: .91rem;
  font-weight: 700;
  color: #fff0dd;
  white-space: nowrap;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 1px;
  right: 1px;
  height: 2px;
  border-radius: 2px;
  background-color: #ffd29a;
  opacity: 0;
}

.nav-links a:hover::after, .nav-links a[aria-current]::after { opacity: 1; }

.header-tools { gap: 9px; }

.header-tools button, .exit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 8px;
  color: #fff5e4;
  border: 1px solid #f2b59799;
  background: #74201930;
  font-size: .88rem;
  font-weight: 700;
  line-height: 1;
}

.header-tools button:hover, .exit-button:hover { background: #6a1a1980; }
.header-tools button:focus-visible, .exit-button:focus-visible, .topbar a:focus-visible { outline-color: #ffe29c; }
.header-tools .icon { font-size: 1.12rem; }
.exit-button { gap: 4px; margin-inline-start: auto; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .56em;
  min-height: 48px;
  padding: 9px 17px;
  border-radius: 9px;
  border: 1px solid transparent;
  line-height: 1.28;
  font-weight: 800;
  text-align: center;
  transition: background-color .15s, transform .15s, box-shadow .15s;
}

.button .icon { font-size: 1em; }

.button-primary {
  color: #fffaf0;
  background: var(--red);
  border-color: #922724;
  box-shadow: 0 3px 0 #72221b, inset 0 1px 0 #d07761;
}

.button-primary:not(:disabled):hover { background: var(--red-deep); }
.button-primary:not(:disabled):active { transform: translateY(2px); box-shadow: 0 1px 0 #72221b; }

.button-light {
  color: #663627;
  background: #fff8e9;
  border-color: #d8b591;
  box-shadow: 0 2px 0 #e9d2b8;
}

.button-light:not(:disabled):hover { background: #f5e1c6; }
.button-light:not(:disabled):active { transform: translateY(1px); box-shadow: 0 1px 0 #e9d2b8; }
.button:disabled { opacity: .53; }

.home-shell { padding-block: 40px 56px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(18px, 4vw, 64px);
}

.hero-copy { min-width: 0; padding-left: clamp(0px, 1.15vw, 18px); }

.store-tag {
  color: #8e2d22;
  font-size: .92rem;
  font-weight: 800;
  letter-spacing: .12em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.store-tag::before {
  content: '';
  display: block;
  width: 23px;
  height: 2px;
  flex: 0 0 auto;
  background: #b34838;
}

.hero-title {
  margin-block: 14px 15px;
  font-family: var(--title-font);
  font-size: clamp(2.9rem, 5.45vw, 5rem);
  letter-spacing: -.06em;
  line-height: 1.07;
  word-break: keep-all;
}

.hero-title > * { display: block; }

.hero-title em {
  color: var(--red);
  font-style: normal;
  letter-spacing: .04em;
  font-size: 1.19em;
  text-shadow: 0 2px 0 #e8c4a1;
}

html[lang="en"] .hero-title {
  font-size: clamp(2.8rem, 5.05vw, 4.65rem);
  letter-spacing: -.055em;
}
html[lang="en"] .hero-title em { letter-spacing: -.06em; font-size: 1em; }
html[lang="en"] .store-tag { letter-spacing: .075em; }

.hero-text {
  max-width: 26ch;
  color: #684938;
  font-size: clamp(1rem, 1.45vw, 1.13rem);
  line-height: 1.7;
}
html[lang="en"] .hero-text { max-width: 34ch; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 27px; }
.hero-actions .button { min-height: 53px; padding-inline: 17px; }
.hero-actions .button-primary { min-width: 160px; font-size: 1.15rem; padding-inline: 19px; }
.hero-actions .button-light { font-size: .96rem; }

.hero-art {
  position: relative;
  overflow: hidden;
  min-width: 0;
  border: 2px solid #5a3022;
  border-radius: 18px;
  background-color: #b5532d;
  box-shadow: 0 5px 0 #8a492f, 0 12px 23px #7b392227;
}

.hero-art img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.hero-art::after {
  content: '';
  pointer-events: none;
  position: absolute;
  z-index: 1;
  inset: 6px;
  border: 1px solid #fff1c654;
  border-radius: 12px;
}

.menu-section { margin-top: clamp(44px, 5vw, 70px); scroll-margin-top: 22px; }
.section-heading { text-align: center; margin: 0 auto 21px; }

.section-heading h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 17px;
  color: var(--ink);
  font-family: var(--title-font);
  font-size: clamp(1.65rem, 2.8vw, 2.4rem);
  letter-spacing: .06em;
}

.section-heading h2::before, .section-heading h2::after {
  content: '';
  width: min(7vw, 76px);
  height: 1px;
  background: linear-gradient(90deg, #cf9d6e33, #b05c38);
}

.section-heading h2::after { transform: scaleX(-1); }
.section-heading p { margin-top: 6px; font-size: .95rem; }

.menu-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }

.menu-card {
  min-width: 0;
  background: #fffbf1;
  border: 1px solid #ddbc99;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 3px 0 #e9cfaf;
}

.menu-food {
  min-height: 0;
  display: grid;
  place-items: center;
  aspect-ratio: 1.78;
  padding: 9px 8px 5px;
  border-bottom: 1px solid #c998673f;
  background-image:
    repeating-radial-gradient(circle at 50% 220%, transparent 0 16px, #b8714f19 17px 18px, transparent 19px 26px),
    radial-gradient(ellipse at 50% 43%, #fff7db 0%, transparent 76%);
  background-color: #f1d7ab;
}
.food-rose { background-color: #eabca9; }
.food-apricot { background-color: #efc29d; }
.food-tea { background-color: #dac49d; }

.menu-food .dish { width: min(83%, 225px); }
.menu-card-text { padding: 10px 13px 14px; }
.menu-card h3 { margin-block: 0 5px; font-family: var(--title-font); font-size: clamp(1rem, 1.6vw, 1.24rem); }
.menu-card p { font-size: .85rem; line-height: 1.6; }

.dish { position: relative; isolation: isolate; container-type: inline-size; }
.bowl-picture { width: 100%; height: auto; }
.bowl-toppings { position: absolute; inset: 0; pointer-events: none; }
.sprinkle { position: absolute; z-index: 2; top: var(--y); left: var(--x); width: var(--piece-width, var(--ingredient-width, 19%)); transform: translate(-50%, -50%) rotate(var(--turn)); }
.sprinkle img { width: 100%; height: auto; }
.sprinkle-chiliSauce { z-index: 0; --ingredient-width: 26%; }
.sprinkle-chashu { z-index: 1; }
.sprinkle-sprouts { --ingredient-width: 25%; }
.sprinkle-scallion { --ingredient-width: 17%; z-index: 3; }
.sprinkle-bamboo { --ingredient-width: 20%; z-index: 3; }
.sprinkle-egg { --ingredient-width: 16%; z-index: 5; }
.sprinkle-shrimp { --ingredient-width: 15%; z-index: 4; }
.sprinkle-corn { --ingredient-width: 19%; z-index: 3; }
.sprinkle-new img { animation: topping-drop .28s cubic-bezier(.2, .82, .32, 1.2) both; }
.bowl-ingredient { background: transparent; border: 0; padding: 0; pointer-events: auto; touch-action: none; cursor: grab; }
.bowl-ingredient img { pointer-events: none; user-select: none; -webkit-touch-callout: none; }
.bowl-ingredient.is-dragging { opacity: .42; cursor: grabbing; }
.bowl-ingredient:focus-visible { z-index: 6; border-radius: 8px; }

@keyframes topping-drop {
  0% { opacity: .12; transform: translateY(-45%) scale(1.34); }
  73% { opacity: 1; transform: translateY(8%) scale(.91); }
  100% { transform: translateY(0) scale(1); }
}

.bowl-label {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 77%;
  transform: translate(-50%, -50%);
  color: #fce5b9;
  font-family: var(--title-font);
  font-size: .72rem;
  font-size: 7.7cqi;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .12em;
  white-space: nowrap;
  text-shadow: 0 1px 0 #61211b;
}

.site-footer { background: #f5e5ce; border-top: 1px solid #dfc29d; }

.footer-inner {
  min-height: 70px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px 18px;
  color: #694939;
  font-size: .89rem;
  font-weight: 700;
}
.footer-inner a { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; white-space: nowrap; }
.footer-inner a:hover { text-decoration: underline; }

.narrow-shell { max-width: 900px; padding-block: 38px 48px; }

.paper-panel {
  background: #fffbf0;
  border: 1px solid #ddbd98;
  border-radius: 16px;
  box-shadow: 0 5px 0 #e5c9a7, 0 11px 36px #85523011;
  overflow: hidden;
}

.tutorial-panel, .score-panel { padding: clamp(20px, 5vw, 46px); }

.inner-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.inner-heading h1, .score-panel h1, .shop-panel h1 {
  font-family: var(--title-font);
  font-size: clamp(1.85rem, 5vw, 2.85rem);
  line-height: 1.2;
}
.inner-heading p { margin-top: 9px; }
.page-chef { width: clamp(76px, 16vw, 136px); object-fit: contain; }
.step-grid { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); padding: 0; margin: 22px 0 15px; gap: 12px; }
.step-grid li { background: #f8ebd6; border: 1px solid #ead1ae; border-radius: 11px; padding: 16px; }
.step-grid li h2 { font-size: 1.1rem; margin-bottom: 5px; }
.step-grid li p { font-size: .93rem; }
.step-icon, .hud-icon, .record-emblem {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: #f2d8bd;
  border-radius: 10px;
  color: #962c24;
}
.step-icon { margin-bottom: 12px; font-size: 1.2rem; }
.tip-banner { display: flex; align-items: center; padding: 12px 14px; gap: 8px; border-radius: 8px; background: #f9edd8; color: #744224; font-size: .93rem; }
.tip-banner .icon { color: #a8442b; }

.page-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-top: 24px; }
.page-actions .button { min-height: 47px; }
.tutorial-panel .page-actions { justify-content: flex-start; }

.score-panel { max-width: 670px; margin-inline: auto; text-align: center; }
.score-panel h1 { margin-top: 3px; }
.result-emblem { margin: 0 auto 12px; width: 104px; height: 104px; background: #f7dfb7; border: 1px solid #e1b488; border-radius: 50%; padding: 6px; display: grid; place-items: center; }
.result-emblem img { width: 100%; height: 100%; object-fit: contain; }
.record-emblem { width: 65px; height: 65px; border-radius: 50%; margin: 0 auto 15px; font-size: 1.9rem; }
.page-kicker { font-size: .88rem; color: #9c3027; letter-spacing: .1em; font-weight: 800; }
.score-total { margin: 6px 0; display: flex; align-items: baseline; justify-content: center; gap: 8px; color: var(--red); }
.score-total strong { font-size: clamp(3rem, 8vw, 5rem); font-weight: 900; line-height: 1.12; font-variant-numeric: tabular-nums; }
.score-total span { font-weight: 700; }
.personal-best { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 5px 10px; border-radius: 7px; background: #f4e3c7; color: #784526; font-weight: 700; font-size: .91rem; }
.result-stats { margin-top: 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.result-stats > div { padding: 10px 6px; background: #f9eedb; border-radius: 8px; border: 1px solid #ecd2ad; }
.result-stats dt { color: #6b503d; font-size: .83rem; font-weight: 700; }
.result-stats dd { font-weight: 900; font-size: 1.15rem; line-height: 1.35; margin-top: 3px; overflow-wrap: break-word; }
.record-note { margin-top: 8px; font-size: .92rem; }
.empty-record { margin: 25px 0 7px; color: var(--muted); background: #fbefdc; border-radius: 8px; padding: 17px 13px; }
.score-id-form { max-width: 430px; margin: 18px auto 0; padding: 13px; background: #fcf0db; border: 1px solid #ead0ac; border-radius: 10px; text-align: left; }
.score-id-form label, .record-player-select label { font-size: .91rem; font-weight: 800; }
.score-id-fields { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin: 5px 0 8px; }
.score-id-fields input, .record-player-select select { min-height: 46px; min-width: 0; color: var(--ink); background-color: #fffaf0; border: 1px solid #cfa47c; border-radius: 7px; font: inherit; font-size: 1rem; padding: 5px 9px; }
.score-id-fields input:focus-visible, .record-player-select select:focus-visible { outline: 3px solid #a75c1a; outline-offset: 2px; }
.score-id-form p { font-size: .83rem; }
.saved-score { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 16px; color: #556224; font-weight: 800; overflow-wrap: anywhere; }
.record-player-select { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 14px auto; }
.record-player-select select {
  appearance: none;
  max-width: min(66%, 270px);
  padding-inline-end: 28px;
  background-image: linear-gradient(45deg, transparent 50%, #74503b 50%), linear-gradient(135deg, #74503b 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.score-table { width: 100%; margin-top: 16px; border-collapse: collapse; table-layout: fixed; color: var(--ink); font-size: .88rem; }
.score-table th, .score-table td { padding: 7px 4px; vertical-align: middle; overflow-wrap: anywhere; }
.score-table th { background: #f3e0c4; font-weight: 800; }
.score-table th:first-child { width: 14%; }
.score-table th:nth-child(2) { width: 39%; }
.score-table tr { border-bottom: 1px solid #ecd6b9; }
.score-table tbody tr:nth-child(even) { background: #faf0dc; }
.score-table tbody tr[data-current] { background: #ffe7bd; }
.score-table td:first-child, .score-table td b { color: var(--red-deep); font-variant-numeric: tabular-nums; }
.you-marker { margin-inline-start: 5px; color: #855537; font-size: .76rem; }

.shop-panel { display: grid; grid-template-columns: .94fr 1.06fr; align-items: center; }
.shop-art { height: 100%; background: #b44726; }
.shop-art img { width: 100%; height: 100%; object-fit: cover; object-position: 51%; }
.shop-copy { padding: clamp(19px, 3.25vw, 36px); }
.shop-copy h1 { margin: 6px 0 10px; font-size: clamp(1.6rem, 3.6vw, 2.3rem); }
.shop-details { display: grid; gap: 9px; margin-block: 17px; }
.shop-details > div { display: grid; gap: 2px; }
.shop-details dt { display: flex; align-items: center; gap: 6px; color: var(--red-deep); font-size: .89rem; font-weight: 800; }
.shop-details dd a { display: inline-block; text-decoration: underline; text-underline-offset: 3px; padding-block: 4px; }
.shop-links { display: flex; flex-wrap: wrap; gap: 7px; }
.shop-links .button { padding-inline: 10px; min-height: 44px; font-size: .88rem; }

.game-shell {
  max-width: 1040px;
  padding-block: 24px max(24px, env(safe-area-inset-bottom));
}

.hud {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid #d8b18d;
  background: #fff9ec;
  border-radius: 12px;
  overflow: hidden;
}

.hud-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 9px 10px;
  border-right: 1px solid #ecd7bb;
}

.hud-cell:last-child { border-right: 0; }
.hud-cell > div { min-width: 0; }
.hud-label { display: block; font-size: .86rem; color: #744c39; font-weight: 700; line-height: 1.25; }
.hud strong { display: block; font-size: 1.67rem; line-height: 1.13; font-weight: 900; font-variant-numeric: tabular-nums; }
.hud-icon { width: 37px; height: 37px; border-radius: 50%; color: #9e3327; background: #f8e1c8; }
.hud-cell.time-low { color: #a42824; background-color: #fff0e7; }
.hud-cell.time-low .hud-icon { color: #fff5e5; background: #ad3027; }

.time-track {
  height: 6px;
  overflow: hidden;
  border-radius: 20px;
  background: #e9d0b2;
  margin: 6px 2px 15px;
}

.time-track > div { height: 100%; background: #a74331; transform-origin: left; border-radius: inherit; }
.time-track .time-low { background: #c63121; }

.game-grid { display: grid; align-items: start; grid-template-columns: minmax(230px, .9fr) minmax(0, 1.9fr); gap: 16px; }
.game-sidebar { min-width: 0; }

.order-ticket {
  background-color: #fffbf0;
  border: 1px solid #dcbb96;
  border-top: 4px solid #b64836;
  border-radius: 10px;
  box-shadow: 0 3px 0 #e8cfaf;
  padding: 13px 14px 15px;
}

.ticket-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px 10px;
  font-size: .87rem;
  color: #8a392a;
  font-weight: 800;
}

.ticket-header span:first-child { display: inline-flex; gap: 6px; align-items: center; }
.ticket-number { color: #73533e; background: #f9e8ce; padding: 3px 7px; border-radius: 5px; font-size: .81rem; white-space: nowrap; }
.order-ticket h2 { font-family: var(--title-font); font-size: clamp(1.25rem, 2.2vw, 1.68rem); margin: 7px 0 11px; }
.ticket-toppings { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 0; margin: 0; }

.ticket-toppings li {
  min-height: 48px;
  display: flex;
  align-items: center;
  position: relative;
  gap: 5px;
  padding: 4px 6px;
  border: 1px solid #ead7be;
  border-radius: 6px;
  background: #fcf1df;
}

.ticket-toppings li[data-state='ready'] { background: #eff1de; border-color: #ccd3a7; }
.ticket-toppings li[data-state='over'] { background: #fde4d8; border-color: #dc9e89; }
.ticket-toppings li .icon { display: none; position: absolute; right: 4px; bottom: 5px; width: .8rem; height: .8rem; color: #52632d; }
.ticket-toppings li[data-state='ready'] .icon { display: block; }
.requirement-art { display: block; width: 25px; height: 30px; flex: 0 0 auto; }
.requirement-art img { width: 100%; height: 100%; object-fit: contain; }
.requirement-text { min-width: 0; display: block; line-height: 1.22; }
.requirement-name { display: block; color: #56392d; font-size: .79rem; font-weight: 700; overflow-wrap: break-word; }
.requirement-count { display: block; font-weight: 700; font-size: .83rem; font-variant-numeric: tabular-nums; color: #744b37; white-space: nowrap; }
.requirement-count b { font-size: .9rem; }
[data-state='ready'] .requirement-count { color: #415421; }
[data-state='over'] .requirement-count { color: #9c2e23; }

.counter-chef {
  min-height: 155px;
  display: grid;
  place-items: end center;
  padding: 16px 10px 0;
  margin-top: 9px;
  background: radial-gradient(ellipse at center, #eed5ad 0, transparent 72%);
}
.counter-chef img { max-width: min(70%, 155px); max-height: 156px; object-fit: contain; }

.kitchen-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d2ab82;
  border-radius: 13px;
  background: #fff9eb;
  box-shadow: 0 4px 0 #e8cbaa, 0 8px 22px #74442a12;
}

.cooking-stage {
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
  height: clamp(230px, 26vw, 306px);
  overflow: hidden;
  background:
    linear-gradient(0deg, #693b25 0%, #a16740 2%, #c58d59 18%, #b57b50 19%, #a46543 22%, transparent 22.5%),
    repeating-linear-gradient(90deg, transparent 0 42px, #9f51331f 43px 44px, transparent 45px 83px),
    radial-gradient(ellipse at 50% 15%, #ffe7b7, #e4bc8b 57%, #ce986f);
  border: 4px solid #ab6849;
  border-bottom-width: 6px;
  box-shadow: inset 0 0 0 1px #814831;
  transition: box-shadow .14s;
}

.cooking-stage::before {
  content: '';
  position: absolute;
  isolation: isolate;
  pointer-events: none;
  inset: auto 0 0;
  height: 21%;
  background: repeating-linear-gradient(176deg, transparent 0 6px, #71392225 7px 9px, transparent 10px 17px);
}

.cooking-stage.drop-ready { box-shadow: inset 0 0 0 3px #a42f26, inset 0 0 30px #ffe68b; }
.stage-chef { display: none; pointer-events: none; }
.cooking-stage .dish { width: min(57%, 343px); z-index: 2; user-select: none; pointer-events: none; margin-top: -8px; }
.cooking-stage .bowl-picture { filter: drop-shadow(0 9px 8px #68402265); }
.dish-serving { animation: take-bowl .43s cubic-bezier(.45,.05,.82,.48) both; }

@keyframes take-bowl {
  0% { opacity: 1; transform: translate(0, 0); }
  21% { opacity: 1; transform: translate(3%, -8%) rotate(-4deg); }
  100% { opacity: 0; transform: translate(90%, -30%) rotate(8deg) scale(.83); }
}

.steam { position: absolute; left: 50%; top: 4%; display: flex; gap: 10px; transform: translateX(-50%); opacity: .55; pointer-events: none; }
.steam i { width: 12px; height: 38px; border-radius: 50%; border-left: 3px solid #fff9dd; transform: skew(-11deg); animation: steam 3s ease-in-out infinite; }
.steam i:nth-child(2) { height: 32px; animation-delay: -.7s; }
.steam i:nth-child(3) { height: 27px; animation-delay: -1.4s; }

@keyframes steam {
  0%, 100% { opacity: .35; transform: translateY(5px) skew(-9deg); }
  50% { opacity: 1; transform: translateY(-2px) skew(14deg); }
}

.kitchen-message {
  position: absolute;
  z-index: 3;
  inset: auto 7px 6px;
  width: fit-content;
  max-width: calc(100% - 14px);
  margin-inline: auto;
  font-size: .85rem;
  font-weight: 800;
  padding: 3px 10px;
  text-align: center;
  border: 1px solid #d7ad81;
  border-radius: 6px;
  background: #fff4dd;
  color: #643b29;
  line-height: 1.35;
  pointer-events: none;
}
.kitchen-message:empty { visibility: hidden; }
.kitchen-message[data-kind='error'] { background: #fff1e8; border-color: #b24331; color: #9e281e; }
.kitchen-message[data-kind='success'] { background: #fff4c9; border-color: #b98438; color: #6f401d; }

.pantry { padding: 10px 12px 0; }
.pantry h2 { color: #614033; font-size: .93rem; margin: 0 0 7px; }
.pantry-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(56px, 1fr)); gap: 6px; }

.topping-button {
  touch-action: none;
  position: relative;
  min-height: 75px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px;
  border-radius: 8px;
  background: #fbefdb;
  border: 1px solid #e1c29d;
  box-shadow: 0 2px 0 #ebd0ad;
  color: #634032;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.topping-button:hover:not(:disabled) { background: #f6e4c7; border-color: #cda174; }
.topping-button:active:not(:disabled) { box-shadow: 0 1px 0 #dfbf99; transform: translateY(1px); }
.topping-button.is-dragging { background: #f0dfc5; box-shadow: none; }
.topping-button:disabled { opacity: .65; }

.ingredient-card-art { width: 39px; height: 36px; flex: 0 0 auto; display: block; pointer-events: none; }
.ingredient-card-art img { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; }
.ingredient-label { min-width: 0; max-width: 100%; font-weight: 800; font-size: .83rem; line-height: 1.15; text-align: center; overflow-wrap: break-word; pointer-events: none; }
.ingredient-count {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 18px;
  min-height: 18px;
  top: 2px;
  right: 2px;
  padding-inline: 3px;
  border-radius: 12px;
  color: #fff8ea;
  background: #88573c;
  font-size: .72rem;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}
.topping-button[data-over='true'] .ingredient-count { background: #a62b26; }

.kitchen-actions {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 7px;
  padding: 11px 12px 13px;
}
.kitchen-actions .button { min-height: 45px; padding-inline: 13px; font-size: .92rem; }
.kitchen-actions .serve-button { font-size: 1rem; }

.drag-ghost {
  position: fixed;
  inset: 0 auto auto 0;
  width: 52px;
  height: 52px;
  pointer-events: none;
  z-index: 30;
}
.drag-ghost img { width: 100%; height: 100%; object-fit: contain; transform: translate(-50%, -58%); filter: drop-shadow(0 4px 3px #4e302b56); }

#leave-dialog {
  max-width: min(420px, calc(100% - 30px));
  padding: 0;
  color: var(--ink);
  background: #fff8e9;
  border: 1px solid #bd8b66;
  border-radius: 13px;
  box-shadow: 0 6px 0 #78452988;
}

#leave-dialog::backdrop { background: #312019a0; }
.dialog-content { padding: 21px; }
.dialog-content h2 { font-family: var(--title-font); margin-bottom: 7px; font-size: 1.45rem; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 15px; }
.noscript { padding: 30px; text-align: center; }

@media (max-width: 930px) {
  .header-inner, .page-shell, .footer-inner { width: calc(100% - 44px); }
  .header-inner { gap: 16px; }
  .nav-links { gap: 13px; }
  .nav-links .nav-menu { display: none; }
  .header-tools { gap: 5px; }
  .brand { font-size: 1.04rem; gap: 8px; }
  .hero { gap: 24px; }
  .home-shell { padding-top: 30px; }
  .hero-actions { gap: 9px; margin-top: 21px; }
  .hero-actions .button { min-height: 48px; padding-inline: 11px; }
  .hero-actions .button-primary { min-width: auto; }
}

@media (min-width: 736px) and (max-width: 835px) {
  .pantry-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 735px) {
  .header-inner, .page-shell, .footer-inner { width: calc(100% - 30px); }
  .header-inner {
    min-height: 57px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0 7px;
  }
  .brand { min-height: 55px; }
  .brand img { width: 34px; height: 34px; }
  .header-tools { grid-column: 3; }
  .header-tools button, .exit-button { border-radius: 7px; background-color: transparent; }
  .nav-links {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
    margin: 0;
    border-top: 1px solid #f0b08451;
  }
  .nav-links a { font-size: .85rem; line-height: 1.25; white-space: normal; text-align: center; }

  .hero {
    max-width: 540px;
    margin-inline: auto;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .hero-copy { padding: 0; text-align: center; }
  .store-tag { justify-content: center; font-size: .86rem; }
  .store-tag::before { width: 16px; }
  .hero-title, html[lang="en"] .hero-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: 0 .15em;
    margin-block: 9px;
    font-size: clamp(2.13rem, 8vw, 3.2rem);
    line-height: 1.14;
  }
  .hero-title em { font-size: 1.09em; }
  .hero-text, html[lang="en"] .hero-text { margin-inline: auto; max-width: 39ch; }
  .hero-actions { justify-content: center; margin-top: 15px; }
  .hero-art { border-radius: 12px; }
  .hero-art::after { inset: 4px; border-radius: 8px; }
  .home-shell { padding-top: 22px; padding-bottom: 36px; }
  .menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .menu-section { margin-top: 35px; }
  .menu-card-text { padding: 8px 9px 12px; }
  .menu-card h3 { font-size: clamp(.97rem, 3.6vw, 1.16rem); }
  .menu-card p { font-size: .85rem; }

  .narrow-shell { padding-block: 23px 34px; }
  .game-shell { padding-top: 10px; }
  .hud-cell { gap: 5px; padding: 5px 6px; }
  .hud-icon { width: 30px; height: 30px; font-size: .86rem; }
  .hud-label { font-size: .77rem; }
  .hud strong { font-size: 1.38rem; }
  .time-track { margin-bottom: 8px; height: 5px; }
  .game-grid { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .counter-chef { display: none; }
  .order-ticket { padding: 5px 8px 8px; border-top-width: 3px; }
  .order-ticket h2 { margin: 2px 0 5px; }
  .ticket-header { font-size: .78rem; }
  .ticket-number { padding: 1px 5px; font-size: .76rem; }
  .ticket-toppings { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .ticket-toppings[data-count='4'] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ticket-toppings li { padding: 3px 4px; min-height: 36px; gap: 4px; }
  .requirement-art { width: 23px; height: 24px; }
  .ticket-toppings[data-count='4'] .requirement-art { width: 18px; }
  .requirement-name { font-size: .75rem; }
  .requirement-count { font-size: .76rem; }
  .requirement-count b { font-size: .83rem; }
  .cooking-stage { height: clamp(150px, 43vw, 230px); border-width: 3px 3px 4px; }
  .cooking-stage .dish { width: clamp(147px, 51vw, 272px); margin-top: -5px; }
  .stage-chef { display: block; position: absolute; z-index: 1; bottom: 21%; left: 5%; width: clamp(48px, 15vw, 78px); }
  .steam { top: 3%; }
  .steam i { height: 22px; border-width: 2px; }
  .steam i:nth-child(2) { height: 18px; }
  .steam i:nth-child(3) { height: 16px; }
  .kitchen-message { bottom: 3px; font-size: .77rem; padding-block: 2px; }
  .pantry { padding: 6px 7px 0; }
  .pantry h2 { margin-bottom: 4px; font-size: .87rem; }
  .pantry-grid { display: flex; flex-wrap: wrap; gap: 5px; }
  .topping-button { flex: 1 1 calc((100% - 15px) / 4); min-height: 51px; padding: 3px 4px; gap: 2px; }
  .ingredient-card-art { width: 30px; height: 25px; }
  .ingredient-label { font-size: .81rem; }
  .ingredient-count { top: 0; right: 0; min-height: 15px; min-width: 15px; font-size: .65rem; }
  .kitchen-actions { padding: 8px 7px 9px; gap: 5px; }
  .kitchen-actions .button { padding-inline: 8px; font-size: .87rem; }
}

@media (max-width: 520px) {
  .header-inner, .page-shell, .footer-inner { width: calc(100% - 24px); }
  .nav-links a { min-height: 40px; }
  .header-tools .sound-button { padding-inline: 6px; }
  .step-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; margin-block: 16px 11px; }
  .step-grid li { padding: 10px; display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 9px; align-items: center; }
  .step-grid li h2 { margin-bottom: 3px; }
  .step-grid li p { grid-column: 2; }
  .step-icon { grid-row: span 2; width: 35px; height: 35px; margin: 0; font-size: .98rem; }
  .shop-panel { grid-template-columns: minmax(0, 1fr); }
  .shop-art { height: auto; aspect-ratio: 3 / 2; }
  .footer-inner { min-height: 59px; font-size: .78rem; }
  .page-actions .button { padding-inline: 11px; }
  .score-id-fields .button { padding-inline: 8px; }
  .score-table { font-size: .82rem; }
}

@media (max-width: 360px) {
  .brand { font-size: .94rem; gap: 6px; }
  .brand img { width: 31px; height: 31px; }
  html[lang='en'] body[data-view='play'] .brand { font-size: .82rem; letter-spacing: 0; }
  html[lang='en'] .exit-button .icon { display: none; }
  .exit-button { padding-inline: 7px; }
  .header-inner, .page-shell, .footer-inner { width: calc(100% - 16px); }
  .hud-cell { gap: 4px; }
  .hud-icon { width: 26px; height: 26px; }
  .hero-actions .button-primary { font-size: 1rem; }
  .kitchen-actions .button { padding-inline: 6px; }
  .ingredient-card-art { width: 27px; height: 23px; }
  .ingredient-label { font-size: .73rem; }
  .ticket-toppings li .icon { right: 2px; }
  .ticket-toppings[data-count='4'] li { display: grid; grid-template-columns: 15px minmax(0, 1fr); gap: 0 4px; }
  .ticket-toppings[data-count='4'] .requirement-art { grid-area: 2 / 1; width: 15px; height: 14px; }
  .ticket-toppings[data-count='4'] .requirement-text { display: contents; }
  .ticket-toppings[data-count='4'] .requirement-name { grid-area: 1 / 1 / 2 / -1; text-align: center; }
  .ticket-toppings[data-count='4'] .requirement-count { grid-area: 2 / 2; }
}

@media (max-width: 735px) and (max-height: 700px) {
  .cooking-stage { height: 150px; }
  .cooking-stage .dish { width: min(51vw, 192px); }
}

@media (max-width: 390px) and (max-height: 640px) {
  .game-shell { padding-top: 7px; }
  .time-track { margin-block: 4px 6px; }
  .game-grid { gap: 6px; }
  .cooking-stage { height: 123px; }
  .cooking-stage .dish { width: min(46vw, 165px); }
  .topping-button { min-height: 46px; }
  .ingredient-card-art { height: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
