:root{color-scheme:dark;--ink:#f6f4e9;--gold:#f1d39b;--muted:#b6c6be;--nav:calc(70px + env(safe-area-inset-bottom));font-family:"Inter",system-ui,sans-serif}
*{box-sizing:border-box}body{margin:0;background:#0b1c22;color:var(--ink);overflow:hidden}button{cursor:pointer;color:inherit;font:inherit;border:0;background:none;touch-action:manipulation}button:focus-visible,[tabindex]:focus-visible{outline:2px solid var(--gold);outline-offset:3px}[hidden]{display:none!important}h1,h2,h3,p{margin:0}svg{width:22px;height:22px;display:block;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;fill:none}i{font-style:normal}h1,h2{font-family:Georgia,"Times New Roman",serif;font-weight:500;letter-spacing:-.045em}h1{font-size:clamp(38px,5vw,68px);line-height:1.05}
.entry,.screen{position:fixed;inset:0;overflow:hidden}.entry{display:grid;align-items:end;padding:clamp(26px,7vw,100px);padding-bottom:max(12vh,env(safe-area-inset-bottom));background:linear-gradient(0deg,#06131afc 0%,#06131ae6 17%,#06131a22 68%),url(tree.webp) center/cover}.entry h1{margin:12px 0}.entry p,.page>p,.selection p{color:#c4d1cd;font-size:15px;line-height:1.5}.signature{display:inline-flex;align-items:center;gap:9px;font-weight:700;font-size:10px;letter-spacing:2.3px;color:var(--gold)}.signature i{height:10px;width:1px;background:#cfbd9080}
#camera,#flakes,.shade{position:absolute;inset:0;pointer-events:none}#camera{background:#112532 url(tree.webp) center/cover;isolation:isolate}#camera:before{content:"";position:absolute;inset:0;background:linear-gradient(180deg,#1227345c,transparent 48%,#0c1c25b8);backdrop-filter:blur(12px)}#stage{pointer-events:auto;cursor:crosshair;position:absolute;top:46%;left:50%;transform:translate(-50%,-50%);width:max(100vw,min(184vw,134vh));aspect-ratio:1.5;mask-image:linear-gradient(transparent,#000 10%,#000 88%,transparent)}.backdrop,#decor{position:absolute;inset:0;width:100%;height:100%}.backdrop,#decor{pointer-events:none}.hung{position:absolute;width:5.8%;aspect-ratio:1;padding:0;transform:translate(-50%,-10%);pointer-events:auto}.hung img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 2px 2px #0008)}.shade{background:linear-gradient(180deg,#071519ad 0%,transparent 23%,transparent 62%,#07171bd9 89%,#0a191c 100%)}#flakes{overflow:hidden}#flakes span{position:absolute;top:-7px;border-radius:50%;background:#fffd;animation:fall linear infinite}@keyframes fall{to{transform:translate(35px,105dvh)}}@media(prefers-reduced-motion:reduce){#flakes{display:none}}
.hud{position:absolute;top:max(23px,env(safe-area-inset-top));left:clamp(18px,5vw,80px);right:clamp(18px,5vw,80px);display:flex;justify-content:space-between;align-items:flex-start;pointer-events:none}.hud h1{margin-top:6px;text-shadow:0 2px 12px #0006}.score,.actions button,.counter,#selectedToy{border:1px solid #e7e7cb38;border-radius:99px;background:#102123af;backdrop-filter:blur(12px)}.score,.counter,#selectedToy{display:inline-flex;align-items:center;gap:8px}.score{padding:8px 13px;color:var(--gold)}.score svg,.counter svg{width:15px;height:15px}.actions{position:absolute;right:clamp(12px,3vw,44px);top:23%;display:grid;gap:8px}.actions button{width:42px;height:42px;display:grid;place-items:center}.actions [aria-pressed=false]{color:#b8c6c5}.selection{position:absolute;bottom:calc(var(--nav) + 14px);left:50%;transform:translateX(-50%);text-align:center;width:max-content;max-width:96vw;display:flex;flex-direction:column;align-items:center;gap:6px;pointer-events:none}.counter{background:none;border:0;backdrop-filter:none;color:#e2e2cf;font-size:12px}.counter svg{width:14px}.selection p{font-size:12px;text-shadow:0 1px 6px #000}.selection button{pointer-events:auto}#selectedToy{padding:4px 15px 4px 6px;font-weight:650;font-size:14px}#selectedToy img{width:34px;height:34px;object-fit:contain}#selectedToy svg{width:14px;color:var(--gold)}
nav{position:fixed;bottom:0;inset-inline:0;padding-bottom:env(safe-area-inset-bottom);background:#091b1ef0;backdrop-filter:blur(22px);border-top:1px solid #c7dbd324;z-index:4}nav>div{display:flex;max-width:590px;margin:auto;height:69px}nav button{position:relative;flex:1;display:grid;justify-items:center;align-content:center;gap:4px;color:#9cafa9;font-size:12px;font-weight:600}nav button.active{color:var(--gold)}nav button.active:before{content:"";width:29px;height:2px;border-radius:4px;background:#e4c488;position:absolute;top:0}
.inner{bottom:var(--nav);overflow:auto;background:radial-gradient(ellipse at top right,#223d3d,transparent 55%),#102427}.page{width:min(100%,900px);padding:calc(env(safe-area-inset-top) + 30px) clamp(18px,5vw,58px) 38px;margin:auto}.page h1{margin:9px 0}.page>p{margin:8px 0 22px}.page button.primary{margin:10px 0}.primary{background:var(--gold);color:#192a27;font-weight:700;border-radius:12px;padding:12px 16px}#toys,#gallerylist{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}#toys{margin-top:24px}.toy,.task,.gallery-item,.empty{background:#ffffff08;border:1px solid #c7d5ce29;border-radius:16px}.toy{position:relative;display:grid;justify-items:center;align-content:center;gap:8px;padding:15px 4px}.toy img{width:76%;max-width:110px;aspect-ratio:1;object-fit:contain}.toy b{font-size:13px}.toy.selected{border-color:#d4b97f;background:#c8b37514}.status{position:absolute;right:8px;top:8px;color:var(--gold)}.status svg{width:15px;height:15px}.task,.empty,.gallery-item{padding:15px;margin:10px 0}.tasktop,.badge,.progress,.tile-icon{display:flex;align-items:center;gap:8px}.tasktop{justify-content:space-between;color:var(--gold)}.task h3,.gallery-item h3{margin:8px 0 3px}.task p,.task small,.gallery-item p,.empty p,dialog p{color:var(--muted);font-size:14px;line-height:1.45}.task small{display:block;margin-top:6px}.progress{font-size:12px;margin-top:10px}.progress span{flex:1;height:4px;border-radius:9px;background:#ffffff1c}.progress em{display:block;background:var(--gold);height:100%;border-radius:9px}.empty{grid-column:1/-1}.gallery-item{text-align:left}.previewtree{position:relative;aspect-ratio:1.5;background-size:cover;overflow:hidden;border-radius:12px}.previewtree .hung{pointer-events:none}.link{color:var(--gold)}#toast{position:fixed;bottom:calc(var(--nav) + 118px);left:50%;transform:translateX(-50%);max-width:90vw;width:max-content;padding:10px 16px;z-index:8;background:#173332f2;color:white;border-radius:12px;font-size:14px;pointer-events:none}#toast:empty{display:none}dialog{background:#16302f;color:var(--ink);border:1px solid #7e968d69;border-radius:18px;width:min(90vw,460px);padding:22px}dialog::backdrop{background:#081717bd}dialog h2{margin:0 32px 10px 0;font-size:28px}dialog p{margin:10px 0 16px}.close{float:right;font-size:26px;line-height:1}
@media(max-width:599px){#toys,#gallerylist{grid-template-columns:repeat(2,minmax(0,1fr))}.toy img{height:88px}.page h1{font-size:42px}}@media(min-aspect-ratio:1/1){#stage{width:min(100vw,131dvh);top:45%;mask-image:linear-gradient(90deg,transparent,#000 15%,#000 85%,transparent)}#camera:before{backdrop-filter:blur(28px)}.hud{top:6vh}.actions{top:25%}.selection{left:clamp(18px,5vw,80px);align-items:flex-start;transform:none}.selection p{font-size:13px}}@media(max-height:540px){.hud h1{font-size:30px}.selection p,.counter{display:none}.actions{display:flex;top:16px;right:90px}.hud{top:10px}.selection{bottom:calc(var(--nav) + 5px)}}
