/* =====================================================================
   Emberfall — BNB Chain edition design system
   Surfaces: near-black slate. Accent: BNB gold. Semantic: green up / red down.
   ===================================================================== */
:root {
  --bg: #0b0e11; --bg2: #101318; --panel: #161a1f; --panel2: #1e2329; --panel3: #262c34;
  --line: #262b33; --line2: #343b45; --text: #eaecef; --muted: #8b939f; --dim: #5e6673;
  --y: #f0b90b; --y2: #fcd535; --yd: #b88a00; --y-a: rgba(240, 185, 11, .12); --y-b: rgba(240, 185, 11, .28);
  --green: #0ecb81; --red: #f6465d; --blue: #3b8bf6; --violet: #a46bff; --cyan: #2fd4d4;
  --r0: #a3aab3; --r1: #3fd17a; --r2: #3b8bf6; --r3: #a46bff; --r4: #f0a030; --r5: #f6465d; --r6: #2fd4d4; --r7: #ff6ad5; --r8: #fcd535;
  --radius: 12px; --radius-sm: 8px;
  --display: 'Chakra Petch', 'Inter', system-ui, sans-serif;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 13px/1.45 'Inter', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; overflow-x: hidden; background: radial-gradient(1200px 600px at 50% -200px, rgba(240, 185, 11, .07), transparent 70%), var(--bg); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:disabled { opacity: .42; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--y); outline-offset: 2px; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.muted { color: var(--muted); } .center { text-align: center; } .small { font-size: 11px; }
.up { color: var(--green); } .down { color: var(--red); } .gold-t { color: var(--y); }
.num { font-family: var(--display); font-weight: 600; letter-spacing: .2px; }
.link { color: var(--y); padding: 0 4px; font-weight: 600; }
.link:hover { text-decoration: underline; }

/* ---------- scrollbars (everywhere) ---------- */
* { scrollbar-width: thin; scrollbar-color: #3a414b transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #2f353e; border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--yd); background-clip: padding-box; border: 2px solid transparent; }
*::-webkit-scrollbar-corner { background: transparent; }

/* ---------- 3D icons ---------- */
img.ri { display: block; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .25s; user-select: none; pointer-events: none; }
img.ri.ready { opacity: 1; }
img.ri.ghost { filter: grayscale(1) brightness(.5); opacity: .35 !important; }
.ic { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; vertical-align: middle; }
.ic img.ri, .ic svg { width: 100%; height: 100%; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line2); background: var(--panel2); font-weight: 600; transition: background .15s, border-color .15s, transform .08s, box-shadow .15s; white-space: nowrap; }
.btn:hover:not(:disabled) { background: var(--panel3); border-color: #48505c; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary { background: var(--y); border-color: var(--y); color: #181a20; }
.btn-primary:hover:not(:disabled) { background: var(--y2); border-color: var(--y2); box-shadow: 0 0 0 4px var(--y-a); }
.btn-outline { background: transparent; border-color: var(--y-b); color: var(--y); }
.btn-outline:hover:not(:disabled) { background: var(--y-a); border-color: var(--y); }
.btn-danger { background: rgba(246, 70, 93, .14); border-color: rgba(246, 70, 93, .5); color: #ff8c9c; }
.btn-danger:hover:not(:disabled) { background: rgba(246, 70, 93, .24); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn-ghost:hover:not(:disabled) { color: var(--text); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn-lg { height: 48px; padding: 0 26px; font-size: 15px; }
.btn-block { width: 100%; }
.btn .ic { width: 20px; height: 20px; }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: inline-grid; place-items: center; line-height: 1; }
.btn-primary .badge { background: #181a20; color: var(--y); }
.dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--bg); }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--panel3); color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
.chip.y { background: var(--y-a); color: var(--y); } .chip.g { background: rgba(14, 203, 129, .12); color: var(--green); } .chip.r { background: rgba(246, 70, 93, .12); color: #ff8c9c; } .chip.v { background: rgba(164, 107, 255, .14); color: #c8a6ff; }

/* ---------- boot ---------- */
.boot { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 18px; background: var(--bg); z-index: 80; transition: opacity .4s; }
.boot.done { opacity: 0; pointer-events: none; }
.boot-mark { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-weight: 700; font-size: 30px; letter-spacing: 6px; }
.boot-bar { width: 220px; height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 40%; background: var(--y); animation: boot 1.2s infinite ease-in-out; }
@keyframes boot { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.boot p { color: var(--muted); margin: 0; }

/* ---------- brand ---------- */
.mark { width: 30px; height: 30px; flex: none; }
.topbar .mark { width: 42px; height: 42px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand b { font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: 3px; display: block; line-height: 1.1; }
.brand small { display: block; font-size: 9px; letter-spacing: 2px; color: var(--y); font-weight: 700; }

/* ---------- landing ---------- */
.landing { min-height: 100vh; display: flex; justify-content: center; padding: 28px 16px 60px; background: radial-gradient(900px 500px at 50% 0%, rgba(240, 185, 11, .12), transparent 70%); }
.landing-inner { max-width: 1080px; width: 100%; }
.landing-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 36px; }
.hero-copy { text-align: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: 99px; background: var(--y-a); color: var(--y); font-size: 11px; font-weight: 700; letter-spacing: 1.5px; }
.landing-title { font-family: var(--display); font-weight: 700; font-size: clamp(40px, 7vw, 72px); letter-spacing: 4px; margin: 16px 0 8px; line-height: 1; }
.landing-title span { color: var(--y); }
.landing-sub { color: var(--muted); max-width: 620px; margin: 0 auto 26px; font-size: 15px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 760px; margin: 0 auto 30px; }
.steps div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; text-align: left; display: flex; gap: 10px; align-items: center; }
.steps b { width: 28px; height: 28px; border-radius: 8px; background: var(--y-a); color: var(--y); display: grid; place-items: center; font-family: var(--display); flex: none; }
.steps span { font-size: 12px; color: var(--muted); } .steps strong { display: block; color: var(--text); font-size: 13px; }
.class-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.class-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; transition: border-color .2s, transform .2s, box-shadow .2s; display: flex; flex-direction: column; cursor: pointer; text-align: left; }
.class-card:hover { transform: translateY(-3px); border-color: var(--line2); }
.class-card.selected { border-color: var(--y); box-shadow: 0 0 0 1px var(--y), 0 18px 50px -20px rgba(240, 185, 11, .5); }
.class-card .portrait { height: 250px; overflow: hidden; background: radial-gradient(circle at 50% 75%, #2a2f37, #12151a 70%); display: grid; place-items: center; position: relative; }
.class-card .portrait img { height: 100%; width: 100%; object-fit: contain; display: block; }
.class-card .portrait .ph { color: var(--dim); font-size: 12px; }
.class-card .portrait .role { position: absolute; top: 12px; left: 12px; }
.class-card .cc-body { padding: 14px 16px 16px; display: grid; gap: 8px; flex: 1; }
.class-card h3 { margin: 0; font-family: var(--display); font-size: 22px; letter-spacing: 1px; }
.class-card p { margin: 0; color: var(--muted); font-size: 12px; min-height: 34px; }
.meters { display: grid; gap: 5px; }
.meter { display: grid; grid-template-columns: 54px 1fr; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.meter i { height: 6px; border-radius: 99px; background: var(--panel3); position: relative; overflow: hidden; }
.meter i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--v); background: linear-gradient(90deg, var(--yd), var(--y)); border-radius: 99px; }
.create-form { margin: 26px auto 0; display: grid; grid-template-columns: 1fr auto; gap: 10px; max-width: 520px; }
.create-form input, .field input { background: var(--bg2); border: 1px solid var(--line2); border-radius: var(--radius-sm); color: var(--text); padding: 0 14px; height: 48px; font: inherit; font-size: 15px; width: 100%; }
.create-form input:focus, .field input:focus { border-color: var(--y); outline: none; box-shadow: 0 0 0 3px var(--y-a); }
.form-error { color: var(--red); min-height: 18px; margin: 0; font-size: 12px; grid-column: 1 / -1; text-align: center; }
.landing-foot { color: var(--muted); font-size: 12px; margin-top: 10px; text-align: center; }

/* ---------- topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; padding: 0 20px; height: 76px; background: rgba(11, 14, 17, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav { display: flex; gap: 2px; margin-left: 12px; overflow-x: auto; scrollbar-width: none; height: 100%; }
.nav::-webkit-scrollbar { display: none; }
.nav-btn { position: relative; display: flex; align-items: center; gap: 9px; padding: 0 16px; color: var(--muted); font-weight: 600; font-size: 15px; white-space: nowrap; height: 100%; }
.nav-btn .ic { width: 32px; height: 32px; }
.topbar .brand b { font-size: 22px; } .topbar .brand small { font-size: 10px; }
.nav-btn:hover { color: var(--text); }
.nav-btn.active { color: var(--text); }
.nav-btn.active::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; background: var(--y); border-radius: 2px; }
.wallet-strip { margin-left: auto; display: flex; gap: 8px; }
.cur { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 6px 0 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.cur .ic { width: 30px; height: 30px; }
.cur b { font-family: var(--display); font-size: 17px; font-weight: 600; min-width: 34px; }
.cur small { font-size: 10px; color: var(--muted); letter-spacing: 1px; font-weight: 700; }
.cur .plus { width: 24px; height: 24px; border-radius: 6px; background: var(--y-a); color: var(--y); font-weight: 700; display: grid; place-items: center; }
.cur .plus:hover { background: var(--y); color: #181a20; }
.chain-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--y-b); color: var(--y); font-size: 11px; font-weight: 700; white-space: nowrap; }
.chain-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--y); box-shadow: 0 0 8px var(--y); }
.account-btn { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 12px 0 4px; border: 1px solid var(--line); border-radius: 99px; position: relative; background: var(--panel); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--y), var(--yd)); color: #181a20; font-family: var(--display); font-weight: 700; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.account-btn .lvl { font-size: 11px; color: var(--muted); display: block; line-height: 1.1; text-align: left; }
.account-name { font-weight: 600; font-size: 14px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.1; text-align: left; display: block; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 300px minmax(0, 1fr) 400px; gap: 16px; padding: 16px 20px 24px; max-width: 1920px; margin: 0 auto; align-items: start; }
.col { display: grid; gap: 16px; min-width: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; min-height: 22px; }
.panel-h h3 { margin: 0; font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.panel-h h3::before { content: ''; width: 3px; height: 14px; border-radius: 2px; background: var(--y); }
.panel-h small { color: var(--muted); font-size: 11px; }
.sub-h { font-size: 11px; letter-spacing: 1px; color: var(--muted); margin: 16px 0 8px; font-weight: 700; text-transform: uppercase; }
.footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; padding: 18px 20px 30px; color: var(--muted); border-top: 1px solid var(--line); max-width: 1920px; margin: 0 auto; font-size: 12px; }
.footer div { display: flex; gap: 14px; }

/* ---------- hero card ---------- */
.hero-id { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.hero-portrait { width: 56px; height: 56px; border-radius: 12px; border: 1px solid var(--y-b); background: radial-gradient(circle at 50% 30%, #2a2f37, #12151a); overflow: hidden; flex: none; }
.hero-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.hero-name { display: flex; align-items: center; gap: 8px; }
.hero-name b { font-family: var(--display); font-size: 19px; font-weight: 700; }
.lv-badge { background: var(--y); color: #181a20; font-weight: 800; font-size: 11px; border-radius: 6px; padding: 1px 7px; font-family: var(--display); }
.hero-id small { color: var(--muted); }
.bar-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin: 10px 0 5px; font-weight: 600; }
.bar-label b { color: var(--text); font-family: var(--display); font-size: 13px; }
.bar { position: relative; height: 8px; background: var(--bg2); border-radius: 99px; overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 99px; transition: width .25s; }
.bar.hp i { background: linear-gradient(90deg, #c8273e, var(--red)); }
.bar.hp em { position: absolute; inset: 0 auto 0 0; width: 0; background: repeating-linear-gradient(45deg, rgba(150, 200, 255, .85) 0 4px, rgba(100, 160, 240, .85) 4px 8px); }
.bar.xp { height: 14px; }
.bar.xp i { background: linear-gradient(90deg, var(--yd), var(--y)); }
.bar.xp span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 9px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px #000; letter-spacing: .3px; }
.power-box { margin: 14px 0 12px; padding: 12px 14px; border-radius: 10px; display: flex; align-items: center; justify-content: space-between; background: linear-gradient(135deg, rgba(240, 185, 11, .14), rgba(240, 185, 11, .03)); border: 1px solid var(--y-b); }
.power-box small { display: block; font-size: 10px; letter-spacing: 1.5px; color: var(--y); font-weight: 700; }
.power-box b { font-family: var(--display); font-size: 28px; font-weight: 700; line-height: 1.1; }
.power-box span { font-size: 12px; font-weight: 700; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stat { background: var(--bg2); border-radius: 8px; padding: 7px 9px; display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--muted); cursor: help; }
.stat b { color: var(--text); font-family: var(--display); font-size: 13px; }
.passive { margin-top: 10px; font-size: 11px; color: var(--muted); background: var(--bg2); border-radius: 8px; padding: 8px 10px; border-left: 2px solid var(--y); }
.boosts { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
.boost { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px 6px 6px; border-radius: 8px; color: var(--text); background: var(--bg2); }
.boost span { display: flex; gap: 8px; align-items: center; }
.boost .ic { width: 28px; height: 28px; }
.boost b { color: var(--green); font-family: var(--display); }

/* ---------- quests ---------- */
.quest { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 12px; border-radius: 10px; margin-bottom: 8px; background: var(--bg2); border: 1px solid transparent; }
.quest h5 { margin: 0; font-size: 12px; font-weight: 600; }
.quest p { margin: 0; color: var(--muted); font-size: 11px; }
.quest .reward { text-align: right; font-size: 11px; font-weight: 700; display: grid; gap: 2px; justify-items: end; }
.quest .reward span { display: flex; align-items: center; gap: 3px; }
.quest .reward .ic { width: 16px; height: 16px; }
.quest .qfoot { display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; margin-top: 4px; }
.quest .qfoot .bar { flex: 1; height: 5px; } .quest .qfoot .bar i { background: linear-gradient(90deg, var(--yd), var(--y)); }
.quest .qfoot small { font-family: var(--display); color: var(--muted); min-width: 56px; text-align: right; }
.quest.ready { border-color: var(--y-b); background: linear-gradient(135deg, rgba(240, 185, 11, .1), var(--bg2)); }
.quest.done { opacity: .45; }
.login-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; margin-bottom: 4px; font-size: 12px; background: linear-gradient(135deg, rgba(240, 185, 11, .16), rgba(240, 185, 11, .04)); border: 1px solid var(--y-b); }
.login-card .ic { width: 38px; height: 38px; }
.login-card div { flex: 1; } .login-card b { display: block; }
.activity { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 12px; max-height: 240px; overflow: auto; }
.activity li { color: var(--muted); padding-left: 10px; border-left: 2px solid var(--line2); }
.activity li b { color: var(--text); font-weight: 600; }

/* ---------- coach ---------- */
.coach { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--radius); background: linear-gradient(100deg, rgba(240, 185, 11, .16), rgba(240, 185, 11, .02) 60%), var(--panel); border: 1px solid var(--y-b); }
.coach .ic { width: 46px; height: 46px; }
.coach-text { flex: 1; min-width: 0; }
.coach-text small { color: var(--y); font-size: 10px; letter-spacing: 1.5px; font-weight: 800; }
.coach-text b { display: block; font-size: 15px; }
.coach-text span { color: var(--muted); font-size: 12px; }

/* ---------- arena ---------- */
.arena { position: relative; height: clamp(400px, 54vh, 620px); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--bg2); touch-action: pan-y; }
.world, .world canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.nameplates, .floaters { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.nameplate { position: absolute; transform: translate(-50%, -100%); text-align: center; min-width: 130px; }
.nameplate .np-tag { display: inline-flex; gap: 5px; align-items: center; font-size: 11px; font-weight: 700; background: rgba(11, 14, 17, .82); border: 1px solid rgba(255, 255, 255, .1); border-radius: 6px; padding: 2px 8px; margin-bottom: 4px; white-space: nowrap; }
.nameplate .np-tag.elite { color: var(--y2); border-color: var(--y-b); } .nameplate .np-tag.giant { color: #ffad6a; border-color: rgba(255, 150, 80, .5); } .nameplate .np-tag.boss { color: #ff7a8a; border-color: var(--red); }
.nameplate .bar { height: 7px; width: 130px; margin: 0 auto; background: rgba(0, 0, 0, .65); box-shadow: 0 0 0 1px rgba(0, 0, 0, .4); }
.nameplate .bar i { background: linear-gradient(90deg, #c8273e, var(--red)); transition: width .12s; }
.nameplate.hero .bar i { background: linear-gradient(90deg, #09a066, var(--green)); }
.nameplate .bar em { position: absolute; inset: 0 auto 0 0; background: rgba(150, 200, 255, .8); }
.nameplate small { display: block; font-size: 10px; color: rgba(255, 255, 255, .85); text-shadow: 0 1px 2px #000; margin-top: 2px; font-family: var(--display); }
.floater { position: absolute; transform: translate(-50%, -50%); font-family: var(--display); font-weight: 700; font-size: 22px; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .8), 0 0 10px rgba(0, 0, 0, .6); animation: floatUp 1.1s ease-out forwards; white-space: nowrap; }
.floater.crit { font-size: 34px; color: var(--y2); animation-name: critPop; }
.floater.ehit { color: #ff6a7c; font-size: 20px; }
.floater.heal { color: var(--green); }
.floater.gold { color: var(--y); font-size: 15px; }
.floater.xp { color: #b49aff; font-size: 14px; }
.floater.miss { color: #9fd4ff; font-size: 16px; }
.floater.debuff { color: #b4f06a; font-size: 14px; }
.floater.big { font-size: 26px; color: var(--y); animation-duration: 2s; letter-spacing: 1px; }
.floater.el-fire { color: #ff8a4a; font-size: 17px; } .floater.el-frost { color: #8fdcff; font-size: 17px; } .floater.el-storm { color: #f3e46a; font-size: 17px; } .floater.pet { color: #ffb36b; font-size: 15px; }
@keyframes floatUp { 0% { opacity: 0; margin-top: 10px; } 12% { opacity: 1; } 100% { opacity: 0; margin-top: -60px; } }
@keyframes critPop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.25); } 30% { transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; margin-top: -70px; transform: translate(-50%, -50%) scale(1); } }
.arena-top { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; pointer-events: none; }
.arena-top > * { pointer-events: auto; }
.zone-plate { background: rgba(11, 14, 17, .78); border: 1px solid var(--line2); border-radius: 10px; padding: 7px 14px; backdrop-filter: blur(6px); min-width: 0; }
.zone-plate small { display: block; font-size: 10px; letter-spacing: 1.5px; color: var(--muted); font-weight: 700; }
.zone-plate b { font-family: var(--display); font-size: 17px; font-weight: 700; }
.arena.nightmare .zone-plate { border-color: var(--violet); } .arena.nightmare .zone-plate small { color: #c8a6ff; }
.potion-widget { display: flex; gap: 6px; }
.potion-btn { width: 54px; height: 54px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(11, 14, 17, .78); display: grid; place-items: center; position: relative; padding: 4px; }
.potion-btn:hover { border-color: var(--y); }
.potion-btn span { position: absolute; right: 4px; bottom: 2px; font-family: var(--display); font-size: 13px; font-weight: 700; text-shadow: 0 1px 2px #000; }
.autopot { height: 54px; padding: 0 10px; border-radius: 12px; background: rgba(11, 14, 17, .78); border: 1px solid var(--line2); color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .5px; display: grid; place-content: center; text-align: center; }
.autopot b { color: var(--green); font-family: var(--display); font-size: 14px; }
.autopot.off b { color: var(--red); }
.boss-timer { position: absolute; top: 76px; left: 50%; transform: translateX(-50%); width: min(340px, 70%); display: flex; align-items: center; gap: 10px; background: rgba(40, 10, 16, .85); border: 1px solid var(--red); border-radius: 10px; padding: 7px 12px; }
.boss-timer small { font-size: 10px; letter-spacing: 1.5px; color: #ff8c9c; font-weight: 800; }
.boss-timer .bar { flex: 1; height: 6px; } .boss-timer .bar i { background: var(--red); transition: width 1s linear; }
.boss-timer b { font-family: var(--display); }
.intel { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 10px; align-items: center; background: rgba(11, 14, 17, .82); border: 1px solid var(--line2); border-radius: 12px; padding: 8px 12px 8px 8px; max-width: min(380px, 55%); backdrop-filter: blur(6px); }
.intel .face { width: 46px; height: 46px; border-radius: 10px; background: radial-gradient(circle, #2b3139, #12151a); overflow: hidden; flex: none; }
.intel > div:last-child { min-width: 0; }
.intel b { font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.intel .traits { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.intel .chip { height: 19px; font-size: 10px; cursor: help; }
.arena-actions { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 8px; }
.act-btn { position: relative; display: flex; align-items: center; gap: 10px; height: 58px; padding: 0 16px 0 8px; border-radius: 12px; font-weight: 700; text-align: left; border: 1px solid var(--line2); background: rgba(11, 14, 17, .85); backdrop-filter: blur(6px); transition: border-color .15s, transform .1s, background .15s; }
.act-btn .ic { width: 44px; height: 44px; }
.act-btn small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.act-btn:hover:not(:disabled) { border-color: var(--y); }
.act-btn.primary { background: var(--y); color: #181a20; border-color: var(--y); }
.act-btn.primary small { color: #4a3a0a; }
.act-btn.primary:hover:not(:disabled) { background: var(--y2); }
.act-btn.pulse { animation: pulse 1.8s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(240, 185, 11, .5); } 50% { box-shadow: 0 0 0 8px rgba(240, 185, 11, 0); } }
.act-btn .badge { position: absolute; top: -7px; right: -7px; }
.death-veil { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; background: radial-gradient(circle, rgba(60, 10, 18, .8), rgba(0, 0, 0, .85)); text-align: center; animation: fadeIn .4s; }
.death-veil h3 { margin: 0; font-family: var(--display); font-size: 30px; color: #ff8c9c; letter-spacing: 2px; }
.death-veil p { margin: 0 0 6px; color: #ffd0d6; }
.loading-veil { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); background: var(--bg2); transition: opacity .5s; }
.loading-veil.done { opacity: 0; pointer-events: none; }
.arena-hint { position: absolute; top: 74px; right: 14px; font-size: 10px; color: rgba(255, 255, 255, .35); pointer-events: none; }
@keyframes fadeIn { from { opacity: 0; } }

/* ---------- zones ---------- */
.nightmare { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid rgba(164, 107, 255, .4); color: #c8a6ff; font-size: 12px; font-weight: 700; }
.nightmare i { width: 30px; height: 16px; border-radius: 99px; background: var(--panel3); position: relative; }
.nightmare i::after { content: ''; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: #6a6278; transition: left .2s, background .2s; }
.nightmare.on { background: rgba(164, 107, 255, .16); } .nightmare.on i { background: var(--violet); } .nightmare.on i::after { left: 16px; background: #fff; }
.zone-strip-wrap { position: relative; }
.zone-strip { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 8px; }
.strip-arrow { position: absolute; top: 50%; transform: translateY(-60%); z-index: 2; width: 30px; height: 30px; border-radius: 50%; background: var(--panel3); border: 1px solid var(--line2); color: var(--text); font-size: 16px; display: grid; place-items: center; box-shadow: var(--shadow); }
.strip-arrow.l { left: -10px; } .strip-arrow.r { right: -10px; }
.zone-card { scroll-snap-align: start; flex: 0 0 230px; border-radius: 12px; border: 1px solid var(--line); position: relative; overflow: hidden; text-align: left; padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; background: var(--zbg); min-height: 156px; transition: border-color .15s, transform .15s; isolation: isolate; }
.zone-card:hover:not(.locked) { border-color: var(--line2); transform: translateY(-2px); }
.zone-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .05) 20%, rgba(0, 0, 0, .72)); z-index: -1; }
.zone-card .zhead { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.zone-card .zi { font-family: var(--display); font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, .7); }
.zone-card h4 { margin: 0; font-family: var(--display); font-size: 16px; font-weight: 700; text-shadow: 0 1px 3px #000; }
.zone-card .mons { display: flex; gap: 4px; margin-top: auto; }
.zone-card .mons span { width: 38px; height: 38px; border-radius: 8px; background: rgba(0, 0, 0, .45); overflow: hidden; border: 1px solid rgba(255, 255, 255, .08); }
.zone-card .zm { display: flex; gap: 4px; flex-wrap: wrap; }
.zone-card .zm .chip { height: 20px; background: rgba(0, 0, 0, .55); color: #d8dde3; }
.zone-card.here { border-color: var(--y); box-shadow: inset 0 0 0 1px var(--y); }
.zone-card.locked { filter: grayscale(.9) brightness(.55); cursor: not-allowed; }
.zone-card.rec:not(.here) { border-color: rgba(14, 203, 129, .7); }
.diff-easy { color: var(--green) !important; } .diff-fair { color: var(--y) !important; } .diff-hard { color: #ffad6a !important; } .diff-deadly { color: var(--red) !important; }
.earn-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.earn-grid div { background: var(--bg2); border-radius: 10px; padding: 10px 12px; }
.earn-grid b { display: block; font-family: var(--display); font-size: 22px; font-weight: 700; }
.earn-grid small { color: var(--muted); font-size: 11px; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); margin-right: 4px; animation: blink 2s infinite; }
@keyframes blink { 50% { opacity: .4; } }

/* ---------- inventory ---------- */
.tabs { display: flex; gap: 2px; background: var(--bg2); border-radius: 9px; padding: 3px; }
.tab { position: relative; height: 28px; padding: 0 12px; font-size: 12px; border-radius: 7px; color: var(--muted); font-weight: 600; }
.tab.active { background: var(--panel3); color: var(--text); }
.tab .dot { top: 3px; right: 3px; width: 7px; height: 7px; box-shadow: none; }
.equip-row { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-bottom: 12px; }
.slot, .cell { aspect-ratio: 1; border-radius: 10px; position: relative; display: grid; place-items: center; padding: 3px; background: radial-gradient(circle at 50% 35%, var(--rg, #2a2f37) 0%, #14171c 75%); border: 1px solid var(--rb, var(--line2)); transition: transform .12s, border-color .12s; }
.slot:hover, .cell:hover:not(.empty) { transform: translateY(-2px); border-color: var(--rc, #5e6673); }
.slot .sl { position: absolute; bottom: 2px; left: 0; right: 0; text-align: center; font-size: 8px; letter-spacing: .5px; color: var(--dim); font-weight: 700; }
.slot.empty { background: var(--bg2); border-style: dashed; }
.plus { position: absolute; top: 2px; right: 4px; font-size: 10px; font-weight: 800; font-family: var(--display); color: #fff; text-shadow: 0 1px 2px #000; }
.inv-toolbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bag-count { margin-left: auto; font-family: var(--display); font-size: 14px; font-weight: 700; color: var(--muted); }
.bag-count.full { color: var(--red); }
.bag-warn { margin-top: 10px; padding: 8px 10px; border: 1px solid rgba(246, 70, 93, .4); background: rgba(246, 70, 93, .08); border-radius: 8px; font-size: 12px; color: #ffb3bd; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.filters { display: flex; gap: 4px; margin: 12px 0 8px; flex-wrap: wrap; }
.chip-btn { height: 26px; padding: 0 10px; border-radius: 6px; font-size: 11px; color: var(--muted); font-weight: 600; background: var(--bg2); }
.chip-btn:hover { color: var(--text); }
.chip-btn.active { background: var(--y-a); color: var(--y); }
.chip-btn b { margin-left: 3px; }
.bag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; max-height: 340px; overflow-y: auto; padding: 2px 4px 2px 2px; }
.cell.sel { outline: 2px solid var(--y); outline-offset: 1px; }
.cell .arrow { position: absolute; left: 3px; bottom: 1px; font-size: 11px; color: var(--green); font-weight: 900; text-shadow: 0 1px 2px #000; }
.cell .lock { position: absolute; left: 3px; top: 1px; font-size: 9px; }
.cell .seal { position: absolute; right: 3px; bottom: 1px; font-size: 10px; color: var(--y2); }
.cell.no { opacity: .55; }
.cell.empty { background: var(--bg2); border: 1px dashed var(--line); }
/* rarity frames */
[data-r="0"] { --rc: var(--r0); --rb: #3a4048; --rg: #2a2f36; }
[data-r="1"] { --rc: var(--r1); --rb: rgba(63, 209, 122, .55); --rg: rgba(63, 209, 122, .28); }
[data-r="2"] { --rc: var(--r2); --rb: rgba(59, 139, 246, .65); --rg: rgba(59, 139, 246, .3); }
[data-r="3"] { --rc: var(--r3); --rb: rgba(164, 107, 255, .7); --rg: rgba(164, 107, 255, .32); }
[data-r="4"] { --rc: var(--r4); --rb: rgba(240, 160, 48, .8); --rg: rgba(240, 160, 48, .34); }
[data-r="5"] { --rc: var(--r5); --rb: rgba(246, 70, 93, .85); --rg: rgba(246, 70, 93, .36); }
[data-r="6"], [data-r="7"], [data-r="8"] { --rb: var(--rc); }
[data-r="6"] { --rc: var(--r6); --rg: rgba(47, 212, 212, .38); box-shadow: 0 0 10px -2px var(--r6); }
[data-r="7"] { --rc: var(--r7); --rg: rgba(255, 106, 213, .38); box-shadow: 0 0 12px -2px var(--r7); }
[data-r="8"] { --rc: var(--r8); --rg: rgba(252, 213, 53, .42); box-shadow: 0 0 14px -2px var(--r8); }
.frame { background: radial-gradient(circle at 50% 35%, var(--rg, #2a2f37) 0%, #14171c 75%); border: 1px solid var(--rb, var(--line2)); position: relative; overflow: hidden; }
[data-r="5"]::before, [data-r="6"]::before, [data-r="7"]::before, [data-r="8"]::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .16) 50%, transparent 65%); background-size: 250% 100%; animation: shimmer 3.5s infinite; pointer-events: none; z-index: 1; }
@keyframes shimmer { 0% { background-position: 150% 0; } 100% { background-position: -100% 0; } }
.rc0 { color: var(--r0); } .rc1 { color: var(--r1); } .rc2 { color: var(--r2); } .rc3 { color: var(--r3); } .rc4 { color: var(--r4); } .rc5 { color: var(--r5); } .rc6 { color: var(--r6); } .rc7 { color: var(--r7); } .rc8 { color: var(--r8); }
.item-detail { margin-top: 12px; border-radius: 12px; padding: 14px; background: var(--bg2); border: 1px solid var(--line); min-height: 120px; }
.idt { display: flex; gap: 12px; align-items: flex-start; }
.idt .big { width: 76px; height: 76px; flex: none; border-radius: 12px; padding: 4px; }
.idt h3 { margin: 0; font-size: 16px; line-height: 1.25; font-weight: 700; }
.idt .meta { font-size: 10px; letter-spacing: 1px; font-weight: 800; margin-top: 4px; }
.idt .pw { margin-top: 6px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.idt .pw b { font-family: var(--display); font-size: 17px; }
.statlist { display: grid; gap: 4px; margin: 12px 0; font-size: 12px; }
.statlist div { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.statlist .main b { color: var(--text); font-family: var(--display); } .statlist .aff { color: var(--muted); } .statlist .aff b { color: #8fc3ff; font-family: var(--display); }
.statlist .q { width: 34px; height: 4px; background: var(--panel3); border-radius: 2px; display: inline-block; margin-left: 6px; vertical-align: middle; overflow: hidden; }
.statlist .q i { display: block; height: 100%; background: var(--y); }
.statlist .tag { color: var(--y); }
details summary { cursor: pointer; }
.item-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* hero tab */
.viewer-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: radial-gradient(circle at 50% 65%, rgba(240, 185, 11, .14), transparent 60%), var(--bg2); position: relative; }
.viewer-h { position: absolute; top: 12px; left: 14px; z-index: 2; }
.viewer-h b { display: block; font-family: var(--display); font-size: 19px; font-weight: 700; letter-spacing: 1px; }
.viewer-h small { color: var(--y); font-weight: 600; }
.hero-viewer { height: 330px; }
.hero-viewer canvas { width: 100% !important; height: 100% !important; display: block; }
.viewer-foot { z-index: 2; position: absolute; left: 14px; right: 14px; bottom: 12px; display: flex; align-items: flex-end; justify-content: space-between; }
.viewer-foot small { display: block; font-size: 10px; letter-spacing: 1.5px; color: var(--y); font-weight: 700; }
.viewer-foot b { font-family: var(--display); font-size: 30px; font-weight: 700; }
.viewer-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.viewer-stats div { background: var(--bg2); border-radius: 8px; padding: 7px 2px; }
.viewer-stats small { display: block; font-size: 10px; color: var(--muted); }
.viewer-stats b { font-family: var(--display); font-size: 15px; }
.skins { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.skin { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 6px; text-align: left; font-size: 11px; background: var(--bg2); }
.skin .face { width: 46px; height: 46px; border-radius: 8px; overflow: hidden; background: #12151a; flex: none; }
.skin b { font-size: 12px; display: block; } .skin small { color: var(--muted); display: block; }
.skin.active { border-color: var(--y); background: var(--y-a); }
.skin.locked .face img { filter: grayscale(1) brightness(.6); }

/* pets */
.pet-active { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pet-slot { text-align: center; display: grid; justify-items: center; gap: 4px; background: var(--bg2); border-radius: 12px; padding: 14px 10px; border: 1px solid var(--line); }
.pet-orb { width: 108px; height: 108px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, var(--pc, #333) -60%, #12151a 70%); border: 2px solid var(--y-b); position: relative; padding: 10px; }
.pet-orb.empty { border-style: dashed; border-color: var(--line2); color: var(--dim); font-size: 30px; background: transparent; }
.pet-orb .tag { position: absolute; bottom: -10px; background: var(--panel3); border-radius: 6px; font-size: 10px; font-weight: 700; padding: 2px 8px; white-space: nowrap; }
.pet-slot b { font-size: 14px; margin-top: 8px; }
.pet-slot small { color: var(--muted); font-size: 11px; min-height: 30px; }
.pet-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.pet-cols h5 { margin: 0 0 6px; font-size: 11px; letter-spacing: 1px; color: var(--muted); display: flex; justify-content: space-between; }
.pet-row { display: flex; gap: 8px; align-items: center; padding: 6px; border-radius: 10px; border: 1px solid transparent; width: 100%; text-align: left; }
.pet-row:hover { background: var(--bg2); }
.pet-row.on { border-color: var(--y-b); background: var(--y-a); }
.pet-row .po { width: 42px; height: 42px; border-radius: 10px; background: radial-gradient(circle, var(--pc) -60%, #12151a 75%); flex: none; padding: 2px; }
.pet-row.locked .po img { filter: grayscale(1) brightness(.55); }
.pet-row b { font-size: 12px; display: block; } .pet-row small { color: var(--muted); font-size: 10px; display: block; }

/* ---------- tooltip ---------- */
.tip { position: fixed; z-index: 90; max-width: 280px; background: #20252c; border: 1px solid var(--line2); border-radius: 10px; padding: 10px 12px; font-size: 12px; box-shadow: var(--shadow); pointer-events: none; }
.tip h6 { margin: 0 0 2px; font-size: 13px; }
.tip p { margin: 4px 0 0; color: var(--muted); }

/* ---------- modal ---------- */
.modal { border: 1px solid var(--line2); border-radius: 16px; background: var(--panel); color: var(--text); padding: 24px; width: min(900px, calc(100vw - 24px)); max-height: calc(100vh - 40px); overflow: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .7); }
.modal.narrow { width: min(460px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(0, 0, 0, .7); backdrop-filter: blur(4px); }
.modal-x { position: sticky; float: right; top: 0; width: 34px; height: 34px; border-radius: 10px; background: var(--panel2); font-size: 18px; color: var(--muted); z-index: 2; }
.modal-x:hover { color: var(--text); }
.modal h2 { margin: 0 0 4px; font-family: var(--display); font-size: 26px; font-weight: 700; }
.modal .lead { color: var(--muted); margin: 0 0 18px; }
.modal h4 { font-size: 11px; letter-spacing: 1.5px; color: var(--muted); margin: 20px 0 10px; text-transform: uppercase; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-right: 44px; }
.bal { display: flex; gap: 6px; flex-wrap: wrap; }
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.store-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 6px; text-align: center; background: var(--bg2); transition: border-color .15s, transform .15s; }
.store-card:hover { border-color: var(--line2); transform: translateY(-2px); }
.store-card .art { height: 96px; display: grid; place-items: center; border-radius: 10px; background: radial-gradient(circle at 50% 45%, var(--ag, #2b3139), #12151a 72%); padding: 6px; }
.store-card .art img { width: 88px; height: 88px; }
.store-card b { font-size: 13px; } .store-card small { color: var(--muted); font-size: 11px; min-height: 30px; }
.store-card.owned { opacity: .6; }
.price { display: inline-flex; align-items: center; gap: 4px; }
.price .ic { width: 18px; height: 18px; }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 11px; letter-spacing: 1px; color: var(--muted); font-weight: 600; }
.field input { height: 44px; font-size: 14px; }
.seg { display: inline-flex; background: var(--bg2); border-radius: 9px; padding: 3px; margin-bottom: 16px; gap: 2px; flex-wrap: wrap; }
.seg button { height: 30px; padding: 0 14px; color: var(--muted); font-weight: 600; border-radius: 7px; }
.seg button.active { background: var(--panel3); color: var(--text); }
.lb-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.lb-table th { text-align: left; font-size: 10px; letter-spacing: 1px; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line2); text-transform: uppercase; }
.lb-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); }
.lb-table td.num { font-family: var(--display); }
.lb-table tr.me td { background: var(--y-a); }
.rank { font-family: var(--display); font-weight: 700; color: var(--muted); }
.rank.top { color: var(--y); }
.vault-stage { display: grid; justify-items: center; gap: 14px; padding: 6px 0; }
.vault-cube { width: 150px; height: 150px; animation: float 3s ease-in-out infinite; filter: drop-shadow(0 0 30px rgba(240, 185, 11, .45)); }
.vault-cube.spin { animation: spin .9s ease-in-out; }
@keyframes float { 50% { transform: translateY(-8px) rotate(2deg); } }
@keyframes spin { 0% { transform: scale(1) rotate(0); } 50% { transform: scale(1.2) rotate(200deg); filter: brightness(2) drop-shadow(0 0 40px #fcd535); } 100% { transform: scale(1) rotate(360deg); } }
.pity { width: min(380px, 90%); }
.pity .bar i { background: linear-gradient(90deg, var(--violet), var(--r7)); }
.vault-btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.vault-btns .btn { flex-direction: column; gap: 2px; min-width: 190px; height: 60px; }
.vault-btns small { font-weight: 500; opacity: .85; display: flex; gap: 4px; align-items: center; }
.prize-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-top: 10px; }
.prize { border-radius: 10px; padding: 10px; font-size: 12px; text-align: center; animation: pop .4s backwards; display: grid; gap: 6px; justify-items: center; background: var(--bg2); }
.prize .pi { width: 64px; height: 64px; border-radius: 10px; padding: 3px; }
.prize.rare { box-shadow: 0 0 18px -4px var(--r7); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.rates { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 16px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.rates b { color: var(--text); float: right; font-family: var(--display); }
.forge-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.forge-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 6px; max-height: 300px; overflow: auto; padding: 2px; }
.forge-panel { border-radius: 12px; padding: 16px; background: var(--bg2); border: 1px solid var(--line); }
.odds { font-family: var(--display); font-size: 30px; font-weight: 700; color: var(--y); }
.loot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.loot { display: flex; gap: 10px; align-items: center; border-radius: 10px; padding: 8px; animation: pop .35s backwards; text-align: left; background: var(--bg2); border: 1px solid var(--line); }
.loot .li { width: 48px; height: 48px; flex: none; border-radius: 9px; padding: 2px; }
.loot b { font-size: 12px; display: block; line-height: 1.25; } .loot small { font-size: 11px; color: var(--muted); }
.offline-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.offline-grid div { background: var(--bg2); border-radius: 10px; padding: 12px; text-align: center; }
.offline-grid b { display: block; font-family: var(--display); font-size: 24px; color: var(--y); }
.offline-grid small { color: var(--muted); }
.guide-steps { display: grid; gap: 8px; }
.guide-steps div { display: flex; gap: 12px; align-items: center; background: var(--bg2); border-radius: 10px; padding: 8px 12px 8px 8px; }
.guide-steps .ic { width: 44px; height: 44px; }
.guide-steps b { display: block; } .guide-steps p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.range { width: 100%; accent-color: var(--y); }
.toggle-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); gap: 10px; }
.toggle-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--y); }
.class-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.class-pick button { border: 1px solid var(--line); border-radius: 10px; padding: 12px; text-align: left; display: grid; gap: 4px; background: var(--bg2); }
.class-pick button.cur { border-color: var(--y); }
.class-pick small { color: var(--muted); }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 100; max-width: min(360px, calc(100vw - 32px)); }
.toast { background: #20252c; border: 1px solid var(--line2); border-left: 3px solid var(--green); border-radius: 10px; padding: 11px 14px; box-shadow: var(--shadow); animation: toastIn .25s; font-size: 13px; }
.toast.err { border-left-color: var(--red); }
.toast.gold { border-left-color: var(--y); }
.toast.out { opacity: 0; transform: translateX(20px); transition: .3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- mobile bottom nav ---------- */
.mnav { display: none; }

/* ---------- responsive ---------- */
/* ---------- desktop app shell: one screen, each side column scrolls on its own ---------- */
@media (min-width: 1201px) {
  .game:not([hidden]) { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
  .topbar { position: relative; flex: none; }
  .layout { flex: 1; min-height: 0; width: 100%; box-sizing: border-box; grid-template-rows: minmax(0, 1fr); align-items: stretch; padding-bottom: 16px; }
  .col-left, .col-right { overflow-y: auto; overscroll-behavior: contain; align-content: start; min-height: 0; padding-right: 4px; }
  .col-center { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow: hidden; }
  .col-center .arena { flex: 1; height: auto; min-height: 280px; }
  .col-center .panel { flex: none; padding: 12px 14px; }
  .col-center .panel-h { margin-bottom: 10px; }
  .col-center .zone-strip { padding-bottom: 4px; }
  .col-center .zone-card { min-height: 128px; flex-basis: 210px; padding: 8px 10px 10px; gap: 4px; }
  .col-center .zone-card .mons span { width: 32px; height: 32px; }
  .col-center .earn-grid div { padding: 8px 12px; }
  .col-center .earn-grid b { font-size: 19px; }
  .footer { display: none; }
}
@media (min-width: 1201px) and (max-height: 860px) {
  .col-center .zone-card { min-height: 104px; }
  .col-center .zone-card .mons { display: none; }
  .col-center .earn-grid b { font-size: 16px; }
}
@media (max-width: 1720px) { .nav-btn { padding: 0 11px; font-size: 14px; } .nav { margin-left: 4px; } .chain-chip { display: none; } }
@media (max-width: 1640px) { .nav-btn span { display: none; } .nav-btn { padding: 0 12px; } }
@media (max-width: 1440px) { .layout { grid-template-columns: 280px minmax(0, 1fr) 360px; } .chain-chip { display: none; } }
@media (max-width: 1200px) {
  .layout { grid-template-columns: minmax(0, 1fr) 360px; }
  .col-left { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .cur small { display: none; }
}
@media (max-width: 860px) {
  body { padding-bottom: 64px; }
  .layout { grid-template-columns: minmax(0, 1fr); padding: 10px; gap: 10px; }
  .col-left { grid-row: auto; grid-template-columns: minmax(0, 1fr); }
  .col-center { order: -1; }
  .topbar { padding: 0 10px; gap: 8px; height: 56px; }
  .nav, .account-name, .account-btn .lvl, .hide-sm { display: none; }
  .brand b, .topbar .brand b { font-size: 15px; letter-spacing: 2px; } .brand small { display: none; } .topbar .mark { width: 30px; height: 30px; } .cur .ic { width: 22px; height: 22px; } .avatar { width: 30px; height: 30px; }
  .cur { padding: 0 4px 0 6px; height: 34px; gap: 4px; } .cur b { font-size: 13px; min-width: 0; } .cur .plus { display: none; }
  .account-btn { padding: 0 4px; height: 36px; }
  .class-cards, .steps { grid-template-columns: minmax(0, 1fr); }
  .class-card { flex-direction: row; }
  .class-card .portrait { width: 120px; height: auto; min-height: 170px; flex: none; }
  .create-form { grid-template-columns: 1fr; }
  .earn-grid { grid-template-columns: repeat(2, 1fr); }
  .forge-cols, .class-pick, .offline-grid { grid-template-columns: minmax(0, 1fr); }
  .arena { height: 400px; }
  .arena-top { top: 8px; left: 8px; right: 8px; }
  .zone-plate { padding: 5px 10px; max-width: 58%; } .zone-plate b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  .potion-btn, .autopot { height: 46px; } .potion-btn { width: 46px; }
  .boss-timer { top: 62px; }
  .arena-hint { display: none; }
  .intel { left: 8px; right: 8px; bottom: 74px; max-width: none; padding: 6px 10px 6px 6px; }
  .intel .face { width: 38px; height: 38px; }
  .arena-actions { left: 8px; right: 8px; bottom: 8px; }
  .act-btn { flex: 1; min-width: 0; height: 56px; padding: 0 10px 0 6px; }
  .act-btn .ic { width: 38px; height: 38px; }
  .act-btn > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .zone-card { flex-basis: 190px; }
  .equip-row { grid-template-columns: repeat(4, 1fr) !important; }
  .coach { padding: 10px; gap: 10px; } .coach .ic { width: 36px; height: 36px; } .coach-text b { font-size: 13px; } .coach-text span { display: none; }
  .modal { padding: 18px; }
  .mnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; height: 62px; z-index: 40; background: rgba(16, 19, 24, .96); border-top: 1px solid var(--line); backdrop-filter: blur(10px); }
  .mnav button { position: relative; display: grid; place-items: center; align-content: center; gap: 2px; font-size: 10px; color: var(--muted); font-weight: 600; }
  .mnav button .ic { width: 26px; height: 26px; }
  .mnav button.active { color: var(--y); }
  .mnav .dot { top: 8px; right: calc(50% - 18px); }
  .toasts { bottom: 74px; }
}
/* ---------- ?cinema capture mode ---------- */
.cinema .topbar, .cinema .col-left, .cinema .col-right, .cinema .col-center > .panel, .cinema .footer, .cinema .mnav,
.cinema .arena-actions, .cinema .potion-widget, .cinema .zone-plate, .cinema .toasts, .cinema #modal, .cinema .intel { display: none !important; }
.cinema .layout { display: block; padding: 0; max-width: none; }
.cinema .col-center { display: block; }
.cinema .arena { position: fixed; inset: 0; height: 100vh !important; border: 0; border-radius: 0; z-index: 50; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
