:root{--cream:#fffaeb;--blue:#285ac8;--yellow:#ffd23f;--ink:#243044;--line:#8cc4ff;--good:#4cb050;color:var(--ink);background:var(--cream);font-family:Trebuchet MS,Segoe UI,sans-serif}*{box-sizing:border-box}html,body{background:var(--cream);height:100%;margin:0}body{touch-action:manipulation;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;overflow:hidden}button,input,select{font:inherit;color:inherit}button{cursor:pointer}img{display:block}.app{height:100dvh;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);flex-direction:column;display:flex}.top{align-items:center;gap:8px;padding:8px 10px 4px;display:flex}.top h1{text-align:center;min-width:0;color:var(--blue);white-space:nowrap;text-overflow:ellipsis;flex:1;margin:0;font-size:clamp(22px,4.2vw,40px);overflow:hidden}.top h1.home-title{text-overflow:clip;font-size:clamp(15px,2.5vw,34px)}.icon-btn,.text-btn,.big-btn,.digit,.choice,.tile,.num,.cell{background:var(--yellow);color:#5a3b00;border:3px solid #e0b000;border-radius:16px;font-weight:800}.icon-btn,.text-btn{background:var(--yellow);min-height:48px;padding:0 12px}.icon-spacer{width:48px}.big-btn{min-height:56px;padding:8px 16px;font-size:20px}.big-btn.alt{border-color:var(--line);color:var(--blue);background:#fff}.text-btn.quiet{color:#a33;background:#fff;border-color:#f0c2c2}.text-btn.on,.avatar-pick.on,.profile-card.on{border-color:var(--good);box-shadow:0 0 0 3px #c8f0c8}.stage-host{flex-direction:column;flex:1;min-height:0;display:flex}.stage{flex:1;padding:8px 12px 20px;overflow:auto}.hint{text-align:center;color:#4d6288;margin:6px 0 10px;font-size:16px}h2,h3{color:var(--blue);text-align:center;margin:8px 0}.loading{color:var(--blue);text-align:center;margin:auto;padding:24px;font-size:28px;font-weight:800}.menu{grid-template-columns:1fr 1fr;gap:12px;display:grid}.game-card,.word-card,.profile-card{border:4px solid var(--line);background:#fff;border-radius:22px;flex-direction:column;min-width:0;padding:8px;display:flex;position:relative;box-shadow:0 6px #d5e7ff}.game-card{min-height:30dvh}.game-card .pic,.word-card .pic,.profile-card .pic{flex:1;min-height:72px}.game-card b,.word-card b,.profile-card b{text-align:center;white-space:nowrap;font-size:16px;display:block;overflow:hidden}.cards,.profile-row{grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:10px;display:grid}.word-card .pic{height:22vw;max-height:160px}.word-card.mini{width:120px}.word-card.mini .pic{height:72px}.done{border-color:var(--good)}.done:after{content:"✓";background:var(--good);color:#fff;border-radius:50%;place-items:center;width:28px;height:28px;font-size:18px;display:grid;position:absolute;top:6px;right:6px}.pic,.pic-fill{justify-content:center;align-items:center;width:100%;height:100%;display:flex}.pic-fill svg,.pic-fill img,.pic svg,.pic img{object-fit:contain;width:100%;height:100%}.hero{justify-content:center;align-items:center;height:min(42dvh,420px);display:flex}.hero .pic-fill,.hero svg:not(.trace-svg),.hero img{width:100%;height:100%}.letter-hero,.song-hero{color:var(--blue);font-size:min(28dvh,180px);font-weight:900;line-height:1}.caption,.caption-row{text-align:center;color:var(--blue);white-space:nowrap;min-height:1.3em;font-size:clamp(18px,3vw,32px);font-weight:800}.spell-word{margin:0 6px;display:inline-block}.spell-word .off{color:#3a5eaa}.spell-word .on{color:#163a78;background:#ffd23f;border-radius:8px;padding:0 3px}.tiles,.choice-row,.row-between,.row-center,.object-grid{flex-wrap:wrap;justify-content:center;align-items:center;gap:8px;display:flex}.row-between{justify-content:space-between}.tile,.choice,.num{width:var(--s,72px);height:var(--s,72px);font-size:calc(var(--s,72px) * .42)}.choice{border-color:var(--line);width:auto;min-width:88px;min-height:88px;color:var(--blue);background:#fff;font-size:40px}.choice.small{min-width:0;min-height:64px;font-size:28px}.choice.next,.tile.next,.cell.next,.num.next{background:var(--yellow)}.tile.used,.choice.used,.num.used,.cell.on{border-color:var(--good);background:#d9f5d9}.letter-grid{grid-template-columns:repeat(auto-fill,minmax(64px,1fr));gap:8px;display:grid}.num-grid{flex-wrap:wrap;justify-content:center;gap:8px;display:flex}.hundred{grid-template-columns:repeat(10,minmax(0,1fr));gap:4px;display:grid}.cell{border-color:var(--line);min-height:6.4dvh;color:var(--blue);background:#fff;padding:0;font-size:clamp(12px,2vw,18px)}.obj{border:3px solid var(--line);background:#fff;border-radius:16px;width:min(18vw,110px);height:min(18vw,110px);padding:4px}.obj.on{border-color:var(--good);background:#e9f8e9}.object-grid .pic-fill{width:72px;height:72px}.equation{justify-content:center;align-items:center;gap:12px;display:flex}.pile{flex-wrap:wrap;justify-content:center;width:min(30vw,180px);display:flex}.pile .pic-fill{width:52px;height:52px}.op{color:var(--blue);font-size:48px;font-weight:900}.trace-board{touch-action:none;width:100%}.trace-svg{aspect-ratio:100/110;border:4px solid var(--line);touch-action:none;background:#fff;border-radius:24px;width:auto;height:min(64dvh,72vw)}.three-canvas{touch-action:none;width:100%;height:100%;display:block}.letter-preview{color:var(--blue);font-size:32px;font-weight:900}.story-text{text-align:center;font-size:22px;line-height:1.6}.story-word{border-radius:8px;margin:2px;padding:0 4px;display:inline-block}.story-word.on{background:var(--yellow)}.swatch{border:2px solid #e6e6e6;border-radius:8px;height:16px}.celebrate,.break-screen{text-align:center;flex-direction:column;justify-content:center;align-items:center;gap:12px;min-height:100%;padding:16px;display:flex}.celebrate{background:var(--cream)}.sticker-hero{width:min(40vw,220px);height:min(40vw,220px)}.hold{color:#5a3b00;background:#fff;border:4px solid #e0b000;border-radius:18px;min-width:min(280px,80vw);min-height:64px;font-size:20px;font-weight:800;position:relative;overflow:hidden}.hold-bar{background:var(--yellow);width:0;position:absolute;top:0;bottom:0;left:0}.hold span:last-child{position:relative}.confetti{pointer-events:none;z-index:40;position:fixed;inset:0;overflow:hidden}.confetti i{border-radius:2px;width:10px;height:16px;animation-name:fall;animation-timing-function:linear;animation-fill-mode:forwards;position:absolute;top:-12px}@keyframes fall{to{transform:translateY(110dvh)rotate(400deg)}}@keyframes wiggle{25%{transform:translate(-8px)}75%{transform:translate(8px)}}.wiggle{animation:.35s wiggle}.gate-prompt{color:var(--blue);text-align:center;font-size:clamp(28px,5vw,44px);font-weight:900}.gate-entry{text-align:center;letter-spacing:6px;min-height:48px;font-size:36px;font-weight:900}.digit-pad{grid-template-columns:repeat(3,76px);justify-content:center;gap:8px;display:grid}.digit{height:64px;font-size:28px}.digit:last-child{grid-column:2}.parent{flex-direction:column;gap:8px;display:flex}.identity,.family-row,.progress-row,.stack{align-items:center;gap:8px;display:flex}.stack{flex-direction:column;flex:1;align-items:stretch}.family-row{flex-wrap:wrap}.photo-btn{border:3px solid var(--line);background:#fff;border-radius:16px;width:72px;height:72px;padding:4px;overflow:hidden}.big-photo{width:120px;height:120px}.field{border:3px solid var(--line);background:#fff;border-radius:12px;flex:1;min-width:0;min-height:48px;padding:8px 10px}.file{opacity:0;pointer-events:none;width:1px;height:1px;position:absolute}.progress-row b{width:9rem;font-size:15px}.bar{background:#e7f0ff;border-radius:8px;flex:1;height:14px;overflow:hidden}.bar i{background:var(--good);height:100%;display:block}.avatar-pick{border:3px solid var(--line);background:#fff;border-radius:18px;width:84px;height:84px;padding:4px}.sticker-grid{grid-template-columns:repeat(auto-fill,minmax(72px,1fr));gap:8px;display:grid}.sticker{aspect-ratio:1;opacity:.35;background:#fff;border:3px dashed #d7e8ff;border-radius:16px;padding:6px}.sticker.earned{opacity:1;border-style:solid;border-color:var(--yellow)}.profile-card{min-height:120px}@media (orientation:landscape){.menu{grid-template-columns:repeat(4,1fr)}.game-card{min-height:36dvh}.parent{max-width:860px;margin:0 auto}}
