:root {
  --bg: #0f0f13;
  --sidebar: #17151d;
  --panel: #15131b;
  --raised: #1c1a25;
  --hover: #252231;
  --line: #2a2735;
  --line-strong: #3a3748;
  --text: #f4f2fc;
  --muted: #a29eb6;
  --faint: #827e98;
  --primary: #7a55ee;
  --primary-hover: #6744dc;
  --primary-soft: #b29dff;
  --green: #34d58b;
  --gold: #ffc24b;
  --danger: #ff5c7a;
  --common: #8f8aa3;
  --uncommon: #39b4ff;
  --rare: #7c5cff;
  --epic: #ff5ca8;
  --grail: #ffc24b;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --sidebar-w: 236px;
  --panel-2: var(--raised);
  --paper: var(--text);
  --ink: #0f0f13;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 500 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--primary-soft); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.01em; }
[hidden] { display: none !important; }
* { scrollbar-width: thin; scrollbar-color: #3a3748 transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #3a3748; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* sidebar */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--sidebar); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 14px; z-index: 30; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 2px 8px 20px; }
.logo svg { width: 30px; height: 30px; flex: none; }
.logo span { font-weight: 800; font-size: 20px; letter-spacing: -0.03em; }
.side-nav, .side-more { display: flex; flex-direction: column; gap: 4px; }
.side-nav a, .side-more a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: #aaa5b7; font-weight: 600; }
.side-nav a svg, .side-more a svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.side-nav a:hover, .side-more a:hover { color: var(--text); background: var(--hover); }
.side-nav a.on, .side-more a.on { background: var(--hover); color: #d0c0ff; }
.side-nav a.on svg, .side-more a.on svg { color: var(--primary-soft); }
.side-more { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.side-label { margin: 0 12px 4px; font-size: 12px; font-weight: 700; color: var(--faint); }
.volume { display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: #aaa5b7; }
.volume svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.volume input { flex: 1; accent-color: #a897ff; min-width: 0; }

/* main */
.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.pagebar { display: flex; align-items: center; gap: 16px; padding: 18px 32px; position: sticky; top: 0; z-index: 20; background: rgba(15,15,19,.9); backdrop-filter: blur(12px); }
.pagebar h1 { font-size: 26px; font-weight: 800; margin-right: auto; }
main { flex: 1; width: 100%; max-width: 1840px; padding: 4px 32px 56px; outline: none; }
.foot { padding: 20px 32px 28px; color: var(--faint); font-size: 13px; border-top: 1px solid var(--line); }
.account { display: flex; align-items: center; gap: 10px; }
.balance { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 10px; background: var(--raised); border: 1px solid var(--line); font-weight: 750; font-size: 16px; font-variant-numeric: tabular-nums; }
.balance i { color: var(--green); font-style: normal; }
.balance.bump { animation: bump .5s ease; }
@keyframes bump { 40% { transform: scale(1.07); } }
.me-btn { display: flex; padding: 0; background: none; border: 0; border-radius: 50%; text-decoration: none; }

/* buttons */
.btn { border: 0; border-radius: var(--r-sm); padding: 10px 16px; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; line-height: 1.2; transition: background .15s; }
.btn-primary, .btn-tag { background: var(--primary); color: #fff; }
.btn-primary:hover, .btn-tag:hover { background: var(--primary-hover); }
.btn-secondary, .btn-ghost { background: #2c2937; color: var(--text); border: 1px solid #4d4760; }
.btn-secondary:hover, .btn-ghost:hover { background: #363244; }
.btn-gold { background: var(--gold); color: #2a1d00; }
.btn-gold:hover { background: #ffd57d; }
.btn-full { width: 100%; }
.btn-lg { padding: 15px 18px; font-size: 18px; font-weight: 700; border-radius: var(--r-md); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.danger { color: var(--danger); }

/* avatar */
.avatar { --av: var(--primary); width: var(--s, 32px); height: var(--s, 32px); border-radius: 50%; background: var(--av); color: #fff; display: inline-grid; place-items: center; font-weight: 800; font-size: calc(var(--s, 32px) * .44); flex: none; text-transform: uppercase; box-shadow: inset 0 -2px 0 rgba(0,0,0,.2); }

/* panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.section-head { display: flex; align-items: center; gap: 10px; margin: 36px 0 14px; }
.section-head h2 { font-size: 22px; font-weight: 800; }
.section-head .ic { width: 20px; height: 20px; }
.section-head p { margin: 0 0 0 auto; color: var(--muted); font-size: 14px; }
.empty { text-align: center; padding: 56px 16px; color: var(--muted); }
.empty h2 { color: var(--text); font-size: 22px; margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }
.form-note { margin: 0; color: var(--muted); font-size: 13px; }
.form-err { margin: 0; color: var(--danger); font-size: 14px; }
.form-err:empty { display: none; }

/* packs page */
.shop { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: stretch; }
.stage { position: relative; min-height: 380px; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(80% 90% at 50% 45%, color-mix(in srgb, var(--pb, #7a55ee) 22%, transparent), transparent 70%), var(--panel); }
.stage-pack { width: 210px; transition: transform .35s cubic-bezier(.2,1.2,.4,1); }
.stage-pack:hover { transform: rotate(-2deg) scale(1.03); }
.stage-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: rgba(28,26,37,.8); display: grid; place-items: center; color: var(--text); font-size: 20px; line-height: 1; z-index: 2; }
.stage-arrow:hover { background: var(--hover); }
.stage-arrow.prev { left: 16px; }
.stage-arrow.next { right: 16px; }
.stage-top { position: absolute; top: 14px; right: 14px; display: flex; gap: 8px; z-index: 6; }
.toggle { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 999px; background: rgba(28,26,37,.85); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.toggle input { appearance: none; width: 30px; height: 18px; border-radius: 999px; background: #3d3b49; position: relative; margin: 0; cursor: pointer; transition: background .2s; }
.toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s; }
.toggle input:checked { background: var(--primary); }
.toggle input:checked::after { transform: translateX(12px); }
.stage-name { position: absolute; left: 20px; bottom: 16px; color: var(--muted); font-size: 13px; max-width: 60%; z-index: 2; }
.stage-name b { display: block; color: var(--text); font-size: 17px; }

.store { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.store h2 { font-size: 24px; font-weight: 750; }
.field-label { font-size: 11px; font-weight: 700; color: var(--faint); margin: 0 0 6px; text-transform: uppercase; letter-spacing: .04em; }
.tier { position: relative; }
.tier-btn { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; background: var(--raised); border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 14px; }
.tier-btn:hover, .tier-btn[aria-expanded="true"] { border-color: var(--primary); }
.tier-btn .t-name { font-weight: 650; font-size: 16px; margin-right: auto; }
.tier-btn .t-price, .tier-opt .t-price { text-align: right; font-weight: 700; }
.tier-btn .t-price small, .tier-opt small { display: block; color: var(--primary-soft); font-size: 12px; font-weight: 600; }
.tier-btn .chev { color: var(--muted); transition: transform .2s; }
.tier-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.tier-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 10; background: #1b1924; border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 6px; box-shadow: 0 18px 40px rgba(0,0,0,.5); max-height: 340px; overflow: auto; }
.tier-opt { width: 100%; display: flex; align-items: center; gap: 12px; background: none; border: 0; border-radius: 9px; padding: 10px; text-align: left; }
.tier-opt:hover, .tier-opt.on { background: var(--hover); }
.tier-opt .mini { width: 26px; flex: none; }
.tier-opt .t-name { margin-right: auto; font-weight: 600; }
.range-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; }
.range-row .lbl { font-size: 12px; color: var(--muted); }
.range-row b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.store .grow { flex: 1; }
.store-note { font-size: 13px; color: var(--muted); text-align: center; margin: -6px 0 0; }

/* foil pack art */
.pack { --a: #2a2440; --b: #7a55ee; position: relative; aspect-ratio: 5 / 7.2; width: 100%; filter: drop-shadow(0 22px 26px rgba(0,0,0,.55)); }
.pack-foil { position: absolute; inset: 0; border-radius: 5px; overflow: hidden; color: #fff; text-align: center;
  background:
    linear-gradient(115deg, transparent 20%, rgba(255,255,255,.3) 38%, transparent 52%),
    conic-gradient(from 210deg at 70% 30%, rgba(255,120,220,.22), rgba(120,200,255,.22), rgba(140,255,190,.18), rgba(255,230,120,.22), rgba(255,120,220,.22)),
    linear-gradient(160deg, var(--b), var(--a) 78%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4%;
  clip-path: polygon(0 3%, 4% 0, 8% 3%, 12% 0, 16% 3%, 20% 0, 24% 3%, 28% 0, 32% 3%, 36% 0, 40% 3%, 44% 0, 48% 3%, 52% 0, 56% 3%, 60% 0, 64% 3%, 68% 0, 72% 3%, 76% 0, 80% 3%, 84% 0, 88% 3%, 92% 0, 96% 3%, 100% 0, 100% 100%, 96% 97%, 92% 100%, 88% 97%, 84% 100%, 80% 97%, 76% 100%, 72% 97%, 68% 100%, 64% 97%, 60% 100%, 56% 97%, 52% 100%, 48% 97%, 44% 100%, 40% 97%, 36% 100%, 32% 97%, 28% 100%, 24% 97%, 20% 100%, 16% 97%, 12% 100%, 8% 97%, 4% 100%, 0 97%); }
.pack-foil::before, .pack-foil::after { content: ""; position: absolute; left: 0; right: 0; height: 9%; background: repeating-linear-gradient(90deg, rgba(255,255,255,.2) 0 2px, rgba(0,0,0,.2) 2px 5px); }
.pack-foil::before { top: 0; }
.pack-foil::after { bottom: 0; }
.pack-brand { font-weight: 850; font-size: clamp(10px, 1.5vw, 17px); letter-spacing: -0.02em; text-shadow: 0 1px 0 rgba(0,0,0,.25); }
.pack-mark { width: 42%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.14); box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.pack-mark svg { width: 62%; height: 62%; }
.pack-name { font-weight: 800; font-size: clamp(11px, 1.6vw, 19px); letter-spacing: .03em; text-transform: uppercase; padding: 0 8%; line-height: 1.1; }
.pack-price { font-weight: 700; font-size: clamp(9px, 1.1vw, 12px); opacity: .85; }
.mini .pack-brand, .mini .pack-name, .mini .pack-price, .mini-bag .pack-brand, .mini-bag .pack-name, .mini-bag .pack-price { display: none; }
.mini .pack, .mini-bag .pack { filter: none; }

/* item card */
.card { --rc: var(--common); position: relative; flex: 0 0 150px; width: 150px; border-radius: var(--r-md); background: var(--raised); border: 1px solid var(--line); overflow: hidden; display: flex; flex-direction: column; }
.card-art { aspect-ratio: 1; display: grid; place-items: center; padding: 14px;
  background: radial-gradient(70% 70% at 50% 45%, color-mix(in srgb, var(--rc) 34%, transparent), transparent 75%), #14121b; border-bottom: 2px solid var(--rc); }
.card-art svg { width: 58%; height: 58%; color: #e9e5f7; }
.card-art img { max-width: 100%; max-height: 100%; object-fit: contain; }
.card-body { padding: 9px 10px 10px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.card-brand { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-name { font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-val { font-size: 15px; font-weight: 750; color: var(--green); font-variant-numeric: tabular-nums; margin-top: 2px; }
.card.r-rare, .card.r-epic, .card.r-grail { border-color: color-mix(in srgb, var(--rc) 45%, var(--line)); }
.card.r-epic, .card.r-grail { box-shadow: 0 0 22px -8px var(--rc); }
.r-common { --rc: var(--common); } .r-uncommon { --rc: var(--uncommon); } .r-rare { --rc: var(--rare); } .r-epic { --rc: var(--epic); } .r-grail { --rc: var(--grail); }
.rarity-pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; color: var(--rc); background: color-mix(in srgb, var(--rc) 15%, transparent); }
.card .odds-tag { position: absolute; top: 8px; right: 8px; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: rgba(15,15,19,.8); color: var(--text); }

/* hits rows */
.hits { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.hit { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: var(--r-lg); background: #121119; border: 1px solid var(--line); text-decoration: none; min-width: 0; }
.hit:hover { background: var(--raised); }
.hit.r-rare, .hit.r-epic, .hit.r-grail { box-shadow: inset 0 -40px 50px -40px color-mix(in srgb, var(--rc) 45%, transparent); border-color: color-mix(in srgb, var(--rc) 30%, var(--line)); }
.hit-art { width: 64px; height: 80px; flex: none; border-radius: 8px; display: grid; place-items: center; padding: 6px; background: radial-gradient(circle, color-mix(in srgb, var(--rc) 40%, transparent), transparent 75%), #1a1823; box-shadow: 0 0 0 1px color-mix(in srgb, var(--rc) 50%, transparent); }
.hit-art svg { width: 44px; height: 44px; color: #e9e5f7; }
.hit-art img { max-width: 100%; max-height: 100%; object-fit: contain; }
.hit-body { min-width: 0; }
.hit-val { color: var(--green); font-size: 21px; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.1; }
.hit-name { font-weight: 650; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hit-who { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.hit-when { font-size: 12px; color: var(--faint); }
.top-hits .hit-val { color: var(--gold); }
.contents { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.contents .card { width: auto; }

/* reel */
.stage:has(.reel) .stage-arrow, .stage:has(.reel) .stage-name, .stage:has(.reel) .stage-pack { visibility: hidden; }
.reel { position: absolute; inset: 0; overflow: hidden; z-index: 3; background: var(--panel);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.reel-track { display: flex; gap: 12px; position: absolute; left: 0; top: 50%; margin-top: -115px; will-change: transform; }
.reel-track .card { flex-basis: 150px; }
.needle { position: absolute; top: 8%; bottom: 8%; left: 50%; width: 3px; margin-left: -1.5px; background: var(--text); border-radius: 3px; z-index: 5; box-shadow: 0 0 14px rgba(255,255,255,.6); }
.reel.suspense .needle { animation: needleBeat .35s ease-in-out infinite; }
@keyframes needleBeat { 50% { box-shadow: 0 0 28px 8px rgba(178,157,255,.9); } }
.reel.landed .needle { background: var(--rc); box-shadow: 0 0 18px var(--rc); }
.reel .card.hit-card { animation: hitPop .6s cubic-bezier(.2,1.6,.4,1) forwards; z-index: 2; }
.reel.landed.r-rare .card.hit-card, .reel.landed.r-epic .card.hit-card, .reel.landed.r-grail .card.hit-card { box-shadow: 0 0 34px 6px var(--rc); }
@keyframes hitPop { 40% { transform: scale(1.12); } 100% { transform: scale(1.06); } }

/* dialogs */
.sheet { border: 1px solid #3c3449; background: #17141f; color: var(--text); border-radius: 18px; padding: 24px; width: min(440px, calc(100vw - 24px)); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.sheet::backdrop { background: rgba(8,7,12,.82); backdrop-filter: blur(3px); }
.sheet-close { position: absolute; top: 10px; right: 12px; margin: 0; z-index: 7; }
.sheet-close button { background: none; border: 0; font-size: 26px; color: var(--muted); line-height: 1; padding: 4px 8px; }
.sheet-title { font-size: 21px; font-weight: 800; margin-bottom: 16px; }
.seg { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: 10px; margin-bottom: 18px; }
.seg button { flex: 1; border: 0; background: none; padding: 8px; border-radius: 7px; color: var(--muted); font-weight: 650; font-size: 14px; }
.seg button.on { background: var(--hover); color: var(--text); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label, .stack-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.auth-form input, .stack-form input, .stack-form textarea { background: #0f0e14; border: 1px solid #4a4459; border-radius: var(--r-sm); padding: 11px 12px; color: var(--text); font: inherit; font-size: 15px; }
.auth-form input:focus, .stack-form input:focus, .stack-form textarea:focus { border-color: var(--primary-soft); outline: none; }

.odds-sheet { width: min(520px, calc(100vw - 24px)); }
.odds-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.odds-row { padding: 8px 0; }
.odds-row .top { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 14px; margin-bottom: 7px; }
.odds-row .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--rc); }
.odds-row .pc { margin-left: auto; font-variant-numeric: tabular-nums; }
.bar { height: 7px; border-radius: 999px; background: #2b2836; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--rc); min-width: 4px; }
.odds-list { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; max-height: 38vh; overflow: auto; }
.odds-list .it { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; }
.odds-list .it .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rc); flex: none; }
.odds-list .it .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.odds-list .it .nm small { color: var(--muted); }
.odds-list .it .v { color: var(--green); font-weight: 700; font-variant-numeric: tabular-nums; }
.odds-list .it .p { width: 64px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.ev-badge { font-size: 12px; font-weight: 700; color: var(--primary-soft); background: rgba(122,85,238,.15); padding: 3px 8px; border-radius: 999px; margin-left: 8px; vertical-align: middle; }

/* reveal */
.reveal { width: min(420px, calc(100vw - 24px)); text-align: center; overflow: visible; }
.reveal .glow { position: relative; display: grid; place-items: center; padding: 18px 0 6px; isolation: isolate; }
.reveal .glow::before { content: ""; position: absolute; width: 270px; height: 270px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--rc) 55%, transparent), transparent 65%); animation: pulse 2.4s ease-in-out infinite; z-index: -1; }
@keyframes pulse { 50% { transform: scale(1.12); opacity: .7; } }
.reveal .card { width: 190px; flex: none; margin: 8px 0 18px; animation: drop .55s cubic-bezier(.2,1.4,.4,1); z-index: 1; text-align: left; }
@keyframes drop { from { transform: scale(.4) rotate(-10deg); opacity: 0; } }
.reveal h2 { font-size: 24px; font-weight: 800; margin-top: 8px; }
.reveal .sub { color: var(--muted); margin: 2px 0; }
.reveal .worth { font-size: 40px; font-weight: 850; font-variant-numeric: tabular-nums; color: var(--green); margin: 8px 0 0; line-height: 1.1; }
.reveal .delta { font-size: 14px; margin: 4px 0 18px; color: var(--muted); }
.reveal .delta.up { color: var(--green); }
.reveal .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.reveal .acts .wide { grid-column: 1 / -1; }
.reveal.rank-2 { border-color: color-mix(in srgb, var(--rc) 55%, #3c3449); }
.reveal.rank-3, .reveal.rank-4 { border-color: var(--rc); box-shadow: 0 0 70px -10px var(--rc); }
.reveal .rays { position: absolute; width: 520px; height: 520px; border-radius: 50%; z-index: -1;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--rc) 38%, transparent) 0 8deg, transparent 8deg 24deg);
  -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 65%); mask-image: radial-gradient(circle, #000 20%, transparent 65%);
  animation: spinRays 9s linear infinite; pointer-events: none; }
@keyframes spinRays { to { transform: rotate(360deg); } }
.reveal.rank-4 .rays { animation-duration: 5s; }
.reveal .stamp { position: absolute; top: 16px; left: 50%; transform: translateX(-50%) rotate(-4deg); z-index: 6; font-weight: 900; font-size: 14px; letter-spacing: .03em; color: #160d00; background: var(--rc); padding: 7px 14px; border-radius: 6px; white-space: nowrap; animation: stamp .5s .15s cubic-bezier(.2,1.8,.4,1) both; }
@keyframes stamp { from { transform: translateX(-50%) rotate(-4deg) scale(2.6); opacity: 0; } }
.reveal.rank-3 .card, .reveal.rank-4 .card { animation: dropBig .9s cubic-bezier(.2,1.3,.4,1); }
@keyframes dropBig { 0% { transform: scale(.2) rotateY(540deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; } }
.reveal.rank-4 .worth { color: var(--gold); text-shadow: 0 0 26px rgba(255,194,75,.5); }
.reveal.rank-3 .worth { color: var(--epic); }

/* feed */
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { text-decoration: none; color: var(--muted); font-weight: 650; padding: 8px 0 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--text); border-color: var(--primary); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: none; font-size: 13px; font-weight: 650; color: var(--muted); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rc); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.day { font-size: 12px; color: var(--faint); font-weight: 650; margin: 18px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.feed-list { display: flex; flex-direction: column; gap: 10px; }
.pull { display: flex; align-items: center; gap: 16px; padding: 12px 16px 12px 12px; border-radius: var(--r-lg); border: 1px solid var(--line);
  background: linear-gradient(90deg, color-mix(in srgb, var(--rc) 13%, #121119), #121119 60%); }
.pull .hit-art { width: 62px; height: 78px; }
.pull-main { flex: 1; min-width: 0; }
.pull-who { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.pull-who a { color: var(--text); text-decoration: none; font-weight: 650; }
.pull-who a:hover { text-decoration: underline; }
.pull-name { font-weight: 750; font-size: 17px; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pull-meta { font-size: 13px; color: var(--muted); }
.pull-right { text-align: right; flex: none; }
.pull-right .when { font-size: 12px; color: var(--faint); }
.pull-right .lbl { font-size: 11px; font-weight: 700; color: var(--muted); margin-top: 12px; }
.pull-right .val { font-size: 22px; font-weight: 800; color: var(--green); font-variant-numeric: tabular-nums; line-height: 1.1; }
.load-more { display: flex; justify-content: center; margin-top: 16px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .n { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.me td { background: rgba(122,85,238,.08); }
.table .rank { color: var(--faint); width: 44px; font-weight: 700; }
.table .rank.top { color: var(--gold); }
.user-cell { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 650; }
.user-cell:hover span { text-decoration: underline; }
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); overflow-x: auto; }
.green { color: var(--green); font-weight: 700; }
.lb-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.lb-grid .feed-list .pull-name { font-size: 15px; }

/* vault */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; min-width: 0; }
.stat span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.stat b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat b.g { color: var(--green); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .grow { margin-left: auto; }
.select { background: var(--raised); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 8px 10px; font: inherit; font-size: 14px; }
.vault-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.vault-item { position: relative; background: none; border: 0; padding: 0; border-radius: var(--r-md); text-align: left; }
.vault-item .card { width: 100%; transition: transform .12s ease; }
.vault-item[aria-pressed="true"] .card { box-shadow: 0 0 0 2px var(--primary); transform: translateY(-3px); }
.vault-item .check { position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; border-radius: 6px; border: 2px solid rgba(255,255,255,.5); background: rgba(15,15,19,.6); display: grid; place-items: center; font-size: 13px; z-index: 2; color: #fff; }
.vault-item[aria-pressed="true"] .check { background: var(--primary); border-color: var(--primary); }

/* rewards */
.rewards { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; }
.reward-card { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.reward-card h2 { font-size: 18px; font-weight: 750; }
.big-num { font-size: 44px; font-weight: 850; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.big-num.g { color: var(--green); }
.countdown { font-size: 15px; color: var(--muted); }
.rules { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rules div { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; }
.rules span { display: block; font-size: 12px; color: var(--muted); }
.rules b { font-size: 18px; }
.vip-card { position: relative; border-radius: var(--r-lg); padding: 22px; min-height: 190px; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(120% 80% at 100% 0, rgba(122,85,238,.45), transparent 60%), linear-gradient(140deg, #231d36, #121019); border: 1px solid #3a3150; }
.vip-card .pct { font-size: 46px; font-weight: 850; line-height: 1; }

/* profile */
.profile-head { display: flex; gap: 20px; align-items: center; padding: 22px; flex-wrap: wrap; }
.profile-head .who { flex: 1; min-width: 200px; }
.profile-head h2 { font-size: 28px; font-weight: 850; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.role-badge { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: rgba(122,85,238,.18); color: var(--primary-soft); }
.role-badge.owner { background: rgba(255,194,75,.15); color: var(--gold); }
.profile-head .bio { color: var(--muted); margin: 6px 0 0; max-width: 60ch; }
.rarity-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: #2b2836; margin: 6px 0 10px; }
.rarity-bar i { background: var(--rc); }
.rarity-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.rarity-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rarity-legend .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rc); }
.showcase { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.showcase .card { width: auto; }
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings .panel { padding: 20px; }
.settings h3 { font-size: 17px; margin-bottom: 14px; }
.stack-form { display: flex; flex-direction: column; gap: 12px; }
.stack-form textarea { resize: vertical; min-height: 70px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--sw); box-shadow: inset 0 0 0 2px rgba(255,255,255,.08); padding: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }

/* effects */
.fx-flash { position: fixed; inset: 0; z-index: 9999; pointer-events: none; background: radial-gradient(circle at 50% 45%, var(--rc), transparent 70%); animation: flashOut .9s ease-out forwards; mix-blend-mode: screen; }
@keyframes flashOut { from { opacity: .95; } to { opacity: 0; } }
.fx-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 10000; }
body.fx-shake .main, body.fx-shake dialog[open] { animation: shake .6s cubic-bezier(.36,.07,.19,.97); }
@keyframes shake { 10%, 90% { transform: translate(-2px, 1px); } 20%, 80% { transform: translate(4px, -2px); } 30%, 50%, 70% { transform: translate(-7px, 3px); } 40%, 60% { transform: translate(7px, -3px); } }
.toast { position: fixed; left: calc(50% + var(--sidebar-w) / 2); bottom: 24px; transform: translate(-50%, 20px); opacity: 0; background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 650; font-size: 14px; transition: .25s ease; pointer-events: none; z-index: 50; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body:has(.savebar) .toast { bottom: 84px; }

/* admin */
.admin-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.admin-tabs a { text-decoration: none; color: var(--muted); font-weight: 650; padding: 8px 0 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.admin-tabs a.on { color: var(--text); border-color: var(--primary); }
.admin-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-bar .form-note { max-width: 60ch; }
.admin-search { background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 9px 12px; color: var(--text); font: inherit; min-width: 240px; }
.admin-packs { display: flex; flex-direction: column; gap: 10px; }
.admin-pack { display: flex; align-items: center; gap: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px 16px 10px 12px; text-decoration: none; }
.admin-pack:hover { background: var(--raised); }
.mini-bag { width: 40px; flex: none; }
.ap-main { flex: 1; min-width: 0; }
.ap-main h3 { font-size: 17px; font-weight: 750; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ap-main p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.ap-edit { color: var(--muted); font-size: 14px; }
.status { font-weight: 700; font-size: 12px; padding: 3px 8px; border-radius: 999px; }
.status.live { background: rgba(52,213,139,.14); color: var(--green); }
.status.draft { background: var(--raised); color: var(--muted); }
.status.bad { background: rgba(255,92,122,.14); color: var(--danger); }
.back { display: inline-block; color: var(--muted); text-decoration: none; margin: 0 0 14px; font-size: 14px; }
.back:hover { color: var(--text); }
.editor { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: start; padding-bottom: 90px; }
.ed-side { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 16px; }
.ed-stats { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ed-stats div span { display: block; font-size: 12px; color: var(--muted); }
.ed-stats div b { font-size: 17px; font-weight: 750; font-variant-numeric: tabular-nums; }
.ed-stats .wide { grid-column: 1 / -1; }
.rcount { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px !important; font-weight: 650 !important; }
.rcount i { font-style: normal; color: var(--rc); }
.ed-problem { grid-column: 1 / -1; margin: 0; color: var(--danger); font-size: 14px; }
.ed-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.ed-form label, .ed-item label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); min-width: 0; font-weight: 600; }
.ed-form .wide { grid-column: span 3; }
.ed-form small { font-size: 12px; color: var(--faint); font-weight: 500; }
.ed-form input:not([type=checkbox]):not([type=color]), .ed-item input, .ed-item select, .users-table select, .bal-edit input {
  background: #0f0e14; border: 1px solid #4a4459; border-radius: var(--r-sm); padding: 9px 10px; color: var(--text); font: inherit; font-size: 14px; width: 100%; min-width: 0; }
.ed-form input:focus, .ed-item input:focus, .ed-item select:focus { border-color: var(--primary-soft); outline: none; }
.ed-form .check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.ed-form .check input { width: 18px; height: 18px; accent-color: var(--primary); }
.colors { display: flex; gap: 8px; }
.colors input { width: 48px; height: 38px; border: 1px solid #4a4459; border-radius: var(--r-sm); background: #0f0e14; padding: 3px; cursor: pointer; }
.ed-items { display: flex; flex-direction: column; gap: 8px; }
.ed-item { --cols: 64px 1fr 1.3fr 110px 120px 110px 80px 32px; display: grid; grid-template-columns: var(--cols); gap: 10px; align-items: end; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--rc); border-radius: var(--r-md); padding: 10px; }
.ed-item .w-col { display: none; }
.ed-items.manual .ed-item { --cols: 64px 1fr 1.3fr 100px 110px 100px 80px 80px 32px; }
.ed-items.manual .ed-item .w-col { display: flex; }
.ed-thumb { position: relative; align-self: center; }
.thumb-btn { width: 64px; height: 64px; border-radius: var(--r-sm); background: radial-gradient(circle, color-mix(in srgb, var(--rc) 35%, transparent), transparent 75%), #14121b; border: 1px dashed #4a4459; display: grid; place-items: center; padding: 4px; color: #e9e5f7; }
.thumb-btn svg { width: 38px; height: 38px; }
.thumb-btn img { max-width: 100%; max-height: 100%; object-fit: contain; }
.thumb-btn:hover { border-color: var(--primary-soft); }
.thumb-btn.loading { opacity: .4; }
.thumb-x { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--danger); color: #fff; font-size: 13px; line-height: 1; padding: 0; }
.ed-odds { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); padding-bottom: 9px; font-weight: 600; }
.ed-odds b { color: var(--text); font-variant-numeric: tabular-nums; font-size: 14px; }
.ed-del { border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1; padding: 6px; align-self: center; }
.ed-del:hover { color: var(--danger); }
.savebar { position: fixed; left: var(--sidebar-w); right: 0; bottom: 0; z-index: 25; display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 32px; background: rgba(15,15,19,.94); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
.savebar .form-note { margin-right: auto; }
.savebar .warn { color: var(--gold); }
.odds-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); overflow-x: auto; }
.odds { width: 100%; border-collapse: collapse; font-size: 14px; }
.odds th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.odds td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.odds .n { text-align: right; font-variant-numeric: tabular-nums; }
.users-table select { width: auto; }
.bal-edit { display: flex; gap: 6px; align-items: center; }
.bal-edit input { width: 120px; }


/* ranks */
.rank-badge { --rk: #8f8aa3; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 750; padding: 3px 9px 3px 7px; border-radius: 999px; color: var(--rk); background: color-mix(in srgb, var(--rk) 15%, transparent); vertical-align: middle; white-space: nowrap; letter-spacing: 0; }
.rank-badge::before { content: ""; width: 8px; height: 8px; transform: rotate(45deg); background: var(--rk); border-radius: 2px; }
.rank-panel { padding: 16px 18px; margin-bottom: 16px; }
.rank-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.rank-progress { height: 8px; border-radius: 999px; background: #2b2836; overflow: hidden; }
.rank-progress i { display: block; height: 100%; border-radius: inherit; background: var(--rk, var(--primary)); min-width: 6px; }
.vip-card { background: radial-gradient(120% 80% at 100% 0, color-mix(in srgb, var(--rk, #7a55ee) 40%, transparent), transparent 60%), linear-gradient(140deg, #231d36, #121019); gap: 14px; }
.vip-top { display: flex; align-items: center; justify-content: space-between; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--gold); color: #2a1d00; font-size: 12px; font-weight: 800; display: inline-grid; place-items: center; }

/* gifts */
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row-2 .btn:only-child { grid-column: 1 / -1; }
.mini-pack { width: 44px; flex: none; display: block; }
.mini-pack .pack { filter: none; }
.mini-pack .pack-brand, .mini-pack .pack-name, .mini-pack .pack-price { display: none; }
.gift-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; padding: 12px; border-radius: var(--r-md); background: var(--raised); }
.gifts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 26px; }
.gift-card { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--r-lg); text-decoration: none;
  background: linear-gradient(100deg, rgba(255,194,75,.12), #121119 60%); border: 1px solid rgba(255,194,75,.3); }
.gift-card:hover { border-color: var(--gold); }
.gift-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.gift-from { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.gift-msg { font-size: 13px; color: var(--text); font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gift-note { background: var(--raised); border: 1px solid rgba(255,194,75,.3); border-radius: var(--r-md); padding: 14px; }
.gift-note .gift-from { font-size: 15px; color: var(--text); }
.gift-note .gift-msg { white-space: normal; margin: 8px 0 0; }

/* chat */
.chat { position: fixed; right: 20px; bottom: 0; width: 360px; z-index: 40; background: #17151d; border: 1px solid var(--line-strong); border-bottom: 0; border-radius: 14px 14px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.4); display: flex; flex-direction: column; }
.chat-bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: none; border: 0; width: 100%; text-align: left; color: var(--text); }
.chat-bar svg { width: 18px; height: 18px; fill: var(--muted); flex: none; }
.chat-title { font-weight: 750; }
.online { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.online i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(52,213,139,.2); }
.unread { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 800; display: inline-grid; place-items: center; }
.chat-bar .chev { margin-left: auto; color: var(--muted); transition: transform .2s; }
.chat.open .chat-bar .chev { transform: rotate(180deg); }
.chat-body { display: none; flex-direction: column; height: min(480px, 60vh); border-top: 1px solid var(--line); }
.chat.open .chat-body { display: flex; }
.chat-list { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; scrollbar-width: thin; }
.chat-empty { color: var(--muted); font-size: 14px; text-align: center; margin: auto; }
.chat-msg { display: flex; gap: 10px; align-items: flex-start; }
.chat-main { flex: 1; min-width: 0; }
.chat-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chat-name { --rk: var(--text); font-weight: 700; font-size: 13px; text-decoration: none; color: color-mix(in srgb, var(--rk) 70%, #fff); }
.chat-name:hover { text-decoration: underline; }
.chat-rank { --rk: #8f8aa3; font-size: 10px; font-weight: 750; color: var(--rk); background: color-mix(in srgb, var(--rk) 14%, transparent); padding: 1px 6px; border-radius: 999px; }
.chat-tag { font-size: 10px; font-weight: 750; color: var(--primary-soft); background: rgba(122,85,238,.18); padding: 1px 6px; border-radius: 999px; }
.chat-tag.owner { color: var(--gold); background: rgba(255,194,75,.15); }
.chat-time { font-size: 11px; color: var(--faint); }
.chat-text { font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; color: #e2deef; }
.chat-text b { color: var(--text); }
.chat-text b.g { color: var(--green); }
.chat-tools { margin-left: auto; display: none; gap: 4px; }
.chat-msg:hover .chat-tools, .chat-msg:focus-within .chat-tools { display: inline-flex; }
.chat-tools button { background: var(--raised); border: 1px solid var(--line-strong); color: var(--muted); font-size: 11px; padding: 1px 6px; border-radius: 6px; }
.chat-tools button:hover { color: var(--danger); }
.chat-msg.pull { padding: 9px; border-radius: 12px; background: linear-gradient(90deg, color-mix(in srgb, var(--rc) 18%, #121119), #121119 75%); border: 1px solid color-mix(in srgb, var(--rc) 40%, var(--line)); }
.chat-msg.pull .rarity-pill { margin-top: 5px; font-size: 11px; padding: 1px 7px; }
.chat-pull-art { width: 40px; height: 48px; flex: none; border-radius: 6px; display: grid; place-items: center; padding: 4px; background: radial-gradient(circle, color-mix(in srgb, var(--rc) 45%, transparent), transparent 75%), #1a1823; }
.chat-pull-art svg { width: 28px; height: 28px; color: #e9e5f7; }
.chat-pull-art img { max-width: 100%; max-height: 100%; object-fit: contain; }
.chat-foot { padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; min-width: 0; background: #0f0e14; border: 1px solid #4a4459; border-radius: var(--r-sm); padding: 10px 12px; color: var(--text); font: inherit; font-size: 14px; }
.chat-form input:focus { border-color: var(--primary-soft); outline: none; }
main { padding-bottom: 90px; }
body:has(.savebar) .chat { display: none; }
@media (min-width: 861px) {
  .chat.open { top: 0; bottom: 0; right: 0; width: 340px; border-radius: 0; border: 0; border-left: 1px solid var(--line); box-shadow: none; }
  .chat.open .chat-body { height: auto; flex: 1; min-height: 0; }
  body.chat-docked .main { margin-right: 340px; }
  body.chat-docked .savebar { right: 340px; }
  .chat:not(.open) { width: auto; min-width: 260px; border-radius: 14px 14px 0 0; }
}

.tier-locked .tier-btn { pointer-events: none; }
.tier-locked .chev { display: none; }

/* quantity + multi open */
.store-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qty { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--raised); }
.qty button { width: 34px; height: 36px; border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; }
.qty button:hover { color: var(--text); }
.qty span { min-width: 64px; text-align: center; font-weight: 650; font-size: 14px; font-variant-numeric: tabular-nums; }
.stage:has(.multi) { place-items: stretch; }
.stage:has(.multi) .stage-arrow, .stage:has(.multi) .stage-name, .stage:has(.multi) .stage-pack { display: none; }
.multi { position: relative; z-index: 3; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding: 56px 18px 18px; align-content: center; perspective: 1200px; }
.flip-back, .flip-front { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: var(--r-md); }
.flip-back { display: grid; place-items: center; background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,.25) 38%, transparent 52%), linear-gradient(160deg, var(--b), var(--a) 80%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.flip-front { transform: rotateY(180deg); }
@keyframes tease { 0%, 100% { transform: none; } 20%, 60% { transform: translateY(-6px) rotate(-3deg) scale(1.04); } 40%, 80% { transform: translateY(-6px) rotate(3deg) scale(1.04); } }
.flip.flipped.r-rare .card, .flip.flipped.r-epic .card, .flip.flipped.r-grail .card { box-shadow: 0 0 26px 2px var(--rc); }
.multi-reveal { width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow-y: auto; }
.multi-reveal h2 { font-size: 22px; margin: 4px 0 14px; }
.multi-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.multi-stats div { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; text-align: left; }
.multi-stats span { display: block; font-size: 12px; color: var(--muted); }
.multi-stats b { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.multi-stats b.g { color: var(--green); }
.multi-stats b.best { color: var(--rc); }
.multi-reveal .delta { margin: 10px 0 14px; }
.multi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; text-align: left; }
.multi-reveal .multi-grid .card { width: 100%; animation: none; margin: 0; }
.multi-grid .card-art { padding: 10px; }
.multi-grid .vault-item.sold .card { opacity: .35; }
.multi-grid .vault-item:disabled { cursor: default; }
.sold-tag { position: absolute; top: 8px; left: 8px; z-index: 2; font-size: 11px; font-weight: 750; padding: 2px 8px; border-radius: 999px; background: var(--text); color: var(--bg); }

.follow-counts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.follow-counts button { background: none; border: 0; padding: 0; color: var(--muted); font-size: 14px; }
.follow-counts button:hover { color: var(--text); }
.follow-counts b { color: var(--text); }
.follow-counts span { color: var(--faint); font-size: 13px; }
#followBtn { min-width: 110px; }
.follow-list { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow-y: auto; }
.follow-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.follow-row:last-child { border-bottom: 0; }
.follow-row .btn { margin-left: auto; min-width: 92px; }

/* ===================== polish ===================== */
body { background: radial-gradient(1100px 520px at 62% -12%, rgba(122,85,238,.13), transparent 62%), radial-gradient(900px 500px at 110% 40%, rgba(255,92,168,.05), transparent 60%), var(--bg); background-attachment: fixed; }
.pagebar { background: linear-gradient(rgba(15,15,19,.92), rgba(15,15,19,.78)); }
.panel { background: linear-gradient(180deg, rgba(255,255,255,.028), transparent 140px), var(--panel); box-shadow: inset 0 1px 0 rgba(255,255,255,.045); }
.side-nav a, .side-more a { position: relative; transition: background .15s, color .15s; }
.side-nav a.on::before, .side-more a.on::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary-soft); box-shadow: 0 0 12px var(--primary); }

/* buttons */
.btn { transition: background .15s, transform .12s, box-shadow .2s, border-color .15s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn-primary, .btn-tag { background: linear-gradient(180deg, #8a66f6, #7148ea); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 8px 22px -12px rgba(122,85,238,.9); }
.btn-primary:hover:not(:disabled), .btn-tag:hover:not(:disabled) { background: linear-gradient(180deg, #9474f8, #7650ef); box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 10px 30px -10px rgba(122,85,238,1); }
.btn-gold { background: linear-gradient(180deg, #ffd06e, #f7b532); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 8px 22px -12px rgba(255,194,75,.9); }
#openBtn:not(:disabled) { position: relative; overflow: hidden; }
#openBtn:not(:disabled)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.28) 50%, transparent 65%); transform: translateX(-120%); animation: btnSheen 4.5s ease-in-out infinite 1.5s; }
@keyframes btnSheen { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
kbd { font: 700 10px/1 var(--font); padding: 3px 5px; border-radius: 4px; background: rgba(255,255,255,.18); margin-left: 4px; }

/* pack on the stage: float, tilt, shine */
.stage::before { content: ""; position: absolute; left: 50%; top: 50%; width: 420px; height: 420px; margin: -210px 0 0 -210px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--pb, #7a55ee) 30%, transparent), transparent 65%); animation: breathe 6s ease-in-out infinite; pointer-events: none; }
@keyframes breathe { 50% { transform: scale(1.12); opacity: .7; } }
.stage-pack { position: relative; transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .25s ease-out; transform-style: preserve-3d; }
.stage-pack:hover { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1.03); }
.stage-pack .pack { animation: float 5.5s ease-in-out infinite; }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
.pack-shine { position: absolute; inset: 0; z-index: 1; pointer-events: none; mix-blend-mode: overlay;
  background: radial-gradient(circle at var(--mx, 30%) var(--my, 20%), rgba(255,255,255,.55), transparent 45%),
              linear-gradient(calc(110deg + var(--ry, 0deg) * 3), transparent 30%, rgba(255,255,255,.25) 45%, rgba(170,140,255,.18) 52%, transparent 65%); }
.pack-foil > :not(.pack-shine) { position: relative; z-index: 2; }

/* tearing the pack open */
.stage-pack.tearing .pack { animation: packShake .7s ease-in-out, packBurst .6s .65s cubic-bezier(.4,0,.6,1) forwards; }
.stage-pack.tearing::after { content: ""; position: absolute; left: -10%; right: -10%; top: 3%; height: 6px; border-radius: 6px; background: #fff; box-shadow: 0 0 24px 8px rgba(255,255,255,.8), 0 0 60px 20px color-mix(in srgb, var(--pb, #7a55ee) 60%, transparent); opacity: 0; animation: tearLine .75s .45s ease-out forwards; z-index: 3; }
@keyframes packShake { 0%, 100% { rotate: 0deg; } 20% { rotate: -4deg; } 40% { rotate: 4deg; } 60% { rotate: -3deg; } 80% { rotate: 2deg; } }
@keyframes packBurst { to { scale: 1.18; opacity: 0; filter: blur(6px) brightness(2.2); } }
@keyframes tearLine { 0% { opacity: 0; scale: .2 1; } 40% { opacity: 1; scale: 1 1; } 100% { opacity: 0; scale: 1.2 4; } }
.stage-pack.returning .pack { animation: packReturn .55s cubic-bezier(.2,1.3,.4,1); }
@keyframes packReturn { from { scale: .7; opacity: 0; } }
.reel { animation: fadeIn .3s ease-out; }
@keyframes fadeIn { from { opacity: 0; } }

/* cards: lift on hover, shimmer on epic and grail */
.contents .card, .showcase .card, .vault-item .card { transition: transform .18s ease, border-color .18s, box-shadow .2s; }
.contents .card:hover, .showcase .card:hover, .vault-item:hover .card { transform: translateY(-4px); border-color: color-mix(in srgb, var(--rc) 60%, var(--line)); box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--rc) 70%, transparent); }
.card.r-epic::after, .card.r-grail::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.16) 45%, color-mix(in srgb, var(--rc) 30%, transparent) 52%, transparent 66%); background-size: 250% 100%; animation: holo 4s ease-in-out infinite; mix-blend-mode: screen; }
@keyframes holo { 0% { background-position: 120% 0; } 60%, 100% { background-position: -120% 0; } }
.hit { transition: background .15s, transform .18s; }
.hit:hover { transform: translateY(-2px); }

/* odds bars grow in */
.bar i { animation: grow .7s cubic-bezier(.2,.8,.2,1); transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } }

/* dialogs pop in */
dialog[open] { animation: pop .28s cubic-bezier(.2,1.2,.4,1); }
dialog[open]::backdrop { animation: fadeIn .25s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.96); } }

/* loading skeletons */
.skel { pointer-events: none; }
.sk { display: block; border-radius: 6px; background: linear-gradient(90deg, #1d1b26 0%, #2a2735 50%, #1d1b26 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; height: 12px; margin: 6px 0; }
.sk.tall { height: 22px; }
.sk.w30 { width: 30%; } .sk.w40 { width: 40%; } .sk.w60 { width: 60%; } .sk.w90 { width: 90%; }
.hit.skel .hit-body { flex: 1; } .hit-art.sk, .pull .hit-art.sk { margin: 0; box-shadow: none; }
.pull.skel .pull-main { flex: 1; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* click-to-reveal multi open */
.multi { display: flex; flex-direction: column; gap: 14px; padding: 20px 20px 22px; }
.multi-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 0 2px 2px 0; margin-right: 110px; min-height: 36px; }
.mb-count { font-size: 14px; color: var(--muted); }
.mb-count b, .mb-sum b { color: var(--text); font-variant-numeric: tabular-nums; }
.mb-sum { font-size: 14px; color: var(--muted); }
.mb-sum b { color: var(--green); font-size: 16px; }
.mb-sum small { color: var(--faint); }
.multi-bar .btn { margin-left: auto; }
.multi-grid-stage { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; perspective: 1400px; }
.flip { aspect-ratio: 150 / 222; padding: 0; border: 0; background: none; cursor: pointer; animation: dealIn .6s cubic-bezier(.2,1.2,.4,1) both; animation-delay: var(--d, 0ms); border-radius: var(--r-md); }
.flip:disabled { cursor: default; }
@keyframes dealIn { from { opacity: 0; transform: translateY(30px) rotate(-6deg) scale(.9); } }
.flip-in { display: block; position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .85s cubic-bezier(.3,1.3,.5,1); }
.flip:not(.flipped):hover .flip-in { transform: translateY(-6px) rotateX(6deg); }
.flip:not(.flipped):hover .flip-back { box-shadow: inset 0 0 0 1px rgba(255,255,255,.35), 0 16px 30px -12px color-mix(in srgb, var(--b) 80%, transparent); }
.flip.flipped .flip-in { transform: rotateY(180deg); }
.flip-back { flex-direction: column; gap: 10px; }
.flip-back .fb-mark { width: 44%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.14); box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.flip-back .fb-mark svg { width: 62%; height: 62%; }
.fb-hint { font-size: 12px; font-weight: 700; color: rgba(255,255,255,.75); }
.flip-back { display: flex; align-items: center; justify-content: center; }
.flip-front { display: block; text-align: left; }
.flip-front .card { width: 100%; height: 100%; }
.flip-front .card-art { padding: 10px; flex: 1; aspect-ratio: auto; min-height: 0; }
.flip.tease .flip-in { animation: teaseBig 1.4s ease-in-out; }
@keyframes teaseBig { 0%, 100% { transform: none; } 15%, 45%, 75% { transform: translateY(-8px) rotate(-4deg) scale(1.06); } 30%, 60%, 90% { transform: translateY(-8px) rotate(4deg) scale(1.06); } }
.flip.tease .flip-back { box-shadow: 0 0 0 2px #fff, 0 0 40px 10px rgba(255,255,255,.45); }
.flip.flipped.r-rare .flip-front .card, .flip.flipped.r-epic .flip-front .card, .flip.flipped.r-grail .flip-front .card { box-shadow: 0 0 28px 2px var(--rc); }
.stage:has(.multi) { overflow: visible; }



/* ===================== battles ===================== */
.battles-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.battles-head .tabs { flex: 1; margin-bottom: 0; }
.battles-head .btn svg { width: 16px; height: 16px; fill: currentColor; }
.battles-explain { margin: 12px 0 18px; }
.battle-list { display: flex; flex-direction: column; gap: 10px; }
.battle-row { display: grid; grid-template-columns: minmax(0, 1.6fr) 110px minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 14px 16px; border-radius: var(--r-lg); text-decoration: none;
  background: linear-gradient(180deg, rgba(255,255,255,.025), transparent), var(--panel); border: 1px solid var(--line); transition: border-color .15s, transform .15s, background .15s; }
.battle-row:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.battle-row.done { opacity: .9; }
.battle-row.skel { display: block; height: 76px; }
.br-packs { display: flex; align-items: center; gap: 14px; min-width: 0; }
.pack-strip { display: inline-flex; align-items: center; }
.pack-strip .mini-pack { width: 30px; margin-right: -9px; filter: drop-shadow(2px 0 4px rgba(0,0,0,.5)); }
.pack-strip .more { margin-left: 14px; font-size: 12px; font-weight: 700; color: var(--muted); }
.br-meta { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-left: 10px; }
.br-meta b { color: var(--text); }
.lock { font-size: 11px; font-weight: 700; color: var(--gold); background: rgba(255,194,75,.12); padding: 2px 7px; border-radius: 999px; }
.br-cost span { display: block; font-size: 11px; color: var(--muted); }
.br-cost b { font-size: 17px; font-variant-numeric: tabular-nums; }
.br-seats { display: flex; align-items: center; gap: 10px; }
.seats { display: inline-flex; gap: 4px; }
.seat.open-seat { width: 30px; height: 30px; border-radius: 50%; border: 2px dashed var(--line-strong); display: inline-block; flex: none; }
.seat.open-seat.big { width: 56px; height: 56px; }
.avatar.bot { --av: #3a3748; color: var(--muted); }
.br-count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.br-right { display: flex; align-items: center; gap: 12px; justify-content: flex-end; }
.br-status, .br-result { font-size: 13px; color: var(--muted); white-space: nowrap; }
.br-result b { color: var(--green); }
.invited { font-size: 12px; font-weight: 700; color: var(--primary-soft); background: rgba(122,85,238,.15); padding: 3px 9px; border-radius: 999px; }

/* create */
.create-battle { width: min(560px, calc(100vw - 24px)); }
.create-battle .field-label .count { float: right; color: var(--muted); }
.cb-packs { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; }
.cb-pack { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--raised); }
.cb-pack.on { border-color: color-mix(in srgb, var(--primary) 60%, var(--line)); background: color-mix(in srgb, var(--primary) 8%, var(--raised)); }
.cb-pack .mini-pack { width: 32px; }
.cb-name { flex: 1; display: flex; flex-direction: column; }
.cb-name small { color: var(--muted); }
.cb-pack .qty button:disabled { opacity: .3; cursor: default; }
.cb-pack .qty span { min-width: 32px; }
.cb-order { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.cb-order .field-label { margin: 0; }
.cb-mode { margin-bottom: 12px; }
.cb-priv { border-radius: var(--r-md); padding: 10px 12px; width: 100%; background: var(--raised); color: var(--text); }
.cb-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 12px; }
.cb-sum div { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; }
.cb-sum span { display: block; font-size: 12px; color: var(--muted); }
.cb-sum b { font-size: 18px; }

/* battle page */
.battle-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; flex-wrap: wrap; }
.battle-top.skel { display: block; }
.bt-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.bt-title h2 { font-size: 22px; font-weight: 800; }
.bt-status { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--raised); color: var(--muted); }
.bt-status.waiting { color: var(--uncommon); background: rgba(57,180,255,.12); }
.bt-status.done { color: var(--text); }
.bt-status.won { color: var(--gold); background: rgba(255,194,75,.12); }
.bt-rounds { display: flex; gap: 8px; flex-wrap: wrap; }
.bt-round { position: relative; width: 36px; transition: transform .25s, opacity .25s; }
.bt-round small { position: absolute; bottom: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--raised); border: 1px solid var(--line-strong); font-size: 10px; font-weight: 800; display: grid; place-items: center; }
.bt-round.done { opacity: .35; }
.bt-round.now { transform: translateY(-4px) scale(1.15); }
.bt-round.now small { background: var(--primary); border-color: var(--primary); }
.bt-right { display: flex; gap: 12px; }
.bt-stat { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 14px; min-width: 130px; }
.bt-stat span { display: block; font-size: 12px; color: var(--muted); }
.bt-stat b { font-size: 20px; font-variant-numeric: tabular-nums; }
.bt-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 16px 0 0; }
.bt-invite { display: flex; gap: 8px; }
.bt-invite input { background: #0f0e14; border: 1px solid #4a4459; border-radius: var(--r-sm); padding: 9px 12px; color: var(--text); font: inherit; font-size: 14px; width: 200px; }
.bt-invite input:focus { border-color: var(--primary-soft); outline: none; }
.bt-grid { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.bt-col { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: var(--r-lg); background: linear-gradient(180deg, rgba(255,255,255,.03), transparent 120px), var(--panel); border: 1px solid var(--line); transition: border-color .3s, box-shadow .4s, opacity .4s, transform .3s; }
.bt-col.me { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); }
.bt-col.leading { border-color: color-mix(in srgb, var(--green) 55%, var(--line)); box-shadow: 0 0 30px -14px var(--green); }
.bt-col.flash { animation: colFlash .9s ease-out; }
@keyframes colFlash { 30% { box-shadow: 0 0 50px -6px var(--epic); } }
.bt-col.winner { border-color: var(--gold); box-shadow: 0 0 60px -16px var(--gold); transform: translateY(-4px); }
.bt-col.loser { opacity: .55; }
.bt-col.open-col { justify-content: center; min-height: 380px; border-style: dashed; background: transparent; }
.bt-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); text-align: center; }
.bt-empty b { color: var(--text); }
.bt-empty .seat { animation: seatPulse 1.8s ease-in-out infinite; }
@keyframes seatPulse { 50% { border-color: var(--primary-soft); transform: scale(1.06); } }
.bt-player { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bt-pname { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bt-pname a { text-decoration: none; }
.bt-pname b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.bt-pname small { font-size: 12px; color: var(--muted); }
.crown { margin-left: auto; font-size: 24px; color: var(--gold); opacity: 0; transform: scale(.3) rotate(-20deg); transition: .5s cubic-bezier(.2,1.6,.4,1); text-shadow: 0 0 16px rgba(255,194,75,.7); }
.bt-col.winner .crown { opacity: 1; transform: none; }
.bt-total { display: flex; align-items: baseline; justify-content: space-between; padding: 8px 12px; border-radius: var(--r-md); background: var(--raised); }
.bt-total span { font-size: 12px; color: var(--muted); }
.bt-total b { font-size: 20px; color: var(--green); font-variant-numeric: tabular-nums; }
.bt-col.winner .bt-total b { color: var(--gold); }
.bt-slot { position: relative; height: 250px; border-radius: var(--r-md); background: #121019; border: 1px solid var(--line); overflow: hidden; display: grid; place-items: center; }
.bt-slot-idle { color: var(--faint); font-size: 13px; }
.bt-count { font-size: 64px; font-weight: 900; color: var(--text); animation: countPop 1s ease-out infinite; }
@keyframes countPop { 0% { transform: scale(1.4); opacity: 0; } 30% { transform: scale(1); opacity: 1; } 100% { opacity: .3; } }
.bt-reel { position: absolute; inset: 0; -webkit-mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent); }
.bt-track { position: absolute; left: 50%; top: 0; width: 150px; margin-left: -75px; display: flex; flex-direction: column; gap: 10px; will-change: transform; }
.bt-track .card { width: 150px; }
.bt-needle { position: absolute; left: 6px; right: 6px; top: 50%; height: 2px; margin-top: -1px; background: rgba(255,255,255,.7); box-shadow: 0 0 10px rgba(255,255,255,.6); }
.bt-landed .card { width: 150px; }
.bt-landed.pop { animation: landPop .5s cubic-bezier(.2,1.6,.4,1); }
@keyframes landPop { from { transform: scale(.7); opacity: .3; } }
.bt-final { text-align: center; }
.bt-final span { display: block; font-size: 13px; color: var(--muted); font-weight: 700; }
.bt-final b { font-size: 30px; font-weight: 850; color: var(--green); font-variant-numeric: tabular-nums; }
.bt-col.winner .bt-final b { color: var(--gold); text-shadow: 0 0 24px rgba(255,194,75,.5); }
.bt-col.winner .bt-final span { color: var(--gold); }
.bt-pulls { display: flex; flex-direction: column; gap: 6px; }
.bt-mini { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; background: var(--raised); font-size: 13px; border-left: 3px solid var(--rc); }
.bt-mini.pop { animation: slideIn .4s ease-out; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } }
.bt-mini .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--rc); flex: none; }
.bt-mini .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-mini b { color: var(--green); font-variant-numeric: tabular-nums; }
.bt-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; }

/* large screens */
@media (min-width: 1500px) {
  :root { --sidebar-w: 256px; }
  body { font-size: 16px; }
  .pagebar { padding: 22px 40px; }
  .pagebar h1 { font-size: 30px; }
  main { padding: 4px 40px 64px; }
  .foot { padding: 22px 40px 30px; }
  .side-nav a, .side-more a { padding: 12px 14px; font-size: 16px; }
  .logo span { font-size: 22px; }
  .shop { grid-template-columns: 1fr 400px; gap: 20px; }
  .stage { min-height: 470px; }
  .stage-pack { width: 260px; }
  .store { padding: 24px; gap: 18px; }
  .store h2 { font-size: 26px; }
  .contents, .showcase, .vault-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
  .card-name { font-size: 14px; }
  .card-val { font-size: 16px; }
  .reel-track .card { flex-basis: 175px; width: 175px; }
  .reel-track { margin-top: -132px; }
  .hits { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); column-gap: 14px; }
  .hit-art { width: 72px; height: 90px; }
  .hit-val { font-size: 23px; }
  .hit-name { font-size: 15px; }
  .section-head h2 { font-size: 24px; }
  .stats { gap: 14px; }
  .stat b { font-size: 24px; }
  .multi { gap: 16px; padding: 60px 28px 24px; }
  .chat.open { width: 380px; }
  body.chat-docked .main { margin-right: 380px; }
  body.chat-docked .savebar { right: 380px; }
}
@media (min-width: 2100px) {
  body { font-size: 17px; }
  .shop { grid-template-columns: 1fr 440px; }
  .stage { min-height: 540px; }
  .stage-pack { width: 300px; }
  .contents, .showcase, .vault-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .reel-track .card { flex-basis: 195px; width: 195px; }
  .reel-track { margin-top: -146px; }
  .hits { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}
/* responsive */
@media (max-width: 1100px) {
  .shop { grid-template-columns: 1fr 300px; }
  .lb-grid { grid-template-columns: 1fr; }
  .ed-item, .ed-items.manual .ed-item { grid-template-columns: 64px 1fr 1fr; }
  .ed-item .ed-thumb { grid-row: span 2; }
  .ed-item { position: relative; padding-right: 36px; }
  .ed-del { position: absolute; top: 4px; right: 6px; }
}
@media (max-width: 860px) {
  :root { --sidebar-w: 0px; }
  .sidebar { inset: auto 0 0 0; width: auto; height: calc(64px + env(safe-area-inset-bottom)); flex-direction: row; padding: 0 6px env(safe-area-inset-bottom); border-right: 0; border-top: 1px solid var(--line); }
  .logo, .side-label, .volume { display: none; }
  .side-nav { flex-direction: row; flex: 1; gap: 0; }
  .side-more { flex-direction: row; margin: 0; padding: 0; border: 0; }
  .side-nav a, .side-more a { flex: 1; flex-direction: column; gap: 3px; padding: 8px 2px; font-size: 11px; border-radius: 10px; justify-content: center; }
  .side-more a { flex: none; width: 60px; }
  .main { margin-left: 0; padding-bottom: 64px; }
  .side-nav a.on::before, .side-more a.on::before { display: none; }
  .pagebar { padding: 12px 16px; }
  .pagebar h1 { font-size: 22px; }
  main { padding: 4px 16px 40px; }
  .foot { padding: 16px; }
  .shop { grid-template-columns: 1fr; }
  .stage { min-height: 320px; }
  .rewards, .settings { grid-template-columns: 1fr; }
  .editor { grid-template-columns: 1fr; }
  .ed-side { position: static; flex-direction: row; align-items: start; }
  .ed-bag { width: 110px; flex: none; }
  .ed-stats { flex: 1; }
  .ed-form { grid-template-columns: 1fr 1fr; }
  .ed-form .wide { grid-column: span 2; }
  .savebar { left: 0; bottom: 64px; padding: 10px 16px; }
  .toast { bottom: 130px; }
  .chat { right: 10px; left: auto; bottom: 74px; width: auto; border-radius: 14px; border-bottom: 1px solid var(--line-strong); }
  .chat:not(.open) .chat-title, .chat:not(.open) .chev { display: none; }
  .chat.open { left: 10px; }
  .chat.open .chat-body { height: calc(100vh - 220px); }
  body:has(.savebar) .toast { bottom: 140px; }
}
@media (max-width: 900px) {
  .battle-row { grid-template-columns: 1fr auto; gap: 10px 14px; }
  .br-packs { grid-column: 1 / -1; }
  .br-cost { display: none; }
  .bt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bt-slot { height: 210px; }
  .bt-track, .bt-track .card, .bt-landed .card { width: 128px; }
  .bt-track { margin-left: -64px; }
}
@media (max-width: 560px) {
  .bt-final b { font-size: 19px; }
  .bt-slot { height: 180px; }
  .bt-track, .bt-track .card, .bt-landed .card { width: 112px; }
  .bt-track { margin-left: -56px; }
  .bt-landed .card .card-body { padding: 6px 7px; }
  .bt-right { width: 100%; }
  .bt-stat { flex: 1; min-width: 0; }
  .bt-invite { width: 100%; }
  .bt-invite input { flex: 1; width: auto; }
  .bt-col { padding: 10px; }
  .bt-total b { font-size: 16px; }
  .multi { padding: 14px 10px 14px; }
  .multi-grid-stage { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .multi-bar { margin-right: 0; padding-top: 34px; }
  .multi-bar .btn { margin-left: 0; width: 100%; }
  .multi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .multi-stats b { font-size: 16px; }
  .flip-front .card-body { padding: 6px 7px 7px; }
  .flip-front .card-name { font-size: 11px; }
  .flip-front .card-val { font-size: 12px; }
  .balance { height: 36px; padding: 0 10px; font-size: 15px; }
  .account .btn { padding: 8px 11px; }
  .account .btn-gold { display: none; }
  .card, .reel-track .card { flex-basis: 128px; width: 128px; }
  .reel-track { margin-top: -100px; }
  .contents, .vault-grid, .showcase { grid-template-columns: repeat(2, 1fr); }
  .hits { grid-template-columns: none; grid-template-rows: none; grid-auto-flow: column; grid-auto-columns: 82%; grid-auto-rows: auto; overflow-x: auto; scrollbar-width: none; }
  .hits::-webkit-scrollbar { display: none; }
  .pull { gap: 12px; padding: 10px; }
  .pull-name { font-size: 15px; }
  .pull-right .val { font-size: 18px; }
  .ed-item, .ed-items.manual .ed-item { grid-template-columns: 1fr 1fr; }
  .ed-item .ed-thumb { grid-column: 1 / -1; grid-row: auto; }
  .ed-form { grid-template-columns: 1fr; }
  .ed-form .wide { grid-column: auto; }
  .rules { grid-template-columns: 1fr; }
  .stage-name { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (hover: none) { kbd { display: none; } }
