/* Kitchanna — styles
   Warm kitchen palette: cocoa, cream, tomato, butter, basil. Mobile-first,
   portrait, one column. Containers are drawn in CSS and themed per restaurant;
   the art sheets supply ingredients, dishes, characters, décor and VFX. */

:root {
  --cocoa: #2b1a12; --cocoa-2: #3a2419; --cocoa-3: #4d3223;
  --cream: #fff3e0; --cream-dim: #d9c3a5; --cream-2: #f7e6cc;
  --tomato: #e0322e; --tomato-dark: #9c1f1c; --tomato-light: #ff6b5e;
  --butter: #ffcf4d; --butter-dark: #c9962a; --butter-light: #ffe58a;
  --basil: #4caf50; --basil-dark: #2e7d32;
  --sky: #8fd3ff;
  --shadow: rgba(0,0,0,.35);
  --radius: 16px;
  --font-head: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;
  --cw: 64px;   /* container width, set by JS */
  --ih: 44px;   /* item slot height */
  --cols: 5;

  /* Shared jawn.games chrome (hub / help / sound / account), in Kitchanna's cocoa */
  --jawn-chrome-font:     inherit;
  --jawn-chrome-weight:   800;
  --jawn-chrome-bg:       var(--cocoa-2);
  --jawn-chrome-bg-hover: var(--cocoa-3);
  --jawn-chrome-fg:       var(--cream);
  --jawn-chrome-border:   2px solid var(--cocoa-3);
  --jawn-chrome-border-hover: var(--cream-dim);
  --jawn-chrome-shadow:   0 2px 0 var(--shadow);
  --jawn-hub-bg:          var(--tomato);
  --jawn-hub-bg-hover:    var(--tomato-light);
  --jawn-hub-fg:          #fff;
  --jawn-hub-border:      2px solid var(--tomato-light);
  --jawn-hub-shadow:      0 3px 0 var(--tomato-dark);
}
/* Hide the chrome row in the kitchen; the HUD's pause button leads home. */
#game.active ~ #jawn-chrome { display: none; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body {
  font-family: var(--font-body); color: var(--cream);
  background: var(--cocoa);
  background-image:
    radial-gradient(ellipse at 50% -10%, #6b3f2a 0%, transparent 55%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.015) 0 6px, transparent 6px 12px);
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
}
img { -webkit-user-drag: none; user-select: none; pointer-events: none; }
button { font-family: inherit; }
b { font-weight: 800; }

.screen { position: fixed; inset: 0; display: none; flex-direction: column; overflow: hidden; }
.screen.active { display: flex; }
[hidden] { display: none !important; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  border: none; border-radius: 999px; cursor: pointer;
  font-family: var(--font-head); font-weight: 700; letter-spacing: .02em;
  padding: 12px 22px; font-size: 17px; color: var(--cream);
  background: var(--cocoa-3); box-shadow: 0 4px 0 rgba(0,0,0,.35);
  transition: transform .08s, box-shadow .08s, filter .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.btn:disabled { filter: grayscale(.6) brightness(.7); cursor: default; }
.btn-primary { background: linear-gradient(180deg, var(--tomato-light), var(--tomato)); box-shadow: 0 5px 0 var(--tomato-dark); color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.25); }
.btn-primary:active { box-shadow: 0 1px 0 var(--tomato-dark); }
.btn-secondary { background: var(--cocoa-3); color: var(--cream); }
.btn-big { font-size: 21px; padding: 15px 28px; width: 100%; max-width: 360px; }
.btn-icon { width: 26px; height: 26px; }
.btn .cost { font-size: 12px; font-family: var(--font-body); font-weight: 700; opacity: .85; margin-left: 4px; }
.row-2 { display: flex; gap: 10px; width: 100%; max-width: 360px; }
.row-2 .btn { flex: 1; }

/* ── Top bar / pills ─────────────────────────────────────────────────────── */
/* Wallet sits centred between the chrome row's Hub button (left) and its icons (right). */
.topbar {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 6px;
  min-height: calc(48px + env(safe-area-inset-top));
}
.wallet { display: flex; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--cocoa-2); border: 2px solid var(--cocoa-3); border-radius: 999px;
  padding: 4px 10px 4px 6px; font-size: 14px; color: var(--cream);
}
.pill img { width: 22px; height: 22px; }
.pill .star { color: var(--butter); font-size: 16px; }
.pill.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.18); } }

/* ── Home ────────────────────────────────────────────────────────────────── */
.home-body {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 4px 16px calc(16px + env(safe-area-inset-bottom)); overflow-y: auto; width: 100%; max-width: 480px; margin: 0 auto;
}
.brand { text-align: center; line-height: 1; }
.brand-title {
  font-family: var(--font-head); font-weight: 700; font-size: 44px; margin: 0;
  color: var(--butter); text-shadow: 0 3px 0 var(--butter-dark), 0 6px 14px rgba(0,0,0,.45);
  letter-spacing: .01em;
}
.brand-tag { margin: 6px 0 0; color: var(--cream-dim); font-weight: 700; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }

.scene-wrap { width: 100%; border-radius: 20px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.45); border: 3px solid var(--cocoa-3); background: #000; position: relative; }
.scene {
  position: relative; width: 100%; aspect-ratio: 16 / 10;
  --wall: #f4c9a4; --wall-dark: #d9a077; --floor: #b97a4a; --floor-dark: #8f5a33; --sky: #8fd3ff;
  background:
    linear-gradient(180deg, var(--wall) 0%, var(--wall-dark) 62%, var(--floor) 62%, var(--floor-dark) 100%);
  overflow: hidden;
}
.scene.photo { background-size: cover; background-position: center bottom; }
.scene.photo::before, .scene.photo::after { display: none; }
.scene::before { /* wainscot line */
  content: ''; position: absolute; left: 0; right: 0; top: 62%; height: 3px; background: rgba(0,0,0,.18);
}
.scene::after { /* floor sheen */
  content: ''; position: absolute; inset: 62% 0 0 0; background: repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 2px, transparent 2px 28px); pointer-events: none;
}
.scene .deco { position: absolute; transform: translate(-50%, -100%); filter: drop-shadow(0 4px 4px rgba(0,0,0,.25)); }
.scene .deco.tile { left: 0; right: 0; top: 62%; bottom: 0; transform: none; background-size: 25% auto; background-repeat: repeat; opacity: .9; filter: none; }
.scene .deco.pop { animation: popIn .5s cubic-bezier(.2,1.4,.4,1) both; }
.scene .who { position: absolute; transform: translate(-50%, -100%); filter: drop-shadow(0 6px 6px rgba(0,0,0,.3)); }
.scene .who.waitress { animation: sway 3.2s ease-in-out infinite; }
.scene .who.customer { animation: sway 4.1s ease-in-out infinite reverse; }
@keyframes sway { 50% { transform: translate(-50%, -100%) translateY(-3px); } }
.scene .counter { position: absolute; left: 50%; bottom: 3%; width: 46%; transform: translateX(-50%); filter: drop-shadow(0 8px 8px rgba(0,0,0,.35)); }
.scene-plate { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 12px; background: linear-gradient(180deg, transparent, rgba(0,0,0,.65)); display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.rest-name { font-family: var(--font-head); font-size: 18px; font-weight: 700; text-shadow: 0 2px 4px rgba(0,0,0,.6); }
.rest-progress { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; color: var(--cream-2); }
.bar { width: 90px; height: 10px; background: rgba(0,0,0,.45); border-radius: 999px; overflow: hidden; border: 1px solid rgba(255,255,255,.2); }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--butter), var(--butter-light)); border-radius: 999px; transition: width .6s ease; }

.home-row { display: flex; gap: 8px; width: 100%; }
.chip {
  flex: 1; border: 2px solid var(--cocoa-3); background: var(--cocoa-2); color: var(--cream);
  border-radius: 999px; padding: 10px 12px; font-size: 13px; font-weight: 800; cursor: pointer; position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.chip .badge-2x { position: absolute; top: -8px; right: 10px; background: var(--butter); color: var(--cocoa); font-style: normal; font-size: 10px; font-weight: 900; padding: 2px 6px; border-radius: 999px; }
.chip .dot { width: 10px; height: 10px; background: var(--tomato-light); border-radius: 50%; box-shadow: 0 0 0 3px var(--cocoa-2); position: absolute; top: -3px; right: 10px; }
.chip.done { border-color: var(--basil); }
.home-nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
.home-nav button {
  border: 2px solid var(--cocoa-3); background: var(--cocoa-2); border-radius: 14px; padding: 8px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--cream); cursor: pointer; font-size: 11px; font-weight: 800;
}
.home-nav button img { width: 40px; height: 40px; object-fit: contain; }
.home-nav button:active { transform: translateY(2px); }
/* build version: tiny, out of the layout flow, so deploys can be confirmed at a glance */
.build-ver { position: absolute; right: 8px; bottom: calc(4px + env(safe-area-inset-bottom)); font-size: 9px; font-weight: 700; letter-spacing: .04em; color: var(--cream-dim); opacity: .45; pointer-events: none; }

/* ── Game HUD ────────────────────────────────────────────────────────────── */
#game { background: var(--cocoa); }
/* Painted room behind the board. Its own element on its own compositing layer
   (z-index -1 inside #game's stacking context), so moves never re-raster it and
   no sibling's positioning is touched. */
.game-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; display: none;
  background-color: var(--cocoa); background-size: cover; background-position: center top; background-repeat: no-repeat;
  will-change: transform; }
.game-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,10,6,.62) 0%, rgba(20,10,6,.28) 30%, rgba(20,10,6,.2) 100%); }
#game.has-bg .game-bg { display: block; }
#game.has-bg .board::before { opacity: .38; }
#game.has-bg .hud { background: linear-gradient(180deg, rgba(20,10,6,.55), rgba(20,10,6,0)); }
#game.has-bg .boosters { background: linear-gradient(0deg, rgba(20,10,6,.6), rgba(20,10,6,0)); }
#game[data-theme="cart"]   { --counter: #b97a4a; --counter-dark: #8f5a33; --edge: #d9a077; }
#game[data-theme="cafe"]   { --counter: #6d8a6c; --counter-dark: #4c6b4c; --edge: #c9a06a; }
#game[data-theme="pizza"]  { --counter: #b9463a; --counter-dark: #85302a; --edge: #f1d3a5; }
#game[data-theme="sushi"]  { --counter: #2f5079; --counter-dark: #1f3a5f; --edge: #e2d3b3; }
#game[data-theme="bakery"] { --counter: #d98ea3; --counter-dark: #b56b83; --edge: #fbe6ee; }
#game[data-theme="fine"]   { --counter: #4a3a5d; --counter-dark: #2e2340; --edge: #c9b8e0; }
#game[data-theme="endless"]{ --counter: #4d3223; --counter-dark: #2b1a12; --edge: #d9c3a5; }
.hud {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 4px;
}
.hud-btn { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--cocoa-3); background: var(--cocoa-2); color: var(--cream); font-size: 13px; cursor: pointer; }
.hud-mid { text-align: center; }
.hud-level { font-family: var(--font-head); font-size: 17px; font-weight: 700; }
.hud-moves { font-size: 12px; color: var(--cream-dim); font-weight: 800; }
.hud-moves.over { color: var(--tomato-light); }
.hud-right { min-width: 38px; display: flex; justify-content: flex-end; }
.hud-timer { display: flex; align-items: center; gap: 4px; background: var(--cocoa-2); border: 2px solid var(--cocoa-3); border-radius: 999px; padding: 3px 10px 3px 4px; font-size: 15px; }
.hud-timer img { width: 24px; height: 24px; }
.hud-timer.low { border-color: var(--tomato); animation: pulse .6s infinite; }
.hud-fuse { background: #4a1d10; border: 2px solid var(--tomato-dark); border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 800; color: var(--butter-light); }
.hud-fuse.low { animation: pulse .5s infinite; border-color: var(--tomato-light); }
@keyframes pulse { 50% { transform: scale(1.08); } }

/* ── Order strip ─────────────────────────────────────────────────────────── */
.order {
  display: flex; align-items: center; gap: 8px; margin: 4px 12px 0; padding: 6px 10px;
  background: var(--cream); color: var(--cocoa); border-radius: 18px; box-shadow: 0 4px 0 rgba(0,0,0,.25);
  position: relative;
}
.customer { position: relative; width: 74px; height: 74px; flex: none; }
.customer img { width: 100%; height: 100%; object-fit: contain; object-position: bottom; transition: transform .2s; }
.customer.swap img { animation: swapIn .35s ease; }
@keyframes swapIn { 0% { transform: scale(.7); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.bubble { position: absolute; left: 60px; top: -6px; background: #fff; border-radius: 12px; padding: 4px 8px; font-size: 11px; font-weight: 800; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.2); z-index: 2; }
.bubble::after { content: ''; position: absolute; left: -6px; bottom: 6px; border: 6px solid transparent; border-right-color: #fff; border-left: 0; }
.order-card { flex: 1; min-width: 0; }
.order-kicker { font-size: 10px; letter-spacing: .14em; font-weight: 900; color: var(--tomato); }
.order-name { font-family: var(--font-head); font-size: 19px; font-weight: 700; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-ings { display: flex; gap: 3px; margin-top: 4px; flex-wrap: wrap; }
.order-ings .oi { width: 26px; height: 26px; position: relative; opacity: .55; transition: opacity .3s, transform .3s; }
.order-ings .oi img { width: 100%; height: 100%; object-fit: contain; }
.order-ings .oi.done { opacity: 1; transform: scale(1.1); }
.order-ings .oi.done::after { content: '✓'; position: absolute; right: -4px; bottom: -4px; background: var(--basil); color: #fff; border-radius: 50%; width: 13px; height: 13px; font-size: 9px; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.order-dish { width: 58px; height: 58px; flex: none; }
.order-dish img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }

/* ── Board / containers ──────────────────────────────────────────────────── */
.board {
  flex: 1; display: flex; flex-wrap: wrap; align-content: center; justify-content: center;
  gap: 22px 10px; padding: 14px 10px 10px; position: relative;
  min-height: 0;
}
.board::before { /* the counter surface */
  content: ''; position: absolute; left: 8px; right: 8px; bottom: 6px; top: 8px;
  background: linear-gradient(180deg, var(--counter, #6a4530) 0%, var(--counter-dark, #4a2f20) 100%);
  border-radius: 22px; border: 3px solid var(--edge, #d9a077); opacity: .55; z-index: 0;
}
.cont {
  position: relative; width: var(--cw); height: var(--ch, calc(var(--ih) * 4 + 22px));
  display: flex; flex-direction: column-reverse; align-items: center; padding: 0 0 calc(var(--ch, 160px) * 0.075);
  cursor: pointer; z-index: 1; transition: transform .15s;
  contain: layout style;   /* a move only re-lays-out the two vessels it touches */
}
/* The painted vessel interior; ingredients sit inside it. No filters anywhere on
   the board: drop-shadow on ~45 images was re-rasterised on every move. */
.cont .vback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; z-index: 0; }
.cont::before { content: ''; position: absolute; left: 4%; right: 4%; bottom: -7px; height: 16px; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at 50% 40%, rgba(0,0,0,.5) 0%, rgba(0,0,0,.22) 45%, rgba(0,0,0,0) 72%); }
.cont::after { content: ''; position: absolute; inset: -6% -18%; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(ellipse at 50% 55%, rgba(255,207,77,.75) 0%, rgba(255,207,77,.35) 40%, rgba(255,207,77,0) 68%); }
.cont.complete::after { opacity: 1; }
.cont.t-jar .vback { opacity: .96; }
.cont .items { position: relative; z-index: 2; display: flex; flex-direction: column-reverse; align-items: center; width: 100%; }
.item {
  width: calc(var(--cw) - 12px); height: var(--ih); display: flex; align-items: center; justify-content: center;
  flex: none; position: relative;
}
.item img { width: min(calc(var(--ih) + 4px), calc(var(--cw) - 12px)); height: calc(var(--ih) + 4px); object-fit: contain; }
.item.hidden-item img { opacity: .92; }
.item.ghost { visibility: hidden; }
.item.landed img { animation: land .28s cubic-bezier(.2,1.6,.4,1); }
@keyframes land { 0% { transform: scale(1.25, .8); } 60% { transform: scale(.92, 1.1); } 100% { transform: scale(1); } }
.cont.selected { transform: translateY(-6px); }
.cont.selected .lift { transform: translateY(-34px) scale(1.06); }
.cont .lift { transition: transform .16s cubic-bezier(.2,1.2,.4,1); }
.cont.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-5px) rotate(-2deg); } 75% { transform: translateX(5px) rotate(2deg); } }
.cont.complete { cursor: default; }
.cont .check { position: absolute; top: -18px; right: -12px; width: 34px; height: 34px; z-index: 5; animation: popIn .45s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes popIn { 0% { transform: scale(0); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
/* hint: warm glow behind the vessel (reuses the ::after glow layer) + a bouncing arrow */
.cont.hint-target::after { opacity: 1; animation: hintGlow .9s ease-in-out infinite alternate;
  background: radial-gradient(ellipse at 50% 55%, rgba(255,236,160,.6) 0%, rgba(255,207,77,.28) 42%, rgba(255,207,77,0) 66%); }
@keyframes hintGlow { from { opacity: .45; } to { opacity: 1; } }
.cont .hint-arrow { position: absolute; left: 50%; top: -34px; width: 34px; height: 34px; margin-left: -17px; z-index: 6; pointer-events: none;
  border-radius: 50%; background: var(--butter); box-shadow: 0 3px 0 var(--butter-dark), 0 6px 10px rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center; animation: hintBob .6s ease-in-out infinite alternate; }
.cont .hint-arrow svg { width: 22px; height: 22px; fill: none; stroke: var(--cocoa); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
@keyframes hintBob { from { transform: translateY(-4px); } to { transform: translateY(4px); } }
@keyframes ringPulse { from { transform: translate(-50%, -50%) scale(.95); opacity: .7; } to { transform: translate(-50%, -50%) scale(1.08); opacity: 1; } }

/* twists */
.cont.frozen .ice { position: absolute; inset: -4px; z-index: 4; display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg, rgba(190,235,255,.55), rgba(120,190,240,.65)); border-radius: 10px 10px 22px 22px; border: 2px solid rgba(255,255,255,.7); }
.cont.frozen .ice img { width: 70%; }
.cont.frozen .ice .ice-n { position: absolute; bottom: 6px; right: 6px; background: #1b6fa8; color: #fff; font-weight: 900; font-size: 12px; border-radius: 999px; padding: 1px 7px; }
.cont.thaw .ice { animation: crack .35s ease both; }
@keyframes crack { 30% { transform: scale(1.06) rotate(-2deg); } 100% { opacity: 0; transform: scale(1.2); } }
.cont.locked .lock { position: absolute; inset: -4px; z-index: 4; display: flex; align-items: center; justify-content: center; background: rgba(40,20,10,.7); border-radius: 10px 10px 22px 22px; }
.cont.locked .lock img { width: 78%; }
.cont.unlocking .lock { animation: crack .45s ease both; }
.cont.stacked .plates { position: absolute; bottom: -14px; left: 50%; transform: translateX(-50%); width: 110%; z-index: 3; }
.cont.stacked .vback { opacity: .8; }
.cont.burning { transform: translateY(-4px); }
.cont.burning .stove { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); width: 120%; z-index: 0; }
.cont.burning .flames { position: absolute; left: 0; right: 0; bottom: -8px; height: 26px; z-index: 3; pointer-events: none; }
.cont.burning .flames img { position: absolute; bottom: 0; width: 22px; height: 30px; object-fit: contain; object-position: bottom; transform-origin: 50% 100%; animation: flame .35s ease-in-out infinite alternate; }
.cont.burning .flames img:nth-child(1) { left: 6%; animation-delay: .1s; }
.cont.burning .flames img:nth-child(2) { left: 36%; height: 38px; width: 26px; }
.cont.burning .flames img:nth-child(3) { left: 66%; animation-delay: .2s; }
@keyframes flame { from { transform: scaleY(.82) scaleX(.94) translateY(2px); opacity: .85; } to { transform: scaleY(1.12); opacity: 1; } }
.cont.burning.low .flames img { animation-duration: .18s; }
.cont.extra .vback { opacity: .88; }

/* ── Boosters bar ────────────────────────────────────────────────────────── */
.boosters {
  display: flex; justify-content: center; gap: 12px; padding: 6px 12px calc(12px + env(safe-area-inset-bottom));
}
.booster {
  position: relative; width: 70px; border: none; background: var(--cocoa-2); border-radius: 16px; padding: 6px 4px 5px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; color: var(--cream-dim);
  box-shadow: 0 4px 0 rgba(0,0,0,.35); border: 2px solid var(--cocoa-3);
}
.booster:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.35); }
.booster img { width: 40px; height: 40px; object-fit: contain; }
.bst-label { font-size: 10px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.bst-count { position: absolute; top: -8px; right: -6px; background: var(--basil); color: #fff; font-style: normal; font-weight: 900; font-size: 11px; min-width: 20px; height: 20px; border-radius: 999px; display: flex; align-items: center; justify-content: center; padding: 0 5px; border: 2px solid var(--cocoa); }
.bst-count.zero { background: var(--butter); color: var(--cocoa); }
.booster.busy { animation: pulse .6s infinite; }
.booster:disabled { opacity: .5; }

/* ── FX layer ────────────────────────────────────────────────────────────── */
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 400; overflow: hidden; }
.fx-layer .fly { position: absolute; width: calc(var(--ih) + 4px); height: calc(var(--ih) + 4px); object-fit: contain; }
.fx-layer .spark { position: absolute; width: 60px; height: 60px; object-fit: contain; animation: sparkOut .7s ease-out both; }
@keyframes sparkOut { 0% { transform: scale(.4) rotate(0deg); opacity: 0; } 30% { opacity: 1; } 100% { transform: scale(1.4) rotate(25deg); opacity: 0; } }
.fx-layer .float-text { position: absolute; font-family: var(--font-head); font-weight: 700; font-size: 20px; color: var(--butter-light); text-shadow: 0 2px 0 var(--cocoa), 0 0 12px rgba(0,0,0,.5); animation: floatUp 1s ease-out both; white-space: nowrap; }
@keyframes floatUp { 0% { transform: translateY(0) scale(.8); opacity: 0; } 20% { opacity: 1; transform: translateY(-10px) scale(1.1); } 100% { transform: translateY(-60px) scale(1); opacity: 0; } }
.fx-layer .coin { position: absolute; width: 30px; height: 30px; object-fit: contain; will-change: transform; }

/* coach marks */
.coach { position: absolute; z-index: 40; pointer-events: none; display: flex; flex-direction: column; align-items: center; }
.coach-hand { font-size: 40px; animation: tapTap .9s ease-in-out infinite; filter: drop-shadow(0 4px 4px rgba(0,0,0,.5)); }
@keyframes tapTap { 50% { transform: translateY(-12px) scale(.92); } }
.coach-text { background: var(--cream); color: var(--cocoa); font-weight: 800; font-size: 13px; padding: 6px 12px; border-radius: 12px; max-width: 220px; text-align: center; box-shadow: 0 4px 10px rgba(0,0,0,.4); }

/* ── Overlays / cards / panels ───────────────────────────────────────────── */
.overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: rgba(20,10,6,.8); padding: 16px; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.card { background: var(--cream); color: var(--cocoa); border-radius: 24px; padding: 22px 20px; width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; gap: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.5); animation: cardIn .3s cubic-bezier(.2,1.3,.4,1); }
@keyframes cardIn { from { transform: translateY(30px) scale(.95); opacity: 0; } }
.card-title { font-family: var(--font-head); font-size: 30px; font-weight: 700; }
.card-text { margin: 0; text-align: center; color: #6b4a3a; font-weight: 700; line-height: 1.4; }
.results-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.fail-img { width: 120px; height: 120px; object-fit: contain; animation: wobble 1.2s ease-in-out infinite; }
@keyframes wobble { 50% { transform: rotate(3deg) translateY(-3px); } }

.panel { align-items: flex-end; padding: 0; }
.panel-card { background: var(--cream); color: var(--cocoa); width: 100%; max-width: 520px; max-height: 92vh; border-radius: 24px 24px 0 0; display: flex; flex-direction: column; animation: slideUp .3s cubic-bezier(.2,1.1,.4,1); margin: 0 auto; }
@keyframes slideUp { from { transform: translateY(60px); opacity: 0; } }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 8px; }
.panel-head h2 { flex: 1; margin: 0; font-family: var(--font-head); font-size: 26px; font-weight: 700; }
.panel-close { width: 34px; height: 34px; border-radius: 50%; border: none; background: rgba(0,0,0,.08); font-size: 16px; cursor: pointer; color: var(--cocoa); }
.panel-head .pill { background: #fff; border-color: #e8d7bf; color: var(--cocoa); }
.panel-body { overflow-y: auto; padding: 8px 18px calc(24px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.tabs { display: flex; gap: 6px; padding: 0 18px 8px; }
.tabs button { flex: 1; border: 2px solid #e8d7bf; background: #fff; border-radius: 999px; padding: 8px; font-weight: 900; color: #8a6a55; cursor: pointer; }
.tabs button.on { background: var(--cocoa); color: var(--cream); border-color: var(--cocoa); }

/* how to */
.howto-step { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.howto-step img { width: 64px; height: 64px; object-fit: contain; flex: none; }
.howto-step h3, .howto-h { margin: 0 0 2px; font-family: var(--font-head); font-size: 18px; font-weight: 700; }
.howto-step p { margin: 0; font-size: 14px; line-height: 1.45; color: #5a3f30; font-weight: 600; }
.howto-h { margin: 16px 0 8px; }
.howto-twists { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.howto-twists li { display: flex; gap: 10px; align-items: center; background: #fff; border-radius: 14px; padding: 8px 10px; font-size: 13px; color: #5a3f30; font-weight: 600; }
.howto-twists img { width: 40px; height: 40px; object-fit: contain; flex: none; }
.howto-foot { font-size: 12px; color: #8a6a55; margin: 16px 0 0; font-weight: 700; }
.howto-foot a { color: var(--tomato); }

/* shop */
.shop-group { margin-bottom: 14px; }
.shop-group h3 { margin: 6px 0 8px; font-family: var(--font-head); font-size: 17px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.shop-group h3 small { font-size: 11px; color: #8a6a55; font-family: var(--font-body); font-weight: 800; }
.shop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.shop-item { background: #fff; border-radius: 16px; padding: 8px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; border: 2px solid #eadbc4; }
.shop-item img { width: 56px; height: 56px; object-fit: contain; }
.shop-item .si-name { font-size: 11px; font-weight: 900; line-height: 1.15; min-height: 26px; display: flex; align-items: center; }
.shop-item .si-charm { font-size: 10px; color: #8a6a55; font-weight: 800; }
.shop-item button { border: none; border-radius: 999px; background: var(--butter); color: var(--cocoa); font-weight: 900; font-size: 12px; padding: 5px 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.shop-item button img { width: 16px; height: 16px; }
.shop-item button:disabled { background: #e8d7bf; color: #a08a76; cursor: default; }
.shop-item.owned { border-color: var(--basil); }
.shop-item.owned button { background: var(--basil); color: #fff; }
.shop-item.locked { opacity: .55; }
.shop-item .si-desc { font-size: 10px; color: #8a6a55; font-weight: 700; }
.shop-item .si-own { font-size: 10px; color: var(--basil-dark); font-weight: 900; }

/* map */
.map-item { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: 18px; padding: 10px 12px; margin-bottom: 10px; border: 2px solid #eadbc4; }
.map-item img { width: 72px; height: 72px; object-fit: contain; flex: none; }
.map-item.current { border-color: var(--butter); box-shadow: 0 0 0 3px rgba(255,207,77,.35); }
.map-item.lockedr { opacity: .6; filter: grayscale(.5); }
.map-item .mi-name { font-family: var(--font-head); font-size: 18px; font-weight: 700; }
.map-item .mi-tag { font-size: 12px; color: #8a6a55; font-weight: 700; }
.map-item .mi-bar { margin-top: 6px; display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 900; color: #5a3f30; }
.map-item .bar { background: #eadbc4; }
.map-item .mi-stars { font-size: 12px; color: var(--butter-dark); font-weight: 900; }
.map-item button { margin-left: auto; }

/* events */
.event-card { background: #fff; border-radius: 18px; padding: 12px 14px; margin-bottom: 10px; border: 2px solid #eadbc4; }
.event-card .ev-head { display: flex; align-items: center; gap: 8px; }
.event-card .ev-name { font-family: var(--font-head); font-size: 19px; font-weight: 700; flex: 1; }
.event-card .ev-days { font-size: 11px; font-weight: 900; color: var(--tomato); }
.event-card p { margin: 6px 0 8px; font-size: 13px; color: #5a3f30; font-weight: 600; line-height: 1.4; }
.event-card .ev-levels { display: flex; gap: 6px; margin-bottom: 8px; }
.event-card .ev-levels i { flex: 1; height: 10px; border-radius: 999px; background: #eadbc4; }
.event-card .ev-levels i.done { background: var(--basil); }
.event-card .ev-reward { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; color: #5a3f30; }
.event-card .ev-reward img { width: 40px; height: 40px; object-fit: contain; }
.event-card.past { opacity: .6; }
.event-card .ev-actions { margin-top: 8px; }
.event-empty { text-align: center; color: #8a6a55; font-weight: 700; padding: 20px 0; }

/* leaderboard */
.lb-blurb { margin: 0 0 8px; font-size: 13px; color: #8a6a55; font-weight: 700; }
.leaderboard { background: #fff; border-radius: 18px; padding: 10px 12px; border: 2px solid #eadbc4; }
.lb-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.lb-title { font-weight: 900; font-size: 13px; letter-spacing: .08em; }
.lb-rank { font-size: 12px; font-weight: 900; color: var(--tomato); }
.lb-list { list-style: none; margin: 0; padding: 0; }
.lb-list li { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid #f2e6d3; font-size: 14px; font-weight: 700; }
.lb-list li.me { background: #fff6dc; border-radius: 8px; }
.lb-pos { width: 24px; color: #8a6a55; font-weight: 900; }
.lb-name { flex: 1; }
.lb-score { font-weight: 900; color: var(--butter-dark); }
.lb-loading, .lb-empty { color: #8a6a55; justify-content: center; }
.lb-footer { font-size: 12px; margin-top: 8px; color: #5a3f30; font-weight: 700; text-align: center; }
.lb-footer a { color: var(--tomato); }
.lb-edit { border: none; background: none; cursor: pointer; font-size: 12px; color: #8a6a55; }
.lb-nick-form { display: flex; gap: 6px; justify-content: center; }
.lb-nick-input { border: 2px solid #eadbc4; border-radius: 999px; padding: 6px 10px; font-family: inherit; font-weight: 800; width: 140px; }
.lb-nick-save { border: none; background: var(--cocoa); color: var(--cream); border-radius: 999px; padding: 6px 12px; font-weight: 900; cursor: pointer; }

/* ── Cook → plate → serve ────────────────────────────────────────────────── */
.cook { background: var(--cocoa); flex-direction: column; justify-content: flex-start; padding: 0; overflow-y: auto; height: 100vh; height: 100dvh; }
.cook-bg { position: absolute; inset: 0; pointer-events: none; background-color: var(--cocoa); background-size: cover; background-position: center top; }
.cook-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,10,6,.72) 0%, rgba(20,10,6,.5) 45%, rgba(20,10,6,.8) 100%); }
.cook-stage { position: relative; width: 100%; max-width: 480px; height: 46vh; height: 46dvh; min-height: 260px; flex: none; overflow: hidden; transition: height .4s ease, min-height .4s ease; }
.cook.results-open .cook-stage { height: 32vh; height: 32dvh; min-height: 200px; }
.cook-title { position: absolute; top: 22px; left: 0; right: 0; text-align: center; font-family: var(--font-head); font-size: 26px; font-weight: 700; color: var(--butter-light); text-shadow: 0 3px 0 var(--butter-dark); opacity: 0; transition: opacity .3s; }
.cook-title.show { opacity: 1; }
.cook-vessel { position: absolute; left: 50%; top: 50%; width: 180px; height: 180px; object-fit: contain; transform: translate(-50%, -40%) scale(0); filter: drop-shadow(0 10px 10px rgba(0,0,0,.5)); }
.cook-vessel.in { animation: vesselIn .5s cubic-bezier(.2,1.4,.4,1) forwards; }
@keyframes vesselIn { to { transform: translate(-50%, -40%) scale(1); } }
.cook-vessel.cooking { animation: cookShake .12s ease-in-out infinite; transform: translate(-50%, -40%) scale(1); }
@keyframes cookShake { 0%, 100% { transform: translate(-50%, -40%) scale(1) rotate(-1.5deg); } 50% { transform: translate(-50%, -40%) scale(1.02) rotate(1.5deg); } }
.cook-vessel.out { animation: vesselOut .4s ease-in forwards; }
@keyframes vesselOut { to { transform: translate(-50%, -40%) scale(0); opacity: 0; } }
.cook-steam { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.cook-steam img { position: absolute; width: 70px; height: 70px; left: -35px; top: -110px; opacity: 0; animation: steamUp 1.4s ease-out infinite; }
.cook-steam img:nth-child(2) { animation-delay: .45s; left: -60px; }
.cook-steam img:nth-child(3) { animation-delay: .9s; left: -10px; }
@keyframes steamUp { 0% { transform: translateY(20px) scale(.5); opacity: 0; } 30% { opacity: .9; } 100% { transform: translateY(-90px) scale(1.3); opacity: 0; } }
.cook-burst { position: absolute; left: 50%; top: 50%; width: 260px; height: 260px; object-fit: contain; transform: translate(-50%, -50%) scale(0); opacity: 0; }
.cook-burst.go { animation: burst .7s ease-out forwards; }
@keyframes burst { 0% { transform: translate(-50%, -50%) scale(.2); opacity: 0; } 30% { opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; } }
.cook-ring { position: absolute; left: 50%; top: 50%; width: 220px; height: 220px; object-fit: contain; transform: translate(-50%, -50%) scale(.6); opacity: 0; }
.cook-ring.go { animation: ringIn .9s ease-out forwards; }
@keyframes ringIn { 0% { transform: translate(-50%, -50%) scale(.4) rotate(0); opacity: 0; } 40% { opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1.3) rotate(30deg); opacity: 0; } }
.cook-plate { position: absolute; left: 50%; top: 50%; width: 150px; height: 150px; transform: translate(-50%, -50%) scale(0); z-index: 4; }
.cook-plate::before { content: ''; position: absolute; left: 5%; right: 5%; top: 40%; bottom: 5%; border-radius: 50%; background: radial-gradient(ellipse at 50% 40%, #fff 0%, #e6e0d6 60%, #c9c0b2 100%); box-shadow: 0 10px 14px rgba(0,0,0,.45); }
.cook-plate img { position: absolute; left: 50%; top: 50%; width: 120px; height: 120px; object-fit: contain; transform: translate(-50%, -55%); filter: drop-shadow(0 6px 6px rgba(0,0,0,.4)); }
.cook-plate.in { animation: plateIn .55s cubic-bezier(.2,1.5,.4,1) forwards; }
@keyframes plateIn { to { transform: translate(-50%, -50%) scale(1); } }
.cook-plate.serve { transition: transform .9s cubic-bezier(.4,0,.2,1); }
.cook-waitress { position: absolute; left: 1%; bottom: 0; width: 42%; height: 92%; object-fit: contain; object-position: left bottom; filter: drop-shadow(0 8px 8px rgba(0,0,0,.5)); translate: -130vw 0; transition: translate .9s cubic-bezier(.4,0,.2,1); will-change: translate; z-index: 3; }
.cook-waitress.in { translate: 0 0; }
.cook-waitress.walk { animation: bob .35s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-5px); } }
.cook-customer { position: absolute; right: 1%; bottom: 0; width: 44%; height: 80%; object-fit: contain; object-position: right bottom; filter: drop-shadow(0 8px 8px rgba(0,0,0,.5)); translate: 130vw 0; transition: translate .6s cubic-bezier(.2,1.2,.4,1); will-change: translate; z-index: 1; }
.cook-customer.in { translate: 0 0; }
.cook-sparkles { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.cook-customer.bounce { animation: bounceIn .6s cubic-bezier(.2,1.5,.4,1); }
@keyframes bounceIn { 0% { transform: scale(.85); } 100% { transform: scale(1); } }
.cook-sparkles img { position: absolute; width: 70px; height: 70px; object-fit: contain; animation: sparkOut .9s ease-out both; }
.cook-sparkles img.heart { width: 60px; height: 60px; animation: heartUp 1.4s ease-out both; }
@keyframes heartUp { 0% { transform: translateY(10px) scale(.4); opacity: 0; } 25% { opacity: 1; transform: translateY(-10px) scale(1.1); } 100% { transform: translateY(-70px) scale(.9); opacity: 0; } }

.results { width: 100%; max-width: 420px; flex: none; background: var(--cream); color: var(--cocoa); border-radius: 26px 26px 0 0; padding: 14px 20px calc(16px + env(safe-area-inset-bottom)); margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; animation: slideUp .4s cubic-bezier(.2,1.2,.4,1); }
@media (max-height: 760px) { .results-kicker { font-size: 24px; } .results-stars { font-size: 38px; } .results .btn-big { padding: 12px 24px; font-size: 19px; } .rrow { font-size: 13px; } }
.results-kicker { font-family: var(--font-head); font-size: 28px; font-weight: 700; letter-spacing: .04em; color: var(--tomato); }
.results-stars { display: flex; gap: 10px; font-size: 46px; line-height: 1; }
.rstar { color: #d9cbb5; transition: none; }
.rstar.on { color: var(--butter); text-shadow: 0 3px 0 var(--butter-dark), 0 0 18px rgba(255,207,77,.6); animation: starPop .5s cubic-bezier(.2,1.6,.4,1); }
@keyframes starPop { 0% { transform: scale(0) rotate(-30deg); } 100% { transform: scale(1) rotate(0); } }
.results-rows { width: 100%; max-width: 300px; display: flex; flex-direction: column; gap: 4px; font-weight: 800; color: #5a3f30; }
.rrow { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.rrow span { display: flex; align-items: center; gap: 5px; }
.rrow img { width: 20px; height: 20px; }
.rrow.total { border-top: 2px dashed #e0cfb5; padding-top: 6px; margin-top: 2px; font-size: 18px; color: var(--cocoa); }
.results-note { font-size: 12px; font-weight: 800; color: var(--basil-dark); min-height: 14px; text-align: center; }

/* splash */
.splash-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; max-width: 360px; animation: cardIn .4s cubic-bezier(.2,1.3,.4,1); }
.splash-inner img { width: 200px; height: 200px; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(0,0,0,.5)); animation: float 2.4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }
.splash-kicker { font-size: 12px; letter-spacing: .18em; font-weight: 900; color: var(--butter); }
.splash-title { font-family: var(--font-head); font-size: 34px; font-weight: 700; }
.splash-text { margin: 0 0 8px; color: var(--cream-dim); font-weight: 700; line-height: 1.4; }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--cream); color: var(--cocoa); font-weight: 800; font-size: 14px; padding: 10px 16px; border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,.5); z-index: 300; animation: toastIn .25s ease; max-width: 90vw; text-align: center; }
@keyframes toastIn { from { transform: translateX(-50%) translateY(10px); opacity: 0; } }

/* auth badge (shared auth-ui.js) */
.auth-icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--cocoa-3); background: var(--cocoa-2); color: var(--cream); font-size: 13px; font-weight: 800; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.auth-dropdown { position: absolute; top: 40px; right: 0; min-width: 180px; background: var(--cocoa-2); border: 2px solid var(--cocoa-3); border-radius: 14px; box-shadow: 0 4px 16px var(--shadow); padding: 6px 0; z-index: 201; }
.auth-dropdown-email { padding: 8px 14px; font-size: 11px; color: var(--cream-dim); border-bottom: 1px solid var(--cocoa-3); word-break: break-all; }
.auth-dropdown-item { display: block; width: 100%; padding: 8px 14px; font-size: 12px; color: var(--cream); font-family: inherit; background: none; border: none; text-decoration: none; text-align: left; cursor: pointer; }
.auth-dropdown-item:hover { background: var(--cocoa-3); }

/* ── Small / large screens ───────────────────────────────────────────────── */
@media (max-height: 680px) {
  .brand-title { font-size: 34px; }
  .home-body { gap: 8px; }
  .customer { width: 60px; height: 60px; }
  .order-dish { width: 46px; height: 46px; }
  .booster img { width: 32px; height: 32px; }
}
@media (min-width: 600px) {
  #game { left: 50%; right: auto; width: 520px; margin-left: -260px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── Prep phase ──────────────────────────────────────────────────────────── */
.prep { background: rgba(20,10,6,.84); padding: 12px; }
.prep-chef { position: absolute; right: 4px; top: -66px; height: 96px; z-index: 3; filter: drop-shadow(0 4px 4px rgba(0,0,0,.4)); pointer-events: none; animation: bob 3s ease-in-out infinite; }
.results { position: relative; }
.prep-card { position: relative; background: var(--cream); color: var(--cocoa); border-radius: 26px; width: 100%; max-width: 420px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; box-shadow: 0 16px 40px rgba(0,0,0,.5); animation: cardIn .3s cubic-bezier(.2,1.3,.4,1); }
.prep-head { width: 100%; display: flex; align-items: center; justify-content: space-between; min-height: 40px; }
.prep-kicker { font-size: 10px; letter-spacing: .14em; font-weight: 900; color: var(--tomato); }
.prep-recipe { font-family: var(--font-head); font-size: 17px; font-weight: 700; }
.prep-dots { display: flex; gap: 6px; }
.prep-dots i { width: 12px; height: 12px; border-radius: 50%; background: #e8d7bf; }
.prep-dots i.on { background: var(--butter); box-shadow: 0 0 0 3px rgba(255,207,77,.35); }
.prep-dots i.done { background: var(--basil); }
.prep-title { font-family: var(--font-head); font-size: 24px; font-weight: 700; text-align: center; line-height: 1.1; }
.prep-stage { position: relative; width: 100%; aspect-ratio: 1 / 1; max-height: 52vh; border-radius: 22px; background: radial-gradient(ellipse at 50% 30%, #fff8ec, #efdcc0 90%); border: 3px solid #eadbc4; overflow: hidden; touch-action: none; cursor: pointer; user-select: none; }
.prep-stage img { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none; object-fit: contain; }  /* never distort a sprite */
.psurface { width: 84%; top: 58%; filter: drop-shadow(0 8px 8px rgba(0,0,0,.25)); }
.pitem { width: 46%; z-index: 2; filter: drop-shadow(0 6px 5px rgba(0,0,0,.3)); transition: top .25s, width .25s; }
.ptool { width: 34%; z-index: 4; filter: drop-shadow(0 8px 8px rgba(0,0,0,.35)); transition: transform .12s; will-change: transform, translate; }
.pfxlayer { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.pfxlayer .pfx { z-index: 5; }
.pfxlayer .spark { animation: sparkOut .8s ease-out both; }
.pfxlayer .hit { animation: hitOut .4s ease-out both; z-index: 7; }
@keyframes hitOut { 0% { transform: scale(.3) rotate(-10deg); opacity: 1; } 100% { transform: scale(1.25) rotate(15deg); opacity: 0; } }
.pfxlayer .badge { animation: badgeIn .9s cubic-bezier(.2,1.5,.4,1) both; z-index: 9; }
@keyframes badgeIn { 0% { transform: scale(.2) rotate(-8deg); opacity: 0; } 30% { transform: scale(1.08) rotate(2deg); opacity: 1; } 75% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.05) translateY(-10px); opacity: 0; } }
.pfxlayer .splashfx { animation: splashOut .7s ease-out both; z-index: 7; }
@keyframes splashOut { 0% { transform: scale(.3); opacity: 0; } 30% { transform: scale(1.05); opacity: 1; } 100% { transform: scale(1.2) translateY(-8px); opacity: 0; } }
.pfxlayer .lines { animation: linesOut .35s ease-out both; z-index: 6; }
.pfxlayer .lines.flip { transform: scaleX(-1); }
@keyframes linesOut { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }
.pfxlayer .puff { animation: puffOut .7s ease-out both; }
@keyframes puffOut { 0% { transform: translate(-50%,-50%) scale(.3); opacity: 0; } 25% { opacity: .95; } 100% { transform: translate(-50%,-80%) scale(1.3); opacity: 0; } }
.pfxlayer .steam { animation: steamUp 1.2s ease-out both; }
.pfxlayer .ppile { z-index: 2; transition: transform .18s cubic-bezier(.2,1.4,.4,1); filter: drop-shadow(0 4px 4px rgba(0,0,0,.25)); }
.pfxlayer .pstream { width: 12%; left: 42% !important; top: 46% !important; transform-origin: 50% 0; transform: translateX(-50%) scaleY(.5); z-index: 3; }
.pfxlayer .pdrag { z-index: 8; left: 0 !important; top: 0 !important; filter: drop-shadow(0 12px 10px rgba(0,0,0,.4)); transition: none; will-change: translate; }
.pfxlayer .pplaced { position: absolute; left: 50%; top: 44%; width: 0; height: 0; }
.pfxlayer .player { z-index: 4; filter: drop-shadow(0 3px 3px rgba(0,0,0,.25)); }
.pstar { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; background: var(--butter-light); clip-path: polygon(50% 0, 62% 38%, 100% 38%, 69% 60%, 80% 100%, 50% 75%, 20% 100%, 31% 60%, 0 38%, 38% 38%); animation: starOut .45s ease-out both; z-index: 6; }
@keyframes starOut { 0% { transform: scale(.3) rotate(0); opacity: 1; } 100% { transform: scale(1.8) rotate(40deg); opacity: 0; } }
.pmeter { position: absolute; left: 12%; right: 12%; bottom: 10px; height: 14px; background: rgba(0,0,0,.15); border-radius: 999px; overflow: hidden; z-index: 6; }
.pmeter .pzone { position: absolute; top: 0; bottom: 0; background: rgba(76,175,80,.45); }
.pmeter .pfill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--tomato-light); border-radius: 999px; }
.pmeter .pfill.good { background: var(--basil); }
.ptray { position: absolute; left: 0; right: 0; bottom: 6px; height: 22%; display: flex; justify-content: center; align-items: center; gap: 6px; z-index: 7; padding: 0 8px; background: linear-gradient(180deg, transparent, rgba(0,0,0,.08)); }
.ptray .pthumb { position: static; transform: none; width: auto; height: 78%; max-width: 18%; object-fit: contain; opacity: .45; filter: grayscale(.4); transition: opacity .2s, transform .2s; }
.ptray .pthumb.next { opacity: 1; filter: drop-shadow(0 4px 4px rgba(0,0,0,.3)); animation: bob .9s ease-in-out infinite; }
.prep-hint { font-size: 13px; font-weight: 800; color: #8a6a55; text-align: center; min-height: 16px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .2s; }
.prep-hint.flash { color: var(--tomato); animation: bump .35s ease; }
.prep-skip { border: none; background: none; color: #a08a76; font-weight: 800; font-size: 12px; cursor: pointer; text-decoration: underline; padding: 4px 8px; }
@media (max-height: 700px) { .prep-title { font-size: 20px; } .prep-stage { max-height: 46vh; } }

/* ── Prep v2: ticket, guides, heat, cut, coach ───────────────────────────── */
.prep-ticket { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: flex-end; max-width: 55%; margin-right: 68px; }
.prep-ticket .tstep { position: relative; width: 30px; height: 30px; border-radius: 9px; background: #fff; border: 2px solid #eadbc4; display: flex; align-items: center; justify-content: center; opacity: .55; }
.prep-ticket .tstep img { width: 24px; height: 24px; object-fit: contain; }
.prep-ticket .tstep.on { opacity: 1; border-color: var(--butter); box-shadow: 0 0 0 3px rgba(255,207,77,.35); animation: bump .6s ease; }
.prep-ticket .tstep.done { opacity: 1; border-color: var(--basil); }
.prep-ticket .tscore { position: absolute; right: -7px; bottom: -7px; font-style: normal; font-size: 9px; font-weight: 900; border-radius: 999px; padding: 1px 4px; color: #fff; background: var(--basil); border: 1.5px solid #fff; }
.prep-ticket .tscore.perfect { background: var(--butter-dark); }
.prep-ticket .tscore.okay { background: #b0836a; }
.pmark { position: absolute; left: 50%; top: 36%; height: 40%; transform: translateX(-50%); border-radius: 999px; z-index: 3; pointer-events: none;
  background: linear-gradient(90deg, rgba(255,207,77,0), rgba(255,207,77,.5) 30%, rgba(255,207,77,.5) 70%, rgba(255,207,77,0));
  box-shadow: inset 0 0 0 0 transparent; transition: background .1s; }
.pmark::after { content: ''; position: absolute; left: 50%; top: -4%; bottom: -4%; width: 3px; transform: translateX(-50%); border-radius: 2px; background: var(--butter-dark); box-shadow: 0 0 6px rgba(255,207,77,.9); }
.pmark.aligned { background: linear-gradient(90deg, rgba(92,170,70,0), rgba(92,170,70,.55) 30%, rgba(92,170,70,.55) 70%, rgba(92,170,70,0)); }
.pmark.aligned::after { background: var(--basil); box-shadow: 0 0 8px rgba(92,170,70,.9); }
.pmark.moved { animation: markIn .25s ease-out; }
.pmark.missed::after { animation: markMiss .3s ease; }
@keyframes markIn { from { opacity: 0; transform: translateX(-50%) scaleY(.6); } to { opacity: 1; transform: translateX(-50%) scaleY(1); } }
@keyframes markMiss { 50% { background: var(--tomato); box-shadow: 0 0 10px rgba(220,60,40,.9); } }
/* aim line: drops from the blade tip so the exact cutting point is visible */
.paim { position: absolute; left: 0; top: 30%; height: 48%; width: 0; border-left: 2px dashed rgba(90,63,48,.45); z-index: 3; pointer-events: none; will-change: translate; }
.pfxlayer .pring { z-index: 3; opacity: .9; animation: ringPulse .8s ease-in-out infinite alternate; transform-origin: center; }
.pfxlayer .pring.hitring { animation: hitOut .5s ease-out both; }
.pfxlayer .pgarnish { z-index: 5; filter: drop-shadow(0 3px 3px rgba(0,0,0,.3)); }
.pmeter-label { position: absolute; left: 50%; top: -18px; transform: translateX(-50%); font-size: 10px; letter-spacing: .12em; font-weight: 900; color: #8a6a55; }
.pmeter .pfill.hot { background: #ff5d2e; box-shadow: 0 0 10px rgba(255,93,46,.8); }
.pfire { position: absolute; left: 50%; top: 58%; width: 60%; height: 22%; transform: translateX(-50%); z-index: 1; opacity: 0; transition: opacity .2s; pointer-events: none; }
.pfire img { position: absolute; bottom: 0; width: 26%; height: 100%; object-fit: contain; object-position: bottom; animation: flame .3s ease-in-out infinite alternate; transform-origin: 50% 100%; }
.pfire img:nth-child(1) { left: 8%; animation-delay: .1s; } .pfire img:nth-child(2) { left: 37%; height: 115%; } .pfire img:nth-child(3) { left: 66%; animation-delay: .2s; }
.pcook { position: absolute; left: 30%; right: 30%; top: 12px; height: 8px; border-radius: 999px; background: rgba(0,0,0,.12); z-index: 6; overflow: hidden; }
.pcook i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--butter), var(--basil)); border-radius: 999px; }
.pcook::before { content: 'COOKED'; position: absolute; left: 50%; top: 10px; transform: translateX(-50%); font-size: 9px; letter-spacing: .12em; font-weight: 900; color: #8a6a55; }
.pcut { position: absolute; left: 50%; top: 42%; background: rgba(255,255,255,.85); box-shadow: 0 0 6px rgba(0,0,0,.35); z-index: 5; animation: cutIn .25s ease-out both; }
.pcut.h { width: 62%; height: 3px; transform: translate(-50%, -50%); }
.pcut.v { width: 3px; height: 62%; transform: translate(-50%, -50%); }
@keyframes cutIn { from { transform: translate(-50%, -50%) scale(0); } }
.pcoach { position: absolute; left: 50%; bottom: 14%; transform: translateX(-50%); z-index: 12; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; width: 82%; animation: cardIn .3s ease; }
.pcoach-hand { font-size: 34px; animation: tapTap .9s ease-in-out infinite; filter: drop-shadow(0 4px 4px rgba(0,0,0,.4)); }
.pcoach-text { background: var(--cocoa); color: var(--cream); font-weight: 800; font-size: 12px; padding: 7px 12px; border-radius: 12px; text-align: center; box-shadow: 0 4px 12px rgba(0,0,0,.4); line-height: 1.3; }
.results-head { display: flex; align-items: center; gap: 10px; }
.results-dish { width: 56px; height: 56px; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(0,0,0,.25)); animation: popIn .5s cubic-bezier(.2,1.5,.4,1) both; }
.cook-plate.serve { transition: transform .8s cubic-bezier(.4,0,.2,1), opacity .4s; }
