/* Child guidance: preserve the familiar room controls and supply positions. */
#galleryModal{padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))}
#galleryCard{padding:0 18px 18px;width:min(860px,calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right) - 24px));max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 20px);overscroll-behavior:contain}
.child-book-header{position:sticky;top:0;z-index:4;display:flex;align-items:center;gap:12px;padding:10px 0;background:#fff4df;border-bottom:2px solid #dfc49d}
#galleryCard .child-book-header h2{margin:0;font-size:clamp(18px,3vw,28px);flex:1}
#galleryClose{margin:0;min-height:52px;flex:0 0 auto;padding:8px 15px;font-size:clamp(15px,2.5vw,20px);display:flex;align-items:center;gap:9px}
#galleryClose>span{font-size:30px;line-height:1}
.child-book-tabs{position:sticky;top:74px;z-index:3;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;background:#fff4df;padding:8px 0 12px}
.child-book-tabs button{min-height:66px;border:2px solid #d6bb90;border-radius:16px;background:#fff9ef;color:#304a65;font:inherit;font-size:14px;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px}
.child-book-tabs .child-picture{width:30px;height:30px;flex:0 0 auto}
.child-book-tabs button[aria-selected="true"]{background:#f9dfaa;border-color:#d88340;box-shadow:inset 0 0 0 2px #fff4d5}
.child-book-page[hidden]{display:none!important}
.child-book-page{padding-top:10px}
#adventureGrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.child-adventure{position:relative;display:grid;grid-template-columns:minmax(84px,32%) minmax(0,1fr);padding:0;border:3px solid #d8bc8e;border-radius:20px;overflow:hidden;min-height:156px;background:#fff8e6;color:#304a65;text-align:left;font:inherit;cursor:pointer;box-shadow:0 4px 0 #d0af7b}
.child-adventure .adventureScene{min-height:100%;border-right-color:#ddc49c}
.child-adventure-copy{display:flex;flex-direction:column;gap:8px;justify-content:center;padding:12px}
.child-adventure-copy>strong{font-size:clamp(16px,2.3vw,22px);line-height:1.05}
.child-adventure.won{border-color:#b59a46;background:#fff1c9}
.child-adventure.active{outline:3px solid #e78c47;outline-offset:1px}
.child-adventure-play{font-size:16px;background:#f2d193;border-radius:18px;padding:6px 12px;align-self:flex-start}
.child-book-steps{display:flex;align-items:center;flex-wrap:wrap;gap:2px}
.child-step{position:relative;display:inline-flex;align-items:center;justify-content:center;border:2px solid #d2b78f;border-radius:11px;background:#fff7e3;color:#304a65;min-width:30px;min-height:30px;padding:2px;font-size:19px;white-space:nowrap}
.child-step .child-picture{width:29px;height:29px;display:block}
.child-step.is-done{background:#f7dda0;border-color:#9aab60}
.child-step b{position:absolute;right:-4px;bottom:-5px;width:14px;height:14px;line-height:14px;font-size:11px;border-radius:50%;background:#3a7d59;color:#fff;text-align:center}
.child-step-arrow{color:#b38245;font-size:18px}
#adventureCard .child-mission-steps{display:flex;gap:2px;align-items:center}
#adventureCard .child-step{font-size:16px;min-height:29px;min-width:29px}
#adventureCard .child-step .child-picture{width:25px;height:25px}
#adventureCard .adventureCopy small{white-space:normal;line-height:1.1}
#adventureCard{width:min(660px,var(--child-header-width,calc(92vw - 288px)))}
.child-earned-stamps{display:grid;grid-template-columns:repeat(auto-fit,minmax(128px,1fr));gap:12px;margin-top:18px}
.child-stamp{border:2px solid #d7b889;border-radius:20px;background:#fff6dc;color:#304a65;padding:12px;font:inherit;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:8px}
.child-stamp>svg{width:100%;max-width:140px;height:110px}.child-stamp>span{font-size:54px}.child-stamp strong{font-size:14px}
.child-badge{position:relative}.child-badge.locked>svg{filter:grayscale(.8);opacity:.47}.child-stamp>.child-badge-lock{font-size:25px;position:absolute;right:9px;top:9px;color:#8f7854}
#photoGrid{grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:14px}
.child-photo-card{position:relative;padding:8px 8px 52px;background:#fffdf4;border-radius:15px;box-shadow:0 4px 9px #77553330}
.child-photo-open{display:block;border:0;padding:0;background:transparent;width:100%;cursor:pointer;border-radius:8px}
.child-photo-open img{display:block;width:100%;border-radius:8px}
.child-photo-favorite{position:absolute;bottom:4px;right:10px;min-width:48px;min-height:44px;font-size:33px;line-height:1;border:0;border-radius:50%;color:#b76941;background:#fff2da;cursor:pointer}
.child-photo-favorite[aria-pressed="true"]{color:#bf593e;background:#ffe1bd}
.child-photo-card.expanded{grid-column:1/-1}
.child-maintenance-row{display:flex;align-items:center;gap:15px;padding:12px 0;border-bottom:1px solid #d8bc91}
.child-maintenance-row img{width:110px;max-width:30%;border-radius:8px}
.child-adult-action,#childPortraitHome{min-height:48px;padding:10px 18px;border:2px solid #fff5df;border-radius:18px;background:#3a536d;color:#fff6df;font:inherit;cursor:pointer}
.child-adult-action:disabled{opacity:.45;cursor:default}
#childStorageNotices p{margin:10px 0;padding:12px;border-radius:14px;background:#fff0be;color:#735127}
#child-page-adult h3{margin:10px 0;color:#304a65}
#childPortraitHome{display:block;margin:20px auto 0;font-size:24px;min-width:160px}
#insideHint{pointer-events:auto;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:12px}
.child-firefly-count{display:flex;align-items:center;gap:9px;flex:0 0 auto}
.child-inside-action{display:flex;align-items:center;flex:0 0 auto;border-radius:10px;background:#ffe6ad;padding:3px}.child-inside-action svg{width:32px;height:32px}
.child-firefly{width:36px;height:40px;display:block;opacity:.53}
.child-firefly svg{width:100%;height:100%;fill:#f8ebcd;stroke:#3a526b;stroke-width:2.4}
.child-firefly.caught{opacity:1;filter:drop-shadow(0 0 5px #edb839)}
.child-firefly.caught .child-firefly-body{fill:#ffd36b}
.child-inside-copy{max-width:300px;font-size:16px;line-height:1.1}
.child-destination{fill:#ffe09a;fill-opacity:.10;stroke:#fff0a9;stroke-width:9;stroke-dasharray:12 10;filter:drop-shadow(0 0 10px #ffce69)}
.child-roof-destination{fill:#c7e6d6;stroke:#e1ffe8;stroke-width:6;stroke-dasharray:5 7}
.child-selected-picture>circle{fill:#fff5dc;stroke:#e1b976;stroke-width:5;filter:drop-shadow(0 5px 6px #60402044)}
#childPlacement:focus-visible{outline:none}#childPlacement:focus-visible>circle{stroke:#e98342;stroke-width:9}
.child-next{filter:drop-shadow(0 0 9px #ffd166)}
@media(max-height:460px) and (orientation:landscape){
  #galleryCard{padding:0 12px 12px}
  .child-book-header{padding:6px 0;gap:10px}#galleryClose{min-height:44px;padding:5px 12px;font-size:15px}
  .child-book-tabs{top:58px;padding:5px 0 8px;gap:6px}.child-book-tabs button{min-height:46px;flex-direction:row;gap:7px;font-size:13px}.child-book-tabs .child-picture{width:26px;height:26px}
  .child-adventure{min-height:142px}.child-adventure-copy{padding:9px;gap:7px}
  #adventureCard{width:min(490px,var(--child-header-width,calc(100vw - 285px)));max-width:var(--child-header-width,calc(100vw - 285px));gap:6px;padding:5px 8px}
  #adventureCard .adventureMoon{width:32px;height:32px;font-size:20px}
  #adventureCard .adventureCopy strong{font-size:11px}#adventureCard .adventureCopy small{font-size:10px}
  #adventureCard .child-step{font-size:14px;min-width:23px;min-height:27px;padding:1px}
  #adventureCard .child-step .child-picture{width:23px;height:23px}
  #adventureCard .child-step-arrow{font-size:14px}
  .child-firefly{width:29px;height:34px}.child-firefly-count{gap:6px}.child-inside-copy{font-size:13px;max-width:200px}#insideHint{gap:9px}
}
@media(max-width:620px){#adventureGrid{grid-template-columns:1fr}.child-book-tabs button{font-size:12px}.child-book-header{gap:6px}#galleryCard .child-book-header h2{font-size:18px}}
@media(max-width:700px) and (orientation:landscape){#adventureCard .adventureCopy{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}#adventureCard .child-mission-steps{justify-content:center;flex:1}.child-inside-copy{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}}
@media(prefers-reduced-motion:reduce){.child-next,.child-firefly.caught,.child-destination{filter:none}.child-destination{stroke-dasharray:none}}
#coachIcon .child-picture{display:block;width:38px;height:38px}
#adventureCard .child-current-action{min-width:42px;min-height:40px;border-width:2px;background:#fff5d8}
#adventureCard .child-current-action .child-picture{width:35px;height:35px}
#childToyBasket[hidden],#childToyTray[hidden],.child-toy-hidden{display:none!important}
#childToyBasket{position:fixed;z-index:23}
#childToyTray{position:fixed;z-index:22;box-sizing:border-box;border:3px solid #dfb67b;border-radius:22px;background:#fff5df;box-shadow:0 8px 24px #60402044;padding:6px 12px;text-align:center;pointer-events:auto;color:#304a65;font-size:16px}
#childPutToysAway{position:absolute;bottom:5px;left:50%;transform:translateX(-50%);min-height:44px;border:2px solid #e1bb7d;border-radius:16px;padding:5px 16px;background:#f9dfaa;color:#304a65;font:inherit;white-space:nowrap;pointer-events:auto;cursor:pointer}
.child-calmer #btnDart,.child-calmer #btnBalloon,.child-calmer #btnDayNight,.child-calmer #btnDance{z-index:23}
#childCalmerSettings{margin-top:12px}
#childCalmerSettings h3{margin:0 0 7px;color:#304a65;font-size:18px}
#settingsCalmerControls{width:100%}
#settingsCalmerControls .child-picture{width:32px;height:32px}
#childKeepsakeTools{margin-top:18px;padding-top:10px;border-top:2px solid #dfc49d}#childKeepsakeTools p{line-height:1.4}#childKeepsakeTools .child-adult-action{margin:4px 8px 4px 0}
#childPreviousRoom[hidden]{display:none!important}#childPreviousRoom{position:fixed;width:88px;height:64px;border-radius:16px;z-index:21;padding:3px;overflow:hidden;background:#fff4df}#childPreviousRoom img{width:100%;height:100%;object-fit:contain;border-radius:10px}#childPreviousRoom span{position:absolute;left:3px;bottom:0;font-size:24px;line-height:1;color:#304a65;background:#fff4df;border-radius:50%;padding:2px}
.child-room-ready{font-size:13px;color:#376a4a}.child-story-detail{font-size:13px!important;color:#665439}.child-photo-story{padding:8px 4px 2px;color:#304a65;font-size:15px;line-height:1.2}.child-photo-story small{display:block;margin-top:5px;font-size:12px;color:#6b5d48}
@media(max-height:460px) and (orientation:landscape){#childCalmerSettings{margin-top:8px}#childCalmerSettings h3{font-size:16px;margin-bottom:4px}#coachIcon .child-picture{width:30px;height:30px}#adventureCard .child-current-action{min-width:34px;min-height:32px}#adventureCard .child-current-action .child-picture{width:29px;height:29px}}
