/* ===================================================================
   Sushi Dash — "sakura afternoon" redesign.
   Light pastel sky, drifting clouds and petals, soft-lit kawaii
   ingredients. No hard black outlines: every edge is a deeper shade
   of the thing it outlines, and depth comes from soft coloured
   shadows plus a gentle "jelly" bottom lip on interactive pieces.
   =================================================================== */

:root{
  /* text */
  --ink:#5b3b4b;
  --ink-soft:#9a7686;
  --ink-faint:#c9a9b7;

  /* surfaces */
  --white:#ffffff;
  --cream:#fffaf5;
  --blush-bg:#fff1f5;
  --ring:#ffe0ea;
  --ring-2:#f7cddb;

  /* sky */
  --sky-top:#a9ddff;
  --sky-mid:#d4efff;
  --sky-low:#fff3f6;

  /* accents (also used by script.js sparkles) */
  --pink:#ff8fb1;
  --pink-deep:#f0648e;
  --pink-lip:#dc4f7b;
  --coral:#ff8a78;
  --sun:#ffd36b;
  --sun-deep:#f5ae2c;
  --leaf:#7fdca2;
  --leaf-deep:#35b877;
  --leaf-lip:#23965e;
  --sky:#7cc8ff;
  --lav:#c3b1ff;
  --purple:#9b7bff;

  /* wood */
  --wood:#fbe3bd;
  --wood-2:#f4cf98;
  --wood-edge:#e7b877;

  --radius-xl:30px;
  --radius-lg:24px;
  --radius-md:18px;
  --radius-sm:14px;

  --soft-shadow:0 14px 30px rgba(214,110,150,.16), 0 3px 8px rgba(214,110,150,.10);
  font-size:16px;
}

*,*::before,*::after{ box-sizing:border-box; }

html,body{ margin:0; padding:0; min-height:100%; }

body{
  font-family:'Nunito', system-ui, sans-serif;
  font-weight:700;
  color:var(--ink);
  background:linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 38%, var(--sky-low) 78%, #ffe9f0 100%);
  background-attachment:fixed;
  min-height:100vh;
  display:flex;
  justify-content:center;
  overflow-x:hidden;
  -webkit-tap-highlight-color:transparent;
}

#app{
  position:relative;
  z-index:1;
  width:100%;
  max-width:520px;
  min-height:100vh;
  padding:max(14px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
}

h1,h2{ font-family:'Fredoka', 'Nunito', sans-serif; margin:0; }
button{ font-family:inherit; }
.hidden{ display:none !important; }

/* ===================== AMBIENT SCENE ===================== */
.scene{
  position:fixed;
  inset:0;
  z-index:0;
  overflow:hidden;
  pointer-events:none;
}
.sun-glow{
  position:absolute;
  top:-120px;
  left:50%;
  width:520px;
  height:520px;
  margin-left:-260px;
  border-radius:50%;
  background:radial-gradient(circle, rgba(255,255,255,.95) 0%, rgba(255,247,214,.55) 32%, rgba(255,255,255,0) 68%);
  animation:glow-breathe 6s ease-in-out infinite;
}
@keyframes glow-breathe{
  0%,100%{ transform:scale(1); opacity:.9; }
  50%{ transform:scale(1.06); opacity:1; }
}

.cloud{
  position:absolute;
  width:140px;
  height:44px;
  border-radius:999px;
  background:#fff;
  opacity:.85;
  filter:drop-shadow(0 6px 10px rgba(120,170,220,.18));
  animation:cloud-drift linear infinite;
}
.cloud::before,
.cloud::after{
  content:"";
  position:absolute;
  background:#fff;
  border-radius:50%;
}
.cloud::before{ width:64px; height:64px; left:22px; top:-30px; }
.cloud::after{ width:48px; height:48px; left:70px; top:-20px; }
.cloud-1{ top:9%;  left:-160px; animation-duration:58s; animation-delay:-12s; }
.cloud-2{ top:30%; left:-160px; transform:scale(.7); opacity:.7; animation-duration:74s; animation-delay:-40s; }
.cloud-3{ top:58%; left:-160px; transform:scale(.55); opacity:.6; animation-duration:90s; animation-delay:-70s; }
@keyframes cloud-drift{
  from{ translate:0 0; }
  to{ translate:calc(100vw + 340px) 0; }
}

/* seigaiha (wave) pattern rising from the bottom of the screen */
.waves{
  position:absolute;
  left:0; right:0; bottom:0;
  height:170px;
  opacity:.5;
  background:
    radial-gradient(circle at 50% 100%, transparent 0 9px, rgba(255,255,255,.9) 9px 12px, transparent 12px 17px, rgba(255,255,255,.9) 17px 20px, transparent 20px 25px, rgba(255,255,255,.9) 25px 28px, transparent 28px) 0 0/56px 28px,
    radial-gradient(circle at 50% 100%, transparent 0 9px, rgba(255,255,255,.9) 9px 12px, transparent 12px 17px, rgba(255,255,255,.9) 17px 20px, transparent 20px 25px, rgba(255,255,255,.9) 25px 28px, transparent 28px) 28px 14px/56px 28px;
  -webkit-mask-image:linear-gradient(180deg, transparent, #000 80%);
          mask-image:linear-gradient(180deg, transparent, #000 80%);
}

.petals{ position:absolute; inset:0; }
.petal{
  position:absolute;
  top:-24px;
  left:var(--x, 50%);
  width:13px;
  height:11px;
  border-radius:100% 0 100% 0;
  background:radial-gradient(circle at 30% 30%, #fff 0%, #ffd2df 40%, #ffadc6 100%);
  box-shadow:0 2px 4px rgba(240,100,142,.15);
  opacity:.9;
  scale:var(--s, 1);
  animation:petal-fall var(--d, 12s) linear var(--delay, 0s) infinite;
}
@keyframes petal-fall{
  0%{   transform:translate(0, 0) rotate(0deg); }
  25%{  transform:translate(calc(var(--drift, 40px) * .6), 27vh) rotate(90deg); }
  50%{  transform:translate(calc(var(--drift, 40px) * -.2), 55vh) rotate(200deg); }
  75%{  transform:translate(var(--drift, 40px), 82vh) rotate(290deg); }
  100%{ transform:translate(calc(var(--drift, 40px) * .3), 110vh) rotate(380deg); }
}

/* ===================== SOUND TOGGLE ===================== */
.sound-toggle{
  position:fixed;
  top:max(14px, env(safe-area-inset-top));
  right:max(14px, calc(50% - 260px + 14px));
  z-index:40;
  width:44px;
  height:44px;
  border-radius:50%;
  border:none;
  background:linear-gradient(180deg, #fff, #fff0f5);
  color:var(--pink-deep);
  box-shadow:0 0 0 3px var(--ring), 0 4px 0 var(--ring-2), 0 8px 16px rgba(214,110,150,.2);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  padding:0;
  transition:transform .12s cubic-bezier(.3,1.6,.5,1), box-shadow .12s ease;
}
.sound-toggle svg{ width:22px; height:22px; display:block; }
.sound-toggle:hover{ transform:scale(1.06) rotate(-4deg); }
.sound-toggle:active{
  transform:translateY(3px) scale(.94);
  box-shadow:0 0 0 3px var(--ring), 0 1px 0 var(--ring-2), 0 3px 6px rgba(214,110,150,.2);
}

/* ---------- screens ---------- */
.screen{ display:none; }
.screen.is-active{ display:block; animation:screen-in .5s cubic-bezier(.2,1.2,.4,1); }
@keyframes screen-in{
  from{ opacity:0; transform:translateY(18px) scale(.97); }
  to{ opacity:1; transform:translateY(0) scale(1); }
}

/* ---------- panel (soft white card) ---------- */
.panel{
  position:relative;
  background:linear-gradient(180deg, #ffffff 0%, var(--cream) 100%);
  border-radius:var(--radius-xl);
  box-shadow:
    0 0 0 3px rgba(255,255,255,.85),
    0 0 0 6px var(--ring),
    var(--soft-shadow);
  padding:22px 20px;
}

/* ===================== START SCREEN ===================== */
.start-hero{
  text-align:center;
  padding:48px 0 8px;
}

.critter-wave{
  display:flex;
  justify-content:center;
  gap:6px;
  margin-bottom:2px;
}
.critter-wave span{
  display:inline-block;
  animation:bob 2.4s ease-in-out infinite;
}
.critter-wave .ing-icon{ width:46px; height:46px; }
.critter-wave span:nth-child(2){ animation-delay:.2s; }
.critter-wave span:nth-child(3){ animation-delay:.4s; }
.critter-wave span:nth-child(4){ animation-delay:.6s; }
.critter-wave span:nth-child(5){ animation-delay:.8s; }
.critter-wave span:nth-child(3) .ing-icon{ width:56px; height:56px; }

@keyframes bob{
  0%,100%{ transform:translateY(0) rotate(-5deg); }
  50%{ transform:translateY(-9px) rotate(5deg); }
}

.logo{
  display:inline-flex;
  flex-direction:column;
  align-items:center;
  animation:logo-float 3.4s ease-in-out infinite;
}
@keyframes logo-float{
  0%,100%{ transform:translateY(0) rotate(-1.5deg); }
  50%{ transform:translateY(-4px) rotate(1.5deg); }
}

.title{
  position:relative;
  font-family:'Fredoka', sans-serif;
  font-weight:700;
  font-size:3.3rem;
  line-height:1;
  letter-spacing:.5px;
  color:#fff;
  paint-order:stroke fill;
  -webkit-text-stroke:10px var(--pink-deep);
  filter:
    drop-shadow(0 4px 0 var(--pink-lip))
    drop-shadow(0 10px 14px rgba(220,79,123,.28));
  margin-bottom:10px;
}

.logo-ribbon{
  position:relative;
  display:inline-block;
  padding:6px 18px;
  background:linear-gradient(180deg, #8fd3ff, #63bff7);
  color:#fff;
  font-family:'Fredoka', sans-serif;
  font-weight:600;
  font-size:.9rem;
  border-radius:999px;
  box-shadow:0 3px 0 #3fa3e0, 0 8px 14px rgba(63,163,224,.25);
  text-shadow:0 1px 0 rgba(40,120,180,.35);
}

.start-panel{ text-align:center; margin-top:14px; }

.mascot-card{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:18px;
  text-align:left;
}
.mascot{
  flex:0 0 auto;
  width:104px;
  height:104px;
  animation:mascot-sway 3s ease-in-out infinite;
  transform-origin:50% 95%;
}
.mascot svg{ width:100%; height:100%; display:block; overflow:visible; }
.mascot .m-eyes{
  transform-box:fill-box;
  transform-origin:center;
  animation:blink 4.2s ease-in-out infinite;
}
.mascot .m-hat{
  transform-box:fill-box;
  transform-origin:50% 100%;
  animation:hat-wiggle 3s ease-in-out infinite;
}
@keyframes mascot-sway{
  0%,100%{ transform:rotate(-3deg); }
  50%{ transform:rotate(3deg) translateY(-2px); }
}
@keyframes blink{
  0%,92%,100%{ transform:scaleY(1); }
  95%{ transform:scaleY(.1); }
}
@keyframes hat-wiggle{
  0%,100%{ transform:rotate(0); }
  50%{ transform:rotate(-4deg); }
}

.mascot-bubble{
  position:relative;
  flex:1;
  margin:0;
  padding:12px 14px;
  background:var(--blush-bg);
  border-radius:20px;
  font-size:.9rem;
  line-height:1.4;
  color:var(--ink);
  box-shadow:inset 0 0 0 2px var(--ring);
}
.mascot-bubble::before{
  content:"";
  position:absolute;
  left:-9px;
  top:50%;
  width:18px;
  height:18px;
  margin-top:-9px;
  background:var(--blush-bg);
  border-left:2px solid var(--ring);
  border-bottom:2px solid var(--ring);
  border-radius:0 0 0 6px;
  transform:rotate(45deg);
}

/* ===================== BUTTONS ===================== */
.btn{
  position:relative;
  overflow:hidden;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-family:'Fredoka', sans-serif;
  font-weight:600;
  font-size:1.05rem;
  letter-spacing:.2px;
  border:none;
  border-radius:999px;
  padding:12px 24px;
  cursor:pointer;
  background:#fff;
  color:var(--ink);
  transition:transform .14s cubic-bezier(.3,1.6,.5,1), box-shadow .12s ease, filter .12s ease;
}
.btn:hover{ transform:translateY(-2px); filter:brightness(1.04); }
.btn:active{ transform:translateY(4px) scale(.97); }

/* the jelly highlight on every filled button */
.btn:not(.btn-soft)::after{
  content:"";
  position:absolute;
  top:4px;
  left:10%;
  width:80%;
  height:40%;
  background:linear-gradient(180deg, rgba(255,255,255,.65), rgba(255,255,255,0));
  border-radius:999px;
  pointer-events:none;
}
/* a slow sheen that sweeps across the main call-to-action */
.btn-lg::before{
  content:"";
  position:absolute;
  top:0; bottom:0;
  left:-40%;
  width:30%;
  background:linear-gradient(100deg, rgba(255,255,255,0), rgba(255,255,255,.55), rgba(255,255,255,0));
  transform:skewX(-18deg);
  animation:sheen 3.2s ease-in-out infinite;
  pointer-events:none;
}
@keyframes sheen{
  0%,55%{ left:-40%; }
  100%{ left:130%; }
}

.btn-primary{
  background:linear-gradient(180deg, #ffb3c9 0%, var(--pink) 45%, var(--pink-deep) 100%);
  color:#fff;
  text-shadow:0 1px 0 rgba(200,60,100,.45);
  box-shadow:0 5px 0 var(--pink-lip), 0 12px 20px rgba(240,100,142,.35);
}
.btn-primary:active{ box-shadow:0 1px 0 var(--pink-lip), 0 4px 8px rgba(240,100,142,.3); }

.btn-serve{
  background:linear-gradient(180deg, #a8f0c4 0%, var(--leaf) 45%, var(--leaf-deep) 100%);
  color:#fff;
  text-shadow:0 1px 0 rgba(20,120,70,.45);
  box-shadow:0 5px 0 var(--leaf-lip), 0 12px 20px rgba(53,184,119,.32);
}
.btn-serve:active{ box-shadow:0 1px 0 var(--leaf-lip), 0 4px 8px rgba(53,184,119,.3); }

.btn-soft{
  background:#fff;
  color:var(--pink-deep);
  box-shadow:0 0 0 2.5px var(--ring), 0 4px 0 var(--ring-2), 0 8px 14px rgba(214,110,150,.14);
}
.btn-soft:active{ box-shadow:0 0 0 2.5px var(--ring), 0 1px 0 var(--ring-2); }

.btn-lg{
  display:flex;
  width:100%;
  font-size:1.3rem;
  padding:15px 22px;
  margin:6px 0 14px;
}
.btn-block{ display:flex; width:100%; }
#btn-howto{ padding:10px 26px; font-size:.98rem; }

.btn-sm{ padding:10px 18px; font-size:.95rem; }

.btn-ico{ display:inline-flex; width:22px; height:22px; }
.btn-ico svg{ width:100%; height:100%; filter:drop-shadow(0 1px 0 rgba(200,60,100,.4)); }

.btn:focus-visible,
.ing-btn:focus-visible,
.sound-toggle:focus-visible{
  outline:3px solid var(--purple);
  outline-offset:3px;
}

/* ===================== LEADERBOARD ===================== */
.leaderboard-preview{
  margin-top:20px;
  text-align:left;
}
.leaderboard-preview h2{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  font-size:1.2rem;
  font-weight:600;
  color:var(--ink);
  margin-bottom:10px;
}
.h2-ico{ font-size:1.05rem; }
.leaderboard-list{
  list-style:none;
  margin:0;
  padding:6px;
  background:var(--blush-bg);
  border-radius:var(--radius-md);
  box-shadow:inset 0 0 0 2px var(--ring);
  display:flex;
  flex-direction:column;
  gap:5px;
}
.leaderboard-list li{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 12px 8px 8px;
  font-size:.95rem;
  background:#fff;
  border-radius:12px;
  box-shadow:0 2px 0 var(--ring);
  animation:row-in .4s cubic-bezier(.2,1.3,.4,1) both;
}
.leaderboard-list li:nth-child(2){ animation-delay:.04s; }
.leaderboard-list li:nth-child(3){ animation-delay:.08s; }
.leaderboard-list li:nth-child(4){ animation-delay:.12s; }
.leaderboard-list li:nth-child(5){ animation-delay:.16s; }
.leaderboard-list li:nth-child(n+6){ animation-delay:.2s; }
@keyframes row-in{
  from{ opacity:0; transform:translateX(-10px); }
  to{ opacity:1; transform:translateX(0); }
}
.leaderboard-list .lb-rank{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:28px;
  height:28px;
  border-radius:50%;
  background:#f6eef2;
  color:var(--ink-soft);
  font-family:'Fredoka', sans-serif;
  font-weight:700;
  font-size:.85rem;
}
.leaderboard-list li:nth-child(1) .lb-rank{ background:linear-gradient(180deg,#ffe58f,#ffc542); color:#9a6412; box-shadow:0 2px 0 #eaa927; }
.leaderboard-list li:nth-child(2) .lb-rank{ background:linear-gradient(180deg,#eef3fb,#c9d5e6); color:#5d6a80; box-shadow:0 2px 0 #aab8cc; }
.leaderboard-list li:nth-child(3) .lb-rank{ background:linear-gradient(180deg,#ffd9bd,#f3a878); color:#8a4a22; box-shadow:0 2px 0 #dc8b56; }
.leaderboard-list .lb-name{
  flex:1;
  font-weight:800;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.leaderboard-list .lb-score{
  font-family:'Fredoka', sans-serif;
  font-weight:600;
  color:var(--leaf-deep);
}
.leaderboard-list li.leaderboard-empty{
  justify-content:center;
  padding:14px;
  text-align:center;
  color:var(--ink-soft);
  font-size:.9rem;
  background:transparent;
  box-shadow:none;
}

/* ===================== MODAL ===================== */
.modal-overlay{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(120,80,110,.32);
  -webkit-backdrop-filter:blur(4px);
          backdrop-filter:blur(4px);
  align-items:center;
  justify-content:center;
  padding:20px;
  z-index:50;
}
.modal-overlay.is-active{ display:flex; animation:overlay-in .25s ease; }
.modal-overlay.is-active .modal-card{ animation:modal-pop .45s cubic-bezier(.2,1.5,.4,1); }
@keyframes overlay-in{ from{ opacity:0; } to{ opacity:1; } }
@keyframes modal-pop{
  from{ opacity:0; transform:scale(.8) translateY(20px); }
  to{ opacity:1; transform:scale(1) translateY(0); }
}
.modal-card{
  max-width:400px;
  width:100%;
  max-height:calc(100vh - 40px);
  overflow-y:auto;
  text-align:left;
}
.modal-card h2{
  text-align:center;
  font-size:1.6rem;
  font-weight:700;
  color:var(--pink-deep);
  margin-bottom:14px;
}
.howto-list{
  padding-left:0;
  list-style:none;
  display:flex;
  flex-direction:column;
  gap:8px;
  margin:0 0 18px;
  font-size:.9rem;
  line-height:1.4;
}
.howto-list li{
  display:flex;
  align-items:center;
  gap:10px;
}
.howto-ico{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  border-radius:12px;
  background:var(--blush-bg);
  box-shadow:inset 0 0 0 2px var(--ring);
  font-size:1.05rem;
}
.howto-list strong{ color:var(--pink-deep); font-weight:900; }

/* ===================== GAME SCREEN ===================== */
.game-wrap{ display:flex; flex-direction:column; gap:12px; }

.game-brand{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  min-height:44px;
  margin-bottom:-4px;
  font-family:'Fredoka', sans-serif;
  font-weight:600;
  font-size:.95rem;
  color:#fff;
  text-shadow:0 1px 0 rgba(63,163,224,.6), 0 2px 8px rgba(63,163,224,.35);
  letter-spacing:.03em;
}

.hud{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.hud-stat{
  display:flex;
  align-items:center;
  gap:6px;
  background:#fff;
  border-radius:999px;
  padding:4px 12px 4px 5px;
  min-width:86px;
  box-shadow:0 0 0 3px rgba(255,255,255,.7), 0 4px 0 var(--ring-2), 0 8px 16px rgba(214,110,150,.18);
}
.hud-ico{
  flex:0 0 auto;
  display:inline-flex;
  width:32px;
  height:32px;
  border-radius:50%;
  align-items:center;
  justify-content:center;
  background:#fff6dc;
}
.hud-combo .hud-ico{ background:#ffece6; }
.hud-ico svg{ width:22px; height:22px; }
.hud-text{ display:flex; flex-direction:column; line-height:1; }
.hud-label{
  font-size:.62rem;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--ink-soft);
  font-weight:800;
}
.hud-value{
  font-family:'Fredoka', sans-serif;
  font-size:1.25rem;
  font-weight:700;
  color:var(--ink);
  margin-top:2px;
}
.hud-stat.bump{ animation:bump .35s cubic-bezier(.3,1.8,.5,1); }
@keyframes bump{
  0%{ transform:scale(1); }
  40%{ transform:scale(1.14); }
  100%{ transform:scale(1); }
}

.timer-wrap{ flex:1; min-width:0; }
.timer-track{
  position:relative;
  height:30px;
  border-radius:999px;
  background:#fff;
  padding:4px;
  box-shadow:0 0 0 3px rgba(255,255,255,.7), 0 4px 0 var(--ring-2), 0 8px 16px rgba(214,110,150,.18);
}
.timer-track::before{
  /* the empty groove the fill runs along */
  content:"";
  position:absolute;
  inset:4px;
  border-radius:999px;
  background:#f7eef2;
  box-shadow:inset 0 2px 3px rgba(180,110,140,.18);
}
.timer-fill{
  position:absolute;
  top:4px; bottom:4px; left:4px;
  width:100%;
  max-width:calc(100% - 8px);
  background:linear-gradient(180deg, #b6f5cf 0%, var(--leaf) 50%, var(--leaf-deep) 100%);
  transition:width 1s linear, background-color .3s ease;
  border-radius:999px;
  overflow:hidden;
}
.timer-fill.is-warn{ background:linear-gradient(180deg, #ffeaa6 0%, var(--sun) 50%, var(--sun-deep) 100%); }
.timer-fill.is-danger{ background:linear-gradient(180deg, #ffc1cf 0%, #ff7f9c 50%, #ec4f73 100%); animation:pulse .6s ease-in-out infinite; }
.timer-fill::before{
  content:"";
  position:absolute;
  top:2px; left:6px; right:6px;
  height:35%;
  border-radius:999px;
  background:rgba(255,255,255,.55);
}
.timer-fill::after{
  content:"";
  position:absolute;
  inset:0;
  background:repeating-linear-gradient(115deg, rgba(255,255,255,.28) 0 8px, transparent 8px 18px);
  animation:belt-move 1.1s linear infinite;
}
@keyframes belt-move{
  from{ background-position:0 0; }
  to{ background-position:-52px 0; }
}
.timer-marker{
  position:absolute;
  top:50%;
  left:0%;
  width:36px;
  height:36px;
  transform:translate(-50%,-56%);
  transition:left 1s linear;
  pointer-events:none;
  z-index:2;
  animation:marker-hop .9s ease-in-out infinite;
}
@keyframes marker-hop{
  0%,100%{ margin-top:0; }
  50%{ margin-top:-3px; }
}
.timer-marker svg{ width:100%; height:100%; overflow:visible; }
.timer-text{
  position:relative;
  z-index:1;
  display:block;
  text-align:center;
  line-height:22px;
  font-weight:700;
  font-family:'Fredoka', sans-serif;
  font-size:1rem;
  color:#fff;
  paint-order:stroke fill;
  -webkit-text-stroke:4px rgba(91,59,75,.55);
}
@keyframes pulse{
  0%,100%{ filter:brightness(1); }
  50%{ filter:brightness(1.15); }
}

/* floating +score / +time popups */
.floaters{
  position:relative;
  height:0;
  z-index:30;
}
.floater{
  position:absolute;
  left:50%;
  top:0;
  transform:translateX(-50%);
  font-family:'Fredoka', sans-serif;
  font-weight:700;
  font-size:1.35rem;
  color:var(--leaf-deep);
  paint-order:stroke fill;
  -webkit-text-stroke:6px #fff;
  filter:drop-shadow(0 4px 6px rgba(53,184,119,.3));
  animation:float-up 1s cubic-bezier(.2,1.2,.4,1) forwards;
  pointer-events:none;
  white-space:nowrap;
}
.floater.bad{ color:var(--pink-deep); filter:drop-shadow(0 4px 6px rgba(240,100,142,.3)); }
@keyframes float-up{
  0%{ opacity:0; transform:translate(-50%, 10px) scale(.6); }
  20%{ opacity:1; transform:translate(-50%, -6px) scale(1.12); }
  100%{ opacity:0; transform:translate(-50%, -52px) scale(1); }
}

/* ---------- order card ---------- */
.order-card{
  padding:26px 14px 14px;
  background:linear-gradient(160deg, #fff5f8 0%, #ffe7ef 100%);
}
.order-card-tab{
  position:absolute;
  top:-10px;
  left:18px;
  z-index:2;
  background:linear-gradient(180deg, #ffb3c9, var(--pink-deep));
  color:#fff;
  font-family:'Fredoka', sans-serif;
  font-weight:600;
  font-size:.78rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  padding:5px 14px;
  border-radius:999px;
  box-shadow:0 3px 0 var(--pink-lip), 0 6px 10px rgba(240,100,142,.3);
  text-shadow:0 1px 0 rgba(200,60,100,.4);
}
.order-customer{
  display:flex;
  align-items:center;
  gap:12px;
}
.order-customer.order-enter{ animation:order-enter .45s cubic-bezier(.2,1.4,.4,1); }
@keyframes order-enter{
  from{ opacity:0; transform:translateX(24px); }
  to{ opacity:1; transform:translateX(0); }
}
.order-avatar{
  flex:0 0 auto;
  animation:avatar-idle 2.6s ease-in-out infinite;
}
@keyframes avatar-idle{
  0%,100%{ transform:translateY(0) rotate(-2deg); }
  50%{ transform:translateY(-3px) rotate(2deg); }
}
.order-emoji{
  width:70px;
  height:70px;
  padding:5px;
  border-radius:50%;
  background:radial-gradient(circle at 50% 40%, #ffffff 0%, #e2f4ff 70%, #cbe9ff 100%);
  box-shadow:0 0 0 3px #fff, 0 0 0 6px #d6eeff, 0 6px 12px rgba(100,170,230,.25);
  display:flex;
  align-items:center;
  justify-content:center;
}
.order-emoji svg{ width:100%; height:100%; overflow:visible; }
.order-emoji-pop{ animation:badge-pop .35s cubic-bezier(.3,1.6,.5,1); }

/* the order itself is the customer's speech bubble */
.order-info{
  position:relative;
  flex:1;
  min-width:0;
  background:#fff;
  border-radius:18px;
  padding:10px 12px 11px;
  box-shadow:0 3px 0 var(--ring-2), 0 6px 12px rgba(214,110,150,.12);
}
.order-info::before{
  content:"";
  position:absolute;
  left:-7px;
  top:50%;
  width:16px;
  height:16px;
  margin-top:-8px;
  background:#fff;
  border-radius:3px;
  transform:rotate(45deg);
}
.order-name-row{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:6px 8px;
}
.order-name{
  font-family:'Fredoka', sans-serif;
  font-weight:600;
  font-size:1.15rem;
  color:var(--ink);
}
.order-badge{
  font-family:'Fredoka', sans-serif;
  font-weight:600;
  font-size:.66rem;
  text-transform:uppercase;
  letter-spacing:.06em;
  padding:3px 10px;
  border-radius:999px;
  color:#fff;
  white-space:nowrap;
  animation:badge-pop .3s cubic-bezier(.3,1.6,.5,1);
}
.order-badge.tricky{ background:linear-gradient(180deg,#ffe28f,var(--sun-deep)); color:#8a5a0a; box-shadow:0 2px 0 #df9920; }
.order-badge.hard{ background:linear-gradient(180deg,#ffa99b,#f5677a); box-shadow:0 2px 0 #d84a60; }
.order-badge.legendary{ background:linear-gradient(90deg, var(--pink), var(--purple)); box-shadow:0 2px 0 #7b5ce0; }
@keyframes badge-pop{
  0%{ transform:scale(.5); opacity:0; }
  70%{ transform:scale(1.15); opacity:1; }
  100%{ transform:scale(1); }
}
.order-recipe{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  margin-top:7px;
}
.order-recipe .chip{
  display:inline-flex;
  align-items:center;
  gap:3px;
  background:#fdf6f9;
  border-radius:999px;
  padding:2px 10px 2px 3px;
  font-size:.76rem;
  font-weight:800;
  color:var(--ink);
  box-shadow:inset 0 0 0 2px var(--ring);
  animation:chip-in .35s cubic-bezier(.2,1.5,.4,1) both;
}
.order-recipe .chip:nth-child(2){ animation-delay:.04s; }
.order-recipe .chip:nth-child(3){ animation-delay:.08s; }
.order-recipe .chip:nth-child(4){ animation-delay:.12s; }
.order-recipe .chip:nth-child(5){ animation-delay:.16s; }
.order-recipe .chip:nth-child(n+6){ animation-delay:.2s; }
@keyframes chip-in{
  from{ opacity:0; transform:scale(.6); }
  to{ opacity:1; transform:scale(1); }
}
.order-recipe .chip .ing-icon{ width:26px; height:26px; }
.order-recipe .chip .face{ display:none; }

/* ---------- bonus (sequence-locked) orders ---------- */
.order-card.bonus{
  background:linear-gradient(160deg, #fffbe6 0%, #ffefb8 100%);
  box-shadow:
    0 0 0 3px rgba(255,255,255,.85),
    0 0 0 6px #ffe08a,
    var(--soft-shadow);
  animation:bonus-glow 1.4s ease-in-out infinite;
}
@keyframes bonus-glow{
  0%,100%{ box-shadow:0 0 0 3px rgba(255,255,255,.85), 0 0 0 6px #ffe08a, var(--soft-shadow), 0 0 0 rgba(255,200,60,0); }
  50%{ box-shadow:0 0 0 3px rgba(255,255,255,.85), 0 0 0 6px #ffd24d, var(--soft-shadow), 0 0 28px rgba(255,200,60,.75); }
}
.order-card.bonus .order-card-tab{
  background:linear-gradient(180deg, #ffe28f, #ffa83d);
  color:#fff;
  box-shadow:0 3px 0 #e98a1f, 0 6px 10px rgba(245,174,44,.4);
  text-shadow:0 1px 0 rgba(190,110,10,.5);
}
.order-card.bonus .order-emoji{
  background:radial-gradient(circle at 50% 40%, #ffffff 0%, #fff4c6 70%, #ffe596 100%);
  box-shadow:0 0 0 3px #fff, 0 0 0 6px #ffe08a, 0 6px 12px rgba(245,174,44,.3);
}
.bonus-countdown{
  position:absolute;
  top:-10px;
  right:18px;
  z-index:2;
  background:linear-gradient(180deg, #8f7cff, #6c55f0);
  color:#fff;
  font-family:'Fredoka', sans-serif;
  font-weight:600;
  font-size:.8rem;
  padding:5px 12px;
  border-radius:999px;
  box-shadow:0 3px 0 #5240c8, 0 6px 10px rgba(108,85,240,.3);
}
.bonus-countdown.is-low{
  background:linear-gradient(180deg, #ffa3b8, #f0507a);
  box-shadow:0 3px 0 #c8385f, 0 6px 10px rgba(240,80,122,.35);
  animation:pulse .5s ease-in-out infinite, wobble .5s ease-in-out infinite;
}
@keyframes wobble{
  0%,100%{ transform:rotate(0) scale(1); }
  50%{ transform:rotate(-4deg) scale(1.08); }
}
.chip-step{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:17px;
  height:17px;
  border-radius:50%;
  background:#e7d6de;
  color:#fff;
  font-family:'Fredoka', sans-serif;
  font-size:.64rem;
  font-weight:700;
  flex:0 0 auto;
  margin-left:2px;
}
.order-recipe .chip.next{
  background:#fff4c8;
  box-shadow:inset 0 0 0 2px var(--sun-deep), 0 0 12px rgba(255,200,60,.6);
  animation:pulse .5s ease-in-out infinite, next-bounce .9s ease-in-out infinite;
}
@keyframes next-bounce{
  0%,100%{ transform:translateY(0); }
  50%{ transform:translateY(-2px); }
}
.order-recipe .chip.next .chip-step{ background:var(--sun-deep); }
.order-recipe .chip.done{
  background:#dcf7e7;
  box-shadow:inset 0 0 0 2px #a9e8c3;
  opacity:.7;
}
.order-recipe .chip.done .chip-step{ background:var(--leaf-deep); }

/* first-time teaching toast for bonus orders — auto-fades, never repeats */
.bonus-toast{
  position:relative;
  z-index:5;
  margin:-2px 0 2px;
  padding:10px 16px;
  background:linear-gradient(180deg, #ffe28f, #ffa83d);
  color:#fff;
  border-radius:999px;
  font-family:'Fredoka', sans-serif;
  font-weight:600;
  font-size:.88rem;
  text-align:center;
  text-shadow:0 1px 0 rgba(190,110,10,.5);
  box-shadow:0 4px 0 #e98a1f, 0 10px 18px rgba(245,174,44,.35);
  opacity:0;
  transform:translateY(-8px);
}
.rush-toast{
  background:linear-gradient(180deg, #b7a6ff, #8a6ff0);
  text-shadow:0 1px 0 rgba(80,50,180,.45);
  box-shadow:0 4px 0 #6a50d6, 0 10px 18px rgba(108,85,240,.3);
}
.bonus-toast.is-in{ animation:toast-in .35s cubic-bezier(.2,1.5,.4,1) forwards; }
.bonus-toast.is-out{ animation:toast-out .3s ease forwards; }
@keyframes toast-in{ from{ opacity:0; transform:translateY(-8px) scale(.9); } to{ opacity:1; transform:translateY(0) scale(1); } }
@keyframes toast-out{ from{ opacity:1; transform:translateY(0); } to{ opacity:0; transform:translateY(-8px); } }

/* ---------- board / plate ---------- */
.board{
  padding:14px 14px 12px;
  background:
    repeating-linear-gradient(92deg, rgba(210,150,80,.10) 0 2px, transparent 2px 14px, rgba(255,255,255,.18) 14px 16px, transparent 16px 31px),
    linear-gradient(180deg, var(--wood) 0%, var(--wood-2) 100%);
  box-shadow:
    0 0 0 3px rgba(255,255,255,.7),
    0 0 0 6px #f6dcb4,
    0 6px 0 6px #ecc58d,
    0 18px 30px rgba(200,140,70,.25);
  margin-bottom:6px;
}
.board-label{
  display:inline-block;
  font-family:'Fredoka', sans-serif;
  font-weight:600;
  font-size:.78rem;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:#b27a3a;
  background:rgba(255,255,255,.6);
  padding:3px 12px;
  border-radius:999px;
  margin-bottom:9px;
}
.plate{
  position:relative;
  min-height:82px;
  background:radial-gradient(ellipse at 50% 30%, #ffffff 0%, #fffafc 55%, #f7eaf0 100%);
  border-radius:26px;
  display:flex;
  align-items:center;
  gap:6px;
  padding:10px 12px;
  flex-wrap:wrap;
  box-shadow:
    inset 0 0 0 3px #fff,
    inset 0 0 0 6px #f6e6ee,
    inset 0 4px 10px rgba(200,120,150,.12),
    0 4px 0 #e1b57a,
    0 8px 14px rgba(170,110,50,.2);
}
.plate-empty-msg{
  color:var(--ink-faint);
  font-size:.88rem;
  font-weight:700;
  margin:auto;
  animation:hint-breathe 2.4s ease-in-out infinite;
}
@keyframes hint-breathe{
  0%,100%{ opacity:.7; }
  50%{ opacity:1; }
}
.plate .ing-icon{
  width:50px;
  height:50px;
  animation:plop .32s cubic-bezier(.3,1.6,.5,1);
  cursor:pointer;
}
.plate .ing-icon:hover{ transform:translateY(-3px) rotate(-6deg); }
@keyframes plop{
  0%{ transform:translateY(-22px) scale(.4); opacity:0; }
  60%{ transform:translateY(2px) scale(1.12, .9); opacity:1; }
  80%{ transform:translateY(0) scale(.96, 1.04); }
  100%{ transform:translateY(0) scale(1); }
}
.board-actions{
  display:grid;
  grid-template-columns:1fr 2fr;
  gap:10px;
  margin-top:14px;
}
.serve-hint{
  margin:10px 0 0;
  font-size:.72rem;
  color:#b88a55;
  text-align:center;
}
.serve-hint kbd{
  font-family:'Fredoka', sans-serif;
  background:rgba(255,255,255,.7);
  border-radius:6px;
  padding:1px 6px;
  font-size:.7rem;
  color:#9a6a30;
  box-shadow:0 2px 0 rgba(200,140,70,.35);
}
.serve-hint-dark{
  color:var(--ink-soft);
  margin-top:14px;
}
.serve-hint-dark kbd{
  background:var(--blush-bg);
  color:var(--ink);
  box-shadow:0 2px 0 var(--ring-2);
}

/* shake for wrong order */
.shake{ animation:shake .4s ease; }
@keyframes shake{
  0%,100%{ transform:translateX(0); }
  20%{ transform:translateX(-8px) rotate(-1deg); }
  40%{ transform:translateX(7px) rotate(1deg); }
  60%{ transform:translateX(-5px); }
  80%{ transform:translateX(4px); }
}
.celebrate{ animation:celebrate .5s cubic-bezier(.3,1.6,.5,1); }
@keyframes celebrate{
  0%{ transform:scale(1); }
  40%{ transform:scale(1.035) rotate(-1deg); }
  70%{ transform:scale(1.02) rotate(1deg); }
  100%{ transform:scale(1); }
}

/* sparkle burst on a correct serve — little four-point stars */
.sparkle{
  position:absolute;
  left:50%;
  top:40%;
  width:16px;
  height:16px;
  margin:-8px;
  pointer-events:none;
  z-index:5;
  clip-path:polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  filter:drop-shadow(0 0 3px rgba(255,255,255,.9));
  animation:sparkle-burst .65s ease-out forwards;
}
.sparkle:nth-child(odd){ width:11px; height:11px; margin:-5.5px; clip-path:circle(50%); }
@keyframes sparkle-burst{
  0%{ transform:translate(0,0) scale(0) rotate(0); opacity:1; }
  55%{ opacity:1; }
  100%{ transform:translate(var(--dx), var(--dy)) scale(1) rotate(160deg); opacity:0; }
}

/* ---------- palette ---------- */
.palette{
  display:grid;
  grid-template-columns:repeat(5, 1fr);
  gap:8px;
}
.ing-btn{
  --tint:#fff3e8;
  --tint-edge:#f7dcc4;
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  min-width:0;
  background:linear-gradient(180deg, #ffffff 0%, var(--tint) 100%);
  border:none;
  border-radius:var(--radius-md);
  padding:8px 2px 7px;
  cursor:pointer;
  box-shadow:
    0 0 0 2.5px #fff,
    0 0 0 4.5px var(--tint-edge),
    0 5px 0 3px var(--tint-edge),
    0 12px 16px rgba(214,110,150,.14);
  transition:transform .14s cubic-bezier(.3,1.6,.5,1), box-shadow .1s ease;
  animation:tile-in .45s cubic-bezier(.2,1.4,.4,1) both;
}
.ing-btn:nth-child(2){ animation-delay:.03s; }
.ing-btn:nth-child(3){ animation-delay:.06s; }
.ing-btn:nth-child(4){ animation-delay:.09s; }
.ing-btn:nth-child(5){ animation-delay:.12s; }
.ing-btn:nth-child(6){ animation-delay:.15s; }
.ing-btn:nth-child(7){ animation-delay:.18s; }
.ing-btn:nth-child(8){ animation-delay:.21s; }
.ing-btn:nth-child(9){ animation-delay:.24s; }
.ing-btn:nth-child(10){ animation-delay:.27s; }
@keyframes tile-in{
  from{ opacity:0; transform:translateY(14px) scale(.85); }
  to{ opacity:1; transform:translateY(0) scale(1); }
}
.ing-btn:active{
  transform:translateY(5px) scale(.94);
  box-shadow:
    0 0 0 2.5px #fff,
    0 0 0 4.5px var(--tint-edge),
    0 1px 0 3px var(--tint-edge),
    0 4px 6px rgba(214,110,150,.12);
  transition-duration:.05s;
}
.ing-btn span.ing-label{
  max-width:100%;
  font-size:.68rem;
  font-weight:800;
  color:var(--ink);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.ing-btn .ing-icon{ width:46px; height:46px; }
.ing-btn[data-ing="rice"]    { --tint:#fff6ea; --tint-edge:#f3e2c8; }
.ing-btn[data-ing="nori"]    { --tint:#e6f5e9; --tint-edge:#c5e6cd; }
.ing-btn[data-ing="salmon"]  { --tint:#ffece0; --tint-edge:#ffd3b8; }
.ing-btn[data-ing="tuna"]    { --tint:#ffe6eb; --tint-edge:#ffc8d3; }
.ing-btn[data-ing="egg"]     { --tint:#fff7d1; --tint-edge:#ffe596; }
.ing-btn[data-ing="avocado"] { --tint:#f0f9da; --tint-edge:#d6edaa; }
.ing-btn[data-ing="cucumber"]{ --tint:#e6f8e6; --tint-edge:#c3ebc4; }
.ing-btn[data-ing="shrimp"]  { --tint:#fff0e8; --tint-edge:#ffd6c4; }
.ing-btn[data-ing="roe"]     { --tint:#ffefdc; --tint-edge:#ffd2a6; }
.ing-btn[data-ing="crab"]    { --tint:#ffeaea; --tint-edge:#ffcaca; }
.ing-btn[data-ing="eel"]     { --tint:#fbeedd; --tint-edge:#ecc9a0; }
.ing-btn[data-ing="scallop"] { --tint:#fff8ef; --tint-edge:#f1dcc0; }
.ing-btn[data-ing="octopus"] { --tint:#ffe8ef; --tint-edge:#f9c4d4; }
.ing-btn[data-ing="wasabi"]  { --tint:#effae0; --tint-edge:#cfeaa6; }

.key-badge{
  position:absolute;
  top:4px;
  left:4px;
  width:16px;
  height:16px;
  border-radius:50%;
  background:rgba(255,255,255,.9);
  color:var(--ink-soft);
  font-family:'Fredoka', sans-serif;
  font-size:.6rem;
  font-weight:700;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:1;
  box-shadow:0 0 0 1.5px var(--tint-edge);
}

/* ===================== INGREDIENT ICONS ===================== */
/* Inline SVG built by script.js; each bakes in its own soft ground
   shadow, so the wrapper only handles size and hover motion. */
.ing-icon{
  width:52px;
  height:52px;
  flex:0 0 auto;
  display:block;
  transition:transform .18s cubic-bezier(.3,1.6,.5,1);
}
.ing-icon svg{ width:100%; height:100%; display:block; overflow:visible; }
.ing-btn:hover .ing-icon{ transform:translateY(-3px) scale(1.08) rotate(-4deg); }

/* ===================== GAME OVER ===================== */
.over-hero{
  text-align:center;
  padding:48px 0 4px;
}
.over-stars{
  display:flex;
  justify-content:center;
  align-items:flex-end;
  gap:6px;
  margin-bottom:6px;
}
.over-stars span{
  display:inline-block;
  font-size:2.4rem;
  line-height:1;
  color:var(--sun);
  -webkit-text-stroke:3px #f5ae2c;
  paint-order:stroke fill;
  filter:drop-shadow(0 4px 6px rgba(245,174,44,.4));
  animation:star-pop .6s cubic-bezier(.2,1.6,.4,1) both, star-twinkle 2.4s ease-in-out infinite;
}
.over-stars span:nth-child(1){ animation-delay:.1s, .7s; transform:rotate(-12deg); }
.over-stars span:nth-child(2){ font-size:3.2rem; animation-delay:.25s, 1s; margin-bottom:8px; }
.over-stars span:nth-child(3){ animation-delay:.4s, 1.3s; transform:rotate(12deg); }
@keyframes star-pop{
  from{ opacity:0; scale:0; }
  to{ opacity:1; scale:1; }
}
@keyframes star-twinkle{
  0%,100%{ filter:drop-shadow(0 4px 6px rgba(245,174,44,.4)) brightness(1); }
  50%{ filter:drop-shadow(0 0 12px rgba(255,220,120,.9)) brightness(1.08); }
}
.title-over{ font-size:2.9rem; }

.over-panel{ margin-top:10px; }

.final-score-card{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:2px;
  background:linear-gradient(180deg, #fff5f8, #ffe8f0);
  border-radius:var(--radius-lg);
  box-shadow:inset 0 0 0 2px var(--ring);
  padding:16px;
  margin:0 0 14px;
}
.final-score{
  font-family:'Fredoka', sans-serif;
  font-size:3.4rem;
  line-height:1.05;
  font-weight:700;
  color:var(--pink-deep);
  paint-order:stroke fill;
  -webkit-text-stroke:6px #fff;
  filter:drop-shadow(0 4px 8px rgba(240,100,142,.25));
  animation:score-pop .7s cubic-bezier(.2,1.6,.4,1) .2s both;
}
@keyframes score-pop{
  from{ opacity:0; transform:scale(.3); }
  to{ opacity:1; transform:scale(1); }
}
.final-best{
  font-size:.88rem;
  color:var(--ink-soft);
  font-weight:800;
}

.new-record{
  background:linear-gradient(180deg, #fffbe6, #fff1c2);
  border-radius:var(--radius-md);
  box-shadow:inset 0 0 0 2px #ffe08a;
  padding:12px 14px;
  margin-bottom:16px;
  text-align:left;
  animation:modal-pop .5s cubic-bezier(.2,1.5,.4,1);
}
.new-record p{ margin:0 0 8px; font-weight:800; font-size:.92rem; color:#9a6412; }
#form-name{ display:flex; gap:8px; }
#input-name{
  flex:1;
  min-width:0;
  border:none;
  border-radius:999px;
  padding:10px 16px;
  font-family:inherit;
  font-weight:800;
  font-size:.95rem;
  color:var(--ink);
  background:#fff;
  box-shadow:inset 0 0 0 2px #ffe08a, inset 0 2px 4px rgba(200,150,40,.12);
}
#input-name::placeholder{ color:var(--ink-faint); }
#input-name:focus{ outline:none; box-shadow:inset 0 0 0 2.5px var(--sun-deep), 0 0 0 4px rgba(255,211,107,.35); }

#btn-again{ margin:18px 0 0; }

/* ===================== RESPONSIVE ===================== */
/* keyboard hints are noise on touch-only devices */
@media (hover:none) and (pointer:coarse){
  .board .serve-hint{ display:none; }
  .key-badge{ display:none; }
}

@media (max-width:380px){
  .title{ font-size:2.7rem; -webkit-text-stroke-width:8px; }
  .title-over{ font-size:2.4rem; }
  .ing-btn .ing-icon{ width:40px; height:40px; }
  .ing-btn span.ing-label{ font-size:.62rem; }
  .plate .ing-icon{ width:44px; height:44px; }
  .order-emoji{ width:58px; height:58px; }
  .hud-stat{ min-width:0; padding-right:9px; }
  .hud-ico{ width:28px; height:28px; }
  .palette{ gap:7px; }
  .mascot{ width:78px; height:78px; }
}

@media (max-width:330px){
  .palette{ grid-template-columns:repeat(4, 1fr); }
}

@media (prefers-reduced-motion:reduce){
  .cloud, .petal, .sun-glow, .logo, .mascot, .mascot .m-hat,
  .order-avatar, .timer-marker, .btn-lg::before, .critter-wave span{
    animation:none !important;
  }
  .petals{ display:none; }
}

/* ===================== MODE SELECT ===================== */
.mode-select{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin:0 0 16px;
}
.mode-card{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:1px;
  padding:12px 8px 11px;
  border:none;
  border-radius:var(--radius-md);
  background:#fff;
  color:var(--ink);
  cursor:pointer;
  box-shadow:0 0 0 2.5px var(--ring), 0 4px 0 var(--ring-2), 0 8px 14px rgba(214,110,150,.12);
  transition:transform .16s cubic-bezier(.3,1.6,.5,1), box-shadow .12s ease, background .2s ease;
}
.mode-card:hover{ transform:translateY(-2px); }
.mode-card:active{ transform:translateY(3px) scale(.97); }
.mode-card.is-selected{
  background:linear-gradient(180deg, #fff6f9, #ffe3ec);
  box-shadow:0 0 0 3px var(--pink), 0 4px 0 var(--pink-deep), 0 10px 18px rgba(240,100,142,.25);
}
.mode-card.is-selected .mode-ico{ animation:mode-bounce 1.6s ease-in-out infinite; }
@keyframes mode-bounce{
  0%,100%{ transform:translateY(0) rotate(-6deg); }
  50%{ transform:translateY(-4px) rotate(6deg); }
}
.mode-ico{ font-size:1.6rem; line-height:1.2; display:inline-block; }
.mode-name{ font-family:'Fredoka', sans-serif; font-weight:600; font-size:1.05rem; }
.mode-desc{ font-size:.74rem; font-weight:800; color:var(--ink-soft); }
.mode-new{
  position:absolute;
  top:-9px;
  right:-4px;
  padding:2px 8px;
  border-radius:999px;
  background:linear-gradient(180deg, #ffe28f, #ffa83d);
  color:#fff;
  font-family:'Fredoka', sans-serif;
  font-weight:600;
  font-size:.64rem;
  letter-spacing:.06em;
  text-transform:uppercase;
  text-shadow:0 1px 0 rgba(190,110,10,.5);
  box-shadow:0 2px 0 #e98a1f;
  transform:rotate(8deg);
}
.mode-card:focus-visible{ outline:3px solid var(--purple); outline-offset:3px; }

.lb-mode{
  font-family:'Nunito', sans-serif;
  font-size:.7rem;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.06em;
  color:var(--pink-deep);
  background:var(--blush-bg);
  padding:2px 8px;
  border-radius:999px;
  box-shadow:inset 0 0 0 1.5px var(--ring);
}
.howto-sub{
  font-family:'Fredoka', sans-serif;
  font-weight:600;
  font-size:1.05rem;
  color:var(--pink-deep);
  margin:-4px 0 10px;
}
.over-mode{
  display:inline-block;
  margin-top:-2px;
  padding:3px 12px;
  border-radius:999px;
  background:rgba(255,255,255,.75);
  color:var(--pink-deep);
  font-family:'Fredoka', sans-serif;
  font-weight:600;
  font-size:.82rem;
  letter-spacing:.04em;
}


/* ===================== CONVEYOR MODE ===================== */
.belt,
.lives-wrap{ display:none; }
.mode-belt .belt{ display:block; }
.mode-belt .lives-wrap{ display:flex; }
.mode-belt .timer-wrap,
.mode-belt .order-card{ display:none; }

.lives-wrap{
  flex:1;
  justify-content:center;
  align-items:center;
  gap:4px;
  height:38px;
  background:#fff;
  border-radius:999px;
  box-shadow:0 0 0 3px rgba(255,255,255,.7), 0 4px 0 var(--ring-2), 0 8px 16px rgba(214,110,150,.18);
}
.heart{ display:inline-flex; width:26px; height:26px; }
.heart svg{ width:100%; height:100%; overflow:visible; }
.heart.full .heart-fill{ fill:#ff7f9c; stroke:#ec4f73; }
.heart.full{ animation:heart-beat 1.2s ease-in-out infinite; }
.heart.full:nth-child(2){ animation-delay:.1s; }
.heart.full:nth-child(3){ animation-delay:.2s; }
.heart.empty .heart-fill{ fill:#f3e6ec; stroke:#e5cfd9; }
.heart.empty .heart-shine{ opacity:.4; }
.heart.break{ animation:heart-break .6s cubic-bezier(.3,1.6,.5,1); }
@keyframes heart-beat{
  0%,100%{ transform:scale(1); }
  15%{ transform:scale(1.14); }
  30%{ transform:scale(1); }
}
@keyframes heart-break{
  0%{ transform:scale(1.5) rotate(0); }
  30%{ transform:scale(1.2) rotate(-18deg); }
  60%{ transform:scale(.8) rotate(12deg); }
  100%{ transform:scale(1) rotate(0); }
}

.belt{
  position:relative;
  padding:10px 0;
  border-radius:var(--radius-xl);
  background:linear-gradient(180deg, #eef6ff 0%, #dcecff 100%);
  box-shadow:
    0 0 0 3px rgba(255,255,255,.85),
    0 0 0 6px #d3e6fb,
    0 14px 26px rgba(100,150,220,.18);
}
.belt-track{
  --plate-w:150px;
  position:relative;
  height:156px;
  overflow:hidden;
  /* the moving belt: soft slats scrolled by script.js in sync with plates */
  background:
    linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0) 30%, rgba(120,150,200,.10) 100%),
    repeating-linear-gradient(90deg, #cfdcee 0 3px, #e3ecf8 3px 40px);
  box-shadow:inset 0 3px 0 #bccde4, inset 0 -3px 0 #bccde4, inset 0 6px 10px rgba(80,110,160,.12);
  -webkit-mask-image:linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
          mask-image:linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}
.belt-slot{
  position:absolute;
  top:14px;
  left:0;
  width:var(--plate-w);
  will-change:transform;
}
.belt-plate{
  --rim:#8fd6a8;
  --rim-deep:#5bbf82;
  --ic:44px;
  --cols:2;
  position:relative;
  height:128px;
  padding:8px;
  border-radius:22px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:radial-gradient(ellipse at 50% 40%, #ffffff 0%, #fffafc 60%, #f8eef3 100%);
  box-shadow:
    inset 0 0 0 3px #fff,
    inset 0 0 0 5px #f6ecf1,
    0 0 0 3px var(--rim),
    0 5px 0 3px var(--rim-deep),
    0 12px 16px rgba(80,110,160,.22);
  animation:plate-in .45s cubic-bezier(.2,1.5,.4,1);
}
/* icon size + grid by how many pieces the order has */
.belt-plate.n-1,
.belt-plate.n-2{ --ic:52px; --cols:2; }
.belt-plate.n-3,
.belt-plate.n-4{ --ic:46px; --cols:2; }
.belt-plate.n-5,
.belt-plate.n-6{ --ic:41px; --cols:3; }
.belt-plate.n-7,
.belt-plate.n-8,
.belt-plate.n-9{ --ic:36px; --cols:3; }
.belt-plate.n-10{ --ic:31px; --cols:4; }

/* kaiten-style plate colours by size */
.belt-plate.rim-3{ --rim:#8cc8ff; --rim-deep:#5aa6e8; }
.belt-plate.rim-4{ --rim:#ffb0c6; --rim-deep:#ef7e9e; }
.belt-plate.rim-5{ --rim:#c5b3ff; --rim-deep:#9c84f0; }
.belt-plate.rim-6,
.belt-plate.rim-7{ --rim:#ffab8f; --rim-deep:#ee7f5c; }
.belt-plate.gold{
  --rim:#ffd35a;
  --rim-deep:#eda52a;
  background:radial-gradient(ellipse at 50% 40%, #fffdf0 0%, #fff3c9 100%);
}
.belt-plate.gold::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  background:linear-gradient(100deg, rgba(255,255,255,0) 30%, rgba(255,255,255,.75) 45%, rgba(255,255,255,0) 60%) -150% 0/250% 100% no-repeat;
  animation:gold-sheen 2.2s ease-in-out infinite;
  pointer-events:none;
}
@keyframes gold-sheen{
  0%,40%{ background-position:-150% 0; }
  100%{ background-position:150% 0; }
}
@keyframes plate-in{
  from{ transform:scale(.7) rotate(-6deg); }
  to{ transform:scale(1) rotate(0); }
}
/* the customer rides on the plate's corner as a little badge */
.bp-avatar{
  position:absolute;
  top:-10px;
  left:-8px;
  z-index:2;
  width:34px;
  height:34px;
  border-radius:50%;
  background:radial-gradient(circle at 50% 40%, #fff 0%, #e2f4ff 75%);
  box-shadow:0 0 0 2.5px #fff, 0 0 0 4.5px var(--rim), 0 3px 6px rgba(80,110,160,.25);
  padding:1px;
}
.bp-avatar svg{ width:100%; height:100%; overflow:visible; }
.bp-gold{
  position:absolute;
  top:-10px;
  right:-6px;
  z-index:2;
  width:26px;
  height:26px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  background:linear-gradient(180deg, #ffe58f, #ffb730);
  color:#fff;
  font-size:.95rem;
  text-shadow:0 1px 0 rgba(190,110,10,.5);
  box-shadow:0 0 0 2.5px #fff, 0 3px 6px rgba(200,140,30,.35);
  animation:star-spin 3s ease-in-out infinite;
}
@keyframes star-spin{
  0%,100%{ transform:rotate(-10deg) scale(1); }
  50%{ transform:rotate(10deg) scale(1.12); }
}
.bp-items{
  display:grid;
  grid-template-columns:repeat(var(--cols), var(--ic));
  gap:2px 3px;
  justify-content:center;
  align-content:center;
}
.bp-items .ing-icon{ width:var(--ic); height:var(--ic); }
/* faces only where the icons are big enough for them to read */
.belt-plate:not(.n-1):not(.n-2):not(.n-3):not(.n-4) .bp-items .face{ display:none; }

/* about to fall off the end */
.belt-plate.hurry{
  box-shadow:0 0 0 3px #ff7f9c, 0 5px 0 3px #ec4f73, 0 0 18px rgba(240,80,122,.55);
  animation:plate-hurry .5s ease-in-out infinite;
}
@keyframes plate-hurry{
  0%,100%{ transform:rotate(-2deg); }
  50%{ transform:rotate(2deg) scale(1.03); }
}
.belt-plate.served{ animation:plate-served .5s cubic-bezier(.3,1.4,.5,1) forwards; }
@keyframes plate-served{
  0%{ transform:scale(1); opacity:1; }
  35%{ transform:scale(1.15) translateY(-6px); opacity:1; }
  100%{ transform:scale(.6) translateY(-60px); opacity:0; }
}
.belt-plate.missed{ animation:plate-missed .5s ease-in forwards; }
@keyframes plate-missed{
  0%{ transform:rotate(0); opacity:1; }
  100%{ transform:translate(-30px, 60px) rotate(-35deg); opacity:0; }
}

.belt-toast{
  background:linear-gradient(180deg, #9fd8ff, #5fb8f5);
  text-shadow:0 1px 0 rgba(40,120,180,.45);
  box-shadow:0 4px 0 #3fa3e0, 0 10px 18px rgba(63,163,224,.3);
}

@media (max-width:380px){
  .belt-track{ --plate-w:140px; }
  .belt-plate.n-10{ --ic:28px; }
  .belt-plate.n-7, .belt-plate.n-8, .belt-plate.n-9{ --ic:34px; }
  .mode-desc{ font-size:.68rem; }
}
@media (prefers-reduced-motion:reduce){
  .heart.full, .mode-card.is-selected .mode-ico, .belt-plate.hurry{ animation:none !important; }
}

/* ===================== NAVIGATION ===================== */
/* pause lives top-left during a shift; mute stays top-right */
.pause-toggle{
  right:auto;
  left:max(14px, calc(50% - 260px + 14px));
  display:none;
}
body[data-screen="game"] .pause-toggle{ display:flex; }
body[data-screen="splash"] #btn-mute{ display:none; }

.over-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:14px;
}
.over-actions .btn{ padding:10px 12px; font-size:.95rem; }

.pause-card{ max-width:340px; text-align:center; }
.pause-card h2{ margin-bottom:6px; }
.pause-cat{
  font-size:2.2rem;
  line-height:1;
  margin-bottom:4px;
  animation:bob 2.4s ease-in-out infinite;
}
.pause-mode{ margin-bottom:16px; background:var(--blush-bg); box-shadow:inset 0 0 0 1.5px var(--ring); }
.pause-actions{ display:flex; flex-direction:column; gap:12px; }
.pause-actions .btn{ padding:12px 20px; }

/* ===================== SPLASH ===================== */
#screen-splash{ cursor:pointer; }
.splash{
  min-height:calc(100vh - 42px);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:14px;
  padding:10px 0 20px;
  text-align:center;
}
.splash-logo{
  display:flex;
  flex-direction:column;
  align-items:center;
  animation:splash-drop .8s cubic-bezier(.2,1.5,.4,1) both, logo-float 3.4s ease-in-out .8s infinite;
}
.splash-title{ font-size:3.8rem; }
@keyframes splash-drop{
  from{ opacity:0; transform:translateY(-60px) scale(.6); }
  to{ opacity:1; transform:translateY(0) scale(1); }
}
.splash-scene{
  width:100%;
  max-width:420px;
  border-radius:36px;
  box-shadow:0 0 0 4px rgba(255,255,255,.9), 0 0 0 8px var(--ring), 0 20px 40px rgba(214,110,150,.22);
  animation:splash-scene-in .8s cubic-bezier(.2,1.3,.4,1) .15s both;
}
@keyframes splash-scene-in{
  from{ opacity:0; transform:scale(.85) translateY(20px); }
  to{ opacity:1; transform:scale(1) translateY(0); }
}
.splash-svg{ display:block; width:100%; height:auto; overflow:visible; }
.splash-svg .sp-rays{ transform-box:view-box; transform-origin:180px 150px; animation:rays-spin 40s linear infinite; }
@keyframes rays-spin{ to{ transform:rotate(360deg); } }
.splash-svg .sp-bob{ transform-box:fill-box; transform-origin:50% 100%; animation:sp-bob 2.2s ease-in-out infinite; }
@keyframes sp-bob{
  0%,100%{ transform:translateY(0) scale(1, 1); }
  45%{ transform:translateY(-8px) scale(.98, 1.03); }
  60%{ transform:translateY(0) scale(1.05, .95); }
}
.splash-svg .sp-peek{ transform-box:fill-box; transform-origin:50% 100%; animation:sp-peek 3.2s ease-in-out infinite; filter:drop-shadow(0 6px 10px rgba(184,106,136,.3)) drop-shadow(0 0 1px rgba(184,106,136,.5)); }
@keyframes sp-peek{
  0%,100%{ transform:translateY(0) rotate(-3deg); }
  50%{ transform:translateY(-5px) rotate(3deg); }
}
.splash-svg .m-eyes{ transform-box:fill-box; transform-origin:center; animation:blink 4.2s ease-in-out infinite; }
.splash-svg .m-hat{ transform-box:fill-box; transform-origin:50% 100%; animation:hat-wiggle 3s ease-in-out infinite; }
.splash-svg .sp-twinkle{ transform-box:fill-box; transform-origin:center; animation:sp-twinkle 2.4s ease-in-out infinite; filter:drop-shadow(0 0 3px rgba(255,200,120,.9)); }
@keyframes sp-twinkle{
  0%,100%{ opacity:.2; scale:.5; }
  50%{ opacity:1; scale:1.2; }
}
.splash-svg .sp-flower{ transform-box:fill-box; transform-origin:center; animation:sp-flower 5s ease-in-out infinite; }
@keyframes sp-flower{
  0%,100%{ transform:rotate(-8deg); }
  50%{ transform:rotate(8deg); }
}

.splash-loader{
  width:180px;
  height:12px;
  padding:3px;
  border-radius:999px;
  background:#fff;
  box-shadow:0 0 0 3px var(--ring), 0 4px 10px rgba(214,110,150,.15);
  animation:loader-out .3s ease 1.9s forwards;
}
.splash-loader span{
  display:block;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg, var(--pink), #ffb3c9, var(--sun));
  animation:loader-fill 1.6s cubic-bezier(.5,0,.3,1) .3s both;
}
@keyframes loader-fill{ from{ width:0; } to{ width:100%; } }
@keyframes loader-out{ to{ opacity:0; height:0; padding:0; margin:-7px 0; } }
.splash-tap{
  font-family:'Fredoka', sans-serif;
  font-weight:600;
  font-size:1.25rem;
  color:#fff;
  padding:12px 34px;
  border:none;
  border-radius:999px;
  background:linear-gradient(180deg, #ffb3c9 0%, var(--pink) 45%, var(--pink-deep) 100%);
  box-shadow:0 5px 0 var(--pink-lip), 0 12px 20px rgba(240,100,142,.35);
  text-shadow:0 1px 0 rgba(200,60,100,.45);
  cursor:pointer;
  opacity:0;
  animation:tap-in .5s cubic-bezier(.2,1.5,.4,1) 1.9s forwards, tap-pulse 1.4s ease-in-out 2.4s infinite;
}
@keyframes tap-in{ from{ opacity:0; transform:scale(.6); } to{ opacity:1; transform:scale(1); } }
@keyframes tap-pulse{
  0%,100%{ transform:scale(1); }
  50%{ transform:scale(1.07); }
}

/* ===================== CONVEYOR LAYOUT ===================== */
/* the belt grew for bigger plates, so the board gives a little back */
.mode-belt .board{ padding:10px 12px 10px; }
.mode-belt .board-label{ display:none; }
.mode-belt .plate{ min-height:72px; }
.mode-belt .board-actions{ margin-top:10px; }

@media (max-width:380px){
  .splash-title{ font-size:3.1rem; }
}
@media (prefers-reduced-motion:reduce){
  .splash-svg *, .splash-logo, .splash-tap, .pause-cat{ animation:none !important; }
  .splash-tap{ opacity:1; }
}

/* teaching / rush toasts float over the order area instead of pushing
   the whole layout down while they're visible */
.game-wrap{ position:relative; }
.bonus-toast{
  position:absolute;
  left:8px;
  right:8px;
  top:118px;
  z-index:20;
  margin:0;
  pointer-events:none;
}

/* ===================== PUZZLES: HOME + MENU ===================== */
.mode-select{ grid-template-columns:repeat(3, 1fr); gap:8px; }
.mode-card{ padding:11px 4px 10px; }
.mode-name{ font-size:.98rem; }
.mode-desc{ font-size:.68rem; }

.puzzle-summary{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:20px;
  padding:12px 14px;
  border-radius:var(--radius-md);
  background:linear-gradient(180deg, #f6f1ff, #ece4ff);
  box-shadow:inset 0 0 0 2px #ddd0ff;
  text-align:left;
}
.ps-ico{ font-size:1.7rem; }
.ps-text{ flex:1; display:flex; flex-direction:column; font-family:'Fredoka', sans-serif; font-weight:600; font-size:1.02rem; }
.ps-text small{ font-family:'Nunito', sans-serif; font-weight:800; font-size:.72rem; color:var(--ink-soft); }
.ps-stars{ font-family:'Fredoka', sans-serif; font-weight:600; color:#e8a020; font-size:1rem; white-space:nowrap; }
.ps-stars b{ color:var(--ink); font-weight:600; }

.pause-switch{ margin-top:2px; }
.pause-switch-label{ display:block; font-size:.72rem; font-weight:900; letter-spacing:.06em; text-transform:uppercase; color:var(--ink-soft); margin-bottom:6px; }
.pause-chips{ display:grid; grid-template-columns:repeat(3, 1fr); gap:6px; }
.pause-chip{
  border:none;
  border-radius:14px;
  padding:9px 4px;
  background:#fff;
  color:var(--ink);
  font-family:'Fredoka', sans-serif;
  font-weight:600;
  font-size:.82rem;
  cursor:pointer;
  box-shadow:0 0 0 2px var(--ring), 0 3px 0 var(--ring-2);
  transition:transform .14s cubic-bezier(.3,1.6,.5,1);
}
.pause-chip:active{ transform:translateY(2px) scale(.96); }
.pause-chip.is-current{ background:var(--blush-bg); color:var(--pink-deep); box-shadow:0 0 0 2px var(--pink); cursor:default; }
body[data-screen="puzzle"] .pause-toggle{ display:flex; }

/* ===================== PUZZLES: LEVEL MAP ===================== */
.levels-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding-right:58px; /* room for the mute button */
  min-height:44px;
}
.levels-stars{
  font-family:'Fredoka', sans-serif;
  font-weight:600;
  color:#e8a020;
  background:#fff;
  padding:6px 14px;
  border-radius:999px;
  box-shadow:0 0 0 2.5px #ffe7a8, 0 3px 0 #ffd77a;
}
.levels-hero{ text-align:center; padding:10px 0 14px; }
.levels-ico{ font-size:2.4rem; animation:bob 2.4s ease-in-out infinite; }
.levels-title{ font-size:2.5rem; margin:2px 0 10px; }
.level-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
.level-tile{
  position:relative;
  display:grid;
  grid-template-columns:auto 1fr;
  grid-template-rows:auto auto auto;
  column-gap:10px;
  align-items:center;
  text-align:left;
  padding:12px 12px 10px;
  border:none;
  border-radius:var(--radius-md);
  background:#fff;
  color:var(--ink);
  cursor:pointer;
  box-shadow:0 0 0 2.5px #e2d7ff, 0 5px 0 #cfc0ff, 0 10px 18px rgba(140,110,220,.14);
  transition:transform .16s cubic-bezier(.3,1.6,.5,1);
  animation:tile-in .45s cubic-bezier(.2,1.4,.4,1) both;
}
.level-tile:nth-child(2){ animation-delay:.03s; } .level-tile:nth-child(3){ animation-delay:.06s; }
.level-tile:nth-child(4){ animation-delay:.09s; } .level-tile:nth-child(5){ animation-delay:.12s; }
.level-tile:nth-child(n+6){ animation-delay:.15s; }
.level-tile:hover:not(:disabled){ transform:translateY(-2px); }
.level-tile:active:not(:disabled){ transform:translateY(3px) scale(.97); }
.lt-num{
  grid-row:1 / span 3;
  width:42px;
  height:42px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-family:'Fredoka', sans-serif;
  font-weight:700;
  font-size:1.3rem;
  color:#fff;
  background:linear-gradient(180deg, #b7a6ff, #8a6ff0);
  box-shadow:0 3px 0 #6a50d6;
}
.lt-name{ font-family:'Fredoka', sans-serif; font-weight:600; font-size:.98rem; line-height:1.1; }
.lt-blurb{ font-size:.7rem; font-weight:800; color:var(--ink-soft); line-height:1.2; }
.lt-stars{ display:flex; gap:1px; margin-top:2px; }
.lt-stars i{ font-style:normal; color:#eadff0; font-size:.95rem; }
.lt-stars i.on{ color:#ffc53d; text-shadow:0 1px 0 #e8a020; }
.level-tile.is-done .lt-num{ background:linear-gradient(180deg, #ffe28f, #ffa83d); box-shadow:0 3px 0 #e98a1f; }
.level-tile.is-locked{ cursor:default; opacity:.6; box-shadow:0 0 0 2.5px #eee6ee, 0 5px 0 #e6dbe6; }
.level-tile.is-locked .lt-num{ background:#efe6ee; box-shadow:0 3px 0 #e0d3df; font-size:1.05rem; }
.level-tile.is-soon .lt-blurb{ color:#b39bd6; }

/* ===================== PUZZLES: BOARD ===================== */
.pz-wrap{ display:flex; flex-direction:column; gap:12px; }
.pz-head{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  min-height:44px;
  padding:0 58px; /* pause (left) + mute (right) */
}
.pz-titles{ width:100%; min-width:0; text-align:center; padding-top:4px; }
.pz-title{ font-family:'Fredoka', sans-serif; font-weight:600; font-size:1.05rem; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pz-sub{ font-size:.72rem; font-weight:800; color:var(--ink-soft); }
.pz-version{ padding:4px 12px; font-size:.76rem; }

.pz-guests{ display:flex; flex-direction:column; gap:10px; margin-top:8px; }
.pz-guest{
  position:relative;
  display:grid;
  grid-template-columns:52px 1fr;
  grid-template-areas:"head clues" "plate plate";
  gap:6px 10px;
  padding:10px 12px 12px;
  border-radius:var(--radius-lg);
  background:linear-gradient(160deg, #ffffff, #fff6f9);
  box-shadow:0 0 0 2.5px var(--ring), 0 4px 0 var(--ring-2), 0 10px 18px rgba(214,110,150,.12);
  cursor:pointer;
  transition:box-shadow .15s ease, transform .15s ease;
}
.pz-guest.is-selected{
  background:linear-gradient(160deg, #fff9fb, #ffeaf1);
  box-shadow:0 0 0 3px var(--pink), 0 4px 0 var(--pink-deep), 0 10px 20px rgba(240,100,142,.22);
}
.pz-guest.is-happy{ animation:guest-happy .6s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes guest-happy{
  0%{ transform:scale(1); }
  40%{ transform:scale(1.04) translateY(-4px); }
  100%{ transform:scale(1); }
}
.pz-guest-head{ grid-area:head; display:flex; flex-direction:column; align-items:center; gap:1px; }
.pz-avatar{
  width:48px;
  height:48px;
  border-radius:50%;
  padding:3px;
  background:radial-gradient(circle at 50% 40%, #fff 0%, #e2f4ff 75%);
  box-shadow:0 0 0 2.5px #fff, 0 0 0 4.5px #d6eeff;
}
.pz-guest.is-selected .pz-avatar{ animation:avatar-idle 2.6s ease-in-out infinite; }
.pz-avatar svg{ width:100%; height:100%; overflow:visible; }
.pz-name{ font-family:'Fredoka', sans-serif; font-weight:600; font-size:.78rem; color:var(--ink-soft); }

.pz-clues{
  grid-area:clues;
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:4px;
  align-self:center;
}
.pz-clue{
  display:flex;
  align-items:center;
  gap:7px;
  padding:4px 10px 4px 5px;
  border-radius:12px;
  background:#fff;
  box-shadow:inset 0 0 0 1.5px var(--ring);
  font-size:.86rem;
  font-weight:700;
  line-height:1.2;
  transition:background .2s ease, box-shadow .2s ease;
}
.pz-clue b{ font-weight:900; }
.pz-clue.is-ok{ background:#e6f8ee; box-shadow:inset 0 0 0 1.5px #a9e6c3; }
.pz-clue.is-ok::after{ content:"✓"; margin-left:auto; color:var(--leaf-deep); font-weight:900; }
.pz-clue.is-fail{ background:#ffe9ee; box-shadow:inset 0 0 0 2px #ff9db3; animation:shake .4s ease; }
.pz-clue.is-fail::after{ content:"✗"; margin-left:auto; color:#e2476d; font-weight:900; }
.clue-num,
.clue-swatch,
.clue-ing,
.clue-avatar{
  flex:0 0 auto;
  position:relative;
  width:26px;
  height:26px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.clue-num{
  border-radius:50%;
  background:linear-gradient(180deg, #b7a6ff, #8a6ff0);
  color:#fff;
  font-family:'Fredoka', sans-serif;
  font-weight:700;
  font-size:.9rem;
}
.clue-swatch{
  border-radius:50%;
  background:radial-gradient(circle at 35% 30%, #fff 0 12%, var(--sw) 45%);
  box-shadow:0 0 0 2px #fff, 0 0 0 3.5px rgba(0,0,0,.06);
  font-size:.8rem;
}
.clue-swatch.is-sea{ background:radial-gradient(circle at 35% 30%, #fff 0 10%, #d4ecff 55%); }
.clue-ing .ing-icon{ width:26px; height:26px; }
.clue-ing .face{ display:none; }
.clue-avatar svg{ width:100%; height:100%; overflow:visible; }
.is-no::after{
  content:"";
  position:absolute;
  left:-1px; right:-1px;
  top:50%;
  height:3px;
  margin-top:-1.5px;
  border-radius:3px;
  background:#f05a7e;
  box-shadow:0 0 0 1.5px #fff;
  transform:rotate(-40deg);
}

.pz-plate{
  grid-area:plate;
  display:flex;
  align-items:center;
  gap:6px;
  min-height:62px;
  padding:6px 10px;
  border-radius:20px;
  background:radial-gradient(ellipse at 50% 30%, #ffffff 0%, #fffafc 55%, #f7eaf0 100%);
  box-shadow:inset 0 0 0 3px #fff, inset 0 0 0 5px #f6e6ee, 0 3px 0 #efd8e2;
}
.pz-guest.is-selected .pz-plate{ box-shadow:inset 0 0 0 3px #fff, inset 0 0 0 5px #ffc9d8, 0 3px 0 #f6b7c9; }
.pz-plate .ing-icon{ width:48px; height:48px; animation:plop .32s cubic-bezier(.3,1.6,.5,1); cursor:pointer; }
.pz-plate .ing-icon.is-locked{ cursor:default; filter:drop-shadow(0 0 5px rgba(255,200,60,.9)); }
.pz-plate .ing-icon.is-hinted{ animation:hint-pop .6s cubic-bezier(.3,1.6,.5,1); }
@keyframes hint-pop{
  0%{ transform:scale(0) rotate(-30deg); }
  60%{ transform:scale(1.3) rotate(8deg); }
  100%{ transform:scale(1) rotate(0); }
}
.pz-plate-empty{ margin:auto; color:var(--ink-faint); font-size:.82rem; font-weight:800; }

.pz-pantry-wrap{
  padding:10px 10px 12px;
  border-radius:var(--radius-lg);
  background:
    repeating-linear-gradient(92deg, rgba(210,150,80,.10) 0 2px, transparent 2px 14px, rgba(255,255,255,.18) 14px 16px, transparent 16px 31px),
    linear-gradient(180deg, var(--wood) 0%, var(--wood-2) 100%);
  box-shadow:0 0 0 3px rgba(255,255,255,.7), 0 0 0 6px #f6dcb4, 0 5px 0 6px #ecc58d;
  margin:4px 0 6px;
}
.pz-pantry-label{
  display:inline-block;
  font-family:'Fredoka', sans-serif;
  font-weight:600;
  font-size:.74rem;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:#b27a3a;
  background:rgba(255,255,255,.6);
  padding:2px 10px;
  border-radius:999px;
  margin-bottom:8px;
}
.pz-pantry{ display:grid; grid-template-columns:repeat(5, 1fr); gap:8px; }
.pz-tile{ padding-top:10px; }
.pz-tile .ing-icon{ width:42px; height:42px; }
.pz-tile .ing-label{ display:inline-flex; align-items:center; gap:3px; }
.pz-count{
  position:absolute;
  top:3px;
  right:4px;
  font-family:'Fredoka', sans-serif;
  font-weight:700;
  font-size:.72rem;
  color:var(--pink-deep);
}
.pz-tile.is-empty{ opacity:.4; filter:grayscale(.6); }
.pz-tile.is-empty .pz-count{ color:var(--ink-faint); }
.pz-dot{
  display:inline-block;
  width:8px;
  height:8px;
  border-radius:50%;
  background:var(--sw);
  box-shadow:0 0 0 1px rgba(0,0,0,.08);
  flex:0 0 auto;
}
.pz-dot.is-sea{ box-shadow:0 0 0 1px rgba(0,0,0,.08), 0 0 0 3px #bfe3ff; }

.pz-note{ min-height:1.2em; margin:0; text-align:center; font-weight:800; font-size:.86rem; color:var(--ink-soft); }
.pz-note.is-fail{ color:#e2476d; }
.pz-actions{ display:grid; grid-template-columns:1fr 1fr 1.4fr; gap:8px; }
.pz-actions .btn{ padding:11px 6px; }
.pz-actions .btn:disabled{ opacity:.5; cursor:default; }
.pz-hint-n{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:20px;
  height:20px;
  border-radius:999px;
  background:#fff4c8;
  color:#b27410;
  font-size:.78rem;
}

/* ===================== PUZZLES: SOLVED ===================== */
.solved-card{ text-align:center; max-width:340px; }
.solved-stars{ display:flex; justify-content:center; align-items:flex-end; gap:6px; margin-bottom:6px; }
.solved-stars i{
  font-style:normal;
  font-size:2.6rem;
  line-height:1;
  color:#eee4ee;
  -webkit-text-stroke:3px #e3d4e2;
  paint-order:stroke fill;
}
.solved-stars i:nth-child(2){ font-size:3.3rem; margin-bottom:6px; }
.solved-stars i.on{
  color:var(--sun);
  -webkit-text-stroke-color:#f5ae2c;
  filter:drop-shadow(0 4px 6px rgba(245,174,44,.45));
  animation:star-pop .6s cubic-bezier(.2,1.6,.4,1) both;
}
.solved-text{ margin:4px 0 16px; font-weight:800; color:var(--ink-soft); }

@media (max-width:380px){
  .pz-clue{ font-size:.8rem; }
  .pz-plate .ing-icon{ width:44px; height:44px; }
  .pz-tile .ing-icon{ width:38px; height:38px; }
  .level-tile{ padding:10px 8px; column-gap:8px; }
  .lt-num{ width:36px; height:36px; }
  .mode-desc{ font-size:.62rem; }
}

/* compact guest cards: clues flow side by side, plate a little shorter */
.pz-clues{ flex-direction:row; flex-wrap:wrap; align-content:center; }
.pz-clue{ padding:3px 9px 3px 4px; font-size:.82rem; }
.clue-num, .clue-swatch, .clue-ing, .clue-avatar{ width:24px; height:24px; }
.clue-ing .ing-icon{ width:24px; height:24px; }
.pz-guest{ padding:9px 10px 10px; gap:6px 8px; grid-template-columns:48px 1fr; }
.pz-avatar{ width:44px; height:44px; }
.pz-plate{ min-height:54px; padding:4px 10px; }
.pz-plate .ing-icon{ width:44px; height:44px; }
.pz-guests{ margin-top:4px; gap:9px; }

/* pantry + actions stay docked at the bottom while guests scroll */
.pz-dock{
  position:sticky;
  bottom:0;
  z-index:6;
  margin:0 -16px -28px;
  padding:10px 16px max(14px, env(safe-area-inset-bottom));
  background:linear-gradient(180deg, rgba(255,240,245,0) 0%, rgba(255,240,245,.92) 18%, #fff0f5 100%);
  display:flex;
  flex-direction:column;
  gap:8px;
}
.pz-dock .pz-pantry-wrap{ margin:6px 0 4px; padding:8px 8px 10px; }
.pz-dock .pz-pantry-label{ margin-bottom:6px; }
.pz-dock .pz-tile{ padding:8px 2px 5px; }
.pz-dock .pz-tile .ing-icon{ width:38px; height:38px; }
.pz-note:empty{ display:none; }

/* ===================== FOUR MODES ===================== */
.mode-select{ grid-template-columns:1fr 1fr; gap:10px; }
.mode-card{ padding:10px 6px 9px; }
.pause-chips{ grid-template-columns:1fr 1fr; }
body[data-screen="dle"] .pause-toggle{ display:flex; }
.dle-summary{ background:linear-gradient(180deg, #eefaf3, #dcf5e6); box-shadow:inset 0 0 0 2px #bfe9cf; }

/* ===================== SUSHIDLE HUB ===================== */
.dle-hub{ display:flex; flex-direction:column; gap:14px; }
.dle-card{
  padding:14px;
  border-radius:var(--radius-lg);
  background:#fff;
  box-shadow:0 0 0 3px rgba(255,255,255,.85), 0 0 0 6px #d5f0e0, 0 10px 20px rgba(60,160,110,.12);
}
.dle-daily{ background:linear-gradient(160deg, #ffffff, #effbf4); }
.dle-card-top{ display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.dle-card-top b{ font-family:'Fredoka', sans-serif; font-weight:600; font-size:1.25rem; }
.dle-card-hint{ font-size:.74rem; font-weight:800; color:var(--ink-soft); }
.dle-badge{
  padding:3px 10px;
  border-radius:999px;
  background:linear-gradient(180deg, #a8f0c4, var(--leaf-deep));
  color:#fff;
  font-family:'Fredoka', sans-serif;
  font-weight:600;
  font-size:.74rem;
  letter-spacing:.06em;
  text-transform:uppercase;
  box-shadow:0 2px 0 var(--leaf-lip);
}
.dle-badge.is-practice{ background:linear-gradient(180deg, #b7a6ff, #8a6ff0); box-shadow:0 2px 0 #6a50d6; }
.dle-badge.is-stats{ background:linear-gradient(180deg, #ffe28f, #ffa83d); box-shadow:0 2px 0 #e98a1f; }
.dle-card-text{ margin:0 0 12px; font-weight:800; color:var(--ink-soft); font-size:.9rem; }
.dle-levels{ display:grid; grid-template-columns:repeat(3, 1fr); gap:8px; }
.dle-level{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:2px;
  padding:10px 4px;
  border:none;
  border-radius:16px;
  background:#f7f3ff;
  color:var(--ink);
  cursor:pointer;
  box-shadow:0 0 0 2px #e2d7ff, 0 4px 0 #cfc0ff;
  transition:transform .14s cubic-bezier(.3,1.6,.5,1);
}
.dle-level:active{ transform:translateY(3px) scale(.96); }
.dle-level b{ font-family:'Fredoka', sans-serif; font-weight:600; font-size:1rem; }
.dle-level span{ font-size:.66rem; font-weight:800; color:var(--ink-soft); text-align:center; }

.dle-stat-nums{ display:grid; grid-template-columns:repeat(4, 1fr); text-align:center; margin-bottom:10px; }
.dle-stat-nums b{ display:block; font-family:'Fredoka', sans-serif; font-weight:600; font-size:1.5rem; line-height:1.1; }
.dle-stat-nums span{ font-size:.66rem; font-weight:800; color:var(--ink-soft); text-transform:uppercase; letter-spacing:.04em; }
.dle-dist{ display:flex; flex-direction:column; gap:3px; }
.dle-dist-row{ display:flex; align-items:center; gap:6px; font-size:.74rem; font-weight:900; color:var(--ink-soft); }
.dle-dist-row span{ width:10px; text-align:right; }
.dle-dist-row i{
  font-style:normal;
  min-width:22px;
  padding:1px 7px;
  border-radius:6px;
  background:#e8dfe6;
  color:#fff;
  text-align:right;
  font-size:.72rem;
}
.dle-dist-row i.has{ background:var(--leaf-deep); }

.dle-legend{ display:flex; justify-content:center; flex-wrap:wrap; gap:12px; font-size:.78rem; font-weight:800; color:var(--ink-soft); }
.dle-legend span{ display:inline-flex; align-items:center; gap:5px; }
.dle-key{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:20px;
  height:20px;
  border-radius:6px;
  font-style:normal;
  font-size:.72rem;
  font-weight:900;
  color:#fff;
}
.dle-key.is-hit{ background:var(--leaf-deep); }
.dle-key.is-near{ background:#f5b52c; }
.dle-key.is-miss{ background:#d9ced6; }

/* ===================== SUSHIDLE BOARD ===================== */
.dle-board{
  --cell:clamp(38px, calc((100vw - 32px - 24px) / var(--n) - 8px), 58px);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  margin-top:8px;
}
.dle-row{ display:flex; gap:6px; }
.dle-cell{
  position:relative;
  width:var(--cell);
  height:var(--cell);
  max-height:46px;
  border-radius:14px;
  background:rgba(255,255,255,.65);
  box-shadow:inset 0 0 0 2px #f1e3ea;
  display:flex;
  align-items:center;
  justify-content:center;
}
@media (min-height:760px){ .dle-cell{ max-height:52px; } }
.dle-row.is-current .dle-cell{ background:#fff; box-shadow:inset 0 0 0 2.5px var(--ring-2); }
.dle-row.is-current .dle-cell.is-filled{ box-shadow:inset 0 0 0 2.5px var(--pink); cursor:pointer; }
.dle-cell .ing-icon{ width:82%; height:82%; }
.dle-cell.is-filled .ing-icon{ animation:plop .28s cubic-bezier(.3,1.6,.5,1); }
.dle-row:not(.is-current) .dle-cell .face{ display:none; }
.dle-cell.is-hit{ background:linear-gradient(180deg, #a8f0c4, #6fd69b); box-shadow:0 3px 0 var(--leaf-deep); }
.dle-cell.is-near{ background:linear-gradient(180deg, #ffe7a0, #ffc94d); box-shadow:0 3px 0 #e9a11f; }
.dle-cell.is-miss{ background:#e9e1e7; box-shadow:0 3px 0 #d6cbd3; }
.dle-cell.is-miss .ing-icon{ opacity:.55; filter:grayscale(.5); }
/* marks as well as colours, so it reads for colour-blind players too */
.dle-cell.is-hit::after,
.dle-cell.is-near::after{
  position:absolute;
  right:-4px;
  top:-5px;
  width:17px;
  height:17px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:.66rem;
  font-weight:900;
  color:#fff;
  box-shadow:0 0 0 2px #fff;
}
.dle-cell.is-hit::after{ content:"✓"; background:var(--leaf-deep); }
.dle-cell.is-near::after{ content:"↔"; background:#f0a21f; }
.dle-cell.is-flip{ animation:dle-flip .44s ease-in-out both; }
@keyframes dle-flip{
  0%{ transform:rotateX(0); }
  50%{ transform:rotateX(90deg); }
  100%{ transform:rotateX(0); }
}
.dle-row.is-win .dle-cell{ animation:dle-hop .5s cubic-bezier(.3,1.6,.5,1) both; }
.dle-row.is-win .dle-cell:nth-child(2){ animation-delay:.07s; }
.dle-row.is-win .dle-cell:nth-child(3){ animation-delay:.14s; }
.dle-row.is-win .dle-cell:nth-child(4){ animation-delay:.21s; }
.dle-row.is-win .dle-cell:nth-child(5){ animation-delay:.28s; }
@keyframes dle-hop{
  0%,100%{ transform:translateY(0); }
  40%{ transform:translateY(-12px); }
}
.dle-row.shake{ animation:shake .4s ease; }

.dle-palette .dle-tile.is-hit{ --tint:#dcf7e7; --tint-edge:#8fdcae; }
.dle-palette .dle-tile.is-near{ --tint:#fff3cc; --tint-edge:#ffd46a; }
.dle-palette .dle-tile.is-miss{ opacity:.38; filter:grayscale(.7); }
.dle-palette .dle-tile.is-hit::after,
.dle-palette .dle-tile.is-near::after{
  position:absolute;
  top:3px;
  right:4px;
  font-size:.66rem;
  font-weight:900;
}
.dle-palette .dle-tile.is-hit::after{ content:"✓"; color:var(--leaf-deep); }
.dle-palette .dle-tile.is-near::after{ content:"↔"; color:#e0931a; }
.dle-actions{ display:grid; grid-template-columns:1fr 2fr; gap:10px; }
.dle-actions .btn{ padding:11px 8px; }
.dle-actions .btn:disabled{ opacity:.5; cursor:default; }

/* ===================== SUSHIDLE RESULT ===================== */
.dle-answer{ display:flex; justify-content:center; gap:4px; margin:-6px 0 12px; }
.dle-answer .ing-icon{ width:46px; height:46px; }
.dle-share-grid{
  margin:0 auto 12px;
  font-size:1.25rem;
  line-height:1.2;
  letter-spacing:2px;
  font-family:inherit;
  user-select:all;
  -webkit-user-select:all;
}
.dle-result .dle-stats{ text-align:left; margin-bottom:14px; }
.dle-copied{ min-height:1em; margin:-4px 0 0; font-size:.8rem; font-weight:800; color:var(--leaf-deep); }
.dle-copied:empty{ display:none; }

/* ===================== APP-LIKE TOUCH BEHAVIOUR ===================== */
/* no accidental text selection / long-press menus / double-tap zoom /
   rubber-band scrolling — what players expect from a store game */
html{ -webkit-text-size-adjust:100%; text-size-adjust:100%; }
body{
  -webkit-user-select:none;
  user-select:none;
  -webkit-touch-callout:none;
  overscroll-behavior:none;
}
button, .ing-btn, .pz-guest, .level-tile, .mode-card, .dle-cell{ touch-action:manipulation; }
input, .share-link, .dle-share-grid, .share-preview{ -webkit-user-select:text; user-select:text; -webkit-touch-callout:default; }
img, svg{ -webkit-user-drag:none; }

/* ===================== SHARING ===================== */
.share-btn{ margin-top:12px; }
.vs-line{
  display:block;
  margin:8px 0 0;
  padding:6px 12px;
  border-radius:12px;
  background:#f1ecff;
  color:#6a50d6;
  font-weight:900;
  font-size:.88rem;
  text-align:center;
}
.modal-x{
  position:absolute;
  top:12px;
  right:12px;
  width:36px;
  height:36px;
  border:none;
  border-radius:50%;
  background:var(--blush-bg);
  color:var(--ink-soft);
  font-size:1rem;
  font-weight:900;
  cursor:pointer;
  box-shadow:inset 0 0 0 2px var(--ring);
}
.share-card, .about-card{ position:relative; max-width:420px; }
.share-card h2{ text-align:center; padding:0 30px; }
.share-preview-card{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:2px 10px;
  align-items:center;
  padding:12px;
  margin-bottom:12px;
  border-radius:var(--radius-md);
  background:var(--blush-bg);
  box-shadow:inset 0 0 0 2px var(--ring);
}
.share-emoji{ grid-row:1 / span 2; font-size:2rem; }
.share-preview{ margin:0; font-weight:800; font-size:.86rem; line-height:1.35; white-space:pre-line; }
.share-link{
  margin:0;
  font-size:.72rem;
  font-weight:800;
  color:var(--pink-deep);
  word-break:break-all;
  opacity:.85;
}
.share-name-row{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:14px;
  font-size:.8rem;
  font-weight:900;
  color:var(--ink-soft);
}
.share-name-row input{
  flex:1;
  min-width:0;
  border:none;
  border-radius:999px;
  padding:9px 14px;
  font:inherit;
  font-size:.92rem;
  color:var(--ink);
  background:#fff;
  box-shadow:inset 0 0 0 2px var(--ring);
}
.share-name-row input:focus{ outline:none; box-shadow:inset 0 0 0 2.5px var(--pink); }
.share-targets{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:12px 6px;
}
.share-target{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:5px;
  padding:0;
  border:none;
  background:none;
  cursor:pointer;
  color:var(--ink);
}
.share-ico{
  width:52px;
  height:52px;
  border-radius:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  background:var(--brand);
  box-shadow:0 4px 0 color-mix(in srgb, var(--brand) 70%, #000), 0 8px 14px rgba(0,0,0,.12);
  transition:transform .14s cubic-bezier(.3,1.6,.5,1);
}
@supports not (color:color-mix(in srgb, red 50%, blue)){
  .share-ico{ box-shadow:0 4px 0 rgba(0,0,0,.18), 0 8px 14px rgba(0,0,0,.12); }
}
.share-target:hover .share-ico{ transform:translateY(-2px); }
.share-target:active .share-ico{ transform:translateY(3px) scale(.94); }
.share-ico svg{ width:26px; height:26px; }
.share-label{ font-size:.72rem; font-weight:800; }
.share-status{ min-height:1.2em; margin:12px 0 0; text-align:center; font-size:.85rem; font-weight:900; color:var(--leaf-deep); }
.share-status:empty{ display:none; }

.challenge-banner{
  position:relative;
  display:grid;
  grid-template-columns:auto 1fr;
  gap:6px 10px;
  align-items:center;
  margin:-4px 0 16px;
  padding:12px 14px;
  border-radius:var(--radius-md);
  background:linear-gradient(160deg, #fff8e0, #ffe9b0);
  box-shadow:inset 0 0 0 2px #ffd46a, 0 6px 14px rgba(245,174,44,.2);
  text-align:left;
  animation:modal-pop .5s cubic-bezier(.2,1.5,.4,1);
}
.challenge-ico{ font-size:1.8rem; grid-row:1 / span 2; }
.challenge-text{ margin:0; padding-right:26px; font-weight:900; font-size:.9rem; color:#8a5a0a; }
.challenge-banner .btn{ justify-self:start; }
.challenge-x{
  position:absolute;
  top:6px;
  right:6px;
  width:30px;
  height:30px;
  border:none;
  border-radius:50%;
  background:rgba(255,255,255,.7);
  color:#b27410;
  font-weight:900;
  cursor:pointer;
}

.home-footer{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  align-items:center;
  gap:6px;
  margin-top:18px;
  font-size:.78rem;
  font-weight:800;
  color:var(--ink-faint);
}
.link-btn{
  border:none;
  background:none;
  padding:6px 2px;
  font:inherit;
  color:var(--pink-deep);
  cursor:pointer;
}
.home-version{ color:var(--ink-faint); }

.about-card h2{ text-align:center; color:var(--pink-deep); margin-bottom:2px; padding:0 30px; }
.about-version{ text-align:center; margin:0 0 12px; font-size:.8rem; font-weight:800; color:var(--ink-soft); }
.about-text{ margin:0 0 10px; font-size:.86rem; line-height:1.45; }
.about-text a{ color:var(--pink-deep); font-weight:900; }
.about-card .howto-sub{ margin:6px 0 6px; }

@media (max-width:360px){
  .share-targets{ grid-template-columns:repeat(3, 1fr); }
}

/* ===================== SHORT SCREENS (iPhone SE, small Androids) ===================== */
/* keep the whole kitchen on screen during a timed shift — no scrolling mid-game */
@media (max-height:760px){
  .sound-toggle{ width:38px; height:38px; }
  .sound-toggle svg{ width:19px; height:19px; }
  .game-wrap{ gap:8px; }
  .game-brand{ min-height:38px; margin-bottom:-2px; font-size:.85rem; }
  .hud-stat{ padding:3px 10px 3px 4px; min-width:0; }
  .hud-ico{ width:28px; height:28px; }
  .hud-ico svg{ width:19px; height:19px; }
  .hud-value{ font-size:1.1rem; }
  .timer-track{ height:26px; }
  .timer-text{ line-height:18px; font-size:.9rem; }
  .lives-wrap{ height:34px; }
  .order-card{ padding:20px 12px 10px; }
  .order-emoji{ width:56px; height:56px; }
  .order-info{ padding:8px 10px 9px; }
  .order-name{ font-size:1.02rem; }
  .order-recipe{ margin-top:5px; }
  .board{ padding:10px 12px 10px; }
  .board-label{ display:none; }
  .plate{ min-height:60px; padding:6px 10px; }
  .plate .ing-icon{ width:42px; height:42px; }
  .board-actions{ margin-top:10px; }
  .board-actions .btn-sm{ padding:8px 14px; }
  .palette{ gap:7px; }
  .ing-btn{ padding:5px 2px 4px; }
  .ing-btn .ing-icon{ width:36px; height:36px; }
  .ing-btn span.ing-label{ font-size:.62rem; }
  .belt{ padding:6px 0; }
  .belt-track{ height:146px; }
  .belt-slot{ top:9px; }
  .mode-belt .plate{ min-height:56px; }
}
@media (max-height:660px){
  .game-brand{ min-height:34px; }
  .belt-track{ height:136px; }
  .belt-plate{ height:118px; padding:6px; }
  .belt-plate.n-7, .belt-plate.n-8, .belt-plate.n-9{ --ic:32px; }
  .belt-plate.n-10{ --ic:27px; }
  .ing-btn .ing-icon{ width:33px; height:33px; }
}

/* ===================== TALL SCREENS (Pro Max, tall Androids) ===================== */
/* use the extra height for bigger, friendlier targets instead of empty space */
@media (min-height:880px) and (max-width:600px){
  .game-wrap{ gap:16px; }
  .order-card{ padding:28px 16px 16px; }
  .order-emoji{ width:80px; height:80px; }
  .order-recipe .chip .ing-icon{ width:30px; height:30px; }
  .plate{ min-height:104px; }
  .plate .ing-icon{ width:58px; height:58px; }
  .board{ padding:16px 16px 14px; }
  .board-actions{ margin-top:16px; }
  .board-actions .btn-sm{ padding:13px 18px; font-size:1.05rem; }
  .palette{ gap:10px; }
  .ing-btn{ padding:15px 2px 13px; }
  .ing-btn .ing-icon{ width:56px; height:56px; }
  .ing-btn span.ing-label{ font-size:.74rem; }
  .belt-track{ height:172px; }
  .belt-slot{ top:18px; }
  .mode-belt .plate{ min-height:88px; }
}
