/* Only two faces now: Cinzel for display (wordmark, section titles),
   Inter for everything UI. Drops Exo 2, Rajdhani, Cinzel Decorative,
   Share Tech Mono. Inter supports tabular-nums for stat tables. */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;900&family=Inter:wght@400;500;600;700;800&display=swap');

/* ════════════════════════════════════════════════════════
   DESIGN TOKENS — Modernized MIR4 (premium MMORPG companion)
   - Crimson-accent dark fantasy palette per design spec
   - 8/16/24/32/48 spacing rhythm
   - MIR4 grade/class/frame colors are preserved verbatim in NFTP_GRADE
     and component-level CSS — DO NOT recolor here
   ════════════════════════════════════════════════════════ */
:root {
  /* ── Surface (spec) ── */
  --void:       #0B0C0E;   /* page background */
  --bg:         #0B0C0E;
  --surface-0:  #0B0C0E;
  --surface-1:  #14171C;   /* primary surface (cards, sidebar) */
  --surface-2:  #1B1F26;   /* secondary surface (raised, hover plates) */
  --surface-3:  #232830;   /* interactive / hover row */
  --surface-4:  #2C323C;   /* active / selected */

  /* Back-compat aliases */
  --obsidian:   var(--surface-1);
  --steel:      var(--surface-1);
  --iron:       var(--surface-2);
  --charcoal:   var(--surface-3);
  --smoke:      var(--surface-4);

  /* ── Text (spec) ── all WCAG AA at body sizes ── */
  --text:        #F5F5F5;   /* primary */
  --text-strong: #FFFFFF;
  --text-muted:  #A7AFBC;   /* secondary — labels, captions */
  --text-dim:    #6B7280;   /* tertiary / disabled-look */
  --text-disabled:#4B5563;
  --text2:       var(--text-muted);
  --text3:       var(--text-dim);
  --text4:       var(--text-disabled);

  /* ── Primary accent (spec) — deep crimson ── */
  --accent:        #8B0000;
  --accent-hover:  #A00000;
  --accent-soft:   #5A0000;
  --crimson:       #8B0000;   /* alias to spec accent */
  --crimson2:      #A00000;

  /* ── MIR4 brand colors — DO NOT TOUCH ── */
  /* These are the in-game palette players already recognize and the JS
     NFTP_GRADE map mirrors them. Kept as supporting accents only. */
  --gold:        #C8963C;   /* gold rim / Cinzel highlights only */
  --gold-bright: #F0C060;
  --gold-soft:   #8A6B2A;
  --gold2:       var(--gold-bright);
  --gold3:       #FFE08A;
  --jade:        #00B894;
  --ember:       #FF6B35;
  --violet:      #8B5CF6;
  --violet2:     #A78BFA;
  --ice:         #7DD3FC;
  --red:         #FF3350;

  /* ── Borders ── */
  --border:      rgba(255,255,255,.06);   /* spec */
  --border-2:    rgba(255,255,255,.10);
  --border-3:    rgba(255,255,255,.16);
  --bdr:         var(--border);
  --bdr2:        var(--border-2);
  --bdr3:        var(--border-3);
  --bdr-red:     rgba(139,0,0,.38);
  --bdr-gold:    rgba(200,150,60,.45);

  /* ── Type scale — Cinzel display + Inter UI ── */
  --fs-xs:   11px;
  --fs-sm:   13px;
  --fs-base: 14px;
  --fs-md:   16px;
  --fs-lg:   18px;
  --fs-xl:   22px;
  --fs-2xl:  28px;
  --fs-3xl:  36px;
  --fs-4xl:  56px;

  /* ── Spacing — 8-point scale per spec (8/16/24/32/48) ── */
  --sp-1:   8px;
  --sp-2:  16px;
  --sp-3:  24px;
  --sp-4:  32px;
  --sp-5:  48px;
  --sp-6:  64px;
  --sp-7:  96px;
  /* Half-step for tight edges (chips, icons, dense rows) */
  --sp-h:   4px;

  /* ── Layout splits (still useful for hero) ── */
  --golden-min: 38.196%;
  --golden-max: 61.803%;

  /* ── Glows (subdued — premium not gaudy) ── */
  --glow-accent:  0 0 24px rgba(139,0,0,.32), 0 0 48px rgba(139,0,0,.12);
  --glow-crimson: var(--glow-accent);
  --glow-red:     0 0 14px rgba(139,0,0,.30);
  --glow-gold:    0 0 18px rgba(200,150,60,.22), 0 0 36px rgba(200,150,60,.07);
  --glow-gold-sm: 0 0 10px rgba(200,150,60,.18);
  --glow-jade:    0 0 18px rgba(0,184,148,.22);
  --glow-violet:  0 0 18px rgba(139,92,246,.26);

  --r:  4px;          /* subtle rounding now — premium card feel */
  --rl: 6px;
  --cut: 12px;
  --sidebar-w: 196px;   /* slimmed (was 228) — Phase 5 */

  /* ── Font stacks ── */
  --font-display: 'Cinzel', 'Times New Roman', serif;
  --font-ui:      'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-num:     'Inter', system-ui, sans-serif;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Body — clean dark plate, single subtle crimson glow up top ── */
body {
  background: var(--void);
  background-image:
    radial-gradient(ellipse 60% 35% at 50% -8%, rgba(139,0,0,.06) 0%, transparent 65%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: 1.55;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* All numbers (stats, counters, prices) get tabular figures so columns line up.
   Apply broadly via a utility-style rule — components inherit unless overridden. */
.nftp-quickstat-val, .nftp-stat-modal-value, .nftp-stat-sum-val,
.nftp-inv-stack, .nftp-inv-enh, .nftp-equip-slot-enh, .nftp-equip-slot-tier,
.nftp-diamond-val, .nftp-resource-val, .nftp-potential-cur, .nftp-potential-max,
.nftp-scripture-count, .nftp-codex-count, .nft-card-power, .ps-val,
.nftp-price-btn-val, .nftp-price-conv {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

/* Page reveal animation when switching nav */
.page.active {
  animation: pageReveal .28s ease;
}
@keyframes pageReveal {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Layout ─────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

/* ════════════════════════════════════════════════════════
   SIDEBAR  — more prominent, richer background
   ════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--steel) 0%, var(--obsidian) 100%);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
}
/* Rune border across top — crimson/gold/crimson gradient line */
.sidebar::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--crimson) 30%, var(--gold) 50%, var(--crimson) 70%, transparent 100%);
  box-shadow: 0 0 12px rgba(196,30,58,.5);
  z-index: 110;
  pointer-events: none;
}
/* Right edge gradient accent */
.sidebar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, var(--crimson), var(--gold) 50%, var(--crimson));
  opacity: .18;
}

/* Sidebar header */
.sidebar-header {
  padding: 22px 18px 18px;
  background: linear-gradient(135deg, rgba(200,168,76,.07) 0%, transparent 60%);
  border-bottom: 1px solid rgba(200,168,76,.12);
  position: relative;
}
.sidebar-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 18px;
  right: 18px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), rgba(200,168,76,.1));
  box-shadow: var(--glow-gold-sm);
}

.logo {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--gold2);
  text-shadow: 0 0 20px rgba(200,150,60,.40);
  text-transform: uppercase;
  line-height: 1.2;
}
.logo-sub {
  font-size: 9px;
  color: var(--text3);
  margin-top: 5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}
.logo-sub::before,
.logo-sub::after {
  content: '◆';
  font-size: 6px;
  color: var(--crimson);
}

/* ── Signup gate (full-page-area overlay for non-public pages) ── */
.signup-gate {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
  background: linear-gradient(180deg, rgba(11, 12, 14, .95), rgba(11, 12, 14, .98));
  backdrop-filter: blur(3px);
}
.signup-gate.open { display: flex; }
.signup-gate-card {
  width: min(520px, calc(100vw - 32px));
  background: var(--surface-1);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  padding: 26px 30px 22px;
  text-align: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .6);
}
.signup-gate-eyebrow {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 6px;
}
.signup-gate-title {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 22px;
  color: var(--gold2);
  text-shadow: 0 0 18px rgba(200, 150, 60, .35);
  margin-bottom: 12px;
  letter-spacing: .02em;
}
.signup-gate-sub {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.55;
  max-width: 420px;
  margin: 0 auto 18px;
}
.signup-gate-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.signup-gate-back {
  font-size: 12px;
  color: var(--text3);
}
.signup-gate-back a {
  color: var(--gold2);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: border-color .15s;
}
.signup-gate-back a:hover {
  border-bottom-color: rgba(212, 168, 73, .55);
}

/* When a page is gated, keep its background but hide its actual
   content from view so a stale render doesn't peek behind the
   overlay. .page.active still triggers display:block; this just
   nukes the visible content area to a clean dark surface. */
.page.page-gated > * { visibility: hidden; }
.page.page-gated::before {
  /* Reserve vertical space so the active-class layout doesn't collapse
     and surrounding chrome (sidebar, header) keeps its position. */
  content: '';
  display: block;
  min-height: 60vh;
}

/* Sidebar auth pill (Sign Up / Sign In / Hi, <user>) */
.auth-pill {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text3);
  letter-spacing: .04em;
  min-height: 14px;
}
.auth-pill-link {
  color: var(--gold2);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.auth-pill-link:hover {
  border-bottom-color: rgba(212, 168, 73, .55);
  color: var(--gold);
}
.auth-pill-link-strong { font-weight: 600; }
.auth-pill-sep { color: var(--text3); margin: 0 2px; opacity: .55; }
.auth-pill-greet strong { color: var(--gold2); font-weight: 600; }
.auth-pill-signed-in .auth-pill-greet { letter-spacing: .04em; }

/* Auth modal — sign up / sign in */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
}
.auth-modal.open { display: flex; }
.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(2px);
}
.auth-modal-body {
  position: relative;
  width: min(420px, calc(100vw - 28px));
  background: var(--surface-1);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  padding: 22px 26px 26px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
}
.auth-modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 4px 8px;
  transition: color .15s;
}
.auth-modal-close:hover { color: var(--crimson2); }
.auth-modal-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--bdr);
  margin-bottom: 18px;
}
.auth-modal-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 10px 18px;
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text3);
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.auth-modal-tab:hover { color: var(--text2); }
.auth-modal-tab.active {
  color: var(--gold2);
  border-bottom-color: var(--gold);
}
.auth-modal-panel { display: none; }
.auth-modal-panel.active { display: block; }
.auth-modal-notice {
  font-size: 12px;
  color: var(--text2);
  background: rgba(255, 255, 255, .025);
  border-left: 2px solid var(--gold);
  padding: 9px 12px;
  border-radius: 0 4px 4px 0;
  line-height: 1.55;
  margin-bottom: 16px;
}
.auth-modal-panel .input-group { margin-bottom: 12px; }
.auth-modal-error {
  font-size: 12px;
  color: #ff8080;
  background: rgba(196, 30, 58, .08);
  border: 1px solid var(--bdr-red, rgba(196, 30, 58, .35));
  border-radius: 4px;
  padding: 8px 10px;
  margin-bottom: 12px;
}
.auth-modal-panel button[type="submit"] {
  width: 100%;
  margin-top: 4px;
}

/* Sidebar search */
.search-wrap {
  padding: 12px 14px;
  border-bottom: 1px solid var(--bdr);
  background: rgba(0,0,0,.2);
}
.search-row { display: flex; gap: var(--sp-h); }
.search-row input {
  flex: 1;
  height: 34px;
  padding: 0 var(--sp-2);
  background: rgba(0,0,0,.35);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-size: var(--fs-sm);
  font-family: var(--font-ui);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(139,0,0,.22);
}
.search-row input::placeholder { color: var(--text-dim); }

.search-btn {
  width: 32px;
  height: 32px;
  background: var(--crimson);
  border: 1px solid rgba(196,30,58,.5);
  border-radius: 0;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow .15s;
}
.search-btn:hover { box-shadow: var(--glow-red); }

/* Nav */
.nav { flex: 1; padding: 8px 0 16px; overflow-y: auto; overflow-x: hidden; }
/* Truncate long nav labels so the favourite star stays visible (no h-scroll) */
.nav-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Section label — gold diamond + hairline accents */
.nav-label {
  pointer-events: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-3) var(--sp-1);
  font-family: var(--font-display);
  font-size: 10px;             /* up from 8px — was unreadable */
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);          /* lift to gold for proper hierarchy */
}
.nav-label::before {
  content: '';
  flex: 0 0 12px;
  height: 1px;
  background: var(--bdr3);
}
.nav-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--bdr), transparent);
}

/* Nav item — gold-tinted card with crimson rune accent when active */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin: 0 8px 1px;
  color: var(--text2);
  cursor: pointer;
  user-select: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: var(--r);
  transition: background .18s, color .18s, border-color .18s, box-shadow .18s;
  position: relative;
  white-space: nowrap;
}
.nav-item:hover {
  background: rgba(200,150,60,.05);
  color: var(--text);
  border-color: var(--bdr);
}
.nav-item.active {
  background: linear-gradient(135deg, rgba(196,30,58,.12) 0%, rgba(200,150,60,.08) 100%);
  color: var(--gold2);
  border-color: var(--bdr2);
  box-shadow: inset 0 0 20px rgba(200,150,60,.04);
}
/* Crimson/gold vertical glow bar on left of active nav item */
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 20%;
  height: 60%;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--gold2), transparent);
  box-shadow: 0 0 8px var(--gold);
  border-radius: 2px;
}
.nav-item.active .nav-icon {
  color: var(--crimson2);
  filter: drop-shadow(0 0 4px rgba(196,30,58,.6));
}

/* Icon — pointer-events off so clicks bubble to nav-item */
.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: .55;
  pointer-events: none;
  transition: opacity .15s;
}
.nav-item:hover  .nav-icon { opacity: .8; }
.nav-item.active .nav-icon {
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(232,192,96,.7));
}

/* Alert badge */
.nav-badge {
  margin-left: auto;
  background: var(--crimson);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 0;
  min-width: 18px;
  text-align: center;
  pointer-events: none;
  box-shadow: var(--glow-red);
}

/* ════════════════════════════════════════════════════════
   MAIN CONTENT
   ════════════════════════════════════════════════════════ */
.main { flex: 1; min-width: 0; padding: 0 28px 56px; }

.page { display: none; }
.page.active { display: block; }

/* Breadcrumb */
.topbar { padding: 14px 0 0; margin-bottom: 4px; }
.breadcrumb {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.breadcrumb span { color: var(--gold); font-weight: 600; }

/* Page header — rune underline crossing the full width */
.page-header {
  margin: var(--sp-2) 0 var(--sp-4);
  position: relative;
  padding-bottom: var(--sp-3);
}
.page-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--crimson) 0%, var(--gold) 30%, transparent 70%);
  opacity: .45;
}

.page-title {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-strong);
  line-height: 1.1;
  text-shadow: 0 0 30px rgba(212,163,86,.15);
}
.page-title-accent {
  color: var(--gold-bright);
  text-shadow: 0 0 24px rgba(212,163,86,.40);
}
.page-sub {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-top: var(--sp-2);
  letter-spacing: .04em;
}

/* ════════════════════════════════════════════════════════
   CARDS — angular with cut top-right corner + gold top edge
   ════════════════════════════════════════════════════════ */
.card {
  background: linear-gradient(135deg, var(--surface-1) 0%, var(--surface-2) 100%);
  border: 1px solid var(--bdr);
  border-radius: var(--rl);
  margin-bottom: var(--sp-3);
  position: relative;
  overflow: visible;
}

/* Centered gold gradient line across top */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: .35;
  z-index: 2;
  border-radius: var(--rl) var(--rl) 0 0;
  pointer-events: none;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--bdr);
  background: rgba(0,0,0,.22);
  gap: var(--sp-2);
  flex-wrap: wrap;
  position: relative;
  z-index: 0;
  border-radius: var(--rl) var(--rl) 0 0;
}

.card-title {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--gold-bright);
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* ── Inputs ──────────────────────────────────────────────── */
.input-group { display: flex; flex-direction: column; gap: var(--sp-1); }

/* Player Lookup autocomplete dropdown — anchored to the input via the
   .input-group's position:relative on the lookup card. Hidden until
   suggestions arrive; arrow-key nav highlights one row at a time. */
.lookup-suggest {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  margin-top: 4px;
  background: linear-gradient(180deg, var(--surface-2, #1B1F26) 0%, var(--surface-1, #14171C) 100%);
  border: 1px solid var(--bdr-gold, rgba(200, 150, 60, .45));
  border-radius: 8px;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, .65),
    0 0 16px rgba(212, 163, 86, .12);
  max-height: 320px;
  overflow-y: auto;
  display: none;
}
.lookup-suggest.open { display: block; }
.lookup-suggest::-webkit-scrollbar { width: 6px; }
.lookup-suggest::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .15);
  border-radius: 3px;
}
.lookup-suggest-item {
  padding: 9px 14px;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 13.5px;
  color: var(--text);
  border-left: 3px solid transparent;
  transition: background .12s, border-color .12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lookup-suggest-item:hover,
.lookup-suggest-item.active {
  background: rgba(255, 255, 255, .04);
  border-left-color: var(--accent, #8B0000);
}
.lookup-suggest-item mark {
  background: transparent;
  color: var(--gold);
  font-weight: 600;
}
.lookup-suggest-empty {
  padding: 16px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text-muted, #A7AFBC);
  text-align: center;
}

.input-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text3);
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="search"],
textarea, select {
  height: 38px;
  padding: 0 var(--sp-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-size: var(--fs-sm);
  font-family: var(--font-ui);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
  width: 100%;
}
textarea { height: auto; padding: var(--sp-1) var(--sp-2); resize: vertical; }
input:hover, textarea:hover, select:hover { border-color: var(--border-2); }
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139,0,0,.18);
  background: var(--surface-2);
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }

/* ── Buttons — gradient with crimson/gold accents ─────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  background: var(--iron);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  color: var(--text2);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.btn:hover {
  background: var(--charcoal);
  color: var(--text);
  border-color: var(--bdr2);
}

.btn-sm { height: 26px; padding: 0 10px; font-size: 10px; }

.btn-crimson {
  background: linear-gradient(135deg, rgba(196,30,58,.20), rgba(196,30,58,.08));
  color: #ff7b8a;
  border-color: rgba(196,30,58,.35);
}
.btn-crimson:hover {
  background: linear-gradient(135deg, rgba(196,30,58,.35), rgba(196,30,58,.15));
  box-shadow: var(--glow-crimson);
  color: #fff;
}

.btn-gold {
  background: linear-gradient(135deg, rgba(200,150,60,.15), rgba(200,150,60,.05));
  color: var(--gold2);
  border-color: var(--bdr2);
}
.btn-gold:hover {
  background: linear-gradient(135deg, rgba(200,150,60,.25), rgba(200,150,60,.10));
  box-shadow: var(--glow-gold);
}

/* ── Stats ───────────────────────────────────────────────── */
.stat-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 2px;
}
.stat-value {
  font-family: var(--font-num);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

/* ── WEMIX currency cards ─────────────────────────────────── */
.wx-ccy-card {
  margin-bottom: 0;
  padding: var(--sp-2) var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-h);
  transition: border-color .15s, background .15s;
}
.wx-ccy-card:hover {
  border-color: var(--bdr-gold);
  background: linear-gradient(135deg, var(--surface-1) 0%, var(--surface-2) 100%);
}
.wx-ccy-code {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.wx-ccy-val {
  font-family: var(--font-num);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--gold-bright);
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

/* ── Table — premium, scannable, sticky headers ───────────── */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}
.tbl th {
  padding: var(--sp-2) var(--sp-2);
  text-align: left;
  font-family: var(--font-ui);            /* spec: Inter Medium for tables */
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  position: sticky;                       /* sticky headers in scroll containers */
  top: 0;
  z-index: 1;
}
.tbl td {
  padding: var(--sp-2);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td {
  background: rgba(255,255,255,.025);
  color: var(--text-strong);
}
/* Numeric columns right-aligned, currency cells tabular */
.tbl th.num, .tbl td.num,
.tbl th:nth-child(n+2),
.tbl td:nth-child(n+2) {
  text-align: right;
}
/* First column always left-aligned (it's usually the label/name) */
.tbl th:first-child, .tbl td:first-child { text-align: left; }

/* ── Item Market grid ────────────────────────────────────────
   Compact tile grid for analysis4nft's market-details/search.
   Auto-fit columns at 160 px min so the layout reflows from
   ~5 columns on desktop down to 2 on mobile. Grade-colored
   frame around the icon mirrors MIR4's in-game item border. */
.im-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  padding: 18px;
}
.im-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255, 255, 255, .015);
  border: 1px solid var(--bdr, rgba(255, 255, 255, .06));
  border-radius: 8px;
  padding: 10px 10px 12px;
  transition: border-color .12s, background .12s;
}
.im-tile:hover {
  background: rgba(255, 255, 255, .035);
  border-color: var(--bdr2, rgba(200, 150, 60, .25));
}
/* Frame uses xdraco's actual grade-tinted backdrops (same ones the
   official MIR4 NFT detail uses):
       img-item-bg-common / uncommon / rare / epic / legendary .webp
   set via background-image per .im-grade-N class. --g-color / --g-glow
   stay as the source of truth for border + outer glow tint, so the
   overall language is consistent with the NFT inventory frames. */
.im-tile {
  --g-color: #cfcfcf;
  --g-glow:  rgba(207, 207, 207, .25);
}
.im-tile-img-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  background-color: #050810;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid var(--g-color);
  border-radius: 4px;
  box-shadow: 0 0 12px var(--g-glow), inset 0 0 14px rgba(0, 0, 0, .35);
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.im-tile:hover .im-tile-img-wrap {
  transform: translateY(-1px);
  box-shadow: 0 0 22px var(--g-glow), inset 0 0 14px rgba(0, 0, 0, .2);
}

/* Per-grade backdrops — xdraco's own art. Grade IDs:
       1 Common  2 Uncommon  3 Rare  4 Epic  5 Legendary  6 Mythic */
.im-grade-1 .im-tile-img-wrap { background-image: url('https://file.mir4global.com/xdraco/dist/img/common/nft-detail/img-item-bg-common.webp'); }
.im-grade-2 .im-tile-img-wrap { background-image: url('https://file.mir4global.com/xdraco/dist/img/common/nft-detail/img-item-bg-uncommon.webp'); }
.im-grade-3 .im-tile-img-wrap { background-image: url('https://file.mir4global.com/xdraco/dist/img/common/nft-detail/img-item-bg-rare.webp'); }
.im-grade-4 .im-tile-img-wrap { background-image: url('https://file.mir4global.com/xdraco/dist/img/common/nft-detail/img-item-bg-epic.webp'); }
.im-grade-5 .im-tile-img-wrap { background-image: url('https://file.mir4global.com/xdraco/dist/img/common/nft-detail/img-item-bg-legendary.webp'); }
.im-grade-6 .im-tile-img-wrap { background-image: url('https://file.mir4global.com/xdraco/dist/img/common/nft-detail/img-item-bg-mythic.webp'); }

/* Inner dark frame for depth (xdraco's art already has a soft vignette,
   so this is a single hairline rather than the heavier ::after the NFT
   inventory uses). */
.im-tile-img-wrap::after {
  content: '';
  position: absolute;
  inset: 2px;
  border: 1px solid rgba(0, 0, 0, .45);
  border-radius: 2px;
  pointer-events: none;
  z-index: 0;
}
.im-tile-img {
  position: absolute;
  inset: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  object-fit: contain;
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .7));
}
/* Sword-glyph fallback when image 404s / is blocked. Sits behind the
   <img> and hides only when the image successfully loads (.loaded). */
.im-tile-img-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: color-mix(in srgb, var(--g-color) 20%, rgba(255, 255, 255, .08));
  z-index: 0;
  pointer-events: none;
}
.im-tile-img-wrap.loaded .im-tile-img-fallback { display: none; }
.im-tile-tier {
  position: absolute;
  bottom: 4px;
  right: 4px;
  z-index: 2;
  background: rgba(0, 0, 0, .8);
  color: var(--g-color);
  font-family: var(--font-num);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: .04em;
  text-shadow: 0 0 4px var(--g-glow);
}

.im-tile-name {
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 32px;
}
.im-tile-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  color: var(--text3);
}
.im-tile-qty {
  font-family: var(--font-num);
  color: var(--text2);
}
.im-tile-price {
  font-family: var(--font-num);
  font-size: 15px;
  font-weight: 700;
  color: var(--gold, #c8963c);
  letter-spacing: .02em;
}
.im-tile-updated {
  font-size: 10px;
  color: var(--text3);
  text-align: right;
  font-family: var(--font-num);
}

/* ── Hidden Valley · clickable clan cell + clan-detail modal ─ */
.hv-clan-cell {
  cursor: pointer;
  transition: background .12s, box-shadow .12s;
}
.hv-clan-cell:hover {
  background: rgba(200, 150, 60, .06);
  box-shadow: inset 3px 0 0 var(--gold, #c8963c);
}

/* "NEW" pill — newly-captured valley or newly-taken castle. Shared
   between Castle Siege, Sabuk Clash, and Hidden Valley so all three
   tabs use one visual language. */
.bs-badge-new {
  background: rgba(0, 184, 148, .18);
  color: #00b894;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  margin-left: 6px;
  flex-shrink: 0;
}

/* Shared clan-cell layout — used by Hidden Valley, Castle Siege, and
   Sabuk Clash. Clan name is right-aligned inside a fixed-width slot;
   the NEW badge sits in its own fixed-width slot 8px to the right.
   Rows without NEW get an invisible same-width placeholder so every
   badge in the column lands at the same X position. Works with any
   script (English / CJK) because the alignment is geometric, not
   per-character.
       [...........clan name (right-aligned, 220px)] 8px [badge 50px]
*/
.clan-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.clan-name {
  width: 220px;
  text-align: right;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.clan-new-slot {
  width: 50px;
  margin-left: 8px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
}
/* The fixed-slot wrapper handles spacing, so the badge inside doesn't
   need its own left margin. */
.clan-new-slot .bs-badge-new {
  margin-left: 0;
}

/* When the same .clan-cell geometry is reused inside a <th> for the
   column header, keep the header's own typography (uppercase, letter-
   spacing, muted color). Only the right-aligned 220px-name + 50px-slot
   layout is shared, not the data-row font styling. */
th .clan-name {
  font-weight: inherit;
  color: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

/* Hidden Valley cell — the <td> itself still controls click → modal
   and vertical centering. Internal layout is the shared .clan-cell. */
.hv-clan-cell {
  vertical-align: middle;
}
.hv-empty-cell {
  vertical-align: middle;
}

.hv-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
}
.hv-modal.open { display: flex; }
.hv-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .78);
  backdrop-filter: blur(6px);
}
.hv-modal-body {
  position: relative;
  z-index: 1;
  width: min(440px, calc(100vw - 32px));
  background: linear-gradient(180deg, var(--surface-2, #1B1F26) 0%, var(--surface-1, #14171C) 100%);
  border: 1px solid var(--bdr-gold, rgba(200, 150, 60, .45));
  border-radius: 12px;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, .7),
    0 0 32px rgba(212, 163, 86, .22),
    inset 0 1px 0 rgba(255, 255, 255, .06);
  overflow: hidden;
}
.hv-modal-close {
  position: absolute;
  top: 10px; right: 10px;
  width: 32px; height: 32px;
  background: rgba(0, 0, 0, .45);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 50%;
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s;
}
.hv-modal-close:hover {
  background: rgba(139, 0, 0, .7);
  border-color: var(--accent-hover, #A00000);
}
.hv-modal-card { padding: 24px 28px 22px; }
.hv-modal-header {
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--bdr, rgba(255, 255, 255, .06));
}
.hv-modal-eyebrow {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold, #c8963c);
  margin-bottom: 6px;
}
.hv-modal-clan {
  font-family: var(--font-display, var(--font-ui));
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  word-break: break-word;
}
.hv-modal-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 18px;
  margin: 0;
}
.hv-modal-dl dt {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text3, #6B7280);
  align-self: center;
}
.hv-modal-dl dd {
  margin: 0;
  font-family: var(--font-num);
  font-size: 15px;
  color: var(--text);
  text-align: right;
}
.hv-modal-power {
  color: var(--gold, #c8963c);
  font-weight: 700;
}

/* ── Home Dashboard ────────────────────────────────────────── */
/* One-page landing for a user's home server. Tile grid is 3-col on
   wide screens, 2-col on tablet, 1-col on mobile. Each tile is a
   self-contained card with header + body + optional footer action.
   Per-tile failure is rendered as an empty-state inside the body so
   the rest of the dashboard keeps working. */
.home-picker {
  display: flex;
  justify-content: center;
  padding: 32px 12px;
}
.home-picker-card {
  background: var(--surface-1);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  padding: 24px;
  max-width: 560px;
  width: 100%;
}
.home-picker-title {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 22px;
  color: var(--text);
  margin-bottom: 8px;
}
.home-picker-sub {
  color: var(--text2);
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 18px;
}
.home-picker-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.home-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--surface-1);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  margin-bottom: 16px;
}
.home-header-left { display: flex; flex-direction: column; gap: 4px; }
.home-server { display: flex; align-items: center; gap: 8px; }
/* Character / server header glyph — line-art SVG sized to sit cleanly
   next to the name. Color matches the gold accent so the symbol carries
   the same visual weight as the wordmark. */
.home-server-glyph {
  color: var(--gold, #c8963c);
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.home-server-name {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 20px;
  color: var(--text);
  font-weight: 700;
}
.home-server-region { color: var(--text2); font-size: 14px; }
/* Claimed-characters strip — sits below the main character header.
   One chip per claimed character; the main one is highlighted gold
   with a star, alts can be clicked to promote. Each non-main chip
   has a × to remove the claim. Wraps to multiple lines on narrow
   screens; no horizontal scroll. */
.home-claimed-strip {
  background: var(--surface-1);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  padding: 10px 14px;
  margin-bottom: 14px;
}
.home-claimed-label {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 8px;
}
.home-claimed-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.home-claimed-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 10px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--bdr);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.home-claimed-chip:hover {
  color: var(--text);
  border-color: var(--bdr2, var(--bdr));
  background: rgba(255, 255, 255, .05);
}
/* "is-main" (not "main") — the bare class collides with the global
   .main layout column and inflates the chip. */
.home-claimed-chip.is-main {
  background: rgba(200, 150, 60, .1);
  border-color: rgba(200, 150, 60, .55);
  color: var(--gold2, #d4a849);
  cursor: default;
}
.home-claimed-chip.is-main:hover {
  background: rgba(200, 150, 60, .1);
}
.home-claimed-star {
  color: var(--gold, #c8963c);
  font-size: 11px;
  line-height: 1;
}
.home-claimed-name {
  font-weight: 600;
  letter-spacing: .01em;
}
.home-claimed-server {
  font-size: 10px;
  color: var(--text3);
  padding-left: 4px;
  border-left: 1px solid rgba(255, 255, 255, .08);
  margin-left: 4px;
}
.home-claimed-remove {
  background: transparent;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 0 0 4px;
  margin-left: 2px;
  transition: color .15s;
}
.home-claimed-remove:hover { color: var(--crimson2); }
.home-claimed-add {
  font-size: 12px;
  color: var(--gold2, #d4a849);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: border-color .15s;
  padding: 5px 8px;
  cursor: pointer;
}
.home-claimed-add:hover {
  border-bottom-color: rgba(212, 168, 73, .5);
}

/* Character-identity variant (shown after profile setup) — bigger name,
   subdued metadata line. Lives in the same .home-header so layout is
   stable whether the user has set up a profile or not. */
.home-character-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.home-character-name {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 22px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: .01em;
}
.home-character-meta {
  font-size: 13px;
  color: var(--text2);
  margin-top: 4px;
}
.home-character-meta strong { color: var(--text); font-weight: 600; }
.home-server-meta {
  font-size: 12px;
  color: var(--text3);
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}
.home-server-meta strong { color: var(--text); font-weight: 600; }
.home-link {
  color: var(--gold2, #d4a849);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: border-color .15s;
  cursor: pointer;
}
.home-link:hover { border-bottom-color: rgba(212, 168, 73, .5); }
.home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 1024px) {
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .home-grid { grid-template-columns: 1fr; }
}
.home-tile {
  background: var(--surface-1);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  min-height: 0;            /* was 200px — let tiles size to content (density) */
  overflow: hidden;
}
.home-tile-wide { grid-column: 1 / -1; }
.home-tile-header {
  padding: 9px 14px;
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text2);
  border-bottom: 1px solid var(--bdr);
  background: rgba(255, 255, 255, .015);
  display: flex;
  align-items: center;
  gap: 9px;
}
/* Tile category icon — matches the sidebar nav-icon convention. Sits
   slightly dimmer than the label so the wordmark reads first. */
.home-tile-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text3);
}
.home-tile-body {
  padding: 9px 14px 10px;
  flex: 1;
  font-size: 12.5px;
  color: var(--text);
}
.home-tile-action {
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px dashed var(--bdr);
  font-size: 11px;
  color: var(--text3);
  text-align: right;
}
.home-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .03);
}
.home-row:last-child { border-bottom: none; }
.home-row-label {
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text3);
  min-width: 100px;
  flex-shrink: 0;
  padding-top: 2px;
}
.home-row-value {
  text-align: right;
  flex: 1;
  font-weight: 500;
  word-break: break-word;
}
.home-row-meta {
  font-size: 11px;
  color: var(--text3);
  font-weight: 400;
}
.home-row-empty { color: var(--text3); font-style: italic; font-weight: 400; }
.home-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.home-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .03);
}
.home-list li:last-child { border-bottom: none; }
.home-list-compact li { padding: 3px 0; }
.home-list-main { flex: 1; min-width: 0; }
.home-list-name {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}
.home-list-sub {
  font-size: 11px;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-list-aside {
  font-family: var(--font-num);
  color: var(--gold, #c8963c);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
  flex-shrink: 0;
}
.home-rank {
  display: inline-block;
  min-width: 22px;
  text-align: right;
  color: var(--text3);
  font-family: var(--font-num);
  font-size: 12px;
  margin-right: 4px;
}
.home-wemix {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 4px 0;
}
.home-wemix-price {
  font-family: var(--font-num);
  font-size: 32px;
  color: var(--gold, #c8963c);
  font-weight: 700;
  letter-spacing: -.5px;
}
.home-wemix-change {
  font-family: var(--font-num);
  font-size: 14px;
}

/* ── My Checklist ───────────────────────────────────────────── */
/* Multi-character daily task tracker laid out as a pivoted matrix:
   characters down the rows (so adding alts grows the table downward,
   not sideways) and tasks across the columns. Character column is
   sticky-left so names stay visible when horizontal scrolling kicks
   in on narrow viewports. Right-most column shows per-character
   progress count + mini bar so completion is glanceable. */
/* Tab bar — Daily / Weekly Summon / Weekly Spawn. Reuses the player-
   lookup tab look so it's visually consistent across the app. */
.checklist-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--bdr);
  margin-bottom: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.checklist-tabs::-webkit-scrollbar { display: none; }
.checklist-tab {
  padding: 11px 18px;
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
}
.checklist-tab:hover { color: var(--text2); }
.checklist-tab.active {
  color: var(--gold2, #d4a849);
  border-bottom-color: var(--gold);
  text-shadow: 0 0 8px rgba(200, 150, 60, .25);
}
.checklist-tab-instructions {
  font-size: 12px;
  color: var(--text3);
  padding: 0 4px 14px;
  line-height: 1.5;
}
.checklist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 11px 16px;
  background: var(--surface-1);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  margin-bottom: 14px;
}
.checklist-meta {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text3);
  letter-spacing: .02em;
}
.checklist-meta #checklist-countdown {
  color: var(--gold2, #d4a849);
  font-weight: 600;
}
.checklist-table-wrap {
  background: var(--surface-1);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  overflow-x: auto;
}
.checklist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.checklist-table th,
.checklist-table td {
  border-bottom: 1px solid var(--bdr);
  vertical-align: middle;
}
.checklist-table tbody tr:last-child td {
  border-bottom: none;
}
.checklist-table thead {
  background: rgba(255, 255, 255, .025);
}
/* Character column (sticky-left in both header and body) */
.checklist-th-char-col,
.checklist-td-char {
  position: sticky;
  left: 0;
  z-index: 2;
  text-align: left;
  min-width: 180px;
  padding: 10px 14px;
}
.checklist-th-char-col {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
  background: rgba(20, 23, 28, .99);
}
.checklist-td-char {
  background: var(--surface-1);
}
.checklist-td-char-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.checklist-td-char-info {
  min-width: 0;
}
.checklist-td-char-name {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 14px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: .01em;
  word-break: break-word;
}
.checklist-td-char-meta {
  font-size: 10px;
  color: var(--text3);
  margin-top: 2px;
}
.checklist-remove {
  background: transparent;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 3px;
  transition: color .15s, background .15s;
  flex-shrink: 0;
}
.checklist-remove:hover {
  color: var(--crimson2);
  background: rgba(220, 75, 75, .08);
}
/* Task column headers — compact short labels, full name in tooltip */
.checklist-th-task {
  text-align: center;
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--text2);
  font-weight: 600;
  padding: 10px 6px;
  min-width: 56px;
  cursor: help;
}
/* Body cells — each is a clickable checkbox target */
.checklist-td-cell {
  text-align: center;
  cursor: pointer;
  transition: background .12s;
  user-select: none;
  padding: 8px 6px;
  min-width: 56px;
}
.checklist-td-cell:hover {
  background: rgba(255, 255, 255, .035);
}
.checklist-td-cell:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: -2px;
}
.checklist-td-cell.done {
  background: rgba(200, 150, 60, .07);
}
.checklist-td-cell.done:hover {
  background: rgba(200, 150, 60, .12);
}
.checklist-td-cell .checklist-checkbox {
  display: inline-flex;
  width: 20px;
  height: 20px;
  border: 1px solid var(--bdr2, var(--bdr));
  border-radius: 3px;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  transition: background .15s, border-color .15s;
}
.checklist-td-cell.done .checklist-checkbox {
  background: var(--gold);
  border-color: var(--gold);
  color: #0d1220;
}
/* Per-character progress column (rightmost) */
.checklist-th-progress {
  text-align: center;
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 10px 14px;
  min-width: 110px;
}
.checklist-td-progress {
  text-align: center;
  vertical-align: middle;
  padding: 10px 14px;
  min-width: 110px;
  background: rgba(255, 255, 255, .015);
}
.checklist-tf-count {
  font-family: var(--font-num);
  font-size: 15px;
  color: var(--gold2, #d4a849);
  font-weight: 700;
  margin-bottom: 4px;
}
.checklist-progress-of {
  color: var(--text3);
  font-weight: 400;
  font-size: 12px;
}
.checklist-tf-bar {
  height: 3px;
  background: rgba(255, 255, 255, .05);
  border-radius: 2px;
  overflow: hidden;
  width: 80%;
  margin: 0 auto;
}
.checklist-tf-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold2, #d4a849) 100%);
  transition: width .25s;
}

/* ── Weekly tabs (bosses-as-rows × characters-as-cols) ──────────
   Reuses .checklist-td-cell / .checklist-checkbox / .checklist-td-progress
   from the daily layout. Boss column is sticky-left so labels stay
   visible while horizontally scrolling on narrow screens. */
.checklist-th-boss,
.checklist-td-boss {
  position: sticky;
  left: 0;
  z-index: 2;
  text-align: left;
  min-width: 240px;
  padding: 10px 14px;
}
.checklist-th-boss {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
  background: rgba(20, 23, 28, .99);
}
.checklist-td-boss {
  background: var(--surface-1);
}
.checklist-boss-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.checklist-boss-info {
  min-width: 0;
  flex: 1;
}
.checklist-boss-label {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 13px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: .01em;
  word-break: break-word;
}
.checklist-boss-meta {
  font-size: 10px;
  color: var(--text3);
  margin-top: 2px;
}
/* Bell indicator — dim dot when no alert, gold + glow when alert is
   subscribed. The whole row gets a subtle tint too so subscribed
   bosses are visible at a glance even from across the table. */
.checklist-bell {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text3);
  flex-shrink: 0;
  margin-top: 1px;
}
.checklist-bell.on {
  color: var(--gold2, #d4a849);
  filter: drop-shadow(0 0 4px rgba(200, 150, 60, .35));
}
.checklist-tr-alert .checklist-td-boss {
  background: linear-gradient(90deg, rgba(200, 150, 60, .08), var(--surface-1) 60%);
}
.checklist-tr-alert .checklist-boss-label {
  color: var(--gold2, #d4a849);
}
/* Paused state — same alert is on, but the user checked it off this
   week. Slight strike-through cue so it's distinguishable from a
   plain alert row. */
.checklist-tr-paused .checklist-boss-label {
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, .25);
  color: var(--text3);
}
.checklist-tr-paused .checklist-bell.on {
  color: var(--text3);
  filter: none;
  opacity: 0.55;
}

/* Favorite-star button — used on both the Boss Schedule rows and the
   My Checklist weekly rows. Off state is a hollow dim star; on state
   is a filled gold star with a soft glow. Persisted under one shared
   localStorage key so favouriting on either page lights up the
   matching row everywhere. */
.fav-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px 5px;
  margin: 0 1px;
  color: rgba(255, 255, 255, .2);
  transition: color .15s, transform .12s, text-shadow .15s;
  vertical-align: middle;
}
.fav-btn:hover {
  color: rgba(255, 215, 0, .75);
  transform: scale(1.18);
}
.fav-btn.on {
  color: #ffd700;
  text-shadow: 0 0 5px rgba(255, 215, 0, .55);
}
.fav-btn.on:hover { color: #ffe23a; }

/* When the checklist row has its alert struck-through (paused), keep
   the star muted but still distinguishable so users can find their
   pinned favourites at a glance. */
.checklist-tr-paused .fav-btn.on {
  color: rgba(255, 215, 0, .55);
  text-shadow: none;
}

/* Character columns in the weekly tab (vs daily tab's task columns).
   Wider so name+server fit; remove button anchored top-right. */
.checklist-th-week-char {
  position: relative;
  text-align: center;
  min-width: 110px;
  padding: 12px 10px 10px;
}
.checklist-th-week-char .checklist-remove {
  position: absolute;
  top: 3px;
  right: 5px;
}

/* ── Sort bar above the weekly tables ─────────────────────────── */
.checklist-sort-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 0 4px;
}
.checklist-sort-label {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
}
.checklist-sort-select {
  background: var(--surface-2);
  border: 1px solid var(--bdr);
  color: var(--text);
  padding: 4px 8px;
  border-radius: 4px;
  font-family: var(--font-ui);
  font-size: 12px;
  cursor: pointer;
}
.checklist-sort-select:hover { border-color: var(--bdr2, var(--bdr)); }
/* Inline sort control — sits in the checklist header row (one line with
   the reset/characters meta and the Add/Clear buttons). */
.checklist-sort-inline { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

/* Uniform-sized action controls (sort select + Add + Clear): same width
   and height, never wrap their text. */
.checklist-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.checklist-actions .checklist-sort-select,
.checklist-actions .btn {
  width: 156px; height: 30px; box-sizing: border-box;
  white-space: nowrap; flex: 0 0 auto;
}
.checklist-actions .btn { justify-content: center; }

/* ── World-group section headers ──────────────────────────────── */
.checklist-world-header-row {
  background: rgba(255, 255, 255, .02);
}
.checklist-world-header {
  position: sticky;
  left: 0;
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text);
  padding: 10px 14px;
  border-left: 3px solid var(--world-tint, var(--bdr));
  border-bottom: 1px solid var(--bdr) !important;
  background: linear-gradient(90deg, color-mix(in srgb, var(--world-tint, transparent) 16%, transparent), transparent 60%);
}
.checklist-world-header-count {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: none;
  color: var(--text3);
  font-weight: 400;
  margin-left: 10px;
}

/* Per-world tint variables. Each .world-wN row picks up its color
   automatically via --world-tint; the boss column gets a 3px left
   stripe, and the section header gets a fading gradient bg.
   Colors chosen to be readable on the dark theme and distinct from
   each other when stacked vertically. */
.world-w1 { --world-tint: #d65555; }   /* crimson */
.world-w2 { --world-tint: #e0883a; }   /* orange */
.world-w3 { --world-tint: #d4b048; }   /* gold */
.world-w4 { --world-tint: #6cc24b; }   /* lime */
.world-w5 { --world-tint: #34c0a0; }   /* teal */
.world-w6 { --world-tint: #4a9dd8; }   /* blue */
.world-w7 { --world-tint: #9c6ed4; }   /* violet */
.world-w8 { --world-tint: #d266a8; }   /* magenta */
.world-wother { --world-tint: #707888; }

/* Each boss row in a world gets a colored left stripe on its boss
   cell. Stripe stays visible even during horizontal scroll thanks
   to the sticky positioning of .checklist-td-boss. */
.checklist-table tbody tr[class*="world-"] .checklist-td-boss {
  border-left: 3px solid var(--world-tint, transparent);
}
.checklist-empty {
  text-align: center;
  padding: 60px 20px;
  background: var(--surface-1);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
}
.checklist-empty-title {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 18px;
  color: var(--text);
  margin-bottom: 8px;
}
.checklist-empty-sub {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 20px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.55;
}

/* ── My Profile ─────────────────────────────────────────────── */
/* A single localStorage-backed "who am I in MIR4" card. Setup flow
   reuses the existing .lookup-suggest dropdown styles for character
   autocomplete; view + confirm flows use a definition list to lay
   out the auto-filled fields. */
.profile-card {
  background: var(--surface-1);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  padding: 22px 24px;
  max-width: 680px;
}
.profile-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--bdr);
}
.profile-eyebrow {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 6px;
}
.profile-name {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 24px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: .01em;
}
.profile-meta {
  font-size: 13px;
  color: var(--text2);
  margin-top: 4px;
}
.profile-sub {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.55;
  margin-top: 6px;
}
.profile-dl {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 6px 14px;
  margin: 0 0 14px;
}
.profile-dl dt {
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text3);
  padding-top: 6px;
}
.profile-dl dd {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  padding-top: 4px;
}
.profile-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 8px;
}
.profile-seed-note {
  margin-top: 14px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text3);
  background: rgba(255, 255, 255, .02);
  border-left: 2px solid var(--bdr);
  border-radius: 0 4px 4px 0;
  line-height: 1.55;
}
.profile-seed-note strong { color: var(--text2); font-weight: 600; }
.profile-tz-select {
  background: var(--surface-2);
  border: 1px solid var(--bdr);
  color: var(--text);
  padding: 4px 8px;
  border-radius: 4px;
  font-family: var(--font-ui);
  font-size: 13px;
  cursor: pointer;
}
.profile-confirm {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--bdr);
}

/* ── Clan roster modal (Clan Rankings) ─────────────────────── */
/* Clan name in the rankings table doubles as a click target — it pulls
   open a modal listing members visible in the matching server's player
   ranking. The link styling stays subtle to avoid out-shouting the rest
   of the table. */
.cr-clan-link {
  cursor: pointer;
  color: var(--text);
  border-bottom: 1px dashed transparent;
  transition: color .15s, border-color .15s;
}
.cr-clan-link:hover {
  color: var(--gold);
  border-bottom-color: rgba(200, 150, 60, .4);
}
.cr-roster-section {
  border-top: 1px solid var(--bdr);
  padding-top: 14px;
  margin-top: 8px;
}
.cr-roster-title {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 8px;
}
.cr-roster-meta {
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 8px;
}
.cr-roster-scroll {
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--bdr);
  border-radius: 6px;
}
.cr-roster-tbl {
  margin: 0;
  border: none;
}
.cr-roster-tbl th {
  position: sticky;
  top: 0;
  background: var(--bg-2, #1a1816);
  z-index: 1;
}
.cr-roster-tbl td {
  padding: 6px 10px;
  font-size: 13px;
}
.cr-roster-name {
  cursor: pointer;
  color: var(--gold2, #d4a849);
}
.cr-roster-name:hover {
  text-decoration: underline;
}
.cr-roster-note {
  margin-top: 10px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text3);
  background: rgba(255, 255, 255, .02);
  border-left: 2px solid var(--bdr);
  border-radius: 0 4px 4px 0;
}

/* ── War tab meta header (last-updated + refresh) ────────── */
.war-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, .02);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  font-size: 12px;
  color: var(--text3);
}
.war-meta-fresh { color: var(--gold); }
.war-meta-stale { color: var(--text2); }
.war-meta-refresh {
  background: transparent;
  border: 1px solid var(--bdr2);
  color: var(--text2);
  padding: 4px 12px;
  border-radius: var(--r);
  font-size: 12px;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.war-meta-refresh:hover { border-color: var(--gold); color: var(--gold); }
.war-meta-refresh:disabled { opacity: .5; cursor: wait; }

/* ── Tabs ────────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 1px solid var(--bdr); }

.tab {
  padding: 10px 20px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .15s;
}
.tab:hover { color: var(--text2); }
.tab.active { color: var(--gold2); border-bottom-color: var(--gold); text-shadow: var(--glow-gold-sm); }

/* ── States ──────────────────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 40px 20px;
  color: var(--text3);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  justify-content: center;
}
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 52px 20px;
  color: var(--text3);
  font-size: 11px;
  letter-spacing: .06em;
  text-align: center;
}
.empty svg { width: 32px; height: 32px; opacity: .22; }

@keyframes spin { to { transform: rotate(360deg); } }
.spin { display: inline-block; animation: spin .75s linear infinite; }

/* ── Filter pills — generous breathing room, MMORPG-style ─── */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 28px;
  padding: 0 10px;
  background: rgba(200,150,60,.04);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  color: var(--text2);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  transition: all .18s;
  white-space: nowrap;
}
.pill:hover {
  border-color: var(--bdr2);
  color: var(--text);
  background: rgba(200,150,60,.08);
}
.pill.active {
  background: linear-gradient(135deg, rgba(196,30,58,.12), rgba(200,150,60,.12));
  border-color: var(--gold);
  color: var(--gold2);
  box-shadow: var(--glow-gold-sm), inset 0 0 14px rgba(200,150,60,.04);
}

/* ── Filter pill grid — auto-fit uniform columns with breathing room */
.pill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.pill-grid .pill {
  min-width: 0;          /* let grid control the width */
  width: 100%;
}

/* Section divider between filter groups */
.filter-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--bdr2) 20%, var(--bdr2) 80%, transparent);
  margin: 2px 0 10px;
  opacity: .65;
}

/* ── Server groups — labeled sections with proper spacing ─── */
.server-group-label {
  display: block;
  margin: 16px 0 8px;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: .70;
  border-bottom: 1px solid var(--bdr);
  padding-bottom: 5px;
}
.server-group-label:first-child { margin-top: 4px; }

.server-group-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

/* ── NFT filter checkboxes ───────────────────────────────── */
.nft-chk-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  cursor: pointer;
  font-size: 11px;
  letter-spacing: .03em;
  color: var(--text2);
  user-select: none;
  transition: color .12s;
}
.nft-chk-row:hover { color: var(--text); }
.nft-chk-row input[type="checkbox"] {
  width: auto; height: auto; padding: 0;
  accent-color: var(--gold);
  cursor: pointer;
}

/* ── Player card ─────────────────────────────────────────── */
.player-hero {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 20px;
  flex-wrap: wrap;
}
.player-badge {
  width: 56px;
  height: 56px;
  background: rgba(200,168,76,.08);
  border: 1px solid var(--bdr-gold);
  box-shadow: var(--glow-gold-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--gold2);
  flex-shrink: 0;
}
.player-meta h2 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--gold2);
  letter-spacing: .06em;
}
.player-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 9px;
  border-radius: 0;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.tag-class  { background: rgba(0,168,130,.1);  color: var(--jade);  border: 1px solid rgba(0,168,130,.3); }
.tag-server { background: rgba(200,168,76,.08); color: var(--gold);  border: 1px solid var(--bdr2); }
.tag-rank   { background: rgba(196,30,58,.1);   color: #ff8080;      border: 1px solid var(--bdr-red); }

/* ── NFT Market header (Characters count + Sort on right) ─── */
.nft-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.nft-count-label {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .04em;
}
.nft-count-label span {
  color: var(--gold2);
  margin-left: 4px;
  font-family: var(--font-num);
  font-size: 17px;
}

/* Sort button on the right */
.nft-sort-wrap { position: relative; }
.nft-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 4px;
  transition: background .15s;
}
.nft-sort-btn:hover { background: rgba(200,168,76,.08); }
.nft-sort-btn svg { color: var(--text2); }

/* ── Filter row (dropdown buttons) ─────────────────────────── */
.nft-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.nft-dd {
  position: relative;
  min-width: 160px;
  flex: 1;
  max-width: 260px;
}
.nft-dd-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 42px;
  padding: 0 16px;
  background: var(--iron);
  border: 1px solid var(--bdr2);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s;
}
.nft-dd-btn:hover  { border-color: var(--bdr-gold); }
[data-dd].open .nft-dd-btn {
  border-color: var(--gold);
  box-shadow: var(--glow-gold-sm);
}
.nft-dd-btn svg {
  color: var(--text2);
  transition: transform .2s;
  flex-shrink: 0;
}
[data-dd].open .nft-dd-btn svg { transform: rotate(180deg); }
.nft-dd-value { color: var(--gold2); font-weight: 600; margin-left: 4px; }

/* Dropdown panel — hidden by default, shown when parent has .open
   Uses [data-dd] attribute selector so it works for both .nft-dd and .nft-sort-wrap */
.nft-dd-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 220px;
  z-index: 50;
  background: var(--steel);
  border: 1px solid var(--bdr-gold);
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,.6), var(--glow-gold-sm);
  display: none;
  overflow: hidden;
}
[data-dd].open .nft-dd-panel { display: block; }
.nft-sort-panel {
  left: auto;
  right: 0;
  min-width: 180px;
}
.nft-dd-opt {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
  transition: background .12s, color .12s;
  font-family: var(--font-ui);
}
.nft-dd-opt:hover { background: rgba(200,168,76,.10); color: var(--gold2); }

/* Refresh icon button (compact, fits at end of filter row) */
.nft-refresh-btn-icon {
  width: 42px;
  height: 42px;
  background: var(--crimson);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}
.nft-refresh-btn-icon:hover { background: #d62a44; }

/* Filter bar (keep old class for backward compat — unused now) */
.nft-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 16px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--steel);
  border: 1px solid var(--bdr);
  border-radius: 8px;
}
.nft-filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.nft-filter-label {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--text3);
  text-transform: uppercase;
  display: flex;
  align-items: center;
}
.nft-filter-select {
  height: 30px;
  padding: 0 10px;
  background: var(--bg);
  border: 1px solid var(--bdr);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  font-family: var(--font-ui);
  outline: none;
  cursor: pointer;
}
.nft-filter-select:focus { border-color: var(--gold); }
.nft-filter-divider {
  width: 1px;
  align-self: stretch;
  background: var(--bdr);
  margin: 4px 2px;
}
.nft-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
/* Compact pill-style checkbox — clickable label hides native checkbox */
.nft-pill-chk {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  background: rgba(200, 168, 76, .04);
  border: 1px solid var(--bdr);
  border-radius: 999px;
  font-size: 11px;
  color: var(--text2);
  cursor: pointer;
  user-select: none;
  transition: all .12s;
  font-family: var(--font-ui);
}
.nft-pill-chk input { display: none; }
.nft-pill-chk:hover {
  background: rgba(200, 168, 76, .08);
  color: var(--text);
  border-color: var(--bdr2);
}
.nft-pill-chk:has(input:checked) {
  background: rgba(200, 168, 76, .15);
  border-color: var(--gold);
  color: var(--gold2);
  box-shadow: var(--glow-gold-sm);
}
.nft-pill-chk .nft-st-count {
  font-size: 9px;
  color: var(--text3);
  font-family: var(--font-num);
  font-weight: 700;
}
.nft-pill-chk:has(input:checked) .nft-st-count { color: var(--gold); }
.nft-filter-range {
  display: flex;
  align-items: center;
  gap: 5px;
}
.nft-filter-range input {
  width: 70px;
  height: 30px;
  padding: 0 8px;
  background: var(--bg);
  border: 1px solid var(--bdr);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  font-family: var(--font-ui);
  outline: none;
}
.nft-filter-range input:focus { border-color: var(--gold); }
.nft-filter-range span { color: var(--text3); font-size: 11px; }
.nft-refresh-btn {
  margin-left: auto;
  height: 30px;
  padding: 0 16px;
  background: var(--crimson);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  font-family: var(--font-display);
  text-transform: uppercase;
  align-self: flex-end;
}
.nft-refresh-btn:hover { background: #d62a44; }

/* ── NFT cards ───────────────────────────────────────────── */
.nft-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);   /* Always 5 cards per row, scale to fit */
  gap: 14px;
}
.nft-card {
  --grade-color: #c8a04a;
  --grade-glow:  rgba(200,168,76,.25);
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, filter .18s ease;
}
/* Subtle lift on hover — pulls the player into the card without
   adding garish glow. Brightens the embedded grade colors slightly. */
.nft-card:hover {
  transform: translateY(-2px);
  filter: brightness(1.06) saturate(1.05);
}

/* Image area — uses xdraco's sp-card.webp sprite frame as backdrop.
   Sprite is 1200×2064 (5 cols × 6 rows of 240×344 cells per xdraco's CSS).
   container-type: size lets us use cqh/cqi units for font sizes that scale with the card. */
.nft-card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 240 / 344;
  overflow: hidden;
  background-image: url('https://file.mir4global.com/xdraco/dist/img/common/card/sp-card.webp');
  background-size: 500% 600%;
  background-repeat: no-repeat;
  background-color: #050810;
  container-type: size;
}
/* Front-layer column = col 1 of 5 (x=25%). Grade rows from top (row 0) to bottom (row 5). */
.nft-grade-mythic    .nft-card-img-wrap { background-position: 25%   0%; }
.nft-grade-legendary .nft-card-img-wrap { background-position: 25%  20%; }
.nft-grade-epic      .nft-card-img-wrap { background-position: 25%  40%; }
.nft-grade-rare      .nft-card-img-wrap { background-position: 25%  60%; }
.nft-grade-uncommon  .nft-card-img-wrap { background-position: 25%  80%; }

/* Class icon overlay — xdraco exact: 32×32 at (top 21, left 19) within 240×344 frame */
.nft-class-icon {
  position: absolute;
  top: 6.1%;         /* 21/344 */
  left: 7.92%;       /* 19/240 */
  width: 13.33%;     /* 32/240 */
  aspect-ratio: 1;   /* keep square */
  z-index: 3;
  background-image: url('https://file.mir4global.com/xdraco/dist/img/common/card/sp-class.webp');
  background-size: 100% 700%;
  background-repeat: no-repeat;
  pointer-events: none;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.6));
}
/* Per-class row offsets (0/6=0%, 1/6=16.67%, 2/6=33.33%, etc.)
   Order in sprite (top→bottom, per xdraco anchor: Arbalist at row 0): */
.nft-class-icon.arbalist  { background-position: 0    0%; }      /* row 0 */
.nft-class-icon.lancer    { background-position: 0   16.67%; }   /* row 1 */
.nft-class-icon.darkist   { background-position: 0   33.33%; }   /* row 2 */
.nft-class-icon.taoist    { background-position: 0   50%; }      /* row 3 */
.nft-class-icon.warrior   { background-position: 0   66.67%; }   /* row 4 */
.nft-class-icon.sorcerer  { background-position: 0   83.33%; }   /* row 5 */
.nft-class-icon.lionheart { background-position: 0  100%; }      /* row 6 */
.nft-card-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(-55deg, rgba(200,168,76,.02) 0, rgba(200,168,76,.02) 1px, transparent 0, transparent 8px),
    linear-gradient(to bottom, transparent 55%, rgba(0,0,0,.55) 100%);
  pointer-events: none;
}
/* Character art — xdraco exact: 164x177 at (top 17, left 38) within 240×344 frame */
.nft-card img {
  position: absolute;
  top: 4.94%;        /* 17/344 */
  left: 15.83%;      /* 38/240 */
  width: 68.33%;     /* 164/240 */
  height: 51.45%;    /* 177/344 */
  object-fit: contain;
  display: block;
  z-index: 2;
  padding: 0;
}

/* Tradeable Epic+ pill — left edge, just below the class icon. */
.nft-card-trade-badge {
  position: absolute;
  top: 19%;
  left: 6%;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-num);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  color: #2a1d05;
  background: #e8b765;
  border: 1px solid #f6d99b;
  border-radius: 6px;
  padding: 2px 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,.6);
}
.nft-card-trade-badge .nftp-trade-ico {
  width: 13px;
  height: 13px;
  vertical-align: -2px;
}

/* "Tradable Epic+" filter toggle in the NFT Market filter row. */
.nft-trade-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--text2, #9aa3bd);
  border: 1px solid var(--line, #2a3350);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.nft-trade-toggle:hover {
  border-color: rgba(232,183,101,.5);
  color: #e7e9f0;
}
.nft-trade-toggle .nft-trade-toggle-t {
  font-size: 15px;
  line-height: 0;
  color: #e8b765;
}
.nft-trade-toggle.active {
  background: rgba(232,183,101,.14);
  border-color: #e8b765;
  color: #f6d676;
}
.nft-trade-toggle.active .nft-trade-toggle-t { color: #f6d676; }

/* Floating badges on image */
/* Level — now lives in the body subtitle (next to class), not on the image */
/* Status text + NFT ID — small subtle overlay, top-right of character */
.nft-card-bottom-left {
  position: absolute;
  right: 8%;
  top: 7%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  text-align: right;
}
.nft-card-status-text {
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow: 0 0 6px rgba(0,0,0,.95), 0 2px 4px rgba(0,0,0,.85);
}
.nft-card-id-text {
  font-family: var(--font-num);
  font-size: 8px;
  color: rgba(255,255,255,.78);
  text-shadow: 0 0 4px rgba(0,0,0,.95);
}
/* +0 enhancement — xdraco exact: 24px white bold at (top 133, left 175) within 240×344 frame */
.nft-card-enhance-badge {
  position: absolute;
  top: 38.66%;       /* 133/344 */
  left: 72.92%;      /* 175/240 */
  z-index: 3;
  color: #FFFFFF;
  font-family: var(--font-num);
  font-size: 6.97cqh;   /* 24/344 of card height */
  font-weight: 700;
  line-height: 1;
  text-shadow:
    0 0 8px rgba(0,0,0,.9),
    0 2px 4px rgba(0,0,0,.85);
  pointer-events: none;
}

/* Text overlays — exact xdraco blueprint coordinates within the 240×344 frame.
   All font sizes use cqh (1cqh = 1% of card height) to scale with the card. */

/* Character Name — xdraco exact: 17px black bold centered at top 206/344 = 59.88% */
.nft-card-name {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 59.88%;          /* 206/344 */
  z-index: 3;
  font-family: var(--font-display);
  font-size: 4.94cqh;   /* 17/344 */
  color: #000000;
  font-weight: 700;
  letter-spacing: .02em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
}
/* Class Name Text — xdraco exact: 13px gray 50% centered at top 227/344 = 65.99% */
.nft-card-class-sub {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 65.99%;          /* 227/344 */
  z-index: 3;
  font-family: var(--font-display);
  font-size: 3.78cqh;   /* 13/344 */
  color: rgba(0, 0, 0, 0.5);
  letter-spacing: .12em;
  text-transform: uppercase;
  text-align: center;
  font-weight: 400;
  line-height: 1;
}
/* Power Score — xdraco exact: 24px black bold at top 257/344 = 74.71% */
.nft-card-ps-value {
  position: absolute;
  left: 0;
  right: 0;
  top: 74.71%;          /* 257/344 */
  z-index: 3;
  font-family: var(--font-num);
  font-size: 6.97cqh;   /* 24/344 */
  font-weight: 700;
  line-height: 1;
  text-align: center;
  color: #000000;
}
/* Price band — distinct dark pill with WEMIX icon on the left */
.nft-card-price-band {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 83%;
  height: 8.5cqh;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3cqh;
  padding: 0 4cqh;
  background: linear-gradient(135deg, #1a0f24 0%, #2a1340 50%, #1a0f24 100%);
  border: 1px solid rgba(199, 64, 168, 0.45);
  border-radius: 999px;
  box-shadow:
    0 0 12px rgba(199, 64, 168, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
/* WEMIX icon — sits to the left of the price.
   Use img.wemix-icon selector to outrank the generic ".nft-card img" rule */
img.wemix-icon {
  position: static;
  flex-shrink: 0;
  height: 7cqh;
  width: 7cqh;
  top: auto;
  left: auto;
  padding: 0;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 6px rgba(255, 79, 180, 0.6));
}
.nft-card-price-amount {
  font-family: var(--font-num);
  font-size: 5.2cqh;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
  letter-spacing: .02em;
  white-space: nowrap;
}
/* PHP conversion — sits just below the WEMIX pill, semi-transparent black matching class subtitle */
.nft-card-price-php {
  position: absolute;
  left: 0;
  right: 0;
  top: 92.5%;
  z-index: 3;
  font-family: var(--font-num);
  font-size: 3.6cqh;
  color: rgba(0, 0, 0, 0.5);
  text-align: center;
  font-weight: 600;
  letter-spacing: .02em;
}

/* ── Boss timer cards ────────────────────────────────────── */
.boss-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.boss-card {
  background: var(--steel);
  border: 1px solid var(--bdr);
  border-radius: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}
.boss-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--bdr2), transparent);
}
.boss-card.active-now {
  border-color: rgba(0,168,130,.38);
  box-shadow: var(--glow-jade), inset 0 0 24px rgba(0,168,130,.03);
}
.boss-card.active-now::before { background: linear-gradient(90deg, transparent, var(--jade), transparent); }
.boss-card.upcoming { border-color: rgba(200,168,76,.28); }
.boss-card.upcoming::before { background: linear-gradient(90deg, transparent, var(--gold), transparent); }

.boss-name {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .04em;
}
.boss-time {
  font-family: var(--font-num);
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
  text-shadow: var(--glow-gold-sm);
}
.boss-countdown { font-size: 11px; color: var(--text3); }

.boss-status-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 9px;
  border-radius: 0;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.badge-active  { background: rgba(0,168,130,.15); color: var(--jade);    border: 1px solid rgba(0,168,130,.32); box-shadow: var(--glow-jade); }
.badge-soon    { background: rgba(200,168,76,.12); color: var(--gold);    border: 1px solid rgba(200,168,76,.32); }
.badge-waiting { background: rgba(255,255,255,.03); color: var(--text3);  border: 1px solid var(--bdr); }
.badge-urgent  { background: rgba(255,51,80,.18);  color: var(--red);     border: 1px solid rgba(255,51,80,.5);  box-shadow: var(--glow-red); animation: bs-pulse 1.5s ease-in-out infinite; }

/* Boss card — URGENT state (spawning in ≤5 minutes) */
.boss-card.urgent {
  border-color: rgba(255,51,80,.5);
  box-shadow: var(--glow-red), inset 0 0 22px rgba(255,51,80,.05);
  animation: bs-pulse-card 2s ease-in-out infinite;
}
.boss-card.urgent::before { background: linear-gradient(90deg, transparent, var(--red), transparent); }

/* Boss Schedule table badges */
.bs-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 9px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  border-radius: 4px;
  text-transform: uppercase;
  font-family: var(--font-display);
}
.bs-badge-summon  { background: rgba(125,211,252,.10); color: #7dd3fc; border: 1px solid rgba(125,211,252,.28); }
.bs-badge-refresh { background: rgba(255,107,53,.12);  color: #ff8a47; border: 1px solid rgba(255,107,53,.32); }
.bs-badge-gray    { background: rgba(255,255,255,.04); color: var(--text2); border: 1px solid var(--bdr); }
.bs-badge-active  { background: rgba(196,30,58,.18);   color: #ff7b8a; border: 1px solid rgba(196,30,58,.4); box-shadow: var(--glow-red); animation: bs-pulse 1.5s ease-in-out infinite; }
.bs-badge-urgent  { background: rgba(196,30,58,.18);   color: var(--red); border: 1px solid rgba(196,30,58,.5); animation: bs-pulse 1.2s ease-in-out infinite; }

/* Spawned-now / Soon pill chips in the alert banner */
.bs-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.bs-pill-active { background: rgba(196,30,58,.12); color: #ff7b8a; }
.bs-pill-active::before { content:''; width:7px; height:7px; border-radius:50%; background:var(--red); animation: bs-pulse 1s ease-in-out infinite; }
.bs-pill-soon   { background: rgba(139,92,246,.12); color: #a78bfa; }
.bs-pill-soon::before   { content:''; width:7px; height:7px; border-radius:50%; background:#7080cc; }

@keyframes bs-pulse {
  0%, 100% { box-shadow: var(--glow-red); }
  50%      { box-shadow: 0 0 18px rgba(255,51,80,.7), 0 0 4px rgba(255,51,80,.4); }
}
@keyframes bs-pulse-card {
  0%, 100% { box-shadow: var(--glow-red), inset 0 0 22px rgba(255,51,80,.05); }
  50%      { box-shadow: 0 0 22px rgba(255,51,80,.45), inset 0 0 28px rgba(255,51,80,.10); }
}

/* ── Top alert banners (Active Now / Spawning Soon) ─────────────── */
.bs-banner {
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}
.bs-banner-active {
  background: linear-gradient(180deg, rgba(196,30,58,.10) 0%, rgba(196,30,58,.02) 100%);
  border: 1px solid rgba(196,30,58,.30);
}
.bs-banner-soon {
  background: linear-gradient(180deg, rgba(139,92,246,.10) 0%, rgba(139,92,246,.02) 100%);
  border: 1px solid rgba(139,92,246,.32);
}

/* Banner header */
.bs-banner-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 10px;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.bs-banner-icon { font-size: 18px; line-height: 1; }
.bs-banner-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.bs-banner-active .bs-banner-title { color: #ff7b8a; }
.bs-banner-soon   .bs-banner-title { color: #a78bfa; }
.bs-banner-count {
  font-size: 11px;
  color: var(--text3);
  letter-spacing: .04em;
  margin-left: auto;
}

/* Card grid inside the banner — compact rows */
.bs-banner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px;
  padding: 8px 12px 10px;
}

/* Individual active boss card — compact */
.bs-active-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: rgba(196,30,58,.06);
  border: 1px solid rgba(196,30,58,.20);
  border-radius: 4px;
  transition: background .15s, border-color .15s;
  min-height: 30px;
}
.bs-active-card:hover {
  background: rgba(196,30,58,.10);
  border-color: rgba(196,30,58,.35);
}
.bs-active-dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 6px var(--red), 0 0 10px rgba(255,51,80,.4);
  animation: bs-pulse 1.4s ease-in-out infinite;
}
.bs-active-info { min-width: 0; flex: 1; line-height: 1.2; }
.bs-active-name {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bs-active-loc {
  font-size: 10px;
  color: var(--text3);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Soon (≤5min) card variant — purple, with countdown number */
.bs-soon-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: rgba(139,92,246,.06);
  border: 1px solid rgba(139,92,246,.22);
  border-radius: 4px;
  transition: background .15s, border-color .15s;
  min-height: 30px;
}
.bs-soon-card:hover {
  background: rgba(139,92,246,.10);
  border-color: rgba(139,92,246,.38);
}
.bs-soon-countdown {
  flex-shrink: 0;
  font-family: var(--font-num);
  font-size: 15px;
  font-weight: 700;
  color: #a78bfa;
  line-height: 1;
  min-width: 26px;
  text-align: center;
}
.bs-soon-unit {
  font-size: 9px;
  color: rgba(167,139,250,.6);
  font-family: var(--font-display);
  margin-left: 1px;
}

/* Tabular numbers — prevents layout shift as time digits change every second/minute */
#bs-clock,
#bs-tab-weekly .tbl td:nth-child(5),
#bs-tab-layer .tbl td:nth-child(5),
#bs-tab-fissured .tbl td:nth-child(3),
.bs-soon-countdown,
.bs-soon-card .bs-active-loc {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* Alert log items in the boss schedule tab */
.bs-log-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--bdr);
}
.bs-log-item:last-child { border-bottom: none; }
.bs-log-time {
  font-family: var(--font-num);
  font-size: 11px;
  color: var(--text3);
  flex-shrink: 0;
  min-width: 80px;
}
.bs-log-msg { font-size: 12px; color: var(--text); flex: 1; }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(200,168,76,.18); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: rgba(200,168,76,.38); }

/* ── Responsive ──────────────────────────────────────────── */
/* ── Mobile hamburger + sidebar drawer ─────────────────────── */
.mobile-menu-btn {
  display: none;          /* shown only at narrow breakpoints */
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1100;
  width: 42px;
  height: 42px;
  padding: 0;
  background: linear-gradient(135deg, #1a1018 0%, #0a0509 100%);
  border: 1px solid rgba(200,168,76,.45);
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.6), 0 0 8px rgba(200,168,76,.15);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}
.mobile-menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--gold);
  border-radius: 1px;
  transition: transform .22s ease, opacity .22s ease;
  transform-origin: center;
}
.mobile-menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-btn.open span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(2px);
  z-index: 1050;
  opacity: 0;
  transition: opacity .22s ease;
}
.sidebar-backdrop.open {
  display: block;
  opacity: 1;
}

@media (max-width: 900px) {
  .mobile-menu-btn { display: flex; }

  /* Sidebar becomes an off-canvas drawer; main content takes full width */
  :root { --sidebar-w: 260px; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 1075;
    box-shadow: 8px 0 24px rgba(0,0,0,.5);
  }
  .sidebar.open { transform: translateX(0); }
  /* The desktop rune bar is position:fixed across the top — hide it on mobile
     so it doesn't sit above the page when the drawer is closed. */
  .sidebar::before { display: none; }
  .layout > .sidebar { flex-shrink: 0; }
  .main { padding: 56px 14px 40px; }              /* leave room for hamburger above */
  /* When drawer is open, prevent body scroll */
  body.sidebar-open { overflow: hidden; }
}

@media (max-width: 600px) {
  .player-hero { flex-direction: column; }
  /* nft-grid stays at 5 columns regardless — cards shrink to fit */
  .boss-grid   { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════
   PLAYER PROFILE — rich layout
   ════════════════════════════════════════════════════════ */
.plr-wrap { margin-bottom: 14px; }

/* Hero banner */
.plr-hero {
  position: relative;
  overflow: hidden;
  padding: 26px 28px 26px;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 210px;
  /* Layered texture: diagonal hairlines + dot grid */
  background:
    radial-gradient(circle at 1px 1px, rgba(200,168,76,.035) 1px, transparent 0) 0 0 / 18px 18px,
    repeating-linear-gradient(
      -55deg,
      rgba(200,168,76,.025) 0,
      rgba(200,168,76,.025) 1px,
      transparent 0,
      transparent 11px
    ),
    var(--steel);
}
/* Top-left corner gold glow */
.plr-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 220px; height: 220px;
  background: radial-gradient(ellipse at top left, rgba(200,168,76,.12) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
/* Bottom gold line accent */
.plr-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(200,168,76,.45), rgba(200,168,76,.10) 55%, transparent);
  pointer-events: none;
  z-index: 3;
}
.plr-hero-bg {
  position: absolute;
  inset: 0;
  /* Height-based sizing — image scales with hero height for consistent face zoom */
  background-size: auto 300%;
  background-repeat: no-repeat;
  /* Right-aligned, top-anchored — face/head dominates the visible area */
  background-position: right -20px top;
  opacity: .58;
  pointer-events: none;
  z-index: 0;
  /* Soft glow around the character art */
  filter: drop-shadow(0 0 30px rgba(200,168,76,.15));
}
.plr-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    /* Strong left fade so text stays readable */
    linear-gradient(to right, var(--steel) 30%, rgba(13,18,32,.80) 50%, rgba(13,18,32,.30) 75%, transparent 100%),
    /* Right-side gold atmosphere — behind character */
    radial-gradient(ellipse 50% 85% at 88% 50%, rgba(200,168,76,.12) 0%, transparent 65%),
    /* Top-right ember accent */
    radial-gradient(ellipse 35% 50% at 95% 5%, rgba(208,104,32,.10) 0%, transparent 70%),
    /* Bottom fade for smooth transition to stats bar */
    linear-gradient(to top, rgba(13,18,32,.55) 0%, transparent 30%);
  pointer-events: none;
  z-index: 1;
}

/* Profile picture — large, no outline, no border, clean character art */
.plr-avatar {
  position: relative;
  width: 130px;
  height: 130px;
  flex-shrink: 0;
  border: none;
  box-shadow: none;
  background: transparent;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 38px;
  color: var(--gold2);
  z-index: 1;
}
.plr-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.5));
}

/* Info block */
.plr-info { flex: 1; min-width: 0; position: relative; z-index: 1; }

.plr-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .05em;
  margin-bottom: 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plr-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 7px;
}
.plr-badge-active {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 10px;
  background: rgba(0,168,130,.14);
  border: 1px solid rgba(0,168,130,.38);
  color: var(--jade);
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.plr-badge-inactive {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 10px;
  background: rgba(196,30,58,.1);
  border: 1px solid rgba(196,30,58,.3);
  color: var(--crimson2);
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.plr-badge-nft {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 10px;
  background: rgba(90,120,220,.12);
  border: 1px solid rgba(90,120,220,.28);
  color: #8aadff;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .08em;
}

.plr-sub {
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 5px;
  letter-spacing: .02em;
}
.plr-class-label {
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: .28em;
  color: var(--gold);
  opacity: .55;
  text-transform: uppercase;
}

/* Stats row */
.plr-stats-bar {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border-top: 1px solid var(--bdr);
}
.plr-stat {
  padding: 14px 18px;
  border-right: 1px solid var(--bdr);
}
.plr-stat:last-child { border-right: none; }
.plr-stat-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 5px;
}
.plr-stat-value {
  font-family: var(--font-num);
  font-size: 26px;
  font-weight: 700;
  color: var(--gold2);
  line-height: 1;
}

/* Activity banner */
.plr-activity-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 20px;
  background: rgba(196,30,58,.06);
  border-top: 1px solid rgba(196,30,58,.15);
  border-bottom: 1px solid rgba(196,30,58,.15);
  font-size: 12px;
  overflow: hidden;
}
.plr-activity-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--red);
  text-transform: uppercase;
  flex-shrink: 0;
}
.plr-activity-item {
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sortable column headers — clickable, hover glow */
.plr-tab-panel .tbl th[data-sort] {
  cursor: pointer;
  user-select: none;
  transition: color .15s, background .15s;
}
.plr-tab-panel .tbl th[data-sort]:hover {
  color: var(--gold3);
  background: rgba(200,150,60,.06);
}
.plr-tab-panel .tbl th[data-sort] .sort-arrow {
  display: inline-block;
  min-width: 10px;
  color: var(--gold);
}

/* Profile tab bar */
.plr-tabs {
  display: flex;
  border-bottom: 1px solid var(--bdr);
  overflow-x: auto;
  scrollbar-width: none;
}
.plr-tabs::-webkit-scrollbar { display: none; }
.plr-tab {
  padding: 11px 20px;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .15s;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
}
.plr-tab:hover { color: var(--text2); }
.plr-tab.active { color: var(--gold2); border-bottom-color: var(--gold); text-shadow: var(--glow-gold-sm); }

.plr-tab-panel { display: none; }
.plr-tab-panel.active { display: block; }

/* Power/Level chart */
.plr-chart-meta {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 14px 20px 6px;
  font-size: 12px;
  color: var(--text3);
  flex-wrap: wrap;
}
.plr-chart-wrap {
  padding: 2px 18px 14px;
}
/* Range pills above the chart — match the existing .pill family
   visually but live inside the chart container so they re-render with it. */
.plr-chart-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 20px 0;
  flex-wrap: wrap;
}
.plr-chart-controls-label {
  font-size: 11px;
  color: var(--text3);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-right: 4px;
}
.plr-range-pill {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--bdr);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.plr-range-pill:hover {
  color: var(--text);
  border-color: var(--bdr2, var(--bdr));
}
.plr-range-pill.active {
  background: rgba(200, 150, 60, .08);
  color: var(--gold, #c8963c);
  border-color: rgba(200, 150, 60, .55);
}
/* Hover tooltip — pure-CSS show/hide on the parent <g> hover.
   pointer-events on the hit circle make the whole 24px-diameter area
   responsive, so users don't have to nail the 4px dot precisely. */
.plr-pt .plr-pt-tip {
  opacity: 0;
  transition: opacity .12s ease-out;
}
.plr-pt:hover .plr-pt-tip {
  opacity: 1;
}
.plr-pt-hit {
  cursor: pointer;
}
.plr-pt:hover circle:first-child {
  /* nudge the visible dot brighter so the user gets feedback that the
     hit zone is active even if the tooltip clips offscreen */
  stroke-width: 3;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .plr-stats-bar { grid-template-columns: repeat(3, 1fr); }
  .plr-stat { border-bottom: 1px solid var(--bdr); }
}
@media (max-width: 600px) {
  .plr-stats-bar { grid-template-columns: repeat(2, 1fr); }
  .plr-hero { padding: 16px; }
  .plr-name { font-size: 16px; }
}

/* ════════════════════════════════════════════════════════════════
   NFT CHARACTER PROFILE — premium MMORPG detail view
   ════════════════════════════════════════════════════════════════ */
.nftp-wrap { padding: 0 0 60px; }

/* ── HERO V2 (xdraco-style) ──────────────────────────────────────
   Orange radial spotlight + floating character + hex equipment slots
   + side info panel + crimson price button. */
.nftp-hero-v2 {
  position: relative;
  margin-bottom: 28px;
  overflow: hidden;
  isolation: isolate;
}
.nftp-hero-bg-v2 {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    /* radial spotlight from bottom-center — kept, just softer */
    radial-gradient(ellipse 90% 70% at 40% 105%,
      rgba(255,140,40,0.40) 0%,
      rgba(255,90,30,0.22) 20%,
      rgba(180,40,10,0.08) 45%,
      transparent 75%),
    /* upper crimson tint */
    radial-gradient(ellipse 60% 50% at 50% 0%,
      rgba(196,30,58,0.06) 0%,
      transparent 60%),
    /* base dark — bottom matches the character art backdrop so they blend */
    linear-gradient(180deg, #08060d 0%, #010219 100%);
}
/* Back link top-left */
.nftp-back {
  position: absolute;
  top: 22px;
  left: 36px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px 6px 8px;
  background: rgba(0,0,0,.4);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: rgba(255,255,255,.85);
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.nftp-back:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
  border-color: rgba(255,255,255,.2);
}
.nftp-back-chev {
  font-size: 18px;
  line-height: 1;
  font-weight: 300;
  color: var(--gold2);
}

/* ── View on XDRACO button — sits below the price-conversion line in the info panel ── */
.nftp-xdraco-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 12px;
  padding: 11px 16px;
  background:
    linear-gradient(135deg, rgba(244,193,79,.18) 0%, rgba(200,168,76,.08) 100%),
    rgba(20,12,4,.7);
  border: 1px solid rgba(244,193,79,.55);
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #ffe9a8;
  text-decoration: none;
  cursor: pointer;
  transition: all .15s ease;
  box-shadow:
    0 2px 8px rgba(0,0,0,.45),
    0 0 0 1px rgba(0,0,0,.4) inset,
    0 0 12px rgba(244,193,79,.18);
  user-select: none;
  white-space: nowrap;
}
.nftp-xdraco-btn:hover {
  border-color: #ffd96b;
  color: #fff5c8;
  background:
    linear-gradient(135deg, rgba(244,193,79,.28) 0%, rgba(200,168,76,.14) 100%),
    rgba(28,18,6,.85);
  box-shadow:
    0 4px 14px rgba(0,0,0,.55),
    0 0 0 1px rgba(0,0,0,.5) inset,
    0 0 18px rgba(244,193,79,.35);
  transform: translateY(-1px);
}
.nftp-xdraco-btn-arrow {
  font-size: 14px;
  line-height: 1;
  color: var(--gold2, #f4c14f);
  transition: transform .15s ease;
}
.nftp-xdraco-btn:hover .nftp-xdraco-btn-arrow {
  transform: translate(2px, -2px);
}

/* Hero grid: stage on left, info panel on right — compact for smaller screens */
.nftp-hero-grid {
  position: relative;
  display: grid;
  /* Golden ratio split — character art : info panel = 38.2 : 61.8.
     Art is the visual anchor (smaller portion = phi-minor); info gets
     the breathing room to hold name, stats, price, and the XDRACO btn. */
  grid-template-columns: minmax(280px, var(--golden-min)) minmax(360px, var(--golden-max));
  gap: var(--sp-5);
  padding: var(--sp-6) var(--sp-5) var(--sp-4);
  max-width: 1280px;
  margin: 0 auto;
  align-items: center;
}

/* ── STAGE: clean floating character (no surrounding slots) ── */
.nftp-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 380px;
  margin: 0 auto;
}
.nftp-stage-char {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  z-index: 1;
  filter: drop-shadow(0 12px 28px rgba(0,0,0,.7));
}

/* ── EQUIPMENT STRIP ── clean horizontal row below the hero
   Grouped: Weapons · Armor · Accessories with subtle dividers between. */
.nftp-equip-strip {
  position: relative;
  z-index: 2;
  margin: 28px auto 0;
  max-width: 1400px;
  padding: 18px 36px 6px;
  display: flex;
  flex-direction: column;   /* two stacked rows: Weapon+Armor, then Accessories */
  align-items: center;
  gap: 22px;
}
/* One horizontal row of equipment groups */
.nftp-equip-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  row-gap: 18px;
}
.nftp-equip-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  min-width: 0;
}
/* Mobile fixes:
   - Strip uses minimal horizontal padding so slots aren't crowded
   - Group horizontal padding tightened
   - Slightly larger row-gap so the ACCESSORIES group has clear
     breathing room when it wraps below WEAPON + ARMOR
   - Slot bumped 78 → 84px so weapon art is readable */
@media (max-width: 720px) {
  .nftp-equip-strip {
    padding: 18px 8px 6px;
    row-gap: 24px;
  }
  .nftp-equip-group { padding: 0 6px; }
  .nftp-equip-slot { --slot-size: 84px; }
  /* Divider doesn't make sense when groups stack into rows */
  .nftp-equip-divider { display: none; }
}
.nftp-equip-group-label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
}
.nftp-equip-group-slots {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.nftp-equip-divider {
  width: 1px;
  align-self: stretch;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(255,255,255,.12) 30%,
    rgba(255,255,255,.12) 70%,
    transparent 100%);
  margin-top: 8px;
}

.nftp-equip-slot {
  --g-color: #cfcfcf;
  --g-glow:  rgba(207,207,207,.28);
  --slot-size: 78px;             /* mobile default; desktop overrides below */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  width: var(--slot-size);
}
/* Match the inventory tile bump on the same breakpoint (HAR's 900px),
   so the equipment strip and the inventory grid scale together. */
@media (min-width: 900px) {
  .nftp-equip-slot { --slot-size: 112px; }
}
.nftp-equip-slot-frame {
  position: relative;
  width: var(--slot-size);
  height: var(--slot-size);
  background:
    radial-gradient(ellipse at center, color-mix(in srgb, var(--g-color) 20%, transparent) 0%, transparent 70%),
    linear-gradient(180deg, #0d1018 0%, #050810 100%);
  border: 1px solid var(--g-color);
  box-shadow: inset 0 0 14px rgba(0,0,0,.65);
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.nftp-equip-slot:hover .nftp-equip-slot-frame {
  transform: translateY(-2px);
  box-shadow: inset 0 0 14px rgba(0,0,0,.45);
}
.nftp-equip-slot-frame::after {
  /* Inner border ring */
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(0,0,0,.4);
  pointer-events: none;
}
.nftp-equip-slot-frame img {
  position: absolute;
  inset: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  object-fit: contain;
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.7));
}
/* Enhancement — flush in the TOP-RIGHT corner of the frame, plain text. */
.nftp-equip-slot-enh {
  position: absolute;
  top: 3px;
  right: 5px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  font-family: var(--font-num);
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  text-shadow: 0 1px 2px #000, 0 0 4px rgba(0,0,0,.7);
  letter-spacing: -.01em;
}
/* Tier (Roman I..VII) — circular badge matching xdraco's exact
   .character-equip-list-v2__item .item-tier rule from the HAR:
   24×24 dark circle, tan border, white text, sits at bottom-left
   with a slight bleed (-3px) outside the cell. */
.nftp-equip-slot-tier {
  position: absolute;
  bottom: -3px;
  left: -3px;
  z-index: 5;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #9f916c;
  border-radius: 50%;
  background-color: #333;
  color: #fff;
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.13px;
  box-sizing: border-box;
}
/* When the item is reforged, xdraco swaps the badge for the blue
   dragon gem disc (img-dragon-reforge-blue.webp). Red variant for
   refineStep >= 7. */
.nftp-equip-slot--forged .nftp-equip-slot-tier {
  width: 27px;
  height: 27px;
  border: none;
  background:
    url('https://file.mir4global.com/xdraco/dist/img/common/card/img-dragon-reforge-blue.webp')
    0 0 / 100% no-repeat;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.8);
}
.nftp-equip-slot--forged.red .nftp-equip-slot-tier {
  background-image: url('https://file.mir4global.com/xdraco/dist/img/common/card/img-dragon-reforge-red.webp');
}
/* Forge "F{N}" — TOP-LEFT compact dark pill. Distinct from the bottom-left
   Tier diamond. Hidden when forge === 0. */
.nftp-equip-slot-forge {
  position: absolute;
  top: 3px;
  left: 4px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  background: linear-gradient(180deg, rgba(40,40,52,.95) 0%, rgba(10,10,16,.95) 100%);
  border: 1px solid rgba(232, 168, 58, .65);
  border-radius: 9px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  color: #ffd96b;
  line-height: 1;
  letter-spacing: .04em;
  text-transform: uppercase;
  box-shadow:
    0 0 6px rgba(232, 168, 58, 0.35),
    0 1px 2px rgba(0, 0, 0, 0.45);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.7);
}
/* Forged / reforged equipment slot — overlay xdraco's official gold dragon
   frame (img-frame-dragon-reforge-blue.webp). Same asset used on the
   inventory thumbnails for visual consistency. The frame sits on top of
   the grade backdrop and inside the cell border. */
.nftp-equip-slot--forged .nftp-equip-slot-frame {
  position: relative;
}
.nftp-equip-slot--forged .nftp-equip-slot-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  background: url('https://file.mir4global.com/xdraco/dist/img/common/card/img-frame-dragon-reforge-blue.webp') 0 0 / contain no-repeat;
  pointer-events: none;
}
/* Red variant for the rare .refine.red items */
.nftp-equip-slot--forged.red .nftp-equip-slot-frame::before {
  background-image: url('https://file.mir4global.com/xdraco/dist/img/common/card/img-frame-dragon-reforge-red.webp');
}
/* Primal indicator — uses xdraco's sp-item-hole.webp sprite.
   Sprite is 2 cols × 4 rows. Right column (gold/active) = bg-position-x 100%.
   Rows 1..4 → bg-position-y 0%, 33.33%, 66.67%, 100%. */
.nftp-equip-slot-primal {
  position: absolute;
  bottom: 3px;
  right: 4px;
  z-index: 3;
  width: 24px;
  height: 24px;
  background-image: url('https://file.mir4global.com/xdraco/dist/img/common/sp-item-hole.webp');
  background-size: 200% 400%;
  background-position-x: 100%; /* gold column */
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 4px rgba(0,0,0,.7));
}
.nftp-primal-1 { background-position-y: 0%; }
.nftp-primal-2 { background-position-y: 33.333%; }
.nftp-primal-3 { background-position-y: 66.666%; }
.nftp-primal-4 { background-position-y: 100%; }

/* Tradeable marker — the in-game "Tradeable" tag: a gold serif "T" in the
   TOP-LEFT corner (top-right is enhancement, bottom-left tier, bottom-right
   primal, so this corner is free). Decoded from the item template id. */
.nftp-equip-slot-trad {
  position: absolute;
  top: 2px;
  left: 3px;
  z-index: 3;
  font-size: 23px;        /* match the enhancement number's visual size */
  line-height: 0;
  color: #f6d676;
  pointer-events: none;
}
/* Shared balance-scale image (size follows parent font-size via 1em). */
.nftp-trade-ico {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.15em;
  object-fit: contain;
}
.nftp-equip-slot-trad .nftp-trade-ico {
  /* Override the frame's generic `img` rule (which would absolutely-position
     and stretch this) — keep it as a small in-flow corner marker. */
  position: static;
  inset: auto;
  width: 1em;
  height: 1em;
  filter: drop-shadow(0 0 1.5px #000) drop-shadow(0 1px 1px #000);
}
/* Inventory-tile marker — upper-left corner. */
.nftp-inv-trad {
  position: absolute;
  top: 2px;
  left: 2px;
  z-index: 4;
  font-size: 18px;        /* match the inventory enhancement number */
  line-height: 0;
  pointer-events: none;
}
.nftp-inv-trad .nftp-trade-ico {
  filter: drop-shadow(0 0 1.5px #000) drop-shadow(0 1px 1px #000);
}
/* Item-card modal marker — upper-left corner of the card front. */
.nftp-card-trad {
  position: absolute;
  top: 26px;
  left: 26px;
  z-index: 6;
  font-size: 44px;
  line-height: 0;
  pointer-events: none;
}
.nftp-card-trad .nftp-trade-ico {
  filter: drop-shadow(0 0 2px #000) drop-shadow(0 1px 2px #000);
}
/* Gold ring on the frame so tradeable gear reads at a glance in the strip. */
.nftp-equip-slot.is-tradeable .nftp-equip-slot-frame {
  box-shadow: inset 0 0 0 1px #e8b765, inset 0 0 14px rgba(0,0,0,.65);
}
/* "N equipped" chip in the hero data list. */
.nftp-trad-count {
  color: #f6d676;
  font-weight: 700;
}
.nftp-trad-hint {
  font-size: 9px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8a6d2e;
  background: rgba(232,183,101,.14);
  border: 1px solid rgba(232,183,101,.35);
  border-radius: 4px;
  padding: 0 4px;
  margin-left: 4px;
  vertical-align: 1px;
}
/* Tradable-gears chip — sits beside the server name; brand gold, glowing. */
.nftp-server-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.nftp-server-row .nftp-server-v2 { margin-bottom: 0; }
.nftp-trad-chip {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold2);
  white-space: nowrap;
}
.nftp-trad-chip.is-zero { color: rgba(255,255,255,.55); }
@media (max-width: 720px) {
  .nftp-server-row { justify-content: center; }
}

.nftp-equip-slot-label {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
  text-align: center;
  white-space: nowrap;
}
.nftp-equip-empty .nftp-equip-slot-frame {
  background: rgba(0,0,0,.4);
  border-color: rgba(255,255,255,.06);
  box-shadow: inset 0 0 12px rgba(0,0,0,.5);
}
.nftp-equip-empty .nftp-equip-slot-label {
  color: rgba(255,255,255,.25);
}

@media (max-width: 1400px) {
  .nftp-equip-group { padding: 0 10px; }
  .nftp-equip-group-slots { gap: 6px; }
  .nftp-equip-slot, .nftp-equip-slot-frame { width: 70px; }
  .nftp-equip-slot-frame { height: 70px; }
  .nftp-equip-slot-primal { width: 20px; height: 20px; }
  .nftp-equip-slot-enh { font-size: 14px; }
  .nftp-equip-slot-trad { font-size: 18px; }
}
@media (max-width: 720px) {
  .nftp-equip-strip { padding: 14px 10px 0; }
  .nftp-equip-group { padding: 0 8px; }
  .nftp-equip-group-slots { gap: 5px; }
  .nftp-equip-slot, .nftp-equip-slot-frame { width: 58px; }
  .nftp-equip-slot-frame { height: 58px; }
  .nftp-equip-slot-primal { width: 16px; height: 16px; }
}

/* ── INFO PANEL V2 ── */
.nftp-info-v2 {
  min-width: 0;
  position: relative;
  z-index: 2;
}
.nftp-name-v2 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  line-height: 1.05;
  letter-spacing: .01em;
  text-shadow: 0 2px 12px rgba(0,0,0,.7), 0 0 24px rgba(255,140,40,.18);
  margin-bottom: 4px;
  overflow-wrap: break-word;
}
.nftp-server-v2 {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
  margin-bottom: 18px;
}

/* 3-cell quick stats row (Class | Level | Power Score) */
.nftp-quickstats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding-bottom: 18px;
}
.nftp-quickstat {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
  border-right: 1px solid rgba(255,255,255,.06);
}
.nftp-quickstat:last-child { border-right: none; }
.nftp-quickstat-lbl {
  font-family: var(--font-ui);
  font-size: 11px;
  color: rgba(255,255,255,.55);
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 500;
}
.nftp-quickstat-val {
  font-family: var(--font-num);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.nftp-quickstat-ico {
  width: 32px;
  height: 32px;
  position: relative;
}
/* Reuse the existing class-icon sprite */
.nftp-quickstat-ico .nft-class-icon {
  position: relative;
  top: auto; left: auto;
  width: 100%; height: 100%;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.7));
}

/* Data list (Sealed on / NFT ID / Blockchain) */
.nftp-datalist {
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 22px;
}
.nftp-datarow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
  font-family: var(--font-ui);
}
.nftp-datarow:last-child { border-bottom: none; }
.nftp-datarow-key {
  font-size: 12px;
  color: rgba(255,255,255,.55);
  letter-spacing: .03em;
}
.nftp-datarow-val {
  font-family: var(--font-num);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: .02em;
}
.nftp-datarow-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 4px;
  transition: all .15s;
}
.nftp-datarow-link:hover { background: rgba(255,255,255,.08); border-color: var(--gold); }
.nftp-datarow-link img {
  width: 11px;
  height: 11px;
  object-fit: contain;
  filter: brightness(1.4);
}

/* Big crimson price button */
.nftp-price-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  padding: 16px 18px;
  background:
    linear-gradient(135deg, #4a0a18 0%, #8b0a1a 50%, #4a0a18 100%);
  border: 1px solid rgba(196,30,58,.6);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
  cursor: default;
  text-decoration: none;
}
.nftp-price-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.nftp-price-btn--link { cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.nftp-price-btn--link:hover { border-color: rgba(255,90,120,.9); }
.nftp-price-cta {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.72);
}
.nftp-price-btn--link:hover .nftp-price-cta { color: #fff; }
.nftp-price-btn .wemix-icon {
  position: static;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  padding: 0;
  filter: drop-shadow(0 0 8px rgba(255,79,180,.6));
}
.nftp-price-btn-val {
  font-family: var(--font-num);
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.nftp-price-conv {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 10px;
  font-family: var(--font-num);
  font-size: 12px;
  color: rgba(255,255,255,.55);
  font-variant-numeric: tabular-nums;
}

/* Responsive */
@media (max-width: 980px) {
  .nftp-hero-grid {
    grid-template-columns: 1fr;
    padding: 60px 24px 40px;
    gap: 24px;
  }
  .nftp-stage { max-width: 460px; }
  .nftp-name-v2 { font-size: 28px; text-align: center; }
  .nftp-server-v2 { text-align: center; }
}

/* ── HERO ── grade-aware crimson/gold panel with portrait, info, price ── */
.nftp-hero {
  --g-color: #f4c14f;
  --g-glow:  rgba(244,193,79,.48);
  position: relative;
  margin-bottom: 28px;
  overflow: hidden;
  isolation: isolate;
  border-top:    1px solid rgba(0,0,0,.5);
  border-bottom: 1px solid var(--g-color);
}
.nftp-hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 50% 70% at 20% 50%, color-mix(in srgb, var(--g-color) 18%, transparent) 0%, transparent 65%),
    radial-gradient(ellipse 40% 60% at 90% 50%, rgba(196,30,58,.18) 0%, transparent 70%),
    linear-gradient(135deg, #07090f 0%, #0d1018 50%, #07090f 100%);
}
.nftp-hero-frame {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    repeating-linear-gradient(-55deg, rgba(200,168,76,.025) 0, rgba(200,168,76,.025) 1px, transparent 0, transparent 9px),
    linear-gradient(to right,  var(--g-color) 0%, transparent 4%, transparent 96%, var(--g-color) 100%);
  background-blend-mode: normal;
  opacity: 0.55;
  mix-blend-mode: screen;
}
.nftp-hero::before {
  /* Top rune line */
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--crimson) 18%, var(--gold) 50%, var(--crimson) 82%, transparent 100%);
  box-shadow: 0 0 14px var(--g-glow);
  z-index: 1;
}

.nftp-hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr minmax(220px, 280px);
  gap: 28px;
  padding: 32px 36px;
  align-items: center;
  max-width: 1500px;
  margin: 0 auto;
}

/* Portrait */
.nftp-portrait-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.nftp-portrait-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.1;
  max-width: 260px;
  background:
    radial-gradient(ellipse at center, color-mix(in srgb, var(--g-color) 14%, transparent) 0%, transparent 70%),
    linear-gradient(180deg, #0a0d14 0%, #050810 100%);
  border: 1px solid var(--g-color);
  box-shadow:
    0 0 28px var(--g-glow),
    inset 0 0 40px rgba(0,0,0,.6),
    inset 0 0 0 1px rgba(0,0,0,.4);
  overflow: hidden;
}
.nftp-portrait-frame::before,
.nftp-portrait-frame::after {
  /* Corner ornaments */
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid var(--g-color);
  z-index: 4;
}
.nftp-portrait-frame::before { top: 4px; left: 4px; border-right: none; border-bottom: none; }
.nftp-portrait-frame::after  { bottom: 4px; right: 4px; border-left: none; border-top: none; }

.nftp-portrait {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 1;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.6));
}
.nftp-portrait-classicon {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 36px;
  height: 36px;
  z-index: 3;
  background-image: url('https://file.mir4global.com/xdraco/dist/img/common/card/sp-class.webp');
  background-size: 100% 700%;
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 6px rgba(0,0,0,.9));
}
.nftp-portrait-classicon.arbalist  { background-position: 0    0%; }
.nftp-portrait-classicon.lancer    { background-position: 0   16.67%; }
.nftp-portrait-classicon.darkist   { background-position: 0   33.33%; }
.nftp-portrait-classicon.taoist    { background-position: 0   50%; }
.nftp-portrait-classicon.warrior   { background-position: 0   66.67%; }
.nftp-portrait-classicon.sorcerer  { background-position: 0   83.33%; }
.nftp-portrait-classicon.lionheart { background-position: 0  100%; }

.nftp-portrait-enhance {
  position: absolute;
  bottom: 10px;
  right: 12px;
  z-index: 3;
  font-family: var(--font-num);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 12px var(--g-color), 0 2px 4px #000;
  letter-spacing: 1px;
}

.nftp-rarity-tag {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 18px;
  letter-spacing: .25em;
  text-transform: uppercase;
  background: rgba(0,0,0,.6);
  border: 1px solid currentColor;
}

/* Info column */
.nftp-info { min-width: 0; }
.nftp-breadcrumb {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: 6px;
}
.nftp-name {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.1;
  color: var(--text);
  text-shadow:
    0 0 18px var(--g-glow),
    0 2px 8px rgba(0,0,0,.85);
  margin-bottom: 14px;
  overflow-wrap: break-word;
}
.nftp-subline {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.nftp-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  background: rgba(0,0,0,.35);
  border: 1px solid var(--bdr);
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: .05em;
}
.nftp-chip-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(200,150,60,.35));
}
.nftp-chip-label {
  text-transform: uppercase;
  color: var(--text3);
  font-size: 10px;
  letter-spacing: .15em;
}
.nftp-chip-val {
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}
.nftp-chip-gold {
  border-color: var(--bdr2);
  background: rgba(200,150,60,.08);
}
.nftp-chip-gold .nftp-chip-val { color: var(--gold2); }
.nftp-chip-mirage {
  border-color: rgba(139,92,246,.30);
  background: rgba(139,92,246,.08);
}
.nftp-chip-mirage .nftp-chip-val { color: var(--violet2); }
.nftp-chip-mono .nftp-chip-val {
  font-family: var(--font-num);
  font-size: 12px;
  color: var(--ice);
}

/* XDRACO outlink button — sits in the price action row */
.nftp-xdraco-link {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.nftp-xdraco-link img {
  width: 11px;
  height: 11px;
  object-fit: contain;
  filter: brightness(1.4);
}

.nftp-stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--bdr);
  background: rgba(0,0,0,.25);
}
.nftp-stat {
  padding: 12px 14px;
  border-right: 1px solid var(--bdr);
}
.nftp-stat:last-child { border-right: none; }
.nftp-stat-lbl {
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 4px;
}
.nftp-stat-val {
  font-family: var(--font-num);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Price column */
.nftp-price-col { display: flex; flex-direction: column; gap: 10px; }
.nftp-price-frame {
  position: relative;
  padding: 20px 18px 18px;
  background:
    linear-gradient(135deg, rgba(196,30,58,.08) 0%, rgba(0,0,0,.5) 100%);
  border: 1px solid var(--bdr-gold);
  text-align: center;
}
.nftp-price-frame::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(200,150,60,.15);
  pointer-events: none;
}
.nftp-price-lbl {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 10px;
}
.nftp-price-amount {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}
.nftp-price-amount img.wemix-icon {
  position: static;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(255, 79, 180, 0.55));
}
.nftp-price-amount span {
  font-family: var(--font-num);
  font-size: 28px;
  font-weight: 700;
  color: var(--gold2);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.nftp-price-sub {
  font-family: var(--font-num);
  font-size: 11px;
  color: var(--text2);
  font-variant-numeric: tabular-nums;
}
.nftp-price-tag {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 12px;
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: .25em;
  background: rgba(0,184,148,.1);
  color: var(--jade);
  border: 1px solid rgba(0,184,148,.3);
}
.nftp-price-chain {
  display: inline-block;
  margin-top: 6px;
  margin-left: 4px;
  padding: 3px 10px;
  font-family: var(--font-num);
  font-size: 9px;
  letter-spacing: .15em;
  background: rgba(125,211,252,.06);
  color: var(--ice);
  border: 1px solid rgba(125,211,252,.25);
}
.nftp-price-actions { display: flex; gap: 6px; }
.nftp-price-actions .btn { flex: 1; }

/* ── SECTION HEAD ── */
.nftp-section-head {
  max-width: 1500px;
  margin: 0 auto 8px;             /* tighter title→panel gap (was 18) */
  padding: 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
@media (max-width: 720px) {
  .nftp-section-head { padding: 0 16px; margin-bottom: 6px; }
}
.nftp-section-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--gold2);
  display: flex;
  align-items: center;
  gap: 12px;
}
.nftp-bullet { color: var(--crimson); font-size: 14px; }
.nftp-section-meta {
  display: flex;
  gap: 18px;
  font-family: var(--font-num);
  font-size: 12px;
  color: var(--text2);
  letter-spacing: .05em;
}

/* ── CATEGORY ── */
.nftp-cat {
  max-width: 1500px;
  margin: 0 auto 22px;
  padding: 0 36px;
}
.nftp-cat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--bdr);
}
.nftp-cat-icon {
  font-size: 16px;
  color: var(--gold);
  filter: drop-shadow(0 0 6px rgba(200,150,60,.5));
}
.nftp-cat-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text);
}
.nftp-cat-count {
  margin-left: auto;
  font-family: var(--font-num);
  font-size: 12px;
  color: var(--text3);
  letter-spacing: .1em;
}

/* ── ITEM GRID ── */
.nftp-item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 10px;
}
.nftp-item {
  --g-color: #cfcfcf;
  --g-glow:  rgba(207,207,207,.30);
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: default;
}
.nftp-item-img-wrap {
  position: relative;
  aspect-ratio: 1;
  background:
    radial-gradient(ellipse at center, color-mix(in srgb, var(--g-color) 18%, transparent) 0%, transparent 70%),
    linear-gradient(180deg, #0d1018 0%, #050810 100%);
  border: 1px solid var(--g-color);
  box-shadow: 0 0 12px var(--g-glow), inset 0 0 14px rgba(0,0,0,.6);
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.nftp-item:hover .nftp-item-img-wrap {
  transform: translateY(-2px);
  box-shadow: 0 0 22px var(--g-glow), inset 0 0 14px rgba(0,0,0,.4);
}
.nftp-item-img-wrap::before {
  /* Subtle diagonal etching */
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(-55deg, rgba(255,255,255,.018) 0, rgba(255,255,255,.018) 1px, transparent 0, transparent 6px);
  pointer-events: none;
}
.nftp-item-img-wrap::after {
  /* Inner frame */
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(0,0,0,.5);
  pointer-events: none;
}
.nftp-item-img {
  position: absolute;
  inset: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  object-fit: contain;
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.7));
}
.nftp-item-enhance {
  position: absolute;
  top: 4px;
  left: 5px;
  z-index: 2;
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 6px var(--g-color), 0 1px 2px #000;
  line-height: 1;
}
/* Tier (Roman) — dark circular badge bottom-left */
.nftp-item-tier {
  position: absolute;
  bottom: 4px;
  left: 4px;
  z-index: 2;
  width: 20px;
  height: 20px;
  background:
    url('https://file.mir4global.com/xdraco/dist/img/common/nft-detail/spirit-tier-badge.webp')
    center/contain no-repeat,
    radial-gradient(circle, #1a1a22 0%, #050508 100%);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  color: var(--gold3);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  text-shadow: 0 1px 2px #000;
}
/* Forged badge (Roman) — amber pill with sparkle, top-right */
.nftp-item-forge {
  position: absolute;
  top: 3px;
  right: 4px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px 2px 4px;
  background: linear-gradient(180deg, #fff5b8 0%, #e8a83a 50%, #8a5a14 100%);
  border: 1px solid #5a3808;
  border-radius: 9px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  color: #2a1500;
  line-height: 1;
  letter-spacing: .02em;
  box-shadow:
    0 0 6px rgba(255, 200, 60, 0.6),
    inset 0 -1px 2px rgba(0, 0, 0, 0.35),
    inset 0 1px 1px rgba(255, 245, 200, 0.6);
}
/* Soft amber accent on the whole item card when forged */
.nftp-item--forged .nftp-item-img-wrap {
  box-shadow:
    0 0 14px rgba(255, 180, 60, 0.40),
    0 0 12px var(--g-glow),
    inset 0 0 14px rgba(0, 0, 0, 0.5);
  border-color: #e8a83a;
}
/* Primal sprite indicator for grid items */
.nftp-item-primal {
  position: absolute;
  bottom: 3px;
  right: 4px;
  z-index: 2;
  width: 20px;
  height: 20px;
  background-image: url('https://file.mir4global.com/xdraco/dist/img/common/sp-item-hole.webp');
  background-size: 200% 400%;
  background-position-x: 100%;
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 3px rgba(0,0,0,.7));
}
.nftp-item-name {
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .02em;
  text-align: center;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 26px;
}
.nftp-item-refine {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 8px;
}
.nftp-refine-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  box-shadow: 0 0 4px currentColor;
}
.nftp-refine-more {
  font-family: var(--font-num);
  font-size: 9px;
  color: var(--text3);
  margin-left: 4px;
}

/* ── STAT SUMMARY ROW ── compact horizontal row + Details button ── */
.nftp-stat-sum-wrap {
  max-width: 1500px;
  margin: 0 auto 28px;
  padding: 0 36px;
}
.nftp-stat-sum-row {
  display: grid;
  grid-template-columns: 1.3fr repeat(6, 1fr) auto;
  gap: 1px;
  background:
    linear-gradient(180deg, rgba(200,150,60,.04) 0%, rgba(0,0,0,.4) 100%);
  border: 1px solid var(--bdr2);
  border-top: 2px solid var(--gold);
  align-items: stretch;
}
.nftp-stat-sum-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 14px 16px;
  background: rgba(0,0,0,.25);
  min-width: 0;
}
.nftp-stat-sum-cell.nftp-stat-sum-ps {
  background: linear-gradient(135deg, rgba(196,30,58,.10) 0%, rgba(200,150,60,.06) 100%);
  border-right: 1px solid var(--bdr2);
}
.nftp-stat-sum-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 9.5px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nftp-stat-sum-label img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 3px rgba(200,150,60,.35));
}
.nftp-stat-sum-val {
  font-family: var(--font-num);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  white-space: nowrap;
}
.nftp-stat-sum-ps .nftp-stat-sum-val {
  font-size: 22px;
  color: var(--gold2);
  text-shadow: 0 0 12px rgba(200,150,60,.4);
}
.nftp-stat-details-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 28px;
  background:
    linear-gradient(135deg, rgba(139,92,246,.20) 0%, rgba(196,30,58,.15) 100%);
  border: none;
  border-left: 1px solid var(--bdr2);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.nftp-stat-details-btn:hover {
  background:
    linear-gradient(135deg, rgba(139,92,246,.35) 0%, rgba(196,30,58,.25) 100%);
  color: var(--gold3);
}
.nftp-stat-details-plus {
  font-family: var(--font-num);
  font-size: 18px;
  font-weight: 400;
  color: var(--gold2);
  line-height: 1;
}

/* ── STATS MODAL ── xdraco-style popup: title bar + flat 2-col list ── */
.nftp-stats-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  animation: nftpStatsFadeIn .15s ease;
}
.nftp-stats-modal.open { display: flex; }
@keyframes nftpStatsFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.nftp-stats-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .75);
  backdrop-filter: blur(4px);
}
.nftp-stats-modal-box {
  position: relative;
  width: min(960px, 94vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, #2b1a4f 0%, #1a0d33 100%);
  border: 1px solid rgba(139,92,246,.55);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, .8),
    0 0 60px rgba(139, 92, 246, .25);
  animation: nftpStatsSlide .22s ease;
  /* Hard-clip any accidental horizontal overflow from long stat values */
  overflow-x: hidden;
}
@keyframes nftpStatsSlide {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.nftp-stats-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.nftp-stats-modal-title {
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .02em;
}
.nftp-stats-modal-close {
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,.65);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all .12s;
}
.nftp-stats-modal-close:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.nftp-stats-modal-body {
  overflow-y: auto;
  overflow-x: hidden;       /* never scroll sideways */
  padding: 8px 20px 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(139,92,246,.5) transparent;
}
.nftp-stats-modal-body::-webkit-scrollbar { width: 8px; }
.nftp-stats-modal-body::-webkit-scrollbar-track { background: transparent; }
.nftp-stats-modal-body::-webkit-scrollbar-thumb {
  background: rgba(139,92,246,.4);
  border-radius: 4px;
}
.nftp-stats-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(139,92,246,.6);
}
.nftp-stats-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));   /* minmax(0,1fr) lets columns shrink below content size */
  column-gap: 24px;
  row-gap: 4px;
  min-width: 0;
}
.nftp-stat-modal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  min-width: 0;                                       /* allow flex children to shrink */
}
.nftp-stat-modal-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(139,92,246,.4));
}
.nftp-stat-modal-name {
  flex: 1 1 auto;
  min-width: 0;                                       /* required for ellipsis inside flex */
  font-family: var(--font-ui);
  font-size: 12.5px;
  color: rgba(255,255,255,.85);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nftp-stat-modal-value {
  flex-shrink: 0;
  font-family: var(--font-num);
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  white-space: nowrap;
}
.nftp-stat-modal-value.pct {
  color: #c4a8ff;
}

/* Modal responsive */
@media (max-width: 700px) {
  .nftp-stats-modal-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════
   ITEM FLIP-CARD MODAL (inventory / equipment item details)
   ════════════════════════════════════════════════════════ */
.nftp-card-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  animation: nftpStatsFadeIn .15s ease;
}
.nftp-card-modal.open { display: flex; }
.nftp-card-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .8);
  backdrop-filter: blur(6px);
}
.nftp-card-modal-body {
  position: relative;
  z-index: 1;
  /* The card itself is centered; this just holds it. */
  display: flex;
  align-items: center;
  justify-content: center;
}
.nftp-card-modal-close {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
  z-index: 2;
  width: 40px;
  height: 40px;
  background: rgba(0,0,0,.45);
  border: 1px solid var(--border-2);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s;
}
.nftp-card-modal-close:hover {
  background: rgba(139,0,0,.7);
  border-color: var(--accent-hover);
}
.nftp-card-loading {
  color: var(--text-muted);
  font-family: var(--font-ui);
  padding: var(--sp-4);
}

/* ════════════════════════════════════════════════════════════════
   PROGRESSION BADGES — unified tier / enhancement / forge system
   Three independent badges on a single horizontal row. Each badge is
   a small pill so they pack flat at any size. No text labels — the
   shape, color, and glyph convey the meaning.
   Sizes:
     lg = card modal      (~26px tall, 13–15px font)
     md = NFT marketplace (~22px tall, 12px font)
     sm = secondary slots (~18px tall, 10.5px font)
     xs = inventory/slot  (~14px tall, 9px font, absolute-positioned)
   ════════════════════════════════════════════════════════════════ */
.prog-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  line-height: 1;
  user-select: none;
}
.prog-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 3px 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #1a1a22 0%, #050508 100%);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #fff;
  font-weight: 700;
  letter-spacing: .02em;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}
.prog-badge b {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .82em;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin-right: 1px;
}

/* Tier — gold border + gold "T" prefix, white Roman numeral */
.prog-badge--tier {
  border-color: var(--gold-soft);
}
/* Enhancement — grade-accent border (color is set per-item via --g-color) */
.prog-badge--enh {
  border-color: var(--g-color, var(--gold-bright));
  box-shadow:
    0 1px 3px rgba(0, 0, 0, .45),
    0 0 6px color-mix(in srgb, var(--g-color, transparent) 35%, transparent);
  /* Enhancement is the primary visual indicator — slight emphasis */
  font-size: 1.02em;
}
/* Forge — uses xdraco's official gem disc (img-dragon-reforge-blue.webp).
   The pill becomes a circular badge with the gem as its full background;
   the step number sits inside on the blue glass dome for info density. */
.prog-badge--forge {
  width: 1em;                 /* scaled by font-size of the size variant */
  height: 1em;
  padding: 0;
  background:
    url('https://file.mir4global.com/xdraco/dist/img/common/card/img-dragon-reforge-blue.webp')
    center / contain no-repeat;
  border: none;
  border-radius: 50%;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, .55),
    0 0 6px rgba(58, 168, 255, .35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8em;           /* gem disc sized larger than other pills */
}
.prog-badge--forge .prog-badge-forge-step {
  font-family: var(--font-num);
  font-weight: 800;
  font-size: .42em;
  color: #fff;
  text-shadow: 0 1px 1px #000, 0 0 3px rgba(0, 0, 0, .9);
  letter-spacing: -.02em;
  /* Sit slightly above center so the number is on the blue dome,
     not the bottom gold rim */
  margin-top: -.18em;
  line-height: 1;
}
/* Forged — text pill ("Forged II"). Forging requires a Tier IV base, so this
   replaces the tier badge entirely. Blue glass to echo the reforge gem. */
.prog-badge--forged {
  border-color: #3aa8ff;
  color: #cfe9ff;
  background: linear-gradient(180deg, #0a1622 0%, #04101c 100%);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, .45),
    0 0 6px rgba(58, 168, 255, .35);
  text-transform: uppercase;
  letter-spacing: .04em;
}
/* Red variant for .refine.red items (rare — reserved for future use) */
.prog-badge--forge.red {
  background-image: url('https://file.mir4global.com/xdraco/dist/img/common/card/img-dragon-reforge-red.webp');
  box-shadow:
    0 1px 3px rgba(0, 0, 0, .55),
    0 0 6px rgba(255, 70, 90, .35);
}

/* ── Size variants ─────────────────────────────────────────────── */
/* lg — card modal centered row, positioned over the art/info seam */
.prog-badges--lg {
  gap: 8px;
  font-size: 14px;
}
.prog-badges--lg .prog-badge { padding: 5px 12px; min-height: 26px; }
/* Inside the flip card, anchor the progression row (badges + primal slots)
   at the seam between art + info panel */
.nftp-card .card__layer.front .nftp-card-prog-row {
  position: absolute;
  top: calc(var(--card-padding-top) - 18px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

/* md — search results / NFT cards */
.prog-badges--md { font-size: 12.5px; gap: 5px; }
.prog-badges--md .prog-badge { padding: 3px 9px; min-height: 22px; }

/* sm — moderate density (e.g. equipment hover cards) */
.prog-badges--sm { font-size: 10.5px; gap: 4px; }
.prog-badges--sm .prog-badge { padding: 2px 7px; min-height: 18px; }

/* xs — inventory thumb + equipment slot. Absolute-positioned along the
   bottom edge with corner padding so it never overlaps stack / primal. */
.prog-badges--xs {
  position: absolute;
  left: 50%;
  bottom: 3px;
  transform: translateX(-50%);
  gap: 3px;
  font-size: 9px;
  z-index: 4;
  max-width: calc(100% - 8px);
  pointer-events: none;
}
.prog-badges--xs .prog-badge {
  padding: 1.5px 5px;
  min-height: 14px;
  border-width: 1px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .55);
}
.prog-badges--xs .prog-badge b { font-size: .8em; }

/* When the cell is really tight (small inventory grids), wrap to single
   most-important badge: enhancement wins, others scrunch. Keep no truncation. */
@media (max-width: 600px) {
  .prog-badges--xs { gap: 2px; bottom: 2px; }
  .prog-badges--xs .prog-badge { padding: 1px 4px; font-size: 8.5px; }
}

/* ════════════════════════════════════════════════════════════════
   FLIP CARD — faithful port of xdraco's .card structure.
   All inner-element selectors (.card__layer, .wrap-item, .wrap-badge,
   .wrap-name, .wrap-thumb, .wrap-property, .no-options, .item-hole,
   .by-what, .power-score) match xdraco's HAR-extracted CSS so future
   reference is direct. Scoped under .nftp-card to avoid collisions.
   Variables follow xdraco's --card-* contract, scaled ~1.5× from
   their 240×344 default to 360×516 so items don't read as postage stamps.
   ════════════════════════════════════════════════════════════════ */
.nftp-card {
  /* xdraco's contract — scaled to a comfortable modal size */
  --card-width:               360px;
  --card-height:              516px;
  --card-padding-top:         254px;   /* offset before the white info panel */
  --card-padding-horizontal:   18px;
  --card-top-height:           30px;   /* where the item art starts */
  --card-margin-text:          39px;   /* gap from padding-top to wrap-name */
  --card-margin-itemname:      54px;
  --card-margin-space:          6px;
  --card-thumb-width:          36px;
  --card-badge-size:           58px;
  --card-name-height:          78px;
  --card-item-name-fontsize:   22px;
  --card-item-type-fontsize:   13px;
  --card-power-fontsize:       22px;
  --card-divider-width:       278px;
  --card-divider-margin:        6px;
  --card-class-size:           48px;

  width: var(--card-width);
  height: var(--card-height);
  max-width: 92vw;
  max-height: 92vh;
  perspective: 1400px;
  cursor: pointer;
  contain: content;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
/* Compact card on small viewports — keep aspect, shrink everything */
@media (max-width: 480px) {
  .nftp-card {
    --card-width:                280px;
    --card-height:               401px;
    --card-padding-top:          197px;
    --card-padding-horizontal:    14px;
    --card-top-height:            24px;
    --card-margin-text:           30px;
    --card-margin-itemname:       42px;
    --card-thumb-width:           28px;
    --card-badge-size:            46px;
    --card-name-height:           62px;
    --card-item-name-fontsize:    18px;
    --card-item-type-fontsize:    12px;
    --card-power-fontsize:        18px;
  }
}

.nftp-card .card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  color: #fff;
  text-align: center;
  transform-style: preserve-3d;
  transition: transform .5s ease;
}
.nftp-card.flipped .card__inner { transform: rotateY(180deg); }

.nftp-card .card__layer {
  position: absolute;
  z-index: 1;
  padding: var(--card-padding-top) 0 0;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  background:
    url('https://file.mir4global.com/xdraco/dist/img/common/card/sp-card.webp')
    0 0 / calc(var(--card-width) * 5) calc(var(--card-height) * 6) no-repeat;
  box-sizing: border-box;
}
.nftp-card .card__layer.front {
  padding-right: var(--card-padding-horizontal);
  padding-left: var(--card-padding-horizontal);
  /* Column 3 of the sprite — the item-detail front face (rays + white panel) */
  background-position-x: calc(var(--card-width) * -3);
}
.nftp-card .card__layer.back {
  padding: 11px 14px;
  color: #fff;
  font-size: 14px;
  /* Column 4 of the sprite — clean colored back panel ("D" watermark) */
  background-position-x: calc(var(--card-width) * -4);
  transform: rotateY(180deg);
}
/* Grade row mapping — Y offset = (6 - grade) * card-height */
.nftp-card[data-item-type="item-grade-6"] .card__layer { background-position-y: 0; }
.nftp-card[data-item-type="item-grade-5"] .card__layer { background-position-y: calc(var(--card-height) * -1); }
.nftp-card[data-item-type="item-grade-4"] .card__layer { background-position-y: calc(var(--card-height) * -2); }
.nftp-card[data-item-type="item-grade-3"] .card__layer { background-position-y: calc(var(--card-height) * -3); }
.nftp-card[data-item-type="item-grade-2"] .card__layer { background-position-y: calc(var(--card-height) * -4); }
.nftp-card[data-item-type="item-grade-1"] .card__layer { background-position-y: calc(var(--card-height) * -5); }

/* Glow ring + drop shadow on the card itself */
.nftp-card .card__inner::before {
  content: '';
  position: absolute;
  inset: -2px;
  pointer-events: none;
  border-radius: 4px;
  box-shadow:
    0 20px 60px rgba(0,0,0,.7),
    0 0 36px var(--g-glow, rgba(255,255,255,.08));
  z-index: -1;
}

/* ── FRONT FACE ── absolute-positioned overlays + flow-positioned name ── */

/* Small "draco" emblem top-left, mirrors xdraco's .by-what */
.nftp-card .card__layer.front .by-what {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,.45);
  border: 1.5px solid rgba(255,255,255,.55);
  box-shadow: inset 0 0 6px rgba(0,0,0,.5);
  z-index: 3;
  pointer-events: none;
}
.nftp-card .card__layer.front .by-what.draco::after {
  content: '';
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,.4), transparent 60%),
    radial-gradient(circle, rgba(255,255,255,.78), rgba(255,255,255,.35) 60%, transparent 80%);
}

/* Power score top-right — xdraco's .power-score with .icon-power.webp prefix */
.nftp-card .card__layer.front .power-score {
  display: flex;
  position: absolute;
  top: 18px;
  right: 18px;
  line-height: 1.2;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -.05em;
  margin: 0;
  z-index: 3;
  text-shadow: 0 1px 2px rgba(0,0,0,.85);
  font-variant-numeric: tabular-nums;
}
.nftp-card .card__layer.front .power-score::before {
  content: '';
  display: block;
  margin-right: 4px;
  width: 20px;
  height: 20px;
  background:
    url('https://file.mir4global.com/xdraco/dist/img/common/card/icon-power.webp')
    0 0 / cover no-repeat;
}
.nftp-card .card__layer.front .power-score dt {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.nftp-card .card__layer.front .power-score dd { margin: 0; }

/* Item art */
.nftp-card .card__layer.front .wrap-item {
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: var(--card-top-height);
  left: 0;
  width: 100%;
  box-sizing: border-box;
}
.nftp-card .card__layer.front .wrap-item .item {
  width: 192px;             /* 128 * 1.5 to match the scaled card */
  max-width: 60%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,.55));
}

/* Item-hole (primal slot) — uses xdraco's sp-item-hole sprite */
.nftp-card .card__layer.front .item-hole {
  --bg-ratio: 4;
  --bg-size-width:  calc(256px / var(--bg-ratio));
  --bg-size-height: calc(512px / var(--bg-ratio));
  --item-hole-size: 24px;
  position: absolute;
  top: 134px;
  right: 18px;
  width: var(--item-hole-size);
  height: var(--item-hole-size);
  display: inline-flex;
  border-radius: 50%;
  background:
    url('https://file.mir4global.com/xdraco/dist/img/common/sp-item-hole.webp')
    0 0 / var(--bg-size-width) var(--bg-size-height) no-repeat;
  z-index: 4;
  pointer-events: none;
}
.nftp-card .card__layer.front .item-hole[data-hole-count="1"] { background-position-y: 0; }
.nftp-card .card__layer.front .item-hole[data-hole-count="2"] { background-position-y: calc(var(--item-hole-size) * -1); }
.nftp-card .card__layer.front .item-hole[data-hole-count="3"] { background-position-y: calc(var(--item-hole-size) * -2); }
.nftp-card .card__layer.front .item-hole[data-hole-count="4"] { background-position-y: calc(var(--item-hole-size) * -3); }
.nftp-card .card__layer.front .item-hole.item-hole--special { background-position-x: calc(var(--item-hole-size) * -1); }
.nftp-card .card__layer.front .item-hole--lg { --item-hole-size: 24px; --bg-ratio: 5.333; }
/* Inline variant — sits in the centered progression row instead of floating
   over the artwork (top/right reset, flows with the tier/forge/enh pills) */
.nftp-card .card__layer.front .item-hole--inline {
  position: relative;
  top: auto;
  right: auto;
  flex: 0 0 auto;
}

/* Badge strip (Tier + Depth pills sitting over the seam) */
.nftp-card .card__layer.front .wrap-badge {
  display: flex;
  justify-content: center;
  position: absolute;
  top: calc(var(--card-padding-top) - var(--card-badge-size) / 2);
  left: 0;
  width: 100%;
  gap: 8px;
  z-index: 3;
}
.nftp-card .card__layer.front .wrap-badge .badge {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: var(--card-badge-size);
  height: var(--card-badge-size);
  margin: 0;
  background:
    url('https://file.mir4global.com/xdraco/dist/img/common/card/sp-badge-card.webp')
    0 0 / calc(var(--card-badge-size) * 2) auto no-repeat;
  color: #fff;
  font-weight: 700;
  line-height: 1;
}
/* dt is the screen-reader label — the orange diamond sprite IS the visual
   indicator, so the text is hidden visually (matches xdraco). */
.nftp-card .card__layer.front .wrap-badge .badge dt {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden;
  clip: rect(0 0 0 0);
  font-size: 0;
  margin: 0;
}
.nftp-card .card__layer.front .wrap-badge .badge dd {
  margin: 0;
  font-size: 18px;
  letter-spacing: -.02em;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.nftp-card .card__layer.front .wrap-badge .badge.tier dd { font-size: 19px; }
/* Grade-driven Y on the badge sprite (same row mapping as the card sprite) */
.nftp-card[data-item-type="item-grade-6"] .wrap-badge .badge { background-position-y: 0; }
.nftp-card[data-item-type="item-grade-5"] .wrap-badge .badge { background-position-y: calc(var(--card-badge-size) * -1); }
.nftp-card[data-item-type="item-grade-4"] .wrap-badge .badge { background-position-y: calc(var(--card-badge-size) * -2); }
.nftp-card[data-item-type="item-grade-3"] .wrap-badge .badge { background-position-y: calc(var(--card-badge-size) * -3); }
.nftp-card[data-item-type="item-grade-2"] .wrap-badge .badge { background-position-y: calc(var(--card-badge-size) * -4); }
.nftp-card[data-item-type="item-grade-1"] .wrap-badge .badge { background-position-y: calc(var(--card-badge-size) * -5); }
/* Non-tier badges shift one column right on the badge sprite (Tier vs other) */
.nftp-card .card__layer.front .wrap-badge .badge:not(.tier) {
  background-position-x: calc(var(--card-badge-size) * -1);
  color: #000;
}
.nftp-card .card__layer.front .wrap-badge .badge:not(.tier) dt { color: rgba(0,0,0,.65); }

/* Name + type — in normal flow, lands on the sprite's white info panel */
.nftp-card .card__layer.front .wrap-name {
  margin-top: var(--card-margin-text);
  position: relative;
  z-index: 1;
}
.nftp-card .card__layer.front .wrap-name .name {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  min-height: var(--card-name-height);
  margin: 0;
  line-height: 1.2;
}
.nftp-card .card__layer.front .wrap-name dt {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.nftp-card .card__layer.front .wrap-name .item-name {
  padding: 0 var(--card-margin-itemname);
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--card-item-name-fontsize);
  font-weight: 700;
  line-height: 1.14;
  color: #000;
  letter-spacing: -.02em;
}
.nftp-card .card__layer.front .wrap-name .item-type {
  padding: 0 14px;
  margin: 2px 0 0;
  color: rgba(0,0,0,.55);
  font-family: var(--font-ui);
  font-size: var(--card-item-type-fontsize);
  font-weight: 500;
  letter-spacing: .02em;
}

/* Class thumbnail strip — bottom of the front face */
.nftp-card .card__layer.front .wrap-thumb {
  display: flex;
  justify-content: center;
  position: absolute;
  bottom: 6%;
  left: 0;
  width: 100%;
  -moz-column-gap: 2px;
  column-gap: 2px;
  pointer-events: none;
}
.nftp-card .card__layer.front .wrap-thumb .thumb {
  width: var(--card-thumb-width);
  height: var(--card-thumb-width);
  line-height: 0;
  font-size: 0;
  color: transparent;        /* hide the text node ("warrior", "sorcerer", …) */
  background:
    url('https://file.mir4global.com/xdraco/dist/img/common/card/sp-thumbs-character.webp')
    0 0 / calc(var(--card-thumb-width) * 7) auto no-repeat;
  background-position-y: calc(var(--card-thumb-width) * -3); /* default inactive row */
}
/* Column = class, from xdraco's exact rules */
.nftp-card .card__layer.front .wrap-thumb .thumb.warrior   { background-position-x: 0; }
.nftp-card .card__layer.front .wrap-thumb .thumb.sorcerer  { background-position-x: calc(var(--card-thumb-width) * -1); }
.nftp-card .card__layer.front .wrap-thumb .thumb.taoist    { background-position-x: calc(var(--card-thumb-width) * -2); }
.nftp-card .card__layer.front .wrap-thumb .thumb.lancer    { background-position-x: calc(var(--card-thumb-width) * -3); }
.nftp-card .card__layer.front .wrap-thumb .thumb.arbalist  { background-position-x: calc(var(--card-thumb-width) * -4); }
.nftp-card .card__layer.front .wrap-thumb .thumb.darkist   { background-position-x: calc(var(--card-thumb-width) * -5); }
.nftp-card .card__layer.front .wrap-thumb .thumb.lionheart { background-position-x: calc(var(--card-thumb-width) * -6); }
/* Grade-driven Y for inactive thumbs */
.nftp-card[data-item-type="item-grade-6"] .wrap-thumb .thumb { background-position-y: calc(var(--card-thumb-width) * -3); }
.nftp-card[data-item-type="item-grade-5"] .wrap-thumb .thumb { background-position-y: calc(var(--card-thumb-width) * -2); }
.nftp-card[data-item-type="item-grade-4"] .wrap-thumb .thumb { background-position-y: calc(var(--card-thumb-width) * -1); }
.nftp-card[data-item-type="item-grade-3"] .wrap-thumb .thumb { background-position-y: 0; }
.nftp-card[data-item-type="item-grade-2"] .wrap-thumb .thumb { background-position-y: calc(var(--card-thumb-width) * -1); }
.nftp-card[data-item-type="item-grade-1"] .wrap-thumb .thumb { background-position-y: 0; }
/* Active thumb (aria-enabled="true") jumps to the bottom-half color row */
.nftp-card .card__layer.front .wrap-thumb .thumb[aria-enabled="true"] { background-position-y: calc(var(--card-thumb-width) * -4); }
.nftp-card[data-item-type="item-grade-6"] .wrap-thumb .thumb[aria-enabled="true"] { background-position-y: calc(var(--card-thumb-width) * -7); }
.nftp-card[data-item-type="item-grade-5"] .wrap-thumb .thumb[aria-enabled="true"] { background-position-y: calc(var(--card-thumb-width) * -6); }
.nftp-card[data-item-type="item-grade-4"] .wrap-thumb .thumb[aria-enabled="true"] { background-position-y: calc(var(--card-thumb-width) * -5); }
.nftp-card[data-item-type="item-grade-3"] .wrap-thumb .thumb[aria-enabled="true"] { background-position-y: calc(var(--card-thumb-width) * -4); }
.nftp-card[data-item-type="item-grade-2"] .wrap-thumb .thumb[aria-enabled="true"] { background-position-y: calc(var(--card-thumb-width) * -5); }
.nftp-card[data-item-type="item-grade-1"] .wrap-thumb .thumb[aria-enabled="true"] { background-position-y: calc(var(--card-thumb-width) * -4); }

/* ── BACK FACE ── property rows + description ────────────────────────── */
.nftp-card .card__layer.back .back__inner {
  overflow-y: auto;
  max-height: 100%;
  padding: 11px 14px;
  scrollbar-width: thin;
}
.nftp-card .card__layer.back .back__inner::-webkit-scrollbar { width: 4px; background: rgba(0,0,0,.06); }
.nftp-card .card__layer.back .back__inner::-webkit-scrollbar-track { box-shadow: inset 0 0 6px rgba(0,0,0,.3); }
.nftp-card .card__layer.back .back__inner::-webkit-scrollbar-thumb { background: rgba(0,0,0,.4); border-radius: 2px; }

.nftp-card .card__layer.back .wrap-property {
  margin: 16px 0 14px;
  text-align: left;
}
.nftp-card .card__layer.back .wrap-property:first-of-type { margin-top: 0; }
.nftp-card .card__layer.back .wrap-property .property {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,.2);
  padding: 6px 0;
  line-height: 1.3;
  font-size: 13px;
  color: #fff;
  margin: 0;
}
.nftp-card .card__layer.back .wrap-property .property:last-child { border-bottom: none; }
.nftp-card .card__layer.back .wrap-property .property dt {
  margin: 0;
  letter-spacing: -.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
  word-break: break-word;
}
.nftp-card .card__layer.back .wrap-property .property.line-break dt,
.nftp-card .card__layer.back .wrap-property .property dt.line-break {
  white-space: normal;
  line-height: 1.15;
  font-size: 12px;
}
.nftp-card .card__layer.back .wrap-property .property dd {
  margin: 0;
  font-family: var(--font-num);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.nftp-card .card__layer.back .wrap-property .property.power-score,
.nftp-card .card__layer.back .wrap-property .property.unique-number {
  font-weight: 700;
  border-bottom-color: rgba(255,255,255,.5);
}
.nftp-card .card__layer.back .wrap-property .property.power-score dd { font-size: 18px; }
.nftp-card .card__layer.back .wrap-property--add .property dd { color: var(--violet2); }

.nftp-card .card__layer.back .no-options {
  margin: 16px 0 0;
  line-height: 1.4;
  text-align: left;
}
.nftp-card .card__layer.back .no-options:first-of-type { margin-top: 0; }
.nftp-card .card__layer.back .no-options dt {
  display: block;
  margin-bottom: 7px;
  line-height: 1.14;
  font-weight: 700;
}
.nftp-card .card__layer.back .no-options dt:empty { display: none; }
.nftp-card .card__layer.back .no-options dd {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}

/* Make inventory + equipment items visibly clickable */
.nftp-inv-item,
.nftp-equip-slot {
  cursor: pointer;
}
/* Summary row responsive */
@media (max-width: 1200px) {
  .nftp-stat-sum-row { grid-template-columns: 1.3fr repeat(3, 1fr) auto; }
  .nftp-stat-sum-row .nftp-stat-sum-cell:nth-child(n+5):nth-last-child(n+2) { display: none; }
}
@media (max-width: 720px) {
  .nftp-stat-sum-row { grid-template-columns: 1fr auto; }
  .nftp-stat-sum-row .nftp-stat-sum-cell:not(.nftp-stat-sum-ps) { display: none; }
}

/* ── SKILLS ── xdraco-style red-glow circles in a single horizontal row ── */
.nftp-skill-section {
  max-width: 1500px;
  margin: 0 auto 28px;
  padding: 0 36px;
}
.nftp-skill-section-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .04em;
  margin-bottom: 16px;
}
.nftp-skill-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Big "Tier 10" class signature skill */
.nftp-skill-tier {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-right: 8px;
  flex-shrink: 0;
}
.nftp-skill-tier-label {
  background: linear-gradient(180deg, #1a0410 0%, #2a0612 100%);
  border: 2px solid #d61c2e;
  border-radius: 999px;
  padding: 3px 12px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .04em;
  box-shadow: 0 0 10px rgba(214,28,46,.55);
  white-space: nowrap;
}

/* Skill icon — circle with sprite background + red ring.
   Uses box-sizing:border-box and background-clip:content-box so the
   border doesn't overlap or clip the icon. */
.nftp-skill-icon {
  width: 50px;
  height: 50px;
  box-sizing: border-box;
  background-image: url('https://file.mir4global.com/xdraco/dist/img/common/nft-detail/sp-skill.webp');
  background-repeat: no-repeat;
  background-clip: content-box;
  background-origin: content-box;
  border-radius: 50%;
  border: 2px solid #d61c2e;
  box-shadow:
    0 0 8px rgba(214,28,46,.7),
    inset 0 0 8px rgba(0,0,0,.5);
  position: relative;
  overflow: hidden;
  /* background-size + background-position set inline per icon */
}
.nftp-skill-icon--big {
  width: 76px;
  height: 76px;
  border-width: 3px;
  box-shadow:
    0 0 14px rgba(214,28,46,.85),
    0 0 6px rgba(214,28,46,.4),
    inset 0 0 10px rgba(0,0,0,.5);
}
/* Unlearned skill (level 0) — xdraco's `disabled` state: greyed + dim ring */
.nftp-skill-icon.nftp-skill-off {
  filter: grayscale(1) brightness(.55);
  border-color: #555;
  box-shadow: inset 0 0 8px rgba(0,0,0,.6);
}

/* Regular skill — circle + level badge below (static, no animations) */
.nftp-skill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  cursor: default;
}

/* Small level badge — sits just below the icon (overlapping slightly) */
.nftp-skill-lv {
  margin-top: -10px;
  z-index: 2;
  background: linear-gradient(180deg, #1a0410 0%, #2a0612 100%);
  border: 1.5px solid #d61c2e;
  border-radius: 999px;
  min-width: 22px;
  height: 18px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  box-shadow: 0 0 6px rgba(214,28,46,.5);
}

@media (max-width: 720px) {
  .nftp-skill-section { padding: 0 16px; }
  .nftp-skill-icon { width: 42px; height: 42px; }
  .nftp-skill-icon--big { width: 60px; height: 60px; }
  .nftp-skill-row { gap: 5px; }
}

/* ── SPIRIT ── xdraco-style decks with gold-portrait cards ── */
.nftp-spirit-section {
  max-width: 1500px;
  margin: 0 auto 28px;
  padding: 0 36px;
}
.nftp-spirit-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.nftp-spirit-section-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .04em;
}
.nftp-spirit-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.nftp-spirit-tabs-label {
  font-family: var(--font-ui);
  font-size: 12px;
  color: rgba(255,255,255,.55);
  letter-spacing: .1em;
  margin-right: 8px;
}
.nftp-spirit-tab {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.5);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .12s, border-color .12s;
  line-height: 1;
}
.nftp-spirit-tab:hover { color: var(--text); }
.nftp-spirit-tab.active {
  color: #fff;
  border-bottom-color: var(--crimson);
}

.nftp-spirit-panel {
  background: linear-gradient(180deg, rgba(20,18,40,.55) 0%, rgba(8,6,16,.4) 100%);
  border: 1px solid rgba(255,255,255,.06);
  padding: 22px 18px;
}

/* Deck view: fixed 5-column × 2-row grid so all 10 deck slots align cleanly */
.nftp-spirit-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px 0;
}
/* "All" view: auto-fill so however many spirits the profile owns flows nicely */
.nftp-spirit-grid--all {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 18px 0;
}
.nftp-spirit-grid--all .nftp-spirit-card:nth-child(5n) { border-right: 1px solid rgba(255,255,255,.04); }
.nftp-spirit-grid--all .nftp-spirit-card:last-child { border-right: none; }
.nftp-spirit-all-count {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,.05);
}

.nftp-spirit-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-right: 1px solid rgba(255,255,255,.04);
  text-align: center;
  cursor: default;
}
.nftp-spirit-card:nth-child(5n) { border-right: none; }

/* Wrap around the portrait so the tier badge can sit OUTSIDE the round-clipped portrait */
.nftp-spirit-portrait-wrap {
  position: relative;
  width: 92px;
  height: 92px;
}
.nftp-spirit-portrait {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
.nftp-spirit-portrait::after {
  /* subtle inner ring shine */
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 2px 8px rgba(255,235,180,.18), inset 0 -2px 6px rgba(0,0,0,.35);
  pointer-events: none;
}
/* Empty slot — keeps the same circular footprint as a filled spirit,
   but uses an inner radial gradient to read as "vacant socket" rather
   than an outlined hole. Subtle, dark, still has presence. */
.nftp-spirit-portrait--empty {
  background:
    radial-gradient(circle at 50% 45%,
      rgba(60, 50, 80, .35) 0%,
      rgba(28, 22, 42, .55) 45%,
      rgba(10, 8, 18, .9) 100%);
  border: 1px solid rgba(255, 255, 255, .06);
  box-shadow:
    inset 0 4px 14px rgba(0, 0, 0, .55),
    inset 0 -2px 6px rgba(255, 255, 255, .03);
}
.nftp-spirit-portrait--empty::after {
  /* Subtle inner ring — overrides the default shine */
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, .08);
  box-shadow: none;
  pointer-events: none;
}
.nftp-spirit-icon {
  width: 76%;
  height: 76%;
  object-fit: contain;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.5));
}
/* Tier badge — sits at bottom-left, OUTSIDE the round portrait (in the wrap)
   so the circle's overflow:hidden doesn't clip it. Made prominent because
   tier level matters significantly for a buyer evaluating a character. */
.nftp-spirit-tier {
  position: absolute;
  bottom: -4px;
  left: -4px;
  z-index: 3;
  width: 30px;
  height: 30px;
  background:
    url('https://file.mir4global.com/xdraco/dist/img/common/nft-detail/spirit-tier-badge.webp')
    center/contain no-repeat,
    radial-gradient(circle, #1a1a22 0%, #050508 100%);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: #ffe98a;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  letter-spacing: .02em;
  box-shadow:
    0 0 8px rgba(255, 224, 130, .35),
    0 2px 6px rgba(0, 0, 0, .6);
  text-shadow:
    0 0 4px rgba(255, 224, 130, .6),
    0 1px 2px #000,
    0 -1px 1px #000;
}
.nftp-spirit-name {
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  /* Reserve full 2-line height so the origin line below sits at a fixed Y,
     and the next row of cards aligns regardless of name length. */
  height: 30px;
}
.nftp-spirit-name--empty {
  color: rgba(255,255,255,.25);
  font-weight: 400;
}
.nftp-spirit-origin {
  font-family: var(--font-ui);
  font-size: 11px;
  color: rgba(255,255,255,.45);
  letter-spacing: .03em;
  min-height: 14px;
}
.nftp-spirit-card--empty .nftp-spirit-origin { color: transparent; }

@media (max-width: 980px) {
  .nftp-spirit-grid { grid-template-columns: repeat(5, 1fr); gap: 14px 0; }
  .nftp-spirit-portrait-wrap { width: 78px; height: 78px; }
}
@media (max-width: 720px) {
  .nftp-spirit-section { padding: 0 16px; }
  .nftp-spirit-grid { grid-template-columns: repeat(3, 1fr); gap: 12px 0; }
  .nftp-spirit-card { border-right: none; }
  .nftp-spirit-portrait-wrap { width: 70px; height: 70px; }
}

/* ── MAGICAL SOUL ORB / SPECIAL MAGIC ORB / DRAGON ARTIFACT ───── */
.nftp-mo-active-badge {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,.55);
  letter-spacing: .02em;
  margin-left: 10px;
}

.nftp-mo-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 6), 1fr);
  gap: 16px 0;
}
.nftp-mo-grid--all {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 18px 0;
}

.nftp-mo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-right: 1px solid rgba(255,255,255,.04);
  text-align: center;
  cursor: default;
}
.nftp-mo-card:last-child { border-right: none; }

.nftp-mo-portrait-wrap {
  position: relative;
  width: 92px;
  height: 92px;
}
.nftp-mo-portrait {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
.nftp-mo-portrait::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 2px 8px rgba(255,235,180,.18), inset 0 -2px 6px rgba(0,0,0,.35);
  pointer-events: none;
}
.nftp-mo-icon {
  width: 70%;
  height: 70%;
  object-fit: contain;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.5));
}
/* Tier / level (Roman) — bottom-left, OUTSIDE the round portrait */
.nftp-mo-tier {
  position: absolute;
  bottom: -4px;
  left: -4px;
  z-index: 3;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  background:
    url('https://file.mir4global.com/xdraco/dist/img/common/nft-detail/spirit-tier-badge.webp')
    center/contain no-repeat,
    radial-gradient(circle, #1a1a22 0%, #050508 100%);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: #ffe98a;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  letter-spacing: .02em;
  box-shadow: 0 0 8px rgba(255,224,130,.35), 0 2px 6px rgba(0,0,0,.6);
  text-shadow: 0 0 4px rgba(255,224,130,.6), 0 1px 2px #000;
}
.nftp-mo-enh {
  position: absolute;
  top: -2px;
  right: -2px;
  z-index: 3;
  padding: 2px 8px;
  background: linear-gradient(180deg, #1a0410 0%, #2a0612 100%);
  border: 1px solid var(--crimson);
  border-radius: 999px;
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  letter-spacing: .02em;
}

/* Locked / empty slot — uses the same dark gradient as empty spirit slot */
.nftp-mo-portrait--locked {
  background:
    radial-gradient(circle at 50% 45%,
      rgba(60, 50, 80, .35) 0%,
      rgba(28, 22, 42, .55) 45%,
      rgba(10, 8, 18, .9) 100%);
  border: 1px solid rgba(255,255,255,.06);
  box-shadow:
    inset 0 4px 14px rgba(0,0,0,.55),
    inset 0 -2px 6px rgba(255,255,255,.03);
}
.nftp-mo-portrait--locked::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px dashed rgba(255,255,255,.08);
  box-shadow: none;
  pointer-events: none;
}
.nftp-mo-locked-label {
  font-family: var(--font-ui);
  font-size: 12px;
  color: rgba(255,255,255,.35);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.nftp-mo-lock-ico {
  font-size: 11px;
  opacity: .7;
}

.nftp-mo-name {
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.nftp-mo-name--empty {
  color: rgba(255,255,255,.35);
  font-weight: 400;
}

/* ── MAGIC STONE ── 12 slots split into 9 (main) + 3 (sub) panels,
   horizontal cards (icon left, name right) ── */
.nftp-stone-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 18px;
  padding: 22px 24px;
  background: linear-gradient(180deg, rgba(20,18,40,.55) 0%, rgba(8,6,16,.4) 100%);
  border: 1px solid rgba(255,255,255,.06);
}
.nftp-stone-grid--sub {
  margin-top: 10px;
}
.nftp-stone-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px;
}
.nftp-stone-portrait-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}
.nftp-stone-portrait {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,.4);
}
.nftp-stone-portrait::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 2px 8px rgba(255,235,180,.15), inset 0 -2px 6px rgba(0,0,0,.35);
  pointer-events: none;
}
.nftp-stone-icon {
  width: 78%;
  height: 78%;
  object-fit: contain;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.5));
}
/* +N enhance — top-right of portrait */
.nftp-stone-enh {
  position: absolute;
  top: -2px;
  right: -4px;
  z-index: 3;
  padding: 2px 7px;
  background: linear-gradient(180deg, #1a0410 0%, #2a0612 100%);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  letter-spacing: .02em;
  text-shadow: 0 1px 2px rgba(0,0,0,.7);
}
/* Trance tier badge — bottom-left of portrait */
.nftp-stone-tier {
  position: absolute;
  bottom: -3px;
  left: -3px;
  z-index: 3;
  width: 22px;
  height: 22px;
  background:
    url('https://file.mir4global.com/xdraco/dist/img/common/nft-detail/spirit-tier-badge.webp')
    center/contain no-repeat,
    radial-gradient(circle, #1a1a22 0%, #050508 100%);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  color: #ffe98a;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  text-shadow: 0 1px 2px #000;
}
.nftp-stone-name {
  flex: 1;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  line-height: 1.25;
  letter-spacing: .01em;
  min-width: 0;
}
.nftp-stone-card--empty .nftp-stone-name {
  color: rgba(255,255,255,.25);
}

@media (max-width: 980px) {
  .nftp-stone-grid { grid-template-columns: repeat(2, 1fr); padding: 16px 18px; gap: 12px 14px; }
  .nftp-stone-portrait-wrap { width: 56px; height: 56px; }
}
@media (max-width: 720px) {
  .nftp-stone-grid { grid-template-columns: 1fr; }
}

/* ── DRAGON ARTIFACT ── 10 slots fixed (5 per row, 2 rows) ── */
.nftp-dragon-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px 0;
}
/* ── TRAINING / CONQUEST / MYSTIQUE / COSMIC HARMONY / DRAGON DESCENT ── */
.nftp-section-title-plain {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .04em;
}

/* Generic gold-rim diamond (used by Training, Conquest, Mystique).
   The diamond SHAPE is a rotated ::before pseudo-element behind the text.
   The text itself never rotates, so it stays pixel-perfect centered.
   Background matches the equipment tier badge: dark radial + faint gold rim. */
.nftp-diamond {
  position: relative;
  width: 50px;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nftp-diamond::before {
  content: '';
  position: absolute;
  inset: 0;
  transform: rotate(45deg);
  background: radial-gradient(circle at 50% 45%, #1a1a22 0%, #050508 100%);
  border: 1px solid rgba(200, 168, 76, .55);
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,.3),
    0 2px 4px rgba(0,0,0,.4);
  z-index: 0;
}
.nftp-diamond > * {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.nftp-diamond-tier {
  font-family: var(--font-ui);
  font-size: 8px;
  color: rgba(255, 224, 130, .70);
  letter-spacing: .08em;
  margin-bottom: 2px;
  text-transform: uppercase;
}
.nftp-diamond-val {
  font-family: var(--font-num);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .02em;
}
/* Training — single uniform size for every tier */
.nftp-diamond--train {
  width: 52px;
  height: 52px;
}
.nftp-diamond--train .nftp-diamond-val { font-size: 17px; }
/* Conquest — slightly smaller, no Tier label */
.nftp-diamond--conq {
  width: 48px;
  height: 48px;
}
.nftp-diamond--conq .nftp-diamond-val { font-size: 16px; }
.nftp-diamond--mystique {
  width: 42px;
  height: 42px;
}
/* Responsive diamond sizing — keep the same shape, scale uniformly.
   Tier label inside the diamond drops to 7px on phones; numeric value
   keeps reasonable contrast at smaller sizes via tighter padding. */
@media (max-width: 720px) {
  .nftp-diamond--train { width: 44px; height: 44px; }
  .nftp-diamond--train .nftp-diamond-val { font-size: 15px; }
  .nftp-diamond--conq  { width: 42px; height: 42px; }
  .nftp-diamond--conq  .nftp-diamond-val { font-size: 14px; }
  .nftp-diamond--mystique { width: 38px; height: 38px; }
  .nftp-diamond-tier { font-size: 7px; margin-bottom: 1px; }
}
@media (max-width: 420px) {
  .nftp-diamond--train { width: 38px; height: 38px; }
  .nftp-diamond--train .nftp-diamond-val { font-size: 13px; }
  .nftp-diamond--conq  { width: 36px; height: 36px; }
  .nftp-diamond--conq  .nftp-diamond-val { font-size: 12px; }
  .nftp-diamond-tier { font-size: 6px; }
}

/* ── Training panel ── */
.nftp-train-wrap {
  max-width: 1500px;
  margin: 0 auto 28px;
  padding: 4px 36px 0;            /* tighter top gap to title (was 16) */
}
.nftp-train-panel {
  display: flex;
  align-items: stretch;
  gap: 0;
  /* Top padding bumped to clear the diamond top-corner extension
     (52px diamond → ~11px). Matches Conquest for visual consistency. */
  padding: 32px 18px 22px;
  background: linear-gradient(180deg, rgba(20,18,40,.55) 0%, rgba(8,6,16,.4) 100%);
  border: 1px solid rgba(255,255,255,.06);
}
@media (max-width: 720px) {
  .nftp-train-wrap { padding: 4px 12px 0; margin-bottom: 20px; }
  .nftp-train-panel { padding: 26px 10px 16px; }   /* keep top clearance for rotated diamond */
  .nftp-train-col--side { padding: 0 12px; }
  /* row-gap then col-gap. 44px diamond → ~9px corner extension →
     column-gap must be >= ~18px to prevent overlap. */
  .nftp-train-col--manuals { padding: 0 10px; gap: 12px 22px; }
  .nftp-train-cell { gap: 10px; }
  .nftp-train-name { font-size: 11px; height: 38px; }
  .nftp-train-name--big { font-size: 13px; height: 38px; }
}
.nftp-train-col {
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.nftp-train-col--side {
  padding: 0 28px;
  border-right: 1px solid rgba(255,255,255,.06);
}
.nftp-train-col--side:last-child {
  border-right: none;
  border-left: 1px solid rgba(255,255,255,.06);
}
.nftp-train-col--manuals {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  /* row-gap column-gap. Column-gap is enlarged because the diamond
     SHAPE is a 52×52 square rotated 45° — its corners extend ~11px
     outside the bounding box on each side. With less than ~22px of
     column-gap, adjacent diamond corners visually overlap. 28px gives
     a clear gap with breathing room. */
  gap: 14px 28px;
  padding: 0 24px;
  align-items: start;
}
.nftp-train-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.nftp-train-name {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,.75);
  text-align: center;
  letter-spacing: .02em;
  line-height: 1.2;
  /* Fixed 3-line slot so every manual cell has identical name-row height.
     With identical cell heights, the diamonds line up on the same Y axis
     regardless of whether the name wraps to 1, 2, or 3 lines. */
  height: 46px;
  display: flex;
  align-items: flex-end;  /* short names hug the diamond above; tall names fill */
  justify-content: center;
}
.nftp-train-name--big {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  height: 46px;
  align-items: flex-end;
}

/* ── Conquest panel ── */
.nftp-conq-wrap {
  max-width: 1500px;
  margin: 0 auto 28px;
  padding: 4px 36px 0;             /* tighter top gap to title (was 16) */
}
.nftp-conq-panel {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  /* row-gap column-gap. Same rotation-aware sizing as Training —
     48×48 diamond extends ~10px past its bbox on each side, so
     a column-gap of 22px guarantees no diamond-corner overlap. */
  gap: 14px 22px;
  /* Top padding accounts for the diamond top-corner that extends
     ~10px above its bbox. 32px top vs. 22px sides keeps ~20px
     visual breathing room above the first row of diamonds. */
  padding: 32px 22px 22px;
  background: linear-gradient(180deg, rgba(20,18,40,.55) 0%, rgba(8,6,16,.4) 100%);
  border: 1px solid rgba(255,255,255,.06);
}
@media (max-width: 720px) {
  .nftp-conq-wrap { padding: 4px 12px 0; margin-bottom: 20px; }
  .nftp-conq-panel {
    grid-template-columns: repeat(4, 1fr);  /* 4 cols on phones (was 5 in 980px breakpoint) */
    /* 42px diamond at this breakpoint → ~9px corner extension →
       column-gap >= ~18px keeps diamond corners apart.
       Top padding (26) clears the diamond top-corner. */
    gap: 12px 20px;
    padding: 26px 12px 16px;
  }
  .nftp-conq-name { font-size: 10px; height: 24px; }
}
.nftp-conq-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}
.nftp-conq-name {
  font-family: var(--font-ui);
  font-size: 11px;
  color: rgba(255,255,255,.65);
  text-align: center;
  line-height: 1.2;
  letter-spacing: .02em;
  max-width: 100px;
  /* Fixed 2-line slot so the diamond row stays flush across all 10 cells */
  height: 28px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

/* ── Mystique panel ── */
.nftp-mystique-wrap {
  max-width: 1500px;
  margin: 0 auto 28px;
  padding: 4px 36px 0;
}
.nftp-mystique-panel {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  padding: 30px 22px;
  background: linear-gradient(180deg, rgba(20,18,40,.55) 0%, rgba(8,6,16,.4) 100%);
  border: 1px solid rgba(255,255,255,.06);
}
.nftp-mystique-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  border-right: 1px solid rgba(255,255,255,.04);
  padding: 0 8px;
}
.nftp-mystique-cell:last-child { border-right: none; }
.nftp-mystique-portrait {
  position: relative;
  width: 130px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 50%, color-mix(in srgb, var(--m-color, #f0c84a) 22%, transparent) 0%, transparent 70%);
}
.nftp-mystique-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.6))
          drop-shadow(0 0 10px color-mix(in srgb, var(--m-color, #f0c84a) 25%, transparent));
}
.nftp-mystique-name {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-align: center;
  line-height: 1.2;
  letter-spacing: .02em;
}

/* ── Cosmic Harmony panel ── */
.nftp-cosmic-wrap {
  max-width: 1500px;
  margin: 0 auto 28px;
  padding: 4px 36px 0;
}
.nftp-cosmic-panel {
  background: linear-gradient(180deg, rgba(20,18,40,.55) 0%, rgba(8,6,16,.4) 100%);
  border: 1px solid rgba(255,255,255,.06);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nftp-cosmic-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 12px 8px;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.nftp-cosmic-row:last-child { border-bottom: none; }
.nftp-cosmic-stage-mark {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.nftp-cosmic-stage-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.nftp-cosmic-stage-label {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.nftp-cosmic-stage-roman {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: rgba(255,255,255,.55);
  letter-spacing: .1em;
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 50%;
  text-align: center;
  line-height: 20px;
}
.nftp-cosmic-stage-meta { display: flex; flex-direction: column; gap: 2px; min-width: 120px; }
.nftp-cosmic-stage-progress {
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.75);
}
.nftp-cosmic-stage-name {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}
.nftp-cosmic-subs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nftp-cosmic-sub {
  position: relative;
  width: 46px;
  height: 46px;
}
.nftp-cosmic-sub-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.nftp-cosmic-sub.is-off {
  filter: grayscale(.4) brightness(.7);
}
.nftp-cosmic-sub-lv {
  position: absolute;
  bottom: -3px;
  right: -5px;
  background: #0a0a14;
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 1px 6px;
  font-family: var(--font-num);
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.nftp-cosmic-sub.is-off .nftp-cosmic-sub-lv {
  background: #0a0a14;
  border-color: rgba(255,255,255,.15);
  color: rgba(255,255,255,.55);
}

/* ── Divine Dragon Descent panel ── */
.nftp-dragondes-wrap {
  max-width: 1500px;
  margin: 0 auto 28px;
  padding: 4px 36px 0;
}
.nftp-dragondes-panel {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  padding: 24px 22px;
  background: linear-gradient(180deg, rgba(20,18,40,.55) 0%, rgba(8,6,16,.4) 100%);
  border: 1px solid rgba(255,255,255,.06);
}
.nftp-dragondes-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  background: rgba(0,0,0,.3);
  border: 1px solid rgba(255,255,255,.04);
}
.nftp-dragondes-orb {
  position: relative;
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
}
.nftp-dragondes-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* drop-shadow follows the image's alpha silhouette — no rectangular halo */
}
.nftp-dragondes-orb--red .nftp-dragondes-img {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .5));
}
.nftp-dragondes-orb--gold .nftp-dragondes-img {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .5));
}
.nftp-dragondes-orb--blue .nftp-dragondes-img {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .5));
}
.nftp-dragondes-progress {
  font-family: var(--font-num);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .02em;
}

/* ── Resource panel ── */
.nftp-resource-wrap {
  max-width: 1500px;
  margin: 0 auto 28px;
  padding: 4px 36px 0;
}
.nftp-resource-panel {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  padding: 22px 22px;
  background: linear-gradient(180deg, rgba(20,18,40,.55) 0%, rgba(8,6,16,.4) 100%);
  border: 1px solid rgba(255,255,255,.06);
}
.nftp-resource-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px;
  background: rgba(0,0,0,.3);
  border: 1px solid rgba(255,255,255,.04);
}
.nftp-resource-icon-wrap {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nftp-resource-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.5));
}
.nftp-resource-glyph {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}
.nftp-resource-label {
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 500;
  color: rgba(255,255,255,.6);
  text-align: center;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.nftp-resource-val {
  font-family: var(--font-num);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .02em;
}

/* ── Potential panel ── */
.nftp-potential-wrap {
  max-width: 1500px;
  margin: 0 auto 28px;
  padding: 4px 36px 0;
}
.nftp-potential-panel {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 22px 22px;
  background: linear-gradient(180deg, rgba(20,18,40,.55) 0%, rgba(8,6,16,.4) 100%);
  border: 1px solid rgba(255,255,255,.06);
}
.nftp-potential-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  background: rgba(0,0,0,.3);
  border: 1px solid rgba(255,255,255,.04);
  border-left: 3px solid var(--accent);
}
.nftp-potential-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,.8);
  letter-spacing: .05em;
  text-transform: uppercase;
}
.nftp-potential-val {
  font-family: var(--font-num);
  line-height: 1;
}
.nftp-potential-cur {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}
.nftp-potential-max {
  font-size: 13px;
  color: rgba(255,255,255,.45);
  margin-left: 4px;
}
.nftp-potential-bar {
  height: 6px;
  background: rgba(255,255,255,.06);
  border-radius: 3px;
  overflow: hidden;
}
.nftp-potential-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, white));
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent);
}

/* ── Scripture Hall + Codex shared panel ── */
.nftp-scripture-wrap,
.nftp-codex-wrap {
  max-width: 1500px;
  margin: 0 auto 28px;
  padding: 4px 36px 0;
}
.nftp-scripture-panel,
.nftp-codex-panel {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 22px 22px;
  background: linear-gradient(180deg, rgba(20,18,40,.55) 0%, rgba(8,6,16,.4) 100%);
  border: 1px solid rgba(255,255,255,.06);
}
.nftp-codex-panel {
  grid-template-columns: repeat(2, 1fr);
}
.nftp-scripture-cell,
.nftp-codex-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  background: rgba(0,0,0,.3);
  border: 1px solid rgba(255,255,255,.04);
  border-left: 3px solid var(--accent, #caa64b);
}
.nftp-scripture-cell { --accent: #b86bff; }
.nftp-scripture-head,
.nftp-codex-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.nftp-scripture-name,
.nftp-codex-name {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .03em;
}
.nftp-scripture-count,
.nftp-codex-count {
  font-family: var(--font-num);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
/* Codex roll-up — sits inline next to the "Codex" title, no pill, clean text */
.nftp-codex-title-group {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}
.nftp-codex-total {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-ui);
  /* gold hairline rule separates it from the title without a boxed pill */
  padding-left: 16px;
  border-left: 1px solid rgba(255,224,130,.28);
}
.nftp-codex-total-lbl {
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
}
.nftp-codex-total-val {
  font-family: var(--font-num);
  font-size: 17px;
  font-weight: 700;
  color: #ffe98a;
  line-height: 1;
}
.nftp-codex-total-val span {
  font-size: 12px;
  font-weight: 400;
  color: rgba(255,255,255,.4);
  margin-left: 1px;
}
.nftp-codex-total-pct {
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 700;
  color: #22d693;
}
.nftp-codex-total-inp {
  font-size: 11px;
  color: rgba(255,255,255,.45);
}
@media (max-width: 720px) {
  .nftp-codex-total { padding-left: 0; border-left: none; gap: 10px; }
  .nftp-codex-total-lbl { display: none; }
}
.nftp-scripture-count span,
.nftp-codex-count span {
  font-size: 12px;
  color: rgba(255,255,255,.45);
  font-weight: 400;
}
.nftp-scripture-bar,
.nftp-codex-bar {
  height: 6px;
  background: rgba(255,255,255,.06);
  border-radius: 3px;
  overflow: hidden;
}
.nftp-scripture-bar-fill,
.nftp-codex-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent, #caa64b), color-mix(in srgb, var(--accent, #caa64b) 55%, white));
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent, #caa64b) 60%, transparent);
}
.nftp-scripture-meta,
.nftp-codex-meta {
  display: flex;
  gap: 16px;
  font-family: var(--font-ui);
  font-size: 10.5px;
  letter-spacing: .04em;
}
.nftp-scripture-tag--done,
.nftp-codex-tag--done {
  color: color-mix(in srgb, var(--accent, #caa64b) 80%, white);
}
.nftp-scripture-tag--prog,
.nftp-codex-tag--prog {
  color: rgba(255,255,255,.55);
}

@media (max-width: 980px) {
  /* Keep the rotation-aware column-gap when columns reduce */
  .nftp-train-col--manuals { grid-template-columns: repeat(3, 1fr); gap: 18px 24px; }
  .nftp-conq-panel { grid-template-columns: repeat(5, 1fr); gap: 14px 20px; }
  .nftp-mystique-panel { grid-template-columns: repeat(2, 1fr); }
  .nftp-dragondes-panel { grid-template-columns: repeat(3, 1fr); }
  .nftp-resource-panel { grid-template-columns: repeat(4, 1fr); }
  .nftp-potential-panel { grid-template-columns: repeat(2, 1fr); }
  .nftp-scripture-panel,
  .nftp-codex-panel { grid-template-columns: 1fr; }
  .nftp-cosmic-row { grid-template-columns: 48px 1fr; }
  .nftp-cosmic-subs { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ── ANCIENT TREASURE ── same 5-col grid as Dragon Artifact so the first
   item aligns column-for-column with the section below it ── */
.nftp-treasure-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px 0;
}
.nftp-treasure-row .nftp-mo-card {
  border-right: none;
}
.nftp-dragon-legend {
  display: flex;
  gap: 14px;
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: .05em;
}
.nftp-dragon-tag { color: rgba(255,255,255,.55); }
.nftp-dragon-tag--black { color: #c5b6ff; }
.nftp-dragon-tag--white { color: #ffd4a3; }
/* Subtle color-coded border on the wrap so users can tell Black vs White at a glance */
.nftp-dragon-card--black .nftp-mo-portrait { box-shadow: 0 0 0 2px rgba(139,92,246,.3), 0 4px 12px rgba(0,0,0,.4); }
.nftp-dragon-card--white .nftp-mo-portrait { box-shadow: 0 0 0 2px rgba(255,200,120,.3), 0 4px 12px rgba(0,0,0,.4); }

@media (max-width: 980px) {
  .nftp-mo-grid { gap: 14px 0; }
  .nftp-mo-portrait-wrap { width: 78px; height: 78px; }
  .nftp-mo-grid--all { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}
@media (max-width: 720px) {
  .nftp-mo-grid { grid-template-columns: repeat(3, 1fr); gap: 12px 0; }
  .nftp-mo-card { border-right: none; }
  .nftp-mo-portrait-wrap { width: 70px; height: 70px; }
  .nftp-dragon-grid { grid-template-columns: repeat(3, 1fr); gap: 12px 0; }
  .nftp-treasure-row { grid-template-columns: repeat(3, 1fr); gap: 12px 0; }
}

/* ── INVENTORY ── tabbed, denser grid with icon-only cards ── */
.nftp-inv-wrap {
  max-width: 1500px;
  margin: 0 auto 22px;
  padding: 0 36px;
}
.nftp-inv-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--bdr);
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.nftp-inv-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--text2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .15s;
  position: relative;
  top: 1px;
}
.nftp-inv-tab:hover { color: var(--text); background: rgba(200,150,60,.04); }
.nftp-inv-tab.active {
  color: var(--gold2);
  border-bottom-color: var(--gold);
  background: linear-gradient(180deg, transparent 0%, rgba(200,150,60,.06) 100%);
}
.nftp-inv-tab-icon { color: var(--gold); font-size: 13px; }
.nftp-inv-tab-count {
  font-family: var(--font-num);
  font-size: 11px;
  color: var(--text3);
  padding: 2px 7px;
  background: rgba(0,0,0,.4);
  border: 1px solid var(--bdr);
  letter-spacing: 0;
}
.nftp-inv-tab.active .nftp-inv-tab-count {
  color: var(--gold2);
  border-color: var(--bdr2);
}
.nftp-inv-panel { display: none; }
.nftp-inv-panel.active { display: block; }

/* Tile size ported from xdraco's HAR:
   - mobile (< 900px): minmax(72px) gap 6px   — dense, fits phones
   - desktop (≥ 900px): minmax(98px) gap 12px — matches xdraco's
     `.nft.market .wrap-item-square .list-item > li { height: 98px }`
   Items stay 1:1 aspect via .nftp-inv-img-wrap. */
.nftp-inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 6px;
}
@media (min-width: 900px) {
  .nftp-inv-grid {
    grid-template-columns: repeat(auto-fill, minmax(98px, 1fr));
    gap: 12px;
  }
}
.nftp-inv-item {
  --g-color: #cfcfcf;
  --g-glow:  rgba(207,207,207,.20);
  cursor: default;
}
.nftp-inv-img-wrap {
  position: relative;
  aspect-ratio: 1;
  background:
    radial-gradient(ellipse at center, color-mix(in srgb, var(--g-color) 14%, transparent) 0%, transparent 70%),
    linear-gradient(180deg, #0d1018 0%, #050810 100%);
  border: 1px solid var(--g-color);
  box-shadow: inset 0 0 10px rgba(0,0,0,.55);
  overflow: hidden;
  transition: transform .12s, box-shadow .12s;
}
.nftp-inv-item:hover .nftp-inv-img-wrap {
  transform: translateY(-1px);
  box-shadow: inset 0 0 10px rgba(0,0,0,.35);
  z-index: 2;
}
.nftp-inv-img-wrap::after {
  content: '';
  position: absolute;
  inset: 2px;
  border: 1px solid rgba(0,0,0,.5);
  pointer-events: none;
}
.nftp-inv-img {
  position: absolute;
  inset: 6px;
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  object-fit: contain;
  z-index: 1;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.7));
}
/* When the source 404s we strip the src and add this class.
   A subtle question-mark glyph appears centered, no browser-default ! icon. */
.nftp-inv-img--broken {
  background: rgba(0,0,0,.18);
  border-radius: 2px;
  /* Hide the alt text rendering quirk in some browsers */
  color: transparent;
  font-size: 0;
}
.nftp-inv-img--broken::after {
  content: '?';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: rgba(255,255,255,.25);
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}
/* Enhancement — TOP-RIGHT, matching xdraco's `.enhance` placement */
/* Enhancement — TOP-RIGHT plain white text (matches xdraco exactly:
   .wrap-item-square.inventory .enhance — text-shadow only, no pill). */
.nftp-inv-enh {
  position: absolute;
  top: 0;
  right: 4px;
  z-index: 4;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 24px;
  height: 16px;
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 1px #000;
  letter-spacing: -.01em;
  line-height: 1;
}
/* Tier — BOTTOM-LEFT plain Roman numeral, NO background.
   Matches xdraco's .wrap-item-square .list-item .tier verbatim. */
.nftp-inv-tier {
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 4;
  width: 22px;
  font-family: var(--font-num);
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 1px 1px #000;
}
/* Desktop: scale corner indicators to match xdraco's desktop sizing
   (.nft.market .wrap-item-square .list-item .tier { width: 27px; font: 18px })
   (.nft.market .wrap-item-square.inventory .enhance { min-width: 40px; height: 27px; font: 18px }) */
@media (min-width: 900px) {
  .nftp-inv-enh {
    min-width: 40px;
    height: 27px;
    font-size: 18px;
  }
  .nftp-inv-tier {
    width: 27px;
    font-size: 18px;
  }
  .nftp-inv-primal {
    width: 22px;
    height: 22px;
  }
  .nftp-inv-stack {
    font-size: 12px;
    bottom: 4px;
    right: 6px;
  }
}
/* Refine — gold dragon-frame overlay for transcended items.
   Matches xdraco's li.refine:after using img-frame-dragon-reforge-blue.webp. */
.nftp-inv-item.refine .nftp-inv-img-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  background: url('https://file.mir4global.com/xdraco/dist/img/common/card/img-frame-dragon-reforge-blue.webp') 0 0 / contain no-repeat;
  pointer-events: none;
}
.nftp-inv-item.refine.red .nftp-inv-img-wrap::before {
  background-image: url('https://file.mir4global.com/xdraco/dist/img/common/card/img-frame-dragon-reforge-red.webp');
}
.nftp-inv-stack {
  position: absolute;
  bottom: 2px;
  right: 3px;
  z-index: 2;
  font-family: var(--font-num);
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 4px #000, 0 1px 2px #000, 0 -1px 2px #000;
  line-height: 1;
  letter-spacing: -.02em;
}
.nftp-inv-hole {
  position: absolute;
  bottom: 2px;
  left: 3px;
  z-index: 2;
  font-family: var(--font-num);
  font-size: 9px;
  font-weight: 700;
  color: var(--ice);
  padding: 0 3px;
  background: rgba(0,0,0,.7);
  line-height: 1;
}
/* Forge "F{N}" — TOP-LEFT compact dark pill (only when forge > 0).
   Sits opposite the Tier diamond so a glance reads:
     TL Forge  ·  TR +Enhancement
     BL Tier   ·  BR Primal slot. */
.nftp-inv-forge {
  position: absolute;
  top: 2px;
  left: 2px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  background: linear-gradient(180deg, rgba(40,40,52,.95) 0%, rgba(10,10,16,.95) 100%);
  border: 1px solid rgba(232, 168, 58, .65);
  border-radius: 7px;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  color: #ffd96b;
  letter-spacing: .04em;
  line-height: 1.05;
  text-transform: uppercase;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.7);
}
.nftp-inv-item--forged .nftp-inv-img-wrap {
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.55);
  border-color: #e8a83a;
}
/* Inventory primal sprite indicator */
.nftp-inv-primal {
  position: absolute;
  bottom: 2px;
  right: 3px;
  z-index: 3;
  width: 16px;
  height: 16px;
  background-image: url('https://file.mir4global.com/xdraco/dist/img/common/sp-item-hole.webp');
  background-size: 200% 400%;
  background-position-x: 100%;
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 2px rgba(0,0,0,.7));
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .nftp-hero-inner { grid-template-columns: 220px 1fr; }
  .nftp-price-col { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .nftp-price-frame { flex: 1; min-width: 220px; }
  .nftp-price-actions { flex-direction: column; min-width: 130px; }
}
@media (max-width: 720px) {
  .nftp-hero-inner { grid-template-columns: 1fr; padding: 24px 20px; }
  .nftp-portrait-wrap { max-width: 220px; margin: 0 auto; }
  .nftp-name { font-size: 26px; }
  .nftp-stat-row { grid-template-columns: repeat(2, 1fr); }
  .nftp-stat { border-bottom: 1px solid var(--bdr); }
  .nftp-stat:nth-last-child(-n+2) { border-bottom: none; }
  .nftp-section-head, .nftp-cat { padding: 0 20px; }
  .nftp-item-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
}

/* ════════════════════════════════════════════════════════
   GLOBAL STATUS RAIL (Layer 1) — fixed top utility bar
   Persists across all pages; driven by tickStatusRail() in app.js.
   Additive only — does not modify any existing selector.
   ════════════════════════════════════════════════════════ */
.status-rail {
  position: fixed; top: 0; left: 0; right: 0; height: 36px; z-index: 200;
  display: flex; align-items: center; padding: 0 14px;
  background: rgba(11, 12, 14, .92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bdr2);
  font-family: var(--font-num); font-size: 12px; color: var(--text-muted);
  user-select: none;
}
.status-rail::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--crimson) 30%, var(--gold) 50%, var(--crimson) 70%, transparent);
  opacity: .5; pointer-events: none;
}
.sr-item { display: flex; align-items: center; gap: 6px; padding: 0 12px; white-space: nowrap; }
.sr-item b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.sr-item i { font-style: normal; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); }
.sr-item em { font-style: normal; color: var(--gold2); font-weight: 600; }
.sr-php { color: var(--jade); font-weight: 600; }
.sr-chg { font-weight: 600; font-variant-numeric: tabular-nums; }
.sr-sep { width: 1px; height: 16px; background: var(--bdr2); flex: 0 0 auto; }
.sr-spacer { flex: 1 1 auto; }
.sr-ico { opacity: .85; }
.sr-refresh { color: var(--text-dim); }
.sr-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--jade); box-shadow: 0 0 6px var(--jade); flex: 0 0 auto; }

/* "Updated" indicator — fixed width so its ticking seconds never shift
   the rest of the rail (keeps the layout static). */
.sr-refresh { flex: 0 0 118px; justify-content: flex-start; }

/* WEMIX item — click to cycle preferred currency. Fixed-width price and
   percent cells keep the rail static as the value/percent tick. */
.sr-wemix { cursor: pointer; }
.sr-wemix:hover b { color: var(--gold2); }
.status-rail #sr-wemix-price { display: inline-block; min-width: 58px; }
.status-rail .sr-chg { display: inline-block; min-width: 56px; }

/* Next-boss list — fixed-width slots (3 columns on desktop). Slot widths
   are constant so per-second countdown updates never reflow the rail.
   Names are ONE uniform colour; only the countdown number is coloured by
   urgency, so colour == time-to-spawn (not per-boss). */
.sr-boss-list { display: inline-flex; align-items: center; gap: 14px; }
.status-rail .sr-bslot { display: inline-flex; align-items: baseline; gap: 5px; width: 178px; overflow: hidden; }
/* Name = ONE neutral colour for every boss (the .status-rail prefix beats
   the generic .sr-item em gold rule). */
.status-rail .sr-bname { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; min-width: 0; }
/* Time = the only coloured part. Colour == urgency: grey >1h, gold <1h,
   ember <15m, red (pulsing) <5m. */
.status-rail .sr-btime { flex: 0 0 auto; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.status-rail .sr-bslot[data-state="soon"] .sr-btime { color: var(--gold-bright); }
.status-rail .sr-bslot[data-state="near"] .sr-btime { color: var(--ember); }
.status-rail .sr-bslot[data-state="now"]  .sr-btime { color: var(--red); animation: srPulse 0.8s steps(2, end) infinite; }
@keyframes srPulse { 50% { opacity: .35; } }
.sr-bpage { font-size: 10px; color: var(--text-dim); margin-left: 2px; font-variant-numeric: tabular-nums; }

/* Slot count by width: 3 / 2 / 1 columns */
@media (max-width: 1200px) { .status-rail .sr-bslot { width: 168px; } }

/* Offset the app so the fixed rail never covers content */
.layout { padding-top: 36px; }
/* Desktop only: sticky sidebar starts below the rail */
@media (min-width: 901px) {
  .sidebar { top: 36px; height: calc(100vh - 36px); }
}
/* Mobile: clear the floating hamburger (top:12 left:12, 42px) */
@media (max-width: 900px) {
  .status-rail { padding-left: 62px; font-size: 11px; }
  .status-rail .sr-item i { display: none; }
  .status-rail .sr-refresh { display: none; }
}
@media (max-width: 560px) {
  .status-rail .sr-sep { display: none; }
  .status-rail .sr-item { padding: 0 7px; }
}

/* ════════════════════════════════════════════════════════
   PHASE 2 — compact page headers (reclaim the per-page "title tax")
   + centered brand wordmark. Additive overrides only.
   ════════════════════════════════════════════════════════ */
/* Centered brand wordmark in the sidebar */
.sidebar-header { text-align: center; }
.logo { text-align: center; letter-spacing: .12em; }
.logo-sub { justify-content: center; }

/* Compact headers: smaller title, tight margins, faint divider, and the
   long descriptions shrunk (not removed) so useful hints survive.

   Vertical rhythm follows the hierarchy: a calm gap above the breadcrumb,
   a clear separation before the title, the subtitle hugging the title as
   one unit, then a balanced gap down to the rune divider. The cumulative
   height is also tuned so the page-header divider lands on the sidebar
   header divider (both columns share the same top). */
.topbar { padding: 22px 0 0; margin-bottom: 14px; }
.page-header { margin: 0 0 14px; padding-bottom: 18px; }
.page-header::after { opacity: .25; }
.page-title { font-size: 18px; letter-spacing: .06em; }
.page-sub { font-size: 11px; margin-top: 4px; opacity: .85; }

/* ════════════════════════════════════════════════════════
   PHASE 5 — Sidebar: collapsible icon-only mode, favourites,
   active-character footer, stronger active/hover states.
   ════════════════════════════════════════════════════════ */
/* Compact brand mark shown only in collapsed mode */
.logo-mark { display: none; font-size: 18px; color: var(--gold2); text-align: center; line-height: 1; }

/* Collapse toggle — desktop only (the mobile sidebar is a drawer) */
.sidebar-collapse-btn {
  position: absolute; top: 8px; right: 8px; z-index: 3; display: none;
  width: 22px; height: 22px; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--bdr2); border-radius: var(--r);
  color: var(--text-muted); cursor: pointer; font-size: 13px; line-height: 1; padding: 0;
}
.sidebar-collapse-btn:hover { color: var(--gold2); border-color: var(--bdr-gold); }
@media (min-width: 901px) { .sidebar-collapse-btn { display: flex; } }

/* Favourite star on each nav item — reveals on hover, gold when pinned */
.nav-item { position: relative; }
.nav-fav-star {
  margin-left: auto; flex: 0 0 auto; font-size: 12px; line-height: 1;
  color: var(--text-dim); cursor: pointer; opacity: 0;
  transition: opacity .15s, color .15s; padding-left: 6px;
}
.nav-item:hover .nav-fav-star { opacity: .55; }
.nav-fav-star:hover { color: var(--gold2); opacity: 1; }
.nav-item.is-fav .nav-fav-star { opacity: 1; color: var(--gold); }
/* Drag-to-reorder — a press anywhere on the row can start a drag, but only
   the ⠿ grip shows the grab cursor; the rest of the row keeps the normal
   pointer. touch-action:none keeps touch drags from scrolling the nav. */
.nav-item.is-fav { touch-action: none; }
.nav-fav-grip {
  flex: 0 0 auto; font-size: 11px; line-height: 1; margin-right: 2px;
  color: var(--text-dim); opacity: .3; cursor: grab;
  transition: opacity .15s, color .15s;
}
.nav-item.is-fav:hover .nav-fav-grip { opacity: .7; color: var(--gold2); }
.sidebar.collapsed .nav-fav-grip { display: none; }

/* The dimmed gap left behind by the row being dragged */
.nav-item.fav-placeholder { opacity: .25; }
.nav-item.fav-placeholder * { visibility: hidden; }

/* Floating clone that follows the cursor while dragging */
.nav-item.fav-ghost {
  position: fixed; z-index: 1000; margin: 0; pointer-events: none;
  background: var(--surface-2); border: 1px solid var(--bdr-gold);
  border-radius: var(--r); color: var(--gold2);
  box-shadow: 0 8px 22px rgba(0,0,0,.45), 0 0 0 1px rgba(200,150,60,.15);
  transform: scale(1.03) rotate(-1deg); opacity: .96;
}
/* While a drag is in progress, force the grabbing cursor everywhere */
body.fav-dragging-active, body.fav-dragging-active * { cursor: grabbing !important; }
/* Favourites group — a plain block at the top of the scrollable nav so
   its label + items align exactly like the other sections. */
.nav-favorites { overflow: visible; }

/* Stronger active state */
.nav-item.active {
  background: linear-gradient(135deg, rgba(139,0,0,.20) 0%, rgba(200,150,60,.07) 100%);
  color: var(--gold2);
  border-color: var(--bdr2);
}
.nav-item:hover { background: rgba(200,150,60,.08); color: var(--text); }

/* Active-character footer card */
.sidebar-charcard {
  display: flex; align-items: center; gap: 9px;
  margin: 6px 10px; padding: 8px 10px;
  background: var(--surface-2); border: 1px solid var(--bdr); border-radius: var(--r);
}
.scc-avatar {
  width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(200,150,60,.12); border: 1px solid var(--bdr-gold);
  color: var(--gold2); font-size: 14px;
}
.scc-info { display: flex; flex-direction: column; min-width: 0; }
.scc-name { font-size: 12px; font-weight: 700; color: var(--gold2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scc-meta { font-size: 10px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Collapsed (icon-only) mode — desktop only ── */
@media (min-width: 901px) {
  .sidebar.collapsed { width: 56px; }
  .sidebar.collapsed::before { width: 56px; }
  .sidebar.collapsed .logo,
  .sidebar.collapsed .logo-sub,
  .sidebar.collapsed .search-wrap,
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .nav-fav-star,
  .sidebar.collapsed .scc-info,
  .sidebar.collapsed .auth-whoami { display: none; }
  .sidebar.collapsed .logo-mark { display: block; }
  .sidebar.collapsed .sidebar-header { padding: 14px 0 12px; }
  .sidebar.collapsed .sidebar-collapse-btn { position: static; margin: 0 auto 8px; }
  /* font-size:0 hides the bare text-node label; the SVG keeps its fixed 16px */
  .sidebar.collapsed .nav-item { font-size: 0; justify-content: center; gap: 0; padding: 9px 0; margin: 0 6px 1px; }
  .sidebar.collapsed .sidebar-charcard { justify-content: center; padding: 8px 0; margin: 6px; }
}

/* ════════════════════════════════════════════════════════
   PHASE 6 — Command Palette (Ctrl+K) + Notifications Center
   ════════════════════════════════════════════════════════ */
/* Rail buttons (⌘K + bell) — sit at the rail's left */
.sr-btn {
  display: inline-flex; align-items: center; justify-content: center; position: relative;
  height: 22px; padding: 0 8px; margin-right: 6px; flex: 0 0 auto;
  background: var(--surface-2); border: 1px solid var(--bdr2); border-radius: var(--r);
  color: var(--text-muted); font-family: var(--font-num); font-size: 11px; font-weight: 600;
  cursor: pointer; line-height: 1;
}
.sr-btn:hover { color: var(--gold2); border-color: var(--bdr-gold); }
.sr-notif-ic { font-size: 12px; }
.sr-notif-badge {
  display: none; position: absolute; top: -6px; right: -6px; min-width: 15px; height: 15px;
  padding: 0 3px; box-sizing: border-box; align-items: center; justify-content: center;
  background: var(--crimson); color: #fff; font-size: 9px; font-weight: 700;
  border-radius: 8px; line-height: 1;
}
@media (max-width: 900px) { .sr-cmdk-btn { display: none; } }   /* keyboard-only feature */

/* Command palette */
.cmdk-overlay {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 12vh; background: rgba(0,0,0,.55); backdrop-filter: blur(3px);
}
.cmdk-modal {
  width: 100%; max-width: 560px; max-height: 70vh; display: flex; flex-direction: column;
  background: var(--surface-1); border: 1px solid var(--bdr2); border-radius: var(--rl);
  box-shadow: 0 24px 70px rgba(0,0,0,.6); overflow: hidden;
}
.cmdk-input {
  height: 48px; padding: 0 18px; background: transparent; border: 0;
  border-bottom: 1px solid var(--bdr); color: var(--text);
  font-family: var(--font-ui); font-size: 15px; outline: none;
}
.cmdk-input::placeholder { color: var(--text-dim); }
.cmdk-list { overflow-y: auto; padding: 6px; }
.cmdk-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px;
  border-radius: var(--r); cursor: pointer; color: var(--text2); font-size: 13px;
}
.cmdk-item.active { background: linear-gradient(135deg, rgba(139,0,0,.18), rgba(200,150,60,.06)); color: var(--gold2); }
.cmdk-ic { width: 16px; height: 16px; flex: 0 0 16px; color: var(--text-dim); display: inline-flex; }
.cmdk-ic svg { width: 16px; height: 16px; }
.cmdk-item.active .cmdk-ic { color: var(--gold2); }
.cmdk-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-empty { padding: 22px; text-align: center; color: var(--text-dim); font-size: 13px; }
.cmdk-foot {
  display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid var(--bdr);
  font-size: 10px; color: var(--text-dim); letter-spacing: .04em;
}

/* Notifications center */
.notif-center {
  position: fixed; z-index: 300; width: 320px; max-height: 60vh; overflow: hidden;
  display: flex; flex-direction: column;
  background: var(--surface-1); border: 1px solid var(--bdr2); border-radius: var(--rl);
  box-shadow: 0 18px 48px rgba(0,0,0,.55);
}
.notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--bdr);
  font-family: var(--font-num); font-size: 12px; color: var(--text); font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
}
.notif-head a { color: var(--text-dim); font-size: 11px; cursor: pointer; text-transform: none; letter-spacing: 0; }
.notif-head a:hover { color: var(--gold2); }
.notif-list { overflow-y: auto; padding: 4px; }
.notif-item { padding: 9px 11px; border-radius: var(--r); border-bottom: 1px solid rgba(255,255,255,.03); }
.notif-item:hover { background: var(--surface-2); }
.notif-msg { font-size: 12.5px; color: var(--text); line-height: 1.4; }
.notif-time { font-size: 10px; color: var(--text-dim); margin-top: 2px; font-variant-numeric: tabular-nums; }
.notif-empty { padding: 20px 16px; text-align: center; color: var(--text-dim); font-size: 12px; line-height: 1.5; }

/* Notifications center — permission banner */
.notif-perm {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; margin: 4px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--bdr2);
  font-size: 11.5px; color: var(--text-muted); line-height: 1.4;
}
.notif-perm b { color: var(--text); }
.notif-perm .btn { flex: 0 0 auto; }
.notif-perm-warn { border-color: var(--bdr-red); color: #ff8a9b; }

/* "View clan roster" action inside the Hidden Valley clan modal */
.hv-modal-actions { margin-top: 14px; text-align: right; }

/* Rail boss list: quiet placeholder when nothing spawns within 5 min */
.status-rail .sr-bslot[data-state="idle"] .sr-bname { color: var(--text-dim); font-weight: 400; }

/* Drag-to-resize handle on the sidebar's right edge (desktop only).
   Fixed-positioned so it escapes the sidebar's overflow + scroll; its
   left/top/height are kept in sync with the sidebar by _sidebarUpdateHandle(). */
.sidebar-resize { display: none; position: fixed; width: 8px; z-index: 150; cursor: col-resize; }
.sidebar-resize::after {
  content: ''; position: absolute; left: 3px; top: 0; bottom: 0; width: 2px;
  background: transparent; transition: background .15s, box-shadow .15s;
}
.sidebar-resize:hover::after { background: var(--gold); box-shadow: 0 0 8px rgba(200,150,60,.6); }
@media (max-width: 900px) { .sidebar-resize { display: none !important; } }

/* ── Global Rankings: round grade-6 class-icon frame + pager ── */
.gl-player { display: flex; align-items: center; gap: 10px; }
.gl-class-ic {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%;
  border: 1px solid var(--bdr-gold); background-color: rgba(200,150,60,.10);
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
.gl-class-ic.warrior   { background-image: url('https://file.mir4global.com/xdraco/dist/img/common/card/warrior-grade6.webp'); }
.gl-class-ic.sorcerer  { background-image: url('https://file.mir4global.com/xdraco/dist/img/common/card/sorcerer-grade6.webp'); }
.gl-class-ic.taoist    { background-image: url('https://file.mir4global.com/xdraco/dist/img/common/card/taoist-grade6.webp'); }
.gl-class-ic.arbalist  { background-image: url('https://file.mir4global.com/xdraco/dist/img/common/card/arbalist-grade6.webp'); }
.gl-class-ic.lancer    { background-image: url('https://file.mir4global.com/xdraco/dist/img/common/card/lancer-grade6.webp'); }
.gl-class-ic.darkist   { background-image: url('https://file.mir4global.com/xdraco/dist/img/common/card/darkist-grade6.webp'); }
.gl-class-ic.lionheart { background-image: url('https://file.mir4global.com/xdraco/dist/img/common/card/lionheart-grade6.webp'); }
.gl-player-name { cursor: pointer; color: var(--gold2); font-weight: 600; }
.gl-player-name:hover { color: var(--gold3); }
.gl-move { font-size: 10px; margin-left: 5px; vertical-align: 1px; }
.gl-move.up { color: var(--jade); }
.gl-move.down { color: var(--red); }
.gl-pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px; border-top: 1px solid var(--bdr); }
.gl-pager-info { font-size: 12px; color: var(--text3); font-family: var(--font-num); }
.gl-pager .btn[disabled] { opacity: .35; cursor: default; pointer-events: none; }

/* ── SP Boss Monitor — dual-boss floor cards ── */
.sp-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--bdr); }
.sp-filter-pills { display: flex; gap: 6px; }
.sp-filter { padding: 6px 12px; font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--text3); background: transparent; border: 1px solid var(--bdr); border-radius: 999px; cursor: pointer; transition: all .15s; }
.sp-filter:hover { color: var(--text2); }
.sp-filter.on { color: var(--gold2); border-color: var(--bdr-gold); background: rgba(200,150,60,.10); }
.sp-offset-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sp-offset-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--text3); }
.sp-offset-chip { padding: 5px 10px; font-size: 11px; font-family: var(--font-num); color: var(--text3); background: transparent; border: 1px solid var(--bdr); border-radius: 6px; cursor: pointer; transition: all .15s; }
.sp-offset-chip:hover { color: var(--text2); }
.sp-offset-chip.on { color: #100c04; background: var(--gold); border-color: var(--gold); font-weight: 700; }
.sp-help { padding: 10px 16px; font-size: 11px; color: var(--text3); line-height: 1.5; }
.sp-section-label { padding: 10px 16px 4px; font-family: var(--font-display); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold2); }
.sp-floor-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 6px 16px 4px; }
.sp-floor-card { border: 1px solid var(--bdr); border-radius: 10px; background: var(--surface-1); overflow: hidden; }
.sp-floor-card.sp-fav { border-color: var(--bdr-gold); }
.sp-floor-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--bdr); }
.sp-star { background: none; border: none; cursor: pointer; font-size: 18px; line-height: 1; color: var(--text3); padding: 0; transition: color .15s; }
.sp-star.on { color: var(--gold-bright); text-shadow: var(--glow-gold-sm); }
.sp-floor-name { font-family: var(--font-display); font-weight: 700; color: var(--gold2); font-size: 14px; }
.sp-floor-alert { margin-left: auto; font-size: 10px; color: var(--text3); font-family: var(--font-num); white-space: nowrap; }
.sp-boss-grid { display: grid; grid-template-columns: 1fr 1fr; }
.sp-boss-block { padding: 10px 12px; border-left: 3px solid var(--bdr); transition: border-color .2s, background .2s; }
.sp-boss-block + .sp-boss-block { border-left: 1px solid var(--bdr); }
.sp-boss-block.sp-safe   { border-left-color: var(--jade); }
.sp-boss-block.sp-soon   { border-left-color: var(--ember); background: rgba(255,107,53,.06); }
.sp-boss-block.sp-active { border-left-color: var(--red);   background: rgba(255,51,80,.08); }
.sp-boss-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.sp-boss-label { font-size: 11px; font-weight: 600; color: var(--text2); }
.sp-badge { font-size: 10px; font-weight: 700; white-space: nowrap; }
.sp-safe   .sp-badge { color: var(--jade); }
.sp-soon   .sp-badge { color: var(--ember); }
.sp-active .sp-badge { color: var(--red); }
.sp-empty  .sp-badge { color: var(--text3); font-weight: 500; }
.sp-boss-times { display: flex; flex-direction: column; gap: 3px; margin-bottom: 9px; }
.sp-boss-times > div { display: flex; align-items: baseline; gap: 6px; }
.sp-k { font-size: 10px; color: var(--text3); width: 74px; flex: 0 0 74px; text-transform: uppercase; letter-spacing: .03em; }
.sp-v { font-size: 12px; color: var(--text); font-family: var(--font-num); }
.sp-v.sp-cd { font-weight: 700; color: var(--gold2); }
.sp-active .sp-v.sp-cd { color: var(--red); }
.sp-soon   .sp-v.sp-cd { color: var(--ember); }
.sp-tag { font-size: 9px; color: var(--violet2); border: 1px solid var(--bdr); border-radius: 4px; padding: 0 4px; }
.sp-boss-actions { display: flex; align-items: center; gap: 6px; }
.sp-clear { margin-left: auto; background: none; border: none; cursor: pointer; color: var(--text3); font-size: 18px; line-height: 1; padding: 0 4px; }
.sp-clear:hover { color: var(--red); }
.sp-manual { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.sp-manual-input { height: 28px; padding: 0 8px; background: var(--iron); border: 1px solid var(--bdr); border-radius: 6px; color: var(--text); font-size: 12px; font-family: var(--font-num); }

@media (max-width: 720px) {
  .sp-floor-grid { grid-template-columns: 1fr; padding: 6px 10px 4px; }
  .sp-boss-grid { grid-template-columns: 1fr; }
  .sp-boss-block + .sp-boss-block { border-left: 3px solid var(--bdr); border-top: 1px solid var(--bdr); }
  /* Sticky alert center: keep the filter + alert toggles reachable while scrolling a long floor list. */
  .sp-controls { position: sticky; top: 0; z-index: 6; background: var(--surface-2); }
  .sp-boss-actions .btn { flex: 1; min-height: 34px; }
}

/* ── Marketplace (WTS/WTB board) ─────────────────────────────────── */
.mkt-tabs { display: flex; gap: 6px; margin: 16px 0 14px; border-bottom: 1px solid var(--bdr); }
.mkt-tab {
  background: none; border: none; cursor: pointer; padding: 8px 4px 10px; margin-right: 18px;
  font-size: 13px; font-weight: 600; color: var(--text3); position: relative; transition: color .15s ease;
}
.mkt-tab:hover { color: var(--text2); }
.mkt-tab.active { color: var(--gold2); }
.mkt-tab.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--gold2); border-radius: 2px 2px 0 0;
}
.mkt-type-tag { display: inline-block; font-size: 9.5px; font-weight: 700; letter-spacing: .04em; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; margin-bottom: 6px; }
.mkt-type-tag.selling { color: var(--gold2); background: rgba(200,150,60,.14); }
.mkt-type-tag.buying { color: var(--jade); background: rgba(0,184,148,.14); }
.mkt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.mkt-card {
  position: relative;
  background: var(--iron); border: 1px solid var(--bdr2); border-radius: var(--rl);
  cursor: pointer;
  transition: transform .18s cubic-bezier(.2,.8,.3,1.1), border-color .18s ease, box-shadow .18s ease;
  animation: mktCardIn .32s cubic-bezier(.2,.8,.3,1.1) both;
}
.mkt-card:hover { transform: translateY(-3px); border-color: var(--bdr-gold); box-shadow: 0 14px 34px rgba(0,0,0,.4); }
@keyframes mktCardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.mkt-card-img-wrap { position: relative; aspect-ratio: 4/3; background: var(--surface-3); overflow: hidden; border-radius: var(--rl) var(--rl) 0 0; }
.mkt-card-img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.mkt-card:hover .mkt-card-img { transform: scale(1.05); }
.mkt-card-img-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 28px; color: var(--text3); }
.mkt-card-count { position: absolute; bottom: 6px; right: 6px; background: rgba(0,0,0,.62); color: #fff; font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 999px; }
.mkt-pin-badge { position: absolute; top: 6px; left: 6px; background: rgba(200,150,60,.85); color: #1a1205; font-size: 9.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
.mkt-card-sold { position: absolute; inset: 0; background: rgba(11,12,14,.72); display: flex; align-items: center; justify-content: center; }
.mkt-card-sold span { color: var(--red); font-family: var(--font-display); font-size: 15px; letter-spacing: .08em; border: 1.5px solid var(--red); border-radius: 6px; padding: 4px 14px; transform: rotate(-8deg); }
.mkt-card-body { padding: 12px 14px; position: relative; }
.mkt-menu-wrap.mkt-menu-wrap-card { position: absolute; top: 8px; right: 8px; z-index: 5; }
.mkt-menu-wrap-card .mkt-menu-btn { background: rgba(0,0,0,.55); color: #fff; }
.mkt-menu-wrap-card .mkt-menu-btn:hover { background: rgba(0,0,0,.75); color: #fff; }
.mkt-card-title { font-size: 13.5px; font-weight: 600; color: var(--text); margin: 0 0 4px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.mkt-card-price { font-family: var(--font-num); color: var(--gold2); font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.mkt-card-foot { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--text3); }
.mkt-card-foot .mkt-comments { display: inline-flex; align-items: center; gap: 4px; }
.mkt-skel { border-radius: var(--rl); overflow: hidden; background: var(--iron); border: 1px solid var(--bdr2); }
.mkt-skel .mkt-skel-img { aspect-ratio: 4/3; }
.mkt-skel .mkt-skel-line { height: 10px; margin: 12px 14px; border-radius: 4px; }
.mkt-skel .mkt-skel-img, .mkt-skel .mkt-skel-line {
  background: linear-gradient(100deg, var(--surface-3) 30%, var(--surface-4) 50%, var(--surface-3) 70%);
  background-size: 200% 100%; animation: mktShimmer 1.3s ease-in-out infinite;
}
@keyframes mktShimmer { from { background-position: 140% 0; } to { background-position: -40% 0; } }
