@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700;800;900&family=Sora:wght@400;500;600;700;800&display=swap');

/* ============================================================
   Forgebase — "Forged Vault" skeuomorphic theme
   Dark blue-black base, forged-metal panels, molten-amber CTAs,
   gem-violet accents, emerald reserved for success/positive.
   Depth is intentionally subtle: soft bevels + inset shadows.
   ============================================================ */
:root {
  /* base surfaces (dark blue-black, kept) */
  --bg: #070a0f;
  --bg-2: #0a0e16;
  --panel: #141926;
  --panel-2: #1a2130;
  --panel-3: #222b3d;
  --line: #28313f;
  --line-2: #35404f;
  --steel: #47536a;          /* brushed-metal edge highlight */

  /* text */
  --text: #eef1f7;
  --muted: #98a2b5;
  --faint: #626d80;

  /* accents */
  --amber: #f0a531;          /* primary / molten CTA */
  --amber-hi: #ffc766;       /* top edge highlight */
  --amber-dim: #b06f1c;      /* bottom edge / shadow */
  --amber-ink: #2a1803;      /* text on amber */
  --green: #3ee38b;          /* success / positive (kept) */
  --green-dim: #1f9d63;
  --purple: #9d8bff;         /* gem-violet accent */
  --purple-dim: #5f4fd6;
  --blue: #5b8def;
  --orange: #e8a13c;
  --red: #e5645a;

  /* radii */
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-w: 248px;

  /* forged depth tokens (subtle) */
  --bevel-hi: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --bevel-lo: inset 0 -1px 0 rgba(0, 0, 0, 0.45);
  --inset: inset 0 2px 5px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(0, 0, 0, 0.4);
  --drop: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 18px -8px rgba(0, 0, 0, 0.7);
  --drop-lg: 0 2px 4px rgba(0, 0, 0, 0.45), 0 18px 42px -18px rgba(0, 0, 0, 0.8);

  --font: "Sora", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: "Cinzel", "Sora", Georgia, "Times New Roman", serif;
  --mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.003em;
  /* forged obsidian base with a soft top vignette + faint metal grain */
  background-color: var(--bg);
  background-image:
    radial-gradient(120% 80% at 50% -10%, rgba(240, 165, 49, 0.05), transparent 55%),
    radial-gradient(100% 90% at 100% 0%, rgba(157, 139, 255, 0.05), transparent 55%),
    linear-gradient(180deg, #0a0e16, #070a0f 60%);
  background-attachment: fixed;
}
h1, h2, h3, h4, .h1, .h2, .h3, .brand .name, .band h2 {
  font-family: var(--font-head);
  letter-spacing: 0.005em;
  font-weight: 800;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font: inherit; }
::selection { background: rgba(240, 165, 49, 0.28); }

/* Accessibility: visible keyboard focus everywhere */
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  /* frosted glass column */
  background: linear-gradient(180deg, rgba(22, 28, 42, 0.72) 0%, rgba(16, 21, 31, 0.72) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04), 2px 0 18px -8px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 22px; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(160deg, var(--amber-hi), var(--amber-dim));
  display: grid; place-items: center; color: var(--amber-ink); font-weight: 800; font-size: 18px;
  box-shadow: var(--bevel-hi), 0 2px 6px rgba(0, 0, 0, 0.5);
}
.brand img.logo { background: none; object-fit: cover; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }
.coin { width: 1.05em; height: 1.05em; object-fit: contain; vertical-align: -0.18em; display: inline-block; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); }
.brand .name { font-weight: 800; font-size: 16px; letter-spacing: 0.04em; }
.brand .tag { font-size: 10px; color: var(--amber); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.nav { padding: 4px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-size: 14px; font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.14s, color 0.14s, box-shadow 0.14s;
}
.nav a svg { width: 18px; height: 18px; flex: 0 0 18px; }
.nav a:hover { background: rgba(255, 255, 255, 0.03); color: var(--text); }
.nav a.active {
  background: linear-gradient(180deg, #212a3b, #1a2230);
  color: var(--text);
  border-color: var(--line-2);
  box-shadow: var(--bevel-hi), inset 0 -1px 0 rgba(0, 0, 0, 0.35);
}
.nav a.active svg { color: var(--amber); }
.nav .sep { height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); margin: 10px 8px; }
.side-foot { border-top: 1px solid var(--line); padding: 12px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); }
.side-user:hover { background: rgba(255, 255, 255, 0.03); }
.side-user .av { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #05110a; box-shadow: var(--bevel-hi), 0 1px 3px rgba(0, 0, 0, 0.5); }
.side-user .u-name { font-size: 13px; font-weight: 600; line-height: 1.1; }
.side-user .u-sub { font-size: 11px; color: var(--faint); }
.side-foot .mini { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--muted); font-size: 13px; }
.side-foot .mini:hover { background: rgba(255, 255, 255, 0.03); color: var(--text); }
.side-foot .mini svg { width: 16px; height: 16px; }

.main { flex: 1; min-width: 0; }
.content { max-width: 1120px; margin: 0 auto; padding: 30px 32px 40px; }
.app-foot { max-width: 1120px; margin: 0 auto; padding: 8px 32px 44px; color: var(--faint); font-size: 12px; line-height: 1.5; }

/* ---------- Typo / bits ---------- */
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--amber); font-family: var(--font-head); }
.h1 { font-size: 30px; font-weight: 800; letter-spacing: 0.01em; }
.h2 { font-size: 20px; font-weight: 700; letter-spacing: 0.01em; }
.section-label { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); }
.pos { color: var(--green); }
.neg { color: var(--red); }

/* ---------- Cards (forged plates) ---------- */
.card {
  background:
    radial-gradient(130% 90% at 50% -30%, rgba(255, 255, 255, 0.06), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 14px 36px -20px rgba(0, 0, 0, 0.8);
  position: relative;
}
.card.pad { padding: 20px; }
.grid { display: grid; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 6px; }

/* stat tiles */
.stat .k { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.stat .v { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; margin-top: 3px; font-family: var(--font-head); }
.stat .v small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.stat .sub { font-size: 12px; color: var(--faint); margin-top: 2px; }

/* ---------- Buttons (pressable forged keys) ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  background: linear-gradient(180deg, #242e40, #1a2231);
  border: 1px solid var(--line-2);
  color: var(--text);
  box-shadow: var(--bevel-hi), var(--drop);
  transition: filter 0.12s, transform 0.06s, box-shadow 0.12s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); box-shadow: var(--inset); }
.btn svg { width: 15px; height: 15px; }
.btn.primary {
  background: linear-gradient(180deg, var(--amber-hi) 0%, var(--amber) 45%, var(--amber-dim) 100%);
  color: var(--amber-ink);
  border: 1px solid #d98f28;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
  box-shadow: var(--bevel-hi), 0 2px 3px rgba(0, 0, 0, 0.4), 0 8px 20px -8px rgba(240, 165, 49, 0.55);
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.accent {
  background: linear-gradient(180deg, #b6a6ff 0%, var(--purple) 45%, var(--purple-dim) 100%);
  color: #160f36; border: 1px solid #7a6ce6;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
  box-shadow: var(--bevel-hi), 0 2px 3px rgba(0, 0, 0, 0.4), 0 8px 20px -8px rgba(157, 139, 255, 0.5);
}
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.04); }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.3); box-shadow: var(--inset); transform: none; }
.icon-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm); display: grid; place-items: center;
  background: linear-gradient(180deg, #242e40, #1a2231); border: 1px solid var(--line-2);
  box-shadow: var(--bevel-hi), var(--drop);
}
.icon-btn:hover { filter: brightness(1.08); }
.icon-btn:active { transform: translateY(1px); box-shadow: var(--inset); }
.icon-btn svg { width: 16px; height: 16px; }
.btn.lg { padding: 13px 26px; font-size: 15px; }

/* ---------- Chips / tabs (engraved tracks) ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); background: var(--bg-2); border: 1px solid var(--line); box-shadow: var(--inset); }
.chip:hover { color: var(--text); }
.chip.on { color: var(--amber-ink); background: linear-gradient(180deg, var(--amber-hi), var(--amber-dim)); border-color: #d98f28; box-shadow: var(--bevel-hi); }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; color: var(--muted); background: linear-gradient(180deg, #202839, #171e2c); border: 1px solid var(--line); box-shadow: var(--bevel-hi); }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); background: linear-gradient(180deg, #2b2547, #201b38); border-color: rgba(157, 127, 245, 0.5); box-shadow: var(--bevel-hi), 0 0 0 1px rgba(157, 127, 245, 0.25); }
.rarity-chip.on.Legendary { color: var(--orange); }
.rarity-chip.on.Epic { color: var(--purple); }
.rarity-chip.on.Rare { color: var(--blue); }
.rarity-chip.on.Uncommon { color: var(--green); }

/* segmented toggle (Buy/Sell) - recessed track with raised active key */
.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 999px; box-shadow: var(--inset); }
.seg-btn { padding: 8px 24px; border-radius: 999px; font-size: 14px; font-weight: 700; color: var(--muted); background: transparent; transition: color 0.12s; }
.seg-btn:hover { color: var(--text); }
.seg-btn.on { color: var(--amber-ink); background: linear-gradient(180deg, var(--amber-hi), var(--amber-dim)); box-shadow: var(--bevel-hi), 0 2px 5px rgba(0, 0, 0, 0.4); }

/* clean filter bar (marketplace) */
.filterbar { display: flex; flex-direction: column; gap: 14px; padding: 16px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)); border: 1px solid rgba(255, 255, 255, 0.09); border-radius: var(--radius); margin-bottom: 20px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 14px 36px -20px rgba(0, 0, 0, 0.8); }
.filterbar .frow { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.filterbar .rarow { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; }
.rtoggle { padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); background: transparent; border: 1px solid transparent; transition: background 0.12s, color 0.12s; }
.rtoggle:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.rtoggle.on { color: var(--text); background: var(--panel-3); border-color: var(--line-2); box-shadow: var(--bevel-hi); }
.rtoggle.on.Legendary { color: var(--orange); }
.rtoggle.on.Epic { color: var(--purple); }
.rtoggle.on.Rare { color: var(--blue); }
.rtoggle.on.Uncommon { color: var(--green); }

/* ---------- Inputs (recessed slots) ---------- */
.input, select.input { background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text); border-radius: var(--radius-sm); padding: 10px 12px; outline: none; box-shadow: var(--inset); }
.input:focus { border-color: var(--amber); box-shadow: var(--inset), 0 0 0 2px rgba(240, 165, 49, 0.25); }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); }
.search input { padding-left: 36px; width: 100%; }

/* ---------- Badges (stamped) ---------- */
.badge { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; box-shadow: var(--bevel-hi); }
.badge.stock { color: var(--green); background: rgba(62, 227, 139, 0.14); }
.badge.rarity-Legendary { color: var(--orange); background: rgba(232, 161, 60, 0.16); }
.badge.rarity-Epic { color: var(--purple); background: rgba(157, 139, 255, 0.16); }
.badge.rarity-Rare { color: var(--blue); background: rgba(91, 141, 239, 0.16); }
.badge.rarity-Uncommon { color: var(--green); background: rgba(62, 227, 139, 0.14); }
.badge.rarity-Common { color: var(--muted); background: var(--panel-3); }

/* ---------- Marketplace (item slots) ---------- */
/* fluid: auto-reflows on resize, lands on 5-up at full content width */
.market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 14px; }
.pcard {
  min-width: 0;
  background:
    radial-gradient(130% 80% at 50% -20%, rgba(255, 255, 255, 0.07), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 16px; padding: 14px;
  display: flex; flex-direction: column;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 32px -20px rgba(0, 0, 0, 0.75);
  transition: transform 0.14s, box-shadow 0.14s, border-color 0.14s, background 0.14s;
}
.pcard:hover { border-color: rgba(240, 165, 49, 0.5); transform: translateY(-3px); background: radial-gradient(130% 80% at 50% -20%, rgba(255, 255, 255, 0.1), transparent 60%), linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.03)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 18px 42px -20px rgba(0, 0, 0, 0.8); }
.pcard.clickable { cursor: pointer; }
.pcard.clickable:hover { border-color: var(--amber); }
.pcard.clickable:active { transform: translateY(-1px); }
.pcard.clickable:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* compact listing header: small slot + 2-line title, then chip row */
.pc-head { display: flex; align-items: flex-start; gap: 12px; }
.pc-title { flex: 1; min-width: 0; }
.pc-head .thumb { width: 56px; height: 56px; flex: 0 0 56px; aspect-ratio: auto; margin-bottom: 0; border-radius: 12px; font-size: 22px; }
.pc-head .thumb.has-img { padding: 0; }
.pc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.mchip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.01em; color: var(--muted); background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); white-space: nowrap; }
.mchip svg { width: 12px; height: 12px; flex: 0 0 12px; opacity: 0.7; }
.mchip b { color: var(--text); font-weight: 700; }
.mchip.r-Legendary svg { color: var(--orange); opacity: 0.95; }
.mchip.r-Epic svg { color: var(--purple); opacity: 0.95; }
.mchip.r-Rare svg { color: var(--blue); opacity: 0.95; }
.mchip.r-Uncommon svg { color: var(--green); opacity: 0.95; }
.mchip.r-Common svg { color: var(--muted); }
.thumb {
  position: relative;
  aspect-ratio: 1 / 1; width: 100%; border-radius: 14px;
  display: grid; place-items: center; font-size: 40px; font-weight: 800; color: rgba(255, 255, 255, 0.9);
  margin-bottom: 12px; overflow: hidden; background: #10141d;
  /* recessed inventory-slot: inner shadow + metal rim */
  border: 1px solid rgba(0, 0, 0, 0.5);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 1px 0 rgba(255, 255, 255, 0.04);
}
.thumb.rar-Common { background: radial-gradient(72% 72% at 50% 38%, rgba(160, 170, 188, 0.22), transparent 70%), #10141d; }
.thumb.rar-Uncommon { background: radial-gradient(72% 72% at 50% 38%, rgba(62, 227, 139, 0.24), transparent 70%), #0e1a15; }
.thumb.rar-Rare { background: radial-gradient(72% 72% at 50% 38%, rgba(91, 141, 239, 0.26), transparent 70%), #0d1728; }
.thumb.rar-Epic { background: radial-gradient(72% 72% at 50% 38%, rgba(157, 139, 255, 0.28), transparent 70%), #16122b; }
.thumb.rar-Legendary { background: radial-gradient(72% 72% at 50% 38%, rgba(232, 161, 60, 0.3), transparent 70%), #1e1608; }
.thumb.has-img { padding: 0; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.el-Fire { background: linear-gradient(150deg, #3a1512, #7a2a1e); }
.el-Water { background: linear-gradient(150deg, #10263f, #1d4e7a); }
.el-Ice { background: linear-gradient(150deg, #16303a, #2b6d7a); }
.el-Dragon { background: linear-gradient(150deg, #241a3f, #4a2f7a); }
.el-Dark { background: linear-gradient(150deg, #1c1c26, #33334a); }
.el-Ground { background: linear-gradient(150deg, #2f2413, #6a4f22); }
.el-Electric { background: linear-gradient(150deg, #3a3210, #7a6a1e); }
.el-Grass { background: linear-gradient(150deg, #16301a, #2b6a34); }
.el-Item { background: linear-gradient(150deg, #142033, #22405f); }
.el-Bundle { background: linear-gradient(150deg, #2a1a3a, #533a6f); }
.el-Lottery { background: linear-gradient(150deg, #33260f, #6f4f1e); }
.el-Neutral { background: linear-gradient(150deg, #22262f, #3a4150); }
.pcard .pname { font-size: 14px; font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .ptype { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.pcard .pfoot { margin-top: auto; padding-top: 12px; }
.pcard .price { font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; }
.pcard .price b { display: block; font-size: 18px; color: var(--text); letter-spacing: -0.01em; font-family: var(--font-head); }
.pcard .price b span { font-size: 12px; color: var(--muted); font-weight: 600; }
/* stacked buy-card footer: label / coin+price / stock */
.pcard .pfoot.buy { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.pcard .plabel { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.pcard .pprice { display: flex; align-items: center; gap: 6px; }
.pcard .pprice .coin { width: 18px; height: 18px; vertical-align: middle; }
.pcard .pprice b { font-family: var(--font-head); font-size: 20px; color: var(--text); letter-spacing: -0.01em; line-height: 1; }
.pcard .pprice .cur { font-size: 11px; color: var(--muted); font-weight: 600; }
.pcard .pfoot.buy .badge.stock { text-transform: none; letter-spacing: 0.02em; }

/* ---------- Table ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th { text-align: left; padding: 12px 14px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; border-bottom: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.015); }
table.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); }
table.tbl tr:hover td { background: rgba(255, 255, 255, 0.03); }
table.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.rank { width: 46px; color: var(--muted); font-weight: 700; }
.rank .medal { font-size: 16px; }

/* ---------- Activity list ---------- */
.activity { display: flex; flex-direction: column; }
.activity .item { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.activity .item:last-child { border-bottom: none; }
.activity .dot { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--bg-2); box-shadow: var(--inset); }
.activity .dot svg { width: 15px; height: 15px; color: var(--amber); }
.activity .t { font-size: 14px; font-weight: 600; }
.activity .s { font-size: 12px; color: var(--faint); }
.activity .amt { margin-left: auto; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.activity .amt .d { font-size: 11px; color: var(--faint); font-weight: 500; }

/* ---------- Profile header ---------- */
.pf-banner { height: 150px; border-radius: var(--radius) var(--radius) 0 0; background: radial-gradient(120% 160% at 85% 0%, rgba(240, 165, 49, 0.16), transparent 55%), linear-gradient(120deg, #1a1408, #101521); border: 1px solid var(--line); border-bottom: none; position: relative; overflow: hidden; box-shadow: var(--bevel-hi); }
.pf-banner .ghost { position: absolute; right: 30px; top: 8px; font-size: 150px; font-weight: 900; color: rgba(255, 255, 255, 0.03); }
.pf-head { background: var(--panel); border: 1px solid var(--line); border-top: none; border-radius: 0 0 var(--radius) var(--radius); padding: 0 24px 22px; }
.pf-av { width: 108px; height: 108px; border-radius: 50%; margin-top: -54px; border: 4px solid var(--panel); display: grid; place-items: center; font-size: 34px; font-weight: 800; color: #05110a; box-shadow: var(--drop-lg); }
.avatar-grad { background: linear-gradient(150deg, var(--amber), var(--purple)); }
.pf-hero { position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line); padding: 44px 30px; margin-bottom: 16px; background-image: linear-gradient(90deg, rgba(7, 10, 15, 0.95), rgba(7, 10, 15, 0.6) 65%, rgba(7, 10, 15, 0.35)), url('/img/hero.svg'); background-size: cover; background-position: right center; box-shadow: var(--bevel-hi), var(--drop); }
.pf-hero-inner { position: relative; z-index: 1; }

/* ---------- Buy dialog (modal) ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(4, 6, 10, 0.72); backdrop-filter: blur(3px); opacity: 0; transition: opacity 0.16s; }
.modal-overlay.show { opacity: 1; }
.modal { width: 100%; max-width: 420px; padding: 22px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, 0.12); background: radial-gradient(120% 80% at 50% -10%, rgba(255, 255, 255, 0.08), transparent 60%), linear-gradient(180deg, rgba(34, 42, 60, 0.75), rgba(20, 26, 40, 0.72)); backdrop-filter: blur(22px) saturate(1.12); -webkit-backdrop-filter: blur(22px) saturate(1.12); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 30px 70px -24px rgba(0, 0, 0, 0.85); transform: translateY(10px) scale(0.98); transition: transform 0.16s; }
.modal-overlay.show .modal { transform: none; }
.modal-head { display: flex; align-items: flex-start; gap: 14px; }
.modal-head .thumb { width: 64px; height: 64px; flex: 0 0 64px; aspect-ratio: auto; margin-bottom: 0; border-radius: 14px; font-size: 26px; }
.modal-head .thumb.has-img { padding: 0; }
.modal h3 { font-family: var(--font-head); font-size: 18px; line-height: 1.2; }
.modal .desc { color: var(--muted); font-size: 14px; margin: 14px 0 0; }
.modal .pricerow { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; border-radius: 12px; background: var(--bg-2); box-shadow: var(--inset); margin: 14px 0 4px; }
.modal .pricerow b { font-family: var(--font-head); font-size: 18px; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn { flex: 1; justify-content: center; }

/* ---------- Toast + misc ---------- */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(12px); background: linear-gradient(180deg, #2a3346, #1c2432); border: 1px solid var(--line-2); padding: 12px 18px; border-radius: var(--radius-sm); font-size: 14px; opacity: 0; transition: opacity 0.18s, transform 0.18s; pointer-events: none; z-index: 60; box-shadow: var(--bevel-hi), var(--drop-lg); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.empty { text-align: center; color: var(--faint); padding: 26px; font-size: 14px; }
.spinner { width: 22px; height: 22px; border: 2px solid var(--line-2); border-top-color: var(--amber); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-load { display: grid; place-items: center; padding: 60px; }
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); margin: 18px 0; }

@media (max-width: 860px) {
  .sidebar { position: fixed; z-index: 50; transform: translateX(-100%); transition: transform 0.2s; }
  .sidebar.open { transform: translateX(0); }
  .content { padding: 20px 16px 70px; }
  .topbar-mobile { display: flex !important; }
}
.topbar-mobile { display: none; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 20; box-shadow: 0 2px 8px -4px rgba(0, 0, 0, 0.7); }

/* ---------- Stack inline multi-column grids on small screens ---------- */
@media (max-width: 760px) {
  .content .grid[style*="repeat(3"],
  .content .grid[style*="repeat(2"],
  .content .grid[style*="1.5fr"] { grid-template-columns: 1fr !important; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
