:root {
  --bg: #f3f6f1;
  --surface: #ffffff;
  --surface-alt: #eaf0e7;
  --text: #1b281d;
  --muted: #4b5d4e;
  --primary: #1f6a3f;
  --primary-hover: #175230;
  --accent: #b87d14;
  --border: #d5dfd2;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --font-display: "DM Serif Display", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::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;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.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);
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-icon { width: 32px; height: 32px; border-radius: 8px; }
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}
.nav-link {
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
}
.nav-link:hover, .nav-link.is-active {
  color: var(--primary);
  background: var(--surface-alt);
  text-decoration: none;
}
.nav-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

/* Main & Heroes */
.page-shell { padding-top: 32px; padding-bottom: 64px; }
.breadcrumb { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.breadcrumb a { color: var(--muted); }
.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--surface-alt);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  color: var(--text);
  margin: 0 0 12px;
}
h1 { font-size: 40px; }
h2 { font-size: 28px; margin-top: 48px; }
h3 { font-size: 22px; margin-top: 24px; }
.lead { font-size: 18px; color: var(--muted); max-width: 66ch; margin: 0 0 16px; }
.hero-meta { font-size: 14px; color: var(--muted); margin-top: 12px; }

.hero-block { margin-bottom: 24px; }
.hero-split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 32px;
  align-items: center;
}
.hero-media {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  background: var(--surface);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }

.compact-hero { margin-bottom: 24px; }
.compact-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.compact-head-row > div:first-child { flex: 1 1 auto; min-width: 0; }
.meta-pill {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Inline KPI Bar */
.kpi-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 18px;
  margin-top: 12px;
  box-shadow: var(--shadow-sm);
}
.kpi-item { display: flex; align-items: baseline; gap: 8px; }
.kpi-label { font-size: 13px; color: var(--muted); }
.kpi-value { font-size: 16px; font-weight: 700; color: var(--text); }

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


/* Tool Panels & Calculator */
.tool-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 24px 0 32px;
  box-shadow: var(--shadow-sm);
}
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.calc-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.calc-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.calc-card-head h2 { font-size: 22px; margin: 0; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.field input, .field select, .search-input, .filter-select, .comment-form input, .comment-form textarea {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  width: 100%;
}
.calc-results {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.res-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.res-box span { display: block; font-size: 12px; color: var(--muted); }
.res-box strong { font-size: 17px; color: var(--primary); }
.calc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.compare-banner {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-weight: 600;
  color: var(--text);
}
.pen-roster-box { margin-top: 20px; }
.pen-roster-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.pen-roster-head h3 { font-size: 18px; margin: 0; }
.pen-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.pen-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
}
.pen-row.is-weakest { border-color: var(--accent); background: var(--surface-alt); }
.pen-row-right { display: inline-flex; align-items: center; gap: 10px; }
.pen-empty { font-size: 14px; color: var(--muted); padding: 8px 0; }

/* Bow Filter Bar */
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.search-input { flex: 1 1 260px; }
.filter-select { flex: 0 1 180px; }
.toggle-check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; }
.tracker-pill {
  font-size: 14px;
  padding: 8px 12px;
  background: var(--surface-alt);
  border-radius: 8px;
  color: var(--text);
}
.tool-hint { font-size: 14px; color: var(--muted); margin: 12px 0 0; }

/* Tier List Tabs & 3-Column Uniform Grid */
.tab-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tab-btn {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.tab-btn.is-active { background: var(--primary); color: #ffffff; border-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.is-active { display: flex; flex-direction: column; gap: 12px; }
.tier-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: stretch;
}
.tier-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 24px;
  border-radius: 10px;
  color: #ffffff;
}
.tier-s { background: var(--primary); }
.tier-a { background: var(--primary-hover); }
.tier-b { background: var(--accent); }
.tier-c { background: var(--muted); }
.tier-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.tier-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.rdot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; background: var(--primary); }
.r-uncommon, .r-supreme, .r-emerald { background: var(--primary); }
.r-rare, .r-diamond, .r-celestial, .r-infinity, .r-omega { background: var(--primary-hover); }
.r-epic, .r-legendary, .r-gold, .r-divine, .r-ascended, .r-absolute, .r-rainbow, .r-mythic, .r-ruby, .r-primordial { background: var(--accent); }
.r-secret { background: var(--muted); }

/* Prose & Tables */
.prose p, .prose li { max-width: 72ch; }
.prose ul, .prose ol { padding-left: 20px; }
.prose blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  background: var(--surface);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text);
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 14px;
}
.prose th, .prose td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.prose th {
  background: var(--surface-alt);
  font-weight: 700;
  color: var(--text);
}
.prose tbody tr:hover { background: var(--bg); }
.prose tbody tr.is-owned { background: var(--surface-alt); }
.prose code {
  background: var(--surface-alt);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 14px;
}

/* FAQ */
.faq-section { margin-top: 48px; }
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
}
.faq-item summary { font-weight: 600; cursor: pointer; color: var(--text); }
.faq-item p { margin: 10px 0 0; color: var(--muted); max-width: 70ch; }

/* Engage / Comments */
.engage-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.engage-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
[data-gf-liked] { background: var(--primary); color: #ffffff; border-color: var(--primary); }
.engage-hint, .share-msg, .comment-msg { font-size: 14px; color: var(--muted); }
.comment-form { display: flex; flex-direction: column; gap: 12px; max-width: 640px; margin-bottom: 24px; }
.comment-actions { display: flex; align-items: center; gap: 12px; }
.comments-list { display: flex; flex-direction: column; gap: 12px; }
.comment-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.comment-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.comment-meta strong { color: var(--text); }
.owner-badge { display: none; font-size: 12px; font-weight: 700; color: #ffffff; background: var(--primary); padding: 2px 8px; border-radius: 999px; }
[data-gf-owner] .owner-badge { display: inline-block; }
.comment-body { margin: 0; font-size: 15px; }

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 40px 0 24px;
  margin-top: 48px;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; }
.footer-title { font-family: var(--font-display); font-size: 22px; margin-bottom: 8px; }
.footer-note, .footer-contact { font-size: 14px; color: var(--muted); margin: 0 0 10px; max-width: 54ch; }
.footer-links { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-heading { font-weight: 700; font-size: 14px; color: var(--text); margin-bottom: 4px; }
.footer-col a { font-size: 14px; color: var(--muted); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid var(--border);
  margin-top: 24px;
  padding-top: 16px;
  font-size: 13px;
  color: var(--muted);
}

/* Mobile */
@media (max-width: 860px) {
  .hero-split, .calc-grid, .footer-grid { grid-template-columns: 1fr; }
  .tier-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  h1 { font-size: 30px; }
  h2 { font-size: 24px; }
  .wrap { padding: 0 16px; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px;
  }
  .site-nav.is-open { display: flex; }
  .field-grid, .calc-results { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .prose table { display: block; overflow-x: auto; }
}