/* =====================================================================
   WRAITH ANALYTICS SUITE - shared stylesheet
   Spec: WRAITH-DESIGN.md. Every page in /wraith/ sets <body class="ws">.
   Mobile first, dark only, 16 px gutters, no horizontal page scroll.
   Prefix: ws-  (icons: .wi)
   ===================================================================== */

/* ---------- 1. TOKENS ---------- */
.ws {
  --ws-bg: #0c0705;
  --ws-bg-2: #140b07;
  --ws-panel: rgba(28, 17, 11, 0.72);
  --ws-panel-2: rgba(38, 23, 14, 0.6);
  --ws-panel-solid: #1c110b;
  --ws-line: rgba(255, 122, 40, 0.18);
  --ws-line-2: rgba(255, 255, 255, 0.06);
  --ws-grid: rgba(255, 190, 140, 0.09);
  --ws-ink: #fdeadb;
  --ws-mute: #c1a48f;
  --ws-faint: #8a7060;

  --ws-fire: #ff6a1a;
  --ws-molten: #ff3b1e;
  --ws-gold: #ffc24a;
  --ws-flame: #ffd88a;
  --ws-ash: #6b5a4e;
  --ws-glow: rgba(255, 106, 26, 0.45);
  --ws-grad-fire: linear-gradient(90deg, #ff3b1e, #ff6a1a, #ffc24a);
  --ws-grad-text: linear-gradient(180deg, #fff 2%, #ffd88a 26%, #ff6a1a 62%, #ff3b1e 100%);

  --ws-win: #ffb43e;
  --ws-loss: #ff5a3c;
  --ws-quit: #9a8578;
  --ws-up: #5fd48a;
  --ws-down: #ff5a3c;
  --ws-flat: #8a7060;

  /* categorical chart slots (validated, dark surface #140b07) */
  --ws-c1: #e8621a;
  --ws-c2: #2aa3c8;
  --ws-c3: #b08a14;
  --ws-c4: #9370e6;
  --ws-c5: #e653a5;
  --ws-c6: #2aa85a;
  /* sequential fire ramp, low to high */
  --ws-s1: #7a3a14; --ws-s2: #a24a14; --ws-s3: #c85c16; --ws-s4: #ea711f; --ws-s5: #ff9040; --ws-s6: #ffb872;
  /* diverging */
  --ws-div-cool: #2aa3c8; --ws-div-mid: #6b5a4e; --ws-div-warm: #e8621a;
  /* podium */
  --ws-p1: #ffc24a; --ws-p2: #e6d2b0; --ws-p3: #d68a4b;

  --ws-display: "Cinzel", Georgia, serif;
  --ws-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ws-mono: "Share Tech Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --ws-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ws-nav-h: 52px;    /* fixed design height of the suite nav (min-height); never written by JS */
  --ws-nav-off: 52px;  /* measured rendered nav height, written by wraith-fx.js, used only for sticky offsets */
  --ws-top: 0px;       /* rendered height of the site .topbar, measured by wraith-fx.js (0 when absent) */
  --ws-hero-tint: rgba(255, 106, 26, 0.16);
  --rc: var(--ws-fire);

  background: var(--ws-bg);
  color: var(--ws-ink);
  font-family: var(--ws-body);
  overflow-x: clip;
}
.ws ::selection { background: rgba(255, 106, 26, 0.32); color: #fff; }
.ws a { color: var(--ws-gold); }
.ws a:hover { color: var(--ws-flame); }
.ws :focus-visible { outline: 2px solid var(--ws-fire); outline-offset: 2px; border-radius: 4px; }
.ws main { overflow: clip; min-height: 100vh; min-height: 100svh; } /* keeps the site footer below the fold while pages fill in, so it never jumps */
.ws-skip { position: absolute; left: -999px; top: 0; z-index: 999; padding: 0.5rem 0.8rem; background: var(--ws-fire); color: #1a0b04; font-weight: 700; }
.ws-skip:focus { left: 8px; top: 8px; }
.ws-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* icons */
.wi { display: inline-block; width: 1em; height: 1em; vertical-align: -0.12em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.wi-lg { width: 1.4em; height: 1.4em; }
.wi-xl { width: 2em; height: 2em; }

/* ---------- 2. LAYOUT ---------- */
.ws-wrap { width: min(1240px, 100% - 32px); margin: 0 auto; }
.ws-section { margin: clamp(2rem, 5vw, 3.5rem) 0; }
.ws-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: start; }
.ws-split { display: grid; gap: 1.2rem; grid-template-columns: 1fr; align-items: start; }
/* grid children default to min-width: auto, so a .ws-scroll table inside a cell would widen the page past the viewport */
.ws-grid > *, .ws-split > *, .ws-cards > *, .ws-tiles > *, .ws-records > * { min-width: 0; }
.ws-tiles { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.ws-cards { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.ws-records { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.ws-stack { display: flex; flex-direction: column; gap: 0.7rem; }
.ws-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
@media (min-width: 768px) {
  .ws-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .ws-grid > * { grid-column: span var(--span, 12); }
  .ws-span-3 { --span: 3; } .ws-span-4 { --span: 4; } .ws-span-5 { --span: 5; } .ws-span-6 { --span: 6; }
  .ws-span-7 { --span: 7; } .ws-span-8 { --span: 8; } .ws-span-9 { --span: 9; } .ws-span-12 { --span: 12; }
}
@media (min-width: 1024px) { .ws-split { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); } }
.ws-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--ws-line) transparent; mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.ws-scroll.is-end { mask-image: none; -webkit-mask-image: none; }

/* ---------- 3. TYPE ---------- */
.ws-kicker { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0 0 0.6rem; font-family: var(--ws-mono); font-size: 0.72rem; letter-spacing: 0.32em; text-transform: uppercase; color: var(--ws-gold); }
.ws-kicker-flame { width: 10px; height: 14px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: linear-gradient(180deg, var(--ws-gold), var(--ws-molten)); box-shadow: 0 0 10px var(--ws-fire); animation: ws-flicker 2.4s infinite; transform-origin: bottom; flex: none; }
.ws-title { margin: 0; font-family: var(--ws-display); font-weight: 900; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 0.98; letter-spacing: 0.03em; text-wrap: balance; background: var(--ws-grad-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; filter: drop-shadow(0 2px 0 rgba(0,0,0,0.4)) drop-shadow(0 0 22px rgba(255,90,20,0.5)); animation: ws-flicker-title 6s infinite; }
.ws-hero.is-hub .ws-title { font-size: clamp(2.4rem, 8vw, 5rem); line-height: 0.95; }
.ws-tagline { max-width: 48ch; margin: 0.9rem 0 0; color: var(--ws-ink); font-size: clamp(0.98rem, 2vw, 1.12rem); line-height: 1.55; text-shadow: 0 1px 12px rgba(0,0,0,0.7); }
.ws-h2 { display: flex; align-items: center; gap: 0.8rem; margin: 0 0 1rem; font-family: var(--ws-display); font-weight: 700; font-size: clamp(1.3rem, 3vw, 1.8rem); letter-spacing: 0.02em; text-wrap: balance; }
.ws-h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--ws-line), transparent); }
.ws-h2 .wi { color: var(--ws-fire); }
.ws-label { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ws-faint); }
.ws-prose { max-width: 65ch; color: var(--ws-mute); font-size: 0.95rem; line-height: 1.6; }
.ws-prose b, .ws-prose strong { color: var(--ws-ink); }
.ws-num { font-family: var(--ws-mono); }
.ws-tab { font-variant-numeric: tabular-nums; }
.ws-delta { font-family: var(--ws-mono); font-weight: 600; font-size: 0.78rem; display: inline-flex; align-items: center; gap: 0.2rem; white-space: nowrap; }
.ws-delta.is-up { color: var(--ws-up); } .ws-delta.is-down { color: var(--ws-down); } .ws-delta.is-flat { color: var(--ws-flat); }
.ws-outcome-text.is-won { color: var(--ws-win); } .ws-outcome-text.is-surrender { color: var(--ws-loss); } .ws-outcome-text.is-regen { color: var(--ws-quit); }
@keyframes ws-flicker { 0%,100% { transform: scaleY(1) rotate(0); opacity: 1; } 30% { transform: scaleY(1.12) rotate(-3deg); } 60% { transform: scaleY(0.92) rotate(3deg); opacity: 0.85; } }
@keyframes ws-flicker-title { 0%,94%,100% { opacity: 1; } 95% { opacity: 0.82; } 96% { opacity: 1; } 97.5% { opacity: 0.9; } }

/* ---------- 4. SUITE NAV ---------- */
.ws-nav { position: sticky; top: var(--ws-top); z-index: 60; background: linear-gradient(180deg, rgba(12,7,5,0.97), rgba(12,7,5,0.88)); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--ws-line); }
.ws-nav-inner { display: flex; align-items: center; gap: 0.6rem; min-height: var(--ws-nav-h); }
.ws-nav-brand { display: inline-flex; align-items: center; gap: 0.45rem; flex: none; font-family: var(--ws-mono); font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ws-gold); text-decoration: none; padding-right: 0.6rem; border-right: 1px solid var(--ws-line); }
.ws-nav-brand .wi { color: var(--ws-fire); font-size: 1.1rem; }
.ws-nav-brand span { display: none; }
@media (min-width: 560px) { .ws-nav-brand span { display: inline; } }
.ws-nav-links { display: flex; gap: 0.15rem; list-style: none; margin: 0; padding: 0; min-width: 0; flex: 1; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 20px), transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 20px), transparent); }
.ws-nav-links::-webkit-scrollbar { display: none; }
.ws-nav-links li { flex: none; scroll-snap-align: start; }
.ws-nav-link { position: relative; display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.9rem 0.65rem; font-size: 0.82rem; font-weight: 600; color: var(--ws-mute); text-decoration: none; white-space: nowrap; transition: color 0.16s ease; }
.ws-nav-link .wi { font-size: 0.95rem; opacity: 0.8; }
.ws-nav-link::after { content: ""; position: absolute; left: 0.65rem; right: 0.65rem; bottom: 0; height: 2px; background: var(--ws-grad-fire); box-shadow: 0 0 10px var(--ws-fire); transform: scaleX(0); transform-origin: left; transition: transform 0.28s var(--ws-ease); }
.ws-nav-link:hover { color: var(--ws-ink); }
.ws-nav-link.is-here { color: var(--ws-gold); }
.ws-nav-link.is-here::after, .ws-nav-link:hover::after { transform: scaleX(1); }
.ws-nav-realm { flex: none; margin-left: auto; }

/* ---------- 5. HERO ---------- */
.ws-hero { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; min-height: clamp(240px, 32vh, 360px); padding: clamp(1.8rem, 5vw, 3rem) 0 clamp(2.2rem, 6vw, 3.6rem); }
.ws-hero.is-hub { min-height: clamp(420px, 56vh, 620px); }
/* Reserve each page's real hero height (about 96% of what it measures once the data has loaded, at 375, 768 and 1280 px wide)
   so the skeleton to content swap does not push the whole page down. Values are min-heights only: longer content still grows the hero.
   Order per page: phone (under 480 px), tablet (480 to 1023 px), desktop (1024 px and up). Re-measure if a hero's content changes. */
body[data-page="realm"] .ws-hero { min-height: 440px; }
body[data-page="players"] .ws-hero { min-height: 360px; }
body[data-page="player"] .ws-hero { min-height: 525px; }
body[data-page="compare"] .ws-hero { min-height: 250px; }
body[data-page="fights"] .ws-hero { min-height: 490px; }
body[data-page="fight"] .ws-hero { min-height: 560px; }
body[data-page="squads"] .ws-hero { min-height: 510px; }
body[data-page="squad"] .ws-hero { min-height: 600px; }
body[data-page="boards"] .ws-hero { min-height: 365px; }
body[data-page="records"] .ws-hero { min-height: 465px; }
body[data-page="seasons"] .ws-hero { min-height: 490px; }
@media (min-width: 480px) {
  body[data-page="realm"] .ws-hero { min-height: 335px; }
  body[data-page="players"] .ws-hero { min-height: 380px; }
  body[data-page="player"] .ws-hero { min-height: 425px; }
  body[data-page="compare"] .ws-hero { min-height: 315px; }
  body[data-page="fights"] .ws-hero { min-height: 380px; }
  body[data-page="fight"] .ws-hero { min-height: 435px; }
  body[data-page="squads"] .ws-hero { min-height: 380px; }
  body[data-page="squad"] .ws-hero { min-height: 435px; }
  body[data-page="boards"] .ws-hero { min-height: 360px; }
  body[data-page="records"] .ws-hero { min-height: 360px; }
  body[data-page="seasons"] .ws-hero { min-height: 380px; }
}
@media (min-width: 1024px) {
  body[data-page="realm"] .ws-hero { min-height: 385px; }
  body[data-page="players"] .ws-hero { min-height: 435px; }
  body[data-page="player"] .ws-hero { min-height: 595px; }
  body[data-page="compare"] .ws-hero { min-height: 325px; }
  body[data-page="fights"] .ws-hero { min-height: 485px; }
  body[data-page="fight"] .ws-hero { min-height: 490px; }
  body[data-page="squads"] .ws-hero { min-height: 435px; }
  body[data-page="squad"] .ws-hero { min-height: 490px; }
  body[data-page="boards"] .ws-hero { min-height: 410px; }
  body[data-page="records"] .ws-hero { min-height: 410px; }
  body[data-page="seasons"] .ws-hero { min-height: 575px; }
}
.ws-hero-art { position: absolute; inset: 0; z-index: -3; background-image: var(--ws-hero-img, none); background-size: cover; background-position: center 30%; transform: scale(1.04); animation: ws-kenburns 40s ease-in-out infinite alternate; }
@keyframes ws-kenburns { from { transform: scale(1.04) translateX(0); } to { transform: scale(1.12) translateX(-1.5%); } }
.ws-hero-fade { position: absolute; inset: 0; z-index: -2; background: linear-gradient(90deg, var(--ws-bg) 4%, rgba(12,7,5,0.86) 30%, rgba(12,7,5,0.35) 62%, rgba(12,7,5,0.08) 100%), linear-gradient(0deg, var(--ws-bg) 2%, rgba(12,7,5,0.15) 32%, transparent 55%), radial-gradient(70% 60% at 78% 45%, var(--ws-hero-tint), transparent 60%); }
.ws-hero-glow { position: absolute; inset: 0; z-index: -2; pointer-events: none; background: radial-gradient(38% 50% at calc(var(--mx, 0.7) * 100%) calc(var(--my, 0.5) * 100%), var(--ws-hero-tint), transparent 70%); mix-blend-mode: screen; }
.ws-embers { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.ws-ember { position: absolute; bottom: -10px; width: 3px; height: 3px; border-radius: 50%; background: var(--ws-fire); box-shadow: 0 0 8px var(--ws-fire), 0 0 14px var(--ws-molten); opacity: 0; animation: ws-rise linear infinite; will-change: transform, opacity; }
@keyframes ws-rise { 0% { transform: translate3d(0,0,0) scale(1); opacity: 0; } 12% { opacity: 1; } 85% { opacity: 0.55; } 100% { transform: translate3d(var(--dx, 14px), -88vh, 0) scale(0.3); opacity: 0; } }
.ws-hero-rule { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; z-index: 1; background: var(--ws-grad-fire); box-shadow: 0 0 26px var(--ws-fire); }
.ws-hero-inner { position: relative; max-width: 720px; }
.ws-hero .breadcrumb, .ws-hero .ws-crumbs { font-size: 0.78rem; color: var(--ws-mute); margin: 0 0 0.8rem; text-shadow: 0 1px 8px rgba(0,0,0,0.8); }
.ws-crumbs a { color: var(--ws-mute); text-decoration: none; } .ws-crumbs a:hover { color: var(--ws-gold); }
.ws-crumbs span::before { content: "/"; margin: 0 0.4rem; color: var(--ws-faint); }
.ws-crumbs > a:first-child::before { content: none; }
@media (max-width: 720px) { .ws-hero.is-hub { text-align: center; } .ws-hero.is-hub .ws-hero-inner { margin: 0 auto; } .ws-hero.is-hub .ws-figures, .ws-hero.is-hub .ws-kicker { justify-content: center; } .ws-hero-art { background-position: center; } .ws-hero-fade { background: linear-gradient(0deg, var(--ws-bg) 6%, rgba(12,7,5,0.55) 45%, rgba(12,7,5,0.7) 100%); } }

/* hero figures */
.ws-figures { list-style: none; display: flex; flex-wrap: wrap; gap: clamp(1rem, 3vw, 2.4rem); margin: clamp(1.4rem, 4vw, 2.2rem) 0 0; padding: 0; }
.ws-figure { display: flex; flex-direction: column; min-width: 0; }
.ws-figure-ico { color: var(--ws-fire); font-size: 1.1rem; opacity: 0.9; }
.ws-figure-num { font-family: var(--ws-mono); font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1.05; color: var(--ws-flame); text-shadow: 0 0 18px var(--ws-glow); }
.ws-figure-num small { font-size: 0.5em; color: var(--ws-mute); margin-left: 0.1em; }
.ws-figure-label { font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ws-mute); margin-top: 0.2rem; }

/* ---------- 6. REALM BAR ---------- */
.ws-realmbar { position: sticky; top: calc(var(--ws-top) + var(--ws-nav-off)); z-index: 50; background: linear-gradient(180deg, rgba(12,7,5,0.96), rgba(12,7,5,0.84)); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--ws-line); }
.ws-realmbar-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.8rem; padding: 0.6rem 0; }
.ws-realmbar-inner .ws-spacer { flex: 1; }
.ws-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.ws-chip { appearance: none; cursor: pointer; font: inherit; font-size: 0.82rem; font-weight: 600; padding: 0.45rem 0.9rem; border-radius: 999px; color: var(--rc, var(--ws-mute)); background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); display: inline-flex; align-items: center; gap: 0.45rem; transition: all 0.16s ease; text-decoration: none; }
.ws-chip:hover { color: var(--ws-ink); border-color: var(--ws-line); }
.ws-chip .ws-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rc, currentColor); box-shadow: 0 0 8px var(--rc, currentColor); flex: none; }
.ws-chip.is-on { color: #1a0b04; background: linear-gradient(180deg, var(--ws-gold), var(--ws-fire)); border-color: transparent; box-shadow: 0 0 20px rgba(255,106,26,0.4); text-shadow: 0 1px 0 rgba(255,255,255,0.25); }
.ws-chip.is-on .ws-dot { background: rgba(26,11,4,0.85); box-shadow: none; }
.ws-chip.is-all.is-on { background: linear-gradient(90deg, var(--ws-gold), var(--ws-molten)); }
.ws-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--rc, var(--ws-fire)); box-shadow: 0 0 8px var(--rc, var(--ws-fire)); flex: none; }
.ws-is-loading > * { opacity: 0.55; transition: opacity 0.2s ease; pointer-events: none; }

/* segments, buttons, selects */
.ws-segs { display: inline-flex; background: rgba(255,255,255,0.04); border-radius: 999px; padding: 3px; gap: 2px; min-height: 36px; box-sizing: border-box; } /* min-height: the bar is filled by script, so the empty control must already be its final height */
.ws-segs:empty { background: none; }
.ws-seg { appearance: none; cursor: pointer; font: inherit; font-weight: 600; font-size: 0.78rem; color: var(--ws-mute); background: transparent; border: none; padding: 0.34rem 0.8rem; border-radius: 999px; transition: all 0.16s ease; }
.ws-seg:hover { color: var(--ws-ink); }
.ws-seg.is-on { background: linear-gradient(180deg, var(--ws-gold), var(--ws-fire)); color: #1a0b04; }
.ws-btn { appearance: none; cursor: pointer; font: inherit; font-weight: 600; font-size: 0.86rem; color: var(--ws-fire); background: transparent; border: 1px solid var(--ws-line); padding: 0.55rem 1.1rem; border-radius: 999px; display: inline-flex; align-items: center; gap: 0.45rem; text-decoration: none; transition: all 0.16s ease; }
.ws-btn:hover { background: rgba(255,106,26,0.09); color: var(--ws-flame); }
.ws-btn.is-primary { color: #1a0b04; background: linear-gradient(180deg, var(--ws-gold), var(--ws-fire)); border-color: transparent; box-shadow: 0 6px 22px rgba(255,106,26,0.3); }
.ws-btn.is-primary:hover { filter: brightness(1.08); color: #1a0b04; }
.ws-btn.is-ghost { border-color: transparent; }
.ws-btn.is-sm { font-size: 0.76rem; padding: 0.38rem 0.8rem; }
.ws-select, .ws-input { font: inherit; font-size: 0.86rem; color: var(--ws-ink); background: var(--ws-bg-2); border: 1px solid var(--ws-line); border-radius: 10px; padding: 0.5rem 0.8rem; min-width: 0; max-width: 100%; }
.ws-select { appearance: none; padding-right: 2rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff6a1a' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.6rem center; background-size: 14px; }
.ws-input::placeholder { color: var(--ws-faint); }
.ws-search { position: relative; display: flex; align-items: center; }
.ws-search .wi { position: absolute; left: 0.7rem; color: var(--ws-faint); pointer-events: none; }
.ws-search .ws-input { padding-left: 2.2rem; width: 100%; }

/* ---------- 7. PANELS AND CARDS ---------- */
.ws-panel { position: relative; background: var(--ws-panel); border: 1px solid var(--ws-line); border-radius: 16px; padding: clamp(1rem, 2.4vw, 1.5rem); min-width: 0; }
.ws-panel.has-glow::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(40% 40% at calc(var(--mx, 0.5) * 100%) calc(var(--my, 0.2) * 100%), rgba(255,106,26,0.12), transparent 70%); }
.ws-panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 0.9rem; margin-bottom: 1rem; }
.ws-panel-title { font-family: var(--ws-display); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.02em; margin: 0; display: flex; align-items: center; gap: 0.5rem; }
.ws-panel-title .wi { color: var(--ws-fire); font-size: 1.1rem; }
.ws-panel-sub { margin: 0.15rem 0 0; color: var(--ws-mute); font-size: 0.84rem; flex-basis: 100%; }
.ws-panel-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-left: auto; }
.ws-panel-foot { margin: 0.9rem 0 0; color: var(--ws-faint); font-size: 0.74rem; }
.ws-card { position: relative; display: block; min-width: 0; padding: 0.9rem 1rem; border-radius: 12px; background: var(--ws-panel-2); border: 1px solid var(--ws-line-2); color: inherit; text-decoration: none; transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease; }
a.ws-card:hover, .ws-card.is-link:hover { border-color: var(--ws-line); transform: translateY(-2px); color: inherit; }
.ws-card.is-row:hover { transform: translateX(3px); background: rgba(255,106,26,0.05); }
.ws-card.is-realm { border-left: 3px solid var(--rc); }

/* ---------- 8. STAT TILE ---------- */
.ws-tile { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 0.3rem; padding: 1rem 1.1rem; border-radius: 14px; background: var(--ws-panel); border: 1px solid var(--ws-line); color: inherit; text-decoration: none; min-width: 0; transition: border-color 0.16s ease, transform 0.16s ease; }
.ws-tile::after { content: ""; position: absolute; right: -20px; top: -20px; width: 80px; height: 80px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255,106,26,0.14), transparent); pointer-events: none; }
a.ws-tile:hover { border-color: rgba(255,106,26,0.4); transform: translateY(-2px); color: inherit; }
.ws-tile-head { display: flex; align-items: center; gap: 0.45rem; min-width: 0; }
.ws-tile-ico { color: var(--ws-fire); font-size: 1rem; }
.ws-tile-label { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ws-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-tile-info { margin-left: auto; appearance: none; cursor: help; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--ws-line); background: transparent; color: var(--ws-faint); font: 600 0.62rem/1 var(--ws-body); display: grid; place-items: center; flex: none; }
.ws-tile-value { font-family: var(--ws-mono); font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.1; color: var(--ws-ink); }
.ws-tile-value small { font-size: 0.55em; color: var(--ws-mute); margin-left: 0.15em; }
.ws-tile.is-hero .ws-tile-value { font-size: clamp(2.2rem, 6vw, 3.4rem); color: var(--ws-flame); text-shadow: 0 0 18px var(--ws-glow); }
.ws-tile.is-win .ws-tile-ico, .ws-tile.is-win .ws-tile-value { color: var(--ws-win); }
.ws-tile.is-loss .ws-tile-ico, .ws-tile.is-loss .ws-tile-value { color: var(--ws-loss); }
.ws-tile.is-quit .ws-tile-ico, .ws-tile.is-quit .ws-tile-value { color: var(--ws-quit); }
.ws-tile.is-gold .ws-tile-ico, .ws-tile.is-gold .ws-tile-value { color: var(--ws-gold); }
.ws-tile-delta { font-family: var(--ws-mono); font-weight: 600; font-size: 0.78rem; display: inline-flex; align-items: center; gap: 0.25rem; }
.ws-tile-delta.is-up { color: var(--ws-up); } .ws-tile-delta.is-down { color: var(--ws-down); } .ws-tile-delta.is-flat { color: var(--ws-flat); }
.ws-tile-delta span { color: var(--ws-faint); font-family: var(--ws-body); font-weight: 400; }
.ws-tile-trend { width: 100%; height: 34px; margin-top: 0.2rem; }
.ws-tile-trend svg { width: 100%; height: 100%; display: block; overflow: visible; }
.ws-tile-foot { font-size: 0.72rem; color: var(--ws-faint); }
.ws-wlq { display: flex; gap: 0.6rem; font-family: var(--ws-mono); font-size: 0.74rem; }
.ws-wlq .w { color: var(--ws-win); } .ws-wlq .l { color: var(--ws-loss); } .ws-wlq .q { color: var(--ws-quit); }

/* sparkline (inline svg drawn by charts or by hand) */
.ws-spark path.line { fill: none; stroke: var(--ws-fire); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 5px rgba(255,106,26,0.55)); }
.ws-spark path.area { fill: rgba(255,106,26,0.12); stroke: none; }
.ws-spark circle { fill: var(--ws-gold); stroke: var(--ws-bg-2); stroke-width: 2; }

/* ---------- 9. RECORD CARD ---------- */
.ws-record { position: relative; display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.85rem 0.95rem; border-radius: 12px; background: var(--ws-panel-2); border: 1px solid var(--ws-line-2); border-left: 3px solid var(--ws-gold); color: inherit; text-decoration: none; min-width: 0; overflow: hidden; transition: transform 0.16s ease, border-color 0.16s ease; }
.ws-record.is-realm { border-left-color: var(--rc); }
.ws-record:hover { transform: translateY(-2px); border-color: var(--ws-line); border-left-color: var(--ws-gold); color: inherit; }
.ws-record.is-realm:hover { border-left-color: var(--rc); }
.ws-record-ico { display: grid; flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: rgba(255,106,26,0.12); color: var(--ws-fire); font-size: 1.1rem; transition: box-shadow 0.16s ease; }
.ws-record:hover .ws-record-ico { box-shadow: 0 0 16px rgba(255,106,26,0.4); }
.ws-record-body { display: block; min-width: 0; flex: 1; }
.ws-record-label { display: block; font-size: 0.64rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ws-faint); }
.ws-record-val { display: block; font-family: var(--ws-mono); font-size: 1.15rem; color: var(--ws-flame); line-height: 1.2; margin-top: 0.1rem; }
.ws-record-holder { display: block; font-weight: 600; font-size: 0.86rem; color: var(--ws-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 0.15rem; }
.ws-record-meta { font-size: 0.72rem; color: var(--ws-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 0.15rem; display: flex; align-items: center; gap: 0.35rem; }
.ws-record-crest { position: absolute; top: 10px; right: -26px; padding: 0.15rem 2rem; transform: rotate(35deg); font-family: var(--ws-mono); font-size: 0.6rem; letter-spacing: 0.2em; color: #1a0b04; background: var(--ws-gold); box-shadow: 0 0 12px rgba(255,194,74,0.5); }

/* ---------- 10. FIGHT CARD ---------- */
.ws-fight { display: grid; gap: 0.75rem; grid-template-columns: auto 1fr auto; align-items: center; }
.ws-outcome { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 58px; }
.ws-outcome-sigil { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid currentColor; font-size: 1.05rem; box-shadow: 0 0 12px color-mix(in srgb, currentColor 35%, transparent); }
.ws-outcome-label { font-family: var(--ws-mono); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; margin-top: 0.3rem; }
.ws-fight.is-won .ws-outcome { color: var(--ws-win); }
.ws-fight.is-surrender .ws-outcome { color: var(--ws-loss); }
.ws-fight.is-regen .ws-outcome { color: var(--ws-quit); }
.ws-fight-main { min-width: 0; }
.ws-fight-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.ws-tag { font-size: 0.66rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ws-mute); background: rgba(255,255,255,0.05); padding: 0.14rem 0.5rem; border-radius: 6px; display: inline-flex; align-items: center; gap: 0.3rem; }
.ws-tag.is-realm { color: var(--rc); background: color-mix(in srgb, var(--rc) 12%, transparent); }
.ws-tag.is-won { color: var(--ws-win); background: rgba(255,180,62,0.14); }
.ws-tag.is-surrender { color: var(--ws-loss); background: rgba(255,90,60,0.14); }
.ws-tag.is-regen { color: var(--ws-quit); background: rgba(154,133,120,0.16); }
.ws-tag.is-phase2 { color: var(--ws-c4); background: rgba(147,112,230,0.14); }
.ws-when { font-size: 0.76rem; color: var(--ws-faint); display: inline-flex; align-items: center; gap: 0.3rem; }
.ws-mvp { font-size: 0.84rem; color: var(--ws-ink); display: inline-flex; align-items: center; gap: 0.3rem; }
.ws-mvp b { color: var(--ws-gold); }
.ws-stage { margin-top: 0.5rem; }
.ws-stage-bar { position: relative; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.07); overflow: hidden; }
.ws-stage-fill { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--ws-grad-fire); box-shadow: 0 0 10px rgba(255,106,26,0.6); width: 0; transition: width 0.9s var(--ws-ease); }
.ws-fight.is-surrender .ws-stage-fill, .ws-fight.is-regen .ws-stage-fill { background: linear-gradient(90deg, #5a3320, #8a7d72); box-shadow: none; }
.ws-stage-meta { display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--ws-faint); margin-top: 0.28rem; font-family: var(--ws-mono); }
.ws-fight-side { text-align: right; display: flex; flex-direction: column; gap: 0.25rem; align-items: flex-end; }
.ws-diff { font-family: var(--ws-mono); font-size: 0.74rem; color: var(--ws-gold); }
.ws-dur { font-family: var(--ws-mono); font-size: 0.74rem; color: var(--ws-faint); display: inline-flex; align-items: center; gap: 0.3rem; }
@media (max-width: 560px) { .ws-fight { grid-template-columns: auto 1fr; } .ws-fight-side { grid-column: 2; text-align: left; flex-direction: row; flex-wrap: wrap; gap: 0.6rem; align-items: center; } }

/* ---------- 11. PLAYER / SQUAD / SEASON CARDS ---------- */
.ws-avatar { position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #3a2416, #1a0f08); color: var(--ws-flame); font-family: var(--ws-display); font-weight: 700; font-size: 1rem; box-shadow: 0 0 0 2px var(--ws-bg-2), 0 0 0 3.5px var(--rc), 0 0 14px color-mix(in srgb, var(--rc) 45%, transparent); overflow: hidden; }
.ws-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ws-avatar.is-lg { width: 84px; height: 84px; font-size: 1.8rem; }
.ws-avatar.is-sm { width: 28px; height: 28px; font-size: 0.7rem; box-shadow: 0 0 0 1.5px var(--ws-bg-2), 0 0 0 2.5px var(--rc); }
.ws-avatar-stack { display: flex; }
.ws-avatar-stack .ws-avatar { margin-left: -8px; }
.ws-avatar-stack .ws-avatar:first-child { margin-left: 0; }
.ws-player-card { display: grid; grid-template-columns: auto 1fr; gap: 0.7rem 0.8rem; align-items: center; }
.ws-player-name { font-weight: 700; font-size: 0.98rem; display: flex; align-items: center; gap: 0.35rem; min-width: 0; }
.ws-player-name > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-member { color: var(--ws-gold); font-size: 0.8rem; flex: none; }
.ws-player-sub { font-size: 0.74rem; color: var(--ws-mute); display: flex; gap: 0.5rem; flex-wrap: wrap; }
.ws-ministats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; padding-top: 0.6rem; border-top: 1px solid var(--ws-line-2); }
.ws-ministat b { display: block; font-family: var(--ws-mono); font-weight: 400; font-size: 1.05rem; color: var(--ws-ink); }
.ws-ministat span { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ws-faint); }
.ws-card-spark { grid-column: 1 / -1; height: 34px; }
.ws-card-spark svg { width: 100%; height: 100%; display: block; overflow: visible; }
.ws-squad-card .ws-row { justify-content: space-between; }
.ws-roster { font-size: 0.8rem; color: var(--ws-mute); margin-top: 0.4rem; line-height: 1.5; }
.ws-roster b { color: var(--ws-ink); font-weight: 600; }
.ws-meter { height: 4px; border-radius: 2px; background: rgba(255,255,255,0.06); overflow: hidden; }
.ws-meter i { display: block; height: 100%; border-radius: 2px; background: var(--ws-grad-fire); width: 0; transition: width 0.8s var(--ws-ease); }
.ws-meter.is-realm i { background: var(--rc); }
.ws-meter-row { display: flex; align-items: center; gap: 0.6rem; font-size: 0.74rem; color: var(--ws-mute); margin-top: 0.5rem; }
.ws-meter-row .ws-meter { flex: 1; }
.ws-meter-row b { font-family: var(--ws-mono); font-weight: 400; color: var(--ws-ink); }
.ws-season-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; border-radius: 12px 0 0 12px; background: var(--rc); box-shadow: 0 0 14px var(--rc); }
.ws-season-server { font-weight: 700; font-size: 0.98rem; display: flex; align-items: center; gap: 0.45rem; }
.ws-season-no { font-family: var(--ws-mono); font-size: 0.74rem; color: var(--ws-gold); margin-top: 0.15rem; }
.ws-season-stats { display: flex; gap: 1.2rem; margin-top: 0.8rem; }
.ws-season-stat b { display: block; font-family: var(--ws-mono); font-weight: 400; font-size: 1.3rem; }
.ws-season-stat span { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ws-faint); }
.ws-podium { display: flex; gap: 0.5rem; margin-top: 0.8rem; }
.ws-podium-step { flex: 1; text-align: center; padding: 0.5rem 0.3rem; border-radius: 8px; background: rgba(255,255,255,0.03); border-top: 2px solid var(--pc, var(--ws-p1)); min-width: 0; }
.ws-podium-step:nth-child(1) { --pc: var(--ws-p1); } .ws-podium-step:nth-child(2) { --pc: var(--ws-p2); } .ws-podium-step:nth-child(3) { --pc: var(--ws-p3); }
.ws-podium-step i { display: block; font-family: var(--ws-display); font-style: normal; font-weight: 700; font-size: 0.8rem; color: var(--pc); }
.ws-podium-step b { display: block; font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-podium-step span { font-family: var(--ws-mono); font-size: 0.7rem; color: var(--ws-mute); }

/* ---------- 12. BADGES ---------- */
.ws-badge-case { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 0.8rem; }
.ws-badge { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; text-align: center; min-width: 0; }
.ws-badge-hex { --tier: var(--ws-p3); position: relative; width: 60px; height: 66px; display: grid; place-items: center; color: var(--ws-flame); font-size: 1.5rem; }
.ws-badge-hex::before { content: ""; position: absolute; inset: 0; background: var(--tier); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.ws-badge-hex::after { content: ""; position: absolute; inset: 3px; background: radial-gradient(circle at 35% 30%, #3a2416, #150c07); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.ws-badge-hex .wi, .ws-badge-hex img { position: relative; z-index: 1; }
.ws-badge-hex img { width: 40px; height: 40px; }
.ws-badge.is-silver .ws-badge-hex { --tier: var(--ws-p2); }
.ws-badge.is-gold .ws-badge-hex { --tier: var(--ws-p1); }
.ws-badge.is-ember .ws-badge-hex { --tier: var(--ws-fire); filter: drop-shadow(0 0 10px var(--ws-glow)); animation: ws-badge-pulse 2.8s ease-in-out infinite; }
@keyframes ws-badge-pulse { 0%,100% { filter: drop-shadow(0 0 6px var(--ws-glow)); } 50% { filter: drop-shadow(0 0 16px var(--ws-fire)); } }
.ws-badge.is-locked { opacity: 0.3; filter: grayscale(1); }
.ws-badge-name { font-size: 0.72rem; font-weight: 600; color: var(--ws-ink); line-height: 1.25; }
.ws-badge-tier { font-family: var(--ws-mono); font-size: 0.62rem; color: var(--ws-mute); text-transform: uppercase; letter-spacing: 0.1em; }

/* ---------- 13. TABLES ---------- */
.ws-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; min-width: 0; }
.ws-table th { text-align: right; font-size: 0.64rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ws-faint); padding: 0.5rem 0.55rem; border-bottom: 1px solid rgba(255,255,255,0.08); white-space: nowrap; }
.ws-table th:first-child, .ws-table td:first-child { text-align: left; }
.ws-table th.is-sortable { cursor: pointer; user-select: none; }
.ws-table th.is-sortable .wi { opacity: 0.4; font-size: 0.85rem; }
.ws-table th.is-sorted-asc, .ws-table th.is-sorted-desc { color: var(--ws-gold); box-shadow: inset 0 -2px 0 var(--ws-fire); }
.ws-table th.is-sorted-asc .wi, .ws-table th.is-sorted-desc .wi { opacity: 1; }
.ws-table th.is-sorted-asc .wi { transform: rotate(180deg); }
.ws-table td { padding: 0.55rem; border-bottom: 1px solid var(--ws-line-2); text-align: right; font-family: var(--ws-mono); font-variant-numeric: tabular-nums; color: var(--ws-ink); white-space: nowrap; }
.ws-table td:first-child { font-family: var(--ws-body); }
.ws-table tbody tr:hover td { background: rgba(255,106,26,0.05); }
.ws-table tr.is-me td { background: rgba(255,194,74,0.08); }
.ws-table .ws-p-name { display: flex; align-items: center; gap: 0.45rem; font-weight: 600; min-width: 0; }
.ws-table .ws-p-name a { color: var(--ws-ink); text-decoration: none; }
.ws-table .ws-p-name a:hover { color: var(--ws-gold); }
.ws-table .ws-p-rank { font-family: var(--ws-display); font-weight: 700; color: var(--ws-faint); width: 1.6rem; text-align: center; flex: none; }
.ws-table tr:nth-child(1) .ws-p-rank { color: var(--ws-p1); } .ws-table tr:nth-child(2) .ws-p-rank { color: var(--ws-p2); } .ws-table tr:nth-child(3) .ws-p-rank { color: var(--ws-p3); }
.ws-row-meter { height: 3px; border-radius: 2px; background: rgba(255,255,255,0.05); margin-top: 0.3rem; overflow: hidden; }
.ws-row-meter i { display: block; height: 100%; background: var(--ws-grad-fire); width: 0; transition: width 0.8s var(--ws-ease); }
.ws-table td.is-dim { color: var(--ws-faint); }
.ws-table td.is-win { color: var(--ws-win); } .ws-table td.is-loss { color: var(--ws-loss); } .ws-table td.is-quit { color: var(--ws-quit); }
@media (max-width: 767px) {
  .ws-scroll .ws-table th:first-child, .ws-scroll .ws-table td:first-child { position: sticky; left: 0; background: var(--ws-bg-2); z-index: 1; box-shadow: 1px 0 0 var(--ws-line-2); }
}

/* ---------- 14. LEADERBOARD ROWS ---------- */
.ws-ladder { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.ws-rank { display: grid; grid-template-columns: 2.2rem 1fr auto; align-items: center; gap: 0.6rem; padding: 0.55rem 0.65rem; border-radius: 10px; background: rgba(255,255,255,0.02); border: 1px solid transparent; color: inherit; text-decoration: none; transition: all 0.16s ease; }
.ws-rank:hover { border-color: var(--ws-line); background: rgba(255,106,26,0.05); color: inherit; }
.ws-rank-no { font-family: var(--ws-display); font-weight: 700; color: var(--ws-faint); text-align: center; }
.ws-ladder > li:nth-child(1) .ws-rank-no { color: var(--ws-p1); text-shadow: 0 0 10px rgba(255,194,74,0.5); }
.ws-ladder > li:nth-child(2) .ws-rank-no { color: var(--ws-p2); }
.ws-ladder > li:nth-child(3) .ws-rank-no { color: var(--ws-p3); }
.ws-rank-body { display: block; min-width: 0; }
.ws-rank-name { display: flex; font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 0.35rem; }
.ws-rank-name .ws-tag { font-size: 0.58rem; }
.ws-rank-meter { display: block; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.06); margin-top: 0.3rem; overflow: hidden; position: relative; }
.ws-rank-meter i { display: block; height: 100%; border-radius: 2px; background: var(--ws-grad-fire); width: 0; transition: width 0.8s var(--ws-ease); }
.ws-rank-meter .ghost { position: absolute; inset: 0 auto 0 0; background: rgba(255,255,255,0.05); }
.ws-ladder > li:nth-child(1) .ws-rank-meter i { background: var(--ws-grad-fire), var(--ws-grad-fire); background-size: 200% 100%; animation: ws-shimmer-x 3s linear infinite; }
@keyframes ws-shimmer-x { to { background-position: -200% 0; } }
.ws-rank-val { display: block; text-align: right; }
.ws-rank-val b { font-family: var(--ws-mono); font-weight: 400; color: var(--ws-flame); font-size: 0.98rem; }
.ws-rank-val span { display: block; font-size: 0.66rem; color: var(--ws-faint); }
.ws-rank-move { font-family: var(--ws-mono); font-size: 0.66rem; display: inline-flex; align-items: center; gap: 0.1rem; }
.ws-rank-move.is-up { color: var(--ws-up); } .ws-rank-move.is-down { color: var(--ws-down); } .ws-rank-move.is-flat { color: var(--ws-flat); }
.ws-ladder-note { color: var(--ws-faint); font-size: 0.76rem; margin: 0.9rem 0 0; text-align: center; }

/* ---------- 15. DESCENT TIMELINE ---------- */
.ws-descent { position: relative; }
.ws-descent-track { position: relative; height: 52px; border-radius: 8px; background: linear-gradient(90deg, rgba(255,106,26,0.06), rgba(255,59,30,0.06)); border: 1px solid var(--ws-line-2); overflow: hidden; }
.ws-descent-fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, rgba(255,106,26,0.24), rgba(255,106,26,0.06)); width: 0; transition: width 1.2s var(--ws-ease); }
.ws-descent-node { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ws-fire); box-shadow: 0 0 8px var(--ws-fire); opacity: 0.85; transform: scaleY(0); transform-origin: bottom; transition: transform 0.4s var(--ws-ease); transition-delay: var(--d, 0ms); }
.ws-descent-node::after { content: attr(data-stage); position: absolute; top: 4px; left: 5px; font-family: var(--ws-mono); font-size: 0.62rem; color: var(--ws-fire); }
.ws-descent-node.is-wall { background: var(--ws-molten); box-shadow: 0 0 12px var(--ws-molten); animation: ws-wall 2.4s ease-in-out infinite; }
.ws-descent-node.is-wall::after { color: var(--ws-molten); }
.ws-descent-node.is-end { background: var(--ws-gold); box-shadow: 0 0 12px var(--ws-gold); }
.ws-descent-node.is-end::after { content: attr(data-stage); color: var(--ws-gold); }
@keyframes ws-wall { 0%,100% { box-shadow: 0 0 8px var(--ws-molten); } 50% { box-shadow: 0 0 18px var(--ws-molten), 0 0 30px rgba(255,59,30,0.5); } }
.ws-descent.is-in .ws-descent-fill { width: var(--w, 100%); }
.ws-descent.is-in .ws-descent-node { transform: scaleY(1); }
.ws-descent-scale { display: flex; justify-content: space-between; font-family: var(--ws-mono); font-size: 0.66rem; color: var(--ws-faint); margin-top: 0.35rem; }
.ws-descent-legend { font-size: 0.74rem; color: var(--ws-mute); margin-top: 0.5rem; }
.ws-descent-legend b { color: var(--ws-molten); font-family: var(--ws-mono); font-weight: 400; }

/* ---------- 16. CHART FRAME, LEGEND, TOOLTIP ---------- */
.ws-chart { position: relative; width: 100%; min-width: 0; }
.ws-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.ws-chart.is-thin svg { opacity: 0.4; }
.ws-chart .ws-empty.is-compact { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; }
.ws-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin: 0 0 0.6rem; padding: 0; list-style: none; }
.ws-legend li, .ws-legend button { appearance: none; border: 0; background: none; padding: 0; font: inherit; display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.74rem; color: var(--ws-mute); cursor: pointer; }
.ws-legend .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--ws-fire)); flex: none; }
.ws-legend .sw.is-line { width: 14px; height: 3px; border-radius: 2px; }
.ws-legend .is-off { opacity: 0.4; text-decoration: line-through; }
.ws-tip { position: fixed; z-index: 300; pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity 0.12s ease, transform 0.12s ease; background: var(--ws-panel-solid); border: 1px solid var(--ws-line); border-radius: 8px; padding: 0.5rem 0.7rem; font-size: 0.78rem; color: var(--ws-mute); box-shadow: 0 10px 30px rgba(0,0,0,0.5); max-width: 260px; }
.ws-tip.is-on { opacity: 1; transform: none; }
.ws-tip-head { font-family: var(--ws-mono); font-size: 0.7rem; color: var(--ws-faint); margin-bottom: 0.3rem; }
.ws-tip-row { display: flex; align-items: center; gap: 0.45rem; white-space: nowrap; }
.ws-tip-row .sw { width: 12px; height: 3px; border-radius: 2px; background: var(--c, var(--ws-fire)); flex: none; }
.ws-tip-row b { font-family: var(--ws-mono); font-weight: 400; color: var(--ws-ink); }
.ws-heat-scale { display: flex; align-items: center; gap: 0.4rem; font-family: var(--ws-mono); font-size: 0.66rem; color: var(--ws-faint); margin-top: 0.5rem; }
.ws-heat-scale i { flex: 1; max-width: 160px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--ws-s1), var(--ws-s2), var(--ws-s3), var(--ws-s4), var(--ws-s5), var(--ws-s6)); }

/* ---------- 17. EMPTY, SKELETON, SLOT ---------- */
.ws-empty { text-align: center; padding: 2.2rem 1rem; color: var(--ws-mute); }
.ws-empty.is-compact { padding: 1.2rem 1rem; }
.ws-empty-art { color: var(--ws-fire); font-size: 2rem; opacity: 0.75; }
.ws-empty-art img { width: 120px; max-width: 60%; height: auto; opacity: 0.9; }
.ws-empty-title { font-family: var(--ws-display); font-size: 1.05rem; color: var(--ws-ink); margin: 0.5rem 0 0.3rem; }
.ws-empty p { margin: 0; font-size: 0.86rem; max-width: 42ch; margin-inline: auto; }
.ws-empty-cta { display: inline-block; margin-top: 0.7rem; }
.ws-skel { position: relative; overflow: hidden; border-radius: 12px; background: rgba(255,255,255,0.03); }
.ws-skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255,140,60,0.1) 50%, transparent 80%); background-size: 200% 100%; animation: ws-shimmer 1.4s infinite; }
@keyframes ws-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.ws-skel.is-tile { height: 88px; }
.ws-skel.is-row { height: 56px; }
.ws-skel.is-chart { height: 220px; background-image: repeating-linear-gradient(180deg, rgba(255,190,140,0.06) 0 1px, transparent 1px 44px); }
.ws-skel.is-hero-num { height: 48px; width: 120px; border-radius: 6px; }
/* a hero figure skeleton must be as tall as the real figure (icon + number + label) or the hero content jumps when the data lands */
.ws-figure > .ws-skel.is-hero-num { height: calc(clamp(2.2rem, 6vw, 3.4rem) * 1.05 + 3rem); }
.ws-skel.is-text { height: 14px; width: 60%; border-radius: 4px; }
.ws-slot { position: relative; border: 1px dashed rgba(147,112,230,0.45); border-radius: 16px; padding: clamp(1rem, 2.4vw, 1.5rem); background: rgba(147,112,230,0.04); }
.ws-slot > .ws-tag.is-phase2 { position: absolute; top: 0.8rem; right: 0.8rem; }
.ws-slot.is-live { border: 1px solid var(--ws-line); background: var(--ws-panel); }
.ws-slot.is-live > .ws-tag.is-phase2, .ws-slot.is-live > .ws-empty { display: none; }
.ws-slot:not(.is-live) > .ws-slot-body { display: none; }

/* ---------- 18. SHARE, TOAST, MISC ---------- */
.ws-share { display: inline-flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.ws-share small { color: var(--ws-faint); font-size: 0.74rem; }
.ws-toast { position: fixed; left: 50%; bottom: 1.4rem; z-index: 400; transform: translate(-50%, 8px); opacity: 0; padding: 0.55rem 1rem; border-radius: 999px; background: var(--ws-panel-solid); border: 1px solid var(--ws-line); color: var(--ws-ink); font-size: 0.84rem; box-shadow: 0 10px 30px rgba(0,0,0,0.5); transition: opacity 0.2s ease, transform 0.2s ease; pointer-events: none; }
.ws-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.ws-divider { height: 1px; background: linear-gradient(90deg, transparent, var(--ws-line), transparent); margin: 1.2rem 0; }
.ws-pill-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ws-diff-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.5rem; }
.ws-diff-item { padding: 0.55rem 0.7rem; border-radius: 10px; background: rgba(255,255,255,0.03); border: 1px solid var(--ws-line-2); }
.ws-diff-item b { display: block; font-family: var(--ws-mono); font-weight: 400; font-size: 1.1rem; color: var(--ws-flame); }
.ws-diff-item span { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ws-faint); }
.ws-ability { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.6rem 0.3rem 0.4rem; border-radius: 8px; background: rgba(255,255,255,0.04); border: 1px solid var(--ws-line-2); font-size: 0.76rem; color: var(--ws-mute); }
.ws-ability .wi { color: var(--ws-fire); font-size: 1.1rem; }
.ws-ability.is-defensive .wi { color: var(--ws-c2); } .ws-ability.is-utility .wi { color: var(--ws-c4); }
.ws-ability b { font-family: var(--ws-mono); font-weight: 400; color: var(--ws-ink); }

/* ---------- 19. REVEAL ---------- */
.ws-fx [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.52s var(--ws-ease), transform 0.52s var(--ws-ease); transition-delay: var(--rd, 0ms); }
.ws-fx [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- 20. REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  .ws *, .ws *::before, .ws *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .ws-ember { display: none; }
  .ws-hero-art { transform: none; }
  .ws-fx [data-reveal] { opacity: 1; transform: none; }
  .ws-descent .ws-descent-fill { width: var(--w, 100%); }
  .ws-descent .ws-descent-node { transform: scaleY(1); }
  .ws-skel::after { animation: none; background: rgba(255,140,60,0.06); }
}
