:root {
  --bg: #0f1115;
  --bg-alt: #161923;
  --panel: #1b1f2b;
  --panel-2: #232838;
  --border: #2e3444;
  --text: #e7e9f0;
  --text-dim: #9aa0b4;
  --gold: #d4af37;
  --gold-bright: #f4d76b;
  --tank: #4c8bf5;
  --heal: #3fbf6f;
  --dps: #e05a5a;
  --support: #b06fe0;
  --radius: 8px;
  --maxw: 1400px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  line-height: 1.5;
}
a { color: var(--gold-bright); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 { font-family: Georgia, "Times New Roman", serif; color: var(--gold-bright); margin: 0 0 .5em; }
button, input, select, textarea { font-family: inherit; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(180deg, #12141c, #0f1115);
  border-bottom: 1px solid var(--border);
}
.stream-status-bar {
  display: block; text-align: center; font-size: .78rem; font-weight: bold; letter-spacing: .02em;
  padding: 5px 10px; background: var(--panel-2); border-bottom: 1px solid var(--border);
  text-decoration: none; cursor: pointer;
}
.stream-status-bar:hover { text-decoration: underline; }
.stream-status-bar.is-offline { color: #ff4d4d; }
.stream-status-bar.is-online { color: #3ddc84; }
.nav-wrap {
  max-width: var(--maxw); margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; height: 68px;
}
.brand { font-family: Georgia, serif; font-size: 1.3rem; font-weight: bold; color: var(--gold-bright); white-space: nowrap; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand span { color: var(--text-dim); font-weight: normal; font-size: .85rem; display: block; }
.brand-logo { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.nav-wrap nav { min-width: 0; }
.nav-links { display: flex; flex-wrap: nowrap; gap: 0; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  color: var(--text); font-size: .8rem; padding: 8px 8px; border-radius: 6px; white-space: nowrap;
  text-decoration: none;
}
.nav-links a:hover, .nav-links a.active { background: var(--panel-2); color: var(--gold-bright); }
.hamburger { display: none; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 8px 10px; cursor: pointer; }
.auth-widget { margin-left: 12px; white-space: nowrap; flex-shrink: 0; }
.auth-widget .btn { padding: 6px 12px; font-size: .82rem; }
.auth-account { display: flex; align-items: center; gap: 8px; font-size: .82rem; }
.auth-avatar { width: 24px; height: 24px; border-radius: 50%; }

/* Above the hamburger breakpoint, the nav has its own scroll area instead of
   shrinking below its content width — flexbox shrinking a nowrap row causes it
   to visually overflow and overlap the brand/auth widget next to it. */
@media (min-width: 1401px) {
  /* A visible (if thin) scrollbar here matters: an invisible one leaves the
     last links (and the login button sitting right after nav) scrolled out
     of view with no cue that there's more to see. */
  .nav-wrap nav { flex: 1 1 auto; overflow-x: auto; scrollbar-width: thin; }
  .nav-wrap nav::-webkit-scrollbar { height: 4px; }
  .nav-wrap nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
}

@media (max-width: 1400px) {
  .hamburger { display: block; }
  .nav-links {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    background: var(--bg-alt); border-bottom: 1px solid var(--border);
    flex-direction: column; padding: 10px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px; border-radius: 6px; }
}

/* ---------- Hero ---------- */
.hero {
  text-align: center; padding: 70px 20px 40px;
  background: radial-gradient(ellipse at top, #232a40 0%, var(--bg) 65%);
  border-bottom: 1px solid var(--border);
}
.hero h1 { font-size: 2.6rem; margin-bottom: .3em; }
.hero p { color: var(--text-dim); max-width: 640px; margin: 0 auto; }

.search-bar { max-width: 560px; margin: 24px auto 0; display: flex; gap: 8px; }
.search-bar input {
  flex: 1; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-size: 1rem;
}
.search-bar button {
  padding: 12px 20px; border-radius: var(--radius); border: 1px solid var(--gold);
  background: var(--gold); color: #1a1a1a; font-weight: bold; cursor: pointer;
}

/* ---------- Sections ---------- */
.section { padding: 40px 20px; }
.section h2 { font-size: 1.6rem; border-bottom: 1px solid var(--border); padding-bottom: 10px; }

.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.filter-chip {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text-dim); cursor: pointer; font-size: .85rem;
}
.filter-chip.active { border-color: var(--gold); color: var(--gold-bright); background: var(--panel-2); }

/* ---------- Class tile grid ---------- */
.class-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px;
}
.class-tile {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 10px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: transform .12s, border-color .12s;
}
.class-tile { border-color: var(--class-color, var(--border)); }
.class-tile:hover { transform: translateY(-3px); box-shadow: 0 0 0 2px color-mix(in srgb, var(--class-color, var(--gold)) 45%, transparent); text-decoration: none; }
.class-tile .icon-wrap { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.class-tile .cname { font-weight: bold; color: var(--text); }
.class-tile .cspecs { font-size: .72rem; color: var(--text-dim); }

/* ---------- Cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
}
.card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.tag { display: inline-block; font-size: .68rem; padding: 2px 8px; border-radius: 999px; margin-right: 4px; background: var(--panel-2); color: var(--text-dim); }
.tag.tag-class-color { border: 1px solid currentColor; font-weight: bold; }
.role-tank { color: var(--tank); } .role-heal { color: var(--heal); } .role-dps { color: var(--dps); } .role-support { color: var(--support); }

/* ---------- Tabs ---------- */
.tabbar { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; flex-wrap: wrap; }
.tabbar button {
  background: none; border: none; color: var(--text-dim); padding: 10px 16px; cursor: pointer; font-size: .95rem;
  border-bottom: 2px solid transparent;
}
.tabbar button.active { color: var(--gold-bright); border-bottom-color: var(--gold); }

/* ---------- Talent tree ---------- */
.calc-summary {
  background: var(--panel-2); border: 1px solid var(--gold); border-radius: var(--radius);
  padding: 12px 16px; margin: 14px 0; font-size: 1rem; color: var(--text);
}
.tree-heading { color: var(--gold-bright); font-size: 1.1rem; margin: 0 0 10px; }
/* Keeps the Spec Tree heading on the same line as its spec-tab buttons, so
   both tree boxes start at the same y — otherwise the tabs row pushed the
   spec tree lower than the class tree. */
.tree-heading-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 10px; }
.tree-heading-row .tree-heading { margin: 0; }
.tree-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tree-heading-row .tree-tabs { margin: 0; }
.tree-tabs button {
  background: var(--panel); border: 1px solid var(--border); color: var(--text); padding: 8px 14px;
  border-radius: 6px; cursor: pointer;
}
.tree-tabs button.active { border-color: var(--gold); color: var(--gold-bright); }
.tree-pool { font-size: .85rem; color: var(--text-dim); margin-bottom: 10px; font-weight: bold; }

/* ---------- Side-by-side tree layout ---------- */
/* Trees render at a fixed pixel size in JS, then js/talent-tree.js scales
   them down (uniformly, via transform) to always fit on one line here with
   no gap and no scrollbars — see coaFitTreeRow(). Never add overflow:auto
   or flex-grow here; that's what caused the per-tree scrollbars before. */
.trees-row {
  display: flex; gap: 20px; align-items: flex-start; flex-wrap: nowrap;
}
.tree-col { flex: 0 1 auto; min-width: 0; overflow: hidden; }
.talent-tree-scaler { transform-origin: top left; }

@media (max-width: 800px) {
  .trees-row { flex-direction: column; }
  .tree-col { flex: 1 1 auto; width: 100%; }
}

.talent-tree-wrap {
  position: relative; background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; overflow: visible;
}
.talent-tree-svg { position: absolute; top: 0; left: 0; pointer-events: none; }
.talent-node {
  position: absolute; width: 46px; height: 46px; border-radius: 6px; border: 2px solid #444a5c;
  cursor: pointer; background: #20242f; transition: border-color .1s, box-shadow .1s, opacity .1s;
}
.talent-node .coa-builder-icon { border-radius: 4px; }

/* Locked: not yet reachable (level/tier gate not met) */
.talent-node.locked { opacity: .3; filter: grayscale(1); cursor: not-allowed; }

/* Available: unlocked, 0 points spent yet — clickable, but visibly NOT selected */
.talent-node.available { border-color: #6a7a99; background: #20242f; }
.talent-node.available:hover { border-color: var(--gold-bright); }
.talent-node.available .badge { background: #000; border-color: #6a7a99; color: #9aa0b4; }

/* Has points: selected talent — filled + glowing + checkmark, unmistakably "picked" */
.talent-node.has-points {
  border-color: var(--gold); background: rgba(212,175,55,.35);
  box-shadow: 0 0 0 3px var(--gold), 0 0 16px rgba(212,175,55,.7);
}
.talent-node.has-points::after {
  content: "✓"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: bold; color: var(--gold-bright); text-shadow: 0 0 4px #000, 0 0 4px #000;
  background: rgba(0,0,0,.25); border-radius: 4px; pointer-events: none;
}
.talent-node.maxed { border-color: var(--gold-bright); background: rgba(244,215,107,.4); box-shadow: 0 0 0 3px var(--gold-bright), 0 0 18px rgba(244,215,107,.85); }

.talent-node .badge {
  position: absolute; bottom: -7px; right: -7px; background: #000; border: 1px solid var(--gold);
  color: var(--gold-bright); font-size: .64rem; font-weight: bold; border-radius: 4px; padding: 1px 4px; line-height: 1.3;
  z-index: 1;
}
.talent-node .level-badge {
  bottom: auto; right: auto; top: -7px; left: -7px; border-color: #6a7a99; color: #9db4e0;
}

/* Choice node: two mutually-exclusive talents sharing one grid cell in the source
   data. Unpicked, it previews both options split half-and-half in one cell; click
   opens a picker to choose one, which then fills the cell like a normal talent —
   clicking it again reopens the picker to change the pick. */
.talent-node.choice-placeholder { overflow: hidden; }
.talent-node.choice-placeholder .choice-half { position: absolute; inset: 0; }
.talent-node.choice-placeholder .choice-half .coa-builder-icon { width: 100%; height: 100%; }
.talent-node.choice-placeholder .choice-half:nth-child(1) { clip-path: inset(0 50% 0 0); }
.talent-node.choice-placeholder .choice-half:nth-child(2) { clip-path: inset(0 0 0 50%); }
.talent-node.choice-placeholder::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px;
  background: var(--gold, #d4af37); opacity: .7; pointer-events: none;
}

.choice-picker {
  display: none; position: fixed; z-index: 600; background: #0c0e13; border: 1px solid var(--gold);
  border-radius: 8px; padding: 6px; min-width: 260px; max-width: 320px; box-shadow: 0 8px 24px rgba(0,0,0,.6);
}
.choice-picker-opt {
  display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: none;
  border-radius: 6px; padding: 8px; cursor: pointer; text-align: left; color: var(--text); font: inherit;
}
.choice-picker-opt:hover { background: var(--panel-2); }
.choice-picker-opt .coa-builder-icon { width: 36px; height: 36px; border-radius: 4px; flex-shrink: 0; }
.choice-picker-opt-text { display: flex; flex-direction: column; gap: 2px; font-size: .82rem; }
.choice-picker-opt-text strong { color: var(--gold-bright); }
.choice-picker-opt-text span { color: var(--text-dim); font-size: .76rem; }

.node-tooltip {
  position: fixed; max-width: 320px; background: #0c0e13; border: 1px solid var(--gold); border-radius: 6px;
  padding: 12px; font-size: .85rem; z-index: 500; display: none; box-shadow: 0 6px 20px rgba(0,0,0,.6);
}
.node-tooltip h4 { margin: 0 0 6px; color: var(--gold-bright); }
.node-tooltip .item-number { color: var(--gold-bright); font-weight: bold; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 4px; font-size: .85rem; color: var(--text-dim); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--panel); color: var(--text);
}
.form-group textarea { resize: vertical; line-height: 1.5; }
.form-group textarea.mono { font-family: "Consolas", "Cascadia Code", "Courier New", monospace; font-size: .85rem; }
.btn {
  display: inline-block; padding: 10px 18px; border-radius: 6px; border: 1px solid var(--gold);
  background: var(--gold); color: #1a1a1a; font-weight: bold; cursor: pointer;
}
.btn.secondary { background: transparent; color: var(--gold-bright); }

/* ---------- Table ---------- */
table.data-table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: var(--radius); overflow: hidden; }
table.data-table th, table.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; font-size: .88rem; }
table.data-table th { background: var(--panel-2); color: var(--gold-bright); }

/* ---------- FAQ ---------- */
.faq-item {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel);
  padding: 4px 16px; margin-bottom: 10px;
}
.faq-question {
  padding: 12px 0; cursor: pointer; font-weight: 600; color: var(--gold-bright);
  list-style: none;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::before { content: "+"; display: inline-block; width: 1.2em; color: var(--gold); font-weight: bold; }
.faq-item[open] .faq-question::before { content: "\2212"; }
.faq-answer { padding: 0 0 14px 1.2em; color: var(--text); line-height: 1.6; }

/* ---------- Addons ---------- */
.importance-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem;
  font-weight: 600; border: 1px solid var(--border); background: var(--panel-2); color: var(--text-dim);
  white-space: nowrap;
}
.importance-must-have { color: var(--gold-bright); border-color: var(--gold); background: rgba(212,175,55,.14); }
.importance-okay-to-have { color: #8fb996; border-color: #3a5c46; background: rgba(143,185,150,.12); }

/* ---------- Tier list (spec icon rows) ---------- */
.tier-badge { font-weight: bold; font-size: 1rem; text-align: center; width: 40px; }
.tier-s { color: #ff5f5f; }
.tier-a { color: #ffb04d; }
.tier-b { color: #d4af37; }
.tier-c { color: #8fb996; }
.spec-icon-row { display: flex; flex-wrap: wrap; gap: 6px; }
.spec-btn { display: inline-flex; padding: 0; border: 2px solid var(--border); border-radius: 6px; background: var(--panel-2); cursor: default; overflow: hidden; line-height: 0; }
.spec-icon { width: 32px; height: 32px; object-fit: cover; display: block; }
.spec-icon.class-icon-circle { border-radius: 0; }
.spec-icon.class-icon-circle .coa-builder-icon { width: 100%; height: 100%; background-size: cover; }

.notice { background: var(--panel-2); border: 1px dashed var(--border); border-radius: var(--radius); padding: 14px 16px; color: var(--text-dim); font-size: .9rem; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-dim); }

/* ---------- Voting ---------- */
.vote-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-dim); padding: 6px 10px; cursor: pointer; font-weight: bold;
}
.vote-btn:hover { border-color: var(--gold); color: var(--gold-bright); }
.vote-btn.voted { background: rgba(212,175,55,.18); border-color: var(--gold); color: var(--gold-bright); }
.vote-btn .vote-arrow { font-size: .8rem; line-height: 1; }
.vote-btn .vote-count { font-size: .95rem; line-height: 1; }

/* ---------- Guide editor ---------- */
.guide-section-editor {
  margin-bottom: 18px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); padding: 14px 16px;
}
.guide-section-editor label {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px;
  color: var(--gold-bright); font-family: Georgia, serif; font-size: 1.05rem;
}
.guide-section-editor label .guide-icon { font-size: .95rem; }
.guide-section-editor textarea {
  width: 100%; min-height: 220px; resize: vertical; line-height: 1.55; font-size: .92rem;
  padding: 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--panel); color: var(--text);
  transition: border-color .15s ease;
}
.guide-section-editor textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(212,175,55,.2);
}
.guide-section-editor textarea.mono {
  font-family: "Consolas", "Cascadia Code", "Courier New", monospace; font-size: .85rem;
}
.guide-section-editor[data-key="overview"] textarea,
.guide-section-editor[data-key="rotation"] textarea { min-height: 280px; }
.guide-section-hint { font-size: .78rem; color: var(--text-dim); margin: 6px 0 0; }
.guide-section-hint code {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 3px;
  padding: 1px 5px; font-size: .82em; color: var(--gold-bright);
}
.guide-char-count { font-size: .74rem; color: var(--text-dim); text-align: right; margin-top: 4px; }
.guide-char-count.over { color: var(--dps); }

/* ---------- @Ability mention autocomplete ---------- */
.mention-autocomplete {
  position: absolute; z-index: 500; min-width: 220px; max-width: 340px; max-height: 260px;
  overflow-y: auto; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.45); padding: 4px;
}
.mention-autocomplete-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px;
  cursor: pointer; line-height: 1.2;
}
.mention-autocomplete-item .coa-builder-icon { width: 22px; height: 22px; flex: none; border-radius: 3px; }
.mention-autocomplete-name { color: var(--text); font-size: .88rem; flex: 1; }
.mention-autocomplete-class { color: var(--text-dim); font-size: .74rem; flex: none; }
.mention-autocomplete-item:hover, .mention-autocomplete-item.active {
  background: rgba(212,175,55,.18);
}
.mention-autocomplete-item.active .mention-autocomplete-name { color: var(--gold-bright); }

.guide-section.guide-live-preview {
  margin: 12px 0 0; padding: 12px 14px; border-color: var(--border); background: var(--panel-2);
}
.guide-live-preview-label {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); margin-bottom: 8px;
}

/* ---------- Guide display (build-view.html) ---------- */
.guide-nav {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 22px; position: sticky; top: 0;
  background: var(--bg); padding: 10px 0; z-index: 5;
}
.guide-nav a {
  font-size: .8rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border);
  color: var(--text-dim); text-decoration: none; transition: border-color .15s ease, color .15s ease;
}
.guide-nav a:hover, .guide-nav a.active { border-color: var(--gold); color: var(--gold-bright); }

.guide-section {
  margin-bottom: 28px; scroll-margin-top: 60px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--panel); padding: 18px 22px;
}
.guide-section h3 {
  display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border);
  padding-bottom: 8px; margin-bottom: 12px; font-size: 1.15rem;
}
.guide-body { max-width: 74ch; line-height: 1.7; font-size: .96rem; color: var(--text); }
.guide-body p { margin: 0 0 1em; }
.guide-body p:last-child { margin-bottom: 0; }
.guide-body strong { color: var(--gold-bright); }
.guide-body em { color: var(--text-dim); }
.guide-body code {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 3px;
  padding: 1px 6px; font-size: .88em; font-family: "Consolas", "Cascadia Code", "Courier New", monospace;
  color: var(--gold-bright);
}
.guide-body ul { margin: 0 0 1em; padding-left: 1.3em; }
.guide-body li { margin-bottom: .4em; }
.guide-body li:last-child { margin-bottom: 0; }

/* Macros read as literal command blocks, not prose — monospace, no paragraph reflow. */
.guide-section.guide-macros .guide-body {
  max-width: none;
}
.guide-section.guide-macros pre {
  background: #14161c; border: 1px solid var(--border); border-radius: 6px;
  padding: 14px 16px; overflow-x: auto; margin: 0;
  font-family: "Consolas", "Cascadia Code", "Courier New", monospace;
  font-size: .85rem; line-height: 1.6; color: #d8dee9;
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); margin-top: 60px; padding: 40px 20px 20px; }
.footer-grid { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px; }
.footer-grid h4 { color: var(--gold-bright); font-size: .9rem; margin-bottom: 10px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 6px; }
.footer-grid a { color: var(--text-dim); font-size: .85rem; }
.footer-bottom { max-width: var(--maxw); margin: 20px auto 0; padding-top: 16px; border-top: 1px solid var(--border); font-size: .78rem; color: var(--text-dim); text-align: center; }

.role-badge { padding: 2px 8px; border-radius: 4px; font-size: .7rem; font-weight: bold; }
.role-badge.tank { background: rgba(76,139,245,.15); color: var(--tank); }
.role-badge.healer { background: rgba(63,191,111,.15); color: var(--heal); }
.role-badge.dps { background: rgba(224,90,90,.15); color: var(--dps); }
.role-badge.support { background: rgba(176,111,224,.15); color: var(--support); }

.page-title { padding: 30px 20px 0; max-width: var(--maxw); margin: 0 auto; }
.page-subtitle { color: var(--text-dim); margin: 0; }
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }

/* ---------- Builds browser (search + class filter row + sort/role/content + cards) ---------- */
.builds-browser { max-width: var(--maxw); margin: 0 auto; }

.builds-search { margin-bottom: 20px; }
.builds-search input {
  width: 100%; padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-size: 1rem;
}
.builds-search input:focus { outline: none; border-color: var(--gold); }

.class-icon-row {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 14px 8px; margin-bottom: 24px;
}
.class-icon-row .class-icon-btn { width: 76px; }
.class-icon-btn {
  background: none; border: none; cursor: pointer; color: var(--text-dim);
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px; font-size: .72rem;
}
.class-icon-circle {
  width: 52px; height: 52px; border-radius: 50%; overflow: hidden; display: flex; align-items: center;
  justify-content: center; background: var(--panel); border: 2px solid var(--border); transition: border-color .12s, box-shadow .12s;
}
.class-icon-circle .coa-builder-icon { width: 100%; height: 100%; background-size: cover; }
.class-icon-circle.class-icon-all { font-weight: bold; color: var(--gold-bright); font-size: .78rem; }
/* Border color per class is set inline (--class-color) from COA_CLASSES data — hover/active
   stay as a glow around that color instead of overriding it with a generic gold border,
   so the class identity color stays visible in every state. */
.class-icon-circle { border-color: var(--class-color, var(--border)); }
.class-icon-btn:hover .class-icon-circle { box-shadow: 0 0 0 3px color-mix(in srgb, var(--class-color, var(--gold)) 35%, transparent); }
.class-icon-btn.active .class-icon-circle {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--class-color, var(--gold-bright)) 45%, transparent), 0 0 14px color-mix(in srgb, var(--class-color, var(--gold-bright)) 60%, transparent);
}
.class-icon-btn.active .class-icon-label { color: var(--gold-bright); }
.class-icon-label { max-width: 78px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.builds-filters {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 20px 32px; align-items: center;
  padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 22px;
}
.filter-group { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.filter-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); }

.sort-chips { display: flex; gap: 4px; }
.sort-chip {
  background: none; border: none; color: var(--text-dim); padding: 4px 8px; cursor: pointer; font-size: .85rem; border-radius: 4px;
}
.sort-chip:hover { color: var(--text); }
.sort-chip.active { color: var(--gold-bright); font-weight: bold; }

.pill-group { display: flex; gap: 4px; flex-wrap: wrap; }
.pill-btn {
  background: var(--panel); border: 1px solid var(--border); color: var(--text-dim);
  padding: 5px 12px; border-radius: 6px; cursor: pointer; font-size: .8rem;
}
.pill-btn:hover { border-color: var(--gold); color: var(--text); }
.pill-btn.active { background: var(--panel-2); border-color: var(--gold); color: var(--gold-bright); }

.build-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.build-card {
  display: block; position: relative; background: var(--panel);
  border: 2px solid var(--class-color, var(--border));
  border-radius: var(--radius); padding: 18px 16px 14px; overflow: hidden; color: var(--text);
  transition: transform .12s, box-shadow .12s;
}
.build-card:hover { transform: translateY(-2px); box-shadow: 0 0 0 2px color-mix(in srgb, var(--class-color, var(--gold)) 45%, transparent); text-decoration: none; }
.build-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--border);
}
.build-card.role-accent-tank::before { background: var(--tank); }
.build-card.role-accent-heal::before { background: var(--heal); }
.build-card.role-accent-dps::before { background: var(--dps); }
.build-card.role-accent-support::before { background: var(--support); }

.build-card-toptag { display: flex; align-items: center; gap: 8px; font-size: .78rem; margin-bottom: 8px; }
.build-card-toptag .tag-class {
  font-weight: bold; border: 1px solid var(--gold-bright); border-radius: 999px; padding: 1px 9px;
}
.build-card-toptag .tag-spec { color: var(--text-dim); }

.build-card-title { font-size: 1.05rem; margin: 0 0 10px; color: var(--text); }

.build-card-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.build-card-pills .pill {
  font-size: .68rem; padding: 2px 8px; border-radius: 999px; background: var(--panel-2); color: var(--text-dim);
}
.build-card-pills .pill-guide { background: rgba(63,191,111,.15); color: var(--heal); }

.build-card-footer {
  display: flex; align-items: center; gap: 12px; font-size: .78rem; color: var(--text-dim);
  border-top: 1px solid var(--border); padding-top: 10px; flex-wrap: wrap;
}
.build-card-footer .vote-count { color: var(--gold-bright); font-weight: bold; }

/* ---------- @Ability mention chips + hover tooltip (js/skill-tooltip.js) ---------- */
.skill-mention {
  color: var(--class-color, var(--gold-bright));
  background: color-mix(in srgb, var(--class-color, var(--gold)) 14%, transparent);
  border-bottom: 1px dotted var(--class-color, var(--gold));
  border-radius: 3px; padding: 0 3px; cursor: pointer; font-weight: 600; white-space: nowrap;
}
.skill-mention:hover, .skill-mention:focus {
  background: color-mix(in srgb, var(--class-color, var(--gold)) 28%, transparent); outline: none;
}

.skill-tooltip-card {
  position: fixed; max-width: 320px; background: #0c0e13; border: 1px solid var(--class-color, var(--gold)); border-radius: 6px;
  padding: 12px 14px; font-size: .85rem; line-height: 1.45; z-index: 600; box-shadow: 0 6px 20px rgba(0,0,0,.6);
}
.skill-tt-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.skill-tt-title { font-family: Georgia, "Times New Roman", serif; color: var(--class-color, var(--gold-bright)); font-size: 1.05rem; margin-bottom: 2px; }
.skill-tt-subtitle { color: var(--text-dim); font-size: .78rem; }
.skill-tt-costline { color: var(--gold-bright); font-size: .78rem; margin-bottom: 8px; }
.skill-tt-desc { color: var(--text); }
.skill-tt-desc .item-number { color: var(--gold-bright); font-weight: bold; }
.skill-tt-footer {
  margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border);
  color: var(--text-dim); font-size: .72rem; font-style: italic;
}
.build-card-footer .build-card-updated { margin-left: auto; }
