:root{
  --bg:#070A0F;
  --bg2:#0B0F14;
  --stroke:rgba(255,255,255,.08);
  --text:#EAF2FF;
  --muted:rgba(234,242,255,.68);
  --accent:#A8FF2E;
  --accent2:#2EF5FF;
  --shadow: 0 18px 60px rgba(0,0,0,.55);
  --r:18px;
  --r2:26px;
  font-synthesis: none;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial;
  color:var(--text);
  background:
    radial-gradient(900px 500px at 18% 14%, rgba(46,245,255,.12), transparent 60%),
    radial-gradient(900px 500px at 80% 18%, rgba(168,255,46,.10), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg2));
}

.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 18px 10px;
  max-width:1100px; margin:0 auto;
}
.brand{display:flex; gap:12px; align-items:center}
.logo{
  width:44px; height:44px; border-radius:14px;
  display:grid; place-items:center;
  background:linear-gradient(135deg, rgba(168,255,46,.18), rgba(46,245,255,.12));
  border:1px solid var(--stroke);
  box-shadow: var(--shadow);
  font-weight:800;
}
.brandName{font-weight:800; letter-spacing:.4px}
.brandTag{font-size:12px; color:var(--muted)}
.pillRow{display:flex; gap:10px; flex-wrap:wrap}
.pill{
  font-size:12px; color:var(--muted);
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.03);
  padding:8px 10px;
  border-radius:999px;
}

.shell{max-width:1100px; margin:0 auto; padding:10px 18px 40px;}
.card{
  background:rgba(255,255,255,.03);
  border:1px solid var(--stroke);
  border-radius:var(--r2);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.hero{display:grid; grid-template-columns: 1.25fr .75fr; gap:18px; padding:22px;}
.hero h1{margin:0 0 10px; font-size:44px; line-height:1.02}
.muted{color:var(--muted)}
.tiny{font-size:12px}

.ctaRow{display:flex; gap:10px; margin-top:16px}
.btn{
  border-radius:14px;
  padding:12px 14px;
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.04);
  color:var(--text);
  font-weight:700;
  cursor:pointer;
}
.btn:disabled{opacity:.45; cursor:not-allowed}
.btn.primary{
  background:linear-gradient(135deg, rgba(168,255,46,.22), rgba(46,245,255,.14));
  border-color: rgba(168,255,46,.35);
}
.btn.ghost{background:transparent}

.microRow{display:grid; grid-template-columns:1fr 1fr 1fr; gap:10px; margin-top:18px}
.cardMini{
  border-radius:16px;
  border:1px solid var(--stroke);
  background:rgba(0,0,0,.18);
  padding:12px;
}
.microTitle{font-weight:800; font-size:12px}
.microText{color:var(--muted); font-size:12px; margin-top:6px}

.heroRight{display:grid; gap:12px}
.packBox{position:relative; padding:16px; overflow:hidden}
.packTop{font-weight:800}
.packHint{color:var(--muted); font-size:12px; margin-top:8px}
.packGlow{
  position:absolute; inset:-50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(168,255,46,.26), transparent 60%),
    radial-gradient(circle at 70% 70%, rgba(46,245,255,.18), transparent 60%);
  filter: blur(18px);
  animation: drift 4.2s ease-in-out infinite alternate;
}
@keyframes drift{
  from{transform:translate(-10px,-8px) rotate(-4deg)}
  to{transform:translate(10px,8px) rotate(4deg)}
}

.market{padding:16px}
.row{display:flex; align-items:center; justify-content:space-between}
.sectionTitle{font-weight:900}
.tag{
  font-size:11px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.03);
}
.sparkWrap{margin-top:12px}
.sparkLine{
  height:64px; border-radius:14px;
  border:1px solid var(--stroke);
  background:
    linear-gradient(180deg, rgba(168,255,46,.10), transparent 70%),
    linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.00));
  overflow:hidden;
}
#sparkSvg{width:100%; height:100%}
.sparkMeta{display:flex; justify-content:space-between; margin-top:10px}

.grid2{display:grid; grid-template-columns: 1fr 1fr; gap:18px; margin-top:18px}
.xi{display:grid; grid-template-columns: repeat(4, 1fr); gap:10px; margin-top:12px}
.slot{
  height:64px; border-radius:16px;
  border:1px dashed rgba(255,255,255,.16);
  display:flex; flex-direction:column; justify-content:center;
  padding:10px;
  background:rgba(0,0,0,.14);
}
.slot .p{font-weight:800; font-size:12px}
.slot .n{color:var(--muted); font-size:12px; margin-top:2px}
.slot.armed{border-color: rgba(168,255,46,.28); background: rgba(168,255,46,.05)}
.slot.equipped{border-style: solid; border-color: rgba(255,255,255,.14)}

.cards{display:grid; grid-template-columns:1fr; gap:10px; margin-top:12px}
.cardRow{
  display:flex; justify-content:space-between; align-items:center;
  padding:12px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.16);
}
.rarity{font-weight:900; font-size:12px}
.rCommon{color:rgba(234,242,255,.75)}
.rRare{color:var(--accent2)}
.rEpic{color:rgba(200,120,255,.95)}
.rLegend{color:var(--accent)}
.footer{max-width:1100px; margin:0 auto; padding:0 18px 24px}

/* ===== Step 5 — Arena + Pass ===== */
.arenaCard, .passCard{padding:16px}
.chipRow{display:flex; gap:8px; flex-wrap:wrap; margin-top:10px}
.arenaLog{
  margin-top:10px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.16);
  border-radius:14px;
  padding:10px;
  font-size:12px;
  color:rgba(234,242,255,.75);
}
.chip{
  border-radius:999px;
  padding:8px 10px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.03);
  color:rgba(234,242,255,.82);
  font-weight:800;
  font-size:12px;
  cursor:pointer;
}
.chip.active{
  border-color: rgba(168,255,46,.35);
  background: rgba(168,255,46,.10);
  color: var(--text);
}
.bar{
  height:10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.04);
  overflow:hidden;
  margin:10px 0 8px;
}
.barFill{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, rgba(46,245,255,.25), rgba(168,255,46,.20));
}

/* ===== Step 4 — Locker ===== */
.locker{margin-top:18px; padding:16px}
.lockerHeader{
  display:flex; align-items:flex-end; justify-content:space-between; gap:12px;
  padding:2px 2px 12px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.styleToggle{display:flex; align-items:center; gap:8px; flex-wrap:wrap}
.lockerBody{
  display:grid;
  grid-template-columns: 1.3fr .7fr;
  gap:14px;
  padding-top:12px;
}
.invPanel{min-height:260px}
.filterRow{display:flex; gap:8px; flex-wrap:wrap; margin-bottom:10px}
.invList{
  display:grid;
  grid-template-columns: 1fr;
  gap:10px;
  max-height:360px;
  overflow:auto;
  padding-right:6px;
}
.invItem{
  border-radius:16px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.16);
  padding:12px;
  display:flex;
  justify-content:space-between;
  gap:10px;
  cursor:pointer;
}
.invItem:hover{background:rgba(255,255,255,.04)}
.invItem.selected{
  border-color: rgba(46,245,255,.30);
  box-shadow: 0 0 0 1px rgba(46,245,255,.15);
}
.invName{font-weight:900}
.invMeta{margin-top:4px; font-size:12px; color:rgba(234,242,255,.70)}
.detailPanel{display:grid; gap:12px}
.detailCard{
  border-radius:18px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.16);
  padding:14px;
}
.chemBox{
  border-radius:18px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.16);
  padding:14px;
}
.chemRow{display:flex; justify-content:space-between; align-items:center}

/* ===== Step 6 — Market ===== */
.marketShell{margin-top:18px; padding:16px}
.marketHeader{
  display:flex; justify-content:space-between; align-items:flex-end; gap:12px;
  padding:2px 2px 12px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.marketActions{display:flex; gap:10px; flex-wrap:wrap}
.marketBody{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
  padding-top:12px;
}
.marketColTitle{font-weight:900; margin-bottom:10px}
.listBox{
  border:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.16);
  border-radius:18px;
  padding:12px;
}
.listRow{display:flex; justify-content:space-between; align-items:center; gap:10px}
.priceRow{display:flex; gap:10px; margin-top:10px}
.inp{
  width:100%;
  border-radius:14px;
  padding:12px 12px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.03);
  color:var(--text);
  outline:none;
}
.openListings,.myListings{
  display:grid;
  grid-template-columns: 1fr;
  gap:10px;
  max-height:420px;
  overflow:auto;
  padding-right:6px;
}
.listing{
  border-radius:16px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.16);
  padding:12px;
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
}
.listingMeta{font-size:12px; color:rgba(234,242,255,.70); margin-top:4px}
.listingRight{display:flex; gap:10px; align-items:center}
.priceTag{
  font-weight:900;
  font-size:12px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.03);
}
.smallBtn{
  border-radius:12px;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.03);
  color:var(--text);
  font-weight:900;
  cursor:pointer;
}
.smallBtn.primary{
  border-color: rgba(168,255,46,.35);
  background: rgba(168,255,46,.10);
}
.smallBtn.danger{
  border-color: rgba(255,90,90,.28);
  background: rgba(255,90,90,.10);
}

/* Step 3 overlay */
.hidden{display:none !important;}
.overlay{
  position:fixed; inset:0;
  background:rgba(0,0,0,.62);
  display:grid; place-items:center;
  z-index:9999;
  padding:18px;
}
.overlayInner{
  width:min(980px, 100%);
  padding:18px;
  position:relative;
  overflow:hidden;
}
.overlayHeader{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:4px 2px 12px;
}
.overlayTitle{font-weight:900; letter-spacing:.3px; font-size:14px}
.revealStage{display:grid; grid-template-columns: 1fr 1.2fr; gap:14px; margin-top:8px}
.revealPack{
  border-radius:22px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.20);
  padding:16px;
  position:relative;
  min-height:210px;
  cursor:pointer;
  overflow:hidden;
}
.revealPackLabel{font-weight:900; font-size:14px}
.revealPackHint{margin-top:8px}
.revealPackGlow{
  position:absolute; inset:-40%;
  background:
    radial-gradient(circle at 25% 25%, rgba(168,255,46,.26), transparent 58%),
    radial-gradient(circle at 70% 75%, rgba(46,245,255,.18), transparent 60%);
  filter: blur(18px);
  animation: packDrift 3.8s ease-in-out infinite alternate;
}
@keyframes packDrift{
  from{transform:translate(-10px,-10px) rotate(-4deg)}
  to{transform:translate(10px,10px) rotate(4deg)}
}
.revealPack.shake{animation: packShake .55s ease-in-out infinite;}
@keyframes packShake{
  0%{transform:translate(0,0) rotate(0)}
  20%{transform:translate(2px,-1px) rotate(-.4deg)}
  40%{transform:translate(-2px,1px) rotate(.5deg)}
  60%{transform:translate(2px,1px) rotate(-.3deg)}
  80%{transform:translate(-1px,-2px) rotate(.3deg)}
  100%{transform:translate(0,0) rotate(0)}
}
.revealCards{display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap:12px}
.flipCard{perspective: 1000px; height:210px; border-radius:22px; position:relative;}
.flipInner{
  position:absolute; inset:0; border-radius:22px;
  transform-style:preserve-3d;
  transition: transform .7s cubic-bezier(.2,.8,.2,1);
}
.flipCard.flipped .flipInner{transform: rotateY(180deg);}
.flipFace{
  position:absolute; inset:0; border-radius:22px;
  backface-visibility:hidden;
  border:1px solid rgba(255,255,255,.10);
  overflow:hidden;
}
.flipBack{
  background: linear-gradient(135deg, rgba(168,255,46,.10), rgba(46,245,255,.08)), rgba(0,0,0,.22);
  display:flex; flex-direction:column; justify-content:center; align-items:center; gap:8px;
}
.flipBack .q{font-weight:900; font-size:36px; opacity:.95;}
.flipBack .t{font-size:12px; color:rgba(234,242,255,.70);}
.flipFront{
  transform: rotateY(180deg);
  background: rgba(0,0,0,.22);
  padding:14px;
  display:flex; flex-direction:column; justify-content:space-between;
}
.cardTop{display:flex; align-items:flex-start; justify-content:space-between; gap:10px}
.cardName{font-weight:900; line-height:1.05}
.cardMeta{margin-top:6px; font-size:12px; color:rgba(234,242,255,.70)}
.badge{
  font-weight:900; font-size:11px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
  white-space:nowrap;
}
.cardFooter{display:flex; justify-content:space-between; align-items:center; font-size:12px; color:rgba(234,242,255,.70)}
.overlayInner.legendaryBurst::after{
  content:""; position:absolute; inset:-30%;
  background:
    radial-gradient(circle at 50% 45%, rgba(168,255,46,.22), transparent 58%),
    radial-gradient(circle at 65% 65%, rgba(46,245,255,.12), transparent 60%);
  filter: blur(14px);
  animation: burst 900ms ease-out forwards;
  pointer-events:none;
}
@keyframes burst{
  0%{opacity:0; transform:scale(.8)}
  30%{opacity:1; transform:scale(1)}
  100%{opacity:0; transform:scale(1.2)}
}
.overlayFooter{
  display:flex; justify-content:flex-end;
  margin-top:14px; padding-top:12px;
  border-top:1px solid rgba(255,255,255,.08);
}

/* Mobile */
@media (max-width: 900px){
  .hero{grid-template-columns:1fr}
  .grid2{grid-template-columns:1fr}
  .lockerBody{grid-template-columns:1fr}
  .marketBody{grid-template-columns:1fr}
  .revealStage{grid-template-columns: 1fr;}
  .revealCards{grid-template-columns: 1fr; }
  .flipCard{height:170px;}
}

.badgeSm{
  font-weight:900;
  font-size:10px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
  color: rgba(234,242,255,.85);
}

.trades{
  display:grid;
  grid-template-columns: 1fr;
  gap:10px;
  max-height:240px;
  overflow:auto;
  padding-right:6px;
}
.tradeRow{
  border-radius:16px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.16);
  padding:12px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}
.tradeMeta{font-size:12px; color:rgba(234,242,255,.70); margin-top:4px}
