/* =========================================================================
   Talent calculator — trees, talents, arrows, tooltip. Original design: no game art or icons.
   The trees use a dark "panel" look in both light and dark site themes.
   ========================================================================= */
.tc { --panel: #121722; --panel-2: #1b2231; --tile: #222b3d; --tile-line: #3a445a; --tile-ink: #c9d2e6;
      --avail: #4cc76a; --maxed: #e5b84b; --arrow-off: #3b4458; position: relative; }

/* Class picker */
.tc-classes { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.tc-class { display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .75rem; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); text-decoration: none; font: 600 .88rem/1.2 var(--font-body); min-height: 36px; }
.tc-class:hover { border-color: var(--cc); color: var(--ink); }
.tc-class.is-on { background: var(--deep); color: #fff; border-color: var(--cc); box-shadow: inset 0 -3px 0 var(--cc); }

/* Summary bar */
.tc-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1rem;
  padding: .7rem .9rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.tc-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem 1.1rem; font-size: .95rem; }
.tc-sum__class { font: 700 1.15rem/1.2 var(--font-display); color: var(--ink); }
.tc-sum__class::before { content: ""; display: inline-block; width: .65rem; height: .65rem; border-radius: 50%; background: var(--cc); margin-right: .45rem; vertical-align: .05em; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.tc-sum__spec { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); }
.tc-sum__item { color: var(--muted); }
.tc-sum__item b { color: var(--ink); font-variant-numeric: tabular-nums; }
.tc-actions { display: flex; flex-wrap: wrap; gap: .4rem; }

/* Tabs (small screens) */
.tc-tabs { display: none; gap: .3rem; margin-bottom: .6rem; }
.tc-tab { flex: 1; min-width: 0; padding: .55rem .4rem; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink-soft); font: 600 .88rem/1.2 var(--font-body); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-tab span { display: inline-block; min-width: 1.6em; padding: 0 .3em; border-radius: 999px; background: var(--surface-3); font-variant-numeric: tabular-nums; margin-left: .15rem; }
.tc-tab[aria-selected="true"] { background: var(--deep); color: #fff; border-color: var(--cc); box-shadow: inset 0 -3px 0 var(--cc); }
.tc-tab[aria-selected="true"] span { background: rgba(255,255,255,.15); }

/* Trees */
.tc-trees { display: grid; gap: 1rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tc-tree { background: var(--panel); border-radius: var(--radius); padding: .6rem .6rem .8rem; border: 1px solid #000;
  background-image: linear-gradient(180deg, color-mix(in srgb, var(--cc) 16%, transparent), transparent 140px); min-width: 0; }
.tc-tree__head { display: flex; align-items: center; gap: .5rem; padding: .1rem .2rem .5rem; color: #eef1f8; }
.tc-tree__head h3 { margin: 0; flex: 1; font: 700 1.05rem/1.2 var(--font-display); color: #fff; letter-spacing: .02em; }
.tc-tree__pts { font-size: .85rem; color: #aab3c8; }
.tc-tree__pts b { color: #fff; font-size: 1rem; font-variant-numeric: tabular-nums; }
.tc-tree__reset { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid #343d52; background: transparent; color: #aab3c8; cursor: pointer; }
.tc-tree__reset:hover { color: #fff; border-color: #56607a; }
.tc-tree__reset .icon { width: 16px; height: 16px; }

.tc-grid { position: relative; aspect-ratio: 4 / var(--tiers); container-type: inline-size; max-width: 360px; margin: 0 auto; }
.tc-arrows { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.tc-arrow path { stroke: var(--arrow-off); stroke-width: 7; fill: none; }
.tc-arrow polygon { fill: var(--arrow-off); }
.tc-arrow.is-on path { stroke: var(--maxed); }
.tc-arrow.is-on polygon { fill: var(--maxed); }

.tc-t { position: absolute; left: calc((var(--c) - 1 + .12) * 25%); top: calc((var(--r) - 1 + .12) * 100% / var(--tiers));
  width: 19%; height: calc(76% / var(--tiers)); padding: 0; margin: 0; cursor: pointer;
  border-radius: 10px; border: 2px solid var(--tile-line); background: linear-gradient(160deg, var(--tile), #161c29);
  color: var(--tile-ink); display: grid; place-items: center; font: 700 1rem/1 var(--font-body); font-size: clamp(.8rem, 5.2cqw, 1.15rem);
  letter-spacing: .02em; transition: border-color .12s, transform .06s, box-shadow .12s; touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; }
.tc-t:active { transform: scale(.96); }
.tc-t__ab { pointer-events: none; }
.tc-t__rk { position: absolute; right: -6px; bottom: -8px; min-width: 2.3em; padding: .12em .3em; border-radius: 6px; background: #0b0f17; border: 1px solid var(--tile-line);
  font: 700 .72rem/1.1 var(--font-body); font-size: clamp(.62rem, 3.6cqw, .78rem); color: #9aa4ba; font-variant-numeric: tabular-nums; pointer-events: none; }
.tc-t.is-locked { opacity: .45; filter: grayscale(1); }
.tc-t.is-avail { border-color: var(--avail); color: #fff; }
.tc-t.is-avail .tc-t__rk { color: var(--avail); border-color: var(--avail); }
.tc-t.is-partial { border-color: var(--avail); color: #fff; box-shadow: 0 0 0 1px var(--avail), 0 0 12px rgba(76, 199, 106, .35); }
.tc-t.is-partial .tc-t__rk { color: var(--avail); border-color: var(--avail); }
.tc-t.is-max { border-color: var(--maxed); color: #fff; background: linear-gradient(160deg, color-mix(in srgb, var(--cc) 35%, var(--tile)), #161c29); box-shadow: 0 0 0 1px var(--maxed), 0 0 14px rgba(229, 184, 75, .35); }
.tc-t.is-max .tc-t__rk { color: var(--maxed); border-color: var(--maxed); }
.tc-t.is-selected { outline: 3px solid #fff; outline-offset: 2px; }
.tc-t:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* Help */
.tc-help { margin: .9rem 0 0; font-size: .85rem; color: var(--muted); }
.tc-help__touch { display: none; }
@media (hover: none), (pointer: coarse) { .tc-help__mouse { display: none; } .tc-help__touch { display: inline; } }

/* Tooltip / bottom sheet */
.tc-tip { position: fixed; z-index: 60; width: min(320px, calc(100vw - 16px)); padding: .75rem .85rem; border-radius: 10px; background: #0d121c; color: #d7deec;
  border: 1px solid #3a445a; box-shadow: 0 12px 32px rgba(0, 0, 0, .45); font-size: .9rem; line-height: 1.45; pointer-events: none; }
.tc-tip p { margin: .35rem 0 0; }
.tc-tip b { color: #fff; }
.tc-tip__head { display: flex; justify-content: space-between; gap: .75rem; align-items: baseline; }
.tc-tip__head strong { color: #fff; font-size: 1rem; }
.tc-tip__head span { color: #9aa4ba; font-size: .8rem; white-space: nowrap; }
.tc-tip__req { color: #ff8a80; }
.tc-tip__next { color: #9aa4ba; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; margin-top: .6rem !important; }
.tc-tip__hint { color: var(--avail); font-size: .8rem; }
.tc-tip.is-sheet { left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 60vh; overflow: auto; border-radius: 16px 16px 0 0; pointer-events: auto;
  padding: 1rem 16px calc(1rem + env(safe-area-inset-bottom)); border-width: 1px 0 0; }
.tc-tip__btns { display: flex; gap: .5rem; margin-top: .85rem; }
.tc-tip__btns .btn { flex: 1; font-size: 1.15rem; min-height: 46px; }
.tc-tip__btns [data-tip="close"] { flex: 1.2; font-size: .9rem; }
.tc-tip .btn--ghost { color: #d7deec; border-color: #3a445a; }
.tc-tip .btn--ghost:hover { background: #1b2231; color: #fff; }

@media (max-width: 760px) {
  .tc-tabs { display: flex; }
  .tc-trees { grid-template-columns: minmax(0, 1fr); }
  .tc-tree { display: none; }
  .tc-tree.is-active { display: block; }
  .tc-bar { flex-direction: column; align-items: stretch; }
  .tc-actions .btn { flex: 1 1 auto; white-space: nowrap; }
  .tc-actions [data-copy-link] { flex-basis: 100%; }
}
@media (min-width: 761px) and (max-width: 1000px) { .tc-tree { padding: .5rem .35rem .7rem; } .tc-t { border-radius: 8px; } }

/* Talent list tables on class pages */
.talent-table td { vertical-align: top; }
.talent-table td.wrap-cell { min-width: 220px; max-width: 520px; }
.talent-table .tier { color: var(--muted); }
