:root{--rox:#9d1d96;--rox-deep:#662d91;--rox-dark:#3d0f3b;--green:#76bc21;--orange:#ff8300;--blush:#eecfe3;--cream:#fffaf6;--ink:#2a1029;
--head:"Montserrat","Avenir Next","Trebuchet MS",system-ui,sans-serif}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;overflow:hidden;background:linear-gradient(160deg,var(--rox) 0%,var(--rox-deep) 70%,var(--rox-dark) 100%);color:var(--ink);
font-family:var(--head);-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;touch-action:manipulation;overscroll-behavior:none}
#app{position:fixed;inset:0;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
.screen{display:none;height:100%}
.screen.on{display:flex;flex-direction:column}
/* home */
#home{overflow-y:auto;-webkit-overflow-scrolling:touch}
.hd{display:flex;flex-direction:column;align-items:center;padding:14px 12px 6px;color:#fff}
.logo{width:112px;height:auto;display:block;filter:drop-shadow(0 2px 4px rgba(0,0,0,.25))}
.ttl{font-weight:900;font-style:italic;font-size:26px;letter-spacing:.3px;text-shadow:0 3px 0 rgba(0,0,0,.18);margin-top:2px}
.tiles{display:grid;grid-template-columns:repeat(2,1fr);gap:14px;padding:12px 14px 28px;max-width:980px;width:100%;margin:0 auto}
@media (min-width:640px){.tiles{grid-template-columns:repeat(3,1fr)}}
@media (min-width:900px){.tiles{grid-template-columns:repeat(5,1fr)}}
.tile{position:relative;border:0;padding:8px 8px 6px;border-radius:22px;background:var(--cream);box-shadow:0 6px 0 rgba(0,0,0,.2),0 10px 22px rgba(0,0,0,.18);cursor:pointer;display:flex;flex-direction:column;align-items:center;transition:transform .12s}
.tile:active{transform:scale(.96)}
.tile svg{width:100%;height:auto;aspect-ratio:400/520;display:block;border-radius:14px;background:#fff}
.tile .nm{font-size:12px;font-weight:800;color:var(--rox-deep);margin-top:4px;line-height:1.1;text-align:center}
.tile .star{position:absolute;top:-6px;right:-6px;width:40px;height:40px;display:none}
.tile.complete .star{display:block}
/* paint */
.bar{display:flex;gap:8px;justify-content:space-between;align-items:center;padding:8px 10px 4px}
.ib{position:relative;width:54px;height:54px;flex:0 0 auto;border:0;border-radius:18px;background:var(--cream);box-shadow:0 4px 0 rgba(0,0,0,.22);display:grid;place-items:center;cursor:pointer;padding:0}
.ib:active{transform:translateY(3px);box-shadow:0 1px 0 rgba(0,0,0,.22)}
.ib svg{width:36px;height:36px;fill:none;stroke:var(--rox-deep);stroke-width:4.5;stroke-linecap:round;stroke-linejoin:round}
.ib svg rect{fill:var(--rox-deep);stroke:none}
.ib.done{background:var(--green);width:72px}
.ib.done svg{stroke:#fff;stroke-width:7;width:42px;height:42px}
.ib .prog{stroke:var(--orange);stroke-width:5;stroke-dasharray:132;stroke-dashoffset:132;transform:rotate(-90deg);transform-origin:24px 24px;opacity:0}
.ib.holding .prog{opacity:1;stroke-dashoffset:0;transition:stroke-dashoffset .9s linear}
.ib.wiggle{animation:wig .45s}
@keyframes wig{20%{transform:rotate(-12deg)}40%{transform:rotate(10deg)}60%{transform:rotate(-8deg)}80%{transform:rotate(5deg)}}
.ib .woff{display:none}.muted .ib .won{display:none}.muted .ib .woff{display:block}
.ib .spk{fill:var(--rox-deep)}
.ib:disabled{opacity:.45}
.stage{flex:1 1 auto;min-height:0;display:flex;align-items:center;justify-content:center;padding:6px 10px}
.stage svg{background:#fff;border-radius:22px;box-shadow:0 8px 24px rgba(0,0,0,.25);touch-action:none;display:block}
.pal{display:grid;grid-template-columns:repeat(6,1fr);gap:8px;padding:6px 12px 12px;max-width:520px;width:100%;margin:0 auto}
.dot{aspect-ratio:1;width:100%;max-width:58px;justify-self:center;border-radius:50%;border:4px solid #fff;box-shadow:0 3px 0 rgba(0,0,0,.25);cursor:pointer;padding:0;transition:transform .12s}
.dot.sel{transform:scale(1.14);border-color:var(--ink);box-shadow:0 0 0 4px #fff,0 4px 8px rgba(0,0,0,.35)}
@media (orientation:landscape) and (min-width:700px){
  #paint.on{display:grid;grid-template-columns:1fr auto;grid-template-rows:auto 1fr}
  .bar{grid-column:1/3}
  .pal{grid-template-columns:repeat(2,64px);align-content:center;padding:10px 18px;width:auto}
  .dot{width:58px}
}
@media (max-height:600px){.ib{width:48px;height:48px}.ib.done{width:64px}.pal{gap:6px;padding-bottom:8px}.dot{max-width:48px}}
/* art */
.r{fill:#fff;stroke:var(--ink);stroke-width:4;stroke-linejoin:round;stroke-linecap:round;cursor:pointer;transition:fill .18s}
.d{fill:none;stroke:var(--ink);stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.k{fill:var(--ink);stroke:none;pointer-events:none}
.w{fill:#fff;stroke:none;pointer-events:none}
.e{fill:#fff;stroke:var(--ink);stroke-width:3;pointer-events:none}
.fx,image{pointer-events:none}
.t{font:800 11.5px var(--head);fill:var(--ink);pointer-events:none}
.ripple{fill:none;stroke:#fff;stroke-width:5;pointer-events:none;transform-box:fill-box;transform-origin:center;animation:rip .45s ease-out forwards}
@keyframes rip{from{transform:scale(.1);opacity:.95}to{transform:scale(1);opacity:0}}
/* fx */
#fx{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;z-index:20}
#balloons{position:fixed;inset:0;pointer-events:none;z-index:21;overflow:hidden}
.bal{position:absolute;left:0;top:0;width:78px;height:130px;pointer-events:auto;cursor:pointer;touch-action:none;will-change:transform}
.bal svg{width:100%;height:100%;overflow:visible}
.bigstar{position:fixed;left:50%;top:42%;width:180px;height:180px;margin:-90px 0 0 -90px;z-index:22;pointer-events:none;animation:star 1.6s ease-out forwards}
@keyframes star{0%{transform:scale(.2) rotate(-30deg);opacity:0}25%{transform:scale(1.15) rotate(8deg);opacity:1}45%{transform:scale(1) rotate(0)}80%{opacity:1}100%{transform:scale(1.25);opacity:0}}
.pal.wiggle{animation:wig .45s}
