:root{color-scheme:dark;--ink:#101d2c;--gold:#e4c681;--cream:#f5eddb;--muted:#a8b9bf}*{box-sizing:border-box}body{margin:0;min-height:100dvh;background:#101d2c;color:var(--cream);font:15px system-ui,sans-serif;background-image:radial-gradient(ellipse at 50% 20%,#30464d66,transparent 70%)}body::before{content:'';position:fixed;inset:0;z-index:-1;background:linear-gradient(#101d2cf5,#101d2cfb),url('assets/sanctuary.webp') center/cover}button,a,input{touch-action:manipulation}button{font:inherit;color:inherit;cursor:pointer;border:1px solid #dfc68130;border-radius:13px;background:#ffffff06;padding:12px 16px;transition:background .2s,transform .15s}button:hover{background:#ffffff10}button:active{transform:scale(.97)}button:disabled{cursor:default}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #f4d28a;outline-offset:4px}header{max-width:580px;margin:auto;padding:16px 20px 8px;display:flex;justify-content:space-between;align-items:center}.brand{font:21px Georgia,serif;text-decoration:none;color:var(--cream);display:flex;align-items:center;gap:10px}.brand>span{font-size:30px;color:var(--gold)}.quiet-button{border:0;padding:10px 13px;font-size:20px;color:var(--muted)}main{max-width:540px;margin:auto;padding:0 16px 12px}.greeting{text-align:center;margin:10px 0 16px}h1{font:29px Georgia,serif;margin:0 0 7px}.greeting p{font-size:12px;color:var(--muted);margin:0}.goal{border:1px solid #cbaa5b33;border-radius:14px;background:linear-gradient(110deg,#d4b76a0c,#91cabb06);padding:12px 15px;display:flex;gap:12px;align-items:center;margin-bottom:12px;min-height:65px}.goal-icon{font-size:27px;color:#a2d3b3;width:31px;text-align:center}.goal-text{flex:1}.goal strong{display:block;font-size:13px;font-weight:500}.goal small{display:block;font-size:10px;color:var(--muted);margin-top:4px}.goal-progress{display:flex;gap:4px}.goal-progress i{height:7px;width:7px;border-radius:50%;background:#e4c68122}.goal-progress i.done{background:var(--gold);box-shadow:0 0 7px #ffdc9677}.world{position:relative;aspect-ratio:1;border-radius:24px;overflow:hidden;isolation:isolate;box-shadow:0 12px 40px #0004,0 0 35px #edc76811;border:1px solid #edce7c66}.scene{position:absolute;inset:0}.room{position:absolute;inset:0}.room img{width:100%;height:100%;object-fit:cover;animation:room-drift 18s ease-in-out infinite alternate}.room::after{content:'';position:absolute;inset:0;box-shadow:inset 0 0 55px #06102477;background:linear-gradient(#0611261a,transparent 45%,#07122280)}.owl{position:absolute;bottom:45%;left:36%;width:28%;padding:0;border:0;background:none!important;z-index:3;filter:drop-shadow(0 8px 5px #02091766);animation:breathe 4s ease-in-out infinite;transition:left .9s,bottom .9s;transform-origin:50% 90%}.owl img{width:100%;height:auto;display:block;transform-origin:50% 85%;animation:curious 12s ease-in-out infinite}.owl img.lavender{filter:sepia(.15) hue-rotate(285deg) saturate(.75)}.owl img.teal{filter:hue-rotate(120deg)}.owl .egg{display:block;font-size:clamp(54px,15vw,90px);line-height:1.3;filter:drop-shadow(0 0 20px #f7d48c99);animation:breathe 3s infinite}.owl.happy{animation:happy .5s ease-in-out 2}.cage-front{position:absolute;inset:24% 30% 22% 26%;z-index:4;pointer-events:none;transform-origin:left center;transition:transform 1s,opacity 1s;opacity:.55}.cage-front svg{width:100%;height:100%}.cage-open .cage-front{transform:perspective(600px) rotateY(-100deg);opacity:0}.cage-open .owl{bottom:28%;left:38%}.trail{position:absolute;inset:11px;display:grid;grid-template-columns:repeat(6,1fr);grid-template-rows:repeat(6,1fr);gap:5px;pointer-events:none;z-index:8}.tile{align-self:center;justify-self:center;width:70%;aspect-ratio:1;display:grid;place-items:center;border:1px solid #ebc56b6b;border-radius:50%;color:#f0d49d;background:radial-gradient(circle at 35% 30%,#31495ff5,#0e2032ee);box-shadow:0 2px 6px #020b1899;font:20px Georgia,serif;position:relative}.tile.current{border-color:#ffe7a8;background:radial-gradient(circle,#ac873a,#444431);box-shadow:0 0 15px #ffdb8577,inset 0 0 8px #ffe89b33}.token{width:90%;position:absolute;inset:1% 5%;filter:drop-shadow(0 2px 2px #0009)}.token img{width:100%;height:100%;object-fit:contain}.tile.visited{animation:tile-pulse .3s}.world-label{position:absolute;bottom:24%;width:100%;text-align:center;font-size:8px;letter-spacing:2px;color:#f5e3bb99;pointer-events:none;z-index:5}.story{margin:13px 0 11px;min-height:34px;text-align:center;font-size:12px;line-height:1.5;color:#e8dbb9;display:flex;align-items:center;justify-content:center}.care-actions{display:flex;justify-content:center;gap:10px;margin-bottom:14px}.care-actions button{padding:10px 15px;font-size:15px;min-height:44px;flex:1;max-width:160px;background:#192e3a}.care-actions span{font-size:12px;margin-left:5px}.care-actions button.need{border-color:#e4c681a0;color:var(--gold)}.play-action{text-align:center}.primary{width:100%;min-height:57px;font-size:17px;font-weight:600;color:#28322e;border:1px solid #ffedbe77;border-radius:15px;background:linear-gradient(115deg,#dfbb70,#f5dda5 48%,#dfb566);box-shadow:0 5px 25px #e4c68118;display:flex;align-items:center;justify-content:center;gap:12px}.primary:hover{background:linear-gradient(115deg,#efd08b,#ffe8b6,#e9c681)}.primary:disabled{filter:saturate(.4);opacity:.8}.primary small{font-size:10px;border-left:1px solid #24362e33;padding-left:12px;font-weight:400}#die{font-size:29px;line-height:1}#dice-note{font-size:10px;color:var(--muted);margin:8px 0 0;min-height:15px}.save-note{font-size:9px;color:#758c99;margin:12px 0 0;text-align:center}.rolling{animation:roll .16s infinite}.gift{position:absolute;font-size:26px;z-index:5;filter:drop-shadow(0 3px 4px #0008)}.gift.plants{left:20%;bottom:18%}.gift.lantern{right:19%;bottom:31%}.gift.books{right:22%;bottom:16%}.lantern-glow{animation:lantern 3s ease-in-out infinite alternate}dialog{color:var(--cream);background:#192d3b;border:1px solid #dfc68150;border-radius:20px;padding:28px;max-width:420px;width:92%;max-height:90dvh}dialog::backdrop{background:#061220d9;backdrop-filter:blur(6px)}dialog h2{font:26px Georgia,serif;margin:0 0 20px}dialog label{display:block;font-size:13px;color:var(--muted);margin:20px 0}dialog input{display:block;width:100%;accent-color:var(--gold);margin:12px 0}dialog p{color:var(--muted);font-size:12px;line-height:1.6}.close{position:absolute;top:10px;right:10px;border:0;padding:5px 12px;font-size:24px}.settings-actions{display:flex;gap:8px;flex-wrap:wrap}.settings-actions button{font-size:12px}.room,.owl,.tile,.cage-front{will-change:auto}@keyframes breathe{50%{transform:translateY(-3px) scale(1.02)}}@keyframes curious{0%,30%,55%,100%{transform:rotate(0)}34%,40%{transform:rotate(-4deg)}75%,81%{transform:rotate(4deg)}}@keyframes happy{50%{transform:translateY(-9px) rotate(5deg)}}@keyframes room-drift{to{transform:scale(1.025)}}@keyframes roll{50%{transform:rotate(18deg) scale(.9)}}@keyframes tile-pulse{50%{transform:scale(1.12)}}@keyframes lantern{to{filter:drop-shadow(0 0 12px #f4c75e)}}@media(min-width:760px){header{padding-top:24px}.greeting{margin-top:16px}.world{max-height:480px}.greeting h1{font-size:32px}.story{font-size:13px}}@media(max-width:380px){header{padding:10px 16px 4px}h1{font-size:25px}.greeting{margin:7px 0 12px}.goal{padding:10px 12px;min-height:59px}.care-actions{gap:7px}.care-actions button{padding:9px}.tile{font-size:17px}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
/* The entire play loop stays inside the visible portrait viewport. */
header{height:56px;padding:6px 16px;flex:none}main{height:calc(100dvh - 56px);max-height:960px;display:flex;flex-direction:column;padding:0 16px 8px}.greeting{flex:none;margin:5px 0 10px}.greeting h1{font-size:27px}.goal{flex:none;padding:10px 13px;min-height:57px;margin-bottom:10px}.world{flex:1;min-height:0;max-height:480px;aspect-ratio:auto;overflow:hidden}.trail{grid-template-rows:repeat(6,minmax(0,1fr))}.tile{height:min(74%,43px);width:auto;max-width:85%;font-size:19px}.story{flex:none;min-height:32px;margin:8px 0;font-size:11px}.care-actions{flex:none;margin-bottom:10px}.care-actions button{min-height:42px;padding:9px 12px}.play-action{flex:none}.primary{min-height:53px}.save-note{margin:6px 0 0;font-size:8px;flex:none}.greeting p{font-size:11px}.goal small{font-size:9px}#dice-note{font-size:9px;margin-top:6px}.owl{width:min(28%,145px)}@media(max-height:700px){.greeting{margin:0 0 8px}.greeting h1{font-size:23px;margin-bottom:4px}.goal{min-height:51px;padding:8px 11px}.goal strong{font-size:12px}.goal-icon{font-size:22px}.story{min-height:29px;font-size:10px}.care-actions{gap:6px;margin-bottom:8px}.care-actions button{min-height:39px;padding:7px}.primary{min-height:49px;font-size:16px}.save-note{display:none}.owl{width:24%}.world-label{display:none}.tile{font-size:15px}.goal-progress{gap:3px}.goal-progress i{width:5px;height:5px}}
