:root{--ink:#3b2414;--cream:#fff8e7;--mint:#35cfa3;--mintD:#1f9d7a;--gold:#ffc83d;--pink:#ff7aa8;--sky:#8fd8ff;--panelW:390px;--panelH:0px}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;overflow:hidden;background:#9fe0ff;font-family:"Trebuchet MS",ui-rounded,"Arial Rounded MT Bold",system-ui,sans-serif;color:var(--ink);user-select:none;-webkit-user-select:none;touch-action:none;overscroll-behavior:none}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
canvas#game{position:fixed;inset:0;width:100%;height:100%;display:block;touch-action:none}
button{font-family:inherit;color:var(--ink);cursor:pointer;touch-action:manipulation}
#hud{position:fixed;left:0;top:0;right:var(--panelW);display:flex;align-items:flex-start;gap:8px;padding:10px 12px;pointer-events:none;z-index:5}
#cashBox{background:var(--cream);border:3px solid var(--ink);border-radius:18px;padding:4px 16px 5px;box-shadow:0 4px 0 var(--ink);min-width:150px;transition:transform .12s}
#cashBox.bump{transform:scale(1.07)}
#cash{font-size:30px;font-weight:900;letter-spacing:.5px;line-height:1.1;color:#2b8a3e;text-shadow:0 2px 0 #c8f0c4}
#rate{font-size:13px;font-weight:800;opacity:.75}
#chips{display:flex;flex-direction:column;gap:6px;margin-top:2px}
.chip{background:var(--gold);border:3px solid var(--ink);border-radius:14px;padding:2px 10px;font-weight:900;font-size:15px;box-shadow:0 3px 0 var(--ink);white-space:nowrap}
.chip.boost{background:var(--pink);color:#fff;text-shadow:0 1px 0 var(--ink);animation:pulse .6s infinite alternate}
.chip.off{display:none}
@keyframes pulse{to{transform:scale(1.08)}}
#btns{margin-left:auto;display:flex;gap:8px;pointer-events:auto}
.round{width:44px;height:44px;border-radius:50%;background:var(--cream);border:3px solid var(--ink);box-shadow:0 3px 0 var(--ink);padding:7px;display:flex;align-items:center;justify-content:center}
.round svg{width:100%;height:100%}
.round.dim{opacity:.45}
#hint{position:fixed;left:0;right:var(--panelW);bottom:calc(var(--panelH) + 10px);text-align:center;pointer-events:none;z-index:4}
#hint span{display:inline-block;background:rgba(59,36,20,.82);color:#fff;font-weight:800;font-size:15px;padding:6px 14px;border-radius:16px;max-width:92vw}
#panel{position:fixed;right:0;top:0;bottom:0;width:var(--panelW);background:var(--cream);border-left:4px solid var(--ink);display:flex;flex-direction:column;z-index:6}
#tabs{display:flex;gap:4px;padding:8px 8px 0;background:#ffe9b8;border-bottom:3px solid var(--ink)}
.tab{flex:1;position:relative;border:3px solid var(--ink);border-bottom:none;border-radius:12px 12px 0 0;background:#fff3d6;font-weight:900;font-size:13px;padding:8px 2px 7px;margin-bottom:-3px}
.tab.on{background:var(--cream);padding-bottom:10px}
.tab i{display:none;position:absolute;top:-6px;right:-3px;width:14px;height:14px;border-radius:50%;background:#ff4f6d;border:2px solid var(--ink)}
.tab.dot i{display:block}
#sub{display:flex;align-items:center;justify-content:space-between;padding:8px 12px 4px;font-weight:900;font-size:15px}
.pill{border:3px solid var(--ink);border-radius:14px;background:var(--gold);font-weight:900;font-size:14px;padding:4px 12px;box-shadow:0 3px 0 var(--ink)}
.pill:active{transform:translateY(2px);box-shadow:0 1px 0 var(--ink)}
#list{flex:1;overflow-y:auto;padding:4px 10px 14px;touch-action:pan-y;-webkit-overflow-scrolling:touch}
.card2{display:flex;align-items:center;gap:8px;background:#fff;border:3px solid var(--ink);border-radius:16px;padding:6px 8px;margin:7px 0;box-shadow:0 3px 0 var(--ink);position:relative}
.card2.lock{background:#f3ead8}
.card2.flash{animation:flash .35s}
@keyframes flash{0%{background:#fff6a8}100%{background:#fff}}
.ico{width:58px;height:58px;flex:none;position:relative;border-radius:12px;background:#e8f8ff;border:2px solid var(--ink);display:flex;align-items:center;justify-content:center;overflow:hidden;cursor:pointer}
.ico img{width:56px;height:56px;object-fit:contain}
.ico .lv{position:absolute;left:0;right:0;bottom:0;background:rgba(59,36,20,.85);color:#fff;font-size:11px;font-weight:900;text-align:center;line-height:15px}
.lock .ico img{filter:grayscale(1) brightness(.75);opacity:.7}
.mid{flex:1;min-width:0}
.nm{font-weight:900;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ds{font-size:12px;font-weight:700;opacity:.75;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bar{height:14px;border:2px solid var(--ink);border-radius:8px;background:#e9e0cc;overflow:hidden;margin:3px 0 2px;position:relative}
.bar b{display:block;height:100%;width:0;background:linear-gradient(#7df0c8,var(--mint));border-radius:6px 0 0 6px}
.bar span{position:absolute;inset:0;font-size:10px;font-weight:900;line-height:10px;text-align:center;color:var(--ink)}
.ms{height:5px;border-radius:3px;background:#eadfca;overflow:hidden}
.ms b{display:block;height:100%;background:var(--gold)}
.buy{flex:none;width:94px;min-height:52px;border:3px solid var(--ink);border-radius:14px;background:var(--mint);font-weight:900;font-size:13px;line-height:1.15;box-shadow:0 3px 0 var(--ink);padding:3px 4px;color:#123}
.buy small{display:block;font-size:14px}
.buy:disabled{background:#d8d2c4;color:#7a6d5e;box-shadow:0 3px 0 #9c907e;cursor:default}
.buy:not(:disabled):active{transform:translateY(2px);box-shadow:0 1px 0 var(--ink)}
.buy.gold{background:var(--gold)}
.tag{display:inline-block;font-size:11px;font-weight:900;background:var(--mint);color:#fff;border-radius:8px;padding:1px 6px;text-shadow:0 1px 0 rgba(0,0,0,.3)}
.empty{font-weight:800;opacity:.7;text-align:center;padding:16px 8px;font-size:14px}
.frBox{text-align:center;padding:6px 4px}
.frBox img{width:110px}
.frBox .num{font-size:32px;font-weight:900;color:#d9901a}
.frBox p{font-size:14px;font-weight:700;margin:6px 0}
.frBox .big{margin-top:8px}
.goal{display:flex;align-items:center;gap:8px;background:#fff;border:3px solid var(--ink);border-radius:14px;padding:6px 10px;margin:6px 0;font-size:13px;font-weight:800}
.goal.done{background:#e6fbe9;opacity:.8}
.goal .gi{font-size:20px;width:26px;text-align:center}
.goal .gm{flex:1}
#toast{position:fixed;left:0;right:var(--panelW);top:96px;text-align:center;pointer-events:none;z-index:7}
#toast div{display:inline-block;background:var(--gold);border:3px solid var(--ink);border-radius:16px;padding:7px 16px;font-weight:900;font-size:16px;box-shadow:0 4px 0 var(--ink);animation:toastIn .35s cubic-bezier(.3,1.6,.6,1);margin:3px}
@keyframes toastIn{from{transform:scale(.4);opacity:0}}
.overlay{position:fixed;inset:0;background:rgba(40,90,130,.45);display:flex;align-items:center;justify-content:center;z-index:20;padding:16px}
.overlay.off{display:none}
.overlay .card{background:var(--cream);border:4px solid var(--ink);border-radius:26px;box-shadow:0 8px 0 var(--ink);padding:14px 22px 18px;max-width:440px;width:100%;text-align:center;animation:toastIn .4s cubic-bezier(.3,1.5,.6,1)}
.biz{width:150px;height:150px;object-fit:contain;margin:-6px auto 0;display:block;animation:bob 1.6s ease-in-out infinite alternate}
.biz.sm{width:96px;height:96px}
@keyframes bob{to{transform:translateY(-6px) rotate(2deg)}}
.logo{font-size:38px;font-weight:900;color:#ff9f1c;-webkit-text-stroke:2px var(--ink);text-shadow:0 4px 0 var(--ink);line-height:1;letter-spacing:1px}
.logo2{font-size:26px;font-weight:900;color:var(--mint);-webkit-text-stroke:1.5px var(--ink);text-shadow:0 3px 0 var(--ink);margin-top:4px}
.intro{font-size:14.5px;font-weight:700;line-height:1.35;margin:10px 0 8px}
.ctrl{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;font-size:12.5px;font-weight:800;margin-bottom:12px}
.ctrl span{background:#fff;border:2px solid var(--ink);border-radius:10px;padding:3px 8px}
kbd{display:inline-block;background:#ffe9b8;border:2px solid var(--ink);border-bottom-width:3px;border-radius:6px;padding:0 5px;font-family:inherit;font-weight:900;font-size:12px}
.big{border:4px solid var(--ink);border-radius:20px;background:var(--mint);font-weight:900;font-size:26px;padding:10px 46px;box-shadow:0 5px 0 var(--ink);color:#fff;text-shadow:0 2px 0 var(--ink)}
.big:active{transform:translateY(3px);box-shadow:0 2px 0 var(--ink)}
.big.ghost{background:#fff;color:var(--ink);text-shadow:none;font-size:18px;padding:8px 18px}
.big:disabled{background:#cfc6b4;text-shadow:none;color:#7a6d5e}
#play{animation:pulse .7s infinite alternate}
.small{font-size:13px;font-weight:800;opacity:.7;margin-top:10px;min-height:16px}
.mt{font-size:26px;font-weight:900;margin:4px 0}
.mb{font-size:15px;font-weight:700;line-height:1.4;margin-bottom:14px}
.mb .amt{display:block;font-size:34px;font-weight:900;color:#2b8a3e;margin:6px 0}
.mBtns{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}
.mBtns .big{font-size:20px;padding:8px 26px}
@media (max-width:599px),(max-aspect-ratio:1/1){
  :root{--panelW:0px;--panelH:47vh}
  #panel{top:auto;left:0;height:var(--panelH);width:auto;border-left:none;border-top:4px solid var(--ink);border-radius:22px 22px 0 0}
  #tabs{border-radius:18px 18px 0 0;padding:7px 6px 0;gap:3px}
  .tab{font-size:11.5px;padding:7px 0 6px}
  #cash{font-size:24px}
  #cashBox{min-width:120px;padding:3px 12px 4px}
  .chip{font-size:13px}
  .round{width:40px;height:40px}
  #toast{top:84px}
  #hint span{font-size:13px}
  .logo{font-size:32px}
  .biz{width:120px;height:120px}
}

/* ---- embed-fit: all 8 shop / manager rows visible without scrolling, small store frame + phone ---- */
:root{--rowH:min(72px,calc((100vh - 104px) / 8 - 7px))}
.card2{height:var(--rowH);min-height:0;padding:3px 8px}
#list .card2{margin:7px 0 0}
.ico{width:calc(var(--rowH) - 12px);height:calc(var(--rowH) - 12px)}
.ico img{width:100%;height:100%}
.buy{min-height:0;height:calc(var(--rowH) - 12px)}
@media (min-width:600px) and (min-aspect-ratio:1/1) and (max-width:1000px){ :root{--panelW:clamp(286px,42vw,390px)} }
@media (min-aspect-ratio:1/1) and (max-height:620px){
  #tabs{padding:5px 5px 0;gap:3px}
  .tab{font-size:12px;padding:5px 1px 5px}
  .tab.on{padding-bottom:7px}
  #sub{padding:4px 10px 0;font-size:13.5px}
  .pill{font-size:12.5px;padding:2px 10px;border-width:2.5px;box-shadow:0 2px 0 var(--ink)}
  #list{padding:0 8px 8px}
  :root{--rowH:calc((100vh - 80px) / 8 - 5px)}
  #list .card2{margin:5px 0 0}
  .card2{border-width:2.5px;border-radius:12px;box-shadow:0 2px 0 var(--ink);padding:2px 6px;gap:6px}
  .ico,.buy{height:calc(var(--rowH) - 9px)}.ico{width:calc(var(--rowH) - 9px)}
  .ico{border-radius:9px;border-width:1.5px}
  .ico .lv{font-size:9px;line-height:12px;letter-spacing:-.2px}
  .nm{font-size:13px;line-height:1.1}
  .ds{display:none}
  .bar{height:11px;margin:2px 0 1px}
  .bar span{font-size:9px;line-height:8px}
  .ms{height:4px}
  .buy{width:84px;font-size:11.5px;line-height:1.05;border-width:2.5px;border-radius:11px;box-shadow:0 2px 0 var(--ink);padding:1px 3px}
  .buy small{font-size:12.5px}
  #list .card2 .mid .ds:has(.tag){display:block}
  .empty{padding:6px 4px;font-size:12.5px}
  .goal{padding:3px 8px;margin:4px 0;font-size:12px}
  .goal .gi{font-size:16px}
  .frBox{padding:2px}
  .frBox img{width:min(80px,16vh)}
  .frBox .num{font-size:24px}
  .frBox p{font-size:12.5px;margin:3px 0}
  .frBox .big{margin-top:4px;font-size:20px;padding:6px 22px}
  #hud{padding:6px 8px}
  #cashBox{padding:2px 12px 3px;min-width:120px;border-radius:14px}
  #cash{font-size:23px}
  #rate{font-size:11.5px}
  .chip{font-size:13px;padding:1px 8px}
  .round{width:38px;height:38px;padding:6px}
  #toast{top:70px}
  #hint span{font-size:13px;padding:4px 12px}
  .overlay{padding:8px}
  .overlay .card{max-width:520px;padding:10px 18px 12px;max-height:100%;overflow:auto}
  .biz{width:min(110px,22vh);height:min(110px,22vh)}
  .biz.sm{width:min(70px,15vh);height:min(70px,15vh)}
  .logo{font-size:32px}
  .logo2{font-size:21px;margin-top:2px}
  .intro{font-size:13.5px;margin:6px 0}
  .ctrl{margin-bottom:8px}
  .big{font-size:23px;padding:7px 40px}
  .small{margin-top:6px}
  .mt{font-size:22px}
  .mb{font-size:14px;margin-bottom:10px}
  .mb .amt{font-size:28px;margin:3px 0}
}
@media (min-aspect-ratio:1/1) and (max-height:420px){
  .intro{display:none}
  .ctrl{margin-top:10px}
  .biz{width:72px;height:72px}
  .logo{font-size:28px}
  #tabs{padding:3px 4px 0}
  .tab{font-size:11px;padding:3px 0 4px;border-width:2.5px}
  .tab.on{padding-bottom:6px}
  #sub{padding:2px 8px 0;font-size:12px}
  .pill{font-size:11px;padding:0 8px;line-height:15px}
  :root{--rowH:calc((100vh - 60px) / 8 - 4px)}
  #list{padding:0 6px 6px}
  #list .card2{margin:4px 0 0}
  .card2{border-width:2px;padding:1px 5px;border-radius:10px}
  .ico,.buy{height:calc(var(--rowH) - 6px)}.ico{width:calc(var(--rowH) - 6px)}
  .ico .lv{font-size:8px;line-height:10px}
  .buy{line-height:1;border-width:2px}
  .bar{height:9px}
  .bar span{display:none}
  .nm{font-size:12px}
  .buy{width:76px;font-size:10.5px}
  .buy small{font-size:11.5px}
}
@media (max-width:599px),(max-aspect-ratio:1/1){
  :root{--panelH:min(60vh,500px);--rowH:min(64px,calc((var(--panelH) - 92px) / 8 - 6px))}
  #list{padding:0 8px 8px}
  #list .card2{margin:6px 0 0}
  .card2{padding:2px 6px;border-radius:13px}
  .ico,.buy{height:calc(var(--rowH) - 10px)}.ico{width:calc(var(--rowH) - 10px)}
  .ico .lv{font-size:9px;line-height:12px;letter-spacing:-.2px}
  .buy{border-width:2.5px;padding:1px 3px;line-height:1}
  .ds{font-size:11px}
  .bar{height:11px;margin:2px 0 1px}
  .bar span{font-size:9px;line-height:8px}
  .buy{font-size:12px;line-height:1.05}
  .buy small{font-size:13px}
}
@media (max-width:599px) and (max-height:900px),(max-aspect-ratio:1/1) and (max-height:900px){ .ds{display:none} #list .card2 .mid .ds:has(.tag){display:block} .nm{font-size:14px} }
