:root {
  --bg: #05060a;
  --panel: rgba(13, 15, 23, 0.72);
  --panel-2: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #eef0f6;
  --muted: #8b93a7;
  --accent: #7c8cff;
  --good: #34d399;
  --bad: #ff5c7a;
  --gold: #ffc93c;
  --radius: 18px;
  --display: 'Sora', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; background: var(--bg); color: var(--text); font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; overflow: hidden; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.fine { font-size: 12px; color: var(--muted); margin-top: 12px; }
.center { text-align: center; }
.eyebrow { font: 600 11px/1 var(--body); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }

#stage { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
.vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,.65) 100%); }

/* ---------- coin glyph */
.coin { display: inline-block; width: .85em; height: .85em; border-radius: 50%; margin-right: .35em; vertical-align: -.08em;
  background: radial-gradient(circle at 35% 30%, #fff3c4 0 15%, #ffc93c 40%, #b07800 100%); box-shadow: 0 0 10px rgba(255, 201, 60, .45), inset 0 0 0 1.5px rgba(255,255,255,.25); }

/* ---------- loader */
#loader { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; gap: 28px; justify-items: center; background: var(--bg); transition: opacity .8s ease, visibility .8s; }
#loader img { width: 140px; animation: breathe 2s ease-in-out infinite; }
#loader .bar { width: 180px; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
#loader .bar i { display: block; height: 100%; width: 10%; background: linear-gradient(90deg, var(--accent), #fff); transition: width .4s ease; }
#loader.done { opacity: 0; visibility: hidden; }
@keyframes breathe { 50% { opacity: .55; transform: scale(.97); } }

/* ---------- glass panel */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%); box-shadow: 0 20px 60px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.05); }

/* ---------- buttons */
.cta { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 12px; height: 54px; padding: 0 30px; border-radius: 14px; font: 700 15px var(--display); letter-spacing: .02em; text-decoration: none;
  color: #07080c; background: linear-gradient(180deg, #ffffff, #cfd5ff); box-shadow: 0 10px 40px rgba(124, 140, 255, .35), inset 0 -2px 0 rgba(0,0,0,.12); transition: transform .2s, box-shadow .2s, filter .2s; overflow: hidden; }
.cta::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.75) 50%, transparent 70%); transform: translateX(-120%); transition: transform .8s; }
.cta:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 16px 50px rgba(124, 140, 255, .5); }
.cta:hover:not(:disabled)::after { transform: translateX(120%); }
.cta:active:not(:disabled) { transform: translateY(0) scale(.98); }
.cta:disabled { filter: grayscale(1) brightness(.6); cursor: not-allowed; }
.cta span { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 8px; background: rgba(0,0,0,.1); font: 700 13px var(--mono); }
.cta.small { height: 42px; padding: 0 20px; font-size: 14px; border-radius: 12px; }
.ghost { height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel-2); font-weight: 600; font-size: 14px; transition: background .2s, border-color .2s; display: inline-flex; align-items: center; gap: 4px; }
.ghost:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.25); }
.ghost.warn { border-color: var(--bad); color: #ffd0d9; background: rgba(255, 92, 122, .12); }
.pill { height: 38px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.04); font-size: 13px; font-weight: 600; white-space: nowrap; }
.icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--muted); }
.icon:hover { color: var(--text); }
#mute .x { display: none; } #mute.off .x { display: block; } #mute.off .w { display: none; }

/* ---------- login / hero */
#login { position: fixed; inset: 0; z-index: 5; display: grid; place-items: center; padding: 24px; opacity: 0; transition: opacity .6s; }
#login.in { opacity: 1; }
.hero { text-align: center; max-width: 520px; display: grid; justify-items: center; }
.hero-logo { width: min(220px, 50vw); filter: drop-shadow(0 0 40px rgba(124,140,255,.35)); animation: rise 1.2s cubic-bezier(.2,.8,.2,1) both; }
.hero h1 { font: 800 clamp(48px, 9vw, 96px)/1 var(--display); letter-spacing: .32em; margin: 18px 0 0 .32em; background: linear-gradient(180deg, #fff 30%, #9aa4c7); -webkit-background-clip: text; background-clip: text; color: transparent; animation: rise 1.2s .1s cubic-bezier(.2,.8,.2,1) both; }
.tag { font-size: 17px; color: var(--muted); margin-top: 14px; animation: rise 1.2s .2s both; }
.tag span { color: var(--text); }
#login form { display: flex; gap: 10px; margin-top: 34px; width: 100%; animation: rise 1.2s .3s both; }
#login input { flex: 1; min-width: 0; height: 54px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(10,12,20,.7); backdrop-filter: blur(12px); font-size: 16px; outline: none; transition: border-color .2s, box-shadow .2s; }
#login input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(124,140,255,.18); }
#login .err { color: var(--bad); min-height: 22px; margin-top: 10px; font-size: 14px; }
.rules { list-style: none; padding: 0; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 18px; animation: rise 1.2s .45s both; }
.rules li { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(10,12,20,.5); font-size: 13px; color: var(--muted); backdrop-filter: blur(10px); }
.rules b { color: var(--text); font-family: var(--mono); margin-right: 4px; }
.hero-links { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 12px; animation: rise 1.2s .55s both; }
.hero-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(10,12,20,.65); color: var(--muted); font-size: 13px; text-decoration: none; backdrop-filter: blur(10px); transition: border-color .2s, background .2s, color .2s, transform .15s; cursor: pointer; }
.hero-pill:hover { border-color: rgba(255,255,255,.32); background: rgba(255,255,255,.08); color: var(--text); transform: translateY(-1px); }
.hero-pill b { color: var(--text); font-family: var(--mono); font-size: 12px; letter-spacing: .04em; }
.ca-val { font-family: var(--mono); font-size: 12px; color: var(--text); opacity: .9; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); filter: blur(6px); } }
@media (max-width: 520px) { #login form { flex-direction: column; } #login input { flex: none; } }

/* ---------- app shell */
#app { position: fixed; inset: 0; z-index: 2; display: grid; grid-template-rows: auto 1fr auto; pointer-events: none; opacity: 0; transition: opacity .6s; }
#app.in { opacity: 1; }
#app > * { pointer-events: auto; }
#app > main { pointer-events: none; }
.topbar { display: flex; align-items: center; gap: 24px; padding: 14px 24px; background: linear-gradient(180deg, rgba(5,6,10,.85), rgba(5,6,10,0)); transition: opacity .4s, transform .4s; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 28px; }
.brand span { font: 800 16px var(--display); letter-spacing: .3em; }
.nav { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--line); margin: 0 auto; }
.nav a { position: relative; padding: 8px 16px; border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 14px; color: var(--muted); transition: color .2s, background .2s; }
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--text); background: rgba(255,255,255,.08); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.badge { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font: 700 11px/18px var(--body); font-style: normal; text-align: center; box-shadow: 0 0 12px var(--bad); }
.right { display: flex; align-items: center; gap: 8px; }
.coins { font: 700 14px var(--mono); border-color: rgba(255, 201, 60, .25); background: rgba(255, 201, 60, .06); }
#stipend { color: var(--muted); }
#stipend.ready { color: #07080c; background: var(--gold); border-color: var(--gold); box-shadow: 0 0 24px rgba(255,201,60,.45); animation: pulse 1.6s infinite; }
#stipend.ready span { font-family: var(--mono); }
@keyframes pulse { 50% { box-shadow: 0 0 6px rgba(255,201,60,.2); } }
.me { height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); font-weight: 600; font-size: 13px; background: rgba(255,255,255,.04); }
.me:hover { border-color: var(--bad); }

#view { position: relative; overflow: hidden; min-height: 0; transition: background .6s; }
#view:not([data-view=shop]) { background: radial-gradient(ellipse at 50% 30%, rgba(5,6,10,.35), rgba(5,6,10,.7)); }
#view.enter > * { animation: viewIn .6s cubic-bezier(.2,.8,.2,1) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(18px); } }
#view .page { pointer-events: auto; height: 100%; overflow-y: auto; padding: 18px max(24px, calc((100vw - 1180px) / 2)) 60px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
body.opening .topbar, body.opening #ticker { opacity: 0; pointer-events: none; transform: translateY(-10px); }
#view.hide-ui > * { opacity: 0 !important; pointer-events: none !important; transition: opacity .4s; }

/* ---------- ticker */
#ticker { height: 34px; overflow: hidden; border-top: 1px solid var(--line); background: rgba(5,6,10,.75); backdrop-filter: blur(10px); display: flex; align-items: center; mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); transition: opacity .4s; }
#ticker .track { display: flex; gap: 42px; white-space: nowrap; animation: tick 60s linear infinite; padding-left: 100%; }
#ticker span { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
#ticker .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
@keyframes tick { to { transform: translateX(-100%); } }

/* ---------- shop */
.shop-info { pointer-events: auto; position: absolute; left: 24px; top: 12px; width: 300px; padding: 22px; max-height: calc(100% - 200px); overflow-y: auto; }
.shop-info h2 { font: 800 26px/1.1 var(--display); margin-bottom: 10px; }
.shop-info p.muted { font-size: 13.5px; }
.odds { margin-top: 16px; display: grid; gap: 2px; }
.odd { display: grid; grid-template-columns: 20px 1fr auto 56px; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; font-size: 13px; }
.odd:hover { background: rgba(255,255,255,.04); }
.odd em { font: 500 12px var(--mono); color: var(--muted); font-style: normal; }
.odd b { font: 700 12.5px var(--mono); text-align: right; color: var(--c); }
.shop-bar { pointer-events: auto; position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; justify-items: center; gap: 14px; width: min(640px, calc(100vw - 32px)); }
.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.pack-tile { position: relative; display: grid; gap: 2px; padding: 14px 16px; border-radius: 14px; text-align: left; background: rgba(13,15,23,.7); border: 1px solid var(--line); backdrop-filter: blur(16px); transition: border-color .2s, transform .2s, background .2s; overflow: hidden; }
.pack-tile::before { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 100% at 0% 0%, color-mix(in srgb, var(--c) 22%, transparent), transparent 60%); opacity: .5; transition: opacity .2s; }
.pack-tile:hover { transform: translateY(-2px); }
.pack-tile.on { border-color: var(--c); box-shadow: 0 0 0 1px var(--c), 0 10px 40px color-mix(in srgb, var(--c) 30%, transparent); }
.pack-tile.on::before { opacity: 1; }
.pt-name { position: relative; font: 700 15px var(--display); }
.pt-sub { position: relative; font-size: 12px; color: var(--muted); }
.pt-price { position: relative; font: 700 14px var(--mono); margin-top: 6px; }
.shop-bar .cta { width: 100%; height: 60px; font-size: 17px; }
@media (max-width: 900px) {
  .shop-info { display: none; }
}

/* ---------- pack opening overlay */
#opening { position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .4s; }
#opening.on { opacity: 1; }
.open-actions { pointer-events: auto; position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%); display: grid; justify-items: center; gap: 12px; animation: viewIn .6s 1.6s both; }
.open-actions .hint { color: var(--muted); font-size: 14px; letter-spacing: .04em; }
.open-actions .hint b { color: var(--text); font-family: var(--mono); }
.pull-banner { position: absolute; top: 9vh; left: 0; right: 0; text-align: center; opacity: 0; }
.pull-banner.show { animation: banner 3.2s cubic-bezier(.2,.8,.2,1) both; }
.pb-tier { font: 700 13px var(--body); letter-spacing: .5em; text-transform: uppercase; color: var(--c); text-shadow: 0 0 20px var(--c); }
.pb-name { font: 800 clamp(34px, 6vw, 64px)/1.1 var(--display); letter-spacing: .04em; margin-top: 6px; text-shadow: 0 0 40px color-mix(in srgb, var(--c) 70%, transparent); }
.pb-name span { font-family: var(--mono); font-weight: 500; color: var(--c); font-size: .6em; }
@keyframes banner { 0% { opacity: 0; transform: scale(1.4); filter: blur(12px); letter-spacing: .3em; } 15% { opacity: 1; transform: none; filter: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }

/* ---------- pages */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 10px 0 24px; flex-wrap: wrap; }
.page-head h1 { font: 800 clamp(32px, 4vw, 46px)/1 var(--display); letter-spacing: -.01em; }
.lede { max-width: 560px; color: var(--muted); margin-top: 12px; font-size: 15px; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stats > div { padding: 12px 18px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(16px); min-width: 120px; }
.stats span { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.stats b { font: 700 20px var(--mono); }
.stats em { color: var(--muted); font-style: normal; font-size: 14px; }
.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: rgba(13,15,23,.65); backdrop-filter: blur(12px); font-size: 13px; font-weight: 600; color: var(--muted); transition: all .2s; }
.chip em { font: 500 11px var(--mono); font-style: normal; opacity: .7; }
.chip:hover { color: var(--text); }
.chip.on { color: var(--text); border-color: var(--c, var(--accent)); background: color-mix(in srgb, var(--c, var(--accent)) 14%, rgba(13,15,23,.7)); }
select { height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(13,15,23,.8); outline: none; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; perspective: 1200px; }
.grid.small { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.card-tile { position: relative; display: block; aspect-ratio: 600 / 840; border-radius: 12px; overflow: hidden; padding: 0;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transform-style: preserve-3d; transition: transform .25s ease-out, box-shadow .25s;
  box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.06); }
.card-tile img { width: 100%; height: 100%; display: block; object-fit: cover; }
.card-tile .sheen { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.35), transparent 45%); mix-blend-mode: overlay; }
.card-tile.holo .sheen { background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.4), transparent 40%),
  linear-gradient(115deg, transparent 20%, rgba(255,0,180,.25), rgba(0,220,255,.25), rgba(255,240,0,.25), transparent 80%); background-size: 100% 100%, 200% 200%; background-position: center, var(--mx, 50%) var(--my, 50%); mix-blend-mode: color-dodge; }
.card-tile:hover { box-shadow: 0 20px 50px rgba(0,0,0,.6), 0 0 30px color-mix(in srgb, var(--c) 45%, transparent), 0 0 0 1px color-mix(in srgb, var(--c) 60%, transparent); z-index: 1; }
.card-tile:hover .sheen { opacity: 1; }
.card-tile[data-on] { box-shadow: 0 0 0 3px var(--c), 0 0 30px color-mix(in srgb, var(--c) 60%, transparent); }
.card-tile[data-on]::after { content: '✓'; position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--c); color: #000; font-weight: 800; display: grid; place-items: center; font-size: 13px; }

.empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 70px 20px; color: var(--muted); }
.empty h3 { color: var(--text); font: 700 20px var(--display); margin-top: 10px; }
.empty a { color: var(--accent); }
.nothing { color: var(--muted); font-size: 13px; padding: 18px 4px; }

/* ---------- inspector */
#inspector { position: fixed; z-index: 4; right: 24px; top: 84px; width: 380px; max-height: calc(100vh - 140px); overflow-y: auto; padding: 26px; opacity: 0; pointer-events: none; transform: translateX(30px); transition: opacity .4s, transform .5s cubic-bezier(.2,.8,.2,1); border-color: color-mix(in srgb, var(--c) 30%, var(--line)); }
#inspector.on { opacity: 1; pointer-events: auto; transform: none; }
body.inspecting #view { opacity: 0; pointer-events: none; transition: opacity .3s; }
#inspector .eyebrow { color: var(--c); }
#inspector h2 { font: 800 30px/1.1 var(--display); display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.serial { font: 700 20px var(--mono); color: var(--c); }
.serial em { font-style: normal; color: var(--muted); font-weight: 500; }
#inspector p.muted { margin-top: 8px; font-size: 14px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.kv > div { padding: 12px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.kv span { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.kv b { font: 700 16px var(--mono); word-break: break-all; }
.history { margin-bottom: 18px; }
.history > div:not(.eyebrow) { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.history b { color: var(--text); }
.history em { font-style: normal; white-space: nowrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.close { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 50%; font-size: 22px; line-height: 1; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); }
.close:hover { color: var(--text); }
@media (max-width: 900px) {
  #inspector { left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; max-height: 46vh; transform: translateY(30px); }
}

/* ---------- trades */
.tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tab { padding: 10px 16px; font-weight: 600; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 8px; align-items: center; }
.tab.on { color: var(--text); border-color: var(--accent); }
.tab em { font: 600 11px var(--mono); font-style: normal; padding: 1px 7px; border-radius: 9px; background: rgba(255,255,255,.08); }
.trades { display: grid; gap: 14px; }
.trade { padding: 20px; }
.trade header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.status { font: 600 11px var(--body); letter-spacing: .14em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--muted); }
.trade.pending .status { color: var(--gold); background: rgba(255,201,60,.1); }
.trade.accepted .status { color: var(--good); background: rgba(52,211,153,.1); }
.trade.declined .status, .trade.failed .status { color: var(--bad); background: rgba(255,92,122,.1); }
.trade:not(.pending) { opacity: .75; }
blockquote { margin: 0 0 14px; padding: 10px 14px; border-left: 2px solid var(--accent); background: var(--panel-2); border-radius: 0 10px 10px 0; color: #cfd4e6; font-size: 14px; }
.sides { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: start; }
.swap { align-self: center; font-size: 22px; color: var(--muted); }
.side-items { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; min-height: 60px; }
.side-items .card-tile { width: 74px; border-radius: 7px; }
.coin-chip { display: inline-flex; align-items: center; padding: 8px 12px; border-radius: 10px; background: rgba(255,201,60,.08); border: 1px solid rgba(255,201,60,.25); font: 700 14px var(--mono); }
.side-val { font: 500 12px var(--mono); color: var(--muted); margin-top: 8px; }
.trade footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
@media (max-width: 640px) { .sides { grid-template-columns: 1fr; } .swap { transform: rotate(90deg); justify-self: center; } }

/* ---------- modal */
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(3,4,8,.55); backdrop-filter: blur(6px); opacity: 0; transition: opacity .25s; }
.modal.in { opacity: 1; }
.modal-card { position: relative; width: min(1000px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; padding: 28px; transform: translateY(16px) scale(.98); transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.modal.in .modal-card { transform: none; }
.modal-card h2 { font: 800 28px/1.1 var(--display); }
.builder header, .profile header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; padding-right: 40px; flex-wrap: wrap; }
.profile .grid { max-height: 60vh; overflow-y: auto; padding: 4px; }
.b-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.b-cols section { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--panel-2); min-width: 0; }
.b-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.coin-input { display: inline-flex; align-items: center; height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(0,0,0,.25); }
.coin-input input { width: 90px; border: 0; background: none; outline: none; font: 600 14px var(--mono); }
.b-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; max-height: 44vh; overflow-y: auto; padding: 4px; perspective: 900px; }
.b-grid .card-tile { border-radius: 7px; }
.builder footer { display: flex; gap: 12px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
#b-msg { flex: 1; min-width: 200px; height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0,0,0,.25); outline: none; }
.b-sum { font: 500 13px var(--mono); color: var(--muted); }
@media (max-width: 700px) { .b-cols { grid-template-columns: 1fr; } }

/* ---------- players */
.table { overflow: hidden; padding: 6px; }
.tr { display: grid; grid-template-columns: 52px 1fr 100px 160px 80px; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; cursor: pointer; transition: background .15s; }
.tr:hover:not(.th) { background: rgba(255,255,255,.05); }
.tr.th { cursor: default; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.tr.me { background: rgba(124,140,255,.08); }
.tr > span:nth-child(3), .tr > span:nth-child(4) { font-family: var(--mono); font-weight: 600; }
.rank { font: 700 16px var(--mono); color: var(--muted); }
.rank.r1 { color: var(--gold); text-shadow: 0 0 12px var(--gold); } .rank.r2 { color: #d7dde8; } .rank.r3 { color: #ff9a5c; }
.who { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.who em { font-style: normal; font-size: 11px; color: var(--accent); border: 1px solid; border-radius: 6px; padding: 1px 6px; }
.avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font: 700 14px var(--display); font-style: normal; background: linear-gradient(135deg, hsl(var(--h) 80% 60%), hsl(calc(var(--h) + 60) 80% 40%)); }
.go { color: var(--muted); font-size: 13px; text-align: right; }
@media (max-width: 640px) { .tr { grid-template-columns: 34px 1fr 110px; } .tr > span:nth-child(3), .tr > span:nth-child(5) { display: none; } }

/* ---------- vault */
.sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.set { display: flex; gap: 18px; padding: 18px; align-items: center; transition: transform .2s, border-color .2s; }
.set:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.set-shape { flex: none; width: 84px; height: 84px; display: grid; place-items: center; border-radius: 16px; background: radial-gradient(circle, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%); filter: drop-shadow(0 0 12px color-mix(in srgb, var(--c) 50%, transparent)); }
.set:hover .set-shape svg { animation: spin 4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.set-body { flex: 1; min-width: 0; }
.set-top { display: flex; justify-content: space-between; align-items: center; }
.set h3 { font: 700 19px var(--display); }
.tier { font: 600 10px var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--c); padding: 3px 8px; border-radius: 999px; background: color-mix(in srgb, var(--c) 14%, transparent); }
.bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.06); margin: 12px 0 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 60%, #000), var(--c)); box-shadow: 0 0 12px var(--c); border-radius: 3px; transition: width 1s cubic-bezier(.2,.8,.2,1); }
.bar.inf i { width: 100%; background: repeating-linear-gradient(90deg, var(--c) 0 6px, transparent 6px 12px); box-shadow: none; opacity: .4; }
.set-meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); gap: 8px; }
.set-meta b { color: var(--text); font-family: var(--mono); }

/* ---------- toasts */
#toasts { position: fixed; z-index: 40; top: 80px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { pointer-events: auto; padding: 12px 18px; border-radius: 12px; background: rgba(16,18,28,.92); border: 1px solid var(--line-2); backdrop-filter: blur(16px); font-size: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.5); opacity: 0; transform: translateY(-12px) scale(.96); transition: all .35s cubic-bezier(.2,.8,.2,1); max-width: min(520px, calc(100vw - 32px)); }
.toast.in { opacity: 1; transform: none; }
.toast.good { border-color: rgba(52,211,153,.4); }
.toast.error { border-color: rgba(255,92,122,.5); color: #ffd6de; }
.toast a { color: var(--accent); font-weight: 600; }

@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .nav { order: 3; width: 100%; overflow-x: auto; margin: 0; }
  .nav a { padding: 8px 12px; white-space: nowrap; }
  .right { margin-left: auto; }
  .brand span { display: none; }
  #stipend { display: none; }
  #stipend.ready { display: inline-flex; }
  #view .page { padding: 12px 16px 40px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
