:root {
  --bg: #0b0f1a;
  --surface: #151b2b;
  --surface-2: #1c2438;
  --border: #26314a;
  --text: #e8ecf5;
  --muted: #9aa4b8;
  --primary: #5b3df5;
  --primary-hover: #4c2ee0;
  --accent: #22d3ee;
  --common: #94a3b8;
  --rare: #38bdf8;
  --epic: #a855f7;
  --legendary: #f59e0b;
  --mythic: #ef4444;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 12px; color: var(--text); }
h1 { font-size: 40px; letter-spacing: -0.02em; }
h2 { font-size: 28px; margin-top: 32px; }
h3 { font-size: 20px; margin-top: 24px; }
p { margin: 0 0 16px; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 16px; background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 15, 26, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-icon { border-radius: 8px; border: 1px solid var(--border); }
.brand-text { display: flex; align-items: baseline; gap: 6px; font-family: var(--font-head); font-size: 18px; }
.brand-text small { font-size: 12px; color: var(--accent); font-family: var(--font-mono); font-weight: 700; }
.site-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav-link {
  color: var(--muted); font-size: 14px; font-weight: 600;
  padding: 8px 12px; border-radius: 8px; transition: background .15s, color .15s;
}
.nav-link:hover, .nav-link.is-active { background: var(--surface); color: var(--text); text-decoration: none; }
.nav-link.is-active { color: var(--accent); }
.nav-toggle {
  display: none; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px;
  font-size: 14px; font-weight: 600; min-height: 44px; cursor: pointer;
}

/* Hero */
.page-hero { padding: 40px 0 28px; border-bottom: 1px solid var(--border); }
.page-hero.hero-compact { padding: 20px 0 16px; }
.page-hero.hero-compact h1 { font-size: 32px; margin-bottom: 8px; }
.page-hero.hero-compact .hero-lead { font-size: 15px; margin-bottom: 8px; }
.page-hero.hero-compact .updated-pill { margin-bottom: 0; }
.stats-band.stats-compact { padding: 16px 0 0; }
.stats-band.stats-compact .stat-card { padding: 12px 14px; }
.stats-band.stats-compact .stat-value { font-size: 18px; }
.hero-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 32px; align-items: center; }
.hero-grid.hero-single { grid-template-columns: 1fr; }
.breadcrumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.breadcrumbs a { color: var(--muted); }
.eyebrow {
  display: inline-block; font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  color: var(--accent); background: rgba(34, 211, 238, 0.1); border: 1px solid rgba(34, 211, 238, 0.25);
  padding: 4px 10px; border-radius: 999px; margin-bottom: 12px;
}
.hero-lead { font-size: 17px; color: var(--muted); max-width: 62ch; margin-bottom: 16px; }
.updated-pill { font-size: 13px; color: var(--muted); font-family: var(--font-mono); margin-bottom: 20px; }
.updated-pill strong { color: var(--text); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-media { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-md); }
.hero-media img { width: 100%; height: auto; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: var(--radius);
  font-size: 15px; font-weight: 600; cursor: pointer; border: 1px solid transparent;
  transition: background .15s, border-color .15s, transform .1s; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 8px; }

/* Stats Band */
.stats-band { padding: 24px 0 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 4px;
}
.stat-value { font-family: var(--font-mono); font-size: 22px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-label { font-size: 13px; color: var(--muted); }

/* Interactive Widget Shell */
.widget-section { padding: 32px 0 8px; }
.widget-shell { display: flex; flex-direction: column; gap: 24px; }
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.panel-head h2 { margin: 0; font-size: 22px; }
.panel-sub { font-size: 14px; color: var(--muted); margin: 0; }

/* Codes Cards */
.codes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.code-card {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.code-name { font-family: var(--font-mono); font-size: 17px; font-weight: 700; color: var(--accent); display: block; }
.code-reward { font-size: 13px; color: var(--muted); display: block; margin-top: 2px; }
.copy-btn {
  background: var(--primary); color: #fff; border: none; border-radius: 8px;
  min-height: 36px; padding: 0 12px; font-size: 13px; font-weight: 600; cursor: pointer; flex-shrink: 0;
}
.copy-btn:hover { background: var(--primary-hover); }
.copy-btn.copied { background: var(--accent); color: var(--bg); }

/* Filters & Pills */
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.search-input, .select-input, .num-input {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; min-height: 44px; padding: 0 14px; font-size: 15px; font-family: var(--font-body);
}
.search-input { flex: 1 1 240px; }
.search-input:focus, .select-input:focus, .num-input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.pill {
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
  border-radius: 999px; min-height: 36px; padding: 0 14px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.pill:hover, .pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Progress Bar */
.progress-wrap { background: var(--bg); border: 1px solid var(--border); border-radius: 999px; height: 12px; overflow: hidden; margin: 8px 0 12px; }
.progress-fill { height: 100%; background: var(--accent); transition: width .2s; }

/* Powers Cards */
.powers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.power-card {
  background: var(--surface-2); border: 1px solid var(--border); border-top: 3px solid var(--common);
  border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 6px;
  cursor: pointer; transition: transform .12s, border-color .15s;
}
.power-card:hover { transform: translateY(-2px); }
.power-card.r-Common { border-top-color: var(--common); }
.power-card.r-Rare { border-top-color: var(--rare); }
.power-card.r-Epic { border-top-color: var(--epic); }
.power-card.r-Legendary { border-top-color: var(--legendary); }
.power-card.r-Mythic { border-top-color: var(--mythic); box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.25); }
.power-card.owned { background: rgba(34, 211, 238, 0.08); border-color: rgba(34, 211, 238, 0.45); }
.power-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.power-name { font-family: var(--font-head); font-size: 16px; font-weight: 700; color: var(--text); }
.badge-rar { font-family: var(--font-mono); font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.b-Common { color: var(--common); background: rgba(148, 163, 184, 0.14); }
.b-Rare { color: var(--rare); background: rgba(56, 189, 248, 0.14); }
.b-Epic { color: var(--epic); background: rgba(168, 85, 247, 0.16); }
.b-Legendary { color: var(--legendary); background: rgba(245, 158, 11, 0.16); }
.b-Mythic { color: var(--mythic); background: rgba(239, 68, 68, 0.18); }
.power-meta { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.power-moves { font-size: 12px; color: var(--accent); margin-top: 4px; line-height: 1.45; }
.own-tag { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.power-card.owned .own-tag { color: var(--accent); font-weight: 700; }

/* Pack Simulator & Calculator */
.sim-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.sim-results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.sim-card {
  background: var(--bg); border: 1px solid var(--border); border-top: 4px solid var(--common);
  border-radius: var(--radius); padding: 18px 14px; text-align: center;
}
.sim-card.r-Rare { border-top-color: var(--rare); }
.sim-card.r-Epic { border-top-color: var(--epic); }
.sim-card.r-Legendary { border-top-color: var(--legendary); }
.sim-card.r-Mythic { border-top-color: var(--mythic); background: rgba(239, 68, 68, 0.08); }
.sim-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.calc-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.check-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 18px; }
.check-label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); cursor: pointer; }

/* Tier List */
.tier-row { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: stretch; margin-bottom: 12px; }
.tier-badge {
  display: flex; align-items: center; justify-content: center; font-family: var(--font-head);
  font-size: 26px; font-weight: 700; border-radius: var(--radius); color: #0b0f1a;
}
.t-S { background: var(--mythic); color: var(--bg); }
.t-A { background: var(--legendary); }
.t-B { background: var(--epic); color: var(--bg); }
.t-C { background: var(--rare); }
.tier-items {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.tier-chip {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; display: flex; flex-direction: column; gap: 2px;
}
.tier-chip strong { font-size: 14px; color: var(--text); }
.tier-chip span { font-size: 12px; color: var(--muted); }

/* Countdown */
.countdown-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 560px; }
.cd-box {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; text-align: center;
}
.cd-num { font-family: var(--font-mono); font-size: 32px; font-weight: 700; color: var(--accent); display: block; font-variant-numeric: tabular-nums; }
.cd-lbl { font-size: 12px; color: var(--muted); }

/* Prose & Tables */
.prose-section { padding: 32px 0; }
.prose { max-width: 820px; }
.prose p, .prose li { color: var(--text); }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 18px; }
.prose li { margin-bottom: 8px; }
.prose code { font-family: var(--font-mono); font-size: 14px; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; color: var(--accent); }
.prose table { width: 100%; border-collapse: collapse; margin: 20px 0 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; white-space: nowrap; }
.prose th { background: var(--surface-2); color: var(--text); font-weight: 700; }
.prose blockquote { margin: 20px 0; padding: 14px 18px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; color: var(--muted); }

/* FAQ & Related */
.faq-section, .related-section { padding: 32px 0; border-top: 1px solid var(--border); }
.faq-list { display: flex; flex-direction: column; gap: 12px; max-width: 820px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; }
.faq-item summary { font-weight: 700; cursor: pointer; font-size: 16px; color: var(--text); }
.faq-item p { margin: 12px 0 0; color: var(--muted); font-size: 15px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.related-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 6px; transition: border-color .15s;
}
.related-card:hover { border-color: var(--accent); text-decoration: none; }
.related-card strong { font-size: 16px; color: var(--text); }
.related-card span { font-size: 13px; color: var(--muted); }

/* Footer */
.site-footer { margin-top: 48px; padding: 48px 0 32px; border-top: 1px solid var(--border); background: var(--bg); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 32px; }
.footer-desc { font-size: 14px; color: var(--muted); margin-top: 12px; max-width: 38ch; }
.footer-meta, .footer-copy { font-size: 12px; color: var(--muted); margin-top: 10px; }
.footer-col h3 { font-size: 14px; color: var(--text); margin: 0 0 12px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-col a { font-size: 14px; color: var(--muted); }
.footer-col a:hover { color: var(--accent); }

.not-found { padding: 72px 0; text-align: center; }
.not-found .hero-actions { justify-content: center; }

/* Type Progress Pills & Pull Log */
.type-prog-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.type-prog-chip {
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px;
}
.type-prog-chip strong { color: var(--text); }
.odds-strip {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px;
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
}
.odds-pill { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; }
.pull-log { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.pull-log h3 { font-size: 15px; margin: 0 0 10px; }
.pull-log-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pull-chip {
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg);
}
.pull-chip.r-Mythic { color: var(--mythic); border-color: var(--mythic); }
.pull-chip.r-Legendary { color: var(--legendary); border-color: var(--legendary); }

/* Engage & Comments */
.engage-section { padding: 32px 0; border-top: 1px solid var(--border); }
.engage-wrap { max-width: 820px; }
.engage-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.engage-bar [data-gf-liked] { border-color: var(--accent); color: var(--accent); }
.comment-form { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 24px; }
.comment-area {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 14px; font-size: 15px; font-family: var(--font-body); resize: vertical;
}
.comment-area:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.comment-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.comments-list { display: flex; flex-direction: column; gap: 10px; }
.comment-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.comment-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 14px; }
.comment-time { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.comment-text { margin: 0; font-size: 14px; color: var(--text); }

@media (max-width: 820px) {
  .hero-grid, .footer-grid { grid-template-columns: 1fr; }
  .stats-grid, .sim-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  h1 { font-size: 30px; }
  h2 { font-size: 24px; }
  .nav-toggle { display: inline-flex; align-items: center; }
  .site-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px 20px; flex-direction: column; align-items: stretch; }
  .site-nav.open { display: flex; }
  .sim-results { grid-template-columns: 1fr; }
  .tier-row { grid-template-columns: 1fr; }
  .tier-badge { padding: 8px; font-size: 20px; }
  .countdown-grid { grid-template-columns: repeat(2, 1fr); }
  .btn { width: 100%; }
}
