.lab-page{background:#2b203b;color:#f7e9ef}.lab-page [hidden]{display:none!important}.lab-header{height:88px;display:flex;align-items:center;justify-content:space-between;max-width:1280px;margin:auto;padding:0 24px;gap:16px}.lab-header img{object-fit:contain;width:132px;height:82px}.lab-header button,.back-home{color:#efdfed;background:#493452;border:1px solid #a887b766;border-radius:15px;padding:12px 17px;font-size:13px;text-decoration:none;min-height:44px}.lab-header button span{display:block;color:#d4b4eb;font-size:10px;margin-top:3px}.lab-page main{max-width:1280px;margin:auto;padding:0 24px 35px}.lab-title{display:flex;align-items:center;gap:18px;margin:4px 0 16px}.lab-title h1{font:32px Georgia,serif;color:#ffe4be;margin:0}.lab-title .eyebrow{font-size:8px;margin:0 0 5px}#help-open{margin-left:auto;border:1px solid #b49bc8;background:#4a365a;color:#ffefd7;border-radius:50%;width:44px;height:44px;font:25px Georgia,serif}#preview-label{font-size:11px;background:#56416a;border-radius:15px;padding:8px 13px;color:#e7c9f7}.lab-scene{position:relative;height:clamp(350px,54svh,610px);background:#987ba8 url('assets/lab/room.webp') center/cover;border-radius:28px;overflow:hidden;border:1px solid #bda1cb;box-shadow:0 15px 40px #130b2555;isolation:isolate;container-type:size}.lab-instruction{position:absolute;top:17px;left:50%;translate:-50% 0;z-index:10;max-width:85%;width:max-content;text-align:center;color:#53365c;font-size:14px;line-height:1.4;background:#fff2dfee;border:1px solid #d6b3cf;padding:12px 20px;border-radius:18px;box-shadow:0 4px 15px #47315033}#lab-pet{position:absolute;width:min(66cqh,42cqw);height:min(66cqh,42cqw);left:70%;bottom:9%;translate:-50% 0}#lab-pet .dritten{width:100%;height:100%;inset:0}.lab-scene .fluffy-svg{overflow:visible}#cauldron{position:absolute;width:min(37cqw,55cqh);height:auto;left:9%;bottom:4%;filter:drop-shadow(0 10px 8px #40284444)}#cauldron svg{width:100%;display:block}.brew-swirl{transform-origin:164px 97px}.mixing .brew-swirl{animation:stir .35s linear infinite}.brew-bubbles{animation:brewBubbles 2s ease-in-out infinite;transform-origin:164px 98px}.mixing .brew-bubbles{animation-duration:.35s}.mixing #cauldron{animation:potShake .16s ease-in-out infinite}.reaction-label{position:absolute;right:7%;bottom:3%;max-width:40%;text-align:center;background:#3d2752dc;border:1px solid #d3b1e7;border-radius:15px;padding:9px 18px;color:#fff1cc;font-size:14px}.mix-bar{display:flex;align-items:center;justify-content:center;gap:13px;padding:15px;margin:0 10px;background:#43304f;border:1px solid #88639b;border-top:0;border-radius:0 0 22px 22px;flex-wrap:wrap}#mix-slots{display:flex;gap:8px}.mix-slot{width:125px;min-height:50px;border:1px dashed #a784b9;border-radius:14px;padding:8px;background:#ffffff05;color:#e2cbe7;font-size:11px;display:grid;place-items:center;text-align:center}.mix-slot.filled{border-style:solid;background:#705285;color:#fff4e6}#mix{background:linear-gradient(#ffe5ab,#ddb586);color:#4e3554;border:1px solid #ffeac2;border-radius:16px;font-size:17px;font-weight:bold;padding:14px 28px;min-height:51px;box-shadow:0 4px 0 #91708b}#mix:disabled{opacity:.45;box-shadow:none}#empty-pot{background:none;color:#d0b4dd;border:0;min-height:44px;padding:8px;font-size:12px}.pantry{margin-top:25px;padding:23px;border:1px solid #81608e;border-radius:24px;background:linear-gradient(#4c3758,#342640)}.pantry-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px}.pantry-heading h2{font:23px Georgia,serif;color:#ffe4bd;margin:0}.pantry-heading p{font-size:12px;color:#d7bedd;margin:0}#ingredients{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:10px}.ingredient{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:110px;background:linear-gradient(#80618c55,#241b3066);color:#f2dfef;border:1px solid #a185b24d;border-radius:17px;padding:10px 6px;font-size:11px;transition:translate .15s,border-color .15s}.ingredient:hover{translate:0 -4px;border-color:#dac0ef}.ingredient[aria-pressed=true]{border:2px solid #f1d697;background:#967a9a66}.ingredient:disabled{opacity:.55}.ingredient svg{width:48px;height:57px;filter:drop-shadow(0 4px 4px #160e2455)}.ingredient .tick{position:absolute;right:7px;top:4px;color:#ffe3a6;font-size:17px}.save-note{font-size:11px;color:#bea4cf;margin:12px 4px}#ingredient-fall{position:absolute;left:50%;top:0;z-index:5;color:#fff3aa;font-size:30px}#ingredient-fall.falling{animation:dropIn .45s both}#spell-stream{position:absolute;left:27%;top:65%;width:10px;height:10px;pointer-events:none;border-radius:50%;background:#fff7bc;opacity:0;box-shadow:0 0 15px 10px #dda9fb80}.pouring #spell-stream{animation:spellPour .65s ease-in both}.lab-page dialog{max-width:94vw;width:820px;max-height:85svh;overflow:auto;background:linear-gradient(#513860,#2f223e);color:#eddbed;border:1px solid #c5a4d8;border-radius:26px;padding:28px}.lab-page dialog::backdrop{background:#140c23bb;backdrop-filter:blur(7px)}.lab-page dialog h2{color:#ffe5bf;font:29px Georgia,serif;margin:10px 0}.lab-page dialog p,.lab-page dialog li{font-size:14px;line-height:1.7}.close-dialog{position:absolute;right:8px;top:8px;width:44px;height:44px;background:none;border:0;color:#e8c9ef;font-size:27px}#recipes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:20px}.recipe{min-height:107px;padding:13px;border:1px solid #a98ab3;border-radius:16px;background:#ffffff09;color:#ffe5cb;text-align:left}.recipe small{display:block;font-size:11px;color:#cbb2d7;line-height:1.5;margin-top:8px}.recipe.locked{border-style:dashed;color:#c9b2d3}#lab-lock{text-align:center;padding:80px 20px}#lab-lock a{color:#e8c3ff}.lab-page button:focus-visible,.lab-page a:focus-visible{outline:3px solid #c6efd9;outline-offset:4px}@keyframes stir{to{transform:rotate(360deg)}}@keyframes brewBubbles{50%{transform:translateY(-12px);opacity:.4}}@keyframes potShake{50%{rotate:1deg}}@keyframes dropIn{from{translate:0 -80px;opacity:0}40%{opacity:1}to{translate:0 65px;opacity:0}}@keyframes spellPour{0%{opacity:1}100%{left:70%;top:52%;opacity:0;scale:3}}
@media(max-width:850px){#ingredients{grid-template-columns:repeat(6,minmax(0,1fr))}.lab-page main{padding:0 12px 25px}.lab-header{padding:0 12px}.lab-scene{height:420px}.pantry{padding:16px}.pantry-heading{display:block}.pantry-heading p{margin-top:8px}}
@media(max-width:540px){.lab-header{height:78px;gap:6px}.lab-header img{width:100px;height:72px}.lab-header button,.back-home{font-size:11px;padding:9px}.lab-title h1{font-size:27px}.lab-title{gap:8px}#preview-label{font-size:9px;padding:6px}.lab-scene{height:350px}#lab-pet{width:48cqw;height:48cqw;left:66%;bottom:16%}#cauldron{width:43cqw;left:2%;bottom:8%}.lab-instruction{font-size:12px;padding:9px 12px;max-width:94%}.reaction-label{right:4%;font-size:11px;padding:7px 10px;bottom:5%}.mix-bar{gap:8px;padding:12px 7px;margin:0 5px}.mix-slot{width:113px;font-size:10px;min-height:44px}#mix{font-size:15px;padding:12px 23px}#ingredients{grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}.ingredient{min-height:103px;font-size:10px}.ingredient svg{width:41px;height:49px}.pantry{padding:13px;margin-top:18px}#recipes{grid-template-columns:1fr 1fr}.lab-page dialog{padding:24px 16px}}
@media(prefers-reduced-motion:reduce){.brew-bubbles,.mixing .brew-swirl,.mixing #cauldron{animation:none}.ingredient{transition:none}}

.ingredient img{width:76px;height:76px;object-fit:contain;filter:drop-shadow(0 4px 5px #20112955)}.ingredient{min-height:133px}#ingredient-fall img{width:45px;height:45px;object-fit:contain}.mix-slot{width:113px}#mix-slots{max-width:100%;flex-wrap:wrap;justify-content:center}
@media(max-width:540px){.ingredient img{width:60px;height:60px}.ingredient{min-height:116px}.mix-slot{width:90px;font-size:10px}#mix-slots{gap:5px}}

/* Painted cauldron and liquid: rotate in the liquid plane, then flatten perspective. */
#cauldron{aspect-ratio:1}
.cauldron-art{display:block;width:100%;height:auto;pointer-events:none}
.painted-liquid{position:absolute;left:21.1%;top:17.8%;width:56.4%;height:14.1%;border-radius:50%;overflow:hidden;pointer-events:none;isolation:isolate}
.liquid-perspective{position:absolute;inset:0 0 auto;height:400%;transform:scaleY(.25);transform-origin:50% 0}
.liquid-whirlpool{display:block;width:100%;height:100%;object-fit:fill;animation:paintedStir 18s linear infinite;will-change:transform}
.mixing .liquid-whirlpool{animation-duration:1.2s}
.mixing #cauldron{animation:none}
.painted-bubbles{position:absolute;left:26%;top:19%;width:48%;height:16%;pointer-events:none}
.painted-bubbles img{position:absolute;left:calc(var(--i)*19%);top:20%;width:18%;height:auto;opacity:0;animation:paintedBubble 3.2s ease-out infinite;animation-delay:calc(var(--i)*.6s)}
.mixing .painted-bubbles img{animation-duration:.9s;animation-delay:calc(var(--i)*.14s)}
.pouring .painted-liquid{filter:brightness(1.3)}
#ingredient-fall{left:43%;top:12%}
@keyframes paintedStir{to{transform:rotate(360deg)}}
@keyframes paintedBubble{0%{opacity:0;transform:translateY(0) scale(.35)}20%{opacity:.95}70%{opacity:.9}100%{opacity:0;transform:translateY(-180%) scale(1.15)}}
@media(prefers-reduced-motion:reduce){.liquid-whirlpool,.mixing .liquid-whirlpool,.painted-bubbles img,.mixing .painted-bubbles img{animation:none}.painted-bubbles img{opacity:.6}}

/* Character dialogue stays beside the action, with a reserved area above her. */
.lab-dialogue{position:absolute;z-index:12;left:70%;top:18px;translate:-50% 0;width:44%;max-width:430px;box-sizing:border-box;padding:12px 17px 15px;border:2px solid #b18aca;border-radius:23px;background:#fff6e8;box-shadow:0 6px 0 #704b8a44,0 9px 22px #39204633;text-align:center;color:#50305f;pointer-events:none}
.lab-dialogue:after{content:"";position:absolute;left:47%;bottom:-11px;width:18px;height:18px;background:#fff6e8;border-right:2px solid #b18aca;border-bottom:2px solid #b18aca;transform:rotate(45deg)}
.dialogue-speaker{display:block;font-size:11px;font-weight:700;letter-spacing:.04em;color:#815397;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-bottom:4px}
.lab-dialogue .lab-instruction{position:static;translate:none;max-width:none;width:auto;padding:0;border:0;border-radius:0;background:none;box-shadow:none;color:#50305f;font-size:clamp(16px,1.8vw,21px);font-weight:600;line-height:1.3}
.lab-dialogue .reaction-label{position:static;max-width:none;padding:0;margin:0 0 5px;background:none;border:0;color:#885da1;font-size:11px;font-weight:700}
#lab-pet{width:min(66cqh,42cqw,calc(100cqh - 150px));height:min(66cqh,42cqw,calc(100cqh - 150px))}
@media(max-width:540px){.lab-dialogue{left:50%;top:12px;width:90%;max-width:none;padding:9px 13px 12px}.lab-dialogue:after{left:67%}.lab-dialogue .lab-instruction{font-size:16px}.dialogue-speaker{font-size:10px}#lab-pet{width:48cqw;height:48cqw;max-height:calc(100cqh - 150px);max-width:calc(100cqh - 150px)}}
/* Full replacement artwork preserves the oversized eye outlines. */
.magic-bigeyes .fluffy-feed-face{mask:none}
.magic-bigeyes.has-feed-face .fluffy-head-normal{visibility:hidden}
