/* Signals live on the character; hidden meters stay hidden. */
.avatar .posture-frame{transform-box:view-box;transform-origin:160px 145px}.avatar .infant-mat,.avatar .lying-leg,.avatar .lying-foot,.avatar .swaddle,.avatar .rest-surface,.avatar .seat-support,.avatar .sparse-hair,.avatar .newborn-mouth{display:none}
.avatar[data-age="0"] .posture-frame{transform:rotate(-62deg) scale(.86)}.avatar[data-age="1"] .posture-frame{transform:none}
.avatar[data-age="0"] .rest-surface{display:block}.avatar[data-age="1"] .infant-mat,.avatar[data-age="1"] .lying-leg,.avatar[data-age="1"] .lying-foot{display:block}.avatar[data-age="1"] .sitting-leg,.avatar[data-age="1"] .sitting-foot{display:none}.avatar[data-age="2"] .seat-support{display:block}
.avatar[data-age="0"] .swaddle{display:block;transform-box:view-box;transform-origin:160px 200px;animation:avatar-breathe 4.6s ease-in-out infinite}.avatar[data-age="0"] .sit-pose>.body,.avatar[data-age="0"] .sit-pose>.leg,.avatar[data-age="0"] .sit-pose>.arm{display:none}
.avatar[data-age="0"] .sit-shadow,.avatar[data-age="1"] .sit-shadow{display:none}.avatar[data-age="0"] .grown-hair,.avatar[data-age="1"] .grown-hair{display:none}.avatar[data-age="0"] .sparse-hair,.avatar[data-age="1"] .sparse-hair{display:block}
.avatar[data-age="0"][data-social="false"] .newborn-mouth{display:block}.avatar[data-age="0"][data-social="false"] .smile{display:none}.avatar.cry .newborn-mouth,.avatar.cue-hunger .newborn-mouth,.avatar.cue-sleepy .newborn-mouth{display:none!important}
.avatar.sleep .posture-frame{transform:rotate(-62deg) scale(.86)}.avatar[data-age="1"].sleep .posture-frame{transform:none}.avatar[data-age="1"].sleep .rest-surface{display:none}.avatar.sleep .seat-support{display:none}.avatar.sleep .rest-surface{display:block}
.avatar[data-age="0"].cue-wriggle .swaddle{animation:cue-swaddle 2.8s ease-in-out infinite}
@keyframes cue-swaddle{0%,100%{transform:rotate(0)}30%{transform:translateX(2px) rotate(3deg)}70%{transform:translateX(-2px) rotate(-3deg)}}
/* view-box length origins use SVG user coordinates; keep the actual joint coordinates. */
.avatar .forearm,.avatar .hand,.avatar .foot{transform-box:view-box}.avatar .arm-left{transform-origin:115px 160px}.avatar .forearm-left{transform-origin:115px 190px}.avatar .hand-left{transform-origin:140px 222px}.avatar .foot-left{transform-origin:92px 248px}.avatar .foot-right{transform-origin:228px 247px}
.avatar .arm-right{transform-origin:205px 160px}.avatar .forearm-right{transform-origin:205px 190px}.avatar .hand-right{transform-origin:180px 222px}
.avatar.motion-wave .arm-right{opacity:1;animation:rig-wave-shoulder 3.6s ease-in-out 1}.avatar.motion-wave .forearm-right{animation:rig-wave-elbow 3.6s ease-in-out 1}.avatar.motion-wave .hand-right{animation:rig-wave-hand 3.6s ease-in-out 1}
@keyframes rig-wave-shoulder{0%,100%{transform:rotate(0)}22%,80%{transform:rotate(-125deg)}}@keyframes rig-wave-elbow{0%,100%{transform:rotate(0)}22%,80%{transform:rotate(-65deg)}}@keyframes rig-wave-hand{0%,100%{transform:rotate(0)}30%,60%{transform:rotate(12deg)}45%,75%{transform:rotate(-12deg)}}
.avatar.cue-hunger:not([data-age="0"]):not([data-age="1"]) .arm-left{animation:cue-feed-shoulder 3.4s ease-in-out infinite}.avatar.cue-hunger:not([data-age="0"]):not([data-age="1"]) .forearm-left{animation:cue-feed-elbow 3.4s ease-in-out infinite}.avatar.cue-hunger:not([data-age="0"]):not([data-age="1"]) .hand-left{animation:cue-feed-wrist 3.4s ease-in-out infinite}.avatar.cue-hunger .head{transform-origin:160px 149px;animation:cue-root 3.4s ease-in-out infinite}.avatar.cue-hunger .smile{opacity:0}.avatar.cue-hunger .surprise-mouth{opacity:1;animation:cue-mouth 2s ease-in-out infinite}
.avatar.cue-sleepy .smile{opacity:0}.avatar.cue-sleepy .surprise-mouth{opacity:1;transform-box:fill-box;transform-origin:center;animation:cue-yawn 4s ease-in-out infinite}.avatar.cue-sleepy .eyes{transform:scaleY(.65);transform-origin:160px 101px;transform-box:view-box}.avatar.cue-sleepy .head{animation:avatar-doze 4.6s ease-in-out infinite}
.avatar.cue-wriggle .body{transform-origin:160px 206px;animation:cue-wriggle 2.8s ease-in-out infinite}.avatar.cue-wriggle .head{transform-origin:160px 149px;animation:cue-unsettled-head 2.8s ease-in-out infinite}.avatar.cue-wriggle .leg-left{transform-origin:133px 218px;animation:cue-leg-left 2.8s ease-in-out infinite}.avatar.cue-wriggle .leg-right{transform-origin:185px 213px;animation:cue-leg-right 2.8s ease-in-out infinite}.avatar.cue-wriggle .foot-left{animation:cue-foot-left 2.8s ease-in-out infinite}.avatar.cue-wriggle .foot-right{animation:cue-foot-right 2.8s ease-in-out infinite}.avatar.cue-wriggle .arm-left{animation:cue-unsettled-arm 2.8s ease-in-out infinite}.avatar.cue-wriggle .forearm-left{animation:cue-unsettled-elbow 2.8s ease-in-out infinite}
.avatar.cue-wriggle .arm-right{animation:cue-unsettled-right 2.8s ease-in-out infinite}.avatar.cue-wriggle .forearm-right{animation:cue-unsettled-elbow-right 2.8s ease-in-out infinite}
@keyframes cue-unsettled-right{0%,100%{transform:rotate(0)}30%{transform:rotate(-8deg)}70%{transform:rotate(10deg)}}@keyframes cue-unsettled-elbow-right{0%,100%{transform:rotate(0)}30%{transform:rotate(-14deg)}70%{transform:rotate(10deg)}}
.avatar.cue-reach .head{animation:none}.avatar.cue-reach .arm-right{transform-origin:205px 161px;animation:avatar-reach 3.4s ease-in-out infinite}
.avatar.cue-away .head{animation:none;transform:rotate(13deg)}.avatar.cue-away .eyes{transform:translateX(3px)}
@keyframes cue-root{0%,100%{transform:rotate(0)}30%,65%{transform:rotate(-8deg)}}@keyframes cue-mouth{50%{transform:translateY(1px)}}@keyframes cue-yawn{0%,100%{transform:scale(.6)}40%,70%{transform:scale(1.4)}}@keyframes cue-wriggle{0%,100%{transform:rotate(0)}28%{transform:translateX(3px) rotate(5deg)}68%{transform:translateX(-3px) rotate(-5deg)}}
@keyframes cue-feed-shoulder{0%,8%,82%,100%{transform:rotate(0)}28%,58%{transform:rotate(-56deg)}}
@keyframes cue-feed-elbow{0%,8%,82%,100%{transform:rotate(0)}28%,58%{transform:rotate(-76deg)}}
@keyframes cue-feed-wrist{0%,100%{transform:rotate(0)}35%,53%{transform:rotate(9deg)}}
@keyframes cue-leg-left{0%,100%{transform:rotate(0)}25%{transform:rotate(-17deg)}52%{transform:rotate(6deg)}75%{transform:rotate(-9deg)}}
@keyframes cue-leg-right{0%,100%{transform:rotate(0)}25%{transform:rotate(-5deg)}52%{transform:rotate(17deg)}75%{transform:rotate(3deg)}}
@keyframes cue-foot-left{0%,100%{transform:rotate(0)}25%,70%{transform:rotate(13deg)}50%{transform:rotate(-9deg)}}
@keyframes cue-foot-right{0%,100%{transform:rotate(0)}35%,80%{transform:rotate(-13deg)}60%{transform:rotate(9deg)}}
@keyframes cue-unsettled-head{0%,100%{transform:rotate(0)}30%{transform:rotate(-5deg)}70%{transform:rotate(5deg)}}
@keyframes cue-unsettled-arm{0%,100%{transform:rotate(0)}30%{transform:rotate(-10deg)}70%{transform:rotate(8deg)}}
@keyframes cue-unsettled-elbow{0%,100%{transform:rotate(0)}30%{transform:rotate(-22deg)}70%{transform:rotate(-5deg)}}
.discovery-button{position:absolute;bottom:8px;right:10px;border:1px solid #bcdcd3;border-radius:12px;padding:7px 9px;background:#fffdf8;color:#285c5d;font:800 .76rem 'DM Sans',sans-serif;display:flex;align-items:center;gap:4px;min-height:38px;max-width:145px}.discovery-button svg{width:19px;height:19px;flex:none}.discovery-button .discovery-dot{width:7px;height:7px;background:#dd986f;border-radius:50%;flex:none}.stage:has(.discovery-button:not([hidden])){padding-bottom:48px}
.discovery-button{bottom:8px;max-width:95px;min-height:34px;padding:5px 7px}.stage:has(.discovery-button:not([hidden])){padding-bottom:32px}
.learning-view{position:fixed;inset:0;z-index:42;background:#eaf4f1;padding:max(12px,env(safe-area-inset-top)) 12px max(12px,env(safe-area-inset-bottom));display:flex;align-items:center;justify-content:center}.learning-page{width:min(620px,100%);height:min(740px,100%);min-height:0;display:flex;flex-direction:column;gap:12px;background:#fffdf8;border:1px solid #d9e7e4;border-radius:24px;padding:20px;overflow:hidden}.learning-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:none}.learning-heading small{font-weight:800;color:#47847b}.learning-page h2{font:900 1.5rem/1.15 'Nunito',sans-serif;margin:0}.learning-preview{flex:1;min-height:50px;max-height:230px;display:grid;place-items:center}.learning-preview .avatar{height:100%;max-height:230px;width:auto;max-width:100%;filter:none}.learning-observation{margin:0;font-size:1rem;line-height:1.4;flex:none}.learning-choices{display:grid;grid-template-columns:1fr;gap:8px;flex:none}.learning-choices button,.learning-next{min-height:44px;padding:11px 12px;border:1px solid #bbd8d2;border-radius:12px;font:800 .9rem 'DM Sans',sans-serif;background:#edf7f2;color:#245e5e;text-align:left}.learning-choices button:disabled{opacity:.55}.learning-next{background:#173e48;color:white;text-align:center;border:0}.learning-reply{display:flex;align-items:center;gap:10px;background:#edf7f2;padding:12px;border-radius:14px;flex:none}.learning-reply img{width:42px;height:46px;object-fit:contain;flex:none}.learning-reply p{margin:0;font-size:.92rem;line-height:1.4}.learning-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:none;font-size:.76rem}.learning-close{border:0;background:transparent;color:#356866;padding:8px;font:800 .8rem 'DM Sans',sans-serif}.learning-sources{display:flex;gap:12px}.learning-sources a{color:#356866}.learning-progress{font-weight:700;color:#577772}
.learning-preview>img{width:auto;max-width:100%;height:100%;max-height:210px;object-fit:contain}.learning-quick{min-height:40px;padding:9px;border:1px solid #c8dcd7;border-radius:12px;background:#fffdf8;color:#356866;font:700 .82rem 'DM Sans',sans-serif;flex:none}.learning-view[data-mode="visitor"] .learning-observation{font-size:1.05rem;line-height:1.55}.learning-view[data-mode="visitor"] .learning-next{margin-top:auto}.learning-view[data-mode="collection"] .learning-footer:first-of-type{margin-top:auto}
.guide-edge-example{flex:none}.guide-edge-example small{display:block;font-size:.76rem;color:#577772;margin-bottom:8px}.guide-edge-example>div{display:flex;gap:8px}.edge-example{flex:1;text-align:center;background:white;border:3px solid;border-radius:13px;padding:9px 3px;font-size:.76rem;font-weight:700}.edge-example.good{border-color:#5cb7a1}.edge-example.watch{border-color:#ddb33f}.edge-example.help{border-color:#de705b}
.memory-grid{display:grid;grid-template-columns:1fr;gap:8px;min-height:0}.memory-tile{text-align:left;border:1px solid #dbe7e2;border-radius:14px;padding:14px;background:#f3f6f2;color:#67827a;min-height:70px;display:flex;flex-direction:column;gap:5px;font-size:.9rem}.memory-tile span{font-size:.76rem;font-weight:400}.memory-tile.completed{background:#ecf7ef;color:#285c5d;border-color:#a6cbbf}.memory-nav{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:auto;flex:none;font-size:.8rem}.memory-nav button{min-height:40px;border:1px solid #c9ded5;background:white;color:#285c5d;border-radius:10px;padding:8px 14px}

/* All routine feedback shares a reserved row. It never floats over the game. */
.feedback-slot{height:38px;flex:none;display:flex;align-items:center;min-width:0}.feedback-slot .reward-pop,.feedback-slot .milestone,.feedback-slot .toast,.menu-feedback .toast{position:static;inset:auto;transform:none!important;width:100%;max-width:none;min-height:30px;margin:0;padding:4px 8px;border:0;border-radius:9px;background:#edf7ef;box-shadow:none;font:.8rem/1.25 'DM Sans',sans-serif;color:#285f57;white-space:normal;opacity:1;animation:none!important;display:flex;align-items:center;gap:7px;text-align:left}
.feedback-slot .reward-pop img{width:23px;height:26px;object-fit:contain}.feedback-slot .reward-copy{display:block;min-width:0}.feedback-slot .reward-copy small{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%)}.feedback-slot .popup-close{position:static;flex:none;margin-left:auto;width:24px;height:24px;padding:0;color:#50766b;background:transparent;line-height:1}.feedback-slot .milestone{background:#fff3d6;font-weight:800}.feedback-slot .milestone span{display:none}.feedback-slot .toast,.menu-feedback .toast{display:none;background:#f2f6f3;pointer-events:auto}.feedback-slot .toast.show,.menu-feedback .toast.show{display:block}.feedback-slot .toast:not(.show){display:none}
.menu-feedback:empty{display:none}.menu-feedback{flex:none;margin-top:4px}.menu-feedback .toast{font-size:.78rem}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.doctor-letter{animation:none;filter:none}.doctor-letter .letter-dot{top:-1px;right:-1px;width:21px;height:21px;display:grid;place-items:center;background:#e9b65f;color:#173e48;border:2px solid #fffdf8;box-shadow:0 0 0 1px #d9c193;font:900 .9rem/1 'Nunito',sans-serif}.doctor-letter.has-unread .letter-dot{animation:mail-badge 2.8s ease-in-out infinite}.doctor-letter.has-unread .letter-closed{animation:mail-reminder 8s ease-in-out infinite;transform-origin:50% 55%}.doctor-letter.letter-arriving{animation:mail-entry 1.5s ease-out both}.doctor-letter.letter-read{opacity:1}
@keyframes mail-entry{0%{opacity:0;transform:translate(26px,-10px) rotate(14deg) scale(.6)}40%{opacity:1;transform:translate(-4px,2px) rotate(-6deg) scale(1.08)}70%,100%{opacity:1;transform:none}}@keyframes mail-badge{0%,100%{box-shadow:0 0 0 1px #d9c193;transform:scale(1)}50%{box-shadow:0 0 0 4px #e9b65f33;transform:scale(1.07)}}@keyframes mail-reminder{0%,8%,100%{transform:rotate(0)}2%,6%{transform:rotate(-7deg)}4%{transform:rotate(7deg)}}
.stage .baby-scene{flex:1;min-height:0;max-height:275px;width:min(100%,290px);display:grid;place-items:center}.stage .baby-touch,.stage .avatar{width:100%;height:100%;max-height:100%;min-height:0}.stage .baby-name,.stage .status{flex:none}.avatar.motion-crawl .seat-support,.avatar.motion-crawl .rest-surface{display:none}
.action{position:relative}.action.care-hit:after{content:'♡';position:absolute;font-size:1.8rem;color:#6ea98b;pointer-events:none;top:12px;left:calc(50% - 12px);animation:care-heart 1.1s ease-out both}@keyframes care-heart{0%{opacity:0;transform:translateY(8px) scale(.6)}25%{opacity:1;transform:translateY(-3px) scale(1)}100%{opacity:0;transform:translateY(-25px) scale(1.15)}}
@media(max-height:660px){.feedback-slot{height:36px}.feedback-slot .reward-pop,.feedback-slot .milestone,.feedback-slot .toast{font-size:.73rem;padding:2px 6px}.learning-preview{min-height:32px}.learning-page{gap:7px}.learning-view[data-mode="visitor"] .learning-observation{font-size:.94rem;line-height:1.4}.learning-preview>img{max-height:120px}.memory-tile{min-height:60px;padding:10px}.learning-quick{min-height:36px;padding:7px}}
@media(max-height:500px){.learning-page{gap:6px;padding:10px}.learning-preview{max-height:68px;min-height:16px}.learning-preview>img{max-height:68px}.learning-page h2{font-size:1.15rem}.learning-heading small{font-size:.7rem}.learning-observation{font-size:.85rem;line-height:1.3}.learning-choices button,.learning-next{padding:6px 9px;min-height:36px;font-size:.8rem}.learning-reply p{font-size:.82rem;line-height:1.3}.learning-reply{padding:8px}.learning-footer{font-size:.67rem}.memory-tile{min-height:50px;padding:8px}.memory-grid{gap:5px}}
@media(prefers-reduced-motion:reduce){.avatar .swaddle,.avatar .forearm-right,.avatar .hand-right,.avatar.cue-wriggle .arm-right{animation:none!important}.action.care-hit:after{animation:none;display:none}.feedback-slot .reward-pop{opacity:1;transform:none}.avatar.motion-wave .arm-right{transform:rotate(-125deg);animation:none!important}.avatar.motion-wave .forearm-right{transform:rotate(-65deg)}}
@media(prefers-reduced-motion:reduce){.doctor-letter.letter-arriving,.doctor-letter.has-unread .letter-dot,.doctor-letter.has-unread .letter-closed{animation:none!important;transform:none;opacity:1}}
@media(max-height:660px){.learning-page{padding:13px;gap:8px}.learning-preview{max-height:125px}.learning-preview .avatar{max-height:125px}.learning-page h2{font-size:1.25rem}.learning-observation{font-size:.9rem}.learning-reply{padding:9px}.learning-reply p{font-size:.84rem}.learning-choices button{padding:8px 10px}.learning-footer{font-size:.7rem}.learning-heading .pause-label{font-size:.65rem}}
@media(max-width:380px){.learning-page{padding:12px}.learning-heading small{font-size:.74rem}.learning-choices button{font-size:.83rem}.discovery-button{font-size:.7rem;max-width:128px}}
@media(prefers-reduced-motion:reduce){.avatar.cue-hunger .head,.avatar.cue-hunger .surprise-mouth,.avatar.cue-sleepy .surprise-mouth,.avatar.cue-sleepy .head,.avatar.cue-wriggle .body,.avatar.cue-wriggle .leg-right,.avatar.cue-wriggle .leg-left,.avatar.cue-wriggle .head,.avatar.cue-wriggle .arm-left,.avatar.cue-wriggle .forearm-left,.avatar.cue-wriggle .foot,.avatar.cue-hunger .arm-left,.avatar.cue-hunger .forearm-left,.avatar.cue-hunger .hand-left,.avatar.cue-reach .arm-right{animation:none!important}}

@media(max-width:610px) and (max-height:650px){.stage:has(.discovery-button:not([hidden])) .baby-touch,.stage:has(.discovery-button:not([hidden])) .avatar{height:clamp(80px,18dvh,125px);width:clamp(95px,20dvh,145px)}.stage:has(.discovery-button:not([hidden])){padding-bottom:43px}.stage:has(.discovery-button:not([hidden])) .status{max-width:95%;font-size:.8rem}}

@media(prefers-reduced-motion:reduce){.avatar.cue-hunger:not([data-age="0"]):not([data-age="1"]) .arm-left{transform:rotate(-56deg)}.avatar.cue-hunger:not([data-age="0"]):not([data-age="1"]) .forearm-left{transform:rotate(-76deg)}.avatar.cue-wriggle .leg-left{transform:rotate(-12deg)}.avatar.cue-wriggle .leg-right{transform:rotate(12deg)}}

@media(max-height:540px){.learning-view[data-mode="visitor"] .learning-preview{display:none}.guide-edge-example small{font-size:.7rem}.edge-example{padding:6px 2px;font-size:.7rem}}

/* One hand, two expressions: relaxed for care, open palm for a wave. */
.avatar .hand-open{display:none}.avatar.motion-wave .hand-right .hand-rest{display:none}.avatar.motion-wave .hand-right .hand-open{display:inline}

/* The illustration fills its grid cell; the SVG scales inside that cell. */
.welcome-art{overflow:hidden}.welcome-art .avatar{width:min(90%,310px);height:100%;max-height:350px;min-height:0;object-fit:contain}@media(max-width:610px){.welcome-art .avatar{width:min(90%,200px);height:100%;max-height:100%}}
/* Sleeping babies lie on their backs; never rotate the seated leg geometry. */
/* Bath and sleep share the same back-lying legs and relaxed joints. */
.avatar:is(.sleep:not([data-age="0"]),.bath-lying) .posture-frame{transform:none}
.avatar.sleep:not([data-age="0"]) .infant-mat{display:block}
.avatar:is(.sleep:not([data-age="0"]),.bath-lying) :is(.lying-leg,.lying-foot){display:block}
.avatar:is(.sleep,.bath-lying) :is(.sitting-leg,.sitting-foot,.sit-shadow,.seat-support),.avatar.sleep:not([data-age="0"]) .rest-surface{display:none}
.avatar:is(.sleep,.bath-lying) :is(.leg,.foot,.arm){animation:none;transform:none}
.avatar.sleep,.baby-touch:hover .avatar.sleep{filter:none}

/* Return stays at the top; memories use only the space left below it. */
.learning-heading{display:grid;grid-template-columns:minmax(0,1fr) auto;row-gap:4px}.learning-heading>small{grid-column:1;grid-row:1}.learning-heading>.pause-label{grid-column:1;grid-row:2;justify-self:start}.learning-heading>.learning-close{grid-column:2;grid-row:1 / 3;min-height:44px;padding:8px 13px;border:1px solid #bbd8d2;border-radius:11px;background:#edf7f2;color:#245e5e;align-self:center;font-weight:800}.learning-page>h2{flex:none}.learning-view[data-mode="collection"] .memory-grid{flex:1;min-height:0;overflow:hidden;align-content:start;grid-auto-rows:max-content}.learning-view[data-mode="collection"] .memory-nav{margin-top:0}.learning-view[data-mode="collection"] .learning-footer{margin-top:0}

/* Small discoveries fall as confetti; a new age floats up as balloons. */
.celebration[data-kind="balloons"]{z-index:24}.celebration .balloon{top:auto;bottom:-140px;width:40px;height:51px;border-radius:50% 50% 46% 46%;background:var(--color);border:1px solid #ffffff80;animation:balloon-rise 5s ease-out forwards;animation-delay:var(--delay)}.celebration .balloon:after{content:'';position:absolute;left:16px;bottom:-5px;width:8px;height:7px;background:var(--color);clip-path:polygon(50% 0,100% 100%,0 100%)}.celebration .balloon:before{content:'';position:absolute;left:19px;top:55px;width:12px;height:48px;border-left:1px solid #638b8066;border-radius:50%}
@keyframes balloon-rise{0%{transform:translateY(0) rotate(-4deg);opacity:0}12%{opacity:1}88%{opacity:1}100%{transform:translate(var(--drift),calc(-100dvh - 150px)) rotate(6deg);opacity:0}}

/* Milestones belong above baby, directly on the scene rather than in a bubble. */
.stage>.milestone{position:absolute;top:56px;left:50%;transform:translateX(-50%);z-index:6;display:block;width:calc(100% - 136px);max-width:370px;min-height:0;margin:0;padding:0 12px;border:0;border-radius:0;background:transparent;box-shadow:none;color:#285f57;text-align:center;opacity:1;font:900 clamp(1.3rem,3.4vw,1.8rem)/1.16 'Nunito',sans-serif;text-shadow:0 1px 2px #fffdf8,0 2px 7px #fffdf8cc;cursor:pointer}.stage>.milestone #milestoneText{display:none}.stage>.milestone .popup-close{position:absolute;top:-8px;right:-14px;width:32px;height:32px;padding:0;color:#527a71;background:transparent;border:0;font-size:1.1rem}.celebration[data-kind="burst"] span{animation:confetti-burst 5.5s linear forwards;animation-delay:var(--delay)}
@keyframes confetti-burst{0%{opacity:0;transform:translate(0,0) scale(.4);animation-timing-function:cubic-bezier(.333,.666,.666,1)}8%{opacity:1}28%{opacity:1;transform:translate(calc(var(--burst-x) * .35),var(--burst-y)) rotate(100deg);animation-timing-function:cubic-bezier(.333,0,.666,.333)}100%{opacity:0;transform:translate(calc(var(--burst-x) * 1.25),var(--burst-floor)) rotate(var(--turn))}}
@media(max-width:610px){.stage>.milestone{top:53px;width:calc(100% - 118px)}}
/* Self-paced visits stay in the baby scene, emerging behind care. */
.stage:has(#nurseScene:not([hidden])){overflow:visible}
#nurseScene{position:absolute;inset:auto 8px 0;z-index:12;display:flex;align-items:end;gap:8px;animation:nurse-enter .5s ease-out}
#nurseScene[hidden],#gameOutcome[hidden]{display:none}
#nurseScene>img{width:clamp(75px,19vw,120px);height:140px;object-fit:contain;object-position:bottom;flex:none;transform:translateY(18px)}
#nurseBubble{align-self:center;text-align:left;border:1px solid #c3ddd6;border-radius:18px 18px 18px 3px;background:#fffdf6;color:#173e48;padding:11px 13px;max-width:340px;min-width:0;box-shadow:0 3px 12px #173e4810;margin-bottom:16px;font:inherit;cursor:pointer}
#nurseBubble small,#nurseBubble span,#nurseBubble em{display:block}#nurseBubble small{font-size:.7rem;color:#54716e}#nurseBubble span{font-size:.9rem;line-height:1.4;margin:5px 0}#nurseBubble em{font-size:.7rem;font-style:normal;color:#54716e}
@keyframes nurse-enter{from{opacity:0}to{opacity:1}}
.avatar.refusing .head{animation:refuse-head .42s ease-in-out 5!important;transform-origin:200px 138px}.avatar.refusing .arm-right{animation:refuse-arm .6s ease-in-out 3!important}@keyframes refuse-head{0%,100%{transform:rotate(-7deg)}50%{transform:rotate(7deg)}}@keyframes refuse-arm{50%{transform:rotate(-12deg)}}
#gameOutcome{position:absolute;inset:35px 15px 10px;z-index:16;background:#fffdf6eF;border:1px solid #c3ddd6;border-radius:18px;padding:18px;text-align:center;display:flex;flex-direction:column;justify-content:center;gap:10px}#gameOutcome p{font-size:.9rem;margin:0;line-height:1.4}#gameOutcome button{min-height:44px;border:0;border-radius:12px;background:#173e48;color:white;font:inherit}
@media(max-height:550px){#nurseScene>img{height:100px;width:65px}#nurseBubble{padding:8px;max-width:360px}#nurseBubble span{font-size:.78rem;line-height:1.25}#gameOutcome{padding:10px;inset:10px}#gameOutcome p{font-size:.75rem}}
@media(prefers-reduced-motion:reduce){#nurseScene,.avatar.refusing .head,.avatar.refusing .arm-right{animation:none!important}}

.stage>.milestone #milestoneTitle{font:inherit}
.baby-scene .sleep-z{left:65%;top:30%;z-index:3;font-size:.9rem;gap:2px;line-height:1;transform:translateY(-4px)}
.thermometer-trigger{position:absolute;bottom:12px;right:12px;z-index:8;width:46px;height:46px;border:1px solid #bbd8d2;border-radius:50%;background:#fffdf5dd;display:grid;place-items:center;cursor:pointer;padding:7px}.thermometer-trigger svg{width:30px;height:30px;position:relative;z-index:1}.thermometer-trigger[hidden]{display:none}.thermometer-trigger:disabled{opacity:.55}.health-dial{display:none;position:absolute;inset:-3px;border-radius:50%;background:conic-gradient(#df8572 var(--health-progress),#dae9e3 0);mask:radial-gradient(circle,transparent 63%,#000 64%)}.fever-known .health-dial{display:block}.health-treated .health-dial{background:conic-gradient(#68b7a0 var(--health-progress),#dae9e3 0)}
.health-modal{position:fixed;inset:0;z-index:34;display:grid;place-items:center;padding:14px;background:#14383f66;backdrop-filter:blur(3px)}.health-modal[hidden]{display:none}.health-card{width:min(100%,410px);max-height:calc(100dvh - 28px);display:flex;flex-direction:column;gap:12px;background:#fffdf6;border:1px solid #d9e7e4;border-radius:22px;padding:20px;color:#173e48}.health-top{display:flex;justify-content:space-between;align-items:center;font-size:.75rem;color:#5b7b76}.health-top button{width:40px;height:40px;border:0;background:transparent;color:#386e70;font:1.5rem inherit}.health-card h2{font:900 1.35rem 'Nunito',sans-serif;margin:0}.health-card p{margin:0;font-size:.93rem;line-height:1.45}.health-card #healthTemperature{font:900 1.55rem 'Nunito',sans-serif}.health-card .health-note,.health-card a{font-size:.76rem;line-height:1.35;color:#557671}.health-card>img{width:70px;height:70px;object-fit:contain;align-self:center}.health-buttons{display:flex;flex-direction:column;gap:8px}.health-buttons button{min-height:44px;border:1px solid #bbd8d2;border-radius:12px;background:#edf7f2;color:#245e5e;font:800 .9rem 'DM Sans',sans-serif;padding:9px}.health-buttons #healthDoctor,.health-buttons #healthFinish{background:#173e48;color:white;border:0}.health-buttons button[hidden],.health-card img[hidden]{display:none}
@media(max-height:570px){.health-card{padding:12px;gap:7px;max-width:480px}.health-card>img{width:42px;height:42px}.health-card p{font-size:.8rem;line-height:1.3}.health-card h2{font-size:1.1rem}.health-card #healthTemperature{font-size:1.2rem}.health-buttons{flex-direction:row}.health-buttons button{flex:1;font-size:.8rem}.health-card .health-note,.health-card a{font-size:.67rem}}

.thermometer-trigger.catchup-ready{border-color:#6aad96;box-shadow:0 0 0 3px #a9dcd14d}.thermometer-trigger.catchup-ready:after{content:'+';position:absolute;right:-3px;top:-3px;border-radius:50%;width:18px;height:18px;display:grid;place-items:center;background:#386e70;color:#fffdf6;font:bold 15px 'DM Sans',sans-serif}

/* Memories live in Menu; the status slot hosts short milestone celebrations. */
.stage>.milestone{position:relative;top:auto;left:auto;transform:none;width:calc(100% - 116px);max-width:460px;margin:4px auto;min-height:38px;padding:0 26px;animation:milestone-status .6s ease-out;font:900 clamp(1.08rem,3.8vw,1.55rem)/1.18 'Nunito',sans-serif;color:#173e48;text-shadow:0 1px 3px #fffdf8,0 0 12px #f5c96f88}
.stage>.milestone .popup-close{top:0;right:0;color:#173e48;background:#fffdf899;font-size:1.35rem}.stage>.milestone[hidden]{display:none}.celebration[data-kind="confetti"] span{animation-duration:5.5s}
@keyframes milestone-status{0%{opacity:0;transform:scale(.85)}60%{transform:scale(1.06)}100%{opacity:1;transform:scale(1)}}
#healthClose{flex:none;width:44px;height:44px;border:1px solid #96bdb4;border-radius:12px;background:#e1efe9;color:#173e48;font-family:'DM Sans',sans-serif;font-size:2rem;font-weight:700;line-height:1}#healthClose:hover{background:#cce3da}#healthClose:focus-visible{outline:3px solid #173e48;outline-offset:2px}
@media(prefers-reduced-motion:reduce){.stage>.milestone{animation:none}}

/* Reserve the full message height while its visible copy is typed. */
#nurseBubble .nurse-copy{display:grid}#nurseBubble .nurse-copy span{grid-area:1 / 1;min-width:0}#nurseBubble .nurse-full{visibility:hidden}#nurseBubble .nurse-typed{white-space:pre-wrap}

/* The full message fixes bubble geometry; typing only paints inside that space. */
#nurseBubble{contain:layout style}#nurseBubble .nurse-copy{display:block;position:relative;margin:5px 0}#nurseBubble .nurse-copy span{margin:0}#nurseBubble .nurse-typed{position:absolute;inset:0}#nurseScene{will-change:transform}

/* Keep visit content inside the scene; focusing a moving element must not scroll the game. */
#nurseScene{inset:8px;display:grid;grid-template-columns:clamp(60px,18vw,104px) minmax(0,1fr);align-items:end;pointer-events:none;animation:nurse-enter .22s ease-out;will-change:opacity}#nurseScene>img{width:100%;height:auto;max-height:140px;object-fit:contain;transform:none;align-self:end}#nurseBubble{width:100%;max-width:420px;max-height:100%;margin:0;align-self:end;justify-self:start;overflow:auto;overscroll-behavior:contain;pointer-events:auto;scrollbar-width:thin}@media(max-height:550px){#nurseScene{gap:6px;grid-template-columns:58px minmax(0,1fr)}#nurseScene>img{max-height:94px}#nurseBubble{padding:7px 9px}}

/* On wider screens the avatar fills the room left above the controls. */
@media(min-width:611px){.stage .baby-scene{width:100%;max-height:none}}
