*{box-sizing:border-box}
html,body{margin:0;width:100%;height:100%;background:#05070d;color:#eee;font-family:monospace;overflow:hidden;touch-action:none}
#game{width:min(100vw,520px);height:100vh;margin:auto;background:#070b13;position:relative;overflow:hidden}
#topbar{height:8.5vh;border:3px solid #4b3572;background:#0b0f1c;display:flex;align-items:center;gap:10px;padding:7px}
#menuBtn{height:54px;width:54px;background:#15182a;border:3px solid #7353aa;color:white;font-size:30px}
#timeBox{flex:1;font-size:18px;line-height:1.25}
#moneyBox{display:flex;align-items:center;gap:8px;color:#99ec62;font-size:28px;font-weight:bold}
#moneyBox img{width:44px;image-rendering:pixelated}
#scene{height:54vh;position:relative;background:#111;overflow:hidden;border-left:3px solid #4b3572;border-right:3px solid #4b3572}
#bg{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;image-rendering:pixelated;z-index:1}

/* Locked from your manual test: bottom 27% */
#customer{
position:absolute;
left:50%;
bottom:27%;
transform:translateX(-50%);
height:62%;
max-width:64%;
object-fit:contain;
image-rendering:pixelated;
z-index:4;
transition: transform .08s ease;
}

#bubble{position:absolute;left:7%;top:25%;width:36%;min-height:92px;padding:13px;background:#f4efd9;color:#111;border:4px solid #111;box-shadow:4px 4px #000;font-size:18px;line-height:1.25;z-index:6}
#bubble b{color:#7546b5}
#feedback{position:absolute;left:50%;top:12%;transform:translateX(-50%);font-size:28px;font-weight:bold;text-shadow:3px 3px #000;z-index:20;pointer-events:none;white-space:nowrap}
#categories{position:absolute;right:6px;top:3%;width:25%;display:flex;flex-direction:column;gap:8px;z-index:8}
.cat{height:64px;background:#0d1320;border:3px solid #455536;display:flex;align-items:center;gap:6px;padding:5px;color:#9be96b;font-weight:bold;font-size:13px}
.cat.active{border-color:#9be96b;box-shadow:0 0 8px rgba(155,233,107,.6)}
.cat img{width:38px;height:38px;object-fit:contain;image-rendering:pixelated}
#tray{height:37.5vh;background:#080b13;border:3px solid #4b3572;text-align:center;padding:10px;position:relative;z-index:10}
#trayTitle{color:#9be96b;font-size:24px;font-weight:bold}
#traySub{font-size:16px;color:#d8d0c0;margin-bottom:8px}
#items{height:57%;display:flex;justify-content:center;gap:8px}
.item{width:19%;min-width:66px;background:#111725;border:3px solid #35384b;border-radius:4px;padding:7px 4px 8px;display:flex;flex-direction:column;align-items:center;justify-content:space-between;font-size:12px;color:#e8dfc9;user-select:none;touch-action:none}
.item .imgWrap{height:78px;width:100%;display:flex;align-items:center;justify-content:center}
.item img{max-width:58px;max-height:70px;width:auto;height:auto;object-fit:contain;image-rendering:pixelated;pointer-events:none;display:block}
.item span{height:28px;display:flex;align-items:flex-end;justify-content:center;text-align:center;line-height:1.05}
#hint{display:inline-block;margin-top:8px;padding:8px 14px;border:3px solid #4b3572;background:#111725;font-size:16px}
#hint b{color:#9be96b}
.dragGhost{position:fixed;width:62px;height:62px;object-fit:contain;pointer-events:none;image-rendering:pixelated;transform:translate(-50%,-50%);z-index:999}
@media(max-height:760px){.cat{height:58px;font-size:12px}#bubble{font-size:16px;min-height:82px}.item .imgWrap{height:64px}.item img{max-height:58px;max-width:52px}}

/* V20 clean home screen only — does not touch gameplay layout */
html,body{margin:0!important;padding:0!important;width:100vw!important;height:100dvh!important;overflow:hidden!important;background:#05070d!important}.home-screen{position:absolute;inset:0;z-index:10000;background:radial-gradient(circle at 50% 20%,rgba(142,91,232,.25),transparent 38%),linear-gradient(180deg,#060914 0%,#0b1020 48%,#05070d 100%);display:flex;align-items:center;justify-content:center;overflow:hidden;color:#eee;font-family:monospace}.home-screen.hidden{display:none!important}.home-inner{width:100%;height:100%;max-width:520px;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;padding:8vh 22px 22px;text-align:center;border:3px solid #4b3572;box-sizing:border-box}.logo-drop-stage{position:relative;width:100%;height:38vh;min-height:240px;display:flex;align-items:flex-end;justify-content:center;overflow:visible!important}.home-logo{position:absolute;max-width:88%;max-height:34vh;object-fit:contain;filter:drop-shadow(0 10px 0 rgba(0,0,0,.35)) drop-shadow(0 0 24px rgba(155,233,107,.35))}.logo-normal{animation:logoDrop 1.2s cubic-bezier(.18,.85,.22,1.2) forwards,logoSwapOut .2s linear 1.45s forwards}.logo-pixel{opacity:0;visibility:hidden;image-rendering:pixelated;animation:logoPixelIn .2s steps(1) 1.45s forwards}.logo-normal.logo-force-hidden{opacity:0!important;visibility:hidden!important;animation:none!important}.logo-pixel.logo-force-visible{opacity:1!important;visibility:visible!important;animation:none!important;transform:translateY(0) scale(1)!important}@keyframes logoDrop{0%{transform:translateY(-120vh) rotate(-7deg) scale(1.05)}72%{transform:translateY(0) rotate(1deg) scale(1)}84%{transform:translateY(-20px) rotate(0deg) scale(.98)}100%{transform:translateY(0) rotate(0deg) scale(1)}}@keyframes logoSwapOut{to{opacity:0;visibility:hidden}}@keyframes logoPixelIn{to{opacity:1;visibility:visible}}.home-buttons{width:100%;display:flex;flex-direction:column;gap:14px;align-items:center;margin-top:22px}.home-btn{width:min(82%,340px);padding:16px 18px;border:4px solid #8ee85b;background:#101827;color:#9be96b;font-size:26px;font-weight:900;font-family:monospace;box-shadow:0 0 18px rgba(142,232,91,.35),0 6px 0 #203113;text-shadow:2px 2px 0 #000}.home-btn:active{transform:translateY(4px)}.rewards-btn{border-color:#8e5be8;color:#d6b7ff}.home-tip{margin-top:18px;max-width:360px;color:#d8d0c0;font-size:16px;line-height:1.35}.rewards-inner{justify-content:center}.rewards-inner h1{color:#9be96b;font-size:34px;text-shadow:3px 3px 0 #000}



/* V24 idle customer lineup debug screen */
.lineup-btn{
  border-color:#61c7ff;
  color:#bcecff;
  box-shadow:0 0 18px rgba(97,199,255,.3), 0 6px 0 #163247;
}

.idle-lineup-screen{
  position:absolute;
  inset:0;
  z-index:10001;
  background:
    radial-gradient(circle at 50% 14%, rgba(142,91,232,.25), transparent 35%),
    linear-gradient(180deg,#060914 0%,#0b1020 48%,#05070d 100%);
  color:#eee;
  font-family:monospace;
  overflow:auto;
  padding:18px 12px 32px;
  box-sizing:border-box;
}

.idle-lineup-screen.hidden{
  display:none !important;
}

.idle-lineup-inner{
  width:100%;
  max-width:520px;
  margin:0 auto;
  text-align:center;
}

.idle-lineup-inner h1{
  margin:10px 0 6px;
  color:#9be96b;
  font-size:28px;
  text-shadow:3px 3px 0 #000;
}

.idle-lineup-inner p{
  margin:0 0 12px;
  color:#d8d0c0;
  font-size:13px;
}

.idle-lineup-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
  margin-bottom:16px;
}

.idle-card{
  position:relative;
  height:230px;
  background:
    linear-gradient(180deg, rgba(84,43,133,.18), transparent 45%),
    #080d17;
  border:3px solid #4b3572;
  overflow:hidden;
}

.idle-card::before{
  content:"";
  position:absolute;
  left:0;
  right:0;
  top:53%;
  height:30px;
  background:linear-gradient(#a95d23,#6f3416);
  border-top:3px solid #c47a38;
  border-bottom:3px solid #3a1a0e;
  z-index:3;
}

.idle-card::after{
  content:"COUNTER LINE";
  position:absolute;
  left:0;
  right:0;
  top:calc(53% + 36px);
  font-size:10px;
  color:#9be96b;
  opacity:.55;
  z-index:5;
}

.idle-card img{
  position:absolute;
  left:50%;
  bottom:44%;
  transform:translateX(-50%);
  max-height:62%;
  max-width:70%;
  image-rendering:pixelated;
  z-index:2;
}

.idle-card-name{
  position:absolute;
  left:0;
  right:0;
  bottom:8px;
  z-index:6;
  color:#d6b7ff;
  font-size:12px;
  text-shadow:2px 2px 0 #000;
  word-break:break-word;
  padding:0 4px;
}

@media(max-height:760px){
  .idle-card{height:190px;}
  .idle-lineup-grid{gap:8px;}
  .idle-lineup-inner h1{font-size:22px;}
}



/* V25 customer pose stability */
.customer-sprite{
  transition:none !important;
  image-rendering:pixelated !important;
  object-fit:contain !important;
}



/* V29 lava lamp rewards */
.shop-lava{
  position:absolute;
  left:27.8%;
  top:10%;
  width:21px;
  height:auto;
  object-fit:contain;
  image-rendering:pixelated;
  z-index:5;
  filter:drop-shadow(0 0 4px rgba(155,233,107,.32));
  pointer-events:none;
}
.shop-lava.hidden{display:none!important;}

.lava-rewards-inner{
  justify-content:flex-start!important;
  padding-top:5vh!important;
  overflow:auto!important;
}
.lava-tip{
  margin-top:4px!important;
  margin-bottom:14px!important;
  max-width:430px!important;
}
.lava-reward-grid{
  width:100%;
  max-width:455px;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  margin:8px auto 18px;
}
.lava-card{
  background:#0d1320;
  border:3px solid #4b3572;
  padding:10px 8px;
  min-height:188px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:space-between;
  box-shadow:0 0 12px rgba(142,91,232,.18);
}
.lava-preview-box{
  width:76px;
  height:104px;
  border:3px solid #34264f;
  background:#070b13;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.lava-preview{
  width:48px;
  height:84px;
  object-fit:contain;
  image-rendering:pixelated;
}
.lava-card-title{
  color:#d6b7ff;
  font-size:16px;
  font-weight:900;
  text-shadow:2px 2px 0 #000;
  min-height:38px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
}
.lava-price{
  color:#9be96b;
  font-size:22px;
  font-weight:900;
}
.lava-buy-btn{
  width:100%;
  padding:10px 6px;
  background:#101827;
  border:3px solid #8ee85b;
  color:#9be96b;
  font-family:monospace;
  font-size:17px;
  font-weight:900;
}
.lava-buy-btn.owned{
  border-color:#8e5be8;
  color:#d6b7ff;
}
.lava-buy-btn.selected{
  border-color:#8ee85b;
  color:#9be96b;
  box-shadow:0 0 14px rgba(142,232,91,.45);
}
@media(max-height:760px){
  .lava-rewards-inner h1{font-size:25px!important;margin:4px 0!important}
  .lava-card{min-height:164px;padding:8px 6px}
  .lava-preview-box{width:66px;height:88px}
  .lava-preview{width:40px;height:72px}
  .lava-card-title{font-size:13px;min-height:28px}
  .lava-price{font-size:18px}
  .lava-buy-btn{font-size:14px;padding:8px 4px}
}

/* V30 reward price cleanup */
.lava-price{display:none!important;}



/* V31 text-only right category cards */
.cat-btn{
  justify-content:center !important;
  text-align:center !important;
  gap:0 !important;
}
.cat-btn img,
.cat-btn .cat-icon,
.cat-btn picture,
.cat-btn svg{
  display:none !important;
}
.cat-btn span,
.cat-btn .cat-label{
  width:100% !important;
  text-align:center !important;
  justify-content:center !important;
  display:flex !important;
  align-items:center !important;
  font-size:18px !important;
  letter-spacing:.5px !important;
}



/* V32 force right category cards to text-only */
#categoryRail .cat-card img,
#categoryRail .cat-btn img,
#categoryRail button img,
#categories .cat-card img,
#categories .cat-btn img,
#categories button img,
.category-rail img,
.categories img,
.cat-card img,
.cat-btn img,
.category-card img,
.category-btn img{
  display:none !important;
  opacity:0 !important;
  width:0 !important;
  height:0 !important;
  margin:0 !important;
  padding:0 !important;
}

#categoryRail .cat-card,
#categoryRail .cat-btn,
#categoryRail button,
#categories .cat-card,
#categories .cat-btn,
#categories button,
.category-rail .cat-card,
.category-rail .cat-btn,
.categories .cat-card,
.categories .cat-btn,
.cat-card,
.cat-btn,
.category-card,
.category-btn{
  justify-content:center !important;
  align-items:center !important;
  text-align:center !important;
  gap:0 !important;
}

#categoryRail .cat-card span,
#categoryRail .cat-btn span,
#categoryRail button span,
#categories .cat-card span,
#categories .cat-btn span,
#categories button span,
.category-rail span,
.categories span,
.cat-card span,
.cat-btn span,
.category-card span,
.category-btn span{
  width:100% !important;
  text-align:center !important;
  justify-content:center !important;
  align-items:center !important;
  display:flex !important;
  margin:0 !important;
}



/* V33 poster reward wall slot */
.shop-poster{
  position:absolute;
  left:66%;
  top:13.8%;
  width:44px;
  height:auto;
  object-fit:contain;
  image-rendering:pixelated;
  z-index:7;
  filter:drop-shadow(0 2px 2px rgba(0,0,0,.65));
  pointer-events:none;
}
.shop-poster.hidden{display:none!important;}

/* V33 hard-center text-only category cards */
.cat-btn,
.cat-card,
.category-btn,
.category-card,
#categoryRail button,
#categories button{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  padding-left:0!important;
  padding-right:0!important;
}
.cat-btn span,
.cat-card span,
.category-btn span,
.category-card span,
#categoryRail button span,
#categories button span{
  flex:1 1 100%!important;
  width:100%!important;
  max-width:100%!important;
  margin:0!important;
  padding:0!important;
  text-align:center!important;
  justify-content:center!important;
  align-items:center!important;
  display:flex!important;
  transform:none!important;
}



/* V34 rewards polish + stronger category text-only cards */
.rewards-top-back{
  position:absolute;
  top:14px;
  left:14px;
  z-index:20;
  background:#101827;
  border:3px solid #8ee85b;
  color:#9be96b;
  font-family:monospace;
  font-size:20px;
  font-weight:900;
  padding:10px 14px;
  box-shadow:0 0 14px rgba(142,232,91,.25);
  text-shadow:2px 2px 0 #000;
}
.reward-section-title{
  grid-column:1 / -1;
  color:#9be96b;
  font-size:26px;
  font-weight:900;
  text-align:center;
  text-shadow:3px 3px 0 #000;
  margin:10px 0 0;
}

/* force category labels dead center and keep icons hidden forever */
#catRail button,
#catRail .cat-btn,
#catRail .cat-card,
#categoryRail button,
#categoryRail .cat-btn,
#categoryRail .cat-card,
#categories button,
#categories .cat-btn,
#categories .cat-card,
.cat-btn,
.cat-card,
.category-btn,
.category-card{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  padding:0!important;
  gap:0!important;
  overflow:hidden!important;
}

#catRail button img,
#catRail .cat-btn img,
#catRail .cat-card img,
#categoryRail button img,
#categoryRail .cat-btn img,
#categoryRail .cat-card img,
#categories button img,
#categories .cat-btn img,
#categories .cat-card img,
.cat-btn img,
.cat-card img,
.category-btn img,
.category-card img,
#catRail svg,
#categoryRail svg,
#categories svg,
.cat-btn svg,
.cat-card svg{
  display:none!important;
  opacity:0!important;
  visibility:hidden!important;
  width:0!important;
  height:0!important;
  min-width:0!important;
  max-width:0!important;
  margin:0!important;
  padding:0!important;
  position:absolute!important;
  pointer-events:none!important;
}

#catRail button span,
#catRail .cat-btn span,
#catRail .cat-card span,
#categoryRail button span,
#categoryRail .cat-btn span,
#categoryRail .cat-card span,
#categories button span,
#categories .cat-btn span,
#categories .cat-card span,
.cat-btn span,
.cat-card span,
.category-btn span,
.category-card span{
  position:static!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex:1 1 100%!important;
  width:100%!important;
  height:100%!important;
  max-width:100%!important;
  margin:0!important;
  padding:0!important;
  text-align:center!important;
  transform:none!important;
  left:auto!important;
  right:auto!important;
}



/* V35 no-icon flash + true centered category labels */
#cats,
#catRail,
#categoryRail,
#categories,
.category-rail,
.categories{
  text-align:center!important;
}

#cats button,
#catRail button,
#categoryRail button,
#categories button,
.category-rail button,
.categories button,
.cat-btn,
.cat-card,
.category-btn,
.category-card{
  position:relative!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  padding:0!important;
  gap:0!important;
}

#cats button > img,
#catRail button > img,
#categoryRail button > img,
#categories button > img,
.category-rail button > img,
.categories button > img,
.cat-btn > img,
.cat-card > img,
.category-btn > img,
.category-card > img,
#cats img,
#catRail img,
#categoryRail img,
#categories img,
.category-rail img,
.categories img{
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  width:0!important;
  min-width:0!important;
  max-width:0!important;
  height:0!important;
  min-height:0!important;
  max-height:0!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  position:absolute!important;
  left:-9999px!important;
  top:-9999px!important;
  pointer-events:none!important;
}

#cats button span,
#catRail button span,
#categoryRail button span,
#categories button span,
.category-rail button span,
.categories button span,
.cat-btn span,
.cat-card span,
.category-btn span,
.category-card span{
  position:absolute!important;
  inset:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
  height:100%!important;
  max-width:100%!important;
  margin:0!important;
  padding:0!important;
  text-align:center!important;
  transform:none!important;
  left:0!important;
  right:0!important;
  top:0!important;
  bottom:0!important;
}

/* V39 real right category cards: no icons, centered text */
#categories .cat{
  position:relative!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  padding:0!important;
  gap:0!important;
}
#categories .cat img{
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  width:0!important;
  height:0!important;
  margin:0!important;
  padding:0!important;
}
#categories .cat span{
  position:absolute!important;
  inset:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  width:100%!important;
  height:100%!important;
  margin:0!important;
  padding:0!important;
}


/* V40 reward slot system */
.shop-reward,.shop-lava,.shop-poster{position:absolute;image-rendering:pixelated;pointer-events:none;object-fit:contain;}
.shop-lava{left:28.4%;top:12.6%;width:22px;height:auto;z-index:8;filter:drop-shadow(0 0 6px rgba(155,80,255,.6));}
.shop-poster{left:66%;top:13.8%;width:44px;height:auto;z-index:7;filter:drop-shadow(0 2px 2px rgba(0,0,0,.65));}
.shop-neon{left:8%;top:6.5%;width:132px;height:auto;z-index:7;filter:drop-shadow(0 0 10px rgba(255,80,255,.6));}
.shop-fridge{left:1.2%;top:9.5%;height:58%;width:auto;z-index:3;filter:drop-shadow(0 3px 3px rgba(0,0,0,.65));}
.shop-floor-decor{right:0.7%;top:22%;height:42%;width:auto;z-index:5;filter:drop-shadow(0 3px 3px rgba(0,0,0,.65));}
.shop-wall-decor{left:8%;top:17%;width:42px;height:auto;z-index:7;filter:drop-shadow(0 2px 2px rgba(0,0,0,.65));}
.hidden{display:none!important;}
.reward-section-title{grid-column:1/-1;color:#9be96b;font-size:28px;font-weight:900;text-align:center;text-shadow:3px 3px 0 #000;margin:14px 0 2px;}
.lava-card-title{min-height:38px;display:flex;align-items:center;justify-content:center;text-align:center;}
.reward-clear-card{border-style:dashed!important;opacity:.95;}
.reward-slot-note{grid-column:1/-1;color:#eee;font-family:monospace;text-align:center;font-size:15px;margin:-3px 0 3px;}
/* category cards true text-only centered */
#categories .cat{display:flex!important;align-items:center!important;justify-content:center!important;text-align:center!important;padding:0!important;gap:0!important;}
#categories .cat img{display:none!important;width:0!important;height:0!important;opacity:0!important;visibility:hidden!important;}
#categories .cat span{position:absolute!important;inset:0!important;display:flex!important;align-items:center!important;justify-content:center!important;text-align:center!important;width:100%!important;height:100%!important;margin:0!important;padding:0!important;}


/* ===== V42 placement screen + reward card cleanup ===== */
.lava-tip{display:none!important;}
.reward-slot-note{grid-column:1/-1;text-align:center;color:#e9e2d0;font-size:14px;line-height:1.25;margin:-2px 8px 8px;}
.place-reward-btn{
  width:100%;
  margin-top:6px;
  background:#0d1320;
  border:2px solid #5b3c86;
  color:#d9b8ff;
  font-family:monospace;
  font-size:15px;
  font-weight:900;
  padding:6px 8px;
  text-shadow:2px 2px #000;
}
.lava-preview-box{
  width:82px!important;
  height:92px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:visible!important;
  background:#080c15!important;
}
.lava-preview{
  width:auto!important;
  max-width:74px!important;
  max-height:84px!important;
  object-fit:contain!important;
  image-rendering:pixelated!important;
}
.reward-card{overflow:visible!important;}
.reward-section-title:first-of-type{margin-top:0!important;}

/* keep right-side category cards text-only and actually centered */
#categories .cat{
  position:relative!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  padding:0!important;
  gap:0!important;
}
#categories .cat img,
#categories .cat svg,
#categories .cat picture{display:none!important;}
#categories .cat span{
  position:absolute!important;
  inset:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
  height:100%!important;
  margin:0!important;
  padding:0!important;
  text-align:center!important;
  line-height:1!important;
}

/* all reward decor is positioned by v42 JS pixel layout */
.shop-reward,.shop-lava,.shop-poster,.shop-neon,.shop-fridge,.shop-floor-decor,.shop-wall-decor{
  position:absolute!important;
  object-fit:contain!important;
  image-rendering:pixelated!important;
  pointer-events:none!important;
  max-width:none!important;
  max-height:none!important;
}
.shop-poster{z-index:7!important;}
.shop-lava{z-index:8!important;}
.shop-neon{z-index:7!important;}
.shop-fridge{z-index:3!important;}
.shop-floor-decor{z-index:5!important;}
.shop-wall-decor{z-index:7!important;}

.placement-screen{
  position:absolute;
  inset:0;
  z-index:80;
  background:#070b13;
  border:3px solid #4b3572;
  overflow:auto;
}
.placement-inner{
  min-height:100%;
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.placement-top{
  display:flex;
  align-items:flex-start;
  gap:10px;
}
.placement-top h1{
  margin:0;
  color:#9be96b;
  font-size:24px;
  text-shadow:3px 3px #000;
}
#placementHelp{
  margin:4px 0 0;
  color:#e9e2d0;
  font-size:13px;
  line-height:1.2;
}
.placement-btn{
  background:#101827;
  border:3px solid #8ee85b;
  color:#9be96b;
  font-family:monospace;
  font-weight:900;
  font-size:16px;
  padding:8px 12px;
  text-shadow:2px 2px #000;
}
.placement-btn.save{
  border-color:#a25cff;
  color:#e2c4ff;
}
.placement-stage{
  width:100%;
  aspect-ratio: 520 / 360;
  position:relative;
  overflow:hidden;
  background:#111;
  border:3px solid #4b3572;
  touch-action:none;
}
.placement-bg{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  image-rendering:pixelated;
  user-select:none;
  pointer-events:none;
}
.placement-item{
  position:absolute;
  z-index:5;
  image-rendering:pixelated;
  object-fit:contain;
  cursor:move;
  filter:drop-shadow(0 2px 2px rgba(0,0,0,.65));
  touch-action:none;
}
.placement-controls{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.placement-controls .placement-btn{
  width:100%;
}
.placement-readout{
  margin:0;
  padding:10px;
  border:2px solid #4b3572;
  background:#0d1320;
  color:#e9e2d0;
  font-size:13px;
  white-space:pre-wrap;
}
@media(max-width:520px){
  .placement-top h1{font-size:20px;}
  .placement-btn{font-size:14px;padding:7px 9px;}
}


/* ===== V43 true scene editor patch ===== */
#placementStage{
  aspect-ratio: unset !important;
  width: 100% !important;
  height: auto !important;
  overflow: hidden !important;
  background:#05080f !important;
}
#placementStage .placement-bg{
  display:none !important;
}
#placementSceneClone{
  position:relative !important;
  transform:none !important;
  margin:0 auto !important;
  width:100% !important;
  max-width:100% !important;
  height:auto !important;
  overflow:hidden !important;
  pointer-events:none !important;
}
#placementSceneClone *{
  pointer-events:none !important;
}
#placementItem{
  position:absolute !important;
  z-index:999 !important;
  pointer-events:auto !important;
  cursor:grab !important;
  touch-action:none !important;
  image-rendering:pixelated !important;
  object-fit:contain !important;
  filter:drop-shadow(0 2px 2px rgba(0,0,0,.65)) !important;
}


/* ===== V44 background + percent placement editor fix ===== */
#placementStage{
  width:100%!important;
  aspect-ratio:520 / 360!important;
  height:auto!important;
  position:relative!important;
  overflow:hidden!important;
  border:3px solid #4b3572!important;
  background:#05080f!important;
}
#placementStage .placement-bg,
#placementSceneClone{
  display:none!important;
}
.placement-bg-v44{
  position:absolute!important;
  inset:0!important;
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  image-rendering:pixelated!important;
  pointer-events:none!important;
  user-select:none!important;
}
#placementItem{
  position:absolute!important;
  z-index:99!important;
  image-rendering:pixelated!important;
  object-fit:contain!important;
  cursor:grab!important;
  touch-action:none!important;
  pointer-events:auto!important;
  filter:drop-shadow(0 2px 2px rgba(0,0,0,.65))!important;
}
.shop-reward,.shop-lava,.shop-poster,.shop-neon,.shop-fridge,.shop-floor-decor,.shop-wall-decor{
  position:absolute!important;
  height:auto!important;
  object-fit:contain!important;
  image-rendering:pixelated!important;
  pointer-events:none!important;
}

/* ===== V45 fixed-pixel placement editor ===== */
#placementStage{
  width:100%!important;
  height:auto!important;
  aspect-ratio:520 / 360!important;
  position:relative!important;
  overflow:hidden!important;
  border:3px solid #4b3572!important;
  background:#05080f!important;
}
#placementStage .placement-bg,
#placementStage .placement-bg-v44,
#placementSceneClone{
  display:none!important;
}
#placementPixelScene{
  position:relative!important;
  width:520px!important;
  height:360px!important;
  transform-origin:top left!important;
  image-rendering:pixelated!important;
}
/* This scales the 520px scene visually while keeping its internal pixel grid exact */
#placementStage #placementPixelScene{
  transform:scale(calc((min(100vw, 520px) - 30px) / 520));
}
@supports not (width: min(100vw, 520px)){
  #placementStage #placementPixelScene{transform:scale(.94);}
}
.placement-bg-v45{
  position:absolute!important;
  inset:0!important;
  width:520px!important;
  height:360px!important;
  object-fit:cover!important;
  image-rendering:pixelated!important;
  pointer-events:none!important;
  user-select:none!important;
}
#placementItem{
  position:absolute!important;
  z-index:99!important;
  height:auto!important;
  image-rendering:pixelated!important;
  object-fit:contain!important;
  cursor:grab!important;
  touch-action:none!important;
  pointer-events:auto!important;
  filter:drop-shadow(0 2px 2px rgba(0,0,0,.65))!important;
}
.shop-reward,.shop-lava,.shop-poster,.shop-neon,.shop-fridge,.shop-floor-decor,.shop-wall-decor{
  position:absolute!important;
  height:auto!important;
  object-fit:contain!important;
  image-rendering:pixelated!important;
  pointer-events:none!important;
}

/* ===== V46 exact live scene editor ===== */
#placementStage{
  position:relative!important;
  overflow:hidden!important;
  border:3px solid #4b3572!important;
  background:#05080f!important;
  max-width:100%!important;
}
#placementStage .placement-bg,
#placementStage .placement-bg-v44,
#placementStage .placement-bg-v45,
#placementPixelScene,
#placementSceneClone{
  display:none!important;
}
#placementLiveScene{
  position:relative!important;
  overflow:hidden!important;
  image-rendering:pixelated!important;
}
.placement-bg-live{
  position:absolute!important;
  inset:0!important;
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  image-rendering:pixelated!important;
  z-index:1!important;
  pointer-events:none!important;
  user-select:none!important;
}
#placementItem{
  position:absolute!important;
  z-index:99!important;
  height:auto!important;
  image-rendering:pixelated!important;
  object-fit:contain!important;
  cursor:grab!important;
  touch-action:none!important;
  pointer-events:auto!important;
  filter:drop-shadow(0 2px 2px rgba(0,0,0,.65))!important;
}
.shop-reward,.shop-lava,.shop-poster,.shop-neon,.shop-fridge,.shop-floor-decor,.shop-wall-decor{
  position:absolute!important;
  height:auto!important;
  object-fit:contain!important;
  image-rendering:pixelated!important;
  pointer-events:none!important;
}
.rewards-layout {
  display: flex;
  width: 100%;
  height: 100%;
  padding-top: 56px;
  box-sizing: border-box;
}
.rewards-sidebar {
  display: flex;
  flex-direction: column;
  width: 72px;
  flex-shrink: 0;
  border-right: 2px solid #4b3572;
}
.reward-tab {
  flex: 1;
  background: #0d1320;
  border: none;
  border-bottom: 1px solid #4b3572;
  color: #888;
  font-family: monospace;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
  text-align: center;
  padding: 4px 2px;
  line-height: 1.3;
}
.reward-tab:last-child { border-bottom: none; }
.reward-tab.active {
  background: #101827;
  color: #9be96b;
  border-right: 2px solid #9be96b;
  margin-right: -2px;
}
.rewards-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}
.reward-panel { display: none; }
.reward-panel.active { display: grid; }

#rankBox {
  color: #d6b7ff;
  font-family: monospace;
  font-size: 14px;
  font-weight: 900;
  background: #0d1320;
  border: 2px solid #8b5cf6;
  padding: 4px 8px;
}

.rankup-overlay {
  position: absolute;
  inset: 0;
  z-index: 99999;
  background: rgba(5, 7, 13, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.rankup-overlay.hidden { display: none !important; }
.rankup-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px 24px;
  border: 3px solid #9be96b;
  background: #0b0f1c;
  width: 85%;
  text-align: center;
  animation: rankupPop 0.4s cubic-bezier(.18,.85,.22,1.2) forwards;
}
@keyframes rankupPop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.rankup-title {
  color: #9be96b;
  font-family: monospace;
  font-size: 42px;
  font-weight: 900;
  text-shadow: 3px 3px 0 #000, 0 0 24px rgba(155,233,107,.6);
  animation: rankupPulse 0.8s ease infinite alternate;
}
@keyframes rankupPulse {
  from { text-shadow: 3px 3px 0 #000, 0 0 12px rgba(155,233,107,.4); }
  to   { text-shadow: 3px 3px 0 #000, 0 0 32px rgba(155,233,107,.9); }
}
.rankup-rank {
  color: #fff;
  font-family: monospace;
  font-size: 28px;
  font-weight: 900;
}
.rankup-name {
  color: #d6b7ff;
  font-family: monospace;
  font-size: 22px;
  font-weight: 900;
  text-shadow: 2px 2px 0 #000;
}
.rankup-unlocked {
  color: #fde047;
  font-family: monospace;
  font-size: 15px;
  line-height: 1.5;
  border: 2px solid #4b3572;
  padding: 10px 16px;
  background: #0d1320;
}
.rankup-btn {
  width: 100%;
  padding: 14px;
  background: #101827;
  border: 3px solid #8ee85b;
  color: #9be96b;
  font-family: monospace;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(142,232,91,.35);
}
/* ===== TIMER BAR ===== */
#timerBar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 7px;
  background: #1a1a2e;
  z-index: 15;
}
#timerBarFill {
  height: 100%;
  width: 100%;
  background: #9be96b;
  transition: width 0.9s linear, background 0.5s ease;
}

/* ===== RANK BOX IN TOPBAR ===== */
#rankBox {
  color: #d6b7ff;
  font-family: monospace;
  font-size: 13px;
  font-weight: 900;
  background: #0d1320;
  border: 2px solid #8b5cf6;
  padding: 4px 8px;
  white-space: nowrap;
}

/* ===== RANK UP OVERLAY ===== */
.rankup-overlay {
  position: absolute;
  inset: 0;
  z-index: 99999;
  background: rgba(5, 7, 13, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.rankup-overlay.hidden { display: none !important; }
.rankup-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px 24px;
  border: 3px solid #9be96b;
  background: #0b0f1c;
  width: 85%;
  text-align: center;
  animation: rankupPop 0.4s cubic-bezier(.18,.85,.22,1.2) forwards;
}
@keyframes rankupPop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.rankup-title {
  color: #9be96b;
  font-family: monospace;
  font-size: 42px;
  font-weight: 900;
  text-shadow: 3px 3px 0 #000, 0 0 24px rgba(155,233,107,.6);
  animation: rankupPulse 0.8s ease infinite alternate;
}
@keyframes rankupPulse {
  from { text-shadow: 3px 3px 0 #000, 0 0 12px rgba(155,233,107,.4); }
  to   { text-shadow: 3px 3px 0 #000, 0 0 32px rgba(155,233,107,.9); }
}
.rankup-rank {
  color: #fff;
  font-family: monospace;
  font-size: 28px;
  font-weight: 900;
}
.rankup-name {
  color: #d6b7ff;
  font-family: monospace;
  font-size: 22px;
  font-weight: 900;
  text-shadow: 2px 2px 0 #000;
}
.rankup-unlocked {
  color: #fde047;
  font-family: monospace;
  font-size: 15px;
  line-height: 1.5;
  border: 2px solid #4b3572;
  padding: 10px 16px;
  background: #0d1320;
  white-space: pre-line;
}
.rankup-btn {
  width: 100%;
  padding: 14px;
  background: #101827;
  border: 3px solid #8ee85b;
  color: #9be96b;
  font-family: monospace;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(142,232,91,.35);
}

/* ===== REWARDS SIDEBAR TABS ===== */
.rewards-layout {
  display: flex;
  width: 100%;
  height: 100%;
  padding-top: 56px;
  box-sizing: border-box;
}
.rewards-sidebar {
  display: flex;
  flex-direction: column;
  width: 72px;
  flex-shrink: 0;
  border-right: 2px solid #4b3572;
}
.reward-tab {
  flex: 1;
  background: #0d1320;
  border: none;
  border-bottom: 1px solid #4b3572;
  color: #888;
  font-family: monospace;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
  text-align: center;
  padding: 4px 2px;
  line-height: 1.3;
}
.reward-tab:last-child { border-bottom: none; }
.reward-tab.active {
  background: #101827;
  color: #9be96b;
  border-right: 2px solid #9be96b;
  margin-right: -2px;
}
.rewards-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}
.reward-panel { display: none; }
.reward-panel.active { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ===== COMBO BAR ===== */
.combo-bar {
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  background: rgba(10, 14, 26, 0.92);
  border: 2px solid #9be96b;
  color: #9be96b;
  font-family: monospace;
  font-size: 15px;
  font-weight: 900;
  padding: 3px 12px;
  white-space: nowrap;
  text-shadow: 1px 1px 0 #000;
  pointer-events: none;
}
.combo-bar.combo-perfect {
  border-color: #ff55ff;
  color: #ff55ff;
  box-shadow: 0 0 14px rgba(255,85,255,.55);
  animation: comboPulse 0.6s ease infinite alternate;
}
@keyframes comboPulse {
  from { box-shadow: 0 0 8px rgba(255,85,255,.4); }
  to   { box-shadow: 0 0 22px rgba(255,85,255,.9); }
}

/* ===== SPECIAL CUSTOMER BADGE ===== */
.special-badge {
  position: absolute;
  top: 26%;
  left: 7%;
  z-index: 10;
  background: rgba(10,14,26,0.92);
  border: 2px solid currentColor;
  font-family: monospace;
  font-size: 14px;
  font-weight: 900;
  padding: 4px 10px;
  text-shadow: 1px 1px 0 #000;
  pointer-events: none;
  animation: badgePop 0.3s cubic-bezier(.18,.85,.22,1.2) forwards;
}
@keyframes badgePop {
  0% { transform: scale(0.5); opacity:0; }
  100% { transform: scale(1); opacity:1; }
}

/* ===== ITEM UPGRADE BADGE ===== */
.item-upgrade-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #8b5cf6;
  color: #fff;
  font-family: monospace;
  font-size: 10px;
  font-weight: 900;
  padding: 1px 4px;
  border: 1px solid #d6b7ff;
  z-index: 5;
  text-shadow: 1px 1px 0 #000;
  pointer-events: none;
}
.item { position: relative; }

/* ===== UPGRADE SHOP SCREEN ===== */
.upgrade-shop-screen {
  position: absolute;
  inset: 0;
  z-index: 10001;
  background:
    radial-gradient(circle at 50% 14%, rgba(142,91,232,.25), transparent 35%),
    linear-gradient(180deg,#060914 0%,#0b1020 48%,#05070d 100%);
  color: #eee;
  font-family: monospace;
  overflow: auto;
  padding: 18px 12px 32px;
  box-sizing: border-box;
}
.upgrade-shop-screen.hidden { display: none !important; }
.upgrade-shop-inner {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
}
.upgrade-shop-inner h1 {
  color: #9be96b;
  font-size: 26px;
  font-weight: 900;
  text-shadow: 3px 3px 0 #000;
  margin: 0 0 4px;
}
.upgrade-shop-inner p {
  color: #d8d0c0;
  font-size: 13px;
  margin: 0 0 14px;
}
.upgrade-shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.upgrade-cat-header {
  grid-column: 1 / -1;
  color: #9be96b;
  font-size: 18px;
  font-weight: 900;
  text-shadow: 2px 2px 0 #000;
  border-bottom: 2px solid #4b3572;
  padding-bottom: 4px;
  margin-top: 8px;
}
.upgrade-card {
  background: #0d1320;
  border: 3px solid #4b3572;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.upgrade-item-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  image-rendering: pixelated;
}
.upgrade-item-name {
  color: #d6b7ff;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  line-height: 1.2;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.upgrade-level {
  color: #8b5cf6;
  font-size: 13px;
  font-weight: 900;
}
.upgrade-bonus {
  color: #9be96b;
  font-size: 13px;
  font-weight: 900;
}
.upgrade-btn {
  width: 100%;
  padding: 7px 4px;
  background: #101827;
  border: 2px solid #8ee85b;
  color: #9be96b;
  font-family: monospace;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  text-shadow: 1px 1px 0 #000;
}
.upgrade-btn.maxed {
  border-color: #ffd700;
  color: #ffd700;
  cursor: default;
}
.upgrade-btn:active:not(.maxed) { transform: translateY(2px); }

/* ===== UPGRADE BUTTON ON HOME ===== */
.upgrade-btn-home, .upgrade-btn {
  /* avoid collision with .upgrade-btn class above - home uses inline style */
}
.home-btn.upgrade-btn-class {
  border-color: #ffd700;
  color: #ffd700;
  box-shadow: 0 0 18px rgba(255,215,0,.3), 0 6px 0 #3d3000;
}

/* ===== FIXED REWARD POSITIONS =====
   Locked spots based on user color-coded screenshot.
   JS placement system is disabled (hupApplyLayoutToElement is a no-op).
*/
/* positions locked — PLACE button and placement screen are disabled */
#rewardPlacementScreen { display:none!important; }
