/* ---------- hero stage ---------- */
.hero { position: relative; min-height: min(100vh, 980px); min-height: min(100svh, 980px); display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; border-bottom: 1px solid var(--line); margin-top: -64px; padding-top: 64px; }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero::after { content: ''; position: absolute; inset: auto 0 0; height: 40%; background: linear-gradient(transparent, var(--bg)); pointer-events: none; }
.hero::before { content: ''; position: absolute; inset: 0 auto 0 0; width: min(760px, 55%); background: linear-gradient(90deg, rgba(7, 8, 10, .92) 0%, rgba(7, 8, 10, .7) 55%, transparent); z-index: 1; pointer-events: none; }
.hero-fallback { position: absolute; right: 18%; top: 22%; width: 220px; opacity: 0; filter: var(--hue) drop-shadow(0 30px 60px rgba(0, 0, 0, .7)); }
.no-webgl .hero-fallback { opacity: 1; }
.hero-in { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 520px) 1fr; gap: 40px; padding: 120px 0 40px; pointer-events: none; }
.hero-in > * { pointer-events: auto; }
.hero-copy { grid-column: 1; align-self: start; }
.hero-copy h1 { font-size: clamp(36px, 4.4vw, 60px); font-weight: 600; letter-spacing: -.04em; line-height: 1; }
.hero-copy p { margin: 22px 0 0; max-width: 440px; color: var(--mute); font-size: 17px; }
.console {
  grid-column: 1; margin-top: 34px; padding: 18px; border-radius: 18px;
  background: rgba(13, 15, 18, .72); border: 1px solid var(--line-2); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.tiers { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: rgba(0, 0, 0, .25); }
.tier { height: 40px; padding: 0; white-space: nowrap; border: 0; border-radius: 9px; background: transparent; font: 500 13px/1 var(--mono); color: var(--mute); transition: background .2s, color .2s; }
.tier:hover { color: var(--text); }
.tier.on { background: var(--text); color: #050605; }
.odds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 14px 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--line); }
.odd { background: var(--bg-2); padding: 11px 12px; }
.odd .rar-chip { font-size: 12px; color: var(--mute); }
.odd .p { display: block; margin-top: 8px; font: 500 17px/1 var(--mono); }
.odd .v { display: block; margin-top: 5px; font: 500 11px/1.2 var(--mono); color: var(--mute); }
.console-actions { display: grid; grid-template-columns: 1.3fr 1fr; gap: 8px; }
.console-note { margin: 12px 2px 0; font-size: 13px; color: var(--mute); min-height: 1em; }
.hero-stats { position: relative; z-index: 2; display: flex; gap: 28px; padding: 0 0 26px; }
.hero-stats:empty { display: none; }
.hero-stats div b { display: block; font: 500 22px/1 var(--mono); }
.hero-stats div span { font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
@media (max-width: 900px) {
  .hero { min-height: 0; justify-content: flex-start; }
  #stage { position: relative; height: 54vh; min-height: 340px; -webkit-mask-image: linear-gradient(#000 72%, transparent); mask-image: linear-gradient(#000 72%, transparent); }
  .hero::after, .hero::before { display: none; }
  .hero-in { grid-template-columns: 1fr; padding: 0 0 32px; margin-top: -40px; }
  .hero-copy h1 { font-size: 40px; }
  .hero-fallback { left: 50%; right: auto; transform: translateX(-50%); top: 90px; width: 170px; }
}
@media (max-width: 480px) {
  .tier { font-size: 11.5px; }
  .odds { grid-template-columns: 1fr 1fr; }
  .console-actions { grid-template-columns: 1fr; }
}

/* ---------- set ---------- */
.set-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .set-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 700px) { .set-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }

/* ---------- live pulls ---------- */
.live-list { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.lp { display: grid; grid-template-columns: auto 1fr auto auto; gap: 16px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); text-decoration: none; background: var(--bg-2); }
.lp:first-child { border-top: 0; }
.lp:hover { background: var(--bg-3); }
.lp .minis { display: flex; gap: 4px; }
.lp .minis img { width: 30px; height: 42px; object-fit: cover; border-radius: 4px; }
.lp .who b { font: 500 13px/1.2 var(--mono); display: block; }
.lp .who span { font-size: 12px; color: var(--mute); }
.lp .tag-r { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--rc); }
.lp .amt { font: 500 15px/1 var(--mono); color: var(--pump); white-space: nowrap; }
.empty { padding: 28px; text-align: center; color: var(--mute); border: 1px dashed var(--line-2); border-radius: 14px; }

/* ---------- how ---------- */
.how { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 40px; }
.how-head h2 { font-size: clamp(24px, 3vw, 34px); margin-bottom: 20px; }
.how-steps { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.how-steps > div { padding: 22px 22px 0 0; }
.how-steps dt { font: 500 18px/1.2 var(--display); }
.how-steps dt span { display: block; font: 500 11px/1 var(--mono); color: var(--pump); margin-bottom: 14px; letter-spacing: .1em; }
.how-steps dd { margin: 10px 0 0; color: var(--mute); }
@media (max-width: 860px) { .how { grid-template-columns: 1fr; gap: 10px; } .how-steps { grid-template-columns: 1fr; } }

/* ---------- opening overlay ---------- */
.opening { position: fixed; inset: 0; z-index: 120; display: none; flex-direction: column; overflow: hidden; background: radial-gradient(ellipse at 50% 42%, #10241a 0%, #07080a 62%); }
.opening::before { content: ''; position: absolute; left: 50%; top: -10%; width: 70vmax; height: 120vh; translate: -50% 0; background: conic-gradient(from 180deg at 50% 0%, transparent 160deg, rgba(255, 255, 255, .05) 175deg, rgba(255, 255, 255, .08) 180deg, rgba(255, 255, 255, .05) 185deg, transparent 200deg); pointer-events: none; }
.opening.on { display: flex; }
.opening.flash::after { content: ''; position: absolute; inset: 0; background: #fff; animation: flash .45s ease-out forwards; pointer-events: none; }
@keyframes flash { from { opacity: .55; } to { opacity: 0; } }
.opening.shake .op-stage { animation: shake .45s; }
@keyframes shake { 20% { transform: translate(-6px, 3px); } 40% { transform: translate(5px, -4px); } 60% { transform: translate(-4px, 2px); } 80% { transform: translate(3px, -1px); } }
#confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
.op-top { position: relative; z-index: 6; display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; }
.op-tools { display: flex; gap: 8px; }
.op-stage { position: relative; flex: 1; display: grid; place-items: center; z-index: 2; }

.rip-pack { position: relative; height: min(56vh, 470px); aspect-ratio: 240 / 392; touch-action: none; user-select: none; cursor: grab; transition: transform .5s, opacity .5s; }
.rip-pack img { width: 100%; height: 100%; filter: var(--hue) drop-shadow(0 30px 50px rgba(0, 0, 0, .7)); pointer-events: none; }
.rip-pack .rp-body, .rip-pack .rp-top { position: absolute; inset: 0; }
.rip-pack .rp-body { clip-path: polygon(0 18%, 8% 17%, 16% 19%, 24% 17.2%, 32% 19%, 40% 17%, 48% 18.8%, 56% 17.2%, 64% 19%, 72% 17%, 80% 18.8%, 88% 17.2%, 100% 18.5%, 100% 100%, 0 100%); }
.rip-pack .rp-top { clip-path: polygon(0 0, 100% 0, 100% 18.5%, 88% 17.2%, 80% 18.8%, 72% 17%, 64% 19%, 56% 17.2%, 48% 18.8%, 40% 17%, 32% 19%, 24% 17.2%, 16% 19%, 8% 17%, 0 18%); transform-origin: 100% 18%; transition: transform .08s linear; }
.rip-pack.torn .rp-top { transition: transform .7s cubic-bezier(.3, .6, .4, 1), opacity .7s; transform: translate(60vw, -40vh) rotate(70deg) !important; opacity: 0; }
.rip-pack .rp-line { position: absolute; left: 4%; right: 4%; top: 17.6%; height: 0; border-top: 1px dashed rgba(255, 255, 255, .7); }
.rip-pack .rp-dot { position: absolute; left: 0; top: -9px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 6px rgba(255, 255, 255, .15), 0 0 24px rgba(255, 255, 255, .6); animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(30px); } }
.rip-pack.dragging .rp-dot { animation: none; }
.rip-pack.torn .rp-line, .rip-pack.waiting .rp-line { opacity: 0; }
.rip-pack.waiting { animation: hover-pk 1.6s ease-in-out infinite; cursor: progress; }
@keyframes hover-pk { 50% { transform: translateY(-10px); } }
.rip-pack.gone { transform: translateY(70vh); opacity: 0; }

.slots { position: absolute; inset: 0; pointer-events: none; }
.slot { --cw: min(240px, 26vw, 36vh); position: absolute; left: 50%; top: 50%; width: var(--cw); aspect-ratio: 634 / 894; translate: -50% -42%; transition: translate .8s cubic-bezier(.2, .9, .3, 1.1), scale .8s, opacity .4s; pointer-events: auto; scale: .7; opacity: 0; }
.slot.out { opacity: 1; scale: 1; translate: var(--tx, -50%) -42%; }
.slot .pcard { --w: var(--cw); width: 100%; cursor: pointer; }
.slot .pcard.flipping { transition: transform .8s cubic-bezier(.3, 1.3, .5, 1); }
.slot::before { content: ''; position: absolute; inset: -22% -30%; opacity: 0; transition: opacity .4s; background: radial-gradient(closest-side, var(--ag, transparent), transparent); pointer-events: none; }
.slot.aura-rare { --ag: rgba(90, 169, 255, .6); }
.slot.aura-rare::before { opacity: .7; }
.slot.aura-epic { --ag: rgba(185, 140, 255, .75); }
.slot.aura-epic::before { opacity: .9; animation: pulse 1.1s ease-in-out infinite; }
.slot.aura-legendary { --ag: rgba(245, 196, 81, .95); }
.slot.aura-legendary::before { opacity: 1; inset: -35% -45%; animation: pulse .7s ease-in-out infinite; }
.slot.aura-legendary .pcard:not(.shown), .slot.aura-epic .pcard:not(.shown) { animation: tremble .5s linear infinite; }
@keyframes pulse { 50% { opacity: .45; } }
@keyframes tremble { 25% { translate: -1.5px 1px; } 75% { translate: 1.5px -1px; } }
.slot.shown::before { animation: none; opacity: .45; }
.slot .badge-new { position: absolute; bottom: -34px; left: 50%; z-index: 3; translate: -50% 0; white-space: nowrap; font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--rc); opacity: 0; transition: opacity .4s .2s; }
.slot.shown .badge-new { opacity: 1; }

.op-bottom { position: relative; z-index: 6; text-align: center; padding: 10px 16px 28px; min-height: 110px; }
.op-hint { margin: 0 0 14px; font: 500 15px/1.3 var(--body); color: var(--mute); }
.op-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.summary { position: absolute; z-index: 7; left: 50%; bottom: 18px; width: min(540px, calc(100% - 32px)); translate: -50% 150%; padding: 20px; background: rgba(13, 15, 18, .9); border-color: var(--line-2); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); transition: translate .6s cubic-bezier(.2, .9, .3, 1.1); }
.summary.on { translate: -50% 0; }
.summary h3 { font-size: 18px; }
.summary .rows { margin: 14px 0; display: grid; gap: 1px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--line); }
.summary .row { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; padding: 9px 12px; background: var(--bg-2); }
.summary .row img { width: 28px; height: 40px; object-fit: cover; border-radius: 4px; }
.summary .row small { color: var(--mute); margin-left: 6px; }
.summary .row .v { font: 500 13px/1 var(--mono); }
.summary .total { display: flex; justify-content: space-between; align-items: baseline; }
.summary .total span { color: var(--mute); }
.summary .total b { font: 500 22px/1 var(--mono); color: var(--pump); }
.summary .note { margin: 10px 0 14px; font-size: 13px; color: var(--mute); }
.summary .note a { color: var(--text); }
.summary .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.summary .acts .btn { flex: 1 1 auto; }
.opening.done .op-bottom { opacity: 0; pointer-events: none; }
.opening.done .slot { translate: var(--tx) -80%; }
.opening.done .slot .badge-new { opacity: 0; }
@media (max-width: 640px) {
  .slot { --cw: min(30vw, 150px); }
  .opening.done .slot { translate: var(--tx) -125%; }
  .summary { padding: 14px; bottom: 10px; }
}
