/* Maths Sprites: The Balance Lab — original CSS-drawn prototype assets.
   No external fonts, services, images, libraries or tracking. */
:root{
  color-scheme:dark;
  --ink:#131a1c; --night:#0e1517; --deep:#192224;
  --panel:#222c2e; --panel-2:#2a3535;
  --paper:#e9dbc0; --paper-deep:#d7c29a;
  --text:#eee6d5; --muted:#a9b4ac;
  --brass:#d0ae73; --brass-dark:#81623e; --teal:#a4c1bc;
  --line:rgba(222,195,140,.25); --focus:#eac58a;
}
*{box-sizing:border-box}
[hidden]{display:none!important}
html{background:var(--night)}
body{margin:0;min-height:100vh;font-family:"Trebuchet MS","Segoe UI",sans-serif;color:var(--text);background:
  radial-gradient(ellipse at 50% -18%,rgba(148,107,68,.18),transparent 52%),linear-gradient(#141d1e,#0e1517 80%)}
button,select{font:inherit}
button{cursor:pointer;touch-action:manipulation}
button:disabled{opacity:.35;cursor:not-allowed}
button:focus-visible,select:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
h1,h2,h3,p{margin:0}
h1,h2,h3{font-family:Georgia,"Times New Roman",serif}
.eyebrow,.control-label,legend{font-size:.67rem;letter-spacing:.18em;font-weight:700;text-transform:uppercase;color:var(--brass)}
.app-shell{max-width:1510px;margin:0 auto;padding:0 22px 24px}
.topbar{min-height:105px;padding:19px 5px 15px;display:flex;justify-content:space-between;align-items:center;gap:30px;border-bottom:1px solid rgba(212,178,115,.15)}
.identity{display:flex;align-items:center;gap:16px}
.identity h1{font-size:clamp(1.65rem,2.5vw,2.4rem);line-height:1.05;letter-spacing:-.03em;font-weight:500}
.title-dot{color:var(--brass)}
.brand-mark{width:49px;height:49px;flex:none;border:1px solid rgba(209,181,124,.6);border-radius:50%;display:flex;align-items:center;justify-content:center;position:relative;background:radial-gradient(circle at 20% 15%,#4c4b3e,#192222 78%);box-shadow:0 0 0 4px rgba(197,161,95,.06)}
.brand-mark:before,.brand-mark:after{content:"";position:absolute;left:9px;right:9px;bottom:11px;height:2px;background:#c5aa75;transform:rotate(16deg)}
.brand-mark:after{transform:rotate(-16deg)}
.brand-mark i{display:block;position:relative;width:10px;height:10px;background:#f5efe1;border-radius:50%;z-index:1;box-shadow:0 0 0 9px #262829}
.brand-mark i+i{margin-left:6px}
.header-actions{display:flex;align-items:end;gap:12px;flex-wrap:wrap;justify-content:flex-end}
.labelled-select{display:flex;flex-direction:column;gap:6px;font-size:.65rem;color:#b3bdba;letter-spacing:.08em}
select,.top-icon{color:var(--text);background:#273333;border:1px solid rgba(215,184,126,.29);border-radius:8px;min-height:40px;padding:8px 12px}
.labelled-select select{min-width:180px}
.top-icon{margin-bottom:0;white-space:nowrap;font-size:.76rem}
/* An unambiguous, accessible explanation when system/browser accessibility
   settings have paused all the playful animations. It is not shown otherwise. */
.motion-notice{margin:9px 5px 12px;padding:13px 17px;border:1px solid rgba(222,190,129,.65);
  border-radius:11px;background:linear-gradient(110deg,#303c38,#263330);
  box-shadow:0 4px 12px rgba(0,0,0,.2);
  display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px}
.motion-notice-copy{display:flex;flex-direction:column;gap:4px;flex:1 1 270px;
  font-size:.83rem;line-height:1.4;color:#e8dcc5}
.motion-notice-copy strong{font:600 .97rem Georgia,serif;color:#f4d7a2}
.motion-enable{flex:none;min-height:42px;padding:10px 16px;border-radius:8px;
  border:1px solid #f4d7a1;background:linear-gradient(#e9d09f,#c7a16d);
  color:#28291f;font-weight:800;font-size:.82rem}
.motion-enable:hover{filter:brightness(1.07)}
@media(max-width:600px){.motion-enable{width:100%}}
.chapter-strip{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:22px 5px 17px}
.chapter-strip h2{font-size:clamp(1.45rem,2.7vw,2.3rem);font-weight:400;margin-top:5px}
.step-dots{display:flex;gap:10px;align-items:center}
.progress-dot{display:block;height:9px;width:33px;border:1px solid #6f6855;background:#28312f;border-radius:20px}
.progress-dot.lit{background:#c3a16e;border-color:#ddbd89}
.progress-dot.current{box-shadow:0 0 0 3px rgba(221,189,137,.13)}
.playfield{height:582px;position:relative;overflow:hidden;border-radius:18px;border:1px solid #4d4836;background:
  linear-gradient(90deg,rgba(0,0,0,.5),transparent 25%,transparent 70%,rgba(0,0,0,.52)),
  radial-gradient(ellipse at 50% 35%,rgba(125,147,138,.19),transparent 54%),
  linear-gradient(#172226 0%,#27312f 54%,#202120 84%,#151714);
  box-shadow:inset 0 0 0 8px rgba(11,14,14,.24),inset 0 25px 65px rgba(0,0,0,.6),0 24px 55px rgba(0,0,0,.25)}
.playfield:before{content:"";position:absolute;left:3%;right:3%;top:0;height:12px;background:linear-gradient(90deg,#322b22,#5c4c33,#362b22);border-bottom:2px solid #866747}
.playfield:after{content:"";position:absolute;inset:0;pointer-events:none;z-index:13;opacity:.15;
background-image:repeating-linear-gradient(90deg,transparent 0 66px,rgba(0,0,0,.12) 68px 70px)}
.ambient-window{position:absolute;width:330px;height:350px;left:50%;top:1px;transform:translateX(-50%);border:12px solid #242829;border-bottom:25px solid #262c2b;border-radius:180px 180px 9px 9px;background:linear-gradient(#334c54,#45645b 65%,#1b302e);box-shadow:0 0 0 4px #55503f,inset 0 0 80px rgba(12,17,20,.4);opacity:.73}
.ambient-window:before{content:"";position:absolute;top:0;bottom:0;left:49%;border-left:12px solid #222b2b}
.ambient-window:after{content:"";position:absolute;left:0;right:0;top:49%;border-top:12px solid #222b2b}
.moon{position:absolute;left:62px;top:44px;width:53px;height:53px;border-radius:50%;background:rgba(240,234,206,.8);box-shadow:0 0 70px 18px rgba(235,222,174,.2)}
.shelf{position:absolute;width:127px;height:130px;border-bottom:10px solid #63503b;top:148px;opacity:.45}
.shelf-left{left:4%}.shelf-right{right:4%}
.shelf:before{content:"";height:5px;background:#806743;top:55%;position:absolute;left:0;right:0}
.shelf i{display:inline-block;background:linear-gradient(90deg,#3b716d,#82a194,#385b59);border:2px solid #b2a47c;width:18px;height:34px;margin:21px 4px 0;border-radius:8px 8px 3px 3px}
.shelf i:nth-child(even){height:47px;background:#81775d}
.light-pool{position:absolute;inset:19% 13% 15%;background:radial-gradient(ellipse at center,rgba(223,185,104,.13),transparent 70%);pointer-events:none}
.scene-heading{position:absolute;z-index:7;left:30px;top:26px;display:flex;gap:15px;align-items:center;font-size:.66rem;letter-spacing:.16em;color:rgba(228,199,146,.72)}
.scene-heading-rule{display:inline-block;width:47px;border-bottom:1px solid currentColor;opacity:.5}
.speech{position:absolute;z-index:18;right:18%;top:34px;max-width:276px;padding:16px 20px;border:1px solid #ad9065;border-radius:16px 16px 16px 4px;background:#ece0c7;color:#37312c;font:italic 1rem/1.38 Georgia,serif;box-shadow:0 12px 30px #0008;animation:speech-in .24s ease-out}
.speech.trial-speech{right:3%;top:13px;max-width:355px;padding:11px 14px;font-size:.84rem;line-height:1.3}
.speech:after{content:"";position:absolute;bottom:-13px;left:18px;border:7px solid transparent;border-top-color:#ece0c7}
@keyframes speech-in{from{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}
.giant-hand{position:absolute;left:27%;top:-165px;width:187px;height:242px;
  transform:translateX(-50%) translateY(-35px);z-index:20;pointer-events:none;
  transition:transform .64s cubic-bezier(.22,.75,.25,1);
  filter:drop-shadow(9px 12px 10px rgba(0,0,0,.48));
  will-change:transform}
.giant-hand.tracking-sprite .hand-art{transform:translateX(var(--hand-chase,10px)) rotate(3deg)}
.hand-art{display:block;position:relative;z-index:3;width:100%;height:100%;overflow:visible;
  filter:drop-shadow(1px 2px 1px rgba(27,20,14,.3))}
.hand-art{transition:transform .19s ease-out}
.hand-art .hand-digit{transform-box:view-box;transition:transform .29s cubic-bezier(.25,.75,.2,1.08);
  will-change:transform}
.hand-art .digit-thumb{transform-origin:72px 152px;transform:rotate(7deg)}
.hand-art .digit-index{transform-origin:88px 179px;transform:rotate(-10deg)}
.hand-art .digit-middle{transform-origin:109px 182px;transform:rotate(-3deg)}
.hand-art .digit-ring{transform-origin:126px 180px;transform:rotate(6deg)}
.hand-art .digit-pinky{transform-origin:144px 177px;transform:rotate(12deg)}
.hand-art .skin-crease{stroke:#825d4b;stroke-width:1.8;stroke-linecap:round;fill:none;opacity:.56}
.hand-art .skin-nail{stroke:#f6d0b0;stroke-width:2.6;stroke-linecap:round;fill:none;opacity:.8}
.giant-hand[data-phase="grip"] .digit-thumb,
.giant-hand[data-phase="carry"] .digit-thumb,
.giant-hand[data-phase="lift"] .digit-thumb{transform:rotate(-28deg)}
.giant-hand[data-phase="grip"] .digit-index,
.giant-hand[data-phase="carry"] .digit-index,
.giant-hand[data-phase="lift"] .digit-index{transform:rotate(22deg) translateY(-5px)}
.giant-hand[data-phase="grip"] .digit-middle,
.giant-hand[data-phase="carry"] .digit-middle,
.giant-hand[data-phase="lift"] .digit-middle{transform:rotate(6deg) translateY(-10px)}
.giant-hand[data-phase="grip"] .digit-ring,
.giant-hand[data-phase="carry"] .digit-ring,
.giant-hand[data-phase="lift"] .digit-ring{transform:rotate(15deg) translateY(-11px)}
.giant-hand[data-phase="grip"] .digit-pinky,
.giant-hand[data-phase="carry"] .digit-pinky,
.giant-hand[data-phase="lift"] .digit-pinky{transform:rotate(25deg) translateY(-15px)}
.giant-hand[data-phase="release"] .digit-index{transform:rotate(-15deg)}
.giant-hand[data-phase="release"] .digit-thumb{transform:rotate(13deg)}
.giant-hand[data-phase="release"] .digit-middle{transform:rotate(-8deg)}
.giant-hand[data-phase="release"] .digit-ring{transform:rotate(5deg)}
.giant-hand[data-phase="release"] .digit-pinky{transform:rotate(11deg)}
.giant-hand.approaching{transform:translateX(-50%) translateY(calc(var(--hand-reach,300px) - 72px))}
.giant-hand.reaching{transform:translateX(-50%) translateY(var(--hand-reach,300px))}
.giant-hand.lifting{transform:translateX(-50%) translateY(calc(var(--hand-reach,300px) - 54px))}
.giant-hand.acting{filter:drop-shadow(10px 14px 12px rgba(0,0,0,.65))}
.giant-hand.grasping .hand-art{filter:drop-shadow(2px 3px 2px rgba(23,16,11,.28))}
.hand-cargo{position:absolute;z-index:4;top:82%;left:39%;width:62px;height:64px;
  transform:translate(-50%,-10px);pointer-events:none;
  transition:opacity .16s ease,transform .24s ease;
  filter:drop-shadow(2px 4px 6px rgba(0,0,0,.67))}
.giant-hand[data-phase="release"] .hand-cargo{transform:translate(-50%,4px);opacity:.16}
.held-weight{position:absolute;left:18px;top:9px;width:33px;height:33px;
  background:linear-gradient(100deg,#82603e,#dfc18c,#80603e);
  clip-path:polygon(33% 4%,67% 4%,94% 95%,10% 95%);border-radius:5px}
.held-sprite{position:absolute;left:13px;top:6px;width:39px;height:38px;
  background:radial-gradient(circle at 30% 20%,#444c4b,#111516 70%);
  border-radius:46%;box-shadow:0 0 0 2px #4a4d47}
.held-sprite-pale{background:radial-gradient(circle at 30% 20%,#f8f3e9,#b9c4c0 73%);box-shadow:0 0 0 2px #a5b6b4}
.held-sprite-square{border-radius:7px;background:radial-gradient(circle at 30% 20%,#58736b,#233a35 80%);box-shadow:0 0 0 3px #c9a878}
.held-sprite-pale i{background:#2c3532}
.hand-cargo.sprite-captured .held-sprite{animation:held-sprite-squirm .35s ease-in-out infinite alternate}
@keyframes held-sprite-squirm{
  from{transform:translateX(-2px) rotate(-6deg) scale(.98,1.03)}
  to{transform:translateX(2px) rotate(7deg) scale(1.05,.96)}
}
.held-sprite i{position:absolute;top:12px;left:11px;width:6px;height:8px;border-radius:50%;background:#f1eddd}
.held-sprite i+i{left:23px}
.held-basket{position:absolute;left:4px;top:4px;width:56px;height:46px;
  border:4px solid #d9bb84;border-top:8px solid #c89f66;border-radius:5px 5px 16px 16px;
  background:repeating-linear-gradient(0deg,rgba(196,161,101,.25) 0 6px,rgba(207,218,204,.14) 6px 12px)}
.held-basket-double:after{content:"";position:absolute;top:5px;left:21px;width:44px;height:36px;
  border:3px solid #e4cda3;border-radius:5px 5px 12px 12px;background:rgba(124,154,136,.22)}
.held-count{position:absolute;right:-8px;bottom:0;padding:2px 6px;border-radius:8px;
  background:#dfc18c;color:#352b20;font:bold .77rem Georgia,serif}
.action-caption{position:absolute;z-index:23;left:50%;bottom:48px;max-width:92%;
  transform:translateX(-50%);padding:8px 15px;border:1px solid #e4c792;
  border-radius:22px;background:rgba(24,34,32,.96);color:#f5e6c7;
  box-shadow:0 5px 18px #0008;font:.83rem/1.25 Georgia,serif;text-align:center}
.hand-target .room-interior{box-shadow:inset 0 0 25px #101817,0 0 0 3px #c2a172,0 0 18px rgba(223,191,132,.3)}
.hand-contact .room-interior{box-shadow:inset 0 0 30px #101817,0 0 0 3px #ae8b60,0 0 32px rgba(234,203,136,.46)}
.hand-contact .room-interior:after{content:"";position:absolute;pointer-events:none;z-index:6;
  left:35%;right:35%;bottom:24px;height:43px;border-radius:50%;
  background:radial-gradient(ellipse at center,rgba(241,218,160,.36),transparent 73%);
  animation:hand-contact-glow .5s ease-out both}
@keyframes hand-contact-glow{from{opacity:.2;transform:scale(.65)}45%{opacity:.8}to{opacity:0;transform:scale(1.4)}}
.solved-scene .room-interior{box-shadow:inset 0 0 25px #101817,0 0 0 3px #e7c68d,0 0 36px rgba(234,203,136,.64)}
.solved-scene .scene-caption{color:#eed9a0}
.rooms-row{position:absolute;z-index:5;left:4.5%;width:91%;top:101px;display:flex;justify-content:space-between;align-items:flex-start;gap:7%;transition:transform .45s ease;transform-origin:50% 350px}
.chamber{width:46.5%;min-width:0;position:relative;z-index:2}
.room-roof{height:40px;position:relative;margin:0 12px -10px;border:8px solid #594431;border-bottom:0;border-radius:180px 180px 5px 5px;background:linear-gradient(#584b38,#34362f);box-shadow:inset 0 5px 0 #8b7654,0 -6px 9px #0004}
.roof-line{position:absolute;left:6%;right:6%;top:12px;height:3px;background:#927755;opacity:.65;border-radius:50%}
.room-interior{height:290px;border:10px solid #584533;border-top:8px solid #7b6242;border-radius:150px 150px 12px 12px/70px 70px 12px 12px;position:relative;overflow:hidden;background:
 radial-gradient(ellipse at 48% 95%,rgba(202,176,113,.13),transparent 66%),
 repeating-linear-gradient(90deg,rgba(0,0,0,.03) 0 12px,transparent 12px 37px),
 linear-gradient(#3e4742,#323a36 75%,#34342e);box-shadow:inset 0 0 40px #101817,0 0 0 3px #ae8b60,0 16px 15px #0005}
.room-interior:before{content:"";position:absolute;inset:3px;border:1px solid rgba(210,184,131,.18);border-radius:140px 140px 4px 4px/68px 68px 4px 4px;pointer-events:none}
.room-arch{position:absolute;inset:12px 15px 28px;border:1px solid rgba(205,191,140,.15);border-radius:110px 110px 4px 4px/65px 65px 4px 4px;pointer-events:none}
.room-window{position:absolute;left:11%;top:60px;width:72px;height:88px;border:6px solid #615740;border-radius:38px 38px 3px 3px;background:radial-gradient(ellipse,#61796c,#2b504e);box-shadow:inset 0 0 20px #14292b,0 0 0 2px #312e25;opacity:.65}
.room-window:before{content:"";position:absolute;left:47%;top:0;bottom:0;border-left:4px solid #594f3f}
.room-window:after{content:"";position:absolute;left:0;right:0;top:50%;border-top:4px solid #594f3f}
.room-window span{position:absolute;left:16px;top:14px;background:#c8d1b8;width:10px;height:35px;transform:rotate(24deg);opacity:.4;filter:blur(4px)}
.tiny-shelf{position:absolute;right:7%;top:95px;width:86px;height:5px;background:#9d7850;opacity:.7}
.tiny-shelf i{display:inline-block;position:relative;top:-24px;background:#759185;width:13px;height:24px;border-radius:7px 7px 2px 2px;border:2px solid #c5ad81;margin-left:6px}
.tiny-shelf i:nth-child(2){height:18px;background:#bbaa77}
.room-name{position:absolute;left:50%;transform:translateX(-50%);top:24px;white-space:nowrap;z-index:1;color:#d9c7a6;font-size:.62rem;letter-spacing:.22em;text-shadow:0 2px 3px #121b1d}
.room-index{color:#a58d6a;margin-left:6px}
.room-items{position:absolute;left:4%;right:4%;bottom:30px;height:180px;display:flex;justify-content:center;align-items:flex-end;z-index:4;overflow:visible}
/* Outside deliberate area operations, every object rests on ONE floor row.
   The whole track is scaled when necessary, never wrapped or stacked. */
.floor-shell{position:absolute;inset:0;display:flex;align-items:flex-end;justify-content:center;
  pointer-events:none}
.items-grid.floor-track{position:relative;width:max-content;max-width:none;flex:none;
  height:max-content;display:flex;flex-wrap:nowrap;align-items:flex-end;justify-content:center;
  gap:6px;padding:0;white-space:nowrap;
  transform:scale(var(--floor-scale,1));transform-origin:50% 100%;
  transition:opacity .3s ease}
.items-grid.floor-track>.token{flex:none;margin:0;transform:none}
.floor-count{position:absolute;bottom:68px;left:50%;transform:translateX(-50%);
  white-space:nowrap;font:italic .67rem Georgia,serif;letter-spacing:.02em;color:#decba1;
  text-shadow:0 2px 5px #000;pointer-events:none}
.area-active .room-items{opacity:.16;transition:opacity .2s ease}
/* Hide the old row while the grid is arranged, but REVEAL the result at the
   exact contact moment so children can see the creature shape change. */
.area-active.area-after-square .room-items,
.area-active.area-after-sqrt .room-items{opacity:1}
.room-empty{font:italic .8rem Georgia,serif;color:rgba(215,203,166,.45);padding-bottom:15px}
.room-floor{position:absolute;bottom:0;left:0;right:0;height:31px;background:
 repeating-linear-gradient(90deg,transparent 0 30px,#2d251e 31px 33px),
 linear-gradient(#9a7751,#4b3228);border-top:3px solid #b18b5e;box-shadow:0 -6px 10px #0003}
.room-action{position:absolute;left:50%;bottom:4px;transform:translateX(-50%);z-index:8;white-space:nowrap;border:1px solid #a3a48f;border-radius:20px;padding:6px 16px;background:#283b38;color:#f4edd9;font-size:.7rem;font-weight:700;box-shadow:0 5px 9px #0009}
.room-action:hover:not(:disabled){background:#3b554e}
.needs-match .room-interior{outline:3px solid #e8c17f;box-shadow:inset 0 0 40px #101817,0 0 0 3px #ae8b60,0 0 30px #c4a26477}
.already-moved .room-interior{opacity:.82}
.scale-pan{width:104%;height:29px;position:relative;left:-2%;margin-top:-1px;border-radius:0 0 50% 50% / 0 0 90% 90%;background:linear-gradient(#a17a4e,#4e3726 43%,#a17e4f 75%,#3e2d20);border:3px solid #ad8958;border-top:6px solid #b89560;box-shadow:0 12px 13px #0005}
.scale-beam{position:absolute;z-index:3;left:15%;right:15%;top:449px;height:34px;transition:transform .45s ease;transform-origin:center}
.beam-body{position:absolute;top:9px;width:100%;height:22px;background:linear-gradient(#a98854,#533d2a 43%,#7f5b39 78%,#302720);border:2px solid #bd9864;border-radius:15px;box-shadow:0 8px 10px #000a}
.pivot-dial{width:105px;height:105px;position:absolute;left:50%;top:-38px;transform:translateX(-50%);border:8px solid #815e39;border-radius:50%;background:radial-gradient(circle at 30% 25%,#dbc591,#aa8a52 45%,#51432c);box-shadow:0 0 0 3px #cfad6e,0 7px 11px #0009;display:flex;align-items:center;justify-content:center;color:#483629}
.pivot-dial span{font-size:1.65rem;opacity:.3}
.dial-needle{position:absolute;z-index:2;left:50%;top:16px;width:4px;height:56px;background:#34291e;border-radius:4px;transform-origin:center 35px;transition:transform .45s ease}
.dial-needle:after{content:"";position:absolute;left:-5px;bottom:-4px;width:14px;height:14px;background:#e8ca88;border:2px solid #443726;border-radius:50%}
.scale-base{position:absolute;z-index:2;left:50%;top:482px;transform:translateX(-50%);width:175px;height:67px;background:linear-gradient(120deg,#7b5433,#ab8151 30%,#453126 75%);clip-path:polygon(37% 0,63% 0,90% 95%,100% 95%,100% 100%,0 100%,0 95%,10% 95%);filter:drop-shadow(0 6px 4px #0008)}
.workbench{position:absolute;bottom:0;left:0;right:0;height:46px;z-index:1;background:repeating-linear-gradient(90deg,transparent 0 165px,#2b1e1a 166px 169px),linear-gradient(#7f5b3c,#32231f 80%);border-top:9px solid #a68456;box-shadow:0 -7px 28px #0009}
.scene-caption{position:absolute;z-index:8;bottom:15px;left:29px;font:italic .81rem Georgia,serif;letter-spacing:.035em;color:#e9d8b5;text-shadow:0 2px 3px #1b1715}
.scene-caption.unbalanced{color:#ffdca8}

/* PR11: the hand builds an actual wooden/brass box ON THE FLOOR of each
   room. Nothing appears in a separate instructional inset. The incoming floor
   row becomes the top dimensional guide; the copied vertical guide and the
   interior objects are then physically built, region by region. */
.room-square-box[hidden]{display:none!important}
.room-square-box{position:absolute;z-index:7;left:3%;right:3%;bottom:32px;
  height:225px;display:flex;align-items:flex-end;justify-content:center;
  pointer-events:none;filter:drop-shadow(3px 6px 5px #0009)}
.room-square-box .box-workshop{position:relative;
  width:min(91%,222px);height:auto;aspect-ratio:1;min-width:0;
  max-height:222px;transform-origin:bottom center;
  animation:box-unfold .35s cubic-bezier(.2,.8,.3,1) both}
.box-workshop:before{content:"";position:absolute;inset:23px 0 0 23px;
  border:4px ridge #a9875a;border-radius:3px;
  background:linear-gradient(150deg,#303a3370,#26352b88);
  box-shadow:inset 0 0 15px #101714a5,0 0 0 2px #37271c}
.box-workshop:after{content:"";position:absolute;inset:26px 3px 3px 26px;
  border:1px dotted #deca9875;pointer-events:none}
.box-edge{position:absolute;z-index:2;display:grid;min-width:0;min-height:0;
  gap:1px;opacity:0;transform:translateY(32px);transition:opacity .25s,transform .38s}
.box-edge.built{opacity:.83;transform:translate(0,0)}
.box-edge-top{left:25px;right:4px;top:2px;height:20px}
.box-edge-left{top:25px;bottom:4px;left:2px;width:20px;transform:translateX(45px)}
.box-edge-left.built{transform:translateX(0)}
.box-edge-left.retired{opacity:0;transform:translateX(-35px)}
.box-edge-top.kept{opacity:1;filter:drop-shadow(0 0 5px #f6c774);
  transform:translateY(0) scale(1.045)}
.box-edge-token{position:relative;align-self:stretch;justify-self:stretch;min-width:0;min-height:0;
  display:grid;place-items:center;border:1px dashed #cbb9898c;
  border-radius:3px;background:#1d24218c}
.box-edge-token:after{content:"";width:min(56%,12px);height:min(75%,12px);
  background:radial-gradient(circle at 27% 22%,#65736a,#1c2623 78%);
  border:1px solid #baa477;border-radius:50%;box-shadow:0 1px 3px #0007}
.box-edge-token.edge-weight:after{border-radius:3px 3px 5px 5px;
  background:linear-gradient(90deg,#7c5937,#edcf96,#805f3b)}
.box-edge-left .box-edge-token{width:100%;height:100%}
.box-grid{position:absolute;z-index:1;left:25px;right:4px;top:25px;bottom:4px;
  display:grid;gap:1px;
  background:repeating-linear-gradient(90deg,#8b775329 0 12px,transparent 13px 24px);
  border:1px solid #af95694d}
.box-cell{min-width:0;min-height:0;position:relative;display:grid;place-items:center;
  border:1px solid #e2d0a03b;border-radius:2px;opacity:0;
  background:#c5aa7745;transform:translateY(35px) scale(.7)}
.box-cell.placed{opacity:1;transform:translate(0,0);
  animation:box-token-place .53s cubic-bezier(.19,.88,.29,1.24) both}
.box-cell.removed{animation:box-token-remove .45s ease-in both}
.box-cell.region-quadratic{background:#6d8d7645}
.box-cell.region-mixed-top,.box-cell.region-mixed-bottom{background:#4c695b55}
.box-cell.region-units{background:#ab895942}
.box-cell.placed .box-actor{animation:box-actor-idle 1.7s ease-in-out infinite alternate}
.box-cell .box-actor{position:relative;display:block;
  width:min(75%,27px);height:min(75%,27px);min-width:3px;min-height:3px}
.box-actor:before,.box-actor:after{content:"";position:absolute;z-index:2;
  top:29%;width:15%;height:24%;border-radius:50%;background:#f5eed9}
.box-actor:before{left:29%}.box-actor:after{left:56%}
.box-actor.box-actor-x2{border:1px solid #dfc790;border-radius:4px;
  background:radial-gradient(circle at 25% 24%,#5e7c71,#192e29 78%);
  box-shadow:inset -1px -2px 3px #08110f80,0 2px 2px #0009}
.box-actor.box-actor-x{border:1px solid #6e8174;border-radius:48%;
  background:radial-gradient(circle at 27% 25%,#5a6a60,#141f1c 82%);
  box-shadow:inset -1px -2px 4px #07100d9c,0 2px 2px #0009}
.box-actor.box-actor-weight{width:min(67%,24px);height:min(71%,27px);
  border-radius:4px 4px 6px 6px;clip-path:polygon(34% 0,67% 0,87% 26%,100% 100%,0 100%,12% 26%);
  background:linear-gradient(105deg,#7d5937,#e6c895 54%,#825f3a);border:1px solid #8d673d}
.box-actor.box-actor-weight:before,.box-actor.box-actor-weight:after{display:none}
.box-cell.region-mixed-top:before,.box-cell.region-mixed-bottom:before{content:"";position:absolute;
  inset:3px;border:1px solid #a1c7b45c;pointer-events:none}
.box-cell.region-mixed-top .box-actor-x{transform:rotate(12deg)}
.box-cell.region-mixed-bottom .box-actor-x{transform:rotate(-12deg)}
.room-square-box[data-operation="sqrt"] .box-cell.placed .box-actor{
  animation:box-actor-idle 2.2s ease-in-out infinite alternate}
.room-square-box[data-step="result"] .box-workshop{animation:box-return-to-floor .54s ease-out both}
.room-square-box[data-operation="sqrt"][data-step="edge"] .box-edge-top{
  border-top:2px solid #e9ca87}
.room-square-box .box-footnote{position:absolute;z-index:3;left:50%;bottom:-12px;
  transform:translateX(-50%);width:max-content;max-width:110%;padding:2px 5px;
  background:#29352de8;border:1px solid #947958;border-radius:5px;color:#e8d5b3;
  font:italic clamp(.42rem,.66vw,.61rem) Georgia,serif;text-align:center;white-space:normal}
.area-active .room-items{opacity:.04;transition:opacity .25s ease}
.area-active.area-after-square .room-items,
.area-active.area-after-sqrt .room-items{opacity:1;transition:opacity .2s ease}
@keyframes box-unfold{from{opacity:0;transform:translateY(15px) scale(.88)}
  to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes box-token-place{0%{opacity:0;transform:translateY(45px) scale(.52)}
  55%{opacity:1;transform:translateY(-4px) scale(1.08)}
  100%{opacity:1;transform:translateY(0) scale(1)}}
@keyframes box-token-remove{from{opacity:1;transform:scale(1)}
  to{opacity:0;transform:scale(.46) translateY(28px)}}
@keyframes box-actor-idle{0%{filter:brightness(.94);translate:0 1px}
  100%{filter:brightness(1.08);translate:0 -1px}}
@keyframes box-return-to-floor{from{opacity:1;transform:translateY(0) scale(1)}
  to{opacity:0;transform:translateY(35px) scale(.75)}}
/* Visual QA: an almost 190px hand hid most of the 5x5 construction,
   especially on phones. This smaller working pose still reaches the floor,
   and an end-of-build presentation motion clears the completed box. */
.giant-hand[data-box-operation]{width:136px;height:190px}
.giant-hand[data-box-operation] .hand-cargo{
  transform:translate(-50%,-8px) scale(.82);transform-origin:center}
.giant-hand[data-box-operation="square"][data-box-step="units"] .hand-art,
.giant-hand[data-box-operation="sqrt"][data-box-step="edge"] .hand-art{
  transform:translate(104px,-38px) rotate(9deg)}
@media(max-width:600px){
  .giant-hand[data-box-operation]{width:75px;height:111px}
  .giant-hand[data-box-operation] .hand-cargo{
    transform:translate(-50%,-8px) scale(.58)}
  .giant-hand[data-box-operation="square"][data-box-step="units"] .hand-art,
  .giant-hand[data-box-operation="sqrt"][data-box-step="edge"] .hand-art{
    transform:translate(52px,-22px) rotate(7deg)}
}
/* The illustrated hand traces the physical box's actual quadrants. It pauses
   to pound x×x into a square sprite or squish an x² square into its side. */
.giant-hand[data-box-step="frame"] .hand-art{transform:translate(-2px,-12px) rotate(-4deg)}
.giant-hand[data-box-step="edge"] .hand-art{transform:translate(-21px,8px) rotate(-9deg)}
.giant-hand[data-box-step="column"] .hand-art{transform:translate(-37px,-22px) rotate(5deg)}
.giant-hand[data-box-step="quadratic"] .hand-art{transform:translate(-30px,-23px) rotate(-5deg)}
.giant-hand[data-box-step="mixed"] .hand-art{transform:translate(8px,-9px) rotate(5deg)}
.giant-hand[data-box-step="units"] .hand-art{transform:translate(20px,13px) rotate(-5deg)}
.giant-hand[data-phase="pound"] .hand-art{animation:hand-area-pound .46s cubic-bezier(.25,.6,.34,1) both}
.giant-hand[data-phase="squish"] .hand-art{animation:hand-area-squish .48s ease-in-out both}
@keyframes hand-area-pound{
  0%{transform:translateY(-13px) rotate(-7deg)}
  44%{transform:translateY(17px) rotate(5deg) scaleY(.93)}
  69%{transform:translateY(-4px) rotate(-2deg)}
  100%{transform:translateY(0) rotate(0)}
}
@keyframes hand-area-squish{
  0%{transform:scaleX(1.04)}
  38%{transform:scaleX(.86) scaleY(1.07) rotate(-4deg)}
  65%{transform:scaleX(.93) rotate(3deg)}
  100%{transform:scale(1)}
}
/* The room actors reappear at contact and visibly MORPH. Their idle motion
   resumes naturally when the box is cleared on the hand's exit. */
.area-after-square .sprite-square .sprite-body{
  animation:square-form .53s cubic-bezier(.22,.85,.2,1.1) both!important}
.area-after-sqrt .sprite-black .sprite-body{
  animation:round-form .53s cubic-bezier(.22,.85,.2,1.1) both!important}
@keyframes square-form{
  0%{border-radius:50%;transform:scale(1.13,.75)}
  55%{border-radius:19%;transform:scale(.84,1.15)}
  100%{border-radius:10px;transform:scale(1)}
}
@keyframes round-form{
  0%{border-radius:9px;transform:scale(1.2,.72)}
  48%{border-radius:36%;transform:scale(.89,1.17)}
  100%{border-radius:50%;transform:scale(1)}
}
.held-square-press{position:absolute;left:11px;top:8px;width:42px;height:35px;
  background:linear-gradient(120deg,#e2c28c,#765332);border:3px solid #5c432d;border-radius:5px;
  box-shadow:inset 0 2px #f7e4bb,0 3px 4px #000a}
.held-square-press:after{content:"";position:absolute;top:-24px;left:13px;width:12px;height:25px;
  border-radius:4px;background:linear-gradient(90deg,#735138,#b99162,#69432e);border:1px solid #573e29}
.held-square-press:before{content:"✦";position:absolute;inset:6px 0 0;text-align:center;
  font:700 .76rem Georgia,serif;color:#4e3424}
.mini-token.posX2{border-radius:3px!important;box-shadow:inset 0 0 0 1.5px #c5a877!important}
@media(max-width:600px){
  .room-square-box{left:1%;right:1%;bottom:19px;height:152px}
  .room-square-box .box-workshop{width:min(98%,145px);max-height:145px}
  .box-edge-top{left:18px;right:2px;height:15px;top:2px}
  .box-edge-left{top:18px;bottom:2px;width:15px;left:2px}
  .box-workshop:before{inset:17px 0 0 17px;border-width:3px}
  .box-workshop:after{inset:19px 2px 2px 19px}
  .box-grid{left:19px;right:2px;top:19px;bottom:2px;gap:0}
  .box-cell{border-width:1px}
  .box-cell .box-actor{width:min(78%,16px);height:min(78%,16px)}
  .box-cell .box-actor-weight{width:min(68%,15px);height:min(70%,16px)}
  .box-edge-token:after{width:min(70%,8px);height:min(70%,8px)}
  .room-square-box .box-footnote{bottom:-9px;font-size:.44rem;padding:1px 3px}
  .giant-hand[data-box-step="column"] .hand-art{transform:translate(-17px,-11px) rotate(4deg)}
  .giant-hand[data-box-step="edge"] .hand-art{transform:translate(-9px,4px) rotate(-5deg)}
  .giant-hand[data-box-step="quadratic"] .hand-art{transform:translate(-14px,-12px) rotate(-4deg)}
  .giant-hand[data-box-step="mixed"] .hand-art{transform:translate(7px,-5px)}
  .giant-hand[data-box-step="units"] .hand-art{transform:translate(11px,6px)}
}

/* PR13 — rejected division is performed ON THE ORIGINAL FLOOR ACTORS,
   not in a floating duplicate basket diagram. Each selected whole sprite
   is geometrically CLIPPED into exactly factor disjoint pieces. The pieces
   separate, wiggle, then rejoin the original when the hand rewinds. */
.fraction-original-hidden{opacity:0!important}
.attempt-fraction .attempt-stage.fraction-floor-stage{
  position:absolute;inset:0;left:0;right:0;top:0;bottom:0;
  width:100%;height:100%;max-height:none;display:block;
  background:transparent;filter:none;pointer-events:none;
  transform:none;animation:none}
.fraction-cut-source{
  position:absolute;z-index:14;display:block;isolation:isolate;
  pointer-events:none;overflow:visible;filter:drop-shadow(0 3px 3px #0007)}
.fraction-cut-mat{position:absolute;left:-9px;right:-9px;bottom:-9px;height:13px;
  background:linear-gradient(0deg,#463421,#906d43 48%,#b4915e);
  border:1px solid #c7a36e;border-radius:3px 4px 6px 4px;
  box-shadow:0 4px 6px #070c09ad;transform:perspective(120px) rotateX(38deg)}
.fraction-cut-piece{position:absolute;top:0;height:100%;display:block;
  overflow:hidden;pointer-events:none;z-index:2;
  transform:translate(0,0) rotate(0deg);transform-origin:center 88%;
  transition:transform .77s cubic-bezier(.2,1.28,.28,1),
    filter .38s ease}
.fraction-fragment-wiggle{position:absolute;inset:0;display:block}
.fraction-cut-art.token{position:absolute!important;display:block!important;z-index:2;
  top:0;left:0;margin:0!important;transform-origin:top left!important;
  animation:none!important;pointer-events:none!important}
/* The illustration is a real clipped copy of ONE original token: half a
   sprite shows half the body, its tuft, and part of its eyes, not an invented
   new mini-sprite with a full pair of eyes for each slice. */
.fraction-cut-art .sprite-motion,.fraction-cut-art .sprite-body,
.fraction-cut-art .sprite-ground-shadow,.fraction-cut-art .sprite-eyes,
.fraction-cut-art .sprite-eyes i,.fraction-cut-art .sprite-feet,
.fraction-cut-art .sprite-reaction-shell,
.fraction-cut-art .balloon-body,.fraction-cut-art .balloon-string{
  animation:none!important}
.fraction-cut-seam{position:absolute;z-index:5;top:-7px;bottom:-7px;
  border-left:2px dashed #f3d29d;opacity:0;transform-origin:top center;
  filter:drop-shadow(0 0 3px #d2ad74);pointer-events:none}
.fraction-cut-swoosh{position:absolute;z-index:6;left:48%;top:-55px;
  width:7px;height:68px;opacity:0;pointer-events:none;
  border-radius:3px;background:linear-gradient(90deg,#6a6156,#f6ecd3 47%,#967e58);
  border:1px solid #e2c798;box-shadow:0 2px 8px #c9b68e99}
.fraction-cut-swoosh:after{content:"";position:absolute;left:-8px;bottom:-3px;
  width:24px;height:8px;border-radius:50%;
  background:radial-gradient(ellipse,#ebd4a6a3,transparent 70%)}
.attempt-stage[data-cut-phase="cutting"] .fraction-cut-seam{
  animation:fraction-mark-line .48s ease-in var(--seam-delay,0ms) both}
.attempt-stage[data-cut-phase="cutting"] .fraction-cut-swoosh{
  animation:fraction-blade-chop .43s cubic-bezier(.28,.72,.3,1) 2 both}
.attempt-stage[data-cut-phase="chopped"] .fraction-cut-piece{
  transform:translate(var(--split-x,0px),var(--split-y,0px))
    rotate(var(--split-rotation,0deg));
  filter:drop-shadow(1px 3px 2px #080d0cac)}
.attempt-stage[data-cut-phase="chopped"] .fraction-cut-seam{opacity:.48}
.attempt-stage[data-cut-phase="chopped"] .fraction-fragment-wiggle{
  animation:fraction-fragment-wiggle .63s ease-in-out infinite alternate}
.attempt-stage[data-cut-phase="rejoining"] .fraction-cut-piece{
  transform:translate(0,0) rotate(0deg)}
.attempt-stage[data-cut-phase="rejoining"] .fraction-cut-seam,
.attempt-stage[data-cut-phase="chopped"] .fraction-cut-swoosh,
.attempt-stage[data-cut-phase="rejoining"] .fraction-cut-swoosh{opacity:0}
@keyframes fraction-mark-line{
  0%{opacity:0;transform:scaleY(0)}
  32%{opacity:1;transform:scaleY(.45)}
  100%{opacity:.84;transform:scaleY(1)}
}
@keyframes fraction-blade-chop{
  0%{opacity:0;transform:translateY(-32px) rotate(-12deg)}
  25%{opacity:1;transform:translateY(-11px) rotate(-2deg)}
  48%{opacity:1;transform:translateY(37px) rotate(9deg)}
  68%{opacity:1;transform:translateY(31px) rotate(4deg)}
  100%{opacity:0;transform:translateY(-25px) rotate(-9deg)}
}
@keyframes fraction-fragment-wiggle{
  from{translate:0 1px;filter:brightness(.9)}
  to{translate:0 -3px;filter:brightness(1.19)}
}
/* The visible tool is a small blunt laboratory cutter: no injury or gore.
   The hand does TWO deliberate downward chops before inspecting the scraps. */
.held-fraction-cutter{position:absolute;left:17px;top:5px;width:30px;height:55px;
  transform:rotate(-14deg);transform-origin:50% 15%;filter:drop-shadow(2px 4px 3px #0009)}
.held-fraction-cutter:before{content:"";position:absolute;left:11px;top:0;
  height:37px;width:9px;border-radius:4px 4px 2px 2px;
  background:linear-gradient(90deg,#71543b,#d8b481,#694c37);
  border:1px solid #5c412c;box-shadow:inset 1px 0 #f6deb4}
.held-fraction-cutter:after{content:"";position:absolute;left:-6px;top:32px;
  width:43px;height:22px;border-radius:3px 4px 10px 10px;
  background:linear-gradient(105deg,#5c594b,#f7ecd1 55%,#82755e);
  border:2px solid #6d5c42;clip-path:polygon(7% 0,93% 0,100% 86%,0 86%)}
.held-fraction-cutter i{position:absolute;left:1px;top:41px;width:29px;height:4px;
  background:#ffe4b3;box-shadow:0 0 5px #e9d3a4;z-index:2}
.giant-hand[data-fraction-attempt="true"]{width:135px;height:195px}
.giant-hand[data-phase="chop"] .hand-art{
  animation:fraction-hand-chop .46s cubic-bezier(.28,.75,.32,1) 2 both}
.giant-hand.fraction-observing .hand-art{
  transform:translate(76px,-45px) rotate(9deg)!important;
  transition:transform .25s ease-out}
@keyframes fraction-hand-chop{
  0%{transform:translateY(-17px) rotate(-8deg)}
  48%{transform:translateY(19px) rotate(4deg) scaleY(.96)}
  78%{transform:translateY(-4px) rotate(-3deg)}
  100%{transform:translateY(-13px) rotate(-6deg)}
}
.reduce-motion .fraction-floor-stage *,
.reduce-motion .giant-hand[data-phase="chop"] .hand-art{
  animation:none!important;transition:none!important}
@media(max-width:600px){
  .giant-hand[data-fraction-attempt="true"]{width:82px;height:124px}
  .giant-hand.fraction-observing .hand-art{
    transform:translate(43px,-25px) rotate(5deg)!important}
  .fraction-cut-mat{left:-5px;right:-5px;height:8px;bottom:-5px}
  .fraction-cut-swoosh{height:46px;top:-32px}
}

/* PR10: unsuccessful actions are VISUAL EXPERIMENTS, never algebra commits.
   Fractional cuts now happen directly to floor actors; crowded rooms spill props;
   different one-sided actions tip the actual beam before the hand undoes them. */
.attempt-stage[hidden]{display:none!important}
.attempt-stage{position:absolute;z-index:10;left:1%;right:1%;bottom:34px;height:150px;
  display:flex;flex-direction:column;align-items:center;justify-content:flex-end;
  gap:7px;pointer-events:none;filter:drop-shadow(0 5px 9px #0009);
  animation:attempt-reveal .36s ease-out both}
.attempt-stage .attempt-caption{background:#273633eb;border:1px solid #dec091;
  color:#f6e0b9;padding:5px 9px;border-radius:9px;text-align:center;
  font:700 .69rem/1.3 Georgia,serif;max-width:100%}
.attempt-stage .attempt-hint{color:#ecd6b3;font:italic .67rem Georgia,serif;
  text-shadow:0 2px 5px #000;text-align:center}
.attempt-stage.rewinding{animation:attempt-reverse .7s ease-in both}
@keyframes attempt-reveal{from{opacity:0;transform:translateY(-12px) scale(.93)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes attempt-reverse{from{opacity:1;transform:scale(1)}to{opacity:0;transform:translateY(-12px) scale(.82)}}
.attempt-overflow .room-interior{overflow:visible}
.attempt-overflow .attempt-stage{left:-16%;right:-17%;height:156px}
.overflow-trail{width:100%;height:98px;position:relative}
.overflow-piece{position:absolute;left:var(--start-x,43%);bottom:0;
  width:38px;height:38px;border:2px solid #c3a576;border-radius:50%;
  background:radial-gradient(circle at 26% 25%,#667c73,#172320 80%);
  box-shadow:inset -3px -4px 4px #0007,0 3px 5px #0009;
  animation:object-spill 1.15s cubic-bezier(.22,.75,.35,1) var(--spill-delay,0ms) both}
.overflow-piece.weight-spill{border-radius:6px 6px 10px 10px;
  background:linear-gradient(95deg,#835a32,#e1bb83,#725131)}
.overflow-piece.weight-spill:before{content:"";position:absolute;left:10px;top:-6px;
  width:13px;height:8px;border:3px solid #d4ad76;border-radius:6px}
.overflow-piece.sprite-spill:before{content:"";position:absolute;left:10px;top:10px;
  background:#f3edd8;width:6px;height:9px;border-radius:50%;box-shadow:11px 0 #f3edd8}
/* Weights tumble over and rotate; sprites LEAP out, land and bounce again. */
.overflow-piece.sprite-spill{animation-name:sprite-escape}
@keyframes sprite-escape{
  0%{opacity:0;transform:translate(0,0) scale(.64)}
  15%{opacity:1;transform:translate(0,5px) scale(1.18,.76)}
  36%{opacity:1;transform:translate(calc(var(--spill-x,30px) * .48),-78px) scale(.9,1.12)}
  58%{opacity:1;transform:translate(calc(var(--spill-x,30px) * .77),0) scale(1.2,.83)}
  73%{opacity:1;transform:translate(var(--spill-x,30px),-34px) rotate(-12deg)}
  100%{opacity:1;transform:translate(var(--spill-x,30px),14px) rotate(4deg)}
}
.overflow-piece.square-spill{border-radius:7px}
@keyframes object-spill{
  0%{opacity:0;transform:translate(0,-8px) rotate(0) scale(.7)}
  15%{opacity:1;transform:translate(0,0) rotate(0) scale(1)}
  42%{opacity:1;transform:translate(calc(var(--spill-x,30px) * .52),-55px) rotate(55deg)}
  75%{opacity:1;transform:translate(var(--spill-x,30px),0) rotate(130deg)}
  100%{opacity:1;transform:translate(var(--spill-x,30px),14px) rotate(160deg)}
}
.attempt-missing .attempt-stage,.attempt-unsupported-area .attempt-stage{height:122px}
.ghost-object{width:47px;height:45px;border:3px dashed #f4d69e;
  border-radius:47%;opacity:.76;
  animation:missing-reach 1.15s ease-in-out infinite alternate}
.ghost-object.weight-ghost{border-radius:6px}
@keyframes missing-reach{from{transform:scale(1) translateY(0);opacity:.75}
  to{transform:scale(.75) translateY(-7px);opacity:.25}}
/* A deliberate manual mismatch produces a DRAMATIC but honest balance tip.
   If two different actions are algebraically equivalent, it must not tilt. */
.scene-failed-balance .rooms-row,
.scene-failed-balance .scale-beam{transition-duration:.85s!important;
  transition-timing-function:cubic-bezier(.2,1.34,.3,1)!important}
.scene-failed-balance .dial-needle{transition-duration:.85s!important}
.scene-failed-balance .scene-caption{color:#f5b49c}
.scene-failed-balance .room-interior{box-shadow:inset 0 0 25px #101817,
  0 0 0 3px #ca987e,0 0 21px #b9605380}
.scene-rewinding .floor-shell{animation:restore-objects .75s ease-out both}
@keyframes restore-objects{
  0%{opacity:.35;filter:blur(2px);transform:translateY(-12px)}
  100%{opacity:1;filter:none;transform:translateY(0)}
}
.reduce-motion .attempt-stage,.reduce-motion .attempt-stage *,
.reduce-motion .scene-rewinding .floor-shell{animation:none!important;
  transition:none!important}
@media(max-width:600px){
  .attempt-stage{bottom:20px;height:98px;gap:2px}
  .attempt-stage .attempt-caption{font-size:.49rem;padding:2px 3px}
  .attempt-stage .attempt-hint{font-size:.48rem}
  .attempt-overflow .attempt-stage{height:102px}
  .overflow-trail{height:58px}
  .overflow-piece{width:21px;height:21px}
}

/* PR12: living mathematical opposites. Cancellation is never a generic
   fade; it is a physical, counted event recorded by the engine. */
.signed-kind[hidden]{display:none!important}
.tiny-white-sprite{background:#e8ede7!important;color:#293638!important;
  border:2px solid #a2b4b0!important;box-shadow:0 0 0 1px #f7f3e9}
.tiny-balloon{display:inline-grid;place-items:center;width:19px;height:24px;
  background:radial-gradient(circle at 28% 18%,#f5e5d9,#cf9f94 70%,#a9756e);
  color:#663f42;border:1px solid #eac8bc;border-radius:50% 50% 47% 47%;
  font:700 .77rem Georgia,serif}
.item-button.signed-kind{border-color:#a6b8b2}
.quantity-locked{filter:saturate(.64)}
.quantity-mode-positive .sprite-white,.quantity-mode-positive .balloon{
  /* Never hide initial objects by CSS; model permission prevents their creation. */
}
/* The hand has deposited its object. It moves its palm out of the way
   so students can actually SEE the opposites collide or rise together. */
.giant-hand.observing-neutral .hand-art{
  transform:translate(84px,-56px) rotate(8deg)!important;
  transition:transform .26s cubic-bezier(.2,.7,.3,1)}
@media(max-width:600px){
  .giant-hand.observing-neutral .hand-art{
    transform:translate(48px,-35px) rotate(6deg)!important}
}
.neutral-effect[hidden]{display:none!important}
.neutral-effect{position:absolute;z-index:12;pointer-events:none;
  width:82px;height:84px;margin:-42px 0 0 -41px;opacity:1}
.neutral-effect .neutral-caption{position:absolute;top:62px;left:50%;transform:translateX(-50%);
  width:max-content;max-width:180px;text-align:center;padding:4px 8px;
  border-radius:8px;border:1px solid #ceb78b;background:#27322cf2;color:#fff0cd;
  font:700 .69rem Georgia,serif;white-space:nowrap}
.neutral-effect .puff-core{position:absolute;left:18px;top:17px;width:46px;height:39px;
  border-radius:50%;background:radial-gradient(circle,#e6dcc8a8,#514f4694 45%,transparent 71%);
  animation:neutral-puff 1.16s ease-out both}
.neutral-effect .soot{position:absolute;left:50%;top:40%;
  width:9px;height:9px;border-radius:50%;
  background:var(--soot-colour,#cbc9bf);box-shadow:0 0 5px #cfc7b1b0;
  animation:soot-scatter 1.16s cubic-bezier(.14,.65,.35,1) both;
  --soot-x:0px;--soot-y:-28px}
.neutral-effect .soot:nth-child(2){--soot-x:-30px;--soot-y:-44px;animation-delay:60ms}
.neutral-effect .soot:nth-child(3){--soot-x:31px;--soot-y:-41px;animation-delay:110ms}
.neutral-effect .soot:nth-child(4){--soot-x:-21px;--soot-y:-9px;animation-delay:90ms}
.neutral-effect .soot:nth-child(5){--soot-x:25px;--soot-y:-12px;animation-delay:130ms}
.neutral-effect .soot:nth-child(6){--soot-x:2px;--soot-y:-50px;animation-delay:180ms}
.neutral-effect .balloon-trail{position:absolute;left:39px;bottom:11px;
  width:4px;height:72px;border-left:3px dashed #e9c5ac;
  animation:balloon-trail-rise 1.18s ease-out both}
.neutral-effect .balloon-trail:before{content:"✦";position:absolute;left:-19px;top:4px;
  font-size:34px;color:#ffdfaa;text-shadow:0 0 9px #e1b08c}
.token.zero-pair-actor{z-index:18!important;transform-origin:50% 95%;will-change:transform,opacity}
.token.zero-pair-actor.zero-sprite-positive,
.token.zero-pair-actor.zero-sprite-negative{
  animation:zero-sprite-collision 1.18s cubic-bezier(.22,.68,.21,1) both!important}
.token.zero-pair-actor.zero-weight-positive,
.token.zero-pair-actor.zero-balloon-negative{
  animation:zero-balloon-carry 1.18s cubic-bezier(.22,.7,.3,1) both!important}
.token.zero-pair-actor .sprite-motion,
.token.zero-pair-actor .sprite-body,
.token.zero-pair-actor .sprite-ground-shadow,
.token.zero-pair-actor .sprite-eyes,
.token.zero-pair-actor .sprite-eyes i{animation-play-state:paused!important}
@keyframes zero-sprite-collision{
  0%{opacity:1;transform:translateX(0) translateY(0) scale(1)}
  24%{opacity:1;transform:translateX(calc(var(--pair-dx,0px)*.40)) translateY(-27px) scale(1.12,.9)}
  48%{opacity:1;transform:translateX(var(--pair-dx,0px)) translateY(-14px) scale(1.16,.68)}
  65%{opacity:1;transform:translateX(var(--pair-dx,0px)) translateY(-16px) scale(.68,1.18)}
  100%{opacity:0;transform:translateX(var(--pair-dx,0px)) translateY(-18px) scale(.05)}
}
@keyframes zero-balloon-carry{
  0%{opacity:1;transform:translateX(0) translateY(0) rotate(0)}
  25%{opacity:1;transform:translateX(calc(var(--pair-dx,0px)*.35)) translateY(-12px) rotate(-4deg)}
  48%{opacity:1;transform:translateX(var(--pair-dx,0px)) translateY(-28px) rotate(5deg)}
  74%{opacity:1;transform:translateX(var(--pair-dx,0px)) translateY(-75px) rotate(-5deg) scale(.92)}
  100%{opacity:0;transform:translateX(var(--pair-dx,0px)) translateY(-122px) scale(.76)}
}
@keyframes neutral-puff{0%,33%{opacity:0;transform:scale(.2)}
  48%{opacity:1;transform:scale(.72)}
  72%{opacity:.8;transform:scale(1.4)}
  100%{opacity:0;transform:scale(2.2)}}
@keyframes soot-scatter{0%,38%{opacity:0;transform:translate(0,0) scale(.3)}
  52%{opacity:1;transform:translate(0,0) scale(1.6)}
  100%{opacity:0;transform:translate(var(--soot-x),var(--soot-y)) scale(.2)}}
@keyframes balloon-trail-rise{0%{opacity:0;transform:translateY(14px) scaleY(.35)}
  35%{opacity:.8;transform:translateY(0) scaleY(.9)}
  100%{opacity:0;transform:translateY(-62px) scaleY(1.15)}}
.held-balloon{position:absolute;left:16px;top:3px;width:34px;height:53px}
.held-balloon:before{content:"";position:absolute;left:3px;top:0;width:28px;height:35px;
  border-radius:50% 50% 45% 45%;background:radial-gradient(circle at 25% 22%,#f6e5df,#d49c93 74%,#ab7772);
  border:2px solid #e8caba;box-shadow:0 2px 8px #0008}
.held-balloon:after{content:"";position:absolute;left:16px;top:35px;height:19px;
  border-left:1px solid #efcfb0;transform:rotate(-8deg)}
.sprite-white .sprite-body:before{clip-path:polygon(49% 0%,61% 17%,76% 3%,82% 24%,98% 22%,90% 43%,100% 62%,86% 74%,85% 96%,64% 90%,51% 100%,35% 89%,16% 98%,17% 76%,0 66%,9% 45%,1% 22%,22% 23%,28% 3%,41% 18%);
  filter:drop-shadow(0 0 2px #e6eeed)}
.signed-notebook-note{font:italic .65rem/1.4 Georgia,serif;color:#e9d3ab;padding:6px;
  border-radius:6px;background:#293734;border:1px solid #7c806e}
.mini-neutral-pair{position:absolute;z-index:6;left:50%;top:48%;
  transform:translate(-50%,-50%);display:flex;align-items:center;
  justify-content:center;gap:5px;margin:0;padding:6px 8px;border-radius:7px;
  background:#273832ed;box-shadow:0 3px 11px #0008;
  border:1px solid #d0b98a;font:italic .63rem Georgia,serif;color:#ead7b8;
  white-space:nowrap;animation:mini-neutral-cue 950ms ease-in-out var(--neutral-delay,0ms) both}
.mini-neutral-pair[data-side="left"]{left:30%}
.mini-neutral-pair[data-side="right"]{left:70%}
.mini-neutral-pair .mini-token{transform:scale(1.18);animation:mini-opposites 950ms ease-in-out var(--neutral-delay,0ms) both}
@keyframes mini-neutral-cue{
  0%{opacity:0;translate:0 12px}
  17%,75%{opacity:1;translate:0 0}
  100%{opacity:0;translate:0 -12px}
}
@keyframes mini-opposites{0%{opacity:1;transform:translateX(0) scale(1)}
  55%{opacity:1;transform:translateX(6px) scale(1.18)}
  100%{opacity:0;transform:translateX(0) scale(.3)}}
.reduce-motion .neutral-effect .puff-core,
.reduce-motion .neutral-effect .soot,
.reduce-motion .neutral-effect .balloon-trail,
.reduce-motion .token.zero-pair-actor,
.reduce-motion .mini-neutral-pair .mini-token{animation:none!important;transition:none!important}
.reduce-motion .neutral-effect .neutral-caption{font-size:.76rem}
@media(max-width:700px){
 .header-actions{gap:8px}
 .labelled-select select{min-width:145px;max-width:43vw;font-size:.74rem}
 .neutral-effect .neutral-caption{font-size:.55rem}
}

/* Actors and props */
.token{position:relative;flex:none;display:inline-block;vertical-align:bottom}
/* A sprite has separate LAYERS. The outer token keeps the layout position and
   responsive scaling; a child hops; the body wobbles; eyes glance and blink;
   its floor shadow stays on the floor. None of this changes its algebraic mass. */
.sprite{width:46px;height:47px;transform-origin:center bottom;
  filter:drop-shadow(0 2px 2px rgba(0,0,0,.38))}
/* PR7: a separate reaction shell lets a selected sprite duck or dodge
   while the normal hop, wiggle and blink layers are paused by the hand.
   The token's slot, counts and mathematical weight never move. */
.sprite-reaction-shell{position:absolute;inset:0;display:block;z-index:2;transform-origin:50% 92%}
.sprite-reacting[data-react-phase="start"][data-reaction="duck"] .sprite-reaction-shell{
  animation:sprite-duck .98s cubic-bezier(.24,.75,.35,1) both}
.sprite-reacting[data-react-phase="start"][data-reaction="dodge"] .sprite-reaction-shell{
  animation:sprite-dodge .98s cubic-bezier(.22,.65,.24,1) both}
.sprite-reacting[data-react-phase="caught"] .sprite-reaction-shell{
  animation:sprite-caught .29s ease-out both}
.sprite-reacting:after{content:"!";position:absolute;z-index:8;top:-25px;left:50%;color:#f7dfaf;
  font:italic bold 1.2rem Georgia,serif;text-shadow:0 2px 3px #0009;pointer-events:none;
  animation:sprite-surprise .5s ease-out both}
.sprite-reacting[data-reaction="dodge"]:after{content:"↝";font-size:1.45rem;top:-29px}
@keyframes sprite-duck{
  0%,8%{transform:translateY(0) scale(1)}
  22%{transform:translateY(4px) scale(1.14,.73)}
  40%,58%{transform:translateY(10px) scale(1.21,.48)}
  76%{transform:translateY(6px) scale(1.08,.69)}
  100%{transform:translateY(3px) scale(1.06,.8)}
}
@keyframes sprite-dodge{
  0%,10%{transform:translateX(0) rotate(0deg) scale(1)}
  25%{transform:translateX(var(--dodge-shift,20px)) rotate(-10deg) scale(.91,1.07)}
  40%,56%{transform:translateX(var(--dodge-shift,20px)) rotate(8deg) scale(.96,1.05)}
  73%{transform:translateX(4px) rotate(-5deg) scale(1.05,.95)}
  100%{transform:translateX(0) rotate(0deg) scale(1)}
}
@keyframes sprite-caught{
  0%{transform:translateY(0) scale(1)}
  45%{transform:translateY(6px) scale(1.1,.65)}
  100%{transform:translateY(4px) scale(.85,.72)}
}
@keyframes sprite-surprise{
  from{opacity:0;transform:translateY(10px) scale(.4)}
  40%{opacity:1;transform:translateY(-4px) scale(1.1)}
  to{opacity:.9;transform:translateY(0) scale(1)}
}
.sprite-motion{position:absolute;inset:0;z-index:2;display:block;transform-origin:center bottom;
  animation:sprite-hop var(--hop-period,1600ms) cubic-bezier(.36,.08,.3,1) infinite;
  animation-delay:var(--hop-delay,0ms);will-change:transform}
.sprite-ground-shadow{position:absolute;z-index:0;bottom:0;left:50%;width:34px;height:7px;
  background:rgba(6,13,12,.68);border-radius:50%;filter:blur(2px);
  transform:translateX(-50%);animation:sprite-shadow var(--hop-period,1600ms) ease-in-out infinite;
  animation-delay:var(--hop-delay,0ms)}
.sprite-ground-shadow:after{content:"";position:absolute;left:15px;top:-2px;width:3px;height:3px;
  border-radius:50%;background:#b7ad8c;box-shadow:-9px -2px #aaa589,10px -3px #d0bd94;
  animation:sprite-dust var(--hop-period,1600ms) ease-out infinite;
  animation-delay:var(--hop-delay,0ms)}
.sprite-body{position:absolute;left:2px;bottom:4px;width:43px;height:41px;
  border-radius:49% 51% 45% 45%;background:radial-gradient(circle at 32% 24%,#56615c,#121719 78%);
  box-shadow:inset -2px -4px 6px #0009,0 0 0 1px rgba(228,225,197,.48),0 0 11px rgba(172,191,176,.22);
  z-index:2;transform-origin:50% 85%;will-change:transform;
  animation:sprite-wiggle var(--wiggle-period,1100ms) ease-in-out infinite;
  animation-delay:var(--wiggle-delay,0ms)}
.sprite-body:before{content:"";position:absolute;inset:-5px;border-radius:48%;
  background:repeating-conic-gradient(from 5deg,#192022 0deg 17deg,transparent 19deg 27deg);
  z-index:-1;filter:blur(.3px)}
.sprite-body:after{content:"";position:absolute;left:-4px;top:19px;width:43px;height:13px;
  border-radius:50%;border-left:3px solid #161a1b;border-right:3px solid #161a1b;z-index:-1}
.sprite-feet{position:absolute;left:13px;bottom:2px;width:24px;height:10px;
  border-left:4px solid #0c1011;border-right:4px solid #0c1011;transform:rotate(8deg)}
.sprite-eyes{position:absolute;left:11px;top:10px;display:flex;gap:9px;z-index:4;
  animation:sprite-look var(--look-period,4000ms) ease-in-out infinite;
  animation-delay:var(--look-delay,0ms)}
.sprite-eyes i{position:relative;display:block;width:7px;height:11px;
  background:#fff6dd;border-radius:50%;box-shadow:0 0 4px #fff9;
  transform-origin:50% 50%;animation:sprite-blink var(--blink-period,6000ms) linear infinite;
  animation-delay:var(--blink-delay,0ms)}
.sprite-eyes i:after{content:"";position:absolute;left:3px;top:5px;width:2.5px;height:3px;
  border-radius:50%;background:#1c2726;opacity:.83}
.sprite-white .sprite-body{background:radial-gradient(circle at 32% 24%,#f5f2e9,#c9d0d0 78%);
  box-shadow:0 0 2px #aab0a8}
.sprite-white .sprite-body:before{background:repeating-conic-gradient(#e7ece8 0deg 16deg,transparent 18deg 27deg)}
.sprite-white .sprite-eyes i{background:#2e3436;box-shadow:0 0 2px #59605c}
.sprite-white .sprite-eyes i:after{background:#f4f4e9}
/* The quadratic creature is genuinely a square, but keeps the same lively
   hop, independent wiggle, blinking eyes and floor shadow as its round cousin. */
.sprite-square .sprite-body{border-radius:10px;background:radial-gradient(circle at 24% 15%,#5b6961,#1a2a28 80%);
  box-shadow:inset -4px -4px 6px #050a09a8,0 0 0 2px #c8aa75,0 0 12px #cfb9873d}
.sprite-square .sprite-body:before{border-radius:9px;background:repeating-conic-gradient(from 12deg,#36443d 0deg 22deg,transparent 24deg 35deg)}
.sprite-square .sprite-body:after{border-radius:5px}
.square-symbol{position:absolute;bottom:3px;left:50%;transform:translateX(-50%);
  font:bold .68rem Georgia,serif;color:#edd3a3;text-shadow:0 2px 2px #000;white-space:nowrap;z-index:5}
.area-after-square .sprite-square .sprite-body{animation:square-form .45s cubic-bezier(.2,.9,.2,1) both!important}
.area-after-sqrt .sprite-black .sprite-body{animation:round-form .45s cubic-bezier(.2,.9,.2,1) both!important}
.area-after-square .sprite-square .sprite-body,
.area-after-sqrt .sprite-black .sprite-body{animation-play-state:running!important}
@keyframes square-form{0%{border-radius:50%;transform:scale(1.1,.7)}50%{border-radius:21%;transform:scale(.87,1.17)}100%{border-radius:10px;transform:scale(1)}}
@keyframes round-form{0%{border-radius:10px;transform:scale(1.2,.76)}55%{border-radius:38%;transform:scale(.88,1.12)}100%{border-radius:50%;transform:scale(1)}}
@keyframes sprite-hop{
  0%,5%,70%,94%,100%{transform:translateY(0) scale(1,1)}
  9%{transform:translateY(2px) scale(1.15,.8)}
  26%{transform:translateY(var(--hop-height,-39px)) scale(.96,1.08)}
  39%{transform:translateY(var(--hop-half,-21px)) scale(.99,1.03)}
  48%{transform:translateY(0) scale(1.13,.82)}
  55%{transform:translateY(-12px) scale(.98,1.03)}
  65%{transform:translateY(0) scale(1.05,.96)}
  82%{transform:translateY(-4px) scale(1,1)}
}
@keyframes sprite-wiggle{
  0%,100%{transform:translateX(0) rotate(0deg) scale(1)}
  20%{transform:translateX(-2px) rotate(var(--wiggle-left,-4deg)) scale(1.04,.97)}
  46%{transform:translateX(2px) rotate(var(--wiggle-right,5deg)) scale(.97,1.04)}
  70%{transform:translateX(-1px) rotate(var(--wiggle-left,-4deg)) scale(1.03,.98)}
  88%{transform:translateX(1px) rotate(2deg) scale(.98,1.02)}
}
@keyframes sprite-shadow{
  0%,8%,48%,68%,100%{transform:translateX(-50%) scaleX(1);opacity:.7}
  26%{transform:translateX(-50%) scaleX(.59);opacity:.35}
  55%{transform:translateX(-50%) scaleX(.8);opacity:.48}
}
@keyframes sprite-dust{
  0%,45%,54%,100%{opacity:0;transform:translateY(0) scale(.2)}
  48%{opacity:.7;transform:translateY(0) scale(.8)}
  60%{opacity:0;transform:translateY(-10px) scale(1.4)}
}
@keyframes sprite-look{
  0%,25%,62%,100%{transform:translateX(0)}
  30%,45%{transform:translateX(-2px)}
  68%,82%{transform:translateX(2px)}
}
@keyframes sprite-blink{
  0%,46%,49%,51%,100%{transform:scaleY(1)}
  47.5%,50%{transform:scaleY(.07)}
}
/* Fingers can pass the sprites without frozen-looking, moving symbols.
   Only the room being manipulated pauses; the opposite room keeps playing. */
.hand-target .sprite-motion,.hand-target .sprite-body,
.hand-target .sprite-ground-shadow,.hand-target .sprite-ground-shadow:after,
.hand-target .sprite-eyes,.hand-target .sprite-eyes i{
  animation-play-state:paused!important}
@keyframes sprite-basket-bob{
  0%,100%{transform:translateY(0)}
  50%{transform:translateY(-4px)}
}
.weight{width:41px;height:41px;z-index:3;background:linear-gradient(108deg,#7b592f 0%,#d5b17c 32%,#8f6a3e 70%,#5b412b);clip-path:polygon(29% 17%,72% 17%,90% 88%,84% 97%,13% 97%,8% 88%);filter:drop-shadow(2px 3px 1px #0008);border-radius:7px}
.weight:after{content:"";position:absolute;left:10%;bottom:4px;width:80%;height:5px;background:#4b311e;box-shadow:0 -3px #d8b77b}
.weight-handle{position:absolute;top:0;left:35%;width:30%;height:11px;border:3px solid #e1c085;border-radius:6px;background:#846139}
.weight-shine{position:absolute;left:12px;top:14px;width:5px;height:20px;background:rgba(255,239,184,.25);transform:rotate(10deg);border-radius:40%}
.balloon{width:35px;height:61px;animation:balloon-float 3s ease-in-out infinite;animation-delay:var(--delay,0s)}
.balloon-body{position:absolute;top:0;left:3px;width:29px;height:37px;border-radius:55% 55% 50% 50%;background:radial-gradient(circle at 25% 20%,#f4d8cc,#c89990 70%,#a97771);border:1px solid #efd0ba;box-shadow:2px 3px 6px #0003}
.balloon-knot{position:absolute;top:35px;left:15px;border:5px solid transparent;border-bottom-color:#ad746d}
.balloon-string{position:absolute;top:44px;left:17px;width:1px;height:16px;border-left:1px solid #d8c6a8;transform:rotate(12deg)}
@keyframes balloon-float{50%{transform:translateY(-8px) rotate(-5deg)}}

/* Transparent mathematical baskets */
.basket-row{height:100%;width:100%;display:flex;justify-content:space-around;align-items:flex-end;gap:3px}
.group-basket{width:19%;min-width:0;max-width:96px;height:162px;position:relative;display:flex;align-items:flex-end;justify-content:center;border:2px solid rgba(211,174,117,.78);border-radius:7px 7px 15px 15px;background:linear-gradient(90deg,rgba(211,193,145,.1),rgba(213,229,219,.04));box-shadow:inset 0 -9px 9px rgba(208,172,100,.1),0 5px 7px #0004;animation:basket-in .5s both}
.group-basket:nth-child(2){animation-delay:.06s}.group-basket:nth-child(3){animation-delay:.12s}.group-basket:nth-child(4){animation-delay:.18s}.group-basket:nth-child(5){animation-delay:.24s}
.basket-row .group-basket{overflow:visible}
.basket-contents{position:absolute;inset:8px 3px 8px;display:flex;align-content:flex-end;align-items:flex-end;justify-content:center;flex-wrap:wrap;gap:1px}
.group-basket .token{width:26px;height:27px;margin:-3px;transform:scale(.58);transform-origin:center bottom;animation:none}
.group-basket .balloon{height:40px}
.group-basket .sprite-motion{animation-name:sprite-basket-bob;animation-duration:var(--wiggle-period,1100ms)}
.group-basket .sprite-ground-shadow{animation:none}
.group-basket .sprite-ground-shadow:after{display:none}
.group-basket .sprite-body{left:-3px;bottom:2px}
.group-basket .sprite-feet{left:4px;bottom:0}
.group-basket .weight{clip-path:polygon(29% 17%,72% 17%,90% 88%,84% 97%,13% 97%,8% 88%)}
.basket-lip{position:absolute;top:-5px;left:-4px;right:-4px;height:7px;border-radius:6px;background:linear-gradient(#d4b78b,#775a40);box-shadow:0 2px 6px #1d1f1f}
@keyframes basket-in{from{opacity:0;transform:translateY(-12px)}to{opacity:1;transform:translateY(0)}}

/* Hand tools */
.experiment-controls{margin-top:16px;display:grid;grid-template-columns:minmax(215px,25%) 1fr;border:1px solid var(--line);border-radius:16px;background:linear-gradient(135deg,#253031,#1b2426);box-shadow:0 12px 40px #0002;overflow:hidden}
.mission{padding:23px 22px;border-right:1px solid var(--line);display:flex;flex-direction:column;gap:11px}
.mission p{font:1.07rem/1.45 Georgia,serif;color:#e9e0cd}
.feedback{margin-top:auto;padding-top:12px;border-top:1px solid rgba(222,195,140,.16);color:#b3c8be;font-size:.82rem;line-height:1.45}
.success-mark{color:var(--brass)}
.inline-link{border:0;background:none;color:#e6c28e;text-decoration:underline;padding:0;display:inline}
.control-content{padding:19px 20px;min-width:0}
.control-top{display:flex;align-items:flex-start;justify-content:space-between;gap:20px}
fieldset{margin:0;padding:0;border:0;min-width:0}
legend{margin-bottom:12px;padding:0}
.operation-picker{flex:2 1 390px}
.tool-button,.item-button{border:1px solid #58615a;color:#e4e2d7;background:#263334;border-radius:9px;min-height:45px;margin:0 6px 7px 0;padding:8px 11px;transition:background .2s,border-color .2s,transform .2s}
.tool-button{font-size:.8rem}
.tool-button span{font-size:1.3rem;vertical-align:-2px;padding-right:4px;color:#e1c08a}
.tool-button.selected,.item-button.selected{background:#45554b;border-color:#dfc28e;box-shadow:inset 0 0 0 1px rgba(233,203,151,.2)}
.tool-button:hover:not(:disabled),.item-button:hover:not(:disabled){background:#3c4a45}
.object-picker{flex:1 1 190px}
.item-button{display:inline-flex;gap:9px;align-items:center;min-width:100px;justify-content:center}
.tiny-weight{width:15px;height:15px;background:linear-gradient(100deg,#977044,#e9c890,#80603e);clip-path:polygon(25% 10%,75% 10%,100% 100%,0 100%)}
.tiny-sprite{font-size:9px;letter-spacing:2px;text-align:center;line-height:22px;color:white;width:25px;height:25px;background:#151819;border-radius:48%;box-shadow:0 0 0 2px #353e3b}
.tiny-square-sprite{border-radius:5px;color:#f0d6a0;background:#23332f;box-shadow:0 0 0 2px #c9a975;font:700 11px/25px Georgia,serif}
.amount-control{flex:0 0 110px}
.stepper{display:flex;align-items:center;margin-top:12px;border:1px solid #647066;border-radius:9px;overflow:hidden;height:45px}
.stepper button{border:0;background:#33423e;color:#e9d6b9;flex:1;font-size:1.2rem;height:100%}
.stepper button:hover:not(:disabled){background:#556354}
.stepper output{min-width:32px;text-align:center;font-weight:800;font-size:1rem}
.control-bottom{display:flex;justify-content:space-between;align-items:center;gap:15px;border-top:1px solid var(--line);margin-top:11px;padding-top:13px}
.small-actions{display:flex;flex-wrap:wrap;gap:7px}
.secondary-btn{background:#2d3838;border:1px solid #68716b;color:#e1dfd3;border-radius:8px;padding:11px 13px;font-size:.8rem}
.secondary-btn:hover:not(:disabled){background:#405049}
.primary-btn{background:linear-gradient(#e6c694,#bea06d);color:#2b2922;border:1px solid #f0d9ae;border-radius:9px;min-height:43px;padding:10px 18px;font-weight:800;font-size:.85rem;box-shadow:inset 0 1px #fff7df66,0 4px 13px #0005}
.primary-btn:hover:not(:disabled){filter:brightness(1.1)}
.primary-btn span{padding-left:7px}
.manual-explanation{color:#d9c29d;font-size:.8rem;font-style:italic;max-width:265px;line-height:1.4}
.footer-note{display:flex;justify-content:space-between;gap:10px;padding:13px 7px 0;color:#858f89;font:italic .76rem Georgia,serif}

/* Comic-book retrospective */
.replay-backdrop{position:fixed;inset:0;z-index:50;background:rgba(10,13,14,.95);padding:2vh 2vw;display:flex;align-items:center;justify-content:center;backdrop-filter:blur(10px)}
.replay-card{width:min(1370px,100%);height:min(920px,96vh);min-height:620px;display:flex;flex-direction:column;border:1px solid #a98b5c;border-radius:16px;background:#1d2425;box-shadow:0 30px 95px #000b;overflow:hidden}
.replay-header{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:18px 25px;background:linear-gradient(110deg,#283231,#1d2626);border-bottom:1px solid rgba(215,181,123,.3)}
.replay-header h2{font-size:clamp(1.45rem,2.7vw,2.3rem);font-weight:400;margin:3px 0}
.replay-header p{font-size:.83rem;color:#bbbfba}
.replay-exit{background:transparent;border:1px solid #837a63;border-radius:8px;color:#e9d8bb;padding:11px 15px;font-size:.8rem;white-space:nowrap}
.replay-exit:hover{background:#414743}
.replay-columns{display:grid;grid-template-columns:53% 47%;flex:1;min-height:0}
.comic-side{min-width:0;min-height:0;padding:21px 22px 0;background:
 radial-gradient(circle at 80% 20%,#3a4140,#252d2e 75%);border-right:5px solid #1b2020;display:flex;flex-direction:column}
.comic-label{font-size:.62rem;letter-spacing:.2em;color:#dcc391;margin-bottom:10px}
.comic-panels{overflow-y:auto;min-height:0;flex:1;padding-right:12px;padding-bottom:16px;scrollbar-color:#76664b #26312f}
.comic-panel{background:linear-gradient(145deg,#e9ddc3,#cfc0a2);color:#302b25;padding:12px;border:3px solid #39322a;box-shadow:5px 5px 0 #121819,inset 0 0 0 2px #e9dbc0;margin:0 0 15px;transform:rotate(-.4deg);position:relative}
.comic-panel:nth-child(even){transform:rotate(.6deg)}
.comic-panel.current-panel{animation:panel-unfold .5s cubic-bezier(.2,.9,.3,1.2) both;outline:2px solid #d2a965;outline-offset:2px}
.comic-panel header{display:flex;flex-direction:column;gap:3px;margin-bottom:10px;border-bottom:1px dashed #82735b;padding-bottom:9px}
.comic-panel header strong{font:1.1rem Georgia,serif}
.comic-panel header small{font-size:.71rem;color:#63543c}
.panel-footnote{font:italic .73rem Georgia,serif;color:#75664e;margin-top:8px}
.mini-stage{height:110px;position:relative;overflow:hidden;border:1px solid #ac9371;background:linear-gradient(#58615a,#3e4a44);border-radius:5px}
.mini-rooms{display:flex;align-items:flex-end;justify-content:space-around;gap:8px;height:100%;padding:6px}
.mini-room{height:94px;width:44%;max-width:220px;background:linear-gradient(#78837a,#56645b);border:3px solid #765d43;border-radius:28px 28px 4px 4px;display:flex;flex-direction:column;justify-content:space-between;padding:4px 6px 5px;box-shadow:inset 0 0 10px #1d302e}
.mini-caption{font-size:.48rem;letter-spacing:.15em;color:#eee5d6}
.mini-floor{display:flex;align-items:flex-end;justify-content:center;align-content:flex-end;flex-wrap:wrap;gap:3px;overflow:hidden;min-height:46px;border-bottom:3px solid #b8a07c}
.mini-token{width:13px;height:14px;display:inline-block;flex:none}
.mini-token.posX,.mini-token.negX{border-radius:45%;background:#191d1c;position:relative;box-shadow:0 0 0 1px #434441}
.mini-token.negX{background:#e3e4de}
.zero-pair-line{font:italic .86rem Georgia,serif;color:#526a60;margin-bottom:5px}
.mini-token.posX:after,.mini-token.negX:after{content:"";position:absolute;left:3px;top:4px;width:2px;height:3px;background:white;border-radius:50%;box-shadow:5px 0 white}
.mini-token.negX:after{background:#202b2b;box-shadow:5px 0 #202b2b}
.mini-token.posOne{background:linear-gradient(105deg,#b18b57,#ead3a3,#8c6f47);clip-path:polygon(21% 16%,75% 16%,100% 100%,0 100%)}
.mini-token.negOne{background:#d7aaa0;border-radius:60% 60% 45% 45%;height:20px;width:12px}
.mini-empty{font-size:.62rem;color:#dfd7c4}
.mini-equals{align-self:center;color:#d9c393}
.mini-stage.reenacting .mini-rooms{animation:mini-jostle .65s ease-in-out}
.mini-hand-cue{position:absolute;top:-10px;left:45%;width:36px;height:52px;animation:mini-visit .7s ease both;filter:drop-shadow(2px 3px 3px #1d2424a0)}
.mini-stage.action-complete:after{content:"✓";position:absolute;right:7px;top:4px;color:#f2db9c;font-size:1.1rem}
@keyframes mini-visit{0%{transform:translateY(-40px);opacity:0}50%{transform:translateY(15px);opacity:1}100%{transform:translateY(-40px);opacity:0}}
@keyframes mini-jostle{35%{transform:translateY(3px)}65%{transform:translateY(-2px)}}
@keyframes panel-unfold{from{opacity:0;transform:scale(.84) rotate(-2deg) translateY(14px)}to{opacity:1;transform:scale(1) rotate(0) translateY(0)}}
.paper-side{padding:16px;background:linear-gradient(130deg,#3b372d,#181e1e);min-height:0;overflow:auto}
.paper-page{position:relative;min-height:100%;padding:23px 30px 45px;color:#393329;background:
 repeating-linear-gradient(0deg,transparent 0 36px,rgba(94,109,106,.16) 37px 38px),
 linear-gradient(120deg,#eee3cb,#d9c8a9);
 border:1px solid #d2bd92;box-shadow:inset 10px 0 20px #af9a7566,2px 5px 12px #090f0fa0}
.paper-top{display:flex;justify-content:space-between;font-size:.62rem;letter-spacing:.17em;color:#846f4e;border-bottom:2px solid rgba(104,79,45,.5);padding-bottom:11px}
.paper-page h3{font-size:clamp(1.25rem,2vw,1.8rem);font-weight:400;margin:18px 0 10px}
.legend{font:italic .73rem Georgia,serif;color:#786950;border-bottom:1px solid #ae9875;padding-bottom:14px;margin-bottom:18px}
.pencil-lines{padding:0 4px;position:relative;min-height:240px}
.paper-line{min-height:76px;padding:6px 0 11px;margin-bottom:7px;border-bottom:1px dashed rgba(110,90,61,.26);display:flex;flex-direction:column;justify-content:center}
.operation-line{font-size:.79rem;font-style:italic;color:#806c50;margin-bottom:6px}
.equation-line{display:block;font:clamp(1.25rem,2.3vw,1.9rem)/1.25 Georgia,serif;letter-spacing:.015em;color:#292f30;white-space:nowrap}
.answer-line{display:inline-block;font-weight:700;color:#214a43;border-bottom:3px solid #587e6b;width:max-content;padding-right:10px}
/* Every character has a reserved space, but is invisible until the pencil
   reaches it. This deliberately does not reveal whole lines at once. */
.ink-glyph{display:inline-block;white-space:pre;opacity:0}
.ink-glyph.written{opacity:1;animation:ink-stroke .16s steps(4,end) both}
@keyframes ink-stroke{from{clip-path:inset(0 100% 0 0);opacity:.65}to{clip-path:inset(0 0 0 0);opacity:1}}
.paper-line .answer-line:not(.complete){border-bottom-color:transparent}
.writing-status{font:italic .79rem Georgia,serif;color:#8f7955;margin-bottom:10px;min-height:18px}
.pencil-icon{position:absolute;z-index:9;left:20px;top:160px;width:30px;height:70px;pointer-events:none;
  transform:rotate(29deg);transform-origin:50% 100%;
  transition:left .16s linear,top .16s linear,opacity .15s ease;
  filter:drop-shadow(3px 4px 2px #0006)}
.pencil-icon svg{height:100%;width:100%;overflow:visible}
.pencil-icon.writing{animation:pencil-nib .22s ease-in-out infinite alternate}
@keyframes pencil-nib{from{transform:rotate(26deg)}to{transform:rotate(32deg)}}
.replay-paused .pencil-icon.writing,.replay-paused .mini-stage *{animation-play-state:paused!important}
.paper-page .pencil-lines{z-index:1}
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;
  overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.journal-footer{margin-top:28px;padding-top:15px;border-top:2px solid #9d8c70;font:italic .85rem/1.5 Georgia,serif;color:#776345}
.replay-toolbar{padding:13px 19px;border-top:1px solid #786648;background:#252e2d;display:flex;justify-content:space-between;align-items:center;gap:12px}
.replay-transport,.replay-end-actions{display:flex;align-items:center;gap:7px}
.replay-transport button{min-height:39px;border:1px solid #777562;background:#394542;color:#ecdfc6;border-radius:6px;padding:7px 12px;font-size:.82rem}
.replay-transport button:hover:not(:disabled){background:#53655a}
.replay-transport button:first-child,.replay-transport button:nth-child(3){font-size:1.6rem;line-height:1;padding:0 15px}
.replay-progress{color:#e0c89a;font-size:.77rem;white-space:nowrap}
.replay-speed{display:flex;align-items:center;gap:8px;color:#d5c8ad;font-size:.7rem;white-space:nowrap}
.replay-speed select{min-height:36px;background:#394542;color:#eee3d3;border:1px solid #797762;border-radius:6px;padding:5px 8px;cursor:pointer}

/* Adaptability */
@media(max-width:1100px){
  .topbar{align-items:flex-start}
  .control-top{flex-wrap:wrap}
  .operation-picker{flex:1 1 100%}
  .object-picker{flex:1}
  .amount-control{flex:0 0 120px}
  .room-interior{height:282px}
  .rooms-row{top:110px}
}
@media(max-width:800px){
  .app-shell{padding:0 9px 20px}
  .topbar{flex-direction:column;align-items:stretch;gap:12px}
  .header-actions{justify-content:flex-start}
  .playfield{height:485px}
  .rooms-row{top:117px;left:2%;width:96%;gap:3%}
  .chamber{width:48.5%}
  .room-interior{height:225px;border-width:7px;border-radius:90px 90px 8px 8px/55px 55px 8px 8px}
  .room-roof{height:30px}
  .room-items{height:135px;bottom:22px}
  .room-window{width:44px;height:60px;top:55px}
  .tiny-shelf{display:none}
  .items-grid{gap:0 2px}
  .items-grid .token{transform:scale(.8);margin:-4px}
  .room-action{padding:4px 9px;font-size:.59rem}
  .rooms-row{transform-origin:50% 260px}
  .scale-beam{top:365px;left:15%;right:15%}
  .scale-base{top:399px}
  .scene-caption{bottom:10px}
  .group-basket{height:113px}
  .group-basket .token{transform:scale(.46);margin:-5px}
  .giant-hand{width:140px}
  .experiment-controls{grid-template-columns:1fr}
  .mission{border-right:0;border-bottom:1px solid var(--line)}
  .control-content{padding:15px}
  .replay-card{height:97vh;min-height:0}
  .replay-columns{grid-template-columns:1fr 1fr}
  .paper-page{padding:20px 16px}
}
@media(max-width:600px){
  .chapter-strip{padding:15px 4px}
  .progress-dot{width:16px}
  .header-actions{gap:6px}
  .labelled-select select{min-width:0;width:155px}
  .top-icon{font-size:.7rem}
  .playfield{height:385px}
  .scene-heading{left:10px;top:11px;font-size:.5rem}
  .ambient-window{transform:translateX(-50%) scale(.75);transform-origin:top}
  .rooms-row{top:99px}
  .room-roof{height:18px;margin:0 4px -3px}
  .room-interior{height:195px;border-width:5px}
  .room-name{top:19px;font-size:.48rem;letter-spacing:.09em}
  .room-window{left:5%;top:40px;width:30px;height:49px;border-width:3px}
  .room-items{height:124px;bottom:17px}
  .items-grid.floor-track>.token{transform:none;margin:0}
  .items-grid.floor-track{gap:4px}
  .floor-count{font-size:.55rem;bottom:48px}
  .room-action{font-size:.52rem;padding:4px 7px}
  .scale-pan{height:18px}
  .scale-beam{top:296px;height:20px}
  .beam-body{height:15px}
  .pivot-dial{width:67px;height:67px;top:-23px;border-width:5px}
  .pivot-dial span{font-size:1.1rem}
  .dial-needle{height:37px;top:9px}
  .scale-base{top:317px;height:38px;width:115px}
  .rooms-row{transform-origin:50% 208px}
  .workbench{height:25px}
  .giant-hand{width:100px;height:145px;top:-123px}
  .giant-hand.reaching{transform:translateX(-50%) translateY(var(--hand-reach,230px))}
  .giant-hand.approaching{transform:translateX(-50%) translateY(calc(var(--hand-reach,230px) - 48px))}
  .giant-hand.lifting{transform:translateX(-50%) translateY(calc(var(--hand-reach,230px) - 35px))}
  .hand-cargo{transform:translate(-50%,-9px) scale(.7)}
  .action-caption{bottom:32px;font-size:.68rem;padding:7px 10px}
  .speech{right:3%;top:29px;max-width:180px;padding:9px;font-size:.78rem}
  .scene-caption{font-size:.65rem}
  .control-top{gap:6px}
  .operation-picker{flex:1 1 100%}
  .tool-button{padding:6px 7px;min-height:40px;font-size:.69rem}
  .control-bottom{flex-direction:column;align-items:stretch}
  .small-actions{justify-content:space-between}
  .primary-btn{width:100%}
  .footer-note span{display:none}
  .replay-backdrop{padding:0}
  .replay-card{width:100%;height:100vh;border-radius:0}
  .replay-header{padding:10px 13px;align-items:flex-start}
  .replay-header p{display:none}
  .replay-exit{font-size:.66rem;white-space:normal}
  .replay-columns{grid-template-columns:1fr;grid-template-rows:46% 54%;overflow:hidden}
  .comic-side{padding:10px 12px 0;border-right:0;border-bottom:3px solid #1e2524}
  .paper-side{padding:7px}
  .paper-page{padding:11px 18px}
  .paper-page h3{font-size:1.15rem;margin:9px 0}
  .paper-line{min-height:57px;margin-bottom:1px}
  .equation-line{font-size:1.15rem}
  .pencil-icon{width:22px;height:53px}
  .writing-status{font-size:.65rem;margin-bottom:4px}
  .replay-speed{font-size:.65rem;gap:4px}
  .replay-speed select{min-height:34px;padding:4px}
  .replay-toolbar{padding:8px;flex-wrap:wrap}
  .replay-progress{order:3;width:100%;text-align:center}
  .replay-transport button{padding:7px;font-size:.74rem}
  .replay-end-actions .secondary-btn{display:none}
  .replay-end-actions .primary-btn{font-size:.7rem;padding:8px}
  .group-basket{height:103px}
  .basket-contents{inset:5px 1px}
  .group-basket .token{transform:scale(.39);margin:-6px}
}
/* JS initialises from the OS accessibility preference. An explicit Motion: on
   click must be able to override it; an unconditional media rule would prevent
   the user's chosen animations from ever appearing. */
.reduce-motion *,.reduce-motion *:before,.reduce-motion *:after{animation-duration:.001ms!important;transition-duration:.001ms!important;scroll-behavior:auto!important}
/* Static presentation must not flicker/blink at 1000fps on reduced motion. */
.reduce-motion .sprite-motion,.reduce-motion .sprite-body,
.reduce-motion .sprite-ground-shadow,.reduce-motion .sprite-ground-shadow:after,
.reduce-motion .sprite-eyes,.reduce-motion .sprite-eyes i{
  animation:none!important;transform:none!important}
.reduce-motion .sprite-ground-shadow{transform:translateX(-50%)!important}
.reduce-motion .sprite-ground-shadow:after{opacity:0!important}
.reduce-motion .sprite-reaction-shell,.reduce-motion .sprite-reacting:after,
.reduce-motion .hand-cargo .held-sprite{animation:none!important;transform:none!important}
/* A still, readable in-room square for students choosing Motion: reduced. */
.reduce-motion .room-square-box .box-cell,
.reduce-motion .room-square-box .box-workshop,
.reduce-motion .room-square-box .box-actor,
.reduce-motion .room-square-box .box-edge,
.reduce-motion .room-square-box .box-cell.placed .box-actor{
  animation:none!important;transition:none!important}
.reduce-motion .room-square-box .box-cell.placed{opacity:1;transform:none}
.reduce-motion .room-square-box .box-cell.removed{opacity:0;transform:none}
.reduce-motion .room-square-box .box-edge.built{opacity:.83;transform:none}
.reduce-motion .room-square-box .box-edge.retired{opacity:0;transform:none}
.reduce-motion .room-square-box .box-edge.kept{opacity:1;transform:none}


/* PR25 — physical wicker baskets: props inside each moving scale chamber. */
.division-stage{position:absolute;inset:0;--basket-rim:#e5b975}
.division-stage .division-source{z-index:4}
.division-stage .basket-row{position:absolute;inset:0;z-index:3;display:flex;
  justify-content:space-around;align-items:flex-end;gap:4px;pointer-events:none}
.division-stage[data-phase="waiting"] .basket-row{visibility:hidden}
.division-stage .group-basket,
.hand-cargo .group-basket.basket-in-hand{
  flex:1 1 0;width:0;
  max-width:100px;min-width:0;height:143px;position:relative;
  border:4px solid #875e34;border-top:10px solid #e3b579;
  border-radius:11px 11px 24px 24px;
  background:
    repeating-linear-gradient(90deg,transparent 0 5px,rgba(52,32,15,.29) 5px 7px,rgba(240,196,124,.13) 7px 9px),
    repeating-linear-gradient(0deg,rgba(240,192,110,.41) 0 5px,rgba(110,65,31,.44) 5px 8px,rgba(213,148,80,.29) 8px 12px),
    linear-gradient(105deg,#86502d,#c69154 34%,#dfaa6d 67%,#6a4225);
  box-shadow:inset 3px 1px 5px #f1c78f65,inset -5px -9px 9px #42230f77,
    0 7px 0 -3px #3b281c,0 11px 12px #10100e80;
  animation:none;transform-origin:50% 100%;overflow:visible;isolation:isolate;
}
.division-stage .group-basket:before,
.hand-cargo .group-basket.basket-in-hand:before{
  content:"";position:absolute;inset:7px 1px 3px;border-radius:4px 4px 18px 18px;
  background:repeating-linear-gradient(157deg,transparent 0 7px,#f0bc7545 7px 10px,transparent 10px 17px);
  opacity:.7;pointer-events:none;z-index:1
}
.division-stage .basket-lip,
.hand-cargo .basket-in-hand .basket-lip{
  top:-13px;left:-6px;right:-6px;height:13px;border-radius:45% 45% 7px 7px;
  border:2px solid #6b4628;
  background:repeating-linear-gradient(90deg,#bb864d 0 6px,#ebc084 6px 10px,#a8753c 10px 15px);
  box-shadow:inset 0 3px 2px #efcb8e,0 3px 5px #281d18b8;z-index:5
}
.division-stage .basket-contents,
.hand-cargo .basket-in-hand .basket-contents{
  position:absolute;inset:7px 1px 7px;display:flex;flex-wrap:wrap;
  align-content:flex-end;align-items:flex-end;justify-content:center;gap:0;
  z-index:3;overflow:visible
}
.division-stage .group-basket .token,
.hand-cargo .basket-in-hand .token{
  width:26px;height:27px;margin:-4px;flex:none;
  transform:scale(.55);transform-origin:50% 100%
}
.division-stage .group-basket .balloon,
.hand-cargo .basket-in-hand .balloon{height:40px}
.division-stage .group-basket .sprite-motion,
.hand-cargo .basket-in-hand .sprite-motion{animation-name:sprite-basket-bob}
.division-stage .group-basket[data-state="dropping"]{
  animation:division-wicker-drop .53s cubic-bezier(.2,.72,.25,1.07) both
}
@keyframes division-wicker-drop{
  0%{opacity:0;transform:translateY(-185px) rotate(-9deg) scale(.88,1.04)}
  62%{opacity:1;transform:translateY(7px) rotate(3deg) scale(1.04,.88)}
  80%{transform:translateY(-9px) rotate(-2deg) scale(.98,1.04)}
  100%{opacity:1;transform:translateY(0) rotate(0) scale(1)}
}
.division-stage .basket-sharing-token{
  animation:division-share .47s cubic-bezier(.24,.72,.28,1.1) var(--basket-share-delay,0ms) both!important
}
@keyframes division-share{
  from{opacity:.86;transform:translate(var(--basket-share-x,0px),var(--basket-share-y,0px)) scale(.76)}
  75%{opacity:1;transform:translate(0,-5px) scale(.60)}
  to{opacity:1;transform:translate(0,0) scale(.55)}
}
.hand-cargo:has(>.basket-in-hand){overflow:visible;opacity:1!important}
.hand-cargo .group-basket.basket-in-hand{
  position:absolute;left:-7px;top:-8px;width:71px;height:83px;
  max-width:none;min-width:0;flex:none;z-index:6
}
.hand-cargo .basket-in-hand .token{transform:scale(.43);margin:-6px}
.hand-cargo .basket-in-hand.basket-grabbed{
  animation:division-basket-grab .14s ease-out both!important
}
@keyframes division-basket-grab{
  from{transform:translate(var(--basket-grab-x,0px),var(--basket-grab-y,0px)) scale(var(--basket-grab-scale,1))}
  to{transform:translate(0,0) scale(1)}
}
.hand-cargo .basket-in-hand[data-state="thrown"]{
  animation:division-basket-throw var(--basket-throw-ms,280ms) cubic-bezier(.3,.04,.65,.66) both!important
}
@keyframes division-basket-throw{
  0%{opacity:1;transform:translate(0,0) rotate(0) scale(1)}
  38%{opacity:1;transform:translate(calc(var(--basket-throw-x,180px) * .35),-65px) rotate(20deg) scale(.93)}
  100%{opacity:0;transform:translate(var(--basket-throw-x,180px),-220px) rotate(115deg) scale(.52)}
}
.giant-hand.basket-throwing .hand-art{transform:translateY(-5px) rotate(-9deg)}
/* The retained basket gets a readable pause; never fade or duplicate its tokens. */
.division-stage[data-phase="remaining"] .group-basket{
  box-shadow:inset 3px 1px 5px #f1c78f65,inset -5px -9px 9px #42230f77,
    0 7px 0 -3px #3b281c,0 11px 12px #10100e80,0 0 0 2px #e5c18a60
}
.reduce-motion .division-stage .group-basket,
.reduce-motion .division-stage .basket-sharing-token,
.reduce-motion .hand-cargo .basket-in-hand{animation:none!important;transition:none!important}
@media(max-width:700px){
  .division-stage .group-basket{height:98px;border-width:3px;border-top-width:7px}
  .division-stage .basket-row{gap:2px}
  .division-stage .group-basket .token{transform:scale(.38);margin:-6px}
  .hand-cargo .group-basket.basket-in-hand{width:59px;height:67px}
  .hand-cargo .basket-in-hand .token{transform:scale(.34);margin:-7px}
  .division-stage .basket-lip,.hand-cargo .basket-in-hand .basket-lip{top:-9px;height:9px}
}


/* PR29 — multiplication shares EXACTLY the PR25 solid wicker, rim and hand
   cargo styles. Extra groups arrive in the hand; none are ghost overlays. */
.multiplication-stage .basket-row > .group-basket[data-state="waiting"]{
  visibility:hidden
}
.multiplication-stage .group-basket[data-state="placing"]{
  animation:multiplication-basket-land .26s cubic-bezier(.18,.68,.3,1.05) both
}
@keyframes multiplication-basket-land{
  0%{opacity:1;transform:translate(var(--multiply-place-x,0px),var(--multiply-place-y,0px)) rotate(-8deg) scale(.96)}
  72%{transform:translate(0,6px) rotate(2deg) scale(1.03,.94)}
  100%{opacity:1;transform:translate(0,0) rotate(0) scale(1)}
}
.multiplication-stage .basket-row > .group-basket[data-state="landed"]{
  visibility:visible
}
.multiplication-stage[data-phase="ready"] .group-basket{
  box-shadow:inset 3px 1px 5px #f1c78f65,
    inset -5px -9px 9px #42230f77,0 7px 0 -3px #3b281c,
    0 11px 12px #10100e80,0 0 0 2px #e5c18a65
}
.multiplication-stage .division-source .multiplication-poured-token{
  animation:multiplication-pour .45s cubic-bezier(.19,.65,.34,1.08)
    var(--multiply-pour-delay,0ms) both!important
}
@keyframes multiplication-pour{
  0%{opacity:.91;transform:translate(var(--multiply-pour-x,0px),var(--multiply-pour-y,0px)) scale(.46)}
  72%{opacity:1;transform:translate(0,-8px) scale(1.05,.94)}
  100%{opacity:1;transform:translate(0,0) scale(1)}
}
.reduce-motion .multiplication-stage .group-basket,
.reduce-motion .multiplication-stage .multiplication-poured-token{
  animation:none!important;transition:none!important
}
@media(max-width:700px){
  .multiplication-stage .group-basket[data-state="placing"]{
    animation-duration:.2s
  }
}
