*{box-sizing:border-box}
html,body{width:100%;height:100%;margin:0;overflow:hidden;background:#05070c;font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;color:#fff;-webkit-user-select:none;user-select:none}
body{touch-action:none;overscroll-behavior:none}
#app{position:fixed;inset:0;overflow:auto;background:#05070c}
#bg{
  position:fixed; inset:0; z-index:0;
  background:
    radial-gradient(circle at 18% 12%, rgba(67,143,255,.25), rgba(67,143,255,0) 28%),
    radial-gradient(circle at 82% 10%, rgba(255,80,170,.20), rgba(255,80,170,0) 28%),
    radial-gradient(circle at 50% 88%, rgba(255,200,60,.10), rgba(255,200,60,0) 34%),
    linear-gradient(180deg, #090d16, #06070b 48%, #04050a);
}
#bg::after{
  content:"";
  position:absolute; inset:0;
  background:
    repeating-linear-gradient(90deg, rgba(115,240,255,.10) 0 3px, transparent 3px 102px, rgba(255,122,217,.10) 102px 105px, transparent 105px 205px);
  opacity:.22;
}
.glass{
  background:linear-gradient(180deg, rgba(18,22,34,.84), rgba(11,14,23,.72));
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 18px 40px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.07);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}
#topbar{
  position:relative; z-index:15; margin:12px 10px 0;
  display:grid; grid-template-columns:repeat(6,minmax(0,1fr));
  gap:10px; padding:10px; border-radius:22px;
}
body[data-page="spend"] #topbar{grid-template-columns:repeat(4,minmax(0,1fr))}
.stat{padding:2px 6px}
.label{display:block; font-size:12px; font-weight:800; letter-spacing:1px; opacity:.8; text-transform:uppercase}
.value{display:block; font-size:20px; font-weight:1000; line-height:1.1}
.panel{
  position:absolute; top:106px; bottom:24px; width:246px; border-radius:26px; padding:16px;
  z-index:10; overflow:auto;
}
#leftPanel{left:10px}
#rightPanel{right:10px}
.panelTitle{font-size:15px; font-weight:1000; margin-bottom:12px}
.sectionGap{margin-top:18px}
#paytable{display:flex; flex-direction:column; gap:8px}
.payRow{
  display:grid; grid-template-columns:42px 1fr auto; gap:10px; align-items:center;
  padding:4px 0; border-bottom:1px solid rgba(255,255,255,.06);
}
.payRow:last-child{border-bottom:0}
.payFace{width:42px; height:42px; border-radius:50%; overflow:hidden; border:2px solid rgba(255,255,255,.08)}
.payFace img{width:100%; height:100%; object-fit:cover; display:block}
.payMeta{font-size:12px; line-height:1.2}
.payMeta strong{display:block; font-size:13px}
.payPays{font-size:12px; font-weight:900; color:#ffe36b}
.modeRow{display:flex; justify-content:space-between; align-items:center; gap:10px; padding:6px 0; border-bottom:1px solid rgba(255,255,255,.05)}
.modeRow:last-of-type{border-bottom:0}
.smallBtn,.controlBtn,.spinBtn,.cta{
  appearance:none; border:0; cursor:pointer; color:#fff; text-decoration:none; text-align:center;
}
.smallBtn,.cta{
  min-width:54px; padding:10px 12px; border-radius:14px;
  background:linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.05));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08);
  font-weight:900;
}
.smallBtn.wide,.navBtn{display:block; width:100%}
.smallBtn.accent{background:linear-gradient(180deg, rgba(76,133,255,.32), rgba(65,83,210,.18))}
.smallBtn:disabled{opacity:.45; cursor:default}
.badge{
  display:inline-flex; align-items:center; justify-content:center; min-width:46px; padding:8px 12px;
  border-radius:14px; background:rgba(255,255,255,.06); font-weight:900;
}
#messageBox{
  margin-top:12px; padding:12px 14px; border-radius:18px;
  background:linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  min-height:64px; font-size:14px; line-height:1.3; font-weight:700;
}
.hintText{margin-top:10px; font-size:12px; line-height:1.35; opacity:.72}
.riskPanel{
  padding:12px; border-radius:18px; background:linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.025));
  border:1px solid rgba(255,255,255,.05);
}
.riskState{font-size:13px; line-height:1.3; min-height:34px; opacity:.92}
.riskSteps{display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin:10px 0 12px}
.riskStep{
  padding:10px 0; border-radius:14px; text-align:center; font-weight:1000;
  background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.06);
}
.riskStep.current{outline:2px solid rgba(255,227,107,.6); box-shadow:0 0 18px rgba(255,227,107,.25)}
.riskStep.done{background:rgba(115,240,255,.12); border-color:rgba(115,240,255,.22)}
.riskBtns{display:grid; grid-template-columns:1fr 1fr; gap:10px}
#casinoStage{
  position:absolute; left:270px; right:270px; top:110px; bottom:20px;
  display:flex; flex-direction:column; align-items:center; justify-content:flex-start;
  z-index:9;
}
#casinoTitle{
  font-size:58px; font-weight:1000; line-height:1; letter-spacing:.5px;
  text-align:center; margin:0 0 14px; text-shadow:0 10px 28px rgba(0,0,0,.35);
}
#cabinet{
  position:relative;
  width:min(980px, 100%);
  aspect-ratio:5 / 3.3;
  border-radius:34px;
  padding:22px;
  overflow:hidden;
}
#cabinetGlow{
  position:absolute; inset:0;
  background:
    radial-gradient(circle at 12% 14%, rgba(255,227,107,.16), transparent 22%),
    radial-gradient(circle at 88% 18%, rgba(115,240,255,.12), transparent 22%),
    radial-gradient(circle at 52% 94%, rgba(255,122,217,.10), transparent 30%);
  pointer-events:none;
}
#reelGrid{
  position:relative; z-index:2;
  width:100%; height:100%;
  display:grid; grid-template-columns:repeat(5,1fr); grid-template-rows:repeat(3,1fr);
  gap:12px;
}
.slotCell{
  position:relative;
  border-radius:26px;
  overflow:hidden;
  background:linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border:1px solid rgba(255,255,255,.08);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.07);
  transition:transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.slotCell.win{
  border-color:rgba(255,227,107,.82);
  box-shadow:0 0 22px rgba(255,227,107,.26), inset 0 1px 0 rgba(255,255,255,.08);
}
.slotCell.scatter{
  border-color:rgba(115,240,255,.72);
  box-shadow:0 0 22px rgba(115,240,255,.22), inset 0 1px 0 rgba(255,255,255,.08);
}
.slotInner{position:absolute; inset:0}
.slotFace{
  width:100%; height:100%; object-fit:cover; display:block;
  filter:drop-shadow(0 6px 12px rgba(0,0,0,.24));
}
.slotCell.spin .slotFace{transform:translateY(12px) scale(1.02); filter:blur(1px) saturate(1.1)}
#winLines{
  position:absolute; inset:22px; width:calc(100% - 44px); height:calc(100% - 44px);
  z-index:5; pointer-events:none;
}
#controls{
  margin-top:18px; display:flex; gap:10px; align-items:center; justify-content:center;
  padding:12px; border-radius:24px;
}
.controlBtn,.spinBtn{
  min-width:86px;
  padding:16px 22px;
  border-radius:18px;
  background:linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.05));
  box-shadow:0 14px 28px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.08);
  font-size:15px; font-weight:1000;
}
.spinBtn{
  min-width:150px;
  background:linear-gradient(180deg, #4dd2ff, #5e60ff);
  box-shadow:0 14px 32px rgba(94,96,255,.35), inset 0 1px 0 rgba(255,255,255,.14);
}
.spinBtn:disabled{opacity:.6; cursor:default}
#winBanner{
  position:absolute; left:50%; top:74px; transform:translateX(-50%); z-index:20;
  padding:16px 28px; border-radius:24px;
  background:linear-gradient(180deg, rgba(255,189,57,.96), rgba(255,156,26,.92));
  color:#111; text-align:center; box-shadow:0 22px 44px rgba(255,177,36,.3);
}
#winBanner.hidden{display:none}
#winBannerText{font-size:26px; font-weight:1000; line-height:1}
#winBannerValue{font-size:42px; font-weight:1000; line-height:1.05}
#loadingOverlay{
  position:absolute; inset:0; z-index:30; display:flex; align-items:center; justify-content:center;
  background:radial-gradient(circle at center, rgba(8,11,18,.16), rgba(0,0,0,.72));
}
.loadingCard{width:min(420px, calc(100vw - 28px)); padding:22px; border-radius:26px}
.loadingTitle{font-size:30px; font-weight:1000; margin-bottom:6px}
.progressOuter{margin-top:14px; height:14px; border-radius:999px; background:rgba(255,255,255,.08); overflow:hidden}
#progressBar{width:0%; height:100%; border-radius:999px; background:linear-gradient(90deg, #73f0ff, #7a7dff, #ff7ad9)}
.trophyShelf{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px}
.trophyCard{
  padding:10px; border-radius:18px; background:linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border:1px solid rgba(255,255,255,.06); min-height:86px;
}
.trophyName{font-size:13px; font-weight:1000}
.trophyCost{font-size:12px; opacity:.75; margin-top:4px}
.trophyEmpty{opacity:.65; font-size:12px; line-height:1.35}
#spendStage{
  position:relative; z-index:5; margin:18px 10px 24px; padding:20px; border-radius:30px;
}
.spendHeader{display:flex; justify-content:space-between; align-items:flex-start; gap:20px}
.spendHeader h1,.spendHeader h2{margin:0 0 6px; font-size:40px}
.spendHeader p{margin:0; opacity:.78; line-height:1.4}
.smallHeader h2{font-size:26px}
.shopGrid,.ownedGrid{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:14px; margin-top:20px;
}
.shopCard,.ownedCard{
  padding:16px; border-radius:24px;
  background:linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border:1px solid rgba(255,255,255,.06);
}
.shopCard h3,.ownedCard h3{margin:0 0 8px; font-size:20px}
.shopCard p,.ownedCard p{margin:0; opacity:.78; line-height:1.35}
.shopMeta{display:flex; justify-content:space-between; align-items:center; margin-top:14px}
.priceTag{
  display:inline-flex; align-items:center; justify-content:center;
  padding:8px 12px; border-radius:12px; font-weight:1000;
  background:rgba(255,255,255,.06);
}
.buyBtn{
  appearance:none; border:0; cursor:pointer; padding:10px 14px; border-radius:14px;
  color:#fff; font-weight:1000;
  background:linear-gradient(180deg, #4dd2ff, #5e60ff);
}
.buyBtn:disabled{opacity:.45; cursor:default}
.spendDivider{height:1px; background:rgba(255,255,255,.08); margin:22px 0}
.toast{
  position:fixed; right:18px; bottom:18px; z-index:30; max-width:320px;
  padding:14px 16px; border-radius:18px;
  background:linear-gradient(180deg, rgba(18,22,34,.94), rgba(11,14,23,.9));
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 18px 36px rgba(0,0,0,.28);
}
.toast.hidden{display:none}
@media (max-width: 1400px){ #casinoStage{left:250px; right:250px} }
@media (max-width: 1100px){
  #topbar{grid-template-columns:repeat(3,minmax(0,1fr))}
  body[data-page="spend"] #topbar{grid-template-columns:repeat(2,minmax(0,1fr))}
  .panel{display:none}
  #casinoStage{left:12px; right:12px; top:124px; bottom:16px}
  #casinoTitle{font-size:44px}
  #cabinet{width:min(900px, 100%)}
}
@media (max-width: 700px){
  #topbar{grid-template-columns:repeat(2,minmax(0,1fr))}
  #casinoTitle{font-size:34px}
  #reelGrid{gap:8px}
  #controls{gap:8px; padding:10px; flex-wrap:wrap; justify-content:center}
  .controlBtn,.spinBtn,.cta{padding:14px 18px; font-size:15px}
  .spinBtn{min-width:120px}
  #winBannerText{font-size:22px}
  #winBannerValue{font-size:34px}
  .spendHeader{flex-direction:column}
}
