/* Deacon Simulator — the GBH kitchen game.
   Art: "GBH sticker" sprites in assets/img/game/ (thick black outlines, flat colour, one cel shade).
   The UI around them follows the same rules: 2–3px #141414 outlines and hard offset shadows. */

.play-page { background: var(--ink); }
.play-intro { padding-top: clamp(24px, 4vw, 44px); padding-bottom: 14px; text-align: center; } /* keep .wrap's side gutters */
.play-intro h1 { font-size: clamp(2.6rem, 8vw, 5.2rem); margin-bottom: 8px; }
.play-intro .lede { margin: 0 auto; }
.play-wrap { display: grid; grid-template-columns: 1fr minmax(320px, 460px) 1fr; gap: 28px; align-items: start; padding: 10px var(--gutter) 70px; max-width: 1240px; margin: 0 auto; }
.play-side { padding-top: 30px; }
.play-side h2 { font-size: 1.6rem; color: var(--lime); }
.play-side ol { padding-left: 20px; color: var(--muted); margin: 0 0 18px; }
.play-side li { margin-bottom: 8px; }
.play-side .keys { font-size: .9rem; color: var(--muted); }
.play-side kbd { display: inline-block; min-width: 24px; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 6px; font-family: var(--body); font-size: .8rem; color: #fff; text-align: center; }
.best-box { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.best-box + .best-box { margin-top: 16px; }
.best-box strong { display: block; font-family: var(--display); font-weight: 400; font-size: 3rem; color: var(--lime); line-height: 1; }
.best-box .muted { margin: 10px 0 16px; font-size: .92rem; }
.best-box .legend { color: #fff; font-weight: 700; }
@media (max-width: 1000px) {
  .play-wrap { grid-template-columns: 1fr; padding: 0 0 50px; }
  .play-side { display: none; }
}

/* ---------- Stage ---------- */
.game {
  position: relative; width: 100%; max-width: 460px; margin: 0 auto;
  height: min(calc(100vh - var(--header-h) - 16px), 880px); /* fallback for browsers without svh */
  height: min(calc(100svh - var(--header-h) - 16px), 880px); min-height: 540px;
  display: grid; grid-template-rows: auto auto 1fr auto auto;
  background: #1a1c1b; border-radius: 22px; overflow: hidden;
  border: 3px solid #141414; box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 1px var(--line);
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent; font-family: var(--body);
}
@media (max-width: 1000px) { .game { border-radius: 0; border-width: 0; max-width: 560px; box-shadow: none; } }
.game button { font-family: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.game img { -webkit-user-drag: none; user-select: none; pointer-events: none; }

/* HUD */
.hud { position: relative; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; padding: 10px 12px 12px; background: linear-gradient(#141614, #0b0c0b); }
.hud-time { font-family: var(--display); font-size: 1.6rem; line-height: 1; color: #fff; min-width: 58px; display: flex; align-items: center; gap: 7px; }
.hud-time svg { width: 20px; height: 20px; fill: none; stroke: var(--lime); stroke-width: 2.4; flex: none; }
.hud-time.low { color: #ff6a4d; animation: pulse .5s ease-in-out infinite alternate; }
.hud-score { font-family: var(--display); font-size: 1.6rem; line-height: 1; color: var(--lime); text-align: center; }
.hud-score small { font-family: var(--body); font-size: .62rem; letter-spacing: .14em; color: var(--muted); display: block; font-weight: 700; }
.hud-combo { font-family: var(--display); font-size: 1rem; background: linear-gradient(#ffb02e, #ff6a1f); color: #1a0d00; border: 2px solid #141414; border-radius: 999px; padding: 3px 10px 2px; opacity: 0; transform: scale(.6); transition: opacity .2s, transform .2s; }
.hud-combo.on { opacity: 1; transform: scale(1); }
.hud-mute { background: none; border: 1px solid var(--line); color: #fff; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; padding: 0; }
.hud-mute svg { width: 18px; height: 18px; fill: currentColor; }
.hud-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: #222; }
.hud-progress i { display: block; height: 100%; background: linear-gradient(90deg, #e2412f, #ffcf3f 30%, var(--lime) 60%); transform-origin: left; transition: transform .2s linear; }
@keyframes pulse { to { transform: scale(1.08); } }

/* Ticket rail: stainless bar with receipts clipped on */
.rail { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 14px 8px 10px; min-height: 108px; background: linear-gradient(#3a3f3c, #262a28); box-shadow: inset 0 -6px 10px rgba(0,0,0,.35); border-bottom: 3px solid #141414; }
.rail::before { content: ""; position: absolute; left: 6px; right: 6px; top: 5px; height: 10px; border-radius: 5px; background: linear-gradient(#f1f3f2, #9aa29e 60%, #6f7773); border: 1.5px solid #141414; }
.ticket {
  position: relative; margin-top: 2px; background: #fbf8ef; color: #141614; padding: 7px 7px 14px;
  font-family: "Courier New", ui-monospace, monospace; border: 2px solid #141414; border-bottom: 0;
  box-shadow: 3px 3px 0 rgba(0,0,0,.35); animation: ticketIn .3s ease-out; transform-origin: top center;
}
.ticket::before { content: ""; position: absolute; top: -7px; left: 50%; width: 26px; height: 8px; margin-left: -13px; background: linear-gradient(#e6e9e8, #8d9591); border: 1.5px solid #141414; border-radius: 2px; }
.ticket::after { content: ""; position: absolute; left: -2px; right: -2px; bottom: -5px; height: 6px; background: linear-gradient(-45deg, transparent 4px, #fbf8ef 0) 0 0 / 8px 6px, linear-gradient(45deg, transparent 4px, #fbf8ef 0) 0 0 / 8px 6px; }
.ticket.special { background: #effbe9; }
.ticket.special::after { background: linear-gradient(-45deg, transparent 4px, #effbe9 0) 0 0 / 8px 6px, linear-gradient(45deg, transparent 4px, #effbe9 0) 0 0 / 8px 6px; }
.ticket.active { box-shadow: 0 0 0 3px var(--lime), 4px 6px 0 rgba(0,0,0,.35); transform: rotate(-1deg); }
.rcpt-top { display: flex; justify-content: space-between; font-size: .58rem; font-weight: 700; color: #5b5f5c; border-bottom: 1px dashed #c9c5b8; padding-bottom: 3px; margin-bottom: 3px; letter-spacing: .04em; text-transform: uppercase; }
.ticket .tag { font-family: var(--body); font-size: .55rem; font-weight: 700; letter-spacing: .06em; background: var(--green); color: #fff; padding: 0 4px; border-radius: 3px; }
.ticket h4 { font-family: var(--display); font-weight: 400; font-size: 1rem; line-height: 1; margin: 2px 0 5px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket .layers { display: flex; flex-wrap: wrap; gap: 2px; }
.ticket .layers span { width: 24px; height: 24px; border-radius: 4px; display: grid; place-items: center; background: #fff; box-shadow: inset 0 0 0 1px #e4dfd0; transition: opacity .2s, background .2s; }
.ticket .layers img { width: 21px; height: 21px; object-fit: contain; }
.ticket .layers span.done { opacity: .28; background: #d8eadb; }
.ticket .layers span.next { background: #fff1b8; box-shadow: inset 0 0 0 2px #e0b400; }
.ticket .patience { position: absolute; bottom: 3px; left: 6px; right: 6px; height: 4px; border-radius: 2px; overflow: hidden; background: #e6e6e0; }
.ticket .patience i { display: block; height: 100%; background: var(--green); transform-origin: left; }
.ticket .patience i.warn { background: #f0a020; }
.ticket .patience i.crit { background: #e2412f; }
.ticket.out { animation: ticketOut .35s ease-in forwards; }
.ticket.shake { animation: shake .3s; }
@keyframes ticketIn { from { transform: translateY(-40px); opacity: 0; } }
@keyframes ticketOut { to { transform: translateY(-60px) rotate(-6deg); opacity: 0; } }
@keyframes shake { 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }

/* ---------- Kitchen: backdrop, Deacon, griddle ----------
   Sized with container units so the griddle and Deacon both fit any kitchen height. */
.kitchen {
  position: relative; overflow: hidden; min-height: 140px; container-type: size;
  background: #8e9692 url("../img/game/kitchen-bg.webp") center 12% / cover no-repeat;
}
.kitchen.shake-sm { animation: shakeSm .18s; }
@keyframes shakeSm { 30% { transform: translate(2px, 2px); } 60% { transform: translate(-2px, 1px); } }

.griddle { position: absolute; left: 50%; bottom: 0; width: 100%; max-width: 100%; transform: translateX(-50%); z-index: 2; }
.griddle-img { display: block; width: 100%; height: auto; filter: drop-shadow(0 -4px 10px rgba(0,0,0,.25)); }
.plate { position: absolute; left: 8.5%; right: 8.5%; top: 11%; height: 37%; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: 100%; gap: 2px; }

.deacon {
  position: absolute; left: 50%; z-index: 1; height: 62%; width: auto; aspect-ratio: 477 / 560;
  bottom: 26%; transform: translateX(-50%); transform-origin: 50% 100%;
}
/* Where container units work, size the griddle and Deacon by the kitchen's own height so both always fit.
   Older Android browsers (Samsung Internet < 20, Chrome/WebView < 105) skip this and use the fallbacks above. */
@supports (width: 1cqh) {
  .griddle { width: min(100cqw, 120cqh); } /* griddle image is 1000x480, so this caps it at ~58% of the kitchen's height */
  .deacon { height: 64cqh; bottom: calc(min(48cqw, 57.6cqh) * .52); }
}
.deacon .pose { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: bottom center; visibility: hidden; filter: drop-shadow(0 8px 12px rgba(0,0,0,.3)); }
.deacon[data-mood="smile"] .p-smile, .deacon[data-mood="focus"] .p-focus,
.deacon[data-mood="happy"] .p-happy, .deacon[data-mood="shock"] .p-shock { visibility: visible; }
.deacon[data-mood="smile"] .p-smile { animation: breathe 3.2s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes breathe { 50% { transform: scaleY(1.012) translateY(-1px); } }
.deacon.smash { animation: deaconSmash .28s ease-out; }
.deacon.cheer { animation: deaconCheer .5s ease-out; }
@keyframes deaconSmash { 35% { transform: translateX(-50%) translateY(8px) scaleY(.96); } }
@keyframes deaconCheer { 30% { transform: translateX(-50%) translateY(-8px) rotate(-2deg); } 60% { transform: translateX(-50%) rotate(2deg); } }

.bubble {
  position: absolute; left: 56%; top: 5%; transform: scale(.6); transform-origin: 10% 100%; opacity: 0; z-index: 4;
  background: #fff; color: #111; font-family: var(--display); font-size: 1.1rem; text-transform: uppercase; line-height: 1.05;
  padding: 7px 12px 6px; border: 2.5px solid #141414; border-radius: 14px; box-shadow: 3px 3px 0 #141414;
  max-width: 42%; white-space: nowrap; transition: transform .18s, opacity .18s;
}
.bubble::after { content: ""; position: absolute; left: 10px; bottom: -11px; border: 10px solid transparent; border-top-color: #141414; border-bottom: 0; }
.bubble::before { content: ""; position: absolute; left: 13px; bottom: -6px; border: 7px solid transparent; border-top-color: #fff; border-bottom: 0; z-index: 1; }
.bubble.show { transform: scale(1); opacity: 1; }

/* Grill spots */
.slot { position: relative; border: 0; padding: 0; color: #fff; background: radial-gradient(ellipse 60% 45% at 50% 50%, rgba(255,110,30,.12), transparent 70%); border-radius: 10px; display: grid; place-items: center; outline-offset: -3px; }
.slot:hover { background: radial-gradient(ellipse 60% 45% at 50% 50%, rgba(255,140,60,.22), transparent 70%); }
.slot:focus-visible { outline: 3px solid var(--lime); }
.slot .key { position: absolute; top: 2px; left: 6px; font-size: .62rem; color: rgba(255,255,255,.4); font-weight: 700; }
.slot .hint { position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%); font-size: .6rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; color: #fff; pointer-events: none; }
.slot .hint:not(:empty) { background: rgba(0,0,0,.6); border-radius: 999px; padding: 2px 8px; }
@media (hover: none) { .slot .key, .pantry .key { display: none; } }

/* Patty sprites: the cooking states are stacked and crossfaded by the crust value */
.patty { position: relative; width: 80%; aspect-ratio: 320 / 250; margin-top: -6%; }
.patty img { position: absolute; left: 0; bottom: 0; width: 100%; height: auto; }
.patty .ball { width: 58%; left: 21%; bottom: 8%; animation: dropIn .25s cubic-bezier(.3,1.5,.5,1); }
.patty .raw, .patty .golden, .patty .burnt { opacity: 0; }
.patty.smashed .ball { display: none; }
.patty.smashed .raw { opacity: 1; }
.patty.burnt .burnt { opacity: 1 !important; }
.patty.smashed .layers { animation: flatten .22s cubic-bezier(.2,1.6,.4,1) .08s both; transform-origin: 50% 70%; } /* lands as the smasher presses */
.patty .layers { position: absolute; inset: 0; transform: scaleY(.78); transform-origin: 50% 80%; }
@keyframes flatten { from { transform: scale(.4, .5); } }
@keyframes dropIn { from { transform: translateY(-40px) scale(.8); } }

.meter { position: absolute; left: 12%; right: 12%; bottom: -16px; height: 9px; z-index: 3; border: 2px solid #141414; border-radius: 6px; background: #3a3a3a; opacity: 0; transition: opacity .2s; overflow: hidden; }
.meter.on { opacity: 1; }
.meter::before { /* golden zone */ content: ""; position: absolute; left: calc(var(--z1) * 100%); width: calc((var(--z2) - var(--z1)) * 100%); top: 0; bottom: 0; background: repeating-linear-gradient(45deg, rgba(255,207,63,.85) 0 4px, rgba(255,207,63,.5) 4px 8px); }
.meter i { position: absolute; top: 0; bottom: 0; left: 0; width: 0; background: #c06a30; }
.meter b { position: absolute; top: -2px; bottom: -2px; width: 4px; background: #fff; border: 1px solid #141414; border-radius: 2px; left: 0; }

/* Smash pose: game.js places both copies so the smasher lands on the patty, and clips the front copy at the griddle's back edge */
.reach { position: absolute; left: 0; top: 0; height: auto; pointer-events: none; transform-origin: 50% 95%;
  -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent); mask-image: linear-gradient(90deg, #000 90%, transparent); } /* his left arm runs off the sprite's edge */
.reach[hidden] { display: none; }
.reach-back { z-index: 1; filter: drop-shadow(0 8px 12px rgba(0,0,0,.3)); }
.reach-front { z-index: 3; }
.reach.press { animation: reachPress .32s ease-out; }
@keyframes reachPress { 0% { transform: translateY(-6%); } 35% { transform: translateY(1%) scaleY(.97); } 70%, 100% { transform: none; } }
.deacon.reaching { opacity: 0; }
.smoke { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: rgba(240,240,240,.6); filter: blur(4px); pointer-events: none; animation: smoke 1.4s ease-out forwards; z-index: 1; }
.smoke.dark { background: rgba(40,40,40,.75); }
@keyframes smoke { from { transform: translate(0,0) scale(.6); opacity: .9; } to { transform: translate(var(--dx, 0), -90px) scale(2.4); opacity: 0; } }
.spark { position: absolute; left: 50%; top: 45%; width: 5px; height: 5px; border-radius: 50%; background: #ffcf3f; border: 1px solid #141414; pointer-events: none; z-index: 2; animation: spark .55s ease-out forwards; }
@keyframes spark { to { transform: translate(var(--sx), var(--sy)) scale(.3); opacity: 0; } }

/* ---------- Pass: patty tray + build board on GBH wrap paper ---------- */
.pass { display: grid; grid-template-columns: 84px 1fr; gap: 8px; padding: 8px 10px; background: linear-gradient(#cfd4d1, #9aa29e); border-top: 3px solid #141414; }
.tray { position: relative; min-height: 164px; display: flex; flex-direction: column-reverse; justify-content: flex-start; gap: 0; padding: 6px 6px 8px; border-radius: 10px; background: linear-gradient(#5d6561, #3c4340); border: 2px solid #141414; box-shadow: inset 0 3px 8px rgba(0,0,0,.5); }
.tray::after { content: "Patties"; position: absolute; top: 4px; left: 0; right: 0; text-align: center; font-size: .58rem; letter-spacing: .14em; text-transform: uppercase; color: #e9ecea; font-weight: 700; }
.tray .tp { position: relative; margin-top: -8px; animation: pop .25s ease-out; }
.tray .tp img { display: block; width: 100%; height: auto; }
.tray .tp.pale img { filter: saturate(.55) brightness(1.3); }
.tray .tp.perfect::after { content: "★"; position: absolute; right: -2px; top: -4px; font-size: .8rem; color: #ffcf3f; -webkit-text-stroke: 2px #141414; paint-order: stroke fill; }
@keyframes pop { 0% { transform: scale(1.25, .7); } 100% { transform: none; } }
.board {
  position: relative; min-height: 164px; border-radius: 10px; overflow: hidden; border: 2px solid #141414;
  background-color: #f5f2ea;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Crect width='24' height='24' fill='%23161616'/%3E%3Crect x='24' y='24' width='24' height='24' fill='%23161616'/%3E%3Ctext x='36' y='15.5' font-family='Arial Black,Arial' font-weight='900' font-size='7.5' fill='%2304843c' text-anchor='middle'%3EGBH%3C/text%3E%3Ctext x='12' y='39.5' font-family='Arial Black,Arial' font-weight='900' font-size='7.5' fill='%2304843c' text-anchor='middle'%3EGBH%3C/text%3E%3C/svg%3E");
  background-size: 40px 40px;
}
.board::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 80%, rgba(255,255,255,.6), rgba(255,255,255,.15) 70%); }
.board .label { position: absolute; top: 6px; left: 6px; right: 6px; z-index: 3; display: flex; justify-content: space-between; font-family: var(--display); font-size: .8rem; color: #111; text-transform: uppercase; background: rgba(255,255,255,.92); border: 2px solid #141414; border-radius: 6px; padding: 1px 6px; }
.board .label span:last-child { font-family: var(--body); font-size: .62rem; font-weight: 700; letter-spacing: .1em; align-self: center; color: #333; }
/* The stack is absolutely positioned layers; game.js sets each layer's bottom offset */
.stack { position: absolute; left: 50%; bottom: 6px; width: min(52%, 140px); height: calc(100% - 34px); transform: translateX(-50%); z-index: 2; filter: drop-shadow(0 4px 0 rgba(0,0,0,.18)); }
.stack .ly { position: absolute; left: 50%; width: 100%; transform: translateX(-50%); }
.stack .ly img { display: block; width: 100%; height: auto; transform: scaleY(.78); transform-origin: 50% 100%; } /* matches SQUASH in game.js */
.stack .ly.new { animation: drop .2s ease-out; }
.stack .ly.cheese { width: 88%; } /* narrower than the lacy patty so it sits on it, not in front */
.stack .ly.q-pale img { filter: saturate(.55) brightness(1.3); }
@keyframes drop { from { transform: translate(-50%, -30px); opacity: 0; } }
.stack.served { animation: served .45s ease-in forwards; }
@keyframes served { to { transform: translateX(70%) rotate(12deg); opacity: 0; } }
.stack.binned { animation: binned .4s ease-in forwards; }
@keyframes binned { to { transform: translate(-50%, 80px) rotate(-20deg); opacity: 0; } }

/* ---------- Pantry: stainless tubs holding the sprites ---------- */
.pantry { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(#202322, #0b0c0b); border-top: 3px solid #141414; }
.pantry button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 72px; padding: 5px 3px 4px; color: #111; background: linear-gradient(#f1f3f2, #b7bebb); border: 2px solid #141414; border-radius: 12px; box-shadow: 0 4px 0 #141414; transition: transform .06s; }
.pantry button:active, .pantry button.hit { transform: translateY(3px); box-shadow: 0 1px 0 #141414; }
.pantry button.want { background: linear-gradient(#fff6c9, #ffd84a); box-shadow: 0 4px 0 #141414, 0 0 0 3px rgba(255,207,63,.45); animation: want 1s ease-in-out infinite; }
@keyframes want { 50% { transform: translateY(-2px); } }
.pantry .tub { width: 100%; max-width: 56px; aspect-ratio: 1.25; border-radius: 7px; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 40%, #59605d, #2c3230); box-shadow: inset 0 2px 5px rgba(0,0,0,.6), 0 0 0 2px #dfe3e1, 0 0 0 3px #7d8581; }
.pantry .tub img { width: 86%; height: 80%; object-fit: contain; filter: drop-shadow(0 2px 0 rgba(0,0,0,.35)); }
.pantry span { font-size: .6rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #1a1a1a; }
.pantry .key { position: absolute; top: 3px; right: 6px; font-size: .55rem; color: #6b706d; font-style: normal; font-weight: 700; }
.pantry .count { position: absolute; top: -8px; left: -6px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; background: var(--green); color: #fff; font-size: .62rem; font-weight: 700; border: 2px solid #141414; border-radius: 999px; }
.pantry .count.zero { background: #a33; }

/* Floating score text */
.float { position: absolute; z-index: 20; pointer-events: none; font-family: var(--display); font-size: 1.5rem; color: #ffcf3f; -webkit-text-stroke: 5px #141414; paint-order: stroke fill; animation: floatUp 1s ease-out forwards; white-space: nowrap; transform: translateX(-50%); }
.float.bad { color: #ff6a4d; }
.float.good { color: var(--lime); }
@keyframes floatUp { from { opacity: 0; transform: translate(-50%, 10px); } 15% { opacity: 1; } to { opacity: 0; transform: translate(-50%, -60px); } }

/* ---------- Overlays ---------- */
.overlay { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; overflow-y: auto; text-align: center; padding: 28px; background: radial-gradient(ellipse at 50% 30%, rgba(14,42,25,.96), rgba(8,10,9,.97) 70%); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.overlay[hidden] { display: none !important; }
.overlay::before, .overlay::after { content: ""; position: absolute; left: 0; right: 0; height: 14px; background: repeating-conic-gradient(var(--green) 0 25%, var(--cream) 0 50%) 0 0 / 14px 14px; }
.overlay::before { top: 0; } .overlay::after { bottom: 0; }
.title-lockup { font-size: clamp(3rem, 14vw, 4.6rem); line-height: .9; margin-bottom: 10px; }
.title-lockup .outline { display: block; color: transparent; -webkit-text-stroke: 2px var(--lime); }
.face-wrap { width: 150px; height: 150px; flex: none; border-radius: 50%; overflow: hidden; margin-bottom: 14px; display: grid; place-items: end center; background: radial-gradient(circle at 50% 40%, #35c96a, #04843c 70%); border: 3px solid #141414; box-shadow: 0 0 0 6px rgba(53,201,106,.18), 0 14px 30px rgba(0,0,0,.5); }
.face-wrap img { width: 112%; max-width: none; height: auto; margin-bottom: -18%; }
.overlay .sub { color: var(--muted); margin-bottom: 18px; max-width: 34ch; }
.overlay .steps-mini { display: grid; gap: 8px; margin: 4px 0 22px; text-align: left; width: 100%; max-width: 320px; }
.overlay .steps-mini div { display: flex; gap: 12px; align-items: center; background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: .92rem; }
.overlay .steps-mini b { font-family: var(--display); font-weight: 400; color: var(--ink); background: var(--lime); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 1rem; }
.count-big { font-family: var(--display); font-size: 9rem; color: var(--lime); line-height: 1; -webkit-text-stroke: 6px #141414; paint-order: stroke fill; animation: countIn .9s ease-out; }
@keyframes countIn { from { transform: scale(1.8); opacity: 0; } 30% { opacity: 1; } }
.end-deacon { width: 120px; height: auto; margin-bottom: -6px; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.result-score { font-family: var(--display); font-size: 5rem; color: var(--lime); line-height: 1; -webkit-text-stroke: 6px #141414; paint-order: stroke fill; }
.result-rank { font-family: var(--display); font-size: 1.8rem; text-transform: uppercase; margin: 4px 0 14px; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; max-width: 340px; margin-bottom: 16px; }
.result-stats div { background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 12px; padding: 10px 4px; }
.result-stats strong { display: block; font-family: var(--display); font-weight: 400; font-size: 1.6rem; line-height: 1; }
.result-stats span { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.result-best { font-size: .9rem; color: var(--muted); margin-bottom: 18px; }
.result-best .new { color: #ffcf3f; font-weight: 700; }
.overlay .btn-row { justify-content: center; }
.overlay .order-link { margin-top: 16px; color: var(--muted); font-size: .9rem; }
.overlay .order-link a { color: var(--lime); font-weight: 700; }

/* Score reward */
.reward-hint { margin: -6px 0 14px; color: #fff; font-size: .95rem; }
.reward-hint strong { color: var(--lime); }
.reward { width: 100%; max-width: 320px; margin: 0 0 16px; padding: 14px 16px 12px; border: 2px dashed var(--lime); border-radius: 14px; background: rgba(53,201,106,.1); display: grid; gap: 6px; justify-items: center; }
.reward .eyebrow { margin: 0; }
.reward-title { font-family: var(--display); font-weight: 400; font-size: 1.6rem; line-height: 1; text-transform: uppercase; color: #fff; }
.reward-code { font-family: var(--display); font-size: 1.9rem; letter-spacing: .12em; color: #141414; background: #fff; border: 3px solid #141414; border-radius: 10px; padding: 4px 18px 2px; box-shadow: 0 4px 0 #141414; user-select: all; -webkit-user-select: all; }
.reward-code:active { transform: translateY(3px); box-shadow: 0 1px 0 #141414; }
.reward-note { color: var(--muted); font-size: .8rem; }
.reward .btn { margin-top: 4px; }
.reward-miss { color: #fff; font-size: .92rem; margin: -6px 0 16px; }
.reward-miss strong { color: #ffcf3f; }
.side-reward strong { color: #fff; }
.side-code { font-family: var(--display); font-weight: 400; letter-spacing: .08em; color: var(--lime) !important; font-size: 1.15rem; }

/* Centre overlay content, but scroll rather than clip it when the screen is short */
.overlay > :first-child { margin-top: auto; }
.overlay > :last-child { margin-bottom: auto; }

/* Narrow phones (most Android handsets are 360–412px wide): keep each ticket's icons on one row */
@media (max-width: 420px) {
  .rail { min-height: 0; gap: 5px; padding-left: 6px; padding-right: 6px; }
  .ticket { padding: 6px 5px 12px; }
  .ticket h4 { font-size: .9rem; }
  .ticket .layers { gap: 1px; flex-wrap: nowrap; }
  .ticket .layers span { width: 18px; height: 18px; flex: 0 0 18px; }
  .ticket .layers img { width: 16px; height: 16px; }
}
/* Shorter screens: give the kitchen the room */
@media (max-height: 760px) {
  .tray, .board { min-height: 140px; }
  .rail { min-height: 100px; }
  .pantry button { min-height: 64px; }
  .face-wrap { width: 110px; height: 110px; margin-bottom: 8px; }
  .overlay .steps-mini { margin-bottom: 14px; }
  .end-deacon { display: none; }
}
/* Short screens, e.g. Android phones with the browser toolbar showing */
@media (max-height: 680px) {
  .hud { padding: 6px 10px 8px; }
  .hud-time, .hud-score { font-size: 1.35rem; }
  .rail { min-height: 0; padding-top: 12px; padding-bottom: 8px; }
  .tray, .board { min-height: 120px; }
  .pantry { padding-top: 7px; padding-bottom: calc(7px + env(safe-area-inset-bottom)); }
  .pantry button { min-height: 58px; }
  .pantry .tub { max-width: 46px; }
  .face-wrap, .overlay .sub { display: none; }
  .title-lockup { font-size: 2.8rem; }
}
