/* Talent calculator and races pages. Only app.css tokens; --cls is the selected class color (accent only). */

:root { --cls: var(--gold); --ok: var(--r-green); }

.tc-loading { color: var(--muted); padding: 40px 2px; }

/* ---------- header + class picker ---------- */
.tc-head h1, .rc-head h1 { margin: 0; font-size: 24px; letter-spacing: -0.02em; line-height: 1.15; }
.tc-intro, .rc-intro { margin: 6px 0 0; color: var(--muted); font-size: 14px; max-width: 70ch; }

.tc-classes { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 14px; }
.tc-class {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 12px 0 10px; border-radius: 8px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-size: 14px;
  transition: border-color .12s, color .12s, background .12s;
}
.tc-class .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--cls); box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); }
.tc-class:hover { color: var(--text); border-color: var(--muted); }
.tc-class[aria-pressed="true"] {
  color: var(--text); background: var(--raise); border-color: var(--cls);
  box-shadow: inset 0 -2px 0 var(--cls);
}

/* ---------- summary bar ---------- */
.tc-bar {
  position: sticky; top: 0; z-index: 4;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px;
  margin: 0 calc(-1 * var(--gutter)); padding: 10px var(--gutter);
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.tc-stats { display: flex; flex-wrap: wrap; gap: 6px 26px; margin: 0; align-items: baseline; }
.tc-stats > div { display: flex; flex-direction: column; }
.tc-stats dt { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
.tc-stats dd { margin: 0; font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tc-stats dd b { color: var(--gold); font-weight: 700; }
.tc-stats .of { color: var(--muted); font-weight: 500; font-size: 15px; }
.tc-stats .tc-start dd { font-size: 14px; font-weight: 500; color: var(--muted); padding-top: 16px; }
.tc-stats .split dd { font-family: var(--code); font-size: 15px; color: var(--muted); font-weight: 500; padding-top: 16px; }
.tc-actions { display: flex; align-items: center; gap: 8px; }
.tc-btn, .tc-mini {
  height: 32px; padding: 0 12px; border-radius: 7px; cursor: pointer; white-space: nowrap;
  background: var(--panel); border: 1px solid var(--line); color: var(--text); font-size: 13.5px;
}
.tc-btn:hover:not(:disabled), .tc-mini:hover:not(:disabled) { border-color: var(--muted); background: var(--raise); }
.tc-btn:disabled, .tc-mini:disabled { opacity: .45; cursor: default; }
.tc-toast { color: var(--str); font-size: 13px; min-width: 1px; }

/* ---------- trees ---------- */
.tc-trees { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 16px; scroll-margin-top: 80px; }
.tc-tree {
  position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 18px;
  background:
    radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--cls) 13%, transparent), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--cls) 5%, var(--panel)), var(--panel));
}
.tc-tree-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.tc-tree-head img { width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--line); }
.tc-tree-head h2 { margin: 0; font-size: 16px; font-weight: 650; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-tree-pts {
  min-width: 34px; text-align: center; font: 600 15px/26px var(--code); color: var(--gold);
  border-radius: 6px; background: var(--bg); border: 1px solid var(--line);
}
.tc-mini { height: 26px; padding: 0 9px; font-size: 12px; color: var(--muted); }

.tc-grid { position: relative; width: 100%; max-width: 250px; margin: 0 auto; }
.tc-arrows { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tc-arrow { fill: none; stroke: var(--line); stroke-width: 6; stroke-linejoin: round; transition: stroke .15s; }
.tc-arrow.on { stroke: var(--gold); }
.ah-off { fill: var(--line); }
.ah-on { fill: var(--gold); }

.tc-tal {
  position: absolute; padding: 0; margin: 0; cursor: pointer;
  border-radius: 9px; border: 2px solid var(--line); background: var(--bg);
  touch-action: manipulation; -webkit-touch-callout: none; user-select: none;
  transition: border-color .12s, box-shadow .12s, transform .08s;
}
.tc-tal img { display: block; width: 100%; height: 100%; border-radius: 7px; object-fit: cover; transition: filter .15s, opacity .15s; }
.tc-tal .rk {
  position: absolute; right: -7px; bottom: -8px;
  padding: 0 4px; border-radius: 5px; font: 600 11px/16px var(--code); font-variant-numeric: tabular-nums;
  background: var(--bg); border: 1px solid var(--line); color: var(--muted); pointer-events: none;
}
.tc-tal[data-state="locked"] img { filter: grayscale(1) brightness(.75); opacity: .5; }
.tc-tal[data-state="locked"] .rk { opacity: .7; }
.tc-tal[data-state="open"] { border-color: color-mix(in srgb, var(--ok) 75%, var(--line)); }
.tc-tal[data-state="open"] .rk { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, var(--line)); }
.tc-tal[data-state="part"] { border-color: var(--ok); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ok) 35%, transparent), 0 0 12px color-mix(in srgb, var(--ok) 25%, transparent); }
.tc-tal[data-state="part"] .rk { color: var(--ok); border-color: var(--ok); }
.tc-tal[data-state="max"] { border-color: var(--gold); box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 40%, transparent), 0 0 14px color-mix(in srgb, var(--gold) 30%, transparent); }
.tc-tal[data-state="max"] .rk { color: var(--gold); border-color: var(--gold); }
.tc-tal:hover:not([data-state="locked"]) img { filter: brightness(1.15); }
.tc-tal:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.tc-tal.bump { animation: tc-bump .18s ease-out; }
@keyframes tc-bump { 50% { transform: scale(.92); } }

/* ---------- tooltip (WoW-style, midnight) ---------- */
.tc-tip {
  position: fixed; z-index: 20; width: min(320px, calc(100vw - 16px));
  padding: 11px 13px 10px; border-radius: 8px; pointer-events: none;
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .45);
  font-size: 13.5px; line-height: 1.42;
}
.tc-tip p { margin: 0; }
.tc-tip .tt-name { font-size: 15.5px; font-weight: 650; color: var(--text); }
.tc-tip .tt-rank { color: var(--muted); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.tc-tip .tt-req { color: var(--err); }
.tc-tip .tt-desc { color: var(--gold); margin-top: 6px; }
.tc-tip .tt-desc b { color: var(--text); font-weight: 600; }
.tc-tip .tt-next { color: var(--text); margin-top: 10px; }
.tc-tip .tt-next + .tt-desc { margin-top: 2px; }
.tc-tip .tt-note { color: var(--muted); font-size: 12px; font-style: italic; margin-top: 4px; }
.tc-tip .tt-hint { color: var(--muted); font-size: 12px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.tc-tip.dock { left: 8px !important; right: 8px; top: auto !important; bottom: 8px; width: auto; }

/* ---------- builds ---------- */
.tc-builds { margin-top: 30px; }
.tc-builds h2, .rc-section h2 { margin: 0; font-size: 19px; letter-spacing: -0.01em; }
.tc-note { margin: 4px 0 14px; color: var(--muted); font-size: 13.5px; }
.tc-build-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.tc-build {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: start;
  padding: 12px 12px 12px 14px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line);
  transition: border-color .12s;
}
.tc-build img { width: 40px; height: 40px; border-radius: 7px; border: 1px solid var(--line); }
.tc-build h3 { margin: 0; font-size: 15px; font-weight: 650; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.tc-build .role { font-size: 12px; font-weight: 500; color: var(--muted); }
.tc-build .split { margin: 1px 0 4px; font: 13px var(--code); color: var(--gold); }
.tc-build .desc { margin: 0; color: var(--muted); font-size: 13.5px; }
.tc-build.on { border-color: var(--cls); box-shadow: inset 3px 0 0 var(--cls); }
.tc-build.on .tc-btn { color: var(--muted); }
.tc-build.rec { grid-column: 1 / -1; border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.tc-rec {
  font-size: 11.5px; font-weight: 650; letter-spacing: .02em; color: var(--gold);
  border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent); border-radius: 999px; padding: 0 7px;
}
.tc-src { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.tc-src a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.tc-src a:hover { color: var(--text); }
.tc-btn.primary { background: var(--gold); border-color: var(--gold); color: var(--bg); font-weight: 650; }
.tc-btn.primary:hover:not(:disabled) { background: var(--gold); border-color: var(--text); filter: brightness(1.08); }
.tc-build.on .tc-btn.primary { background: var(--panel); border-color: var(--line); color: var(--muted); font-weight: 500; }

/* ---------- races ---------- */
.rc-section { margin-top: 28px; }
.rc-changes {
  margin-top: 18px; padding: 16px 18px; border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 7%, var(--panel)), var(--panel));
  border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line));
}
.rc-changes h2 { margin: 0 0 4px; font-size: 18px; }
.rc-changes > p { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; }
.rc-change-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px 22px; margin: 0; padding: 0; list-style: none; }
.rc-change-list h3 { margin: 0 0 4px; font-size: 14px; }
.rc-change-list h3 a { color: var(--text); text-decoration: none; }
.rc-change-list h3 a:hover { color: var(--gold); }
.rc-change-list ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; }
.rc-chip {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 3px 6px 3px 3px; border-radius: 6px; border: 0; background: none; cursor: pointer; font-size: 13.5px;
}
.rc-chip:hover { background: var(--raise); }
.rc-chip img { width: 22px; height: 22px; border-radius: 4px; }
.rc-chip small { color: var(--muted); font-size: 12px; margin-left: auto; padding-left: 8px; text-align: right; }

.rc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 14px; margin-top: 12px; }
.rc-card {
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 16px 16px 10px;
  scroll-margin-top: 16px;
}
.rc-card h3 { margin: 0; font-size: 19px; letter-spacing: -0.01em; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.rc-lore { margin: 6px 0 10px; color: var(--muted); font-size: 13.5px; }
.rc-lore button { background: none; border: 0; padding: 0; color: var(--field); cursor: pointer; font-size: 13px; }
.rc-sky {
  border-color: color-mix(in srgb, var(--gold) 55%, var(--line));
  background:
    radial-gradient(90% 70% at 100% 0%, color-mix(in srgb, var(--field) 14%, transparent), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--gold) 8%, var(--panel)), var(--panel));
  padding: 20px 20px 12px;
}
.rc-sky h3 { font-size: 24px; }
.rc-sky .rc-note { margin: 6px 0 4px; color: var(--text); font-size: 14px; }
.rc-branches { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 6px 22px; margin: 8px 0 8px; }
.rc-branches p { margin: 0; color: var(--muted); font-size: 13.5px; }
.rc-branches b { color: var(--text); font-weight: 600; }

.rc-list { list-style: none; margin: 0; padding: 0; }
.rc-ab {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: start;
  padding: 10px 6px; margin: 0 -6px; border-top: 1px solid var(--line); border-radius: 8px; cursor: pointer;
}
.rc-list li:first-child .rc-ab { border-top-color: transparent; }
.rc-ab:hover { background: var(--raise); border-top-color: transparent; }
.rc-ab:hover + .rc-ab, .rc-list li:hover + li .rc-ab { border-top-color: transparent; }
.rc-ab img { width: 40px; height: 40px; border-radius: 7px; border: 1px solid var(--line); }
.rc-ab .rc-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.rc-ab .nm { font-weight: 650; font-size: 15px; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.rc-ab .meta { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.rc-ab .d { margin: 2px 0 0; color: var(--str); font-size: 13.5px; }
.rc-var { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.rc-var li { padding-left: 10px; border-left: 2px solid var(--line); font-size: 13.5px; }
.rc-var li.fv { border-left-color: var(--gold); }
.rc-var .cls { color: var(--text); font-weight: 600; font-size: 12.5px; }
.rc-var .d { margin: 0; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 18px; letter-spacing: .01em;
  color: var(--gold); background: color-mix(in srgb, var(--gold) 13%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
}
.badge.big { font-size: 12.5px; padding: 2px 10px; }
.tag { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 11.5px; line-height: 18px; color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }

.drawer .badge { margin: 0 0 12px; }
.drawer .d { color: var(--str); margin: 0 0 16px; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .tc-trees { grid-template-columns: minmax(0, 1fr); max-width: 420px; margin-inline: auto; }
  .tc-grid { max-width: 300px; }
}
@media (max-width: 640px) {
  .tc-head h1, .rc-head h1 { font-size: 22px; }
  .tc-stats { gap: 4px 18px; }
  .tc-stats dd { font-size: 17px; }
  .tc-stats .split { display: none; }
  .tc-bar { padding-block: 8px; }
  .tc-class { height: 32px; padding: 0 10px 0 8px; font-size: 13.5px; }
  .tc-build-list { grid-template-columns: minmax(0, 1fr); }
  .rc-sky h3 { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  .tc-tal.bump { animation: none; }
}
/* level cap: points available at your level */
.tc-lvl { width: 56px; height: 26px; padding: 0 6px; border-radius: 5px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-weight: 700; }
.tc-over { margin: 6px 0 0; color: var(--err); font-size: 13px; }
