:root{color:#69442d;background:#eddfcf;font-family:"Hiragino Maru Gothic ProN","Yu Gothic",system-ui,sans-serif;font-weight:750;--line:#c99e75;--cream:#fff9ed;--rose:#cc6890;--shadow:0 3px 0 #9b64432b,0 6px 18px #75402424}
*{box-sizing:border-box}body{margin:0;overflow:hidden}button{font:inherit;color:inherit;cursor:pointer;border:1px solid var(--line);background:linear-gradient(#fffdf7,#ffefdc);box-shadow:var(--shadow);border-radius:18px;min-width:44px;min-height:44px;-webkit-tap-highlight-color:transparent;user-select:none}button:active{transform:translateY(2px);box-shadow:none}button:focus-visible{outline:3px solid #94546d;outline-offset:-3px}button[aria-pressed=true]{border-color:var(--rose);box-shadow:inset 0 0 0 2px #eb91ab;background:#fff0ef}.icon svg{width:25px;height:25px;display:block;margin:auto}.icon small{display:block;font-size:10px;margin-top:2px}.icon{padding:5px 8px}.toolbar{z-index:3;position:absolute;top:max(10px,env(safe-area-inset-top));left:max(10px,env(safe-area-inset-left));right:max(10px,env(safe-area-inset-right));display:flex;justify-content:space-between;pointer-events:none}.toolbar>*{pointer-events:auto}.actions{display:flex;gap:7px}.hold{touch-action:none}.hold.holding{background:#f5d2b8}
#app{height:100dvh;max-width:1440px;margin:auto;position:relative;overflow:hidden;background:#fff2e2}.home,.studio,.camera,.album,.settings{height:100%;position:relative}.home{background:#efcfad url(./assets/shop.webp) center/cover;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:max(58px,env(safe-area-inset-top)) 10px max(13px,env(safe-area-inset-bottom))}.sign{position:relative;margin:8px auto 0;padding:.22em .75em .28em;background:#fff6dd;border:3px double #b18650;border-radius:45% 45% 35% 35%;box-shadow:var(--shadow);color:#754324;font-size:clamp(33px,7vw,65px);letter-spacing:.07em;white-space:nowrap}.sign::after{content:"";position:absolute;inset:4px;border:1px dashed #dcb785;border-radius:inherit;pointer-events:none}.sign svg{display:block;width:.75em;height:.60em;margin:auto}.children{display:flex;width:min(100%,660px);flex:1;min-height:0;max-height:640px;justify-content:center;gap:4px}.child{width:50%;background:none;border:0;box-shadow:none;display:flex;flex-direction:column;align-items:center;min-height:0;padding:0}.child canvas{min-height:0;flex:1;width:100%;object-fit:contain;filter:drop-shadow(0 6px 4px #60402333)}.child span{font-size:clamp(16px,4vw,25px);width:95%;padding:10px 2px;border-radius:25px;border:2px solid #db88a0;background:linear-gradient(#fff1ed,#fbbdcf);box-shadow:var(--shadow);white-space:nowrap}.child:nth-child(2) span{border-color:#7dadd1;background:linear-gradient(#f2f9ff,#bce0ff)}
.studio{display:flex;flex-direction:column}.stage,.camera-view{min-height:0;flex:1;position:relative;overflow:hidden;background:#dfc39f}.scene{width:100%;height:100%;display:block}.parts{display:grid;gap:3px;position:absolute;left:max(8px,env(safe-area-inset-left));top:63px;bottom:6px;align-content:center}.parts button{border-radius:50%;padding:4px;width:44px;height:44px}.tray{position:relative;z-index:2;background:#fff8ec;border-top:2px solid #dbb892;border-radius:18px 18px 0 0;box-shadow:0 -3px 14px #72513c25;padding:5px max(7px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(7px,env(safe-area-inset-left))}.categories{display:flex;gap:3px;justify-content:center}.categories button{flex:1;display:flex;align-items:center;justify-content:center;gap:3px;padding:3px;font-size:clamp(10px,2.9vw,15px);white-space:nowrap;min-height:43px;border-radius:12px 12px 7px 7px}.categories svg{width:19px;height:19px;flex:none}.items{display:flex;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;touch-action:pan-x;gap:5px;padding:5px 1px}.item{flex:0 0 clamp(61px,17vw,89px);height:75px;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:2px;border-radius:11px;touch-action:pan-x}.item img,.item canvas{width:100%;height:50px;object-fit:contain;pointer-events:none}.item small{max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:10px;pointer-events:none}.colors{display:flex;gap:5px;justify-content:center;padding-top:4px}.colors button{min-height:37px;min-width:43px;border-radius:14px}.ghost{position:fixed;width:74px;height:74px;object-fit:contain;z-index:10;pointer-events:none;filter:drop-shadow(0 3px 3px #68473666)}
.camera{display:flex;flex-direction:column;background:#fff2df}.camera-view{margin:0}.frame{position:absolute;inset:11% 9% 8%;border:2px solid #fff9;border-radius:20px;pointer-events:none}.shutter-bar{display:grid;place-items:center;padding:8px 0 max(9px,env(safe-area-inset-bottom));background:#fff3e1}.shutter{width:68px;height:68px;border:4px solid #fff5e7;outline:2px solid #cc7484;background:linear-gradient(#ffb5be,#eb7e99);border-radius:50%}.shutter svg{width:32px;height:32px}.flash{position:absolute;inset:0;background:#fff7e9;opacity:0;pointer-events:none}.flash.fire{animation:flash .29s ease-out}@keyframes flash{25%{opacity:.65}}.fly{position:absolute;z-index:5;width:min(50vw,245px);max-height:55%;object-fit:contain;background:white;padding:7px 7px 16px;left:50%;top:43%;box-shadow:0 8px 25px #63463160;animation:fly .86s both;pointer-events:none}.camera-album{opacity:0;pointer-events:none;min-height:44px;min-width:44px;display:grid;place-items:center;border-radius:16px;background:#fff4e4;border:1px solid var(--line);box-shadow:var(--shadow)}.camera.saving .camera-album{opacity:1;transition:opacity .2s}@keyframes fly{0%{transform:translate(-50%,-50%) scale(.88) rotate(-5deg);opacity:0}20%,52%{transform:translate(-50%,-50%) scale(1) rotate(-5deg);opacity:1}100%{left:calc(100% - 26px - env(safe-area-inset-right));top:calc(26px + env(safe-area-inset-top));transform:translate(-50%,-50%) scale(.12) rotate(7deg);opacity:0}}
.album,.settings{background:radial-gradient(ellipse at top,#fffaf0,#f3dfc8);padding: max(60px,calc(env(safe-area-inset-top) + 55px)) 12px max(12px,env(safe-area-inset-bottom));display:flex;flex-direction:column;align-items:center;gap:10px}.album h1,.settings h1{font-size:24px;margin:0}.album-tabs{display:flex;gap:8px}.album-tabs button,.settings button.toggle{min-width:115px;padding:8px}.photos{overflow:auto;width:min(100%,820px);display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:9px;align-content:start;padding:6px}.photos button{padding:4px;border-radius:10px;background:#fffaf2}.photos img{aspect-ratio:1;object-fit:cover;width:100%;display:block;border-radius:6px}.empty{grid-column:1/-1;text-align:center;padding:18px}.photo-large{object-fit:contain;min-height:0;max-width:96%;height:100%;border:7px solid white;border-bottom-width:14px;box-shadow:var(--shadow);border-radius:5px;touch-action:pan-y}.photo-frame{min-height:0;flex:1;display:flex;justify-content:center;width:100%}.photo-actions{display:flex;gap:8px}.photo-actions button{padding:4px 10px}.settings label{display:flex;justify-content:space-between;align-items:center;gap:16px;width:min(100%,340px);padding:12px;border-bottom:1px solid #dbb892}.notice,#notice{position:fixed;z-index:11;bottom:calc(16px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);border-radius:16px;background:#704b37;color:white;padding:9px 14px;text-align:center;width:max-content;max-width:90%;pointer-events:none}#notice:empty{display:none}
@media(max-height:690px) and (orientation:portrait){.parts{gap:2px}.parts button{height:40px;min-height:40px}.parts svg{width:23px;height:23px}.item{height:64px}.item img,.item canvas{height:42px}}
@media(orientation:landscape){.home{padding-top:8px}.sign{font-size:clamp(29px,5.7vh,56px)}.children{width:min(67%,720px)}.child span{font-size:clamp(15px,3vh,25px)}.parts{grid-template-rows:repeat(4,44px);grid-auto-flow:column;align-content:center}.camera{display:block}.camera-view{height:100%}.shutter-bar{position:absolute;bottom:0;left:50%;transform:translateX(-50%);background:none}.album,.settings{padding-top:max(18px,env(safe-area-inset-top))}}
@media(orientation:landscape) and (min-height:640px){.parts{grid-template-rows:repeat(8,49px)}.parts button{height:48px;width:48px}.tray{padding-top:8px}.items{justify-content:safe center}.item{height:93px}.item img,.item canvas{height:67px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important}}
.child canvas{object-fit:fill;display:block;flex:1 1 0}
.home .children{max-height:540px}
@media(orientation:portrait){.home .children{width:min(95%,660px);max-height:580px}.home{justify-content:space-between}.home .sign{margin-top:clamp(10px,7vh,58px);font-size:clamp(38px,10vw,72px)}}
@media(orientation:portrait) and (max-height:645px){.parts{top:53px;bottom:4px;grid-auto-rows:minmax(34px,1fr)}.parts button{width:39px;min-width:39px;min-height:31px;height:100%;max-height:42px}.parts svg{width:20px;height:20px}.colors button{min-height:32px}}
@media(orientation:landscape) and (max-height:415px){.parts{top:51px;grid-template-rows:repeat(4,35px);gap:2px}.parts button{width:35px;min-width:35px;height:35px;min-height:35px}.parts svg{width:20px;height:20px}.item{height:61px}.item img,.item canvas{height:39px}.categories button{min-height:36px}}
@media(orientation:landscape) and (max-height:420px){.shutter{width:58px;height:58px}}
@media(orientation:portrait){.home{background-image:url(./assets/shop-portrait.webp);background-position:center}}

.shutter:disabled{transform:translateY(2px) scale(.94);box-shadow:none}
.album h1{display:flex;align-items:center;gap:.38em}
.album h1 svg{width:1.05em;height:1.05em}
.flash::before,.flash::after{content:"";position:absolute;left:0;right:0;height:50%;background:#75504750;transform:scaleY(0)}
.flash::before{top:0;transform-origin:top}
.flash::after{bottom:0;transform-origin:bottom}
.flash.fire::before,.flash.fire::after{animation:close-shutter .29s ease-in-out}
@keyframes close-shutter{0%,100%{transform:scaleY(0)}26%{transform:scaleY(1)}}
@media(prefers-reduced-motion:reduce){.flash.fire::before,.flash.fire::after{animation:none}}
