.memory-spirit-v1 .mr-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(3,1fr);gap:8px;width:100%;height:min(420px,100%);padding:8px;box-sizing:border-box}.mr-card{min-width:0;min-height:88px;padding:4px;border:2px solid #b5a9da;border-radius:14px;background:linear-gradient(145deg,#dfd8f4,#f6e8ff);color:#5a4285}.mr-back{font-size:30px}.mr-front{display:none;flex-direction:column;align-items:center;height:100%;width:100%;overflow:hidden}.mr-number{font-size:22px}.mr-front svg{width:100%;min-height:0;flex:1}.mr-open .mr-back,.mr-done .mr-back{display:none}.mr-open .mr-front,.mr-done .mr-front{display:flex}.mr-done{background:#fff6c9;border-color:#dcbe69}.ten-refill-v1 .ct-grid{display:grid;grid-template-columns:repeat(3,72px);grid-auto-rows:72px;align-content:start;justify-content:center;gap:10px}.ten-refill-v1 .ct-tile{width:72px;height:72px;min-width:72px;min-height:72px;max-width:72px;max-height:72px;flex:none;aspect-ratio:auto;font-size:30px}.tr-phase{font-size:14px;color:#507463}.mole-timed-v1 .cm-area{display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);gap:12px}.mole-timed-v1 .cm-mole{animation:none}.flash-color-v1 .cf-dot{background:var(--flash-color)!important}.flash-color-v1 .cf-card{border-color:var(--flash-color)!important}.kg-pattern .cp-key{width:72px;height:64px;min-width:64px;min-height:48px;max-width:80px;max-height:72px;flex:0 0 72px;font-size:30px}.kg-pattern .cp-keys{display:flex;justify-content:center;gap:10px}

.mole-timed-v1 img.cm-face{display:block;width:52px;height:48px;object-fit:contain;margin:0 auto}

/* Stable, roomy targets: filled and empty slots never make other numbers move. */
.ten-refill-v1 .kg-head{flex-wrap:wrap;gap:6px;justify-content:space-between}
.ten-refill-v1 .kg-next{font-size:clamp(17px,4.5vw,22px)}
.ten-refill-v1 .ct-grid{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(4,minmax(52px,1fr));grid-auto-rows:auto;align-content:stretch;gap:12px;padding:14px;box-sizing:border-box;background:linear-gradient(145deg,#f4fff4,#edf6ff);border:2px solid #cee6da}
.tr-slot{position:relative;min-width:0;min-height:0;border-radius:20px;background:#ffffff80;border:2px dashed #bfd8cf;box-sizing:border-box}
.ten-refill-v1 .ct-tile{display:grid;place-items:center;width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;margin:0;border:2px solid color-mix(in srgb,var(--tile-ink) 28%,white);border-radius:18px;background:linear-gradient(145deg,#ffffff90,transparent),var(--tile-fill);color:var(--tile-ink);box-shadow:0 4px 0 color-mix(in srgb,var(--tile-ink) 35%,white),inset 0 2px 0 #fff9;font-size:34px;font-weight:800;touch-action:manipulation;transition:box-shadow .15s,background .15s,opacity .3s}
.ten-refill-v1 .ct-tile.on{border:4px solid #22736a;box-shadow:0 0 0 3px #ffcc59,inset 0 0 0 2px white}
.ten-refill-v1 .ct-tile.tr-match{background:#d5f7c3;color:#265c3e;border-color:#519650;box-shadow:0 0 0 4px #ffe288}
.ten-refill-v1 .ct-tile.tr-vanish{opacity:0;transform:scale(.82);transition:opacity .3s,transform .3s}
.tr-empty:after{content:'✦';position:absolute;inset:0;display:grid;place-items:center;color:#c5d9cc;font-size:24px}
.tr-phase{font-size:14px;font-weight:700}
/* Preserve answer controls; the flash picture uses only the space left over. */
.kg-flash .cf-area{grid-template-rows:minmax(70px,1fr) auto auto auto;align-content:stretch;gap:8px;padding:10px;min-height:0;box-sizing:border-box}
.kg-flash .cf-card{height:100%;width:auto;max-height:100%;max-width:100%;min-height:0;aspect-ratio:1;box-sizing:border-box;justify-self:center}
.kg-flash .cf-keys{min-height:56px;gap:8px}
.kg-flash .cf-key{min-height:56px;font-size:30px}
.kg-flash .cf-again{min-height:44px;font-size:16px}
/* A complete garden scale. Space above the tilted arm is part of the stage. */
.scale-garden-v1 .kg-head{flex-wrap:wrap;gap:6px}
.scale-garden-v1 .cs-area{grid-template-rows:minmax(210px,1fr) auto auto;gap:10px;padding:12px;background:radial-gradient(ellipse at 50% 20%,#fffdf2 0 45%,#f3efd8 100%);box-sizing:border-box}
.sv-stage{position:relative;min-height:210px;height:100%;isolation:isolate}
.sv-stem{position:absolute;z-index:0;top:25%;bottom:12px;left:calc(50% - 9px);width:18px;border-radius:9px;background:linear-gradient(90deg,#94703f,#dfbb78,#9c733d);box-shadow:2px 0 0 #71553725}
.scale-garden-v1 .cs-stand{position:absolute;z-index:1;bottom:0;left:31%;width:38%;height:18px;margin:0;background:linear-gradient(#bc965b,#92683b);border-radius:50% 50% 8px 8px;box-shadow:0 4px 0 #79573330}
.scale-garden-v1 .cs-beam{position:absolute;z-index:2;left:7%;right:7%;top:25%;height:142px;margin:0;transform-origin:50% 8px}
.scale-garden-v1 .cs-beam:before{left:0;right:0;top:3px;height:12px;background:linear-gradient(#e7cb8b,#aa7b40);box-shadow:0 3px 0 #77512535}
.scale-garden-v1 .cs-beam:after{content:'';position:absolute;left:calc(50% - 10px);top:-2px;width:20px;height:20px;box-sizing:border-box;border:4px solid #be9554;border-radius:50%;background:#fff3c9}
.scale-garden-v1 .cs-pan{top:12px;width:44%;min-height:118px;padding:62px 4px 10px;gap:3px;align-content:flex-start;border-bottom:9px solid #af824b;border-radius:0 0 35px 35px;background:linear-gradient(transparent 70%,#e7d2a34d);transform-origin:50% 0}
.scale-garden-v1 .cs-left{left:-6%}.scale-garden-v1 .cs-right{right:-6%}
.scale-garden-v1 .cs-pan:before{content:'';position:absolute;top:0;left:calc(50% - 1px);width:2px;height:32px;background:#b99a63}
.scale-garden-v1 .cs-num{top:28px;font-size:21px;line-height:1.25;padding:3px 9px;min-width:36px;text-align:center;box-sizing:border-box;box-shadow:0 2px 0 #9c784629}
.scale-garden-v1 .cs-apples{font-size:18px;gap:0}
.scale-garden-v1 .cs-weight{min-width:34px;min-height:34px;padding:0 4px;border-radius:8px;font-size:20px;touch-action:manipulation}
.scale-garden-v1 .cs-note{font-size:16px;line-height:1.5;min-height:24px;overflow-wrap:anywhere}
.scale-garden-v1 .cs-shelf{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding-bottom:4px}
.scale-garden-v1 .cs-add{min-width:0;min-height:60px;border:2px solid #a47b44;background:linear-gradient(#f9e4b9,#e8bf7a);color:#694a25;font-size:30px;box-shadow:0 4px 0 #92683b}
/* Quiet garden, prominent equation, staggered mole arrivals. */
.mole-timed-v1 .kg-head{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center}
.mole-timed-v1 .kg-next{font-size:clamp(25px,6vw,34px);font-weight:800;padding:12px 10px;white-space:nowrap;text-align:center;border:2px solid #cead63;border-radius:18px;color:#315746;background:linear-gradient(#fffdf0,#fff0bd);box-shadow:0 3px 0 #b4924b28}
.mole-timed-v1 .cm-area{background:radial-gradient(ellipse at 20% 10%,#edfacf,transparent 50%),linear-gradient(#d8efc7,#bee0aa);padding:12px;gap:14px;box-sizing:border-box}
.mole-timed-v1 .cm-hole{overflow:visible;min-width:0;isolation:isolate}
.mole-timed-v1 .cm-dirt{height:30%;border-bottom:6px solid #a0804f;background:radial-gradient(ellipse at 50% 70%,#533d29,#80603a);box-shadow:0 -3px 0 #9e8150,inset 0 5px 8px #291e2040}
.mole-timed-v1 .cm-mole{animation:mole-rise .22s ease-out;z-index:2;bottom:16%;min-height:78px;background:none;border:0;box-shadow:none;padding:0}
.mole-timed-v1 img.cm-face{width:66px;height:60px;filter:drop-shadow(0 3px 0 #644d3333)}
.mole-timed-v1 .cm-num{background:#fff8dd;border:2px solid #a58248;border-radius:12px;color:#395b46;min-width:42px;line-height:1.3;font-size:25px;box-shadow:0 2px 0 #a5824840}
@keyframes mole-rise{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:translateY(0)}}
@media(min-width:650px){.ten-refill-v1 .ct-grid{grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(3,minmax(52px,1fr))}}
@media(prefers-reduced-motion:reduce){.mole-timed-v1 .cm-mole{animation:none}.ten-refill-v1 .ct-tile{transition:none}}

.flash-color-v1 .cf-grid{position:relative;display:block;width:92%;height:92%}
.flash-color-v1 .cf-cell{position:absolute;width:17%;height:17%;transform:translate(-50%,-50%);background:transparent!important}
.flash-color-v1 .cf-dot:before{width:100%;height:100%;aspect-ratio:1;background:var(--flash-color)!important;box-shadow:inset -2px -3px 0 #0002}
.flash-color-v1 .cf-card{border:2px solid #e6d8ad!important;box-shadow:none;border-radius:22px;background:#fffdf7}
.flash-color-v1 .cf-card.cf-hidden{background:#fcf0cb}
.kg-egg .kg-head{flex-wrap:wrap;gap:5px;height:auto;min-height:60px}
.kg-egg .ce-say{font-size:23px;gap:6px;white-space:nowrap}
.kg-egg .ce-q{background:#fff0ba;border:3px dashed #c08a24;box-shadow:0 0 0 3px #fff6d2;color:#976418}
.kg-egg .ce-carton{position:relative;background:linear-gradient(#dfcca7,#c9ae82);border-color:#b39465;box-shadow:inset 0 2px 0 #fff8,0 4px 0 #987b5030}
.kg-egg .ce-new{animation:egg-arrive .35s var(--egg-delay,0ms) both}
.kg-egg .ce-slot.ce-full{animation:none}
.kg-egg .ce-slot.ce-new.ce-full{animation:egg-arrive .35s var(--egg-delay,0ms) both}
.kg-egg .ce-carton[data-full='1']:after{content:'10こ そろった！';position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) rotate(-5deg);padding:7px 12px;border:3px solid #b89543;border-radius:12px;background:#fff7dceF;color:#796021;font-size:22px;font-weight:800;white-space:nowrap;animation:egg-seal .9s both}
.kg-egg .ce-area{grid-template-rows:auto auto minmax(0,1fr);gap:8px;padding:12px}
.kg-egg .ce-key{min-height:48px;max-height:88px}
@keyframes egg-arrive{from{opacity:0;transform:translateY(-12px)}to{opacity:1;transform:none}}
@keyframes egg-seal{0%,55%{opacity:0}80%,100%{opacity:1}}
@media(prefers-reduced-motion:reduce){.kg-egg .ce-new,.kg-egg .ce-slot.ce-new.ce-full,.kg-egg .ce-carton[data-full='1']:after{animation:none}}

.tr-slot:not(.tr-empty){border-color:transparent;background:transparent}
.scale-garden-v1 .cs-weight{min-width:44px;min-height:44px}
.kg-sort .kg-head{height:auto;min-height:60px;flex-wrap:wrap;gap:6px}
.kg-sort .csr-arrow{white-space:pre-line;line-height:1.6;font-size:22px;font-weight:800;color:#396c63;background:#fff9e0;border-radius:16px;border:2px solid #e0cd91;padding:10px 8px;margin:0}

.balloon-answer-v2 .kg-head{height:auto;min-height:60px;flex-wrap:wrap;gap:8px}
.balloon-answer-v2 .cb2-say{font-size:27px}
.balloon-answer-v2 .cb2-area{grid-template-rows:minmax(100px,1fr) auto auto;padding:12px;gap:10px;background:radial-gradient(ellipse at 20% 15%,#fff9,transparent 25%),linear-gradient(#ccecff,#f4fbff)}
.balloon-answer-v2 .cb2-sky{align-content:center;gap:22px 12px;padding:10px;min-height:0}
.balloon-answer-v2 .cb2-balloon{width:52px;height:64px;border:2px solid #ffffff99;box-shadow:inset -5px -6px 0 #0001,0 3px 0 #457a9822}
.balloon-answer-v2 .cb2-balloon:before{content:'';position:absolute;left:22%;top:15%;width:14%;height:22%;border-radius:50%;background:#fff8;transform:rotate(20deg)}
.balloon-answer-v2 .cb2-balloon.cb2-gone{background:none!important;border:2px dashed #8eb8cc;opacity:.3;transform:none;box-shadow:none;animation:none}
.balloon-answer-v2 .cb2-balloon.cb2-gone:before{display:none}
.balloon-answer-v2 .bv-count .cb2-balloon:not(.cb2-gone){animation:none;outline:3px solid #fff9}
.balloon-answer-v2 .cb2-eq{font-size:21px;min-height:32px}
.bv-keys{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;min-height:56px;padding-bottom:5px}
.bv-key{border:2px solid #7bb3bd;border-radius:16px;background:#fff;min-height:56px;font-size:30px;font-weight:800;box-shadow:0 4px 0 #7bb3bd;color:#315a6d}

.ten-refill-v1 .kg-head{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:40px 20px;gap:4px;height:66px;align-content:center;justify-items:start}
.ten-refill-v1 .kg-next{height:40px;font-size:18px;padding:5px 12px}
.ten-refill-v1 .tr-phase{font-size:13px;line-height:20px;white-space:nowrap}
@media(max-height:650px){.scale-garden-v1 .cs-area{grid-template-rows:minmax(170px,1fr) auto auto;gap:6px;padding:8px}.scale-garden-v1 .sv-stage{min-height:170px}.scale-garden-v1 .cs-add{min-height:52px}.scale-garden-v1 .cs-beam{top:18%}.scale-garden-v1 .sv-stem{top:18%}.kg-egg .ce-carton{max-width:280px;width:100%;margin:auto;padding:8px;gap:5px}.kg-egg .ce-area{padding:8px;gap:6px}.kg-egg .ce-keys{grid-template-rows:repeat(2,minmax(44px,1fr));gap:6px}.kg-egg .ce-key{min-height:44px;font-size:25px}}

.kg-scale.scale-garden-v1{min-height:500px;overflow:visible}
.scale-garden-v1 .cs-area{grid-template-rows:minmax(250px,1fr) auto auto;overflow:hidden}
.scale-garden-v1 .sv-stage{min-height:250px}
.scale-garden-v1 .cs-beam{top:18%}
.scale-garden-v1 .sv-stem{top:18%}
.scale-garden-v1 .cs-pan{height:174px;min-height:174px;align-content:flex-end}
.scale-garden-v1 .sv-weights{display:flex;flex-wrap:wrap;justify-content:center;align-items:flex-end;gap:3px;width:100%;max-height:91px;overflow-y:auto;scrollbar-width:thin;padding:1px;box-sizing:border-box}
.scale-garden-v1 .cs-weight{flex:0 0 44px}
.mole-timed-v1 .cm-mole{position:absolute;left:10%;right:10%;bottom:12%;height:96px;min-height:0;margin:0;display:block}
.mole-timed-v1 img.cm-face{width:74px;height:80px}
.mole-timed-v1 .cm-num{position:absolute;left:50%;bottom:0;transform:translateX(-50%)}
.mole-timed-v1 .cm-mole{height:88%;max-height:96px;bottom:6%}.mole-timed-v1 img.cm-face{max-width:100%;height:calc(100% - 12px);max-height:80px}
.kg-flash .cf-area{container-type:size;grid-template-columns:minmax(0,1fr)}.kg-flash .cf-card{width:max(70px,min(calc(100cqw - 24px),calc(100cqh - 180px),320px));height:auto;min-width:0;max-width:100%;aspect-ratio:1;align-self:center}.kg-flash .cf-key{min-width:0}

.kg-egg .ce-keys{align-content:start;grid-template-rows:repeat(2,minmax(48px,64px));gap:10px}.kg-egg .ce-key{height:100%;max-height:none}

/* Numbers rise from below; matching pairs burst before the gaps close. */
.ten-gravity-v2 .ct-grid{position:relative;overflow:hidden;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(4,minmax(52px,1fr));max-width:460px;width:100%;margin-left:auto;margin-right:auto;isolation:isolate}
.ten-gravity-v2 .tr-slot{border-color:transparent!important;background:transparent!important}
.ten-gravity-v2 .ct-tile{position:relative;transition:box-shadow .15s,background .15s;will-change:transform;z-index:2}
.ten-gravity-v2 .ct-tile.tr-vanish{animation:tr-burst-tile .3s ease-out both;transition:none}
.tr-spark{position:absolute;width:9px;height:9px;border-radius:3px;pointer-events:none;z-index:4;box-shadow:0 0 5px #fff9}
@keyframes tr-burst-tile{0%{transform:scale(1);opacity:1}35%{transform:scale(1.18) rotate(-3deg);opacity:1}100%{transform:scale(.12) rotate(12deg);opacity:0}}
@media(prefers-reduced-motion:reduce){.ten-gravity-v2 .ct-tile{will-change:auto}.ten-gravity-v2 .ct-tile.tr-vanish{animation:none;opacity:0;transform:none}}

/* A quiet balance landing: no bounce, burst or flashing of the scale. */
.scale-garden-v1 .cs-beam,.scale-garden-v1 .cs-pan{animation:none!important;transition:transform .32s cubic-bezier(.2,.8,.25,1)}
.scale-garden-v1 .cs-note{min-height:48px;display:grid;place-items:center;margin:0;font-size:16px;line-height:1.4}
.scale-garden-v1 .cs-note[data-mode="ok"]{font-size:clamp(27px,7vw,34px);font-weight:800;color:#337246}
.scale-garden-v1 .cs-take-target{outline:3px solid #e3ad36;outline-offset:1px;animation:none!important}
.cs-remove-hand{position:absolute;z-index:8;font-size:28px;line-height:29px;width:30px;pointer-events:none;filter:drop-shadow(0 1px 1px #fff)}
@media(prefers-reduced-motion:reduce){.scale-garden-v1 .cs-beam,.scale-garden-v1 .cs-pan{transition:none}}

.scale-garden-v1 .cs-note{white-space:pre-line}

/* Ordering direction stays directly above the cards; the upper box is only an example. */
.kg-sort .csr-card-group{align-self:center;width:100%;min-width:0;display:flex;flex-direction:column;gap:12px}
.kg-sort .csr-direction{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0;padding:0 4px;font-size:clamp(15px,4.1vw,20px);font-weight:800;color:#346a51;line-height:1.4}
.kg-sort .csr-direction-start,.kg-sort .csr-direction-end{white-space:nowrap}
.kg-sort .csr-direction-arrow{flex:1;min-width:20px;text-align:center;font-size:24px;color:#648d75}
.kg-sort .csr-card-group .csr-row{width:100%;min-width:0;align-self:stretch}
.kg-sort .csr-arrow{font-size:clamp(18px,4.6vw,23px);line-height:1.5;padding:9px 8px}

/* Egg: progress under title; carton, equation, prompt, choices in reading order. */
.kg-egg .ce-progress{justify-content:center;margin:0 0 12px;min-height:14px}
.kg-egg .ce-area{display:flex;flex-direction:column;align-items:stretch;gap:12px;padding:16px;min-height:0;height:auto}
.kg-egg .ce-carton{flex:none;width:100%;box-sizing:border-box}
.kg-egg .ce-say{align-self:center;justify-content:center;margin:2px 0 0;font-size:clamp(23px,6vw,32px);white-space:nowrap}
.kg-egg .ce-note{margin:0;text-align:center;font-size:clamp(19px,4.8vw,24px);min-height:1.5em;line-height:1.5}
.kg-egg .ce-keys{margin:0;gap:10px}
@media(max-height:740px){.kg-egg .ce-area{gap:8px;padding:12px}.kg-egg .ce-keys{gap:8px}.kg-egg .ce-say{font-size:23px}}
