/* ─────────────────────────────────────────────────────────────
   Crates of Eight — styles
   Fonts + design tokens baked in from ../../design-system (shipped
   inside the folder, no network) + all UI chrome. The crate machine
   is plain DOM + CSS; three.js renders only Ollie the Orange.
   Chrome, cards, buttons, quiz and speech match the sibling
   activities (exploding-dots / mirror-maze) exactly.
   ───────────────────────────────────────────────────────────── */

/* ── Fonts (shipped inside the folder — no network) ── */
@font-face {
  font-family: 'GT Walsheim';
  src: url('assets/fonts/GT-Walsheim-Regular.otf') format('opentype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'GT Walsheim';
  src: url('assets/fonts/GT-Walsheim-Medium.otf') format('opentype');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'GT Walsheim';
  src: url('assets/fonts/GT-Walsheim-Bold.otf') format('opentype');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'GT Walsheim';
  src: url('assets/fonts/GT-Walsheim-Ultra-Bold.otf') format('opentype');
  font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('assets/fonts/inter-var-latin.woff2') format('woff2');
  font-weight: 100 900; font-style: normal; font-display: swap;
}
/* Raleway powers the Fruit3D site chrome and headings, matching the sibling
   activities exactly (exploding-dots / mirror-maze) — shipped locally, no CDN. */
@font-face {
  font-family: 'Raleway';
  src: url('assets/fonts/raleway-var-latin.woff2') format('woff2');
  font-weight: 300 900; font-style: normal; font-display: swap;
}

:root {
  /* ── Brand / logo colours ── */
  --brand-blue:   #38C3E4;
  --brand-orange: #FF8A20;
  --brand-pink:   #FC74B4;
  --brand-yellow: #FFD401;
  --brand-red:    #E83459;
  --brand-green:  #45BA90;

  /* ── Purple ramp ── */
  --purple-700: #4B235D;
  --purple-800: #401E50;

  /* ── Dark plum theme (matches examples.fruit3d.com siblings) ── */
  --plum:       #2B0326;
  --card:       #3a0a33;
  --card-inset: #4a133f;
  --line-dark:  #5a1a4f;
  --nav:        #A1FCD2;
  --nav-dark:   #6fcea3;

  /* ── Warm cream play field (the brief's "warm cream play field") ── */
  --cream:       #F7EFE3;
  --cream-2:     #F0E4D2;
  --cream-line:  #E4D4BE;

  /* ── Wood / crate palette ── */
  --wood-1:     #C98A4B;
  --wood-2:     #A96C33;
  --wood-dark:  #7A4A22;
  --wood-slot:  #E9D9BF;
  --wood-slot-line: #D8C3A0;

  /* ── Orange fruit ── */
  --orange-lit:  #FFB257;
  --orange-mid:  #FF8A20;
  --orange-dark: #EF7A05;

  /* ── Surfaces / text ── */
  --text-strong:    #FFFFFF;
  --text-body:      #FFFFFF;
  --text-soft:      rgba(248, 244, 241, .68);
  --text-faint:     rgba(248, 244, 241, .5);
  --ink-plum:       #2B0326;

  /* ── Type — GT Walsheim (brand) + Inter (body), shipped locally ── */
  --font-brand: 'Raleway', 'GT Walsheim', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-sans:  'Raleway', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-chrome:'Raleway', 'GT Walsheim', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700; --fw-ultrabold: 800;
  --tracking-tight: -0.02em;
  --text-xs: 12px; --text-sm: 14px; --text-base: 16px; --text-md: 18px;
  --text-lg: 20px; --text-xl: 24px; --text-2xl: 30px; --text-3xl: 36px;

  /* ── Spacing / radius / shadow / motion ── */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px;
  --radius-md: 8px; --radius-lg: 12px; --radius-xl: 16px; --radius-full: 9999px;
  --shadow-card: 0 12px 28px rgba(28,10,36,0.35), 0 2px 6px rgba(28,10,36,0.20);
  --shadow-soft: 0 4px 12px rgba(28,10,36,0.22);
  --shadow-wood: 0 6px 0 rgba(122,74,34,0.55), 0 10px 18px rgba(28,10,36,0.28);
  --ease-pop: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 120ms; --dur-base: 220ms; --dur-slow: 360ms;
  --ring: color-mix(in srgb, var(--purple-700) 55%, transparent);
}

/* ── Reset & base ── */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; width: 100%; height: 100%;
  overflow: hidden;
  background: var(--plum);
  font-family: var(--font-sans);
  color: var(--text-body);
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: var(--radius-md); }
[hidden] { display: none !important; }

.ce-app { width: 100vw; height: 100vh; display: flex; flex-direction: column; }

/* ═══════════════════════════════════════════════════════════════════
   Fruit3D site chrome — header & footer (cloned from the siblings)
   ═══════════════════════════════════════════════════════════════════ */
.site-header, .site-footer { flex: none; background: var(--plum); z-index: 10; font-family: var(--font-chrome); }
.site-header { border-bottom: 1px solid var(--line-dark); }
.site-footer { border-top: 1px solid var(--line-dark); }
.site-bar { display: flex; align-items: center; gap: 14px; padding: 8px 22px; }
.site-header .site-bar { height: 60px; padding: 0 20px; gap: 16px; }
.site-logo-link { display: inline-flex; align-items: center; flex: 0 0 auto; transition: opacity .15s ease; }
.site-logo-link:hover { opacity: .85; }
.site-logo { height: 30px; width: auto; display: block; }
.site-title { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.site-title h1 {
  margin: 0; font-family: var(--font-chrome);
  font-size: clamp(14px, 2vw, 20px); font-weight: 700; letter-spacing: -.01em;
  line-height: 1.1; color: #fff;
}
.fruit3d-pill {
  margin-left: auto; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  border-radius: 11px; background: var(--card-inset); border: 1px solid var(--line-dark);
  padding: 6px 13px; font-size: 13px; font-weight: 700; letter-spacing: .02em;
  color: #f8f4f1; text-decoration: none; transition: opacity .16s;
}
.fruit3d-pill:hover { opacity: .9; }
.fruit3d-pill .pill-logo { display: block; height: 16px; width: auto; }
.signup-btn {
  display: inline-flex; align-items: center; border: 1px solid transparent; border-radius: 11px;
  background: #EB7CB2; color: #fff; padding: 6px 16px; font-family: var(--font-chrome);
  font-size: 13px; font-weight: 700; letter-spacing: .02em; line-height: 16px;
  white-space: nowrap; cursor: pointer; text-decoration: none; transition: filter .16s;
}
.signup-btn:hover { filter: brightness(1.06); }
.site-footer .copyright, .site-footer .made-with {
  white-space: nowrap; font-size: 13.5px; font-weight: 600; letter-spacing: .01em; color: #f8f4f1;
}
.site-footer .copyright { margin-right: auto; }
.site-footer .site-bar { position: relative; }
.site-footer .created-by {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  font-size: 13.5px; font-weight: 600; letter-spacing: .01em; color: #f8f4f1;
}
.site-footer .created-by svg { display: block; flex: none; }
.site-footer .wordmark-link { display: inline-flex; align-items: center; transition: opacity .16s; }
.site-footer .wordmark-link:hover { opacity: .8; }
.site-footer .wordmark { height: 22px; width: auto; }
@media (max-width: 560px) {
  .fruit3d-pill { font-size: 0; gap: 0; padding: 7px; }
  .fruit3d-pill .pill-logo { height: 17px; }
  .site-footer .made-with, .site-footer .created-by { display: none; }
}
@media (max-width: 640px) {
  .site-header .site-bar { height: auto; flex-wrap: wrap; padding: 10px 12px; gap: 10px 12px; }
  .site-logo-link { order: 1; } .fruit3d-pill { order: 2; } .signup-btn { order: 3; }
  .site-title { order: 4; flex-basis: 100%; }
  .site-title h1 { font-size: 17px; }
}

/* ── Stage wrap ── */
.ce-stage-wrap {
  flex: 1 1 auto; min-height: 0; display: flex; align-items: stretch; justify-content: stretch;
  position: relative; overflow: hidden; padding: 0;
}

/* The dark play field fills the whole area between the header and footer, edge to
   edge, at every breakpoint — flat aubergine plum, matching exploding-dots. */
.ce-play {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: 100%;
  background: var(--plum);
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

/* ── HUD — copied from mirror-maze exactly (dark card, mint accents, top-right) ── */
.ce-hud-group {
  position: absolute; top: 12px; right: 12px; z-index: 12;
  display: flex; flex-direction: column; gap: 8px; align-items: stretch;
}
.ce-hud {
  background: var(--card); border: 2px solid var(--nav); border-radius: 16px;
  padding: 10px 16px 12px; min-width: 168px; box-shadow: var(--shadow-soft);
  font-family: var(--font-brand); text-align: center;
}
.ce-hud-level { font-size: 20px; font-weight: var(--fw-ultrabold); color: var(--nav); line-height: 1.04; letter-spacing: .01em; margin-bottom: 4px; }
.ce-hud-pct { font-size: 13px; font-weight: var(--fw-bold); color: var(--nav); opacity: .9; margin-bottom: 8px; }
.ce-hud-track { height: 12px; border-radius: var(--radius-full); overflow: hidden; background: rgba(161,252,210,.22); }
.ce-hud-fill { height: 100%; width: 0%; border-radius: var(--radius-full); background: var(--nav); transition: width .45s var(--ease-pop); }
.ce-hud-controls { display: flex; gap: 8px; }
.ce-hud-btn {
  flex: 1 1 0; font-family: var(--font-brand); font-weight: var(--fw-ultrabold); font-size: 14px;
  color: var(--nav); background: transparent; border: 2px solid var(--nav); border-radius: 13px;
  padding: 8px 10px; cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s, transform .1s; touch-action: manipulation;
}
.ce-hud-btn:hover { background: var(--nav); color: var(--plum); }
.ce-hud-btn:active { transform: translateY(1px) scale(.98); }

/* ── The running total — sits just above the bottom controls (e.g. the Drop
   an orange button) ── */
.ce-total {
  position: absolute; bottom: 104px; left: 50%; transform: translateX(-50%); top: auto;
  z-index: 8; text-align: center; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; line-height: 1;
}
.ce-total-num {
  font-family: var(--font-brand); font-weight: var(--fw-ultrabold);
  font-size: clamp(40px, 7.2vh, 66px); color: var(--brand-orange);
  letter-spacing: -0.02em; line-height: .92;
  text-shadow: 0 2px 16px rgba(255,138,32,0.5);
  transition: transform .2s var(--ease-pop);
}
.ce-total-num.ce-bump { animation: ce-bump .42s var(--ease-pop); }
@keyframes ce-bump {
  0% { transform: scale(1); } 40% { transform: scale(1.28); } 100% { transform: scale(1); }
}
.ce-total-num.ce-amber { color: var(--brand-orange); }
.ce-total-label {
  font-family: var(--font-brand); font-weight: var(--fw-bold);
  font-size: clamp(11px, 1.6vh, 14px); letter-spacing: .06em; text-transform: uppercase;
  color: rgba(248,230,210,.72); margin-top: 3px;
}
/* In the bag game the bottom-centre is used by the bag + −1, so the packed
   counter moves to the top-left corner (clear of everything). */
.ce-bagmode .ce-total {
  top: 12px; left: 14px; bottom: auto; transform: none; align-items: flex-start; z-index: 12;
}
.ce-bagmode .ce-total-num { font-size: clamp(26px, 4.4vh, 42px); }

/* ── Goal chip ── */
/* The question "orb" — sits centred directly under Ollie + his speech bubble. */
.ce-goal {
  position: absolute; top: 172px; left: 50%; transform: translateX(-50%); z-index: 8;
  background: var(--card); border: 2px solid var(--line-dark); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft); padding: 8px 20px; text-align: center; max-width: 84%;
}
.ce-goal-lead {
  display: block; font-family: var(--font-brand); font-weight: var(--fw-bold);
  font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: rgba(248,230,210,.6);
}
.ce-goal-main {
  display: block; font-family: var(--font-brand); font-weight: var(--fw-ultrabold);
  font-size: clamp(20px, 3.2vh, 30px); color: #fff; line-height: 1.1;
}
.ce-goal.is-hit .ce-goal-main { color: var(--nav); }
/* The 8 / "eight" highlight — orange, everywhere it's written on dark surfaces. */
.ce-eight { color: var(--brand-orange); }

/* ── Stack / loading bay of sealed crates ── */
.ce-stack-wrap {
  position: absolute; left: 50%; right: auto; transform: translateX(-50%); top: 250px; bottom: 200px;
  width: min(92%, 880px);
  display: flex; align-items: center; justify-content: center;
  padding: 8px; z-index: 5;
}
.ce-stack {
  display: flex; flex-wrap: wrap; align-content: flex-end; justify-content: center;
  gap: 8px; width: 100%; max-height: 100%;
}
/* A sealed crate on the stack — a little wooden box showing eight oranges. */
.ce-crate-mini {
  position: relative; width: 84px; height: 62px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,238,205,.28), rgba(255,238,205,0) 16%),
    repeating-linear-gradient(90deg, rgba(88,50,20,.22) 0 1px, transparent 1px 20px),
    linear-gradient(160deg, #DE9A5C, #B9773B 66%, var(--wood-dark));
  border: 2px solid var(--wood-dark);
  box-shadow:
    inset 0 1px 0 rgba(255,234,198,.45),
    inset 0 -3px 7px rgba(72,38,14,.4),
    0 3px 0 rgba(122,74,34,0.5), 0 5px 10px rgba(28,10,36,0.18);
  display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr);
  gap: 2px; padding: 13px 6px 7px;
  animation: ce-slidein .42s var(--ease-pop);
}
/* a raised top rim gives the sealed crate a 3D box edge */
.ce-crate-mini::before {
  content: ''; position: absolute; left: -1px; right: -1px; top: -1px; height: 10px;
  border-radius: 8px 8px 2px 2px;
  background: linear-gradient(180deg, #EDCB97, #C59A62);
  box-shadow: inset 0 -3px 4px rgba(70,40,14,.45), 0 1px 0 rgba(255,240,210,.4);
}
@keyframes ce-slidein {
  0% { opacity: 0; transform: translateY(-26px) scale(.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.ce-crate-mini .mini-o {
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, var(--orange-lit) 0%, var(--orange-mid) 62%, var(--orange-dark) 100%);
  box-shadow: inset 0 -1px 2px rgba(150,60,0,0.25);
}
.ce-crate-mini .mini-lid {
  position: absolute; inset: 0; border-radius: 6px; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(122,74,34,0.0) 0 10px, rgba(122,74,34,0.14) 10px 12px);
}
/* A blanked "missing" crate on the stack (8 × ? puzzles) */
.ce-crate-mini.is-blank {
  background: repeating-linear-gradient(45deg, #efe2cd 0 8px, #e7d6bc 8px 16px);
  border: 2px dashed var(--wood-2);
  box-shadow: none;
}
.ce-crate-mini.is-blank .mini-o { display: none; }
.ce-crate-mini .mini-q {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-brand); font-weight: var(--fw-ultrabold); font-size: 30px; color: var(--wood-2);
}

/* Quick-pack "how many oranges?" — centre the countable crates in the canvas
   and enlarge them so a child can count the oranges (8 per crate) if they want. */
.ce-count .ce-stack-wrap {
  left: 50%; right: auto; transform: translateX(-50%);
  width: min(820px, 90%); justify-content: center; align-items: center;
}
.ce-count .ce-stack { align-content: center; gap: 12px; }
.ce-count .ce-crate-mini { width: 108px; height: 80px; gap: 4px; padding: 10px 8px; }
.ce-count .ce-crate-mini .mini-o { box-shadow: inset 0 -2px 3px rgba(150,60,0,0.28); }

/* ── The open crate — centred under the goal orb ── */
.ce-open-wrap {
  position: absolute; left: 50%; transform: translateX(-50%); top: 250px; bottom: auto; z-index: 6;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
/* Pack mode (stage 1): the sealed crates sit below the open crate. */
.ce-packmode .ce-crate--open { width: clamp(190px, 26vw, 228px); }
/* Packed crates sit lower — centred in the gap between the open crate and the
   orange counter, so they don't hide behind the next crate. */
.ce-packmode .ce-stack-wrap { top: 398px; bottom: 168px; align-items: center; }
.ce-crate.ce-crate--open {
  position: relative;
  width: clamp(240px, 34vw, 340px);
  padding: 20px 18px 16px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,238,205,.32), rgba(255,238,205,0) 11%),
    linear-gradient(0deg, rgba(58,30,10,.42), rgba(58,30,10,0) 18%),
    repeating-linear-gradient(90deg, rgba(88,50,20,.24) 0 1.5px, rgba(255,244,225,.06) 1.5px 3px, transparent 3px 60px),
    repeating-linear-gradient(93deg, rgba(120,72,32,.10) 0 7px, rgba(120,72,32,0) 7px 15px),
    linear-gradient(160deg, #DE9A5C, #B9773B 62%, var(--wood-dark));
  border: 3px solid var(--wood-dark);
  box-shadow:
    inset 0 2px 0 rgba(255,234,198,.55),
    inset 0 -9px 18px rgba(72,38,14,.5),
    inset 0 0 0 1.5px rgba(120,72,32,.3),
    var(--shadow-wood);
  display: block; text-align: left;
  transition: transform .16s var(--ease-pop), box-shadow .2s;
}
.ce-crate.ce-crate--open.is-full { animation: ce-wobble 1s ease-in-out infinite; box-shadow: 0 0 0 4px var(--brand-yellow), var(--shadow-wood); }
@keyframes ce-wobble {
  0%,100% { transform: rotate(-1.3deg); } 50% { transform: rotate(1.3deg); }
}
.ce-crate.ce-crate--open.is-sealing { animation: ce-seal-pop .34s var(--ease-pop); }
@keyframes ce-seal-pop {
  0% { transform: scale(1); } 45% { transform: scale(1.06) rotate(0deg); } 100% { transform: scale(1); }
}
.ce-crate-count {
  position: absolute; top: -16px; left: -14px; z-index: 3;
  min-width: 40px; height: 40px; padding: 0 8px;
  border-radius: var(--radius-full);
  background: #fff; border: 3px solid var(--brand-orange);
  color: var(--ink-plum); font-family: var(--font-brand); font-weight: var(--fw-ultrabold);
  font-size: 22px; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-soft);
}
.ce-crate-slots {
  display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr);
  gap: 8px;
}
.ce-slot {
  position: relative; aspect-ratio: 1 / 1; border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #7a4d26 0%, #5a361a 60%, #43280f 100%);
  box-shadow: inset 0 3px 7px rgba(0,0,0,0.5), inset 0 -1px 0 rgba(255,220,170,0.12);
  border: 1px solid rgba(30,14,4,0.5);
}
/* An orange sitting in a slot */
.ce-orange {
  position: absolute; inset: 6%; border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, var(--orange-lit) 0%, var(--orange-mid) 60%, var(--orange-dark) 100%);
  box-shadow: inset 0 -3px 6px rgba(150,60,0,0.30), 0 2px 4px rgba(28,10,36,0.20);
  cursor: pointer;
  animation: ce-drop-in .34s var(--ease-pop) both, ce-orange-wiggle 2.6s ease-in-out .5s infinite;
}
/* little Ollies gently come alive (staggered so they don't move in lock-step) */
@keyframes ce-orange-wiggle { 0%,100% { transform: rotate(-3.5deg); } 50% { transform: rotate(3.5deg); } }
.ce-slot:nth-child(2) .ce-orange, .ce-slot:nth-child(5) .ce-orange { animation-delay: 0s, .2s; }
.ce-slot:nth-child(3) .ce-orange, .ce-slot:nth-child(6) .ce-orange { animation-delay: 0s, .9s; }
.ce-slot:nth-child(4) .ce-orange, .ce-slot:nth-child(7) .ce-orange { animation-delay: 0s, 1.4s; }
.ce-slot:nth-child(8) .ce-orange { animation-delay: 0s, .6s; }
.ce-orange::before { /* leaf */
  content: ""; position: absolute; top: -7%; left: 46%;
  width: 34%; height: 26%;
  background: var(--brand-green);
  border-radius: 0 80% 0 80%; transform: rotate(-22deg);
  box-shadow: inset 0 -1px 1px rgba(20,80,50,0.35);
}
.ce-orange.is-leaving { animation: ce-drop-out .26s var(--ease-pop) forwards; }
@keyframes ce-drop-in {
  0% { opacity: 0; transform: translateY(-34px) scale(.5); }
  70% { transform: translateY(3px) scale(1.05); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ce-drop-out {
  0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: translateY(-30px) scale(.4); }
}
/* 3D orange sprite — once Ollie's model has loaded, every DOM orange is painted
   with a PNG rendered from the real orange.glb body, so they look like true 3D
   oranges. Falls back to the CSS radial gradient if the render is unavailable. */
/* Loose oranges the child is handling become little Ollies (full face). */
.orange3d .ce-orange,
.orange3d .ce-pile-o {
  background: center / contain no-repeat var(--ollie-face-img);
  box-shadow: none;
  border-radius: 0;
}
.orange3d .ce-orange { inset: 0; }
.orange3d .ce-orange::before { display: none; }   /* the face sprite already has its leaf-free look */
/* Sealed-crate oranges stay faceless bodies (tiny, packed away). */
.orange3d .ce-crate-mini .mini-o {
  background: center / contain no-repeat var(--orange-img);
  box-shadow: none;
  border-radius: 0;
}
/* Once the 3D crate render is ready, every sealed/filled crate becomes the real
   3D crate of eight oranges. */
.crate3d .ce-crate-mini {
  background: center / contain no-repeat var(--crate-img);
  border: none; box-shadow: none; padding: 0; display: block;
  aspect-ratio: 1 / 0.86;
}
.crate3d .ce-crate-mini::before { display: none; }
.crate3d .ce-crate-mini .mini-o { display: none; }

/* CLUNK comic burst on seal */
.ce-crate-seal {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) scale(0) rotate(-8deg);
  z-index: 5; pointer-events: none;
  font-family: var(--font-brand); font-weight: var(--fw-ultrabold);
  font-size: clamp(28px, 5vh, 46px); color: #fff;
  padding: 8px 18px;
  background: var(--brand-yellow);
  border: 4px solid #fff;
  border-radius: 12px;
  text-shadow: 0 2px 0 rgba(122,74,34,.5);
  box-shadow: 0 6px 18px rgba(28,10,36,.4);
  -webkit-text-stroke: 1px var(--wood-dark); color: #fff;
}
.ce-crate-seal.is-burst { animation: ce-clunk .6s var(--ease-pop); }
@keyframes ce-clunk {
  0% { transform: translate(-50%,-50%) scale(0) rotate(-14deg); opacity: 0; }
  40% { transform: translate(-50%,-50%) scale(1.15) rotate(6deg); opacity: 1; }
  70% { transform: translate(-50%,-50%) scale(1) rotate(-3deg); opacity: 1; }
  100% { transform: translate(-50%,-50%) scale(1.05) rotate(0deg); opacity: 0; }
}

/* Tap hint pulse on the open crate when it is full */
.ce-tap-hint {
  position: absolute; inset: -6px; border-radius: 18px; pointer-events: none;
  border: 3px solid var(--brand-yellow); opacity: 0;
}
.ce-crate--open.is-full .ce-tap-hint { animation: ce-tap-pulse 1.2s ease-in-out infinite; }
@keyframes ce-tap-pulse {
  0%,100% { opacity: 0; transform: scale(1); } 50% { opacity: .85; transform: scale(1.02); }
}

/* ── Pile of loose oranges (unpack stages) ── */
.ce-pile-wrap {
  position: absolute; left: 4%; bottom: 128px; z-index: 6;
  width: 40%; display: flex; flex-direction: column; align-items: center;
}
.ce-pile {
  position: relative; width: 100%; min-height: 190px;
  display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-end; justify-content: center;
  padding: 10px;
  background: rgba(122,74,34,0.06);
  border: 2px dashed var(--cream-line); border-radius: var(--radius-lg);
}
.ce-pile-o {
  width: 40px; height: 40px; border-radius: 50%; position: relative; cursor: pointer;
  background: radial-gradient(circle at 36% 30%, var(--orange-lit) 0%, var(--orange-mid) 60%, var(--orange-dark) 100%);
  box-shadow: inset 0 -3px 5px rgba(150,60,0,0.30), 0 2px 4px rgba(28,10,36,0.18);
  transition: transform .12s var(--ease-pop);
}
.ce-pile-o::before {
  content: ""; position: absolute; top: -6%; left: 46%; width: 32%; height: 24%;
  background: var(--brand-green); border-radius: 0 80% 0 80%; transform: rotate(-22deg);
}
.ce-pile-o:hover { transform: translateY(-3px) scale(1.06); }
.ce-pile-o.is-flying { animation: ce-fly .34s var(--ease-pop) forwards; pointer-events: none !important; }
@keyframes ce-fly { 0% { opacity:1; transform: scale(1);} 100% { opacity: 0; transform: translate(40px,-60px) scale(.4);} }
.ce-pile-label {
  margin-top: 8px; font-family: var(--font-brand); font-weight: var(--fw-bold);
  font-size: var(--text-sm); color: #a9743f;
}

/* ═══════════════════════════════════════════════════════════════════
   Level 3 — paper-bag packing game (drag oranges into the bag)
   ═══════════════════════════════════════════════════════════════════ */
.ce-bag-stage {
  position: absolute; left: 2%; right: 2%; top: 232px; bottom: 116px; z-index: 6;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5%;
}
.ce-bag-stage[hidden] { display: none; }

/* Endless source basket of draggable oranges */
.ce-basket {
  width: 30%; align-self: center; max-height: 100%;
  display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 8px;
  padding: 14px 10px; border-radius: var(--radius-lg);
  background: rgba(255,255,255,.04); border: 2px dashed var(--line-dark);
}
.ce-drag-orange, .ce-drag-ghost {
  width: 48px; height: 48px; position: relative; cursor: grab; touch-action: none;
  background: radial-gradient(circle at 36% 30%, var(--orange-lit) 0%, var(--orange-mid) 60%, var(--orange-dark) 100%);
  border-radius: 50%; box-shadow: inset 0 -3px 6px rgba(150,60,0,0.3), 0 2px 4px rgba(28,10,36,0.2);
  will-change: transform;
}
.orange3d .ce-drag-orange, .orange3d .ce-drag-ghost {
  background: center/contain no-repeat var(--orange-img); border-radius: 0; box-shadow: none;
}
.ce-drag-orange::before, .ce-drag-ghost::before {
  content: ""; position: absolute; top: -6%; left: 46%; width: 32%; height: 24%;
  background: var(--brand-green); border-radius: 0 80% 0 80%; transform: rotate(-22deg);
}
.ce-drag-orange:active { cursor: grabbing; }
.ce-drag-orange.is-hidden { visibility: hidden; }
.ce-drag-ghost {
  position: fixed; z-index: 60; pointer-events: none; cursor: grabbing;
  width: 54px; height: 54px; transform: translate(-50%, -50%) scale(1.08);
}
.ce-drag-orange.pop-in { animation: ce-drop-in .3s var(--ease-pop); }

/* The bag column: bag + −1 button */
.ce-bag-col {
  width: 34%; display: flex; flex-direction: column; align-items: center; gap: 12px;
  flex: 0 0 auto;
}
.ce-bag {
  position: relative; width: clamp(118px, 19vw, 166px); aspect-ratio: 4 / 5;
  border-radius: 5px 5px 12px 12px; touch-action: none;
  background:
    repeating-linear-gradient(90deg, rgba(90,55,20,.12) 0 1px, transparent 1px 24px),
    linear-gradient(100deg, #D3A972 0%, #B98A54 46%, #8E6234 100%);
  box-shadow: inset -12px 0 22px rgba(80,48,16,.45), inset 12px 0 16px rgba(255,232,196,.28),
              inset 0 -14px 20px rgba(70,40,14,.4), 0 12px 24px rgba(28,10,36,.45);
  transition: transform .16s var(--ease-pop), box-shadow .2s, outline-color .2s;
  outline: 3px solid transparent; outline-offset: 3px;
}
/* the dark opening at the top of the bag */
.ce-bag-open {
  position: absolute; top: 6px; left: 12%; right: 12%; height: 20px; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 30%, #3a2410, #241608);
  box-shadow: inset 0 3px 6px rgba(0,0,0,.6);
}
/* a folded paper rim just under the opening */
.ce-bag-fold {
  position: absolute; top: 14px; left: 4px; right: 4px; height: 16px; border-radius: 4px;
  background: linear-gradient(180deg, #E4C293, #C69C63);
  box-shadow: 0 2px 3px rgba(70,40,14,.4); border-top: 1px solid rgba(255,240,210,.5);
}
.ce-bag-face { position: absolute; inset: 40px 8px 10px; display: flex; align-items: center; justify-content: center; }
.ce-bag-num {
  font-family: var(--font-brand); font-weight: var(--fw-ultrabold);
  font-size: clamp(40px, 7vw, 60px); color: #5a3417;
  text-shadow: 0 1px 0 rgba(255,240,210,.5); opacity: .92;
}
/* Once the 3D kraft-bag render is ready, the bag (and packed bags) use it. */
.bag3d .ce-bag {
  background: center / contain no-repeat var(--bag-img);
  box-shadow: none; border-radius: 0; aspect-ratio: 1 / 1.06;
}
.bag3d .ce-bag-open, .bag3d .ce-bag-fold { display: none; }
.bag3d .ce-bag-face { inset: 38% 16% 24%; }
.bag3d .ce-bag-num { text-shadow: 0 1px 0 rgba(255,238,205,.4); }
.bag3d .ce-dock-bag {
  background: center / contain no-repeat var(--bag-img);
  box-shadow: none; border-radius: 0; width: 52px; height: auto; aspect-ratio: 1 / 1.06;
}
.bag3d .ce-dock-bag span { color: #5a3417; text-shadow: 0 1px 0 rgba(255,238,205,.4); }

.ce-bag.is-over { transform: scale(1.05); box-shadow: inset -12px 0 22px rgba(80,48,16,.45), inset 12px 0 16px rgba(255,232,196,.28), 0 14px 26px rgba(28,10,36,.5); }
.ce-bag.is-ready { outline-color: var(--nav); animation: ce-bag-ready 1.1s ease-in-out infinite; }
@keyframes ce-bag-ready { 0%,100% { transform: translateY(0) rotate(-0.5deg); } 50% { transform: translateY(-4px) rotate(0.5deg); } }
.ce-bag.is-sweeping { transition: none; }
.ce-bag.is-nope { animation: ce-shake .4s; }

.ce-bag-sweep {
  position: absolute; top: 50%; right: -10px; transform: translate(100%, -50%);
  font-family: var(--font-brand); font-weight: var(--fw-ultrabold); font-size: 15px;
  color: var(--nav); white-space: nowrap; opacity: 0; transition: opacity .2s;
}
.ce-bag.is-ready .ce-bag-sweep { opacity: 1; animation: ce-sweep-nudge 1.1s ease-in-out infinite; }
@keyframes ce-sweep-nudge { 0%,100% { transform: translate(100%,-50%);} 50% { transform: translate(120%,-50%);} }

.ce-bag-minus {
  min-width: 76px; min-height: 46px; padding: 8px 18px; border-radius: var(--radius-full);
  font-family: var(--font-brand); font-weight: var(--fw-ultrabold); font-size: 20px;
  background: #fff; color: var(--ink-plum); border: 3px solid var(--brand-orange);
  box-shadow: var(--shadow-soft); touch-action: manipulation;
  transition: transform .1s var(--ease-pop);
}
.ce-bag-minus:active { transform: scale(.94); }
.ce-bag-minus:disabled { opacity: .4; cursor: default; }

/* Dock of packed bags on the right */
.ce-bag-dock-wrap { width: 30%; align-self: center; display: flex; align-items: center; justify-content: center; }
.ce-bag-dock { display: flex; flex-wrap: wrap; gap: 8px; align-content: center; justify-content: center; width: 100%; }
.ce-dock-bag {
  position: relative; width: 58px; height: 72px; border-radius: 4px 4px 8px 8px;
  background:
    repeating-linear-gradient(90deg, rgba(90,55,20,.12) 0 1px, transparent 1px 16px),
    linear-gradient(100deg, #D3A972, #B98A54 46%, #8E6234);
  box-shadow: inset -6px 0 12px rgba(80,48,16,.4), inset 5px 0 8px rgba(255,232,196,.25), 0 4px 8px rgba(28,10,36,.3);
  display: flex; align-items: center; justify-content: center;
  animation: ce-dock-in .4s var(--ease-pop);
}
.ce-dock-bag span { font-family: var(--font-brand); font-weight: var(--fw-ultrabold); font-size: 24px; color: #5a3417; }
@keyframes ce-dock-in { 0% { opacity: 0; transform: translateX(60px) rotate(8deg); } 100% { opacity: 1; transform: translateX(0) rotate(0); } }

/* Ghost hand (demo) */
.ce-ghost-hand {
  position: absolute; left: 0; top: 0; z-index: 40; pointer-events: none;
  width: 44px; height: 52px; filter: drop-shadow(0 3px 5px rgba(0,0,0,.45));
  will-change: transform; opacity: .95;
}
.ce-ghost-hand[hidden] { display: none; }

/* Timer / egg-timer */
.ce-bag-timer {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%); z-index: 8;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card-inset); border: 2px solid var(--line-dark); border-radius: var(--radius-full);
  padding: 6px 16px; font-family: var(--font-brand); font-weight: var(--fw-ultrabold);
  font-size: 18px; color: #fff;
}
.ce-bag-timer[hidden] { display: none; }
.ce-bag-timer.is-low { border-color: var(--brand-red); color: var(--brand-yellow); }
.ce-bag-timer-ico { font-size: 18px; }
.ce-bag-timer-bar { width: 90px; height: 8px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.15); }
.ce-bag-timer-bar[hidden] { display: none; }
.ce-bag-timer-fill { height: 100%; width: 100%; background: var(--nav); border-radius: 999px; }

/* Unpack mode: the pile is a bin sitting ABOVE the open crate on the left,
   with smaller oranges so a pile of up to 72 fits without scrolling; the
   sealed stack keeps its place on the right. */
.ce-unpack .ce-pile-wrap {
  left: 3%; right: auto; top: 236px; bottom: auto; height: 250px; width: 44%;
  transform: none; align-items: stretch;
}
.ce-unpack .ce-pile { height: 100%; min-height: 0; gap: 6px; align-content: flex-start; }
.ce-unpack .ce-pile-o { width: 44px; height: 44px; }     /* brief §5: loose oranges ≥ 44px */
.ce-unpack .ce-open-wrap { left: 60%; top: 276px; bottom: auto; transform: translateX(-50%); }
.ce-unpack .ce-crate--open { width: 216px; padding: 14px 12px 12px; }
.ce-unpack .ce-crate-slots { gap: 6px; }
.ce-unpack .ce-stack-wrap { left: auto; right: 3%; width: 26%; top: 234px; bottom: 176px; }

/* ── Answer cards (recall / division / missing factor) ── */
.ce-answers {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 9; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; max-width: 92%;
}
.ce-answer {
  min-width: 88px; min-height: 68px; padding: 12px 22px;
  background: var(--card-inset); border: 3px solid var(--line-dark); border-radius: var(--radius-lg);
  font-family: var(--font-brand); font-weight: var(--fw-ultrabold);
  font-size: clamp(22px, 3.4vh, 30px); color: #fff;
  box-shadow: var(--shadow-soft);
  transition: transform .14s var(--ease-pop), border-color .14s, background .14s, color .14s;
}
.ce-answer:hover { transform: translateY(-2px); }
.ce-answer:active { transform: scale(.95); }
.ce-answer.is-correct { background: var(--nav); border-color: var(--nav); color: var(--plum); transform: scale(1.06); }
.ce-answer.is-wrong { border-color: var(--brand-orange); opacity: .55; animation: ce-shake .4s; }
@keyframes ce-shake {
  0%,100% { transform: translateX(0); } 20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); }
}

/* ── Contextual action buttons ── */
.ce-actions {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 9; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; max-width: 92%;
}
.ce-act {
  min-height: 68px; padding: 14px 28px; border-radius: var(--radius-full);
  font-family: var(--font-brand); font-weight: var(--fw-ultrabold); font-size: var(--text-lg);
  letter-spacing: var(--tracking-tight);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform var(--dur-fast) var(--ease-pop), box-shadow var(--dur-base), background var(--dur-base), filter .15s;
}
/* Primary drop button — chunky orange */
.ce-act--drop {
  background: linear-gradient(180deg, #FF9C3D, var(--orange-mid));
  color: #fff; border: none;
  box-shadow: 0 6px 0 var(--orange-dark), 0 12px 20px rgba(28,10,36,.32);
  min-width: 210px;
}
.ce-act--drop:hover { filter: brightness(1.04); }
.ce-act--drop:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--orange-dark), 0 6px 12px rgba(28,10,36,.32); }
.ce-act--drop:disabled { filter: grayscale(.4) brightness(.9); cursor: default; box-shadow: 0 6px 0 var(--orange-dark); opacity: .7; }
.ce-act--drop .ce-act-ico {
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #FFD9A8, #FFB257 65%, #EF7A05);
  box-shadow: inset 0 -2px 3px rgba(150,60,0,0.3);
}
/* At eight, the button becomes a bold "Pack" button (like the exploding-dots BANG). */
.ce-act--drop.is-pack {
  background: linear-gradient(180deg, #B6FFDD, var(--nav));
  color: var(--plum); min-width: 210px;
  box-shadow: 0 6px 0 var(--nav-dark), 0 12px 22px rgba(0,0,0,.4);
  animation: ce-pack-pulse .85s ease-in-out infinite;
}
.ce-act--drop.is-pack:hover { filter: brightness(1.03); }
.ce-act--drop.is-pack:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--nav-dark), 0 6px 12px rgba(0,0,0,.4); animation: none; }
@keyframes ce-pack-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
/* Secondary green action — Double / Pack / partial-fact */
.ce-act--green {
  background: var(--nav); color: var(--plum); border: none;
  box-shadow: 0 6px 0 var(--nav-dark), 0 12px 18px rgba(28,10,36,.28);
}
.ce-act--green:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--nav-dark); }
.ce-act--blue {
  background: #fff; color: var(--ink-plum); border: 3px solid var(--brand-blue);
  box-shadow: var(--shadow-soft);
}
.ce-act--blue:active { transform: scale(.96); }
.ce-act:disabled { cursor: default; }

/* ── Top dock — a stage-pips status bar above Ollie + his speech bubble,
   the same shape as the exploding-dots play-top ── */
.ce-play-top {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 24; pointer-events: none; max-width: 96%;   /* above the card overlay so Ollie narrates it */
}
/* In-level card questions keep the crate area dark behind them (Ollie is on top). */
.ce-card-overlay { background: rgba(38, 9, 33, 0.66); }
/* Stage-pips: one per stage — mint = done, white = current, faint = upcoming
   (values copied from exploding-dots). */
.ce-stage-pips { display: flex; gap: 8px; justify-content: center; }
.ce-pip {
  width: 30px; height: 8px; border-radius: var(--radius-full);
  background: rgba(255,255,255,.2); transition: background var(--dur-base);
}
.ce-pip.done { background: var(--nav); }
.ce-pip.active { background: #fff; }

.ce-mascot-dock {
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.ce-mascot {
  width: clamp(115px, 18vh, 169px); height: clamp(115px, 18vh, 169px);
  flex: 0 0 auto; animation: ce-ollie-sway 3s ease-in-out infinite;
}
.ce-mascot canvas { display: block; width: 100% !important; height: 100% !important; }
@keyframes ce-ollie-sway {
  0%,100% { transform: translateX(-5px) rotate(-4deg); } 50% { transform: translateX(5px) rotate(4deg); }
}
/* Ollie speech — orange bubble, fixed width (never resizes per message), tail
   pointing left toward Ollie at its vertical centre. */
.ce-speech-bubble {
  position: relative;
  width: min(64vw, 400px);
  background: var(--brand-orange); border: 2px solid var(--brand-orange);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-soft);
  padding: 8px 16px; opacity: 0; transform: scale(.96);
  transition: opacity var(--dur-base) var(--ease-pop), transform var(--dur-base) var(--ease-pop);
}
.ce-speech-bubble.is-visible { opacity: 1; transform: scale(1); }
.ce-speech-bubble p {
  margin: 0; font-family: var(--font-sans); font-weight: var(--fw-semibold);
  font-size: clamp(15px, 2.1vh, 18px); line-height: 1.4; color: #fff; text-align: center;
}
.ce-speech-bubble::before {
  content: ''; position: absolute; left: -9px; top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 14px; height: 14px; background: var(--brand-orange);
  border-left: 2px solid var(--brand-orange); border-bottom: 2px solid var(--brand-orange);
}

/* ── Level 2 — doubling: 3D crates with 8 + 8 labels + an animated grouping line ── */
.ce-double-stage {
  position: absolute; left: 0; right: 0; top: 214px; bottom: 120px; z-index: 6;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
}
.ce-double-stage[hidden] { display: none; }
.ce-dbl-row {
  display: flex; align-items: flex-end; justify-content: center; flex-wrap: wrap;
  gap: 8px 10px; max-width: 94%;
}
.ce-dbl-unit { display: flex; flex-direction: column; align-items: center; gap: 6px; animation: ce-slidein .4s var(--ease-pop); }
.ce-dbl-8 {
  font-family: var(--font-brand); font-weight: var(--fw-ultrabold);
  font-size: clamp(18px, 2.8vh, 26px); color: var(--brand-orange);
}
.ce-dbl-plus {
  font-family: var(--font-brand); font-weight: var(--fw-ultrabold);
  font-size: clamp(20px, 3vh, 28px); color: var(--text-soft); align-self: center; margin: 0 -2px 6px;
}
.ce-dbl-unit .ce-crate-mini { width: clamp(74px, 9.5vw, 104px); height: clamp(58px, 7.5vh, 80px); }
.ce-dbl-group { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.ce-dbl-line {
  position: relative; height: 5px; background: var(--nav); border-radius: 3px;
  width: min(78%, 660px); transform: scaleX(0); transform-origin: left center;
}
.ce-dbl-line::before, .ce-dbl-line::after {
  content: ''; position: absolute; top: 0; width: 5px; height: 14px; background: var(--nav); border-radius: 3px;
}
.ce-dbl-line::before { left: 0; } .ce-dbl-line::after { right: 0; }
.ce-dbl-line.draw { animation: ce-line-draw .6s ease-out forwards; }
@keyframes ce-line-draw { to { transform: scaleX(1); } }
.ce-dbl-total {
  font-family: var(--font-brand); font-weight: var(--fw-ultrabold);
  font-size: clamp(30px, 5.4vh, 50px); color: var(--nav); opacity: 0; transform: scale(.6);
  text-shadow: 0 2px 14px rgba(161,252,210,.4);
}
.ce-dbl-total.show { animation: ce-total-pop .42s var(--ease-pop) forwards; }
@keyframes ce-total-pop { to { opacity: 1; transform: scale(1); } }

/* ── Level 1 stage 2 — the 8× times table ──
   Centred directly under the "Build N × 8" goal: the chart (1–10 in two columns
   of five) up top, the built crates below it, all above the buttons. */
.ce-times {
  position: absolute; left: 50%; transform: translateX(-50%); top: 252px; bottom: auto;
  width: auto; max-width: 92%; z-index: 6;
  display: grid; grid-template-columns: auto auto; grid-template-rows: repeat(5, auto);
  grid-auto-flow: column; gap: 4px 34px; align-content: start; justify-content: center;
  padding: 12px 22px; background: var(--card); border: 1px solid var(--line-dark);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-soft);
}
.ce-times[hidden] { display: none; }
.ce-times-row {
  display: flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap;
  font-family: var(--font-brand); font-weight: var(--fw-bold); font-size: clamp(11px, 1.7vh, 14px);
  color: var(--text-soft); padding: 3px 6px; border-radius: 6px; transition: background .2s, box-shadow .2s;
}
.ce-times-row b { color: #fff; font-weight: var(--fw-ultrabold); }
.ce-times-row .tt-x { color: var(--text-faint); }
.ce-times-row .tt-val { color: var(--brand-orange); min-width: 26px; text-align: right; }
.ce-times-row.is-now { background: var(--card-inset); box-shadow: 0 0 0 2px var(--nav); color: #fff; }
.ce-times-row.is-now .tt-val { color: var(--nav); }
.ce-times-row.is-done .tt-val { color: var(--nav); }

/* In times-table mode the built crates sit centred BELOW the chart and above
   the counter/buttons. */
.ce-timesmode .ce-stack-wrap {
  left: 50%; right: auto; transform: translateX(-50%); top: auto; bottom: 196px; height: 76px;
  width: min(94%, 900px); align-items: center; justify-content: center; align-content: center;
}
.ce-timesmode .ce-crate-mini { width: 76px; height: 60px; }

/* ── Banner ── the centred goal "orb" + Ollie now carry stage messages, so the
   banner is retired (kept in the DOM; the JS calls are harmless no-ops). ── */
.ce-banner { display: none !important; }
.ce-banner--unused {
  position: absolute; top: 178px; left: 50%; transform: translate(-50%, -8px);
  z-index: 11; background: var(--card-inset); border: 1px solid var(--line-dark);
  border-radius: var(--radius-full); box-shadow: var(--shadow-soft);
  padding: 9px 22px; max-width: 80%; opacity: 0; pointer-events: none;
  transition: opacity var(--dur-slow) var(--ease-pop), transform var(--dur-slow) var(--ease-pop);
}
.ce-banner.is-visible { opacity: 1; transform: translate(-50%, 0); }
.ce-banner p {
  font-family: var(--font-brand); font-weight: var(--fw-bold); font-size: var(--text-md);
  color: #fff; text-align: center; white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════
   Overlays (title / quiz / finale) — copied from the siblings
   ═══════════════════════════════════════════════════════════════════ */
.ce-overlay {
  position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  background: rgba(38, 9, 33, 0.6); padding: 16px; opacity: 1;
  transition: opacity var(--dur-slow) var(--ease-pop);
}
/* Quiz, interim & celebration sit on a solid plum ground. */
#quizOverlay, #finaleOverlay, #interOverlay { background: var(--plum); }

/* ── Interim recap card (between levels) ── */
.ce-inter-card { text-align: center; max-width: 520px; position: relative; }
.ce-inter-card .intro-emoji { margin-bottom: 4px; }
.ce-inter-card h2 {
  font-family: var(--font-brand); font-weight: var(--fw-bold);
  font-size: clamp(21px, 3.4vh, 29px); color: #fff; margin: 6px 0 16px; text-wrap: balance;
}
.ce-inter-list { list-style: none; margin: 0 auto; padding: 0; max-width: 430px; display: flex; flex-direction: column; gap: 10px; }
.ce-inter-list li {
  background: var(--card-inset); border: 1px solid var(--line-dark); border-radius: var(--radius-lg);
  padding: 11px 16px; font-size: clamp(15px, 2.2vh, 18px); color: #fff; line-height: 1.4;
}
.ce-inter-list li b { color: var(--brand-orange); font-weight: var(--fw-bold); }
.ce-inter-card .ce-btn { margin-top: var(--space-6); width: 100%; }
.ce-card {
  background: var(--card); border: 1px solid var(--line-dark); border-radius: 24px;
  box-shadow: var(--shadow-card); padding: var(--space-8); max-width: 560px; width: 100%;
  max-height: 100%; overflow: auto; animation: f3d-pop var(--dur-base) var(--ease-pop);
}
@keyframes f3d-pop { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }

/* Title card */
.ce-title-card { text-align: center; width: min(520px, calc(100vw - 32px)); max-width: none;
  padding: clamp(28px, 4vh, 42px) clamp(24px, 4vw, 40px) clamp(26px, 3.4vh, 36px); }
.intro-logo { display: block; height: 32px; width: auto; margin: 0 auto 14px; }
.intro-emoji { font-size: clamp(38px, 6vh, 48px); line-height: 1; }
.ce-title-card h1 {
  margin: 8px 0 8px; font-family: var(--font-brand); font-weight: var(--fw-bold);
  font-size: clamp(28px, 4.8vh, 40px); line-height: 1.08; letter-spacing: var(--tracking-tight);
  text-wrap: balance; color: #fff;
}
.intro-sub { font-size: clamp(13px, 1.8vh, 15px); font-weight: 700; letter-spacing: .02em; color: #EB7CB2; margin: 0 0 6px; }
.intro-subtitle { font-size: clamp(15px, 2.2vh, 19px); font-weight: 800; letter-spacing: .01em; color: #EB7CB2; margin: 0 0 12px; }
.intro-subhead {
  margin: clamp(20px, 4vh, 40px) auto; max-width: 420px;
  font-size: clamp(16px, 2.6vh, 21px); font-weight: 700; line-height: 1.25; text-wrap: balance; color: #fff;
}
.ce-hot-word {
  display: inline-block;
  background-image: linear-gradient(110deg, var(--brand-yellow), #FFB020 45%, var(--brand-orange));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
  animation: ce-hot-pulse 1.6s var(--ease-pop) infinite;
}
@keyframes ce-hot-pulse { 0%,100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.12) rotate(2deg); } }

/* Level picker */
.ce-level-picker {
  margin-top: 0; display: flex; flex-direction: row; flex-wrap: wrap;
  align-items: center; justify-content: center; gap: 12px;
}
.ce-btn.ce-level-btn {
  flex: 0 0 auto; display: block; text-align: center; min-width: 0; min-height: 0;
  padding: 12px 30px; font-size: clamp(15px, 2.4vh, 18px); font-weight: var(--fw-ultrabold);
  line-height: 1.17; white-space: nowrap; width: auto; margin-top: 0;
}
.ce-level-btn.ce-btn--primary { border: 2px solid var(--nav); box-shadow: 0 6px 14px rgba(0,0,0,.3); }
.ce-level-btn.ce-btn--primary:active { transform: translateY(2px) scale(.98); box-shadow: 0 3px 8px rgba(0,0,0,.3); }
.ce-level-btn.ce-btn--outline { background: transparent; color: #A1FCD2; border: 2px solid #A1FCD2; box-shadow: none; }

/* Buttons */
.ce-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 64px; padding: 14px 32px; border-radius: var(--radius-full);
  font-family: var(--font-brand); font-weight: var(--fw-bold); font-size: var(--text-md);
  letter-spacing: var(--tracking-tight);
  transition: transform var(--dur-fast) var(--ease-pop), box-shadow var(--dur-base), background var(--dur-base);
}
.ce-btn:active { transform: scale(0.96); }
.ce-btn--primary { background: var(--nav); color: var(--plum); border: none; box-shadow: 0 8px 0 var(--nav-dark), 0 14px 22px rgba(0,0,0,.4); }
.ce-btn--primary:hover { background: #b6ffdd; }
.ce-btn--primary:active { transform: translateY(3px) scale(.98); box-shadow: 0 4px 0 var(--nav-dark), 0 8px 14px rgba(0,0,0,.4); }
.ce-btn--outline:hover { background: #A1FCD2; color: var(--plum); }
.ce-btn--outline:active { transform: translateY(2px) scale(.98); }

/* ── Quiz ── */
.ce-quiz-card { text-align: center; position: relative; max-width: 520px;
  padding: clamp(24px, 5vh, 44px) clamp(24px, 5vw, 52px); }
.ce-quiz-next {
  position: absolute; bottom: 12px; right: 12px; z-index: 3;
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
  border-radius: 50%; border: 2px solid var(--nav); background: transparent; color: var(--nav);
  font-family: var(--font-brand); font-weight: var(--fw-bold); font-size: 22px; line-height: 1; cursor: pointer;
  transition: background .15s, color .15s, transform .1s;
}
.ce-quiz-next[hidden] { display: none; }
.ce-quiz-next:hover { background: var(--nav); color: var(--plum); }
.ce-quiz-next:active { transform: scale(.95); }
.ce-quiz-stars { display: flex; gap: 8px; justify-content: center; margin-bottom: var(--space-5); }
.ce-quiz-star { width: 30px; height: 30px; flex-shrink: 0; opacity: 0.35; transition: opacity var(--dur-base) var(--ease-pop), transform var(--dur-base) var(--ease-pop); }
.ce-quiz-star.is-earned { opacity: 1; transform: scale(1.12); }
.ce-quiz-prompt {
  font-family: var(--font-brand); font-weight: var(--fw-ultrabold);
  font-size: clamp(16px, 2.6vh, 21px); color: #EB7CB2; text-align: center; text-wrap: balance; margin-bottom: var(--space-2);
}
.ce-quiz-title {
  font-family: var(--font-brand); font-weight: var(--fw-bold);
  font-size: clamp(22px, 3.6vh, 30px); color: #fff; text-align: center; margin-bottom: var(--space-4); text-wrap: balance;
}
.ce-quiz-scene { display: flex; justify-content: center; margin: var(--space-2) 0 var(--space-4); }
.ce-quiz-crates {
  display: inline-flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 340px;
}
.ce-quiz-options { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; width: 100%; margin-top: var(--space-4); }
.ce-quiz-option {
  flex: 0 1 auto; min-width: 96px; min-height: 68px; background: var(--card-inset);
  border: 3px solid var(--line-dark); border-radius: var(--radius-lg); padding: 12px 22px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-brand); font-weight: var(--fw-ultrabold); font-size: clamp(20px, 3vh, 26px);
  color: #fff; text-align: center; box-shadow: var(--shadow-soft);
  transition: transform .16s var(--ease-pop), border-color .16s, background .16s, color .16s;
}
.ce-quiz-option:hover { transform: translateY(-2px); }
.ce-quiz-option:active { transform: scale(0.95); }
.ce-quiz-option.is-correct { background: #A1FCD2; color: var(--plum); border-color: #A1FCD2; transform: scale(1.06); }
.ce-quiz-option.is-wrong { border-color: var(--brand-orange); opacity: 0.55; animation: ce-shake .4s; }
.ce-quiz-feedback {
  margin-top: var(--space-5); min-height: 2.4em; font-size: clamp(14px, 2vh, 17px);
  font-weight: var(--fw-semibold); color: var(--text-soft); text-align: center;
}
.ce-quiz-feedback.is-good { color: var(--brand-green); }
.ce-quiz-feedback strong { color: inherit; }

/* ── Finale / celebration ── */
.ce-finale-card { text-align: center; max-width: 540px; }
.ce-finale-title {
  font-family: var(--font-brand); font-weight: var(--fw-ultrabold);
  font-size: clamp(26px, 4.4vh, 38px); line-height: 1.12; color: #fff; text-wrap: balance;
}
.ce-finale-take {
  margin-top: var(--space-5); padding: var(--space-5);
  background: var(--card-inset); border: 1px solid var(--line-dark); border-radius: var(--radius-lg);
  font-size: var(--text-md); color: #fff; font-style: italic;
}
.ce-finale-note { margin-top: var(--space-3); font-size: var(--text-sm); color: var(--text-faint); }
.ce-finale-card .ce-btn { margin-top: var(--space-6); width: 100%; }
.ce-finale-stars { display: flex; gap: 10px; justify-content: center; margin-bottom: var(--space-4); }
.ce-finale-stars .ce-quiz-star { width: 38px; height: 38px; }

/* The dot-grid "F" the finale swirl resolves into */
.ce-dotgrid-f { display: block; margin: 0 auto var(--space-4); width: 96px; height: auto; }

/* ── End-of-experience feedback card (copied from the sibling activities) ── */
.ce-card.ce-endcard { max-width: 540px; text-align: center; }
.ce-end-title {
  font-family: var(--font-brand); font-weight: var(--fw-ultrabold);
  font-size: clamp(26px, 4.4vh, 38px); line-height: 1.12; color: #fff; text-align: center; text-wrap: balance;
}
.ce-end-ask {
  margin-top: var(--space-4); font-family: var(--font-brand); font-weight: var(--fw-ultrabold);
  font-size: clamp(17px, 2.8vh, 22px); color: var(--brand-pink); text-align: center;
}
.ce-end-row { display: flex; gap: 12px; margin-top: var(--space-5); align-items: flex-end; }
.ce-end-field { display: flex; flex-direction: column; gap: 6px; text-align: left; margin-top: var(--space-4); }
.ce-end-row .ce-end-field { margin-top: 0; }
.ce-end-field--grow { flex: 1 1 auto; }
.ce-end-field--age { flex: 0 0 104px; }
.ce-end-label {
  font-family: var(--font-brand); font-weight: var(--fw-bold);
  font-size: clamp(13px, 1.8vh, 15px); color: var(--text-soft);
}
.ce-end-input {
  width: 100%; min-height: 52px; background: var(--card-inset); border: 3px solid var(--line-dark);
  border-radius: var(--radius-lg); padding: 12px 16px; font-family: var(--font-brand); font-weight: var(--fw-semibold);
  font-size: clamp(15px, 2.2vh, 18px); color: #fff; transition: border-color .16s;
}
.ce-end-input::placeholder { color: var(--text-faint); }
.ce-end-input:focus { outline: none; border-color: var(--brand-pink); }
.ce-end-select { min-height: 52px; cursor: pointer; text-align: center; }
.ce-end-select option { color: #fff; background: var(--plum); }
.ce-end-textarea { resize: vertical; min-height: 76px; line-height: 1.4; }
.ce-end-rate { margin-top: var(--space-5); }
.ce-end-actions { display: flex; gap: 12px; margin-top: var(--space-6); }
.ce-end-actions .ce-btn { flex: 1 1 0; width: auto; margin-top: 0; text-decoration: none; }
.ce-btn--secondary {
  background: transparent; color: #fff; border: 2px solid var(--line-dark); box-shadow: var(--shadow-soft);
}
.ce-btn--secondary:hover { border-color: var(--nav); background: var(--card-inset); }
@media (max-width: 480px) { .ce-end-actions { flex-direction: column; } }

/* ── Fruit sprinkle (matches the sibling activities) ── */
.fruit-sprinkle { position: fixed; inset: 0 0 auto 0; height: 0; pointer-events: none; z-index: 900; }
.fruit-sprinkle-item {
  position: fixed; display: block; height: auto; opacity: 0; will-change: transform, opacity;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .16));
}
.fruit-burst { position: fixed; inset: 0; height: 0; pointer-events: none; z-index: 950; }
.fruit-burst-item {
  position: fixed; display: block; height: auto; opacity: 0; will-change: transform, opacity;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .18));
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .ce-mascot { animation: none; }
  .ce-hot-word { animation: none; }
  .ce-crate.ce-crate--open.is-full { animation: none; box-shadow: 0 0 0 4px var(--brand-yellow), var(--shadow-wood); }
  .ce-orange, .ce-crate-mini { animation-duration: 1ms; }
  .ce-banner, .ce-banner.is-visible { transform: translate(-50%, 0) !important; }
  .ce-overlay, .ce-card, .ce-banner, .ce-speech-bubble { animation: none !important; transition-duration: 160ms !important; }
  .ce-total-num.ce-bump { animation: ce-fade-pulse 300ms ease-in-out; }
}
@keyframes ce-fade-pulse { 0%,100% { opacity: 1; } 50% { opacity: .6; } }

/* ═══════════════════════════════════════════════════════════════════
   Responsive — narrow / portrait: dock controls along the bottom
   ═══════════════════════════════════════════════════════════════════ */
/* ── Compact screens (small laptops, tablets, short landscape) — keep the
   top mascot clear of the goal chip / HUD and the crate clear of the bottom
   controls + counter. The 1024×768 target renders at full size (no trigger). */
@media (max-width: 1000px), (max-height: 700px) {
  .ce-hud-group { top: 8px; right: 8px; }
  .ce-hud { min-width: 128px; padding: 7px 12px 9px; }
  .ce-hud-level { font-size: 16px; margin-bottom: 2px; }
  .ce-hud-pct { font-size: 11px; margin-bottom: 6px; }
  .ce-hud-track { height: 9px; }
  .ce-hud-btn { font-size: 12px; padding: 7px 8px; }

  .ce-goal { top: 128px; max-width: 80%; padding: 6px 16px; }
  .ce-goal-lead { font-size: 10px; }
  .ce-goal-main { font-size: clamp(15px, 2.4vh, 22px); }

  .ce-mascot { width: clamp(86px, 14vh, 126px); height: clamp(86px, 14vh, 126px); }
  .ce-speech-bubble { width: min(46vw, 300px); padding: 7px 13px; }
  .ce-speech-bubble p { font-size: clamp(12px, 1.9vh, 16px); }

  .ce-crate.ce-crate--open { width: clamp(180px, 38vw, 258px); }
  .ce-open-wrap { top: 186px; left: 4%; }
  .ce-stack-wrap { top: 182px; bottom: 172px; width: 44%; }
  .ce-actions, .ce-answers { bottom: 20px; }
  .ce-total { bottom: 88px; }
  .ce-total-num { font-size: clamp(30px, 5.6vh, 48px); }

  .ce-unpack .ce-pile-wrap { top: 184px; height: clamp(140px, 34vh, 220px); width: 45%; }
  .ce-unpack .ce-pile-o { width: 38px; height: 38px; }
  .ce-unpack .ce-open-wrap { top: 220px; left: 60%; }
  .ce-unpack .ce-stack-wrap { top: 184px; bottom: 150px; width: 26%; }

  /* times table: sit the compact chart just under the goal and the crates just
     above the counter, on this shorter/narrower canvas */
  .ce-times { top: 182px; padding: 8px 16px; gap: 2px 22px; }
  .ce-times-row { font-size: clamp(10px, 1.7vh, 13px); }
  .ce-timesmode .ce-stack-wrap { bottom: 136px; height: 64px; }
  .ce-timesmode .ce-crate-mini { width: 54px; height: 44px; }
}

/* ── Very narrow (phones, portrait) — the goal is spoken by Ollie, so drop the
   chip to give the top-centre mascot room; centre the single crate. ── */
/* ═══════════════════════════════════════════════════════════════════
   Narrow / portrait phones — stack the top vertically (HUD, then the
   mascot dock below it, then the goal orb) so nothing crosses over, and
   keep the counter clear above the bottom controls.
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 700px) {
  .ce-hud-group { top: 6px; right: 6px; gap: 6px; }
  .ce-hud { min-width: 104px; padding: 5px 9px 6px; }
  .ce-hud-level { font-size: 13px; margin-bottom: 1px; }
  .ce-hud-pct { font-size: 10px; margin-bottom: 4px; }
  .ce-hud-track { height: 7px; }
  .ce-hud-btn { font-size: 11px; padding: 5px 6px; }

  .ce-play-top { top: 94px; max-width: 100%; }   /* below the taller HUD (Level + Back/Menu) */
  .ce-mascot { width: 54px; height: 54px; }
  .ce-speech-bubble { width: min(70vw, 288px); padding: 6px 12px; }
  .ce-speech-bubble p { font-size: clamp(13px, 3.6vw, 15px); }

  .ce-goal { top: 184px; left: 50%; transform: translateX(-50%); max-width: 92%; padding: 6px 14px; }
  .ce-goal-lead { font-size: 10px; }
  .ce-goal-main { font-size: clamp(17px, 5.4vw, 24px); }

  /* smaller controls so pairs of buttons fit one row (don't wrap into the counter) */
  .ce-act { padding: 9px 13px; min-height: 54px; font-size: clamp(14px, 3.9vw, 17px); white-space: nowrap; }
  .ce-answer { padding: 10px 15px; min-height: 58px; font-size: clamp(20px, 6vw, 26px); }

  /* one shared bottom: counter above the controls */
  .ce-actions, .ce-answers { bottom: 14px; left: 50%; right: auto; transform: translateX(-50%); width: auto; max-width: 97%; flex-wrap: nowrap; gap: 8px; }
  .ce-total { bottom: 96px; }
  .ce-total-num { font-size: clamp(26px, 6.6vw, 42px); }
  .ce-bagmode .ce-total { top: 8px; left: 8px; bottom: auto; }

  /* the play band sits between the goal and the counter */
  .ce-open-wrap { top: 250px; }
  .ce-packmode .ce-crate--open { width: clamp(178px, 58vw, 234px); }
  .ce-packmode .ce-stack-wrap { top: auto; bottom: 188px; height: 90px; align-items: center; }

  .ce-stack-wrap { left: 50%; right: auto; transform: translateX(-50%); top: 246px; bottom: 190px; width: 94%; }
  .ce-count .ce-crate-mini { width: 66px; height: 54px; }

  .ce-times { left: 50%; transform: translateX(-50%); top: 242px; bottom: auto;
    width: auto; max-width: 94%; padding: 7px 12px; gap: 1px 16px; }
  .ce-times-row { font-size: 10px; padding: 1px 4px; }
  /* one compact centred row of crates — fits up to ten without wrapping behind
     the chart on short phones */
  .ce-timesmode .ce-stack-wrap { left: 50%; right: auto; transform: translateX(-50%);
    top: auto; bottom: 140px; height: 46px; width: 98%; }
  .ce-timesmode .ce-stack { gap: 4px; flex-wrap: nowrap; }
  .ce-timesmode .ce-crate-mini { width: 30px; height: 25px; }

  .ce-double-stage { top: 250px; bottom: 176px; gap: 8px; justify-content: flex-start; }
  .ce-dbl-unit .ce-crate-mini { width: clamp(46px, 13vw, 68px); height: clamp(38px, 10.5vw, 54px); }
  .ce-dbl-8 { font-size: 15px; }
  .ce-dbl-row { gap: 6px 7px; }
  .ce-dbl-line { width: min(88%, 320px); }
  .ce-dbl-total { font-size: clamp(26px, 8vw, 40px); }

  .ce-bag-stage { top: 244px; bottom: 90px; left: 2%; right: 2%; gap: 1%; }
  .ce-basket { width: 26%; padding: 8px 4px; }
  .ce-bag { width: clamp(96px, 30vw, 140px); }
  .ce-bag-dock-wrap { width: 26%; }
  .ce-dock-bag { width: 44px; height: 56px; }
  .ce-drag-orange { width: 40px; height: 40px; }
}

/* ═══════════════════════════════════════════════════════════════════
   Short / landscape phones — very little height, so compact hard: the
   mascot + goal share a slim top strip and the counter tucks bottom-right.
   ═══════════════════════════════════════════════════════════════════ */
@media (max-height: 500px) and (min-width: 560px) {
  .ce-hud-group { top: 4px; right: 4px; gap: 5px; }
  .ce-hud { min-width: 88px; padding: 3px 7px 4px; }
  .ce-hud-level { font-size: 12px; margin-bottom: 0; }
  .ce-hud-pct { font-size: 9px; margin-bottom: 2px; }
  .ce-hud-track { height: 5px; }
  .ce-hud-btn { font-size: 10px; padding: 3px 5px; }

  .ce-stage-pips { display: none; }
  .ce-play-top { top: 4px; left: 8px; transform: none; }
  .ce-mascot { width: 42px; height: 42px; }
  .ce-speech-bubble { width: min(44vw, 280px); padding: 4px 10px; }
  .ce-speech-bubble p { font-size: 12px; }

  /* goal sits to the right of the mascot's bubble, clear of the HUD */
  .ce-goal { top: 6px; left: auto; right: 152px; transform: none; padding: 3px 12px; max-width: 210px; }
  .ce-goal-lead { display: none; }
  .ce-goal-main { font-size: 15px; }

  .ce-actions, .ce-answers { bottom: 8px; }
  .ce-total { top: auto; bottom: 8px; left: auto; right: 14px; transform: none; align-items: flex-end; }
  .ce-total-num { font-size: 26px; }
  .ce-total-label { display: none; }
  .ce-bagmode .ce-total { top: auto; bottom: 8px; left: 50%; right: auto; transform: translateX(-50%); align-items: center; }

  .ce-open-wrap { top: 56px; }
  .ce-packmode .ce-crate--open { width: clamp(140px, 26vw, 180px); }
  .ce-packmode .ce-stack-wrap { top: auto; bottom: 70px; height: 56px; }
  .ce-stack-wrap { top: 56px; bottom: 78px; width: 90%; }
  .ce-count .ce-crate-mini { width: 52px; height: 42px; }

  .ce-times { left: 50%; transform: translateX(-50%); top: 44px; bottom: auto;
    width: auto; max-width: 66%; padding: 5px 12px; gap: 1px 14px; }
  .ce-times-row { font-size: 10px; padding: 1px 4px; }
  .ce-timesmode .ce-stack-wrap { left: 50%; right: auto; transform: translateX(-50%);
    top: auto; bottom: 58px; height: 40px; width: 72%; }
  .ce-timesmode .ce-crate-mini { width: 42px; height: 34px; }

  .ce-double-stage { top: 50px; bottom: 60px; gap: 8px; }
  .ce-dbl-unit .ce-crate-mini { width: 52px; height: 42px; }
  .ce-dbl-8 { font-size: 14px; }
  .ce-dbl-line { width: min(86%, 300px); }
  .ce-dbl-total { font-size: 24px; }

  .ce-bag-stage { top: 50px; bottom: 50px; }
  .ce-bag { width: clamp(88px, 15vw, 120px); }
  .ce-drag-orange { width: 38px; height: 38px; }
  .ce-bag-minus { min-height: 40px; }
}
