/* =====================================================================
   WRAITH HALL OF FIRE - achievements, tier rings, rarity, reveals
   Spec: WRAITH-ACHIEVEMENTS.md 5.3 and WRAITH-DESIGN.md 15.
   Loads after wraith-suite.css on achievements.html, player.html and
   boards.html. Prefix: wh-. Effects script: wraith-hall.js (WraithHall).
   Rule: colour never alone; every ring and frame carries its tier or
   rarity name in text. Reduced motion: every animation off, static frame.
   ===================================================================== */

/* ---------- 1. TIER AND RARITY SCALE (one scale, learnt once) ---------- */
.ws {
  --wh-t0: #3a2e27;   /* Unlit / locked */
  --wh-t1: #8a7f78;   /* I Ash        / C common */
  --wh-t2: #7d8791;   /* II Iron      / U uncommon */
  --wh-t3: #d68a4b;   /* III Bronze   / R rare */
  --wh-t4: #c9d1d9;   /* IV Silver */
  --wh-t5: #ffc24a;   /* V Gold       / E epic */
  --wh-t6: #e4ecf2;   /* VI Platinum */
  --wh-t7: #2aa85a;   /* VII Emerald */
  --wh-t8: #9fe6ff;   /* VIII Diamond */
  --wh-t9: #1a1014;   /* IX Obsidian  / L legendary (band) */
  --wh-t9-crack: #ff3b1e;
  --wh-t10: #ff6a1a;  /* X Wraithfire / M mythic (mid of the fire gradient) */
  --wh-fire: conic-gradient(from 0deg, #ff3b1e, #ff6a1a, #ffc24a, #ff6a1a, #ff3b1e);
  --wh-preview: #9370e6;   /* staff preview only: categorical slot 4, used by nothing else on the hall */
  --wh-stone: #171110;
  --wh-stone-2: #221915;
  --wh-smoke: rgba(150, 170, 190, 0.18);
}
/* tier and rarity tokens on the element: data-tier="0".."10", data-rarity="C|U|R|E|L|M" */
[data-tier="0"], [data-rarity="X"] { --tc: var(--wh-t0); --tc-glow: transparent; }
[data-tier="1"], [data-rarity="C"] { --tc: var(--wh-t1); --tc-glow: rgba(138,127,120,0.25); }
[data-tier="2"], [data-rarity="U"] { --tc: var(--wh-t2); --tc-glow: rgba(125,135,145,0.3); }
[data-tier="3"], [data-rarity="R"] { --tc: var(--wh-t3); --tc-glow: rgba(214,138,75,0.35); }
[data-tier="4"] { --tc: var(--wh-t4); --tc-glow: rgba(201,209,217,0.3); }
[data-tier="5"], [data-rarity="E"] { --tc: var(--wh-t5); --tc-glow: rgba(255,194,74,0.45); }
[data-tier="6"] { --tc: var(--wh-t6); --tc-glow: rgba(228,236,242,0.35); }
[data-tier="7"] { --tc: var(--wh-t7); --tc-glow: rgba(42,168,90,0.4); }
[data-tier="8"] { --tc: var(--wh-t8); --tc-glow: rgba(159,230,255,0.45); }
[data-tier="9"], [data-rarity="L"] { --tc: var(--wh-t9-crack); --tc-band: var(--wh-t9); --tc-glow: rgba(255,59,30,0.45); }
[data-tier="10"], [data-rarity="M"] { --tc: var(--wh-t10); --tc-glow: rgba(255,106,26,0.55); }

/* ---------- 2. TIER RING (.wh-ring) ----------
   <span class="wh-ring" data-tier="7" style="--size:96px"><span class="wh-ring-band"></span>
     <span class="wh-medal"><img src="/images/wraith/badges/i-bd-slayer.webp" alt=""></span></span>
   The band is drawn in CSS so every tier works before the Artist's PNG exists; when
   --ring-img is set (per tier, see 2.1) the PNG paints on top of the CSS band.
   Animations run only with .is-live (wraith-hall.js budgets at most 12 in view). */
.wh-ring { --size: 96px; --band: calc(var(--size) * 0.085); position: relative; display: inline-grid; place-items: center; width: var(--size); height: var(--size); border-radius: 50%; flex: none; isolation: isolate; }
.wh-ring-band { position: absolute; inset: 0; border-radius: 50%; border: var(--band) solid var(--tc); box-sizing: border-box; background: transparent; }
.wh-ring-band::before, .wh-ring-band::after { content: ""; position: absolute; inset: calc(var(--band) * -1); border-radius: 50%; pointer-events: none; }
.wh-ring-art { position: absolute; inset: 0; border-radius: 50%; background: var(--ring-img, none) center / 100% 100% no-repeat; pointer-events: none; }
/* with the Artist's ring file (.has-art, set by wraith-hall.js) the PNG is the band: the CSS band goes transparent and only
   its glows and the ::before / ::after effect overlays (sheen, facet chase, glint, crack pulse) stay, painted on top */
.wh-ring.has-art .wh-ring-band { border-color: transparent; background: none; }
.wh-ring.has-art[data-tier="6"] .wh-ring-band { box-shadow: none; }
.wh-ring.has-art[data-tier="9"] .wh-ring-band { box-shadow: 0 0 calc(var(--size) * 0.1) rgba(255,59,30,0.25); }
.wh-medal { position: absolute; inset: 12%; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #3a2416, #150c07); color: var(--ws-flame); font-size: calc(var(--size) * 0.36); }
.wh-medal img, .wh-medal .wi { width: 100%; height: 100%; display: block; object-fit: cover; }
.wh-medal .wi { width: 55%; height: 55%; }
/* 0 Unlit */
.wh-ring[data-tier="0"] .wh-ring-band { border-style: dashed; border-width: 1.5px; opacity: 0.8; }
.wh-ring[data-tier="0"] .wh-medal { filter: saturate(0.15); opacity: 0.3; }
.wh-ring[data-tier="0"] .wh-lock { position: absolute; z-index: 2; color: var(--wh-t1); font-size: calc(var(--size) * 0.28); }
/* I Ash: flat matte band, nothing else */
.wh-ring[data-tier="1"] .wh-ring-band { border-color: var(--wh-t1); }
/* II Iron: four rivets at the compass points; 1 px rim light follows the pointer on hover (JS sets --mx/--my) */
.wh-ring[data-tier="2"] .wh-ring-band::before { inset: calc(var(--band) * -1); background:
  radial-gradient(circle at 50% calc(var(--band) / 2), #c9d1d9 0 2px, transparent 3px),
  radial-gradient(circle at 50% calc(100% - var(--band) / 2), #c9d1d9 0 2px, transparent 3px),
  radial-gradient(circle at calc(var(--band) / 2) 50%, #c9d1d9 0 2px, transparent 3px),
  radial-gradient(circle at calc(100% - var(--band) / 2) 50%, #c9d1d9 0 2px, transparent 3px); }
.wh-ring[data-tier="2"]:hover .wh-ring-band::after { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35); mask: radial-gradient(60% 60% at calc(var(--mx, 0.5) * 100%) calc(var(--my, 0.2) * 100%), #000, transparent); -webkit-mask: radial-gradient(60% 60% at calc(var(--mx, 0.5) * 100%) calc(var(--my, 0.2) * 100%), #000, transparent); }
/* III Bronze: warm inner glow on hover (always on under reduced motion) */
.wh-ring[data-tier="3"]:hover .wh-medal, .wh-ring[data-tier="3"].is-static .wh-medal { box-shadow: inset 0 0 calc(var(--size) * 0.18) var(--tc-glow); }
/* IV Silver: one cool sheen sweep on reveal and on hover */
.wh-ring[data-tier="4"] .wh-ring-band::after { background: conic-gradient(from 0deg, transparent 0 78%, rgba(255,255,255,0.75) 86%, transparent 94%); mask: radial-gradient(circle, transparent calc(50% - var(--band) - 1px), #000 calc(50% - var(--band)), #000 calc(50% + 1px), transparent calc(50% + 2px)); -webkit-mask: radial-gradient(circle, transparent calc(50% - var(--band) - 1px), #000 calc(50% - var(--band)), #000 calc(50% + 1px), transparent calc(50% + 2px)); opacity: 0; }
.wh-ring[data-tier="4"].is-revealed .wh-ring-band::after, .wh-ring[data-tier="4"]:hover .wh-ring-band::after { animation: wh-sheen 1.1s ease-out 1 forwards; }
/* V Gold: breathing halo */
.wh-ring[data-tier="5"] .wh-ring-band { box-shadow: 0 0 calc(var(--size) * 0.16) var(--tc-glow); }
.wh-ring[data-tier="5"].is-live .wh-ring-band { animation: wh-breathe 4s ease-in-out infinite; }
/* VI Platinum: double band (thin outer, wide inner) with a pale sheen every 6 s */
.wh-ring[data-tier="6"] .wh-ring-band { border-width: calc(var(--band) * 0.8); box-shadow: 0 0 0 2px var(--ws-bg-2), 0 0 0 3.5px var(--wh-t6); }
.wh-ring[data-tier="6"] .wh-ring-band::after { background: conic-gradient(from 0deg, transparent 0 80%, rgba(255,255,255,0.7) 88%, transparent 96%); mask: radial-gradient(circle, transparent calc(50% - var(--band) - 1px), #000 calc(50% - var(--band)), #000 calc(50% + 1px), transparent calc(50% + 2px)); -webkit-mask: radial-gradient(circle, transparent calc(50% - var(--band) - 1px), #000 calc(50% - var(--band)), #000 calc(50% + 1px), transparent calc(50% + 2px)); opacity: 0; }
.wh-ring[data-tier="6"].is-live .wh-ring-band::after { animation: wh-sheen 6s ease-in-out infinite; }
/* VII Emerald: twelve facets that catch light one after another */
.wh-ring[data-tier="7"] .wh-ring-band { border-color: transparent; background: conic-gradient(from 0deg, #2aa85a 0 15deg, #1e7a42 15deg 30deg) border-box; -webkit-mask: radial-gradient(circle, transparent calc(50% - var(--band)), #000 calc(50% - var(--band) + 0.5px)); mask: radial-gradient(circle, transparent calc(50% - var(--band)), #000 calc(50% - var(--band) + 0.5px)); box-shadow: inset 0 0 calc(var(--size) * 0.14) rgba(42,168,90,0.35); }
.wh-ring[data-tier="7"] .wh-ring-band::after { inset: 0; margin: calc(var(--band) * -1); background: conic-gradient(from 0deg, rgba(255,255,255,0.55) 0 15deg, transparent 15deg 360deg); -webkit-mask: radial-gradient(circle, transparent calc(50% - var(--band)), #000 calc(50% - var(--band) + 0.5px)); mask: radial-gradient(circle, transparent calc(50% - var(--band)), #000 calc(50% - var(--band) + 0.5px)); opacity: 0; }
.wh-ring[data-tier="7"].is-live .wh-ring-band::after { opacity: 1; animation: wh-spin 3s steps(12, end) infinite; }
/* VIII Diamond: faceted band, a glint travels the ring every 4 s, star flare at the top */
.wh-ring[data-tier="8"] .wh-ring-band { border-color: transparent; background: conic-gradient(from 0deg, #9fe6ff 0 10deg, #5fb8d8 10deg 20deg) border-box; -webkit-mask: radial-gradient(circle, transparent calc(50% - var(--band)), #000 calc(50% - var(--band) + 0.5px)); mask: radial-gradient(circle, transparent calc(50% - var(--band)), #000 calc(50% - var(--band) + 0.5px)); box-shadow: 0 0 calc(var(--size) * 0.12) var(--tc-glow); }
.wh-ring[data-tier="8"] .wh-ring-band::before { inset: 0; margin: calc(var(--band) * -1); background: conic-gradient(from 0deg, #fff 0 6deg, transparent 8deg 360deg); -webkit-mask: radial-gradient(circle, transparent calc(50% - var(--band)), #000 calc(50% - var(--band) + 0.5px)); mask: radial-gradient(circle, transparent calc(50% - var(--band)), #000 calc(50% - var(--band) + 0.5px)); }
.wh-ring[data-tier="8"].is-live .wh-ring-band::before { animation: wh-spin 4s linear infinite; }
.wh-ring[data-tier="8"] .wh-star { position: absolute; top: calc(var(--band) * -0.6); left: 50%; width: calc(var(--size) * 0.2); height: calc(var(--size) * 0.2); transform: translateX(-50%); background: conic-gradient(from 0deg, transparent 0 20deg, #fff 22deg 23deg, transparent 25deg 110deg, #fff 112deg 113deg, transparent 115deg 200deg, #fff 202deg 203deg, transparent 205deg 290deg, #fff 292deg 293deg, transparent 295deg 360deg); filter: blur(0.3px); opacity: 0.9; pointer-events: none; }
.wh-ring[data-tier="8"].is-live .wh-star { animation: wh-star 4s linear infinite; }
/* IX Obsidian: black glass band, molten cracks pulse, embers rise off the rim */
.wh-ring[data-tier="9"] .wh-ring-band { border-color: var(--wh-t9); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), 0 0 calc(var(--size) * 0.1) rgba(255,59,30,0.25); }
.wh-ring[data-tier="9"] .wh-ring-band::after { inset: 0; margin: calc(var(--band) * -1); background: conic-gradient(from 20deg, transparent 0 40deg, var(--wh-t9-crack) 41deg 43deg, transparent 44deg 120deg, var(--wh-t9-crack) 121deg 122deg, transparent 123deg 210deg, var(--wh-t9-crack) 211deg 214deg, transparent 215deg 300deg, var(--wh-t9-crack) 301deg 302deg, transparent 303deg 360deg); -webkit-mask: radial-gradient(circle, transparent calc(50% - var(--band)), #000 calc(50% - var(--band) + 0.5px)); mask: radial-gradient(circle, transparent calc(50% - var(--band)), #000 calc(50% - var(--band) + 0.5px)); filter: blur(0.4px); }
.wh-ring[data-tier="9"].is-live .wh-ring-band::after { animation: wh-cracks 3s ease-in-out infinite; }
.wh-ring .wh-ember { position: absolute; bottom: 8%; left: 50%; width: 3px; height: 3px; border-radius: 50%; background: var(--ws-fire); box-shadow: 0 0 6px var(--ws-fire); opacity: 0; pointer-events: none; }
.wh-ring.is-live .wh-ember { animation: wh-ember-rise 2.6s linear infinite; }
.wh-ring .wh-ember:nth-child(2) { left: 30%; animation-delay: -0.9s; } .wh-ring .wh-ember:nth-child(3) { left: 68%; animation-delay: -1.7s; }
/* X Wraithfire: fire gradient band plus a living flame ring (SVG turbulence filter injected by wraith-hall.js), medallion emblem burns brighter */
.wh-ring[data-tier="10"] .wh-ring-band { border-color: transparent; background: var(--wh-fire) border-box; -webkit-mask: radial-gradient(circle, transparent calc(50% - var(--band)), #000 calc(50% - var(--band) + 0.5px)); mask: radial-gradient(circle, transparent calc(50% - var(--band)), #000 calc(50% - var(--band) + 0.5px)); box-shadow: 0 0 calc(var(--size) * 0.2) var(--tc-glow); }
.wh-ring[data-tier="10"] .wh-flame { position: absolute; inset: -12%; border-radius: 50%; background: radial-gradient(circle, transparent 38%, rgba(255,106,26,0.55) 44%, rgba(255,59,30,0.35) 52%, transparent 60%); pointer-events: none; opacity: 0.85; }
.wh-ring[data-tier="10"].is-live .wh-flame { filter: url(#wh-flame); animation: wh-flame 1.6s ease-in-out infinite alternate; }
.wh-ring[data-tier="10"] .wh-medal { box-shadow: inset 0 0 calc(var(--size) * 0.22) rgba(255,106,26,0.55); }
.wh-ring[data-tier="10"] .wh-medal img { filter: drop-shadow(0 0 4px var(--ws-fire)) brightness(1.12); }
.wh-ring[data-tier="10"] .wh-shimmer { position: absolute; left: 10%; right: 10%; top: -18%; height: 22%; pointer-events: none; opacity: 0; }
.wh-ring[data-tier="10"].is-live .wh-shimmer { opacity: 1; backdrop-filter: blur(0.6px); animation: wh-shimmer 1.2s ease-in-out infinite alternate; }
/* tier label under a ring: always text beside colour */
.wh-tier { display: inline-flex; align-items: baseline; gap: 0.3rem; font-family: var(--ws-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ws-mute); }
.wh-tier b { font-family: var(--ws-display); font-weight: 700; color: var(--tc, var(--ws-ink)); }
.wh-tier[data-tier="9"] b { color: var(--wh-t9-crack); } .wh-tier[data-tier="10"] b { background: linear-gradient(90deg, #ff3b1e, #ff6a1a, #ffc24a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wh-tier[data-tier="0"] b { color: var(--wh-t1); }
/* ladder strip: ten small rings, current one lit */
.wh-ladder { display: flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; }
.wh-ladder .wh-ring { --size: 22px; --band: 3px; opacity: 0.35; }
.wh-ladder .wh-ring.is-reached { opacity: 1; }
.wh-ladder .wh-ring.is-current { --size: 30px; --band: 4px; opacity: 1; box-shadow: 0 0 12px var(--tc-glow); }
/* next-tier meter under a badge */
.wh-next { display: flex; align-items: center; gap: 0.5rem; font-family: var(--ws-mono); font-size: 0.68rem; color: var(--ws-faint); }
.wh-next .ws-meter { flex: 1; }
.wh-next .ws-meter i { background: linear-gradient(90deg, var(--tc, var(--ws-fire)), var(--ws-flame)); }

/* ---------- 3. ACHIEVEMENT TILE (.wh-tile) rounded square, never a hex ----------
   <a class="wh-tile is-lit" data-rarity="E" href="#id">
     <span class="wh-tile-frame"></span><span class="wh-tile-ico"><svg class="wi"><use href="..#i-sword"/></svg></span>
     <span class="wh-tile-name">Name</span><span class="wh-rarity" data-rarity="E">Epic · 3 %</span></a> */
.wh-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 0.7rem; }
.wh-tile { --tsize: 96px; position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.4rem; padding: 0.6rem 0.4rem 0.7rem; border-radius: 12px; background: rgba(255,255,255,0.02); border: 1px solid var(--ws-line-2); color: inherit; text-decoration: none; text-align: center; min-width: 0; transition: transform 0.16s ease, border-color 0.16s ease; }
a.wh-tile:hover { transform: translateY(-2px); border-color: var(--ws-line); color: inherit; }
.wh-tile-frame { position: relative; width: var(--tsize); height: var(--tsize); border-radius: 16px; border: 2px solid var(--tc, var(--wh-t0)); background: radial-gradient(circle at 35% 30%, #2a1a10, #120a06); display: grid; place-items: center; box-shadow: 0 0 calc(var(--tsize) * 0.14) var(--tc-glow, transparent); flex: none; overflow: hidden; }
.wh-tile-frame::after { content: ""; position: absolute; inset: 0; background: var(--frame-img, none) center / 100% 100% no-repeat; pointer-events: none; }
.wh-tile-frame.has-art { border-color: transparent; }   /* the Artist frame carries the band; the rarity glow and state styles stay */
.wh-tile.is-locked .wh-tile-frame.has-art, .wh-tile.is-hidden .wh-tile-frame.has-art, .wh-tile.is-found .wh-tile-frame.has-art, .wh-tile.is-preview .wh-tile-frame.has-art { --frame-img: none; border-color: #2a201b; }
.wh-tile-ico { position: absolute; color: var(--tc, var(--ws-mute)); font-size: calc(var(--tsize) * 0.44); display: grid; place-items: center; }
.wh-tile[data-rarity="L"] .wh-tile-frame { border-color: var(--wh-t9); box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 0 calc(var(--tsize) * 0.14) var(--tc-glow); background-image: linear-gradient(135deg, transparent 46%, rgba(255,59,30,0.5) 48%, transparent 50%), radial-gradient(circle at 35% 30%, #1d1216, #0d0709); }
.wh-tile[data-rarity="L"] .wh-tile-ico { color: var(--wh-t9-crack); }
.wh-tile[data-rarity="M"] .wh-tile-frame { border-color: transparent; background: linear-gradient(#150c07, #150c07) padding-box, var(--wh-fire) border-box; box-shadow: 0 0 calc(var(--tsize) * 0.2) var(--tc-glow); }
.wh-tile[data-rarity="M"] .wh-tile-ico { color: var(--ws-flame); filter: drop-shadow(0 0 5px var(--ws-fire)); }
.wh-tile-name { font-weight: 600; font-size: 0.78rem; line-height: 1.25; color: var(--ws-ink); text-wrap: balance; }
.wh-tile-sub { font-size: 0.68rem; color: var(--ws-faint); line-height: 1.3; }
.wh-tile-rule { font-size: 0.7rem; color: var(--ws-mute); line-height: 1.35; }
.wh-rarity { display: inline-flex; align-items: center; gap: 0.3rem; font-family: var(--ws-mono); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; padding: 0.15rem 0.5rem; border-radius: 6px; color: var(--ws-ink); background: color-mix(in srgb, var(--tc, var(--wh-t1)) 18%, transparent); border: 1px solid color-mix(in srgb, var(--tc, var(--wh-t1)) 45%, transparent); }
.wh-rarity::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--tc, var(--wh-t1)); flex: none; }
.wh-rarity[data-rarity="M"]::before { background: var(--wh-fire); }
.wh-rarity[data-rarity="L"]::before { background: var(--wh-t9); box-shadow: 0 0 0 1px var(--wh-t9-crack); }
/* locked (visible rule): cold, lock icon, optional progress meter */
.wh-tile.is-locked .wh-tile-frame { border-color: var(--wh-t0); background: radial-gradient(circle at 35% 30%, #1c1512, #0d0908); box-shadow: none; }
.wh-tile.is-locked .wh-tile-ico { color: var(--wh-t0); opacity: 0.7; }
.wh-tile.is-locked .wh-tile-name { color: var(--ws-mute); }
.wh-tile .wh-lock { position: absolute; right: 8%; bottom: 8%; font-size: calc(var(--tsize) * 0.18); color: var(--wh-t1); }
.wh-tile.is-lit .wh-lock, .wh-tile.is-hidden .wh-lock, .wh-tile.is-found .wh-lock { display: none; }
.wh-tile .ws-meter { width: 100%; }
/* hidden, never found by anyone: stone, engraved "?", cold smoke wisp; faint ability silhouette at 8 % when given */
.wh-tile.is-hidden .wh-tile-frame { border-color: #2a201b; background: linear-gradient(160deg, var(--wh-stone-2), var(--wh-stone)); box-shadow: inset 0 1px 0 rgba(255,255,255,0.04); }
.wh-tile.is-hidden .wh-tile-ico { color: var(--wh-t1); opacity: 0.08; }
.wh-tile.is-hidden .wh-q { position: absolute; font-family: var(--ws-display); font-weight: 900; font-size: calc(var(--tsize) * 0.5); color: transparent; -webkit-text-stroke: 1px rgba(138,127,120,0.55); text-shadow: 0 1px 0 rgba(0,0,0,0.6); }
.wh-tile.is-hidden .wh-smoke { position: absolute; inset: 10%; border-radius: 50%; background: radial-gradient(ellipse at 40% 60%, var(--wh-smoke), transparent 60%); filter: blur(5px); opacity: 0.8; }
.wh-tile.is-hidden.is-live .wh-smoke { animation: wh-smoke 8s ease-in-out infinite; }
.wh-tile.is-hidden .wh-tile-name { color: var(--ws-faint); font-weight: 500; }
/* found by someone else, not this player: real name on stone, one ember crack along an edge */
.wh-tile.is-found .wh-tile-frame { border-color: #2a201b; background: linear-gradient(160deg, var(--wh-stone-2), var(--wh-stone)); box-shadow: none; }
.wh-tile.is-found .wh-tile-frame::before { content: ""; position: absolute; left: 12%; right: 30%; bottom: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--ws-fire), var(--ws-molten), transparent); box-shadow: 0 0 8px var(--ws-fire); }
.wh-tile.is-found .wh-tile-ico { color: var(--wh-t1); opacity: 0.55; }
/* unlocked hidden one: lit plus a small secret eye */
.wh-tile .wh-secret { position: absolute; left: 8%; top: 8%; font-size: calc(var(--tsize) * 0.16); color: var(--ws-gold); display: none; }
.wh-tile.is-secret .wh-secret { display: block; }
/* staff preview: violet dashed outline and tag; never confused with a public reveal */
.wh-tile.is-preview .wh-tile-frame { outline: 2px dashed var(--wh-preview); outline-offset: 3px; border-color: #2a201b; background: linear-gradient(160deg, var(--wh-stone-2), var(--wh-stone)); box-shadow: none; }
.wh-tile.is-preview .wh-tile-ico { color: var(--wh-preview); opacity: 0.8; }
.wh-tile .wh-preview-tag { display: none; position: absolute; top: -8px; right: 8px; font-family: var(--ws-mono); font-size: 0.56rem; letter-spacing: 0.14em; text-transform: uppercase; padding: 0.1rem 0.4rem; border-radius: 4px; background: var(--wh-preview); color: #14092a; }
.wh-tile.is-preview .wh-preview-tag { display: inline-block; }
/* first-ever unlock: gold FIRST crest in the corner */
.wh-first { position: absolute; top: 6px; left: -6px; padding: 0.12rem 0.5rem; font-family: var(--ws-display); font-weight: 800; font-size: 0.58rem; letter-spacing: 0.16em; color: #1a0b04; background: linear-gradient(180deg, var(--ws-flame), var(--ws-gold)); border-radius: 4px; transform: rotate(-8deg); box-shadow: 0 0 10px rgba(255,194,74,0.55); display: none; }
.wh-tile.is-first .wh-first, .wh-feed-card.is-first .wh-first { display: inline-block; }
/* met count and date */
.wh-tile-meta { font-family: var(--ws-mono); font-size: 0.62rem; color: var(--ws-faint); }

/* ---------- 4. REVEAL SEQUENCE (classes driven by WraithHall.reveal) ---------- */
.wh-tile.is-shiver { animation: wh-shiver 0.12s linear 1; }
.wh-tile .wh-cracks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; }
.wh-tile .wh-cracks path { fill: none; stroke: var(--tc, var(--ws-fire)); stroke-width: 1.5; stroke-linecap: round; stroke-dasharray: 200; stroke-dashoffset: 200; filter: drop-shadow(0 0 3px var(--tc, var(--ws-fire))); }
.wh-tile.is-cracking .wh-cracks { opacity: 1; }
.wh-tile.is-cracking .wh-cracks path { animation: wh-draw 0.3s ease-out forwards; }
.wh-tile.is-igniting .wh-tile-frame { animation: wh-ignite 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) 1; }
.wh-tile.is-igniting .wh-lock { animation: wh-dissolve 0.45s ease-out forwards; }
.wh-tile .wh-burst { position: absolute; inset: -30%; border-radius: 50%; background: radial-gradient(circle, var(--tc-glow, transparent) 0%, transparent 60%); opacity: 0; pointer-events: none; z-index: -1; }
.wh-tile.is-bursting .wh-burst { animation: wh-burst 0.5s ease-out 1; }
.wh-tile .wh-column { position: absolute; left: 20%; right: 20%; bottom: 30%; height: 220%; background: linear-gradient(0deg, rgba(255,106,26,0.5), rgba(255,59,30,0.25) 40%, transparent 85%); filter: blur(6px); opacity: 0; pointer-events: none; z-index: -1; transform-origin: bottom; }
.wh-tile.is-mythic-reveal .wh-column { animation: wh-column 1.4s ease-out 1; }
.wh-tile .wh-first.is-stamping { display: inline-block; animation: wh-stamp 0.18s ease-out 1; }
.wh-type { display: inline; }
.wh-type span { opacity: 0; animation: wh-letter 0.18s ease-out forwards; animation-delay: calc(var(--i) * 30ms); }
/* page-level moments: legendary vignette, mythic heat shimmer */
.wh-vignette { position: fixed; inset: 0; z-index: 250; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, transparent 55%, rgba(255,59,30,0.35) 85%, rgba(255,106,26,0.55) 100%); }
.wh-vignette.is-on { animation: wh-vignette 1.2s ease-out 1; }
.wh-heat { position: fixed; inset: 0; z-index: 249; pointer-events: none; opacity: 0; backdrop-filter: blur(0.8px) contrast(1.05); }
.wh-heat.is-on { animation: wh-heat 0.9s ease-in-out 1; }
.wh-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 260; pointer-events: none; }
/* badge tier-up: old ring cracks and falls, new ring forms from the centre, tier name split-flap */
.wh-ring.is-tierup-old { animation: wh-ring-fall 0.5s ease-in forwards; }
.wh-ring.is-tierup-new { animation: wh-ring-form 0.6s cubic-bezier(0.16, 1, 0.3, 1) 1; }
.wh-flap { display: inline-block; perspective: 300px; }
.wh-flap b { display: inline-block; transform-origin: 50% 0; }
.wh-flap.is-flipping b { animation: wh-flap 0.15s ease-in-out 1; }

/* ---------- 5. GROUP IDENTITIES (.wh-group[data-group]) ---------- */
.wh-group { position: relative; overflow: hidden; }
.wh-group-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-bottom: 0.9rem; }
.wh-group-head .ws-panel-title .wi { color: var(--ws-fire); }
.wh-motto { font-family: var(--ws-display); font-style: italic; font-weight: 500; font-size: 0.9rem; color: var(--ws-mute); }
.wh-group-meter { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; font-family: var(--ws-mono); font-size: 0.7rem; color: var(--ws-faint); min-width: 160px; }
.wh-group-meter .ws-meter { flex: 1; }
.wh-group-mark { position: absolute; right: 2%; bottom: -6%; width: clamp(140px, 24%, 260px); height: auto; aspect-ratio: 1; color: var(--ws-flame); opacity: 0.05; pointer-events: none; }
.wh-group-mark .wi { width: 100%; height: 100%; }
.wh-group[data-group="firststeps"] .wh-group-ember { position: absolute; left: 12%; bottom: 0; width: 4px; height: 4px; border-radius: 50%; background: var(--ws-fire); box-shadow: 0 0 8px var(--ws-fire); opacity: 0; animation: wh-ember-float 9s linear infinite; }
.wh-group[data-group="slayer"]::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(-28deg, transparent 0 140px, rgba(255,106,26,0.05) 140px 142px, transparent 142px 260px); }
.wh-group[data-group="endurance"]::before { content: ""; position: absolute; top: 0; bottom: 0; right: 1.2rem; width: 1px; background: linear-gradient(180deg, transparent, var(--ws-gold) 50%, transparent); background-size: 100% 200%; opacity: 0.35; animation: wh-sand 12s linear infinite; }
.wh-group[data-group="difficulty"]::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(0deg, rgba(255,59,30,0.09), transparent 60%); }
.wh-group[data-group="oddities"]::before { content: ""; position: absolute; inset: -20%; pointer-events: none; background: radial-gradient(ellipse at 30% 70%, var(--wh-smoke), transparent 50%), radial-gradient(ellipse at 75% 30%, var(--wh-smoke), transparent 45%); filter: blur(18px); opacity: 0.7; animation: wh-smoke 14s ease-in-out infinite; }
.wh-group[data-group="extreme"] { border-color: transparent; background: linear-gradient(var(--ws-panel), var(--ws-panel)) padding-box, conic-gradient(from 30deg, rgba(255,59,30,0.5), rgba(255,255,255,0.06) 20%, rgba(255,59,30,0.6) 45%, rgba(255,255,255,0.06) 70%, rgba(255,59,30,0.5)) border-box; }
.wh-group[data-group="deathbyability"] .wh-ability-ring { position: absolute; right: -6%; top: 50%; width: clamp(180px, 30%, 320px); aspect-ratio: 1; transform: translateY(-50%); opacity: 0.06; pointer-events: none; color: var(--ws-flame); }
.wh-group[data-group="deathbyability"] .wh-ability-ring .wi { position: absolute; left: 50%; top: 50%; width: 11%; height: 11%; transform: translate(-50%, -50%) rotate(var(--a)) translateY(-44%) rotate(calc(var(--a) * -1)); }
.wh-group > * { position: relative; }
.wh-group::before, .wh-group-mark, .wh-ability-ring { z-index: 0; }

/* ---------- 6. WALL OF ALCOVES (.wh-wall), hero signature ---------- */
.wh-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(10px, 1fr)); gap: 3px; max-width: 520px; }
.wh-cell { aspect-ratio: 1; border-radius: 2px; background: var(--wh-stone-2); box-shadow: inset 0 1px 0 rgba(255,255,255,0.04); transition: background 0.4s ease, box-shadow 0.4s ease, transform 0.4s ease; }
.wh-cell.is-lit { background: var(--tc, var(--ws-fire)); box-shadow: 0 0 6px var(--tc-glow, var(--ws-glow)); }
.wh-cell.is-lit[data-rarity="M"] { background: var(--ws-fire); box-shadow: 0 0 8px var(--ws-fire), 0 0 14px var(--ws-molten); }
.wh-cell.is-lit[data-rarity="L"] { background: var(--wh-t9-crack); }
.wh-wall.is-filling .wh-cell.is-lit { animation: wh-cell 0.45s ease-out backwards; animation-delay: calc(var(--i, 0) * 8ms); }
.wh-wall-legend { display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem; margin-top: 0.5rem; font-family: var(--ws-mono); font-size: 0.64rem; color: var(--ws-faint); }
.wh-wall-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; background: var(--tc, var(--wh-stone-2)); vertical-align: -1px; margin-right: 0.3rem; }
.ws-hero .wh-wall { position: absolute; right: 4%; top: 50%; transform: translateY(-50%); width: min(38%, 520px); opacity: 0.9; z-index: 0; mask-image: linear-gradient(90deg, transparent, #000 25%); -webkit-mask-image: linear-gradient(90deg, transparent, #000 25%); }
@media (max-width: 900px) { .ws-hero .wh-wall { position: static; transform: none; width: 100%; max-width: none; margin-top: 1.2rem; mask-image: none; -webkit-mask-image: none; opacity: 1; } }

/* ---------- 7. LIVE FEED (.wh-feed) ---------- */
.wh-feed { display: flex; flex-direction: column; gap: 0.6rem; }
.wh-feed-card { position: relative; display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 0.75rem; padding: 0.7rem 0.9rem; border-radius: 12px; background: var(--ws-panel-2); border: 1px solid var(--ws-line-2); color: inherit; text-decoration: none; min-width: 0; }
a.wh-feed-card:hover { border-color: var(--ws-line); color: inherit; }
.wh-feed-card .wh-tile { --tsize: 44px; padding: 0; border: 0; background: none; gap: 0; }
.wh-feed-card .wh-tile-frame { border-radius: 9px; }
.wh-feed-card .wh-tile .wh-rarity, .wh-feed-card .wh-tile .wh-first, .wh-feed-card .wh-tile .wh-tile-name, .wh-feed-card .wh-tile .wh-tile-rule, .wh-feed-card .wh-tile .wh-tile-sub, .wh-feed-card .wh-tile .wh-tile-meta, .wh-feed-card .wh-tile .ws-meter { display: none; }
.wh-feed-body { display: block; min-width: 0; }
.wh-feed-line { display: block; font-size: 0.88rem; color: var(--ws-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wh-feed-line b { font-weight: 700; }
.wh-feed-line em { font-style: normal; color: var(--ws-gold); }
.wh-feed-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.7rem; margin-top: 0.25rem; font-size: 0.7rem; color: var(--ws-faint); }
.wh-feed-when { font-family: var(--ws-mono); font-size: 0.7rem; color: var(--ws-faint); white-space: nowrap; }
.wh-feed-card.is-legendary, .wh-feed-card.is-mythic { grid-template-columns: auto auto 1fr auto; padding: 0.9rem 1rem; border-color: rgba(255,194,74,0.45); box-shadow: 0 0 0 1px rgba(255,194,74,0.15), 0 8px 26px rgba(0,0,0,0.35); }
.wh-feed-card.is-legendary .wh-tile, .wh-feed-card.is-mythic .wh-tile { --tsize: 72px; }
.wh-feed-card.is-mythic { border-color: transparent; background: linear-gradient(var(--ws-panel-solid), var(--ws-panel-solid)) padding-box, var(--wh-fire) border-box; }
.wh-feed-card.is-new { animation: wh-slide-in 0.5s var(--ws-ease) 1; }
.wh-feed-card .wh-first { top: -6px; left: -10px; }
@media (max-width: 560px) { .wh-feed-card { grid-template-columns: auto 1fr; } .wh-feed-card .wh-tile { display: none; } .wh-feed-when { grid-column: 2; } }

/* ---------- 8. RAREST FLAMES (.wh-rarest) sized by rarity ---------- */
.wh-rarest { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 1rem 1.2rem; }
.wh-rarest .wh-tile { --tsize: calc(64px * var(--scale, 1)); background: none; border: 0; padding: 0; }
.wh-rarest [data-rarity="M"] { --scale: 1.6; } .wh-rarest [data-rarity="L"] { --scale: 1.35; } .wh-rarest [data-rarity="E"] { --scale: 1.15; }
.wh-holders { display: flex; justify-content: center; margin-top: 0.3rem; }
.wh-holders .ws-avatar { --av: 22px; box-shadow: 0 0 0 1.5px var(--ws-bg-2); margin-left: -6px; }
.wh-holders .ws-avatar:first-child { margin-left: 0; }

/* ---------- 9. COMPLETION AND CREST ROW ---------- */
.wh-crest { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; }
.wh-crest .wh-ring { --size: 40px; --band: 4px; }
.wh-crest-fig { font-family: var(--ws-mono); font-size: 0.86rem; color: var(--ws-ink); }
.wh-crest-fig span { color: var(--ws-faint); font-size: 0.72rem; margin-left: 0.25rem; }
.wh-ringmeter { --p: 0; width: 34px; height: 34px; border-radius: 50%; background: conic-gradient(var(--ws-gold) calc(var(--p) * 1%), rgba(255,255,255,0.06) 0); display: grid; place-items: center; flex: none; }
.wh-ringmeter::after { content: ""; width: 24px; height: 24px; border-radius: 50%; background: var(--ws-bg-2); }
.wh-pips { display: inline-flex; gap: 3px; }
.wh-pips i { width: 8px; height: 8px; border-radius: 2px; background: var(--tc, var(--wh-t1)); }
.wh-pips i[data-rarity="M"] { background: var(--wh-fire); }

/* ---------- 9b. HIDDEN ATTRIBUTE ---------- */
/* component display rules above are more specific than the UA [hidden] rule; keep the attribute authoritative */
.wh-tile[hidden], .wh-group[hidden], .wh-feed-card[hidden], .wh-ring[hidden], .wh-wall[hidden], .wh-feed[hidden], .wh-rarest[hidden], .wh-tiles[hidden], .wh-crest[hidden], .wh-rarity[hidden], .wh-first[hidden], .wh-tier[hidden] { display: none !important; }

/* ---------- 10. KEYFRAMES ---------- */
@keyframes wh-sheen { from { opacity: 1; transform: rotate(0); } to { opacity: 0; transform: rotate(360deg); } }
@keyframes wh-breathe { 0%, 100% { box-shadow: 0 0 calc(var(--size) * 0.16) rgba(255,194,74,0.45); } 50% { box-shadow: 0 0 calc(var(--size) * 0.22) rgba(255,194,74,0.7); } }
@keyframes wh-spin { to { transform: rotate(360deg); } }
@keyframes wh-star { 0%, 88%, 100% { opacity: 0; transform: translateX(-50%) scale(0.6); } 94% { opacity: 1; transform: translateX(-50%) scale(1.1); } }
@keyframes wh-cracks { 0%, 100% { filter: blur(0.4px) brightness(1); } 50% { filter: blur(0.6px) brightness(1.6) hue-rotate(25deg); } }
@keyframes wh-ember-rise { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(6px, calc(var(--size) * -0.9)); opacity: 0; } }
@keyframes wh-flame { from { transform: scale(1) rotate(0); opacity: 0.75; } to { transform: scale(1.06) rotate(3deg); opacity: 1; } }
@keyframes wh-shimmer { from { transform: translateY(0) skewX(-4deg); } to { transform: translateY(-3px) skewX(4deg); } }
@keyframes wh-shiver { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }
@keyframes wh-draw { to { stroke-dashoffset: 0; } }
@keyframes wh-ignite { 0% { transform: scale(0.9); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes wh-dissolve { to { transform: translateY(-18px); opacity: 0; filter: blur(2px); } }
@keyframes wh-burst { 0% { opacity: 0; transform: scale(0.6); } 40% { opacity: 1; } 100% { opacity: 0; transform: scale(1.4); } }
@keyframes wh-column { 0% { opacity: 0; transform: scaleY(0.2); } 30% { opacity: 1; } 100% { opacity: 0; transform: scaleY(1.1) translateY(-20px); } }
@keyframes wh-stamp { from { transform: rotate(-8deg) scale(1.4); opacity: 0; } to { transform: rotate(-8deg) scale(1); opacity: 1; } }
@keyframes wh-letter { to { opacity: 1; } }
@keyframes wh-vignette { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }
@keyframes wh-heat { 0% { opacity: 0; } 40% { opacity: 1; } 100% { opacity: 0; } }
@keyframes wh-ring-fall { to { transform: translateY(12px) rotate(6deg) scale(0.9); opacity: 0; filter: blur(2px); } }
@keyframes wh-ring-form { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes wh-flap { 0% { transform: rotateX(0); } 50% { transform: rotateX(-90deg); } 100% { transform: rotateX(0); } }
@keyframes wh-smoke { 0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.6; } 50% { transform: translate(6%, -8%) scale(1.15); opacity: 0.9; } }
@keyframes wh-ember-float { 0% { transform: translateY(0); opacity: 0; } 10% { opacity: 1; } 100% { transform: translateY(-140px) translateX(20px); opacity: 0; } }
@keyframes wh-sand { to { background-position: 0 -200%; } }
@keyframes wh-cell { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes wh-slide-in { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 11. REDUCED MOTION: every ring static, reveal is a cross-fade ---------- */
@media (prefers-reduced-motion: reduce) {
  .wh-ring *, .wh-ring *::before, .wh-ring *::after, .wh-tile *, .wh-tile *::before, .wh-tile *::after, .wh-group::before, .wh-group *, .wh-cell, .wh-feed-card, .wh-vignette, .wh-heat { animation: none !important; transition: none !important; }
  .wh-ring[data-tier="3"] .wh-medal { box-shadow: inset 0 0 calc(var(--size) * 0.18) var(--tc-glow); }
  .wh-ring[data-tier="4"] .wh-ring-band::after, .wh-ring[data-tier="6"] .wh-ring-band::after { opacity: 0.35; }
  .wh-ring[data-tier="5"] .wh-ring-band { box-shadow: 0 0 calc(var(--size) * 0.16) rgba(255,194,74,0.55); }
  .wh-ring[data-tier="7"] .wh-ring-band::after { opacity: 0.6; }
  .wh-ring[data-tier="8"] .wh-star { opacity: 0.9; transform: translateX(-50%) scale(1); }
  .wh-ring[data-tier="10"] .wh-flame { filter: none; }
  .wh-ring[data-tier="10"] .wh-shimmer, .wh-ring .wh-ember, .wh-vignette, .wh-heat, .wh-canvas, .wh-group-ember { display: none !important; }
  .wh-tile.is-revealing { transition: opacity 0.2s ease !important; }
  .wh-type span { opacity: 1; }
}
