@font-face{font-family:Fredoka;src:url(fredoka-bold.woff2) format('woff2');font-weight:700;font-display:swap}
html,body{margin:0;height:100%;overflow:hidden;background:#ffd6e5;font-family:Fredoka,system-ui,sans-serif;color:#1d2433;-webkit-user-select:none;user-select:none;touch-action:none;-webkit-tap-highlight-color:transparent}
#cv{position:fixed;inset:0;width:100%;height:100%;display:block;touch-action:none;outline:none}
#ui{position:fixed;inset:0;pointer-events:none;z-index:2}
#ui *,.modal *{box-sizing:border-box}
#boot{position:fixed;inset:0;z-index:5;display:flex;align-items:center;justify-content:center;background:radial-gradient(circle at 50% 40%,#fff6fa,#ffc4da);transition:opacity .4s}
#boot.out{opacity:0;pointer-events:none}
.bootin{font-size:min(9vw,56px);color:#ff5c9a;text-shadow:0 3px 0 #1d2433;text-align:center}.bootin small{display:block;font-size:18px;color:#1d2433;text-shadow:none;margin-top:8px}
.btn{pointer-events:auto;font:700 18px Fredoka,system-ui,sans-serif;color:#1d2433;background:#fff;border:3px solid #1d2433;border-radius:16px;padding:9px 18px;box-shadow:0 4px 0 #1d2433;cursor:pointer;transition:transform .08s;white-space:nowrap}
.btn:active{transform:translateY(3px);box-shadow:0 1px 0 #1d2433}
.btn:disabled{opacity:.45;cursor:default}
.pink{background:#ff8fb8!important}.yel{background:#ffd84a!important}.mint{background:#9eeacb!important}.sky{background:#a9d8ff!important}.lil{background:#d8c2ff!important}
.big{font-size:24px;padding:12px 34px;border-radius:20px}
.ico{width:46px;height:46px;padding:0;border-radius:50%;font-size:20px;display:inline-flex;align-items:center;justify-content:center}
.scr{position:absolute;inset:0;pointer-events:none}
.top{position:absolute;top:calc(8px + env(safe-area-inset-top));right:calc(8px + env(safe-area-inset-right));display:flex;gap:8px;align-items:center;pointer-events:auto}
.coins{background:#fff3b0;border:3px solid #1d2433;border-radius:999px;padding:5px 14px 5px 8px;box-shadow:0 3px 0 #1d2433;font-size:18px;display:flex;align-items:center;gap:6px}
.coin{display:inline-block;width:22px;height:22px;border-radius:50%;background:radial-gradient(circle at 35% 35%,#fff6a8,#ffc21a 60%,#e59a00);border:2px solid #1d2433}
.menu{position:absolute;left:0;right:0;bottom:calc(6vh + env(safe-area-inset-bottom));display:flex;flex-direction:column;align-items:center;gap:12px;pointer-events:none}
.title{font-size:min(13vw,86px);line-height:.95;color:#ff5c9a;text-align:center;-webkit-text-stroke:3px #1d2433;paint-order:stroke fill;text-shadow:0 6px 0 #1d2433;letter-spacing:1px}
.title span{display:block;color:#fff;font-size:.55em}
.row{display:flex;gap:10px;flex-wrap:wrap;justify-content:center;pointer-events:auto}
.sheet{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:min(760px,calc(100% - 16px));max-height:calc(100% - 90px);overflow:auto;background:rgba(255,250,244,.96);border:4px solid #1d2433;border-radius:26px;box-shadow:0 6px 0 #1d2433;padding:14px 16px;pointer-events:auto}
.sheet h2{margin:2px 0 10px;text-align:center;font-size:28px;color:#ff5c9a;-webkit-text-stroke:1.5px #1d2433;paint-order:stroke fill}
.area{border:3px solid #1d2433;border-radius:18px;padding:8px 10px;margin:8px 0;background:#fff}
.area h3{margin:0 0 6px;font-size:19px;display:flex;justify-content:space-between}
.lv{display:grid;grid-template-columns:repeat(10,1fr);gap:6px}
@media (max-width:560px){.lv{grid-template-columns:repeat(5,1fr)}}
.lb{font:700 17px Fredoka,sans-serif;aspect-ratio:1;border:3px solid #1d2433;border-radius:14px;background:#ffd6e5;box-shadow:0 3px 0 #1d2433;cursor:pointer;padding:0;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#1d2433}
.lb small{font-size:10px;color:#e59a00;letter-spacing:-1px}
.lb:disabled{background:#e5e0ea;color:#8a8496;cursor:default}
.tabs{display:flex;gap:6px;flex-wrap:wrap;justify-content:center;margin-bottom:8px}
.tab{font:700 15px Fredoka,sans-serif;border:3px solid #1d2433;border-radius:999px;padding:5px 12px;background:#fff;cursor:pointer;color:#1d2433}
.tab.on{background:#ff8fb8}
.items{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px}
.it{border:3px solid #1d2433;border-radius:16px;background:#fff;padding:8px;text-align:center;font-size:14px;display:flex;flex-direction:column;align-items:center;gap:4px}
.it img{width:54px;height:54px}.it .d{font-size:11px;color:#6b6478;min-height:26px}
.it .btn{font-size:15px;padding:5px 12px}
#panel{position:absolute;left:50%;transform:translateX(-50%);bottom:calc(8px + env(safe-area-inset-bottom));width:min(780px,calc(100% - 12px));background:rgba(255,250,244,.95);border:3px solid #1d2433;border-radius:22px;box-shadow:0 5px 0 #1d2433;padding:8px 12px 10px;pointer-events:auto}
#panel h4{margin:0 0 4px;font-size:18px;display:flex;align-items:center;gap:8px}
#panel h4 img{width:34px;height:34px}
#panel .hint{font-size:14px;color:#5b5466;margin-bottom:6px}
.opt{display:flex;align-items:center;gap:6px;margin:4px 0;overflow-x:auto;padding:2px 2px 6px}
.opt b{font-size:13px;min-width:56px;color:#6b6478}
.chip{flex:none;font:700 14px Fredoka,sans-serif;border:3px solid #1d2433;border-radius:14px;background:#fff;padding:4px 10px;cursor:pointer;color:#1d2433;display:flex;align-items:center;gap:5px;box-shadow:0 2px 0 #1d2433;touch-action:none}
.chip.on{background:#ffd84a}
.chip img{width:30px;height:30px;pointer-events:none}
.chip i{display:inline-block;width:18px;height:18px;border-radius:50%;border:2px solid #1d2433}
.acts{display:flex;gap:8px;justify-content:flex-end;align-items:center;margin-top:4px;flex-wrap:wrap}
.acts .grow{flex:1;font-size:15px}
.meter{position:relative;height:30px;border:3px solid #1d2433;border-radius:14px;overflow:hidden;margin:6px 0;display:flex}
.meter div{height:100%}
.needle{position:absolute;top:-4px;bottom:-4px;width:6px;margin-left:-3px;background:#1d2433;border-radius:3px;box-shadow:0 0 0 2px #fff}
.prog{height:16px;border:3px solid #1d2433;border-radius:10px;overflow:hidden;background:#fff;margin:4px 0}
.prog div{height:100%;background:linear-gradient(90deg,#ff8fb8,#ffd84a);width:0}
#order{position:absolute;left:calc(8px + env(safe-area-inset-left));top:calc(62px + env(safe-area-inset-top));width:212px;background:#fffaf4;border:3px solid #1d2433;border-radius:18px;box-shadow:0 4px 0 #1d2433;padding:6px 8px;pointer-events:auto;font-size:13px}
#order canvas{width:100%;height:auto;display:block;border-radius:10px;background:linear-gradient(#fff0f6,#ffe1ec)}
#order .nm{font-size:15px;display:flex;justify-content:space-between}
#order .req{display:flex;flex-wrap:wrap;gap:3px 8px;margin-top:3px}
#order .req span{display:flex;align-items:center;gap:2px}
#order .req img{width:20px;height:20px}
.pat{height:12px;border:2px solid #1d2433;border-radius:8px;overflow:hidden;background:#fff;margin-top:4px}
.pat div{height:100%;background:#7bd04a;width:100%;transition:background .3s}
.hudl{position:absolute;left:calc(8px + env(safe-area-inset-left));top:calc(8px + env(safe-area-inset-top));display:flex;gap:8px;align-items:center;pointer-events:auto}
.tag{background:#fff;border:3px solid #1d2433;border-radius:999px;padding:5px 12px;box-shadow:0 3px 0 #1d2433;font-size:16px}
.toast{position:absolute;left:50%;top:32%;transform:translate(-50%,-50%);font-size:min(8vw,44px);color:#fff;-webkit-text-stroke:2px #1d2433;paint-order:stroke fill;text-shadow:0 4px 0 #1d2433;pointer-events:none;animation:tst 1.3s ease-out forwards;white-space:nowrap;z-index:9}
@keyframes tst{0%{opacity:0;transform:translate(-50%,-30%) scale(.6)}15%{opacity:1;transform:translate(-50%,-50%) scale(1.08)}75%{opacity:1}100%{opacity:0;transform:translate(-50%,-80%)}}
.modal{position:fixed;inset:0;z-index:20;background:rgba(40,26,50,.45);display:flex;align-items:center;justify-content:center;padding:12px;font-family:Fredoka,sans-serif;pointer-events:auto}
.modal .card{background:#fffaf4;border:4px solid #1d2433;border-radius:26px;box-shadow:0 6px 0 #1d2433;padding:16px 18px;width:min(420px,100%);max-height:92vh;overflow:auto;text-align:center;color:#1d2433;animation:pop .35s cubic-bezier(.3,1.6,.5,1)}
@keyframes pop{0%{transform:scale(.6);opacity:0}100%{transform:none;opacity:1}}
.modal h2{margin:4px 0;font-size:30px;color:#ff5c9a;-webkit-text-stroke:1.5px #1d2433;paint-order:stroke fill}
.stars{font-size:46px;letter-spacing:4px;margin:2px 0}.stars .s{color:#ffc21a;-webkit-text-stroke:2px #1d2433;display:inline-block;animation:pop .4s both}.stars .e{color:#e8e0ee;-webkit-text-stroke:2px #1d2433}
.brk{text-align:left;font-size:15px;margin:8px 0;background:#fff;border:2px solid #1d2433;border-radius:12px;padding:6px 10px}
.brk div{display:flex;justify-content:space-between}
.modal .row{margin-top:10px}
.modal img.snap{width:100%;border:3px solid #1d2433;border-radius:12px}
.cred .made{font-size:34px;color:#ff5c9a;-webkit-text-stroke:1.5px #1d2433;paint-order:stroke fill;margin:6px 0}
.cred .dir{font-size:13px;color:#6b6478;margin-top:8px}
#ghost{position:fixed;z-index:30;width:56px;height:56px;margin:-28px 0 0 -28px;pointer-events:none;filter:drop-shadow(0 4px 2px rgba(0,0,0,.25))}
.pgBadge{top:calc(env(safe-area-inset-top) + 8px)!important}
@media (orientation:landscape) and (max-height:520px){
 #panel{left:auto;right:calc(6px + env(safe-area-inset-right));transform:none;top:6px;bottom:6px;width:310px;overflow:auto;padding:6px 8px}
 #order{top:56px;width:170px;font-size:11px}
 #panel .hint{font-size:12px}.title{font-size:46px}.menu{bottom:8px;gap:6px}.big{font-size:19px;padding:8px 24px}
 .sheet{max-height:calc(100% - 64px);top:calc(50% + 22px)}
}
@media (max-width:480px){#order{width:150px;font-size:11px;top:58px}#order .nm{font-size:13px}#panel h4{font-size:16px}#panel .hint{font-size:12px}.chip{font-size:13px;padding:3px 8px}.chip img{width:26px;height:26px}}
.tt{position:absolute;left:0;right:0;top:calc(52px + env(safe-area-inset-top));pointer-events:none}
@media (orientation:landscape) and (max-height:520px){.tt{top:6px;font-size:40px}}
@media (orientation:landscape) and (max-height:520px){#sPlay .top{right:calc(326px + env(safe-area-inset-right))}}
/* v2 phone-fit layout */
.btn{min-height:44px}.tab{min-height:44px}.lb{min-height:44px}
#panel{display:flex;flex-direction:column;max-height:calc(100vh - 150px);max-height:calc(100dvh - 140px - env(safe-area-inset-top));padding:8px 10px calc(8px + env(safe-area-inset-bottom)*0);left:calc(50% + (env(safe-area-inset-left) - env(safe-area-inset-right))/2);width:min(780px,calc(100% - 12px - env(safe-area-inset-left) - env(safe-area-inset-right)))}
#panel .pbody{overflow-y:auto;min-height:0;flex:1 1 auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
.opt{flex-wrap:wrap;overflow:visible;padding:2px 0 4px;gap:6px}
.opt b{min-width:58px}
.chip{min-height:44px;white-space:normal;text-align:left;line-height:1.1;max-width:100%}
#panel .acts{flex:none;margin-top:6px;padding-top:6px;border-top:2px dashed #f1c7d8}
.hintS{display:none;flex:none;align-self:center;margin-top:-30px;margin-bottom:4px;position:relative;z-index:2;font-size:12px;background:#1d2433;color:#fff;border-radius:999px;padding:3px 10px;pointer-events:none;animation:bob 1s ease-in-out infinite alternate}
#panel.more .hintS{display:block}
@keyframes bob{to{transform:translateY(3px)}}
.sheet{max-height:calc(100vh - 90px);max-height:calc(100dvh - 84px - env(safe-area-inset-top) - env(safe-area-inset-bottom));top:calc(50% + 24px)}
.items{grid-template-columns:repeat(auto-fill,minmax(138px,1fr))}
@media (max-width:430px){
 #panel{width:calc(100% - 8px - env(safe-area-inset-left) - env(safe-area-inset-right));border-radius:18px}
 .chip{font-size:12.5px;padding:3px 8px;gap:4px}.chip img{width:26px;height:26px}
 .opt b{min-width:48px;font-size:12px}
 #panel h4{font-size:15px}#panel h4 img{width:28px;height:28px}
 .sheet{padding:10px;width:calc(100% - 10px)}.sheet h2{font-size:23px}
 .top .coins{font-size:15px;padding:4px 10px 4px 6px}
 .lv{gap:5px}.lb{font-size:15px;border-radius:12px}
}
@media (orientation:landscape) and (max-height:520px){
 #panel{left:auto;right:calc(6px + env(safe-area-inset-right));transform:none;top:calc(6px + env(safe-area-inset-top));bottom:calc(6px + env(safe-area-inset-bottom));max-height:none;width:330px}
 #sPlay .top{right:calc(344px + env(safe-area-inset-right))}
 .chip{font-size:12px;padding:3px 7px}.chip img{width:24px;height:24px}
 .sheet{max-height:calc(100dvh - 64px);top:calc(50% + 26px)}
}
@media (max-height:700px) and (orientation:portrait){#panel .hint{display:none}#panel h4{margin-bottom:2px}}
