/* WoW Forever Talent Sim.
   Palette mirrors immoralstudios.com/css/site.css (--bg, --surface, --line,
   --ink, --accent, --gold). Everything else here is this page's own
   WoWSims/Armory-style skin: dark stone panels, bronze-gold frames, a
   Cinzel display face for headings. No Blizzard art or fonts anywhere,
   self-hosted Cinzel (OFL licensed, see fonts/OFL.txt), CSP-safe (no
   external hosts, fonts/images are local files only). */

@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/cinzel-400.woff2") format("woff2");
}
@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/cinzel-700.woff2") format("woff2");
}

:root {
  --bg: #0b090d;
  --bg-2: #120f16;
  --surface: #17131d;
  --surface-2: #1f1a27;
  --line: #2c2434;
  --ink: #f2ecf5;
  --ink-2: #b3a8bd;
  --ink-3: #7d7288;
  --accent: #e0355a;
  --gold: #e6b45c;
  --gold-dim: #a9824a;
  --bronze: #6b4f26;
  --epic: #a335ee;
  --danger: #e0355a;
  --ok: #6fcf97;

  /* Stone/ink frame tones for the talent-frame look. */
  --stone-1: #1c1820;
  --stone-2: #120f15;
  --stone-3: #0a0910;
  --tooltip-bg: #0a0d16;
  --tooltip-border: #caa25a;

  --radius: 14px;
  --radius-sm: 8px;
  --radius-frame: 2px;
  --maxw: 1320px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Cinzel", Georgia, "Times New Roman", serif;
  --cell: 64px;
  --gap: 10px;
  --class-color: var(--gold);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* belt and suspenders: nothing here should ever force page-level horizontal scroll */
}

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3 {
  line-height: 1.2;
  margin: 0 0 .3em;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: .01em;
}
h2 { font-size: 1.1rem; color: var(--gold); }
h3 { font-size: .82rem; color: var(--ink-2); margin-top: 1.2em; font-family: var(--font); text-transform: uppercase; letter-spacing: .06em; }

.muted { color: var(--ink-3); }

.app {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 16px 60px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ------------------------------------------------------------------ top */

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent, var(--gold-dim) 20%, var(--gold) 50%, var(--gold-dim) 80%, transparent) 1;
}
.top__title h1 {
  font-size: 1.5rem;
  color: var(--gold);
  text-shadow: 0 1px 0 rgba(0,0,0,.6);
}
.top__title p { margin: .2em 0 0; font-size: .92rem; font-family: var(--font); }

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: .6em 1.1em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn--primary {
  background: linear-gradient(180deg, #ea4a6c, var(--accent));
  border-color: #ff7591;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 2px 6px rgba(224,53,90,.35);
}
.btn--primary:hover:not(:disabled) { filter: brightness(1.1); }

.btn--ghost { background: transparent; }

.btn--text {
  background: none;
  border: none;
  padding: .4em .2em;
  color: var(--ink-2);
  font-size: .85rem;
  text-decoration: underline;
}
.btn--text:hover { color: var(--ink); }

/* ----------------------------------------------------------- class picker */

.class-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.class-chip {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  color: var(--ink);
  border-radius: var(--radius-frame);
  padding: .55em 1.1em;
  font-size: .86rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  position: relative;
  padding-left: 1.9em;
}
.class-chip::before {
  content: "";
  position: absolute;
  left: .85em;
  top: 50%;
  transform: translateY(-50%);
  width: .6em;
  height: .6em;
  border-radius: 50%;
  background: var(--class-color);
  box-shadow: 0 0 4px var(--class-color);
}
.class-chip:hover { border-color: var(--class-color); }
.class-chip[aria-pressed="true"] {
  border-color: var(--class-color);
  background: linear-gradient(180deg, color-mix(in srgb, var(--class-color) 22%, var(--surface-2)), var(--surface));
  box-shadow: 0 0 0 1px var(--class-color), 0 0 10px color-mix(in srgb, var(--class-color) 45%, transparent);
}

.race-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.race-chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-frame);
  padding: .5em 1em;
  font-size: .84rem;
  cursor: pointer;
}
.race-chip .race-chip__faction { color: var(--ink-3); font-size: .8em; margin-left: .3em; }
.race-chip:hover { border-color: var(--gold); }
.race-chip[aria-pressed="true"] {
  border-color: var(--gold);
  background: var(--surface-2);
  box-shadow: 0 0 0 1px var(--gold);
}

.racials-panel .racial-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: .85rem;
}
.racials-panel .racial-row:last-child { border-bottom: none; }
.racials-panel .racial-row.is-unsupported { opacity: .5; }
.racials-panel .racial-row__name { font-weight: 700; flex: 0 0 150px; }
.racials-panel .racial-row__body { flex: 1; }
.racials-panel .racial-row__kind {
  font-size: .7rem;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.racials-panel .badge--changed {
  display: inline-block;
  margin-left: 6px;
  padding: .1em .5em;
  border-radius: 999px;
  background: rgba(224,53,90,.15);
  color: var(--accent);
  font-size: .7rem;
  flex: 0 0 auto;
}

/* Compact mode (collapsed, the default): a dense one-line-per-racial list of
   only the DPS-relevant abilities, so this panel stays a strip under the
   race chips instead of pushing the talent trees down the page. */
.racials-panel--compact { padding-bottom: 10px; }
.racials-list--compact { display: flex; flex-direction: column; gap: 2px; }
.racial-row--compact {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  border-bottom: none;
  font-size: .82rem;
}
.racial-row--compact .racial-row__name {
  flex: 0 0 auto;
  font-weight: 700;
  color: var(--ink);
}
.racial-row--compact .racial-row__effect {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --------------------------------------------------------------- panels */

.panel {
  background: linear-gradient(180deg, var(--stone-1), var(--surface) 70%);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-frame);
  box-shadow: inset 0 0 0 1px rgba(230,180,92,.08), 0 2px 8px rgba(0,0,0,.35);
  padding: 16px;
}

.panel__head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(230,180,92,.18);
}
.panel__head h2 { margin: 0; flex: 0 0 auto; }
.panel__head > *:last-child { margin-left: auto; }

.hint { font-size: .85rem; color: var(--ink-3); margin: .3em 0 .8em; }
.hint--warn { color: var(--gold); }

.empty-state, .error-state {
  text-align: center;
  color: var(--ink-2);
}
.error-state { border-color: var(--danger); color: var(--ink); }

.results-placeholder {
  text-align: center;
  color: var(--ink-3);
  font-size: .88rem;
  padding: 32px 16px;
}

/* ----------------------------------------------------------- talent tree */

.talent-total { font-size: .88rem; color: var(--ink-2); }
.talent-total span { color: var(--gold); font-weight: 700; font-family: var(--font-display); }

.build-template, .bis-select {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  color: var(--ink-2);
}
.build-template select { max-width: 220px; }

.template-meta { margin-top: 8px; }
.tag--source {
  display: inline-block;
  padding: .1em .55em;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-3);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.tree-scroll { overflow-x: auto; padding-bottom: 6px; }

.tree-row {
  display: flex;
  gap: 16px;
  width: max-content;
}

/* A single talent tree: dark stone/ink background, bronze-gold frame,
   squared 2px corners, a class-colored gradient cap on the header. */
.tree {
  background: linear-gradient(180deg, var(--stone-1) 0%, var(--stone-2) 55%, var(--stone-3) 100%);
  border: 1px solid var(--bronze);
  border-radius: var(--radius-frame);
  box-shadow:
    inset 0 0 0 1px rgba(230, 180, 92, .12),
    0 2px 6px rgba(0, 0, 0, .5);
  padding: 10px;
  flex: 0 0 auto;
}

.tree__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin: -10px -10px 10px;
  padding: 7px 10px;
  font-size: .85rem;
  border-radius: var(--radius-frame) var(--radius-frame) 0 0;
  border-bottom: 1px solid rgba(230, 180, 92, .3);
  background: linear-gradient(180deg, color-mix(in srgb, var(--tree-color, var(--gold)) 38%, var(--stone-3)), var(--stone-3) 90%);
}
.tree__head .tree__name {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--gold);
  text-shadow: 0 1px 0 rgba(0,0,0,.7);
  letter-spacing: .03em;
}
.tree__head .tree__points { color: var(--ink-2); font-size: .8rem; }

.tree__grid-wrap { position: relative; }

.tree__grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, var(--cell));
  grid-template-rows: repeat(7, var(--cell));
  gap: var(--gap);
}

.tree__lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}
.tree__lines line {
  stroke: var(--bronze);
  stroke-width: 2;
}
.tree__lines line.is-met { stroke: var(--gold); }

/* Square tile with an inner bevel: a light top-left edge and a dark
   bottom-right edge, like an inset WoW action-bar slot. */
.node {
  position: relative;
  width: var(--cell);
  height: var(--cell);
  border: 1px solid var(--bronze);
  border-radius: var(--radius-frame);
  background: linear-gradient(180deg, #2a2430, #17131a);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8rem;
  user-select: none;
  padding: 0;
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, .08),
    inset -1px -1px 0 rgba(0, 0, 0, .6);
}
.node:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.node[data-ranked="0"] { color: var(--ink-3); background: linear-gradient(180deg, var(--stone-1), var(--stone-3)); }
.node[data-ranked="0"][data-locked="true"] { opacity: .4; cursor: not-allowed; }
.node:not([data-ranked="0"]) {
  border-color: var(--tree-color, var(--gold));
  background: linear-gradient(180deg, color-mix(in srgb, var(--tree-color, var(--gold)) 30%, #2a2430), color-mix(in srgb, var(--tree-color, var(--gold)) 8%, #17131a));
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, .16),
    inset -1px -1px 0 rgba(0, 0, 0, .7),
    0 0 7px color-mix(in srgb, var(--tree-color, var(--gold)) 55%, transparent);
}

.node--placeholder {
  opacity: .55;
  border-style: dashed !important;
}
.node--placeholder::after {
  content: "?";
  position: absolute;
  top: -5px;
  left: -5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink-3);
  color: var(--bg);
  font-size: .62rem;
  line-height: 14px;
  text-align: center;
}

.node__abbr { font-size: .82rem; letter-spacing: .02em; }

/* Rank badge, bottom-right corner, gold-on-black like an item-count badge. */
.node__rank {
  position: absolute;
  right: -4px;
  bottom: -4px;
  background: var(--stone-3);
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: var(--radius-frame);
  font-size: .58rem;
  font-weight: 700;
  padding: 0 3px;
  line-height: 1.4;
  font-family: var(--font);
}

.node__minus {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink-2);
  font-size: .7rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.node__minus:hover { color: var(--accent); border-color: var(--accent); }
.node__minus[hidden] { display: none; }

/* --------------------------------------------------------------- tooltip */

.tooltip {
  position: fixed;
  z-index: 50;
  max-width: 280px;
  background: linear-gradient(180deg, var(--tooltip-bg), #050710);
  border: 1px solid var(--tooltip-border);
  border-radius: var(--radius-frame);
  padding: 10px 12px;
  font-size: .82rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.6), inset 0 0 0 1px rgba(202,162,90,.15);
  pointer-events: none;
}
.tooltip[hidden] { display: none; }
.tooltip h4 {
  margin: 0 0 4px;
  font-size: .95rem;
  font-family: var(--font-display);
  color: var(--gold);
  text-shadow: 0 1px 0 rgba(0,0,0,.8);
}
.tooltip ol { margin: 4px 0; padding-left: 1.1em; color: var(--ink); }
.tooltip li.is-current { color: var(--gold); font-weight: 600; }
.tooltip .tooltip__note { color: var(--ink-3); margin-top: 4px; }
.tooltip .badge {
  display: inline-block;
  margin-top: 6px;
  padding: .15em .55em;
  border-radius: 999px;
  background: rgba(230,180,92,.15);
  color: var(--gold);
  font-size: .72rem;
}
.tooltip .badge--placeholder {
  background: rgba(125,114,136,.2);
  color: var(--ink-2);
}

/* -------------------------------------------------------------- stats */

.preset-select, .run-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  color: var(--ink-2);
}

select, input[type="number"], input[type="text"] {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: .4em .6em;
  font-family: var(--font);
  font-size: .88rem;
}
select:focus-visible, input:focus-visible { outline: 2px solid var(--accent); }

.stats-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.stats-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: var(--bg-2);
}
.stats-group h3 { margin-top: 0; }

.stat-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 6px 0;
  font-size: .82rem;
}
.stat-field label { color: var(--ink-2); flex: 1; }
.stat-field input, .stat-field select { width: 110px; }

.weapon-field {
  border-top: 1px dashed var(--line);
  margin-top: 8px;
  padding-top: 8px;
}
.weapon-field .weapon-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 6px 0;
}
.weapon-field .weapon-row input, .weapon-field .weapon-row select { width: 76px; }

/* ------------------------------------------------------------------ gear */

.gear-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.gear-slot {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--bronze);
  border-radius: var(--radius-frame);
  background: linear-gradient(180deg, var(--stone-1), var(--stone-3));
}
.gear-slot.is-locked { opacity: .55; }

.gear-slot__label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-3);
}

.gear-slot__item {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: .78rem;
  font-weight: 600;
  padding: .35em .5em;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gear-slot__item:disabled { cursor: not-allowed; color: var(--ink-3) !important; }

.gear-slot__enchant, .gear-slot__suffix { font-size: .74rem; padding: .3em .4em; }
.gear-slot__clear { align-self: flex-start; font-size: .72rem; padding: 0; }

#gear-warnings .warning { margin-top: 8px; }

.set-bonuses { margin-top: 8px; }
.set-bonus-row {
  font-size: .82rem;
  color: var(--gold);
  padding: 4px 0;
}

/* ---------------------------------------------------------------- picker */

.gear-picker {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(5, 4, 8, .72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.gear-picker__panel {
  width: min(640px, 100%);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--stone-1), var(--stone-3));
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-frame);
  box-shadow: 0 12px 40px rgba(0,0,0,.6);
  overflow: hidden;
}

.gear-picker__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(230,180,92,.25);
}
.gear-picker__head h3 { margin: 0; color: var(--gold); font-family: var(--font-display); }

.gear-picker__filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.gear-picker__filters input[type="search"] { flex: 1 1 160px; }

.gear-picker__list {
  overflow-y: auto;
  padding: 6px;
}

.gear-picker__row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.gear-picker__row:hover:not(:disabled) { background: var(--surface-2); }
.gear-picker__row:disabled { opacity: .4; cursor: not-allowed; }
.gear-picker__name { font-weight: 700; font-size: .88rem; }
.gear-picker__meta { font-size: .74rem; color: var(--ink-3); }
.gear-picker__reason { font-size: .72rem; color: var(--danger); }

/* --------------------------------------------------------------- buffs */

.buffs-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.buffs-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: var(--bg-2);
}
.buffs-group h3 { margin-top: 0; }
.buff-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .84rem;
  padding: 3px 0;
  cursor: pointer;
}
.buff-check input { width: auto; }

.buffs-group--unconfirmed {
  border-style: dashed;
  border-color: var(--ink-3);
}
.buffs-group--unconfirmed summary {
  cursor: pointer;
  font-size: .82rem;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 6px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.buffs-group--unconfirmed .btn--text {
  font-weight: 400;
  padding: 0;
}

/* ------------------------------------------------------------------ run */

.settings-bar {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.run-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* Second settings-bar row: fight conditions (target resistance, downtime,
   cast latency, incoming damage). Same label/select styling as the first
   row, just its own line so it does not compete with the Simulate button
   for wrap space. */
.run-row--conditions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.run-row__title {
  font-size: .82rem;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.target-debuffs {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: .82rem;
  color: var(--ink-2);
}
.target-debuffs label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.target-debuffs input { width: auto; }

.effective-armor {
  font-size: .82rem;
  color: var(--gold);
  white-space: nowrap;
}

.run-actions { display: flex; align-items: center; gap: 8px; }

/* Small screens: keep Simulate/Cancel reachable without scrolling back up
   to the settings bar, as a bottom action bar fixed to the viewport. */
@media (max-width: 640px) {
  .run-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, var(--stone-1), var(--stone-3));
    border-top: 1px solid var(--gold-dim);
    box-shadow: 0 -4px 12px rgba(0,0,0,.4);
  }
  .run-actions .btn { flex: 1 1 auto; }
  /* Leave room at the bottom of the page so the fixed bar never covers the
     footer or the last panel's content. */
  .app { padding-bottom: 76px; }
}

/* Phones: the three trees stack vertically instead of a hidden horizontal
   scroller. Each tree takes the full width and centers its fixed-size grid. */
@media (max-width: 720px) {
  .tree-row {
    flex-direction: column;
    width: 100%;
    gap: 14px;
  }
  .tree {
    width: 100%;
    max-width: 100%;
  }
  .tree__grid-wrap {
    display: flex;
    justify-content: center;
  }
}

.progress {
  margin-top: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  height: 22px;
  position: relative;
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width .1s linear;
}
.progress__label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  color: var(--ink);
}

/* --------------------------------------------------------- two-column layout */

/* Desktop: left column (talents + gear), right column (results + compare),
   the right column sticks as you scroll the left one. Single column, normal
   flow, on narrower screens (including the 375px floor). */
.layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.layout__main {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.layout__side {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

@media (min-width: 960px) {
  .layout {
    flex-direction: row;
    align-items: flex-start;
  }
  .layout__main { flex: 1 1 auto; min-width: 0; }
  .layout__side {
    flex: 0 0 340px;
    position: sticky;
    top: 16px;
  }

  /* The main column now competes with a 340px sticky side column, so the
     three talent trees need smaller tiles/gaps to fit side by side without
     their own inner scrollbar from 1200px up (app maxw caps content width
     at ~1288px past that, so this same size has to work all the way to
     very wide viewports too). --cell/--gap are read live by
     app/talents.js (see CELL/GAP in buildTalentTrees), and it rebuilds the
     trees on resize, so this breakpoint takes effect without a reload. */
  :root {
    --cell: 48px;
    --gap: 8px;
  }
}

/* -------------------------------------------------------------- results */

.results-subtitle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .9rem;
  color: var(--ink-2);
  margin-top: 4px;
}

.badge--unverified {
  display: inline-block;
  padding: .15em .55em;
  border-radius: 999px;
  background: rgba(230,180,92,.15);
  color: var(--gold);
  font-size: .7rem;
  cursor: help;
  border: 1px solid rgba(230,180,92,.35);
}

.dps-headline {
  font-size: 1.9rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--gold);
  text-shadow: 0 1px 0 rgba(0,0,0,.7), 0 0 18px rgba(230,180,92,.25);
  margin: 8px 0;
}
.dps-headline .ci { font-size: .85rem; color: var(--ink-2); font-weight: 400; font-family: var(--font); }

#results-warnings .warning {
  background: rgba(224,53,90,.12);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: .82rem;
  margin-bottom: 8px;
}

.bar-chart { display: flex; flex-direction: column; gap: 6px; }

.bar-row {
  display: grid;
  grid-template-columns: 120px 1fr 70px;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
}
.bar-row .bar-row__label { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .bar-row__track {
  background: var(--bg-2);
  border-radius: 999px;
  height: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.bar-row .bar-row__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}
.bar-row .bar-row__value { text-align: right; color: var(--ink-2); }

.bar-chart--uptime .bar-row__fill { background: var(--ok); }
/* Pinned comparisons get an epic-purple-to-gold gradient: the one spot on
   the page that leans on item-quality purple, kept to this single chart. */
.bar-chart--compare .bar-row__fill { background: linear-gradient(90deg, var(--epic), var(--gold)); }

.bar-row__badge-row {
  margin: -2px 0 2px;
  padding-left: 2px;
}

/* ----------------------------------------------------------------- misc */

.site-footer {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  font-size: .78rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

[hidden] { display: none !important; }

/* ------------------------------------------------------------ responsive */

/* Talent cell/gap pixel sizes are also used by app/talents.js to place the
   SVG prerequisite lines and size the grid. They must stay in sync across
   all breakpoints, so trees keep a fixed pixel size and scroll horizontally
   (via .tree-scroll) on narrow screens instead of shrinking the cells. That
   internal scroller is the one place this page scrolls sideways; the page
   body itself never does, down to 375px. */

@media (max-width: 640px) {
  .app { padding: 14px 10px 48px; }
  .panel { padding: 12px; }
  .bar-row { grid-template-columns: 90px 1fr 56px; font-size: .76rem; }
  .dps-headline { font-size: 1.6rem; }

  /* Gear picker becomes a full-screen sheet rather than a centered dialog. */
  .gear-picker { padding: 0; align-items: stretch; }
  .gear-picker__panel { width: 100%; max-width: none; height: 100%; max-height: none; border-radius: 0; }

  /* Two-column paperdoll grid on phones (holds down to 375px). */
  .gear-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 375px) {
  .class-chip { padding: .5em .9em .5em 1.6em; font-size: .82rem; }
}

/* Verification labels next to the class name in results (see docs/VERIFICATION_SUMMARY.md). */
.badge--caveats,
.badge--verified {
  display: inline-block;
  padding: .15em .55em;
  border-radius: 999px;
  font-size: .7rem;
  cursor: help;
}
.badge--caveats {
  background: rgba(230,180,92,.10);
  color: var(--ink-2, #b3a8bd);
  border: 1px solid rgba(230,180,92,.25);
}
.badge--verified {
  background: rgba(96,200,120,.12);
  color: #8fd9a3;
  border: 1px solid rgba(96,200,120,.35);
}

/* Plain badge: data/assumptions.json's "demo" source (a real number
   transcribed from the BlizzCon demo, no caveat, no verification claim). */
.badge {
  display: inline-block;
  padding: .15em .55em;
  border-radius: 999px;
  font-size: .7rem;
  background: var(--bg-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
}

/* ------------------------------------------------------------ assumptions */

#assumptions-panel summary {
  cursor: pointer;
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 1rem;
}

#assumptions-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.assumption-row {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: var(--bg-2);
  font-size: .82rem;
}
.assumption-row__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.assumption-row__what { color: var(--ink); font-weight: 600; }
.assumption-row__value { color: var(--ink-2); margin-top: 4px; }
.assumption-row__note { color: var(--ink-3); margin-top: 4px; }
