/* ============================================================================
   PoE2 Compare — forge.css
   A dark, engraved "exile's ledger" identity. The passive tree (the Atlas) is
   the signature; the orbs / damage auras / gear grids are kept and enhanced.
   Player colours are data-driven (--c per element): Roxie purple, Terence red,
   Jaydin blue.
   ========================================================================== */

:root {
  --bg:        #090A10;
  --bg-1:      #0D0F17;
  --bg-2:      #12141F;
  --bg-3:      #181B29;
  --bg-glass:  rgba(18, 20, 31, 0.72);

  --ink:       #ECE7DA;
  --ink-dim:   #9DA2B5;
  --ink-faint: #646A7E;
  --line:        rgba(236, 231, 218, 0.08);
  --line-strong: rgba(236, 231, 218, 0.17);

  --gold:      #C9A24B;
  --gold-soft: #E2C97E;

  /* player identity defaults — Roxie purple / Terence red / Jaydin blue */
  --p0: #B06BF2;
  --p1: #EA4B5B;
  --p2: #4E86F0;

  --phys: #D6CDB6;
  --fire: #F0563B;
  --cold: #4FB4F0;
  --lightning: #F1D43E;
  --chaos: #B85CE0;

  --r-normal: #C8C8C8;
  --r-magic:  #7C8BFF;
  --r-rare:   #E6D24A;
  --r-unique: #E08A43;

  --display: 'Fraunces', 'Hoefler Text', 'Georgia', serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'SFMono-Regular', ui-monospace, monospace;

  --shadow-card: 0 1px 0 rgba(255,255,255,0.03) inset, 0 14px 40px -18px rgba(0,0,0,0.8);
  --r-sm: 6px; --r-md: 12px; --r-lg: 20px;
  --maxw: 1320px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 78px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
}
body::before {
  content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(201,162,75,0.10), transparent 60%),
    radial-gradient(900px 600px at 12% 18%, rgba(176,107,242,0.05), transparent 55%),
    radial-gradient(900px 600px at 88% 30%, rgba(78,134,240,0.05), transparent 55%);
}
body::after {
  content: ''; position: fixed; inset: 0; z-index: -1; opacity: 0.03; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; text-decoration: none; }

/* ── shared text atoms ─────────────────────────────────────────────────── */
.eyebrow {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.34em; text-transform: uppercase; color: var(--gold);
  margin: 0 0 14px; display: inline-flex; align-items: center; gap: 12px;
}
.eyebrow::before { content: ''; width: 34px; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); }
.act-title {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(30px, 4.4vw, 56px); line-height: 1.02; letter-spacing: -0.015em;
  margin: 0; color: var(--ink);
}
.act-head { margin-bottom: 42px; }

/* ── top bar ───────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 28px;
  padding: 0 26px; height: 64px;
  background: linear-gradient(180deg, rgba(9,10,16,0.92), rgba(9,10,16,0.62));
  backdrop-filter: blur(14px) saturate(120%); border-bottom: 1px solid var(--line);
}
.wordmark { display: flex; align-items: center; gap: 11px; flex: none; }
.wordmark-mark { color: var(--gold); font-size: 20px; filter: drop-shadow(0 0 8px rgba(201,162,75,0.5)); }
.wordmark-text { font-family: var(--display); font-weight: 600; font-size: 19px; letter-spacing: 0.01em; color: var(--ink); }
.topnav { display: flex; gap: 4px; margin-left: 6px; }
.topnav a { font-size: 13px; color: var(--ink-faint); padding: 7px 12px; border-radius: var(--r-sm); letter-spacing: 0.02em; transition: color .18s, background .18s; }
.topnav a:hover { color: var(--ink); background: rgba(236,231,218,0.05); }
.topnav a.is-active { color: var(--gold-soft); }
.legend { display: flex; align-items: center; gap: 8px; margin-left: 14px; flex: none; }

/* data-freshness pill */
.freshness { margin-left: auto; display: flex; align-items: center; flex: none; }
.fresh-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px;
  background: rgba(236,231,218,0.035); border: 1px solid var(--line); font-size: 12px; color: var(--ink-dim); cursor: help; }
.fresh-pill.is-live { border-color: color-mix(in srgb, #5BC88A 40%, var(--line)); }
.fresh-ico { color: var(--ink-faint); font-size: 13px; line-height: 1; }
.fresh-pill.is-live .fresh-ico { color: #5BC88A; }
.fresh-txt b { color: var(--ink); font-weight: 600; }
.legend-chip { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 9px; border-radius: 999px;
  background: rgba(236,231,218,0.035); border: 1px solid var(--line); font-size: 12.5px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px 1px color-mix(in srgb, var(--c) 60%, transparent); }
.legend-name { color: var(--ink); font-weight: 600; }
.legend-lvl { color: var(--ink-faint); font-family: var(--mono); font-size: 10.5px; }

/* ── act frame + per-section atmosphere (so each act feels distinct) ─────── */
.act { position: relative; max-width: var(--maxw); margin: 0 auto; padding: 92px 26px; }
.act--atlas { max-width: none; padding-left: 0; padding-right: 0; }
.act--atlas .act-head { max-width: var(--maxw); margin: 0 auto 34px; padding: 0 26px; }
.act::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 360px; z-index: -1; pointer-events: none; }
.act--roster::after  { background: radial-gradient(760px 300px at 50% 0, rgba(201,162,75,0.07), transparent 70%); }
.act--atlas::after   { background: radial-gradient(980px 360px at 50% 0, rgba(120,110,205,0.11), transparent 70%); }
.act--vitals::after  { background: radial-gradient(860px 320px at 28% 0, rgba(208,64,70,0.07), transparent 70%); }
.act--resilience::after { background: radial-gradient(860px 320px at 50% 0, rgba(79,180,240,0.07), transparent 70%); }
.act--avoidance::after { background: radial-gradient(860px 320px at 50% 0, rgba(79,180,240,0.06), transparent 70%); }
.act--strike::after  { background: radial-gradient(860px 320px at 72% 0, rgba(240,90,60,0.07), transparent 70%); }
.act--skillsetup::after { background: radial-gradient(860px 320px at 30% 0, rgba(120,110,205,0.07), transparent 70%); }
.act--allegiance::after { background: radial-gradient(820px 320px at 50% 0, rgba(91,200,138,0.06), transparent 70%); }
.act--lootluck::after { background: radial-gradient(820px 320px at 50% 0, rgba(201,162,75,0.08), transparent 70%); }
.act--arsenal::after { background: radial-gradient(860px 320px at 50% 0, rgba(110,135,255,0.06), transparent 70%); }

/* ============================================================================
   ROSTER (hero) — engraved plates
   ========================================================================== */
.act--roster { padding-top: 60px; }
.roster-stage { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.plate {
  position: relative; overflow: hidden; border-radius: var(--r-lg);
  border: 1px solid color-mix(in srgb, var(--c) 30%, var(--line-strong));
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 24%, transparent), transparent 48%),
              radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--c) 16%, transparent), transparent 60%),
              linear-gradient(180deg, var(--bg-2), var(--bg-1));
  padding: 28px 26px 26px; min-height: 430px; display: flex; flex-direction: column;
  box-shadow: var(--shadow-card); isolation: isolate;
}
.plate::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, transparent, var(--c), transparent); }
.plate-constellation { position: absolute; inset: 0; z-index: -1; opacity: 0.5; }
.plate-rank { font-family: var(--mono); font-size: 11px; letter-spacing: 0.3em; color: var(--ink-faint); text-transform: uppercase; }
.plate-top { display: flex; align-items: center; gap: 16px; margin: 14px 0 4px; }
.plate-crest {
  width: 64px; height: 64px; flex: none; display: grid; place-items: center; border-radius: 50%;
  font-family: var(--display); font-size: 27px; font-weight: 600; color: var(--c);
  border: 1.5px solid color-mix(in srgb, var(--c) 55%, transparent);
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%);
  box-shadow: inset 0 0 18px -6px color-mix(in srgb, var(--c) 70%, transparent);
}
.plate-id { min-width: 0; }
.plate-name { font-family: var(--display); font-weight: 600; font-size: clamp(25px, 2.4vw, 34px); line-height: 1.0; letter-spacing: -0.01em; margin: 0;
  color: var(--c); }
.plate-char { font-size: 13px; color: var(--ink-dim); font-weight: 500; margin-top: 4px; }
.plate-updated { display: flex; align-items: center; gap: 7px; margin-top: 11px; font-size: 11px; color: var(--ink-faint);
  font-family: var(--mono); letter-spacing: 0.02em; cursor: help; }
.plate-updated .dot { width: 5px; height: 5px; border-radius: 50%; background: color-mix(in srgb, var(--c) 70%, var(--ink-faint)); }
.plate-meta { margin: 16px 0 0; font-size: 12.5px; color: var(--ink-dim); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.plate-meta b { color: var(--ink); font-weight: 600; }

/* clean "main skill" row replaces the old archetype+pill */
.plate-skill { display: flex; align-items: center; gap: 11px; margin-top: 16px; padding: 10px 12px;
  border-radius: var(--r-md); background: rgba(236,231,218,0.03); border: 1px solid var(--line); }
.plate-skill .skill-ico { width: 34px; height: 34px; }
.plate-skill-txt { min-width: 0; }
.plate-skill-k { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); }
.plate-skill-v { font-size: 14.5px; color: var(--ink); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.plate-spine { margin-top: auto; padding-top: 22px; display: grid; gap: 14px; }
.plate-stat { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 2px; }
.plate-stat-k { font-size: 11px; color: var(--ink-faint); letter-spacing: 0.06em; text-transform: uppercase; }
.plate-stat-right { display: flex; align-items: center; gap: 9px; }
.plate-stat-v { font-family: var(--display); font-weight: 600; font-size: 22px; color: var(--ink); }
.plate-stat--lead .plate-stat-v { color: var(--c); }
.lead-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 7px; border-radius: 999px;
  font-family: var(--body); font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: #2A2410; background: linear-gradient(180deg, #F2D98B, #C9A24B);
  border: 1px solid #E2C97E; box-shadow: 0 0 14px -2px rgba(201,162,75,0.7), inset 0 1px 0 rgba(255,255,255,0.4);
  white-space: nowrap;
}
.lead-crown { font-size: 11px; line-height: 1; }
.plate-bar { height: 7px; border-radius: 5px; background: rgba(236,231,218,0.07); overflow: hidden; }
.plate-bar > i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 55%, #000), var(--c));
  box-shadow: 0 0 12px color-mix(in srgb, var(--c) 70%, transparent); }

.roster-verdict { grid-column: 1 / -1; margin-top: 10px; display: flex; flex-wrap: wrap; gap: 10px; }
.verdict-pill { display: inline-flex; align-items: center; gap: 9px; padding: 10px 16px; border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 14%, var(--bg-2)), var(--bg-2));
  border: 1px solid color-mix(in srgb, var(--c) 40%, var(--line-strong)); font-size: 13px; color: var(--ink-dim); }
.verdict-pill b { color: var(--c); font-weight: 600; }
.verdict-pill .verdict-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }

/* ============================================================================
   ATLAS — passive tree canvas
   ========================================================================== */
.atlas-frame {
  position: relative; max-width: var(--maxw); margin: 0 auto; height: min(76vh, 800px);
  border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  background: radial-gradient(130% 90% at 50% 0%, rgba(120,110,205,0.09), transparent 60%), #0B0D15;
  overflow: hidden; cursor: grab; touch-action: none;
  box-shadow: inset 0 0 120px -30px rgba(0,0,0,0.9), var(--shadow-card);
}
.atlas-frame.is-panning { cursor: grabbing; }
#atlas-canvas { display: block; width: 100%; height: 100%; }
.atlas-controls { position: absolute; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.atlas-toggles { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.atlas-toggle {
  display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 8px 13px; border-radius: 999px;
  font-size: 13px; color: var(--ink); background: var(--bg-glass); border: 1px solid var(--line-strong);
  backdrop-filter: blur(8px); transition: opacity .15s, border-color .15s; user-select: none;
}
.atlas-toggle .legend-dot { box-shadow: 0 0 12px 1px color-mix(in srgb, var(--c) 70%, transparent); }
.atlas-toggle[aria-pressed="false"] { opacity: 0.4; }
.atlas-toggle[aria-pressed="false"] .legend-dot { box-shadow: none; background: var(--ink-faint); }
.atlas-btn { padding: 8px 13px; border-radius: 999px; font-size: 12.5px; cursor: pointer;
  background: var(--bg-glass); border: 1px solid var(--line-strong); color: var(--ink-dim); backdrop-filter: blur(8px); }
.atlas-btn:hover { color: var(--ink); border-color: var(--gold); }
.atlas-readout { position: absolute; left: 16px; bottom: 16px; display: flex; gap: 18px; flex-wrap: wrap;
  padding: 12px 18px; border-radius: var(--r-md); background: var(--bg-glass); border: 1px solid var(--line-strong);
  backdrop-filter: blur(8px); font-size: 13px; }
.readout-item { display: flex; flex-direction: column; gap: 2px; }
.readout-k { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); }
.readout-v { font-family: var(--display); font-size: 20px; font-weight: 600; color: var(--c, var(--ink)); }
.readout-v small { font-family: var(--body); font-size: 12px; color: var(--ink-dim); font-weight: 400; }
.atlas-hint { position: absolute; right: 16px; bottom: 16px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--ink-faint); pointer-events: none; }

/* ============================================================================
   VITALS — life/ES orbs + resist wards (kept; enhanced)
   ========================================================================== */
.vitals-stage { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: start; }
.vital { display: flex; flex-direction: column; align-items: center; padding: 30px 22px 26px; border-radius: var(--r-lg);
  border: 1px solid var(--line); background: linear-gradient(180deg, color-mix(in srgb, var(--c) 6%, var(--bg-2)), var(--bg-1)); box-shadow: var(--shadow-card); }
.vital-name { font-family: var(--display); font-size: 20px; font-weight: 600; margin: 0 0 2px; color: var(--c); }
.vital-role { font-size: 12px; color: var(--ink-faint); margin: 0 0 16px; letter-spacing: 0.03em; }
.vital-orb { position: relative; }
.vital-orb svg { display: block; overflow: visible; }
.ward-key { display: flex; gap: 12px; margin-top: 8px; }
.ward-tick { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink-dim); font-family: var(--mono); }
.ward-tick i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.ward-tick.is-breach { color: var(--fire); font-weight: 700; }
.vital-pools { display: flex; gap: 16px; margin-top: 14px; }
.vital-pool { text-align: center; }
.vital-pool-v { font-family: var(--mono); font-size: 15px; color: var(--ink); }
.vital-pool-k { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.vital-pool.is-life .vital-pool-v { color: #E5604F; }
.vital-pool.is-es .vital-pool-v { color: #54C8E8; }
.vital-pool.is-ward .vital-pool-v { color: #DBE3EA; }
.vital-foot { margin-top: 20px; width: 100%; display: grid; gap: 9px; }
.vital-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.vital-row-k { color: var(--ink-faint); display: flex; align-items: center; gap: 8px; }
.vital-row-v { font-family: var(--mono); color: var(--ink); }
.vital-row.is-best .vital-row-v { color: var(--c); }

/* ============================================================================
   OFFENSE — DPS aura + damage-type ring + skill list (kept; enhanced)
   ========================================================================== */
.strike-stage { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: start; }
.strike { display: flex; flex-direction: column; align-items: center; padding: 28px 22px; border-radius: var(--r-lg);
  border: 1px solid var(--line); background: linear-gradient(180deg, color-mix(in srgb, var(--c) 6%, var(--bg-2)), var(--bg-1)); box-shadow: var(--shadow-card); }
.strike-name { font-family: var(--display); font-size: 20px; font-weight: 600; color: var(--c); margin: 0 0 2px; }
.strike-role { font-size: 12px; color: var(--ink-faint); margin: 0 0 14px; }
.strike-core { position: relative; }
.strike-core svg { display: block; overflow: visible; }
.strike-gem { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 54px; height: 54px;
  border-radius: 12px; overflow: hidden; border: 1.5px solid color-mix(in srgb, var(--c) 50%, var(--line-strong)); background: var(--bg-3); display: grid; place-items: center;
  box-shadow: 0 0 20px -3px color-mix(in srgb, var(--c) 60%, transparent); }
.strike-gem img { width: 100%; height: 100%; object-fit: cover; }
.strike-gem .gem-fallback { font-family: var(--display); font-size: 22px; color: var(--ink-dim); }
.strike-dps { text-align: center; margin-top: 10px; }
.strike-dps-v { font-family: var(--display); font-size: 30px; font-weight: 600; color: var(--ink); line-height: 1; }
.strike-dps-k { font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); margin-top: 4px; }
.strike-mix { display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap; justify-content: center; }
.mix-tick { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink-dim); font-family: var(--mono); }
.mix-tick i { width: 9px; height: 9px; border-radius: 50%; }
.strike-skills { margin-top: 20px; width: 100%; display: grid; gap: 8px; }
.skill-row { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r-sm);
  background: rgba(236,231,218,0.025); border: 1px solid var(--line); }
.skill-meta { flex: 1; min-width: 0; }
.skill-nm { font-size: 13.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skill-sup { font-size: 11px; color: var(--ink-faint); }
.skill-dps { font-family: var(--mono); font-size: 13px; color: var(--ink-dim); flex: none; }
.skill-row.is-main { border-color: color-mix(in srgb, var(--c) 40%, transparent); background: color-mix(in srgb, var(--c) 7%, transparent); }
.skill-row.is-main .skill-dps { color: var(--c); }

/* shared gem-icon atom (offense list + roster plate skill) */
.skill-ico { width: 30px; height: 30px; border-radius: 6px; flex: none; overflow: hidden; background: var(--bg-3); border: 1px solid var(--line); display: grid; place-items: center; }
.skill-ico img { width: 100%; height: 100%; object-fit: cover; }
.skill-ico .gem-fallback { font-family: var(--display); font-size: 15px; color: var(--ink-dim); }

/* ============================================================================
   RESILIENCE — per-element max-hit pentagon (one shared figure)
   ========================================================================== */
.resilience-stage { display: flex; justify-content: center; }
.resi-panel {
  width: 100%; max-width: 980px; display: grid; grid-template-columns: minmax(0, 480px) 1fr; gap: 34px; align-items: center;
  padding: 28px 32px; border-radius: var(--r-lg); border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1)); box-shadow: var(--shadow-card);
}
.resi-svg { width: 100%; height: auto; display: block; overflow: visible; }
.resi-reads { display: grid; gap: 12px; }
.resi-card { padding: 13px 16px; border-radius: var(--r-md); border: 1px solid var(--line);
  border-left: 3px solid var(--c); background: linear-gradient(180deg, color-mix(in srgb, var(--c) 9%, transparent), transparent), rgba(236,231,218,0.02); cursor: help; }
.resi-name { font-family: var(--display); font-size: 17px; font-weight: 600; color: var(--c); margin-bottom: 8px; }
.resi-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12.5px; margin-top: 4px; }
.resi-k { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.resi-weak, .resi-strong { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); color: var(--ink); }
.resi-weak { font-weight: 600; }
.resi-weak i, .resi-strong i { width: 9px; height: 9px; border-radius: 2px; }

/* ============================================================================
   AVOIDANCE — evade ring gauges
   ========================================================================== */
.avoidance-stage { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; max-width: 980px; margin: 0 auto; width: 100%; }
.avoid-card { display: flex; flex-direction: column; align-items: center; padding: 26px 22px 22px; border-radius: var(--r-lg);
  border: 1px solid var(--line); border-top: 2px solid color-mix(in srgb, var(--c) 55%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 6%, var(--bg-2)), var(--bg-1)); box-shadow: var(--shadow-card); }
.avoid-name { font-family: var(--display); font-size: 19px; font-weight: 600; color: var(--c); margin: 0 0 12px; }
.avoid-gauge-wrap { width: 180px; }
.avoid-gauge { display: block; width: 100%; height: auto; overflow: visible; }
.avoid-read { margin-top: 10px; font-size: 13px; color: var(--ink-dim); }
.avoid-read b { color: var(--ink); font-weight: 600; }
.avoid-row { margin-top: 14px; width: 100%; display: flex; align-items: center; justify-content: space-between; font-size: 13px;
  padding-top: 12px; border-top: 1px solid var(--line); }
.avoid-k { color: var(--ink-faint); }
.avoid-v { font-family: var(--mono); color: var(--ink); }
.avoid-v.is-best { color: var(--c); }

/* ============================================================================
   LOOT LUCK — increased item rarity on a shared scale
   ========================================================================== */
.lootluck-stage { display: flex; justify-content: center; }
.loot-panel { width: 100%; max-width: 880px; padding: 26px 30px; border-radius: var(--r-lg); border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1)); box-shadow: var(--shadow-card); }
.loot-cap { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 18px; }
.loot-row { display: grid; grid-template-columns: 180px 1fr 70px; align-items: center; gap: 18px; padding: 12px 0; border-top: 1px solid var(--line); }
.loot-row:first-of-type { border-top: none; }
.loot-name { font-family: var(--display); font-size: 17px; font-weight: 600; color: var(--c); }
.loot-tag { font-size: 11px; color: var(--gold-soft); font-weight: 600; margin-top: 2px; letter-spacing: 0.02em; }
.loot-sub { font-size: 11px; color: var(--ink-faint); margin-top: 2px; }
.loot-track { position: relative; height: 12px; border-radius: 7px; background: rgba(236,231,218,0.06); }
.loot-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 7px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 35%, transparent), var(--c)); }
.loot-coin { position: absolute; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, var(--gold-soft), var(--gold)); border: 1.5px solid #0B0D14;
  box-shadow: 0 0 12px rgba(201,162,75,0.7); }
.loot-val { font-family: var(--display); font-size: 22px; font-weight: 600; color: var(--ink); text-align: right; }
.loot-val small { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); font-weight: 400; }

/* ============================================================================
   SKILL SETUP — every skill per player, with its gems (3 columns)
   ========================================================================== */
.skillsetup-stage { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: start; }
.skillcol { padding: 22px 20px; border-radius: var(--r-lg); border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 7%, var(--bg-2)), var(--bg-1)); box-shadow: var(--shadow-card); }
.skillcol-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--line-strong); }
.skillcol-name { font-family: var(--display); font-size: 19px; font-weight: 600; color: var(--c); }
.skillcol-count { font-size: 11px; color: var(--ink-faint); font-family: var(--mono); }
.skill-group { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-top: 1px solid var(--line); }
.skill-group:first-of-type { border-top: none; }
.sg-active { flex: none; width: 40px; height: 40px; border-radius: 9px; overflow: hidden; background: var(--bg-3);
  border: 1.5px solid var(--c); display: grid; place-items: center; cursor: help; transition: transform .12s; }
.sg-active img { width: 100%; height: 100%; object-fit: cover; }
.sg-active .gem-fallback { font-family: var(--display); font-size: 17px; color: var(--ink-dim); }
.sg-active:hover { transform: translateY(-1px); z-index: 3; }
.sg-meta { flex: 1; min-width: 0; }
.sg-name { font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-dps { font-family: var(--mono); font-size: 10.5px; color: var(--c); margin-top: 1px; }
.sg-dps.is-util { color: var(--ink-faint); }
.sg-supports { flex: none; display: flex; gap: 4px; }
.sg-sup { width: 26px; height: 26px; border-radius: 6px; overflow: hidden; background: var(--bg-3);
  border: 1px solid color-mix(in srgb, var(--c) 35%, var(--line-strong)); display: grid; place-items: center; cursor: help; transition: transform .12s; }
.sg-sup img { width: 100%; height: 100%; object-fit: cover; }
.sg-sup .gem-fallback { font-family: var(--display); font-size: 11px; color: var(--ink-dim); }
.sg-sup:hover { transform: translateY(-2px); z-index: 3; }

/* ============================================================================
   ATTRIBUTES — ternary triangle (one shared figure)
   ========================================================================== */
.allegiance-stage { display: flex; justify-content: center; }
.triangle-panel {
  width: 100%; max-width: 920px; display: grid; grid-template-columns: minmax(0, 460px) 1fr; gap: 36px; align-items: center;
  padding: 30px 32px; border-radius: var(--r-lg); border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1)); box-shadow: var(--shadow-card);
}
.triangle-svg { width: 100%; height: auto; display: block; overflow: visible; }
.allegiance-reads { display: grid; gap: 12px; }
.alleg-card { padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 9%, transparent), transparent),
              rgba(236,231,218,0.02); border-left: 3px solid var(--c); }
.alleg-name { font-family: var(--display); font-size: 17px; font-weight: 600; color: var(--c); line-height: 1.1; }
.alleg-who { font-size: 11px; color: var(--ink-faint); margin-bottom: 9px; }
.alleg-attrs { display: flex; gap: 16px; }
.alleg-attr { display: flex; flex-direction: column; }
.alleg-k { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.alleg-v { font-family: var(--mono); font-size: 15px; color: var(--ink-dim); }
.alleg-attr.is-dom .alleg-v { color: var(--ink); font-weight: 700; }
.alleg-attr.is-dom .alleg-k { color: var(--c); }

/* ============================================================================
   ARSENAL — gear grids (kept; rarity made unmistakable)
   ========================================================================== */
.arsenal-stage { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: start; }
.loadout { padding: 26px 22px; border-radius: var(--r-lg); border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 7%, var(--bg-2)), var(--bg-1)); box-shadow: var(--shadow-card); }
.loadout-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 4px; }
.loadout-name { font-family: var(--display); font-size: 19px; font-weight: 600; color: var(--c); }
.loadout-name span { display: block; font-family: var(--body); font-size: 11px; color: var(--ink-faint); font-weight: 400; margin-top: 1px; }
.loadout-score { text-align: right; }
.loadout-score b { font-family: var(--display); font-size: 24px; color: var(--ink); font-weight: 600; }
.loadout-score small { display: block; font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.rarity-tally { display: flex; gap: 4px; align-items: center; margin: 12px 0 14px; flex-wrap: wrap; }
.tally-pip { width: 18px; height: 5px; border-radius: 2px; }
.gear-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.gear-cell {
  position: relative; aspect-ratio: 1; border-radius: var(--r-sm);
  background: radial-gradient(circle at 50% 32%, var(--bg-3), #0b0d15); border: 1.5px solid var(--line-strong);
  display: grid; place-items: center; overflow: hidden; cursor: help; transition: transform .14s, box-shadow .14s, border-color .14s;
}
.gear-cell[data-rarity="Unique"] { border-color: var(--r-unique);
  box-shadow: inset 0 0 22px -6px color-mix(in srgb, var(--r-unique) 85%, transparent), 0 0 0 1px color-mix(in srgb, var(--r-unique) 30%, transparent); }
.gear-cell[data-rarity="Rare"] { border-color: color-mix(in srgb, var(--r-rare) 72%, transparent);
  box-shadow: inset 0 0 18px -9px color-mix(in srgb, var(--r-rare) 70%, transparent); }
.gear-cell[data-rarity="Magic"] { border-color: color-mix(in srgb, var(--r-magic) 60%, transparent); }
.gear-cell:hover { transform: translateY(-3px) scale(1.05); z-index: 5; border-color: var(--gold); box-shadow: 0 12px 28px -8px rgba(0,0,0,0.9); }
.gear-cell img { width: 88%; height: 88%; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6)); }
.gear-cell .gear-fallback { font-size: 8.5px; color: var(--ink-dim); text-align: center; padding: 4px; line-height: 1.15; }
.gear-slot-label { position: absolute; left: 4px; bottom: 3px; font-size: 8px; letter-spacing: 0.05em; color: var(--ink-faint); text-transform: uppercase; pointer-events: none; }
.gear-corner { position: absolute; top: 0; right: 0; width: 0; height: 0; border-style: solid;
  border-width: 0 13px 13px 0; border-color: transparent var(--r-unique) transparent transparent; }

/* ── tooltip ───────────────────────────────────────────────────────────── */
.tooltip { position: fixed; z-index: 100; max-width: 330px; pointer-events: none; padding: 12px 14px; border-radius: var(--r-md);
  background: rgba(12, 14, 22, 0.98); border: 1px solid var(--line-strong); box-shadow: 0 18px 50px -16px rgba(0,0,0,0.92);
  font-size: 13px; line-height: 1.5; }
.tt-title { font-family: var(--display); font-weight: 600; font-size: 15px; margin-bottom: 5px; }
.tt-sub { font-size: 11px; color: var(--ink-faint); margin-bottom: 8px; font-family: var(--mono); letter-spacing: 0.03em; }
.tt-mod { color: var(--ink-dim); }
.tt-mod.is-implicit { color: var(--r-magic); }
.tt-mod.is-rune { color: var(--cold); }
.tt-sep { height: 1px; background: var(--line); margin: 7px 0; }
.tt-who { display: flex; gap: 8px; margin-top: 7px; flex-wrap: wrap; }
.tt-who span { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; }
.tt-who i { width: 7px; height: 7px; border-radius: 50%; }
.tt-row { display: flex; justify-content: space-between; gap: 18px; }
.tt-row b { color: var(--ink); font-weight: 600; }
.tt-line { color: var(--ink-dim); }

/* ── loading / footer / error ──────────────────────────────────────────── */
.loading-veil { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: var(--bg); transition: opacity .5s; }
.loading-veil.is-done { opacity: 0; pointer-events: none; }
.loading-rune { font-size: 44px; color: var(--gold); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .35; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.04); } }
.page-foot { max-width: var(--maxw); margin: 0 auto; padding: 56px 26px 80px; color: var(--ink-faint); font-size: 12.5px; font-family: var(--mono); letter-spacing: 0.04em; border-top: 1px solid var(--line); }
.load-error { max-width: 560px; margin: 18vh auto; padding: 32px; text-align: center; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--bg-2); }
.load-error h2 { font-family: var(--display); }

/* ── responsive ───────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .roster-stage, .vitals-stage, .strike-stage, .arsenal-stage, .avoidance-stage, .skillsetup-stage { grid-template-columns: 1fr; }
  .triangle-panel, .resi-panel { grid-template-columns: 1fr; }
  .loot-row { grid-template-columns: 130px 1fr 56px; gap: 12px; }
  .topnav { display: none; }
  .legend-chip .legend-lvl { display: none; }
  .act { padding: 60px 18px; }
  .atlas-frame { height: 66vh; }
}
@media (max-width: 560px) {
  .legend { gap: 6px; } .legend-name { font-size: 12px; }
  .fresh-txt { display: none; }
  .act-head { margin-bottom: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.05ms !important; }
}
