/* Soya's 3D Home (soyapet): a digital pet in a cosy 3D room. The kid feeds, plays, washes, pets and puts Soya to bed, teaches him
   tricks step by step (practice makes progress), decorates the room and meets friends who visit. Soya never gets sick, never runs
   away and never sends a message to bring the kid back: when the kid returns his needs have only dropped a little.
   Everything is stored on this device only (annabelle-soyapet). The 3D characters come from soya3d-kit.js, the same Soya as in
   Soya Town. Without WebGL Soya is drawn flat (art/soya-sit.svg) and every action still works. */
:root{--ink:#3b2a4a;--soft:#6b5a78;--acc:var(--an-accent,#34639f);--top:calc(var(--an-bar-h,46px) + 8px);--pb:env(safe-area-inset-bottom,0px)}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;height:100dvh;overflow:hidden;overscroll-behavior:none;position:fixed;inset:0;width:100%;background:#f6dcc4;font-family:"Rubik","Varela Round",Arial,sans-serif;color:var(--ink)}
button{font-family:inherit;color:inherit;cursor:pointer;touch-action:manipulation}
button:focus-visible{outline:3px solid #1d6fd1;outline-offset:3px}
#gl{position:fixed;inset:0;width:100%;height:100%;display:block;touch-action:none}
#flat{position:fixed;left:50%;bottom:calc(var(--pb) + 150px);width:min(58vw,260px);transform:translateX(-50%);display:none}
#flat svg{width:100%;height:auto}
body.flat #flat{display:block}
#needs{position:fixed;left:8px;right:8px;top:var(--top);z-index:5;display:none;justify-content:center;gap:6px;direction:ltr;pointer-events:none}
body.on #needs{display:flex}
.need{display:flex;flex-direction:column;align-items:center;gap:2px;background:#fffffff0;border:2px solid var(--ink);border-radius:14px;padding:4px 6px;min-width:58px}
.need b{font-size:20px;line-height:1}
.bar{width:44px;height:8px;border-radius:9px;background:#e6dde9;overflow:hidden}.bar i{display:block;height:100%;width:50%;background:#46b37a;border-radius:9px;transition:width .4s}
.bar i.low{background:#f0a23a}
.need.love{min-width:52px}.need.love span{font-weight:800;font-size:14px}
#bubbleW{position:fixed;left:50%;top:calc(var(--top) + 66px);transform:translateX(-50%);z-index:6;display:none;align-items:center;gap:6px;max-width:92vw}
#bubbleW.on{display:flex}
#bubble{background:#fff;border:2px solid var(--ink);border-radius:16px;padding:8px 12px;font-weight:700;font-size:16px;text-align:center;margin:0}
#readB{width:48px;height:48px;border-radius:50%;border:2px solid var(--ink);background:#fff;font-size:20px;flex:none}
#acts{position:fixed;left:0;right:0;bottom:0;z-index:6;display:none;justify-content:center;gap:6px;padding:0 6px calc(var(--pb) + 10px);flex-wrap:wrap}
body.on #acts{display:flex}
#acts button{width:60px;height:64px;border-radius:18px;background:#fff;border:2.5px solid var(--ink);font-size:24px;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1.05}
#acts button small{font-size:12px;font-weight:700;margin-top:2px;max-width:58px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#acts button.on{background:#ffe9a8}
#panel{position:fixed;left:8px;right:8px;bottom:calc(var(--pb) + 84px);z-index:7;display:none;justify-content:center}
#panel.on{display:flex}
#panel .in{background:#fff;border:2.5px solid var(--ink);border-radius:20px;padding:10px;max-width:460px;width:100%;display:flex;flex-direction:column;gap:8px}
#panel h2{margin:0;font-size:17px;text-align:center}
#panel .row{display:flex;gap:8px;flex-wrap:wrap;justify-content:center}
#panel .pick{min-width:64px;min-height:56px;border-radius:16px;border:2px solid #d8cfe0;background:#fbf8ff;font-size:24px;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:4px 8px}
#panel .pick small{font-size:12px;font-weight:700}
#panel .pick[aria-pressed=true]{border-color:var(--acc);box-shadow:0 0 0 2px var(--acc)}
#panel .pick:disabled{opacity:.45}
#panel .note{margin:0;font-size:14px;color:var(--soft);text-align:center}
#panel .close{align-self:center;min-height:48px;padding:0 20px;border-radius:14px;border:2px solid #d8cfe0;background:#fff;font-weight:700}
.an-menu .soya-row{display:flex;align-items:center;gap:10px}.an-menu .soya-row .cat{width:70px;height:78px;flex:none}.an-menu .soya-row .cat svg{width:100%;height:100%}
.an-menu .bub{flex:1;background:var(--an-tint,#e8eef7);border-radius:16px;padding:10px 12px;font-weight:600;text-align:start;margin:0}
.an-menu .how{margin:0;color:var(--an-soft,#5a6272);text-align:start;line-height:1.5}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
