:root{
  --grass:#4fae3a; --panel:#1c2230; --panel2:#262f42;
  --gold:#ffd94a; --gem:#4fd0ff; --green:#3fd45a; --red:#ff4b5c;
}
*{box-sizing:border-box; margin:0; padding:0; -webkit-tap-highlight-color:transparent;}
html,body{height:100%; overflow:hidden; font-family:'Bricolage Grotesque',sans-serif; background:#3a8a2e; user-select:none;}
canvas{display:block; position:fixed; inset:0; touch-action:none;}

#hud{position:fixed; inset:0; pointer-events:none; z-index:5;}
#hud button, #hud .hbslot, #hud .action{pointer-events:auto;}

/* chunky buttons */
.chunky{
  font-family:'Bricolage Grotesque'; font-weight:800; color:#fff;
  border:none; border-radius:12px; padding:10px 16px; font-size:16px;
  cursor:pointer; box-shadow:0 4px 0 rgba(0,0,0,0.35), inset 0 2px 0 rgba(255,255,255,0.25);
  text-shadow:0 2px 2px rgba(0,0,0,0.4); transition:transform .08s;
}
.chunky:active{transform:translateY(3px); box-shadow:0 1px 0 rgba(0,0,0,0.35);}
.chunky.green{background:linear-gradient(#5eea6f,#33b447);}
.chunky.red{background:linear-gradient(#ff6b7a,#e0303f);}
.chunky.big{font-size:20px; padding:14px 28px; margin-top:16px;}
.chunky:disabled{filter:grayscale(.6) brightness(.8); cursor:default;}

/* top bar */
#topbar{position:absolute; top:8px; left:8px; right:8px; display:flex; align-items:center; gap:10px; flex-wrap:wrap;}
.stat{background:var(--panel); border-radius:20px; padding:6px 14px; color:#fff; font-weight:800; font-size:16px; display:flex; align-items:center; gap:6px; border:2px solid #000; box-shadow:0 3px 0 rgba(0,0,0,.4);}
.stat .icon{font-size:18px;}
.coins{border-color:var(--gold);}
.gems{border-color:var(--gem);}
#waveInfo{flex:1; min-width:120px; max-width:340px;}
#waveLabel{color:#fff; font-weight:800; font-size:14px; text-shadow:0 2px 3px rgba(0,0,0,.6); text-align:center; margin-bottom:3px;}
#waveBarWrap{height:12px; background:rgba(0,0,0,.5); border-radius:8px; border:2px solid #000; overflow:hidden;}
#waveBar{height:100%; width:0%; background:linear-gradient(90deg,#ffb020,#ff4b5c); transition:width .3s;}
.topright{display:flex; flex-direction:column; gap:6px; margin-left:auto;}
.topright .chunky{font-size:14px; padding:8px 14px;}

/* luck info */
#luckInfo{position:absolute; top:70px; left:8px; background:rgba(20,26,38,.85); border-radius:12px; padding:8px 12px; color:#cfe; font-weight:700; font-size:13px; line-height:1.6; border:2px solid #000;}
#hiwave{color:var(--gold);}

/* action bar */
#actionbar{position:absolute; bottom:14px; left:0; right:0; display:flex; justify-content:center; align-items:flex-end; gap:18px;}
.action{background:none; border:none; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:2px; font-family:inherit;}
.action .ai{font-size:34px; filter:drop-shadow(0 3px 3px rgba(0,0,0,.5));}
.action .al{color:#fff; font-weight:800; font-size:14px; text-shadow:0 2px 3px rgba(0,0,0,.7);}
.action.active .al{color:var(--gold);}
.rolldice .dice{
  font-size:52px; width:92px; height:92px; display:flex; align-items:center; justify-content:center;
  background:radial-gradient(circle at 35% 30%,#fff,#dfe4ee);
  border-radius:20px; border:3px solid #000;
  box-shadow:0 6px 0 rgba(0,0,0,.4), inset 0 -6px 0 rgba(0,0,0,.12);
  transition:transform .08s;
}
.rolldice:active .dice{transform:translateY(4px); box-shadow:0 2px 0 rgba(0,0,0,.4);}
.buildBtn.active{}

/* hotbar */
#hotbar{position:absolute; bottom:120px; left:0; right:0; display:flex; justify-content:center; gap:8px; flex-wrap:wrap; padding:0 10px;}
.hbslot{width:58px; height:64px; background:rgba(20,26,38,.9); border:3px solid #888; border-radius:10px; cursor:pointer; position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; overflow:hidden;}
.hbslot.sel{box-shadow:0 0 0 3px #fff, 0 0 14px #fff;}
.hbicon{font-size:24px;}
.hbcount{position:absolute; top:2px; right:4px; background:#000; color:#fff; font-size:11px; font-weight:800; border-radius:6px; padding:0 4px;}
.hbname{font-size:9px; color:#cfe; font-weight:700; text-align:center; line-height:1;}
.hbempty{color:#fff; background:rgba(0,0,0,.5); padding:10px 18px; border-radius:10px; font-weight:700; text-shadow:0 2px 3px #000;}

/* reveal card */
#revealCard{position:absolute; top:38%; left:50%; transform:translate(-50%,-50%); background:rgba(15,20,30,.96); border:3px solid #fff; border-radius:18px; padding:16px 26px; text-align:center; z-index:20; min-width:200px;}
#revealCard.hidden{display:none;}
#revealCard.pop{animation:pop .35s ease;}
@keyframes pop{0%{transform:translate(-50%,-50%) scale(.4); opacity:0;}60%{transform:translate(-50%,-50%) scale(1.12);}100%{transform:translate(-50%,-50%) scale(1); opacity:1;}}
#revealRarity{font-weight:800; font-size:15px; letter-spacing:2px; text-transform:uppercase;}
#revealIcon{font-size:48px; margin:6px 0;}
#revealName{color:#fff; font-weight:800; font-size:20px;}
#revealStats{color:#bcd; font-size:13px; font-weight:700; margin-top:4px;}

/* modals */
.modal{position:fixed; inset:0; background:rgba(0,0,0,.72); z-index:30; display:flex; align-items:center; justify-content:center; padding:14px; pointer-events:auto;}
.modal.hidden{display:none;}
.modalInner{background:linear-gradient(#232b3d,#161b28); border:3px solid #000; border-radius:18px; padding:20px; max-width:720px; width:100%; max-height:90vh; overflow-y:auto; text-align:center; box-shadow:0 10px 40px rgba(0,0,0,.6);}
.modalInner.center{max-width:420px;}
.modalInner h2{color:#fff; font-weight:800; margin-bottom:10px; font-size:26px; text-shadow:0 2px 4px #000;}
.skillCurrency{color:#ffd94a; font-weight:800; margin-bottom:14px; font-size:16px;}
#skillGrid, #invGrid{display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:10px;}
.skillNode{background:linear-gradient(#3157a8,#22406f); border:2px solid #5a8fe0; border-radius:12px; padding:10px 8px; cursor:pointer; transition:transform .1s; color:#fff;}
.skillNode:hover{transform:translateY(-2px);}
.skillNode.maxed{background:linear-gradient(#3aa14a,#237a30); border-color:#5eea6f; cursor:default;}
.skillNode.locked{filter:grayscale(1) brightness(.5); cursor:not-allowed;}
.skillNode.noafford{opacity:.65;}
.skName{font-weight:800; font-size:14px;}
.skLvl{font-size:12px; opacity:.85; margin:2px 0;}
.skEff{font-size:11px; color:#cde; min-height:26px;}
.skCost{margin-top:6px; font-weight:800; font-size:13px; background:rgba(0,0,0,.35); border-radius:8px; padding:3px;}
.skMax{margin-top:6px; font-weight:800; color:#dfffe0;}
.invCard{background:rgba(255,255,255,.05); border:2px solid #888; border-radius:12px; padding:10px; cursor:pointer; color:#fff; transition:transform .1s;}
.invCard:hover{transform:translateY(-2px);}
.invIcon{font-size:30px;}
.invR{font-weight:800; font-size:12px; letter-spacing:1px; text-transform:uppercase;}
.invN{font-weight:800; font-size:14px;}
.invS{font-size:11px; color:#bcd; margin-top:2px;}
#goStats{color:#fff; font-size:17px; line-height:1.8; margin:10px 0;}

#toast{position:absolute; bottom:225px; left:50%; transform:translateX(-50%) translateY(20px); background:rgba(0,0,0,.85); color:#fff; font-weight:700; padding:10px 20px; border-radius:20px; opacity:0; transition:.3s; font-size:14px; text-align:center; max-width:90%; border:2px solid #444;}
#toast.show{opacity:1; transform:translateX(-50%) translateY(0);}

#remixLink{position:fixed; bottom:4px; right:8px; color:rgba(255,255,255,.75); font-size:11px; text-decoration:none; z-index:6; font-weight:700; text-shadow:0 1px 2px #000;}
#remixLink:hover{color:#fff;}

@media (max-width:600px){
  .rolldice .dice{width:76px; height:76px; font-size:42px;}
  .action .ai{font-size:28px;}
  #hotbar{bottom:104px;}
  #toast{bottom:200px;}
  .modalInner{padding:14px;}
}
</parameter>
</invoke>