/* Dream Doll House: a live, cozy doll house world. System fonts only, no inline styles. */
[hidden]{display:none!important}
*{box-sizing:border-box}
html,body{margin:0;padding:0;height:100%;width:100%;overflow:hidden;overscroll-behavior:none;touch-action:none;
  -webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
body{position:fixed;inset:0;height:100dvh;background:#f7d8e4;color:#5a2d48;
  font-family:ui-rounded,"SF Pro Rounded","Nunito","Segoe UI Rounded","Trebuchet MS",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif}
#ddh{position:fixed;inset:0;height:100dvh;width:100vw;overflow:hidden;overscroll-behavior:none;touch-action:none}
#world{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none;outline:none;cursor:pointer}
#world:focus-visible{box-shadow:inset 0 0 0 4px #ffffffaa}
button,a{touch-action:manipulation;font:inherit;color:inherit}
button{cursor:pointer}
.nojs{position:absolute;inset:40% 10% auto;text-align:center;font-weight:800;background:#fff;padding:16px;border-radius:16px}

/* ---------- HUD ---------- */
.hud{position:absolute;left:0;right:0;top:0;display:flex;align-items:center;gap:6px;
  padding:calc(env(safe-area-inset-top,0px) + 6px) calc(env(safe-area-inset-right,0px) + 8px) 6px calc(env(safe-area-inset-left,0px) + 8px);
  pointer-events:none;z-index:5}
.hud > *{pointer-events:auto}
.hbtn{flex:0 0 auto;width:46px;height:46px;border-radius:16px;border:0;display:grid;place-items:center;
  background:linear-gradient(#fffafc,#ffe3ee);box-shadow:0 3px 0 #e7a9c2,0 6px 14px #b0547a33,inset 0 1px 0 #fff;text-decoration:none}
.hbtn svg{width:28px;height:28px;display:block}
.hbtn:active{transform:translateY(2px);box-shadow:0 1px 0 #e7a9c2,0 3px 8px #b0547a33}
.hbtn[aria-pressed="true"].zoomed,.hbtn[aria-expanded="true"]{background:linear-gradient(#fff2c9,#ffd98a);box-shadow:0 3px 0 #d9a440,0 6px 14px #b0547a33}
.hbtn:focus-visible,.tod:focus-visible,.bubble button:focus-visible,.chores li button:focus-visible,.panel button:focus-visible{outline:4px solid #7b5cff;outline-offset:2px}
.hud-mid{flex:1 1 auto;min-width:0;display:flex;align-items:center;gap:6px}
.tod{flex:0 1 auto;min-width:0;height:46px;display:flex;align-items:center;gap:6px;padding:0 12px 0 6px;border:0;border-radius:23px;
  background:linear-gradient(#fffafc,#ffe3ee);box-shadow:0 3px 0 #e7a9c2,0 6px 14px #b0547a33,inset 0 1px 0 #fff;text-align:left}
.tod-ic svg{width:34px;height:34px;display:block}
.tod-txt{display:flex;flex-direction:column;line-height:1.05;min-width:0}
.tod-txt b{font-size:15px;color:#7a2f58;white-space:nowrap}
.tod-txt small{font-size:12px;font-weight:700;color:#a5617f;white-space:nowrap}
.happy{height:34px;padding:0 8px;border-radius:17px;display:flex;align-items:center;background:#ffffffc9;box-shadow:0 2px 8px #b0547a22}
.hearts{display:flex;gap:1px}
.hearts svg{width:17px;height:17px;display:block;transition:transform .3s}
.hearts svg.pop{animation:pop .5s}
@keyframes pop{50%{transform:scale(1.5)}}
@media (max-width:420px){.happy{display:none}.hbtn{width:42px;height:42px}.hbtn svg{width:25px;height:25px}.tod{height:42px}}
@media (max-width:350px){.tod-txt small{display:none}}

/* ---------- caption + toast ---------- */
.say{position:absolute;left:50%;bottom:calc(env(safe-area-inset-bottom,0px) + 12px);transform:translateX(-50%);margin:0;max-width:min(92vw,560px);
  padding:10px 18px;border-radius:22px;background:#fffffff2;color:#6b2d55;font-weight:800;font-size:17px;text-align:center;line-height:1.25;
  box-shadow:0 4px 0 #f0b6cc,0 8px 22px #8a3a6033;pointer-events:none;opacity:0;transition:opacity .35s, transform .35s;z-index:4}
.say.on{opacity:1;transform:translateX(-50%) translateY(-4px)}
.toast{position:absolute;left:50%;top:40%;pointer-events:none;transform:translate(-50%,-50%);padding:18px 26px;border-radius:28px;z-index:9;
  background:linear-gradient(#fffdf5,#ffe9f3);box-shadow:0 6px 0 #f0b6cc,0 16px 40px #8a3a6055;text-align:center;font-weight:900;font-size:22px;color:#7a2f58;
  animation:toastIn .45s cubic-bezier(.2,1.6,.4,1)}
.toast small{display:block;font-size:15px;font-weight:700;color:#a5617f;margin-top:4px}
@keyframes toastIn{from{transform:translate(-50%,-50%) scale(.5);opacity:0}}

/* ---------- action bubble ---------- */
.bubble{position:absolute;z-index:6;left:0;top:0;padding:8px 10px 10px;border-radius:24px;background:#fffffff7;
  box-shadow:0 5px 0 #f0b6cc,0 12px 30px #8a3a6040;min-width:120px;max-width:calc(100vw - 16px);animation:bubIn .3s cubic-bezier(.2,1.6,.4,1)}
@keyframes bubIn{from{opacity:0;scale:.6}}
.bubble-t{margin:0 4px 6px;font-weight:900;font-size:15px;color:#a5617f;text-align:center}
.bubble-row{display:flex;gap:8px;justify-content:center;flex-wrap:wrap}
.bubble button{border:0;border-radius:18px;min-width:76px;padding:6px 8px 7px;display:flex;flex-direction:column;align-items:center;gap:2px;
  background:linear-gradient(#fff5fa,#ffe0ee);box-shadow:0 3px 0 #eba7c4;font-weight:800;font-size:14px;color:#6b2d55}
.bubble button svg{width:44px;height:44px;display:block}
.bubble button:active{transform:translateY(2px);box-shadow:0 1px 0 #eba7c4}
.bubble button.todo{background:linear-gradient(#fffbe6,#ffe7a6);box-shadow:0 3px 0 #e0b04a}
.bubble-tail{position:absolute;left:var(--tail,50%);bottom:-10px;width:22px;height:22px;background:#fffffff7;transform:translateX(-50%) rotate(45deg);border-radius:4px;z-index:-1}
.bubble.below .bubble-tail{bottom:auto;top:-10px}

/* ---------- chore list ---------- */
.chores{position:absolute;z-index:7;top:calc(env(safe-area-inset-top,0px) + 60px);right:calc(env(safe-area-inset-right,0px) + 8px);width:min(330px,calc(100vw - 16px));
  max-height:calc(100dvh - 80px);overflow:auto;overscroll-behavior:contain;touch-action:pan-y;
  border-radius:26px;padding:10px 12px 12px;background:linear-gradient(#fffdf7,#fff0f6);box-shadow:0 5px 0 #f0b6cc,0 16px 40px #8a3a6040;animation:bubIn .3s}
.chores-head,.panel-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.chores h2,.panel h2{margin:2px 4px 6px;font-size:19px;color:#7a2f58}
.x{width:40px;height:40px;border:0;border-radius:14px;background:#ffe3ee;display:grid;place-items:center}
.x svg{width:20px;height:20px}
.chores ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:7px}
.chores li button{width:100%;display:flex;align-items:center;gap:10px;border:0;border-radius:18px;padding:5px 10px 5px 5px;text-align:left;
  background:#fff;box-shadow:0 2px 0 #f3c6d7;font-weight:800;font-size:16px;color:#6b2d55}
.chores li .pic{width:52px;height:52px;flex:0 0 auto;border-radius:14px;background:radial-gradient(circle at 50% 40%,#fff8fb,#ffe1ec);display:grid;place-items:center;overflow:hidden}
.chores li .pic img,.chores li .pic canvas{max-width:46px;max-height:46px;display:block}
.chores li .lbl{flex:1}
.chores li .lbl small{display:block;font-size:13px;color:#b27393}
.chores li .chk{width:30px;height:30px;flex:0 0 auto}
.chores li.done button{background:#f2fff4;box-shadow:0 2px 0 #b7e7c0}
.chores li.done .lbl{color:#3f8a55}
.chores-foot{margin:8px 4px 0;font-size:14px;font-weight:700;color:#a5617f;text-align:center}

/* ---------- panels (wardrobe, decorate) ---------- */
.panel{position:absolute;z-index:8;left:50%;top:50%;transform:translate(-50%,-50%);width:min(560px,calc(100vw - 16px));max-height:calc(100dvh - 20px);
  overflow:auto;overscroll-behavior:contain;touch-action:pan-y;border-radius:28px;padding:12px 14px 14px;
  background:linear-gradient(#fffdf7,#fdeaf3);box-shadow:0 6px 0 #f0b6cc,0 20px 50px #8a3a6055;animation:bubIn .3s}
.panel h3{margin:10px 4px 6px;font-size:15px;color:#a5617f}
.closet-body{display:flex;gap:12px;align-items:flex-start}
#closetPreview{width:150px;height:191px;flex:0 0 auto;border-radius:22px;background:radial-gradient(circle at 50% 35%,#fff,#ffe0ec 70%,#f7c6d9)}
.closet-opts{flex:1;min-width:0}
.closet-opts h3:first-child{margin-top:0}
.swatches{display:flex;flex-wrap:wrap;gap:8px}
.sw{width:50px;height:50px;border-radius:16px;border:0;padding:0;overflow:hidden;background:#fff;box-shadow:0 2px 0 #eab3c8;display:grid;place-items:center}
.sw canvas{width:50px;height:50px;display:block}
.sw.on{outline:4px solid #ff6fae;outline-offset:2px}
.sw.dot{width:40px;height:40px;border-radius:50%}
.decor-rooms{display:flex;gap:6px;flex-wrap:wrap}
.decor-rooms button{border:0;border-radius:16px;padding:8px 12px;background:#fff;box-shadow:0 2px 0 #eab3c8;font-weight:800;color:#6b2d55}
.decor-rooms button[aria-selected="true"]{background:linear-gradient(#fff2c9,#ffd98a);box-shadow:0 2px 0 #d9a440}
@media (max-width:440px){.closet-body{flex-direction:column;align-items:center}#closetPreview{width:120px;height:153px}}
@media (max-height:460px){.panel{max-height:calc(100dvh - 12px)}.closet-body{flex-direction:row}#closetPreview{width:110px;height:140px}}

/* ---------- home menu (grown-up links live one tap deeper) ---------- */
.menu{position:absolute;z-index:9;top:calc(env(safe-area-inset-top,0px) + 58px);left:calc(env(safe-area-inset-left,0px) + 8px);display:flex;flex-direction:column;gap:6px;
  padding:8px;border-radius:20px;background:#fffffff7;box-shadow:0 5px 0 #f0b6cc,0 12px 30px #8a3a6040;animation:bubIn .25s;min-width:180px}
.menu a{display:block;padding:10px 14px;border-radius:14px;background:#fff5fa;color:#6b2d55;font-weight:800;font-size:15px;text-decoration:none;box-shadow:0 2px 0 #f3c6d7}
.menu a#mParents,.menu a#mPrivacy{font-size:13px;font-weight:700;color:#8a5a72;background:#fff;padding:8px 14px}
.menu a:focus-visible{outline:4px solid #7b5cff;outline-offset:2px}

/* ---- travel map button ---- */
.mapbtn{position:absolute;z-index:5;left:calc(env(safe-area-inset-left,0px) + 8px);top:calc(env(safe-area-inset-top,0px) + 62px);width:56px;height:56px;border:0;border-radius:20px;
  background:linear-gradient(#fffaf0,#ffe6a8);box-shadow:0 3px 0 #d9a440,0 6px 14px #b0547a33;display:grid;place-items:center;padding:0}
.mapbtn svg{width:40px;height:40px;display:block}
.mapbtn:active{transform:translateY(2px)}
.mapbtn:focus-visible{outline:4px solid #7b5cff;outline-offset:2px}

/* ---- map ---- */
.panel.mapp{width:min(780px,calc(100vw - 12px),calc((100dvh - 108px) * 4 / 3 + 28px));padding:8px 12px 8px;overflow:hidden}
.mapp .panel-head h2{margin:0 4px 4px}
.mapwrap{position:relative;width:100%;aspect-ratio:4/3;border-radius:18px;overflow:hidden;box-shadow:inset 0 0 0 3px #fff,0 3px 10px #b0547a33;background:#bfe6c4}
.mapwrap canvas{position:absolute;inset:0;width:100%;height:100%;display:block}
.pin{position:absolute;transform:translate(-50%,-100%);border:0;background:none;padding:0;display:flex;flex-direction:column;align-items:center;gap:2px;cursor:pointer;min-width:64px;min-height:44px}
.pin-l{display:block;padding:5px 12px;border-radius:16px;background:#fffffff2;color:#7a2f58;font-weight:900;font-size:16px;box-shadow:0 3px 0 #f0a9c8,0 4px 10px #0003;white-space:nowrap}
.pin::after{content:"";width:0;height:0;border:8px solid transparent;border-top:11px solid #fffffff2;margin-top:-3px}
.pin.here .pin-l{background:linear-gradient(#fff2c9,#ffd98a);box-shadow:0 3px 0 #d9a440,0 4px 10px #0003}
.pin.here::after{border-top-color:#ffd98a}
.pin:not(.here):hover .pin-l{transform:scale(1.06)}
.pin .sticker{position:absolute;right:-16px;top:-18px;width:30px;height:30px}
.pin:focus-visible{outline:4px solid #7b5cff;outline-offset:2px;border-radius:14px}
.mapwrap.going .pin{pointer-events:none;opacity:.85}
.mapfoot{margin:6px 2px 0;display:flex;align-items:center;justify-content:center;gap:8px;font-weight:800;color:#a5617f;font-size:14px}
@media (max-width:560px){.pin-l{font-size:13px;padding:4px 8px}.pin{min-width:52px}}
@media (max-height:460px){.panel.mapp{padding:4px 8px}.mapp .panel-head h2{font-size:16px;margin:0 4px 2px}.mapp .x{width:34px;height:34px}.mapfoot{margin-top:3px;font-size:12px}.mapfoot .sticker{width:26px;height:26px}
  .panel.mapp{width:min(780px,calc(100vw - 12px),calc((100dvh - 86px) * 4 / 3 + 16px))}}

/* ---- stickers ---- */
.sticker{display:inline-grid;place-items:center;width:38px;height:38px;border-radius:50%;background:radial-gradient(circle at 40% 35%,#fff,#ffe6f0 70%);box-shadow:0 0 0 3px #fff,0 0 0 5px #ffb3cf,0 3px 6px #0003;flex:0 0 auto}
.sticker img{width:80%;height:80%;object-fit:contain;display:block}
.sticker.big{width:96px;height:96px;box-shadow:0 0 0 5px #fff,0 0 0 9px #ffb3cf,0 6px 14px #0003}
.sticker.empty{background:#ffffff99;box-shadow:inset 0 0 0 3px #f3c6d7}
.chores-foot .got{display:inline-flex;align-items:center;gap:8px;color:#3f8a55;font-weight:900}
.again{display:block;margin:8px auto 0;border:0;border-radius:16px;padding:9px 18px;font-weight:900;font-size:16px;color:#6b2d55;background:linear-gradient(#fff2c9,#ffd98a);box-shadow:0 3px 0 #d9a440}
.again:focus-visible{outline:4px solid #7b5cff;outline-offset:2px}
.toast .sticker.big{margin:4px auto 6px;display:grid}

/* ---- shops ---- */
.shop-items{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.shop-items .item{border:0;border-radius:18px;background:#fff;box-shadow:0 3px 0 #eab3c8;padding:6px 4px 7px;display:flex;flex-direction:column;align-items:center;gap:1px;font-weight:900;color:#6b2d55;font-size:14px}
.shop-items .item img{width:62px;height:62px;object-fit:contain;display:block}
.shop-items .item small{font-size:13px;color:#b27393;font-weight:800}
.shop-items .item.on{background:linear-gradient(#fff2c9,#ffd98a);box-shadow:0 3px 0 #d9a440}
.shop-items .item:disabled{opacity:.45}
.shop-msg{margin:8px 4px;min-height:2.5em;font-weight:800;color:#7a2f58;font-size:15px;text-align:center}
.shop-money{display:flex;gap:8px}
.moneybox{flex:1;min-width:0;background:#fff7e6;border-radius:16px;padding:4px 8px 8px;box-shadow:inset 0 0 0 2px #f6dca2}
.moneybox.tray{background:#f2fbff;box-shadow:inset 0 0 0 2px #bfe3f5}
.moneybox h3{margin:2px 0 4px;font-size:14px}
.coins{display:flex;flex-wrap:wrap;gap:5px;min-height:44px}
.coin{width:44px;height:44px;border-radius:50%;border:0;padding:0;display:grid;place-items:center;background:radial-gradient(circle at 35% 30%,#fff6b8,#f6c33a 60%,#e0a020);box-shadow:inset 0 0 0 3px #c98a10,0 2px 0 #a8700c;color:#8a5a06;font-weight:900;font-size:19px}
.coin.c5{width:50px;height:50px;background:radial-gradient(circle at 35% 30%,#ffffff,#d9e4ee 55%,#a9b9c8);box-shadow:inset 0 0 0 3px #8193a6,0 2px 0 #66788a;color:#3e4f62;font-size:21px}
.coin:active{transform:translateY(2px)}
.choices{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin-top:8px}
.choices button,.lesson-nav .next{border:0;border-radius:18px;min-width:84px;min-height:52px;padding:6px 16px;font-weight:900;font-size:22px;color:#6b2d55;background:#fff;box-shadow:0 3px 0 #eab3c8}
.choices button:disabled{opacity:.4}
.choices button.right{background:#e6ffe9;box-shadow:0 3px 0 #8fd6a0;color:#2f7a45;opacity:1}

/* ---- school + library ---- */
.board{display:flex;align-items:center;gap:12px;background:#3f7a5a;border-radius:18px;padding:10px 12px;box-shadow:inset 0 0 0 6px #c98a4a,inset 0 0 0 8px #a86b33}
.lesson-pic{flex:0 0 auto;min-width:96px;display:flex;flex-direction:column;align-items:center}
.lesson-pic img.big{width:104px;height:104px;object-fit:contain;display:block;filter:drop-shadow(0 3px 2px #0004)}
.lesson-pic .many{display:grid;grid-template-columns:repeat(3,46px);gap:4px}
.lesson-pic .many img{width:46px;height:46px;object-fit:contain}
.lesson-pic .word{margin:2px 0 0;color:#fff;font-weight:800;font-size:18px}
.lesson-pic .word b{color:#ffe08a;font-size:24px}
.lesson-q{margin:0;flex:1;color:#fff;font-weight:800;font-size:19px;line-height:1.3}
.lesson.story .board{background:#fffaf0;box-shadow:inset 0 0 0 4px #f3c6d7}
.lesson.story .lesson-q{color:#6b2d55}
.lesson-nav{display:flex;align-items:center;justify-content:space-between;margin-top:8px;font-weight:800;color:#a5617f;min-height:52px}
.lesson-nav .next{font-size:18px;background:linear-gradient(#fff2c9,#ffd98a);box-shadow:0 3px 0 #d9a440}
@media (max-width:440px){.shop-items .item img{width:48px;height:48px}.shop-items .item{font-size:12px}.coin{width:40px;height:40px}.coin.c5{width:44px;height:44px}.board{flex-direction:column;gap:6px}.lesson-q{text-align:center;font-size:17px}}
@media (max-height:460px){.shop-items .item img{width:40px;height:40px}.shop-msg{margin:4px;min-height:0;font-size:14px}.coin{width:36px;height:36px;font-size:16px}.coin.c5{width:40px;height:40px}.coins{min-height:36px}
  .lesson-pic img.big{width:72px;height:72px}.lesson-pic .many{grid-template-columns:repeat(5,36px)}.lesson-pic .many img{width:36px;height:36px}.choices button,.lesson-nav .next{min-height:44px}.lesson-nav{margin-top:4px;min-height:44px}}

/* in the four places Rosie usually walks near the bottom, so her words float up in the sky instead of over her */
body[data-place]:not([data-place="house"]) .say{top:calc(env(safe-area-inset-top,0px) + 64px);bottom:auto;max-width:min(560px,calc(100vw - 150px))}
@media (max-height:460px){body[data-place]:not([data-place="house"]) .say{top:calc(env(safe-area-inset-top,0px) + 58px);font-size:15px}}
/* shared voice toggle (assets/js/voice.js) */
.hbtn.kav-btn .kav-ic{width:28px;height:28px;display:block}
.hbtn.kav-btn{color:#b0457a}
.hbtn.kav-btn.kav-off{color:#9a8a94;background:#f1eaee}
@media (max-width:420px){.hbtn.kav-btn .kav-ic{width:25px;height:25px}}
/* phones: room for the voice button without cutting off "Morning / 8 o'clock" */
@media (max-width:420px){.hud{gap:4px}.hbtn{width:40px;height:40px}.tod{padding:0 8px 0 3px;gap:3px}.tod-ic svg{width:28px;height:28px}.tod-txt b{font-size:14px}.tod-txt small{font-size:11px}}
@media (max-width:380px){.tod-ic{display:none}.tod{padding:0 10px}}
