/* Talent calculator (/talents). Composes nag-tokens.css; one dark surface like the leaderboard. */

.talents-page { background: var(--nag-ink); }
.talents-main { padding-bottom: clamp(56px, 8vw, 110px); }

.talents-hero {
  padding: clamp(56px, 8vw, 104px) 0 clamp(28px, 4vw, 48px);
  border-bottom: 1px solid var(--nag-hairline);
}
.talents-hero__display { font-size: clamp(2.1rem, 4.4vw, 3.4rem); margin-bottom: 0.35em; }
.talents-hero .nag-lead { margin: 0; }
.talents-hero a { color: var(--nag-gold-text); }

.talents { padding-top: clamp(22px, 3vw, 36px); }
.talents-quiet { color: var(--nag-text-dim); }

.talents-classes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.talents-class,
.talents-tab {
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--nag-text-dim);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
.talents-class:hover, .talents-tab:hover { color: var(--nag-text); border-color: rgba(255, 255, 255, 0.22); }
.talents-class[aria-pressed="true"],
.talents-tab[aria-selected="true"] {
  color: var(--nag-text);
  background: var(--nag-gold-edge);
  border-color: var(--nag-gold-edge-strong);
}

.talents-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.talents-status { margin: 0; color: var(--nag-text); font-weight: 700; }
.talents-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.talents-copied { min-height: 1.2em; margin: 6px 0 0; color: var(--nag-text-dim); font-size: 0.85rem; }
.talents-link { width: 100%; max-width: 640px; margin: 4px 0 8px; padding: 6px 8px; font: inherit; font-size: 0.85rem; }
.talents-note { margin: 8px 0; color: var(--nag-warn); }
.talents-help { margin-top: 20px; color: var(--nag-text-dim); font-size: 0.88rem; max-width: 72ch; }

.talents-tabs { display: none; }
.talents-tab { display: inline-flex; align-items: center; gap: 6px; }
.talents-tab__icon { width: 20px; height: 20px; border-radius: 4px; }
.talents-tab__pts { color: var(--nag-gold-hover); font-variant-numeric: tabular-nums; }

.talents-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 20px; margin-top: 14px; align-items: start; }
.talents-trees { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; min-width: 0; }

/* One framed column per tree: the game's talent background for that tree (talents.js sets --tree-art), darkened so the
   icons and numbers stay readable, under a header strip with the tree's icon, name and points. */
.talents-tree {
  min-width: 0;
  padding: 0 0 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(7, 9, 12, 0.55), rgba(7, 9, 12, 0.72) 55%, rgba(7, 9, 12, 0.88)), var(--tree-art, none) center top / cover no-repeat, #121318;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5), 0 6px 18px rgba(0, 0, 0, 0.35);
}
.talents-tree__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(221, 163, 67, 0.28);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.5));
}
.talents-tree__icon { flex: none; width: 24px; height: 24px; border: 1px solid rgba(221, 163, 67, 0.5); border-radius: 5px; }
.talents-tree__name { margin: 0; font-size: 1rem; flex: 1; min-width: 0; color: var(--nag-text); text-shadow: 0 1px 2px #000; }
.talents-tree__spent {
  min-width: 2.2em;
  padding: 1px 7px;
  border: 1px solid rgba(221, 163, 67, 0.45);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--nag-gold-hover);
  font-size: 0.85rem;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.talents-reset {
  padding: 2px 8px;
  border: 1px solid var(--nag-hairline);
  border-radius: 4px;
  background: transparent;
  color: var(--nag-text-dim);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

/* 4 columns; tiles and prerequisite lines share the grid, lines underneath */
.talents-grid { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 0 12px; }
.talents-line { z-index: 0; background: rgba(255, 255, 255, 0.2); border-radius: 2px; pointer-events: none; }
.talents-line--v { justify-self: center; width: 4px; }
.talents-line--h { align-self: center; height: 4px; }
.talents-line.is-met { background: var(--nag-gold-fill); }

.talents-tile {
  position: relative;
  z-index: 1;
  aspect-ratio: 1;
  width: 100%;
  max-width: 56px;
  justify-self: center;
  padding: 0;
  border: 2px solid var(--nag-pos);
  border-radius: 7px;
  background: #111;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.6);
  color: var(--nag-text);
  cursor: pointer;
  -webkit-touch-callout: none;
  user-select: none;
}
.talents-tile:focus-visible { outline: 2px solid var(--nag-focus-ring); outline-offset: 2px; }
.talents-tile__icon { display: block; width: 100%; height: 100%; border-radius: 5px; object-fit: cover; }
.talents-tile__initials { display: grid; place-items: center; height: 100%; font-weight: 800; font-size: 0.8rem; }
.talents-tile__badge {
  position: absolute;
  right: -7px;
  bottom: -8px;
  padding: 0 4px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 5px;
  background: rgba(5, 6, 8, 0.94);
  color: var(--nag-pos);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.35;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
/* taken: a gold frame; maxed: solid gold with a glow; not taken (the guides' view) or not reachable: dim and grey */
.talents-tile.is-some { border-color: rgba(221, 163, 67, 0.7); }
.talents-tile.is-some .talents-tile__badge { color: var(--nag-gold-hover); border-color: rgba(221, 163, 67, 0.45); }
.talents-tile.is-max { border-color: var(--nag-gold-fill); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 10px rgba(221, 163, 67, 0.55); }
.talents-tile.is-max .talents-tile__badge { color: #1a1206; background: var(--nag-gold-fill); border-color: var(--nag-gold-hover); }
.talents-tile.is-locked { border-color: rgba(255, 255, 255, 0.14); box-shadow: none; }
.talents-tile.is-locked .talents-tile__icon,
.talents-tile.is-locked .talents-tile__initials { filter: grayscale(1) brightness(0.8); opacity: 0.4; }
.talents-tile.is-locked .talents-tile__badge { color: var(--nag-text-faint); }
/* the guides' view shows a finished build: an untaken talent carries no "0 / 5" (its tooltip still says it) */
.talents-tree--ro .talents-tile.is-locked .talents-tile__badge { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .talents-tile { transition: border-color 0.15s, box-shadow 0.15s; }
}

.talents-detail {
  position: sticky;
  top: 90px;
  padding: 14px;
  border: 1px solid var(--nag-hairline);
  border-radius: var(--nag-radius);
  background: var(--nag-panel);
}
.talents-detail h3 { margin: 0 0 6px; font-size: 1rem; }
.talents-detail p { margin: 4px 0; font-size: 0.88rem; color: var(--nag-text-dim); }
.talents-detail .is-unmet { color: var(--nag-warn); }
.talents-detail__desc { white-space: pre-line; }
.talents-detail p.talents-detail__desc { color: var(--nag-text); }
.talents-detail p.talents-detail__extra,
.talents-detail p.talents-detail__muted { color: var(--nag-text-faint); font-size: 0.8rem; }
.talents-detail p.talents-detail__label { margin-top: 10px; color: var(--nag-gold-text); font-weight: 700; }

/* hover / focus / tap tooltip: fixed, placed by talents.js beside the tile; never takes a click */
.talents-tip {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: min(340px, calc(100vw - 16px));
  padding: 10px 12px;
  border: 1px solid var(--nag-gold-edge-strong);
  border-radius: var(--nag-radius);
  background: var(--nag-ink);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  color: var(--nag-text);
  font-size: 0.85rem;
  line-height: 1.4;
  pointer-events: none;
}
.talents-tip[hidden] { display: none; }
.talents-tip p { margin: 3px 0; font-size: inherit; line-height: inherit; }
.talents-tip .talents-detail__name { margin: 0; font-weight: 800; font-size: 0.95rem; }
.talents-tip .talents-detail__rank { color: var(--nag-text-dim); font-size: 0.8rem; }
.talents-tip .talents-detail__extra,
.talents-tip .talents-detail__muted { color: var(--nag-text-faint); font-size: 0.78rem; }
.talents-tip .talents-detail__label { margin-top: 8px; color: var(--nag-gold-text); font-weight: 700; }
.talents-tip .is-unmet { color: var(--nag-warn); }

.talents-detail__actions { display: flex; gap: 8px; margin-top: 10px; }
.talents-step { min-width: 48px; min-height: 44px; font-size: 1.2rem; }

.footer-licence { margin: 18px 0 0; color: var(--nag-text-dim); font-size: 0.82rem; }

@media (max-width: 1100px) {
  .talents-layout { grid-template-columns: minmax(0, 1fr); }
  .talents-detail { position: static; }
}

/* phones: one tree at a time behind tabs; cells shrink to fit 360 px */
@media (max-width: 760px) {
  /* the tree switch: one segmented row, three equal parts (the guides' widget uses the same) */
  .talents-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 12px 0 0; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 8px; overflow: hidden; }
  /* a tree tab: icon and points on top, the full name under them */
  .talents-tab {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: center;
    align-items: center;
    column-gap: 5px;
    min-width: 0;
    min-height: 48px;
    padding: 4px 2px;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0;
    background: rgba(0, 0, 0, 0.4);
    font-size: 0.78rem;
  }
  .talents-tab:last-child { border-right: 0; }
  .talents-tab__name { grid-column: 1 / -1; grid-row: 2; min-width: 0; text-align: center; font-size: 0.68rem; letter-spacing: -0.01em; line-height: 1.15; }
  .talents-tab__icon { width: 18px; height: 18px; }
  .talents-tab[aria-selected="true"] { background: rgba(221, 163, 67, 0.16); color: var(--nag-text); box-shadow: inset 0 -2px 0 var(--nag-gold-fill); }
  .talents-trees { grid-template-columns: minmax(0, 1fr); }
  .talents-tree { display: none; }
  .talents-tree.is-active { display: block; }
  .talents-grid { gap: 8px 6px; }
  .talents-tile { max-width: 52px; }
}
