:root{color-scheme:light;--paper:#f7f3e9;--ink:#344c3e;--muted:#82907c;--green:#58775b;--line:#e5e6d7;--coral:#d9876c;--soft:#eaf0df;--font:"Microsoft YaHei","PingFang SC","Noto Sans CJK SC",sans-serif}
*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font-family:var(--font);-webkit-tap-highlight-color:transparent}button,a,input{touch-action:manipulation}button{font:inherit;color:inherit;cursor:pointer}button{border:0}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #557b62;outline-offset:5px}button:disabled{cursor:default}svg{height:24px;width:24px;fill:currentColor;flex-shrink:0}.stroke{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.symbol-bank{position:absolute;width:0;height:0;overflow:hidden}.world{min-height:100svh;position:relative;overflow:hidden;background:radial-gradient(ellipse at 0 48%,#e8edda80 0,transparent 42%),radial-gradient(ellipse at 100% 60%,#efe4cb70 0,transparent 38%)}.world:before,.world:after{content:"";position:absolute;z-index:0;border:1px solid #dee5cc;pointer-events:none;width:420px;height:620px;border-radius:100% 0 100% 0;transform:rotate(18deg);left:-340px;top:220px}.world:after{left:auto;right:-340px;top:300px;transform:rotate(-162deg)}.topbar{position:relative;z-index:1;max-width:1200px;margin:auto;min-height:82px;padding:16px 36px;display:flex;align-items:center;justify-content:space-between;gap:16px}.brand{display:flex;align-items:center;gap:10px;font-size:14px;letter-spacing:2px;font-weight:600;text-decoration:none;color:var(--ink)}.brand-mark{width:36px;height:36px;background:#e4ead7;border-radius:12px;display:grid;place-items:center;color:#64825e}.brand-mark svg{width:26px;height:26px}.top-actions{display:flex;align-items:center;gap:12px}.sound-button{height:42px;display:flex;align-items:center;gap:8px;background:#fff9;border:1px solid var(--line);border-radius:25px;padding:0 14px;font-size:12px}.sound-button svg{width:18px;height:18px}.sound-button.muted{color:#99958a}.parent-button{min-height:44px;padding:8px;background:transparent;font-size:12px;color:#75826e}main{max-width:930px;position:relative;z-index:1;margin:0 auto;padding:9px 28px 0}.intro{text-align:center;margin:8px 0 28px}.eyebrow{font-size:11px;letter-spacing:2.5px;color:#7e8b72;display:flex;align-items:center;justify-content:center;gap:12px}.eyebrow span{width:28px;height:1px;background:#c5ccb7}h1{margin:14px 0 11px;font-size:38px;letter-spacing:7px;font-weight:600;display:flex;align-items:center;justify-content:center;gap:12px}h1 svg{color:#cc987f;width:23px;height:23px;transform:rotate(12deg)}.intro p{font-size:14px;letter-spacing:2px;margin:0;color:#87907c}.storybook{padding:0 14px;background:#fffdf7;border:1px solid #e5dfd0;border-radius:22px;box-shadow:0 15px 45px #5a573d0b,0 3px 0 #eeeadf;overflow:hidden}.book-topline{display:flex;align-items:center;justify-content:space-between;min-height:48px;padding:0 8px;gap:12px}.scene-marker{display:flex;align-items:center;gap:7px;font-size:13px;color:#627658}.scene-marker svg{height:16px;width:16px}.book-note{font-size:11px;color:#989784;letter-spacing:1px}.scene{isolation:isolate;width:100%;display:block;position:relative;aspect-ratio:960/464;overflow:hidden;border-radius:12px;background:#e4e6cd;padding:0;touch-action:manipulation;user-select:none;-webkit-user-select:none}.scene-image,.scene-video{display:block;width:100%;height:100%;object-fit:cover;position:absolute;inset:0;pointer-events:none}.scene-video{opacity:0}.scene.playing .scene-video{opacity:1}.scene-vignette{position:absolute;inset:0;pointer-events:none;box-shadow:inset 0 0 24px #3b47350b}.touch-invitation{position:absolute;bottom:18px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:7px;white-space:nowrap;background:#fffcf2ed;color:#66744e;font-size:13px;padding:10px 17px;border:1px solid #fffc;box-shadow:0 3px 12px #34421b16;border-radius:30px;transition:opacity .25s}.touch-invitation svg{width:16px;height:16px;color:#c88a6e}.scene.hugging .touch-invitation{opacity:0}.hug-bubble{position:absolute;top:14%;left:56%;font-size:clamp(19px,3vw,30px);font-weight:600;letter-spacing:2px;background:#fff8eaeF;border:2px solid #fff8e8;padding:12px 22px;border-radius:45% 45% 45% 8%;color:#9d6e4f;transform:translateY(6px) scale(.92);opacity:0;transition:opacity .28s,transform .35s;pointer-events:none}.scene.hugging .hug-bubble{opacity:1;transform:translateY(0) scale(1)}.hearts{position:absolute;inset:0;pointer-events:none;overflow:hidden}.heart-particle{position:absolute;color:#f1b495;width:24px;height:24px;animation:float-heart 1.7s ease-out forwards;filter:drop-shadow(0 2px 1px #fff7);opacity:0}.heart-particle svg{width:100%;height:100%}@keyframes float-heart{0%{opacity:0;transform:translate(-50%,10px) scale(.7)}20%{opacity:.9}85%{opacity:.6}100%{opacity:0;transform:translate(calc(-50% + var(--drift)), -85px) scale(1)}}.book-bottom{min-height:54px;padding:8px 10px;display:flex;align-items:center;justify-content:space-between;gap:10px}.book-bottom p{font-size:14px;letter-spacing:1.5px;margin:0;color:#728064}.little-heart{color:#d8b594}.little-heart svg{width:16px;height:16px}.play-controls{text-align:center;margin:24px auto 0}.hug-button{height:70px;min-width:240px;background:var(--coral);box-shadow:0 5px 0 #be735b,0 10px 22px #b96d4220;border-radius:40px;display:inline-flex;align-items:center;justify-content:center;gap:20px;color:#fffdf4;transition:transform .16s,box-shadow .16s}.hug-button span{font-size:27px;font-weight:600;letter-spacing:5px}.hug-button>svg{width:27px;height:27px;transform:rotate(-12deg)}.hug-button .small-heart{height:17px;width:17px;transform:rotate(15deg);opacity:.7}.hug-button:active{transform:translateY(4px);box-shadow:0 1px 0 #be735b,0 5px 12px #b96d4220}.sound-status{min-height:19px;margin:13px 0 0;color:#929782;font-size:11px;letter-spacing:1px}.sound-status.error{color:#a34e35}.friends{display:flex;justify-content:center;gap:15px;margin:19px auto 0}.friend{width:99px;min-height:106px;border-radius:18px;background:transparent;padding:7px 6px 8px;display:flex;flex-direction:column;align-items:center;gap:8px;border:1px solid transparent;font-size:12px;color:#8a8d78;transition:background .2s,border-color .2s}.friend.selected{background:#e9eedc;border-color:#d9e2c9;color:#4e6e47}.friend-portrait{width:64px;height:58px;border-radius:50%;border:3px solid #fcfaf0;box-shadow:0 2px 3px #71744e0a;overflow:hidden}.friend-portrait img{height:100%;width:100%;object-fit:cover;object-position:60% center;pointer-events:none}.friend[data-scene=elephant] img{object-position:57% center}.friend[data-scene=chameleon] img{object-position:61% center}.friend[data-scene=giraffe] img{object-position:75% center}.friend[data-scene=monkey] img{object-position:69% center}.friend.selected .friend-portrait{border-color:#9daf83}.family-button{display:flex;align-items:center;justify-content:center;gap:9px;margin:24px auto 0;background:transparent;min-height:44px;font-size:12px;letter-spacing:1px;color:#8a8b76}.family-button>svg{height:15px;width:15px;color:#b39a79}.family-button .arrow{height:13px;width:13px;color:#859275}footer{max-width:1060px;margin:20px auto 0;padding:20px 30px 23px;display:flex;justify-content:center;position:relative;color:#a2a491;font-size:10px;letter-spacing:1.4px}.version{position:absolute;right:30px;font-size:9px;color:#b8b8a5}dialog{padding:30px;border:1px solid #e3dfd0;border-radius:24px;background:#fffdf5;box-shadow:0 25px 90px #22391c35;color:var(--ink);width:min(460px,calc(100% - 32px));max-height:calc(100svh - 32px);overflow-y:auto}dialog::backdrop{background:#263b2cb0;backdrop-filter:blur(5px)}.dialog-close{position:absolute;right:16px;top:13px;width:44px;height:44px;border-radius:50%;background:transparent;color:#849179;display:grid;place-items:center}.dialog-close svg{width:20px;height:20px}.dialog-kicker{display:block;color:#9b9b7b;font-size:11px;letter-spacing:2px;margin-top:8px}dialog h2{font-size:25px;letter-spacing:2px;font-weight:600;margin:15px 0 23px}dialog p{font-size:13px;line-height:2;color:#768168}.volume-label{display:flex;justify-content:space-between;font-size:12px;margin-top:25px}input[type=range]{width:100%;height:42px;accent-color:var(--green)}.secondary-button{width:100%;min-height:44px;border-radius:12px;background:#eef0e3;font-size:13px;color:#56704a}.source-note{font-size:11px!important;color:#9a9c86!important;padding-top:10px}.primary-small{min-height:48px;padding:13px 25px;border-radius:30px;background:var(--green);color:white;font-size:14px;display:block;margin:18px auto 0}.family-dialog{padding:0;text-align:center;overflow:hidden}.family-dialog>img{width:100%;display:block;aspect-ratio:960/464;object-fit:cover}.family-content{padding:24px 24px 32px}.family-content h2{margin-bottom:15px}.family-content p{font-size:16px;line-height:2.1}.family-content .dialog-kicker{margin:0}body.dialog-open{overflow:hidden}
@media(min-width:1200px) and (min-height:950px){main{padding-top:22px}.intro{margin-bottom:32px}.storybook{margin:0 10px}.play-controls{margin-top:29px}}
@media(max-width:600px){.topbar{min-height:65px;padding:12px 18px;gap:8px}.brand{font-size:11px;letter-spacing:1px;gap:7px}.brand-mark{width:30px;height:30px;border-radius:10px}.brand-mark svg{width:22px;height:22px}.top-actions{gap:7px}.sound-button{padding:0 10px;height:38px;font-size:10px;gap:5px}.sound-button svg{width:16px;height:16px}.parent-button{font-size:10px;padding:4px}.intro{margin:12px 0 22px}.eyebrow{font-size:9px;letter-spacing:1px;gap:7px}.eyebrow span{width:16px}h1{font-size:30px;letter-spacing:5px;margin:12px 0 10px;gap:7px}h1 svg{width:20px;height:20px}.intro p{font-size:12px;letter-spacing:1px}main{padding:5px 14px 0}.storybook{padding:0 8px;border-radius:17px}.book-topline{min-height:42px;padding:0 6px;gap:4px}.scene-marker{font-size:11px;gap:4px}.scene-marker svg{height:14px;width:14px}.book-note{font-size:9px;letter-spacing:0}.scene{border-radius:9px}.book-bottom{min-height:49px;padding:9px 7px}.book-bottom p{font-size:12px;letter-spacing:.5px}.touch-invitation{bottom:10px;padding:7px 13px;font-size:11px;gap:5px}.touch-invitation svg{width:14px;height:14px}.hug-bubble{font-size:20px;padding:8px 14px;top:9%;left:57%}.play-controls{margin-top:25px}.hug-button{min-width:220px;height:69px}.hug-button span{font-size:26px}.sound-status{font-size:10px;letter-spacing:.3px;margin-top:14px}.friends{gap:4px;margin-top:20px}.friend{width:calc((100vw - 48px)/5);max-width:89px;min-height:90px;padding:7px 3px 8px;gap:8px;border-radius:14px;font-size:11px}.friend-portrait{height:49px;width:51px}.family-button{margin-top:19px;font-size:11px;gap:7px}footer{margin-top:14px;padding:14px 20px 22px;font-size:9px;letter-spacing:.5px}.version{right:16px;font-size:8px}.world:before{top:240px}.world:after{top:430px}}
@media(max-width:350px){.topbar{padding:10px 12px}.brand{font-size:10px}.parent-button{font-size:9px}.top-actions{gap:2px}.sound-button{padding:0 8px}.eyebrow{font-size:8px}h1{font-size:27px}.book-note{font-size:8px}.scene-marker{font-size:10px}.friend-portrait{width:44px;height:44px}.friend{font-size:10px}.friends{gap:3px}.family-button{font-size:10px}.version{display:none}}
@media(max-height:740px) and (max-width:600px){.topbar{min-height:55px;padding-top:7px;padding-bottom:7px}.intro{margin:7px 0 16px}.eyebrow{display:none}h1{margin:4px 0 7px;font-size:28px}.play-controls{margin-top:19px}.hug-button{height:63px}.friends{margin-top:12px}.family-button{margin-top:9px}footer{margin-top:4px;padding-top:8px}.sound-status{margin-top:11px}}
@media(orientation:landscape) and (max-height:550px){.topbar{max-width:1000px;min-height:46px;padding:5px 24px}main{max-width:1000px;display:grid;grid-template-columns:minmax(0,1fr) 220px;gap:5px 22px;padding:0 24px}.intro{grid-column:1/-1;margin:0 0 8px}.intro h1{font-size:23px;margin:2px 0}.intro h1 svg{width:17px}.intro .eyebrow,.intro p{display:none}.storybook{grid-column:1;grid-row:2/5;margin:0}.book-topline{min-height:33px}.book-bottom{min-height:38px}.book-bottom p{font-size:11px}.play-controls{grid-column:2;grid-row:2;margin:4px 0}.hug-button{min-width:190px;height:56px}.hug-button span{font-size:23px}.sound-status{font-size:9px;max-width:220px;margin:10px 0 0}.friends{grid-column:2;grid-row:3;flex-wrap:wrap;gap:2px;margin:0}.friend{min-height:59px;width:66px;gap:4px;padding:4px 2px;font-size:10px}.friend-portrait{width:36px;height:32px;border-width:2px}.family-button{grid-column:2;grid-row:4;font-size:10px;margin:0;gap:4px;min-height:36px}.family-button svg{width:12px}footer{margin:0;padding:9px 20px;font-size:8px}}
@media(orientation:landscape) and (max-height:550px){.storybook{width:min(100%,calc(206.9svh - 384px));justify-self:center;align-self:start}footer{padding-top:5px;padding-bottom:5px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}.heart-particle{display:none}}

/* v0.1.1: large picture targets and consistent reframed story media. */
.scene-wrap{position:relative;border-radius:12px;isolation:isolate}
.scene-return-image{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;pointer-events:none}
.scene-return-image[hidden],.character-tap[hidden]{display:none}
.character-tap{position:absolute;z-index:2;background:transparent;border:0;border-radius:18px;display:flex;align-items:flex-end;justify-content:center;padding:0 0 7px;touch-action:manipulation;-webkit-user-select:none;user-select:none}
.mama-tap{left:0;top:5%;width:55%;height:91%}
.baby-tap{left:60%;top:46%;width:36%;height:50%}
.character-tap span{display:inline-flex;align-items:center;gap:7px;padding:8px 16px;border-radius:24px;background:#fff9eae8;border:1px solid #f7f5df;color:#6a7552;font-size:14px;box-shadow:0 3px 8px #45532d1a}
.character-tap svg{width:14px;height:14px;color:#cb9171}
.character-tap:active span{background:#e9eed8;transform:translateY(1px)}
.scene-wrap[data-busy=true] .character-tap{visibility:hidden}
.scene-wrap[data-animal=monkey] .touch-invitation{display:none}
.scene[data-animal=monkey]:not([data-phase=embracing]) .hug-bubble{opacity:0}
.scene[data-animal=monkey] .hug-bubble{left:44%;top:10%}
.hug-button.is-playing{background:#cd8b72;box-shadow:0 3px 0 #be735b,0 8px 18px #b96d4216}
.scene,.family-dialog>img{aspect-ratio:816/464}
.friends{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;max-width:850px}
.friend{width:100%;max-width:none;min-height:128px;padding:10px 6px;gap:8px;background:#fffdf7;border:2px solid #e6e6d5;border-radius:19px;font-size:14px;font-weight:600;color:#647557;box-shadow:0 3px 0 #e7e7d9}
.friend-portrait{width:88px;height:82px;border-radius:17px;border-width:3px}
.friend.selected{border-color:#8ca475;background:#e9eedc;box-shadow:0 3px 0 #a9bb92}
.friend:active{transform:translateY(2px);box-shadow:0 1px 0 #d5ddc7}
.next-friend{background:#e9eedf;border-color:#dbe4ce}
.next-portrait{display:grid;place-items:center;background:#d9e4c8;border-color:#f7f9ef;color:#71895c}
.next-portrait svg{width:40px;height:40px}
.scene[data-state=holding] .touch-invitation{opacity:0}
@media(max-width:600px){
  .character-tap span{font-size:11px;padding:6px 11px;gap:5px}.character-tap svg{width:12px;height:12px}.character-tap{padding-bottom:4px}
  .topbar{min-height:54px;padding-top:8px;padding-bottom:8px}
  main{padding-top:0}
  .intro{margin:5px 0 14px}.eyebrow{display:none}h1{font-size:28px;margin:5px 0 7px}
  .book-topline{min-height:34px}.book-bottom{min-height:37px;padding:6px 7px}
  .play-controls{margin-top:14px}.hug-button{height:66px;width:100%;max-width:330px;min-width:220px}.sound-status{margin-top:9px;min-height:15px}
  .friends{grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin-top:14px}
  .friend{width:100%;min-height:112px;padding:8px 4px 7px;gap:7px;border-radius:17px;font-size:13px}
  .friend-portrait{width:82px;height:72px;border-radius:14px}
  .family-button{margin-top:10px;min-height:42px}footer{margin-top:3px;padding-top:8px;padding-bottom:14px}
}
@media(max-width:600px) and (max-height:740px){
  .topbar{min-height:48px;padding-top:4px;padding-bottom:4px}.intro{margin:1px 0 10px}h1{font-size:25px;margin:2px 0 5px}.intro p{font-size:11px}
  .book-topline{min-height:30px}.book-bottom{min-height:32px}.book-bottom p{font-size:11px}
  .play-controls{margin-top:11px}.hug-button{height:58px;min-width:200px}.hug-button span{font-size:24px}.sound-status{margin-top:7px;font-size:9px}
  .friends{gap:7px;margin-top:10px}.friend{min-height:88px;padding:5px 4px;gap:4px;font-size:12px}.friend-portrait{width:68px;height:54px;border-radius:12px;border-width:2px}
  .family-button{margin-top:8px}footer{padding-top:4px;padding-bottom:10px}
}
@media(orientation:landscape) and (max-height:550px){
  .character-tap span{font-size:11px;padding:6px 11px;gap:5px}.character-tap svg{width:12px;height:12px}
  main{grid-template-columns:minmax(0,1fr) 280px;gap:5px 18px}.intro{margin:0 0 8px}.intro h1{font-size:23px}
  .storybook{width:min(100%,calc(175.9svh - 322px));grid-row:2/5}
  .play-controls{margin:4px 0}.hug-button{height:56px;min-width:230px}.sound-status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .friends{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:0}.friend{min-height:74px;padding:4px 2px;gap:3px;font-size:11px;border-radius:13px}.friend-portrait{width:56px;height:46px;border-radius:11px;border-width:2px}.next-portrait svg{width:28px;height:28px}
  .family-button{margin:0;min-height:36px;font-size:10px}footer{margin:0;padding-top:5px;padding-bottom:5px}
}

/* Baby layout: keep the picture and familiar tap targets in the foreground. */
.parent-sound-row{display:flex;align-items:center;justify-content:space-between;gap:16px;font-size:14px;margin:0 0 16px}
.parent-sound-row .sound-button{min-height:44px;font-size:13px;padding:0 16px}
.baby-mode-note{display:none}
@media(max-width:600px),(orientation:landscape) and (max-height:550px){
  .intro,.book-note,.book-bottom,.world>footer{display:none}
  .sound-status:not(.error){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  .sound-status.error{position:static;width:auto;height:auto;clip-path:none;margin:10px 0 0;font-size:12px}
  .topbar{min-height:52px;padding:4px max(14px,env(safe-area-inset-right)) 4px max(14px,env(safe-area-inset-left));padding-top:max(4px,env(safe-area-inset-top));gap:8px}
  .brand{font-size:11px;letter-spacing:1px}.brand-mark{width:28px;height:28px}.brand-mark svg{width:21px;height:21px}
  .parent-button{min-height:44px;min-width:60px;font-size:12px;border-radius:22px;background:#eef0e3;color:#6c7b63}
  .book-topline{min-height:32px;justify-content:center;padding:0 6px}.scene-marker{font-size:12px;letter-spacing:1px}
  .baby-mode-note{display:block}
}
@media(max-width:600px) and (orientation:portrait){
  main{padding:0 max(8px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))}
  .storybook{padding:0 5px 5px;border-radius:18px}.scene{border-radius:11px}
  .play-controls{margin:20px auto 0;padding:0 12px}
  .hug-button{height:80px;width:100%;max-width:370px;min-width:230px}.hug-button span{font-size:30px}
  .friends{margin:20px 4px 0;gap:10px;grid-template-columns:repeat(3,minmax(0,1fr))}
  .friend{min-height:124px;padding:9px 5px;gap:7px;font-size:14px;border-radius:19px}
  .friend-portrait{width:88px;max-width:100%;height:79px;border-radius:16px}
  .family-button{min-height:44px;margin:14px auto 0;font-size:11px}
}
@media(max-width:600px) and (orientation:portrait) and (max-height:740px){
  .topbar{min-height:48px;padding-top:2px;padding-bottom:2px;padding-top:max(2px,env(safe-area-inset-top))}
  .book-topline{min-height:28px}
  .play-controls{margin-top:14px}.hug-button{height:70px}.hug-button span{font-size:28px}
  .friends{margin-top:16px;gap:8px}.friend{min-height:100px;padding:6px 4px;gap:5px;font-size:12px}
  .friend-portrait{width:72px;height:61px;border-radius:13px}
  .family-button{margin-top:10px}
}
@media(orientation:landscape) and (max-height:550px){
  main{padding:0 max(18px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left));grid-template-columns:minmax(0,1fr) 280px;gap:10px 18px}
  .storybook{grid-column:1;grid-row:1/4;align-self:start;width:min(100%,calc((100svh - 100px)*1.759));padding:0 5px 5px}
  .play-controls{grid-column:2;grid-row:1;margin:0}.hug-button{height:62px;width:100%;min-width:230px}
  .friends{grid-column:2;grid-row:2;margin:0;gap:8px}.friend{min-height:80px}.friend-portrait{height:49px;width:60px}
  .family-button{grid-column:2;grid-row:3;min-height:40px;margin:0}
}
