:root {
  --bg:          #0d1117;
  --surface:     #161b22;
  --surface2:    #1e2530;
  --border:      #30363d;
  --border-lite: #21272e;

  --text:        #e6edf3;
  --text-muted:  #7d8590;
  --text-dim:    #484f58;

  --hover-bg:    rgba(255,255,255,0.055);
  --pinned-bg:   rgba(240,180,41,0.13);
  --pinned-border: rgba(240,180,41,0.5);

  --radius: 6px;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-display: 'Cinzel', serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  min-height: 100vh;
}

.page {
  max-width: 1300px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

/* ── Header ── */
.site-header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  overflow: visible;
}
.site-header h1 {
  font-family: var(--font-display);
  font-size: clamp(22px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #b88cf0 0%, #e0aaff 50%, #7ec8f8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 18px rgba(180,130,255,0.4));
  margin-bottom: 6px;
  overflow: visible;
}
.site-header .season-label {
  position: relative;
  z-index: 10;
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: clamp(16px, 2.5vw, 26px);
  font-weight: 700;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, #f5e27a 0%, #c8a951 40%, #f0d080 65%, #a07828 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(200, 160, 60, 0.5));
  overflow: visible;
}

/* Chrome doesn't propagate background-clip:text to children — apply gradient directly to each trigger */
.site-header h1 .hdr-dropdown-trigger {
  background: linear-gradient(135deg, #b88cf0 0%, #e0aaff 50%, #7ec8f8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.site-header .season-label .hdr-dropdown-trigger {
  background: linear-gradient(180deg, #f5e27a 0%, #c8a951 40%, #f0d080 65%, #a07828 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Header utility links (compare / back) ── */
.compare-link, .back-link {
  display: inline-block;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  margin-top: 10px;
  transition: color 0.15s;
}
.compare-link:hover, .back-link:hover { color: var(--text); }

/* ── Header dropdowns ── */
.hdr-dropdown {
  position: relative;
  display: inline-block;
  cursor: pointer;
}
.hdr-dropdown-trigger {
  display: inline-block;
  border-bottom: 2px solid transparent;
  transition: border-color 0.18s;
}
.hdr-dropdown:hover .hdr-dropdown-trigger {
  border-bottom-color: rgba(200,169,81,0.5);
}
.site-header h1 .hdr-dropdown:hover .hdr-dropdown-trigger {
  border-bottom-color: rgba(180,130,255,0.5);
}
.hdr-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 180px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 0;
  list-style: none;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  margin-top: 8px;
}
.hdr-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 14px;
}
.hdr-dropdown-menu::after {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: var(--surface2);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
}
.hdr-dropdown:hover .hdr-dropdown-menu {
  display: block;
}
.hdr-dropdown-item {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 8px 16px;
  cursor: pointer;
  text-align: center;
  transition: background 0.12s, color 0.12s;
  -webkit-text-fill-color: initial;
  background-clip: initial;
  -webkit-background-clip: initial;
}
.hdr-dropdown-item:hover {
  background: var(--hover-bg);
  color: var(--text);
}
.hdr-dropdown-item.active {
  color: var(--text);
}
.hdr-dropdown-item + .hdr-dropdown-item {
  border-top: 1px solid var(--border-lite);
}

/* ── Section titles ── */
.section-title {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
  border-left: 3px solid #b88cf0;
  padding-left: 10px;
}

/* ── Table wrapper ── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 32px;
}

/* ── Table base ── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--surface);
}

thead th {
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 12px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border-lite);
  white-space: nowrap;
}
thead th:last-child { border-right: none; }
thead tr:first-child th {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--text);
  background: #1a1820;
  letter-spacing: 0.1em;
}
thead tr.group-header th {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--text);
  background: #1a1820;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 7px 12px;
  text-align: center;
  border-bottom: 1px solid var(--border-lite);
  border-right: 1px solid var(--border-lite);
  vertical-align: middle;
  white-space: nowrap;
  transition: background 0.12s;
}
tbody td:last-child { border-right: none; }
tbody tr:last-child td { border-bottom: none; }
td.left { text-align: left; }

/* ── Hover & pinned ── */
tbody tr { cursor: pointer; }
tbody tr:hover td { background: var(--hover-bg) !important; }
tbody tr.pinned td {
  background: var(--pinned-bg) !important;
  box-shadow: inset 3px 0 0 var(--pinned-border);
}
tbody tr.pinned:hover td { background: rgba(240,180,41,0.2) !important; }

/* ── iLvl numbers ── */
.ilvl-num { font-weight: 700; font-size: 13px; color: var(--text); letter-spacing: 0.02em; }
.ilvl-num.cap { color: #f0b429; }

/* ── Track badge base ── */
.track {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* ── Key level pill ── */
.key-level {
  display: inline-block;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 7px;
  font-weight: 600;
  color: var(--text);
  font-size: 12px;
}

/* ── Dungeon chest/vault value with track letter ── */
.dval {
  font-weight: 700;
  color: var(--text);
}
.dval .tletter {
  font-size: 10px;
  font-weight: 600;
  margin-left: 2px;
  opacity: 0.75;
}

/* ── Crafted label ── */
.crafted-label { color: var(--text-muted); font-size: 12px; }

/* ── Dungeon crest with key cap ── */
.dungeon-crest { display: inline-flex; align-items: center; gap: 4px; }
.dungeon-crest .key-req { font-size: 10px; color: var(--text-dim); font-weight: 500; }

/* ── Notes ── */
.note {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 32px;
  line-height: 1.7;
}
.note strong { color: #b88cf0; }
.note ul { padding-left: 18px; margin-top: 4px; }
.note li { margin-bottom: 2px; }

/* ── Hint ── */
.hint {
  font-size: 11px;
  text-align: right;
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}

/* ── Legend ── */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
  align-items: center;
}
.legend-label { font-size: 11px; color: var(--text-muted); margin-right: 4px; }

/* ── Bottom grid ── */
.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 700px) { .bottom-grid { grid-template-columns: 1fr; } }

/* ── Spacer column ── */
td.spacer, th.spacer {
  width: 16px;
  min-width: 16px;
  background: var(--bg) !important;
  border-left: 1px solid var(--border) !important;
  border-right: 1px solid var(--border) !important;
  padding: 0;
  cursor: default;
}
