/**
 * Rune Tree UI — right-side panel style to match game UI.
 * One selected skill; title + fragment count at top; centered 3-node tree.
 * Clarity over fancy effects; expandable for more runes.
 */

/* -------------------------------------------------------------------------
   Runes view: two-panel layout (skill list left, tree right)
   ------------------------------------------------------------------------- */
.runes-view.runes-view {
  display: block;
  padding: 0;
  min-height: 0;
}

.runes-view .runes-wrapper {
  background: var(--rw-panel, #1a2230);
  border: 1px solid var(--rw-gold-border, rgba(184, 150, 46, 0.45));
  border-radius: var(--rw-radius, 8px);
  padding: 0;
  overflow: hidden;
}

.runes-view .runes-skill-list-panel {
  flex: 0 0 28%;
  min-width: 140px;
  max-width: 200px;
}

.runes-view .runes-skill-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.runes-view .runes-skill-list li {
  margin: 0;
}

.runes-view .runes-skill-tab {
  display: block;
  width: 100%;
  padding: 0.6rem 0.85rem;
  text-align: left;
  border: 1px solid var(--rw-inner-edge, #161c26);
  border-radius: var(--rw-radius-inner, 6px);
  background: var(--rw-inner-dark, #222a36);
  color: var(--rw-text-dim, #8a8580);
  cursor: pointer;
  font-size: 0.95rem;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.runes-view .runes-skill-tab:hover {
  color: var(--rw-text, #d4cfc4);
  border-color: var(--rw-gold-border, rgba(184, 150, 46, 0.45));
}

.runes-view .runes-skill-tab.active {
  background: var(--rw-inner-mid, #1b2230);
  border-color: var(--rw-gold, #b8962e);
  color: var(--rw-gold-soft, #c9a227);
}

/* Right panel: rune tree box — wide enough so bottom row nodes don’t touch the border */
.runes-view .runes-tree-panel {
  flex: 1 1 42%;
  min-width: 340px;
  max-width: 640px;
  background: linear-gradient(180deg, var(--rw-inner-mid, #1b2230) 0%, var(--rw-inner-dark, #222a36) 100%);
  border: 2px solid var(--rw-gold-border, rgba(184, 150, 46, 0.5));
  border-radius: var(--rw-radius, 8px);
  padding: 1.25rem 2rem;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(184, 150, 46, 0.08) inset;
}

.runes-tree-detail {
  padding: 0;
}

/* Header: selected skill title + fragment count */
.runes-tree-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rw-gold-border, rgba(184, 150, 46, 0.25));
}

.runes-tree-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--rw-text, #d4cfc4);
  text-transform: uppercase;
}

.runes-fragment-display {
  font-size: 1rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--rw-radius-inner, 6px);
  background: rgba(184, 150, 46, 0.12);
  border: 1px solid var(--rw-gold-border, rgba(184, 150, 46, 0.4));
  color: var(--rw-gold-soft, #c9a227);
}

/* Tree container: centered layout */
.runes-tree-container {
  background: transparent;
  padding: 1rem 1rem 1rem 1.25rem;
  min-height: 240px;
  box-sizing: border-box;
}

.runes-tree-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.runes-tree-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
}

.runes-tree-row--tier2 {
  order: 0;
}

.runes-tree-row--tier1 {
  order: 1;
}

/* Connection line (SVG, drawn by JS) */
.runes-tree-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.runes-tree-lines line {
  stroke: var(--rw-gold-border, rgba(184, 150, 46, 0.5));
  stroke-width: 2;
}

/* Rune node — readable cards */
.rune-node {
  position: relative;
  min-width: 200px;
  max-width: 260px;
  padding: 1rem 1.25rem;
  border-radius: var(--rw-radius-inner, 6px);
  border: 2px solid var(--rw-inner-edge, #161c26);
  background: var(--rw-inner-dark, #222a36);
  color: var(--rw-text, #d4cfc4);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, opacity 0.15s, box-shadow 0.15s;
}

.rune-node-name {
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.35;
  margin-bottom: 0.5rem;
  color: var(--rw-text, #d4cfc4);
}

.rune-node-cost {
  font-size: 1rem;
  color: var(--rw-gold, #b8962e);
  margin-bottom: 0.3rem;
}

.rune-node-sub {
  font-size: 0.95rem;
  color: var(--rw-text-dim, #8a8580);
  line-height: 1.4;
}

/* States: clarity over glow */
.rune-node.locked {
  opacity: 0.65;
  border-color: var(--rw-inner-edge, #161c26);
}

.rune-node.locked .rune-node-name,
.rune-node.locked .rune-node-cost {
  color: var(--rw-text-dim, #8a8580);
}

.rune-node.unlockable {
  border-color: var(--rw-gold, #b8962e);
  box-shadow: 0 0 12px rgba(184, 150, 46, 0.15);
}

.rune-node.unlockable .rune-node-cost {
  color: var(--rw-gold-soft, #c9a227);
}

.rune-node.unlocked {
  border-color: var(--rw-gold-soft, #c9a227);
  opacity: 1;
  box-shadow: 0 0 14px rgba(201, 162, 39, 0.2);
}

.rune-node.unlocked .rune-node-name {
  color: var(--rw-gold-soft, #c9a227);
}

/* Tooltip — keep for hover detail */
.rune-tooltip {
  position: fixed;
  z-index: 1000;
  max-width: 280px;
  padding: 0.65rem 0.9rem;
  background: var(--rw-bg-panel, #161a22);
  border: 1px solid var(--rw-gold-border, rgba(184, 150, 46, 0.45));
  border-radius: var(--rw-radius-inner, 6px);
  color: var(--rw-text, #d4cfc4);
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.rune-tooltip .rune-tooltip-name {
  font-weight: 600;
  color: var(--rw-gold-soft, #c9a227);
  margin-bottom: 0.25rem;
}

.rune-tooltip .rune-tooltip-desc,
.rune-tooltip .rune-tooltip-req {
  color: var(--rw-text-dim, #8a8580);
  margin-bottom: 0.2rem;
}

.rune-tooltip .rune-tooltip-cost {
  color: var(--rw-gold, #b8962e);
}

.rune-tooltip .rune-tooltip-state {
  margin-top: 0.3rem;
  font-size: 0.85rem;
  opacity: 0.9;
}
