/* Altarium — World of Warcraft inspired theme */

:root {
  --bg: #0a0806;
  --bg-raised: #15110c;
  --panel-top: #1d1711;
  --panel-bottom: #100c08;
  --gold: #ffd100;
  --gold-warm: #f0c060;
  --gold-soft: #c9a45c;
  --gold-dim: #7a5c2e;
  --gold-deep: #4a3519;
  --text: #ece0c4;
  --text-muted: #a3957a;
  --text-faint: #6f6450;
  --red: #b3261e;
  --red-deep: #4d0b07;
  --green: #1eff00;
  --alliance: #3e74d8;
  --horde: #c4231c;
  --tooltip-bg: rgba(6, 9, 26, 0.97);
  --tooltip-border: #6b7192;

  --q-poor: #9d9d9d;
  --q-common: #ffffff;
  --q-uncommon: #1eff00;
  --q-rare: #0070dd;
  --q-epic: #a335ee;
  --q-legendary: #ff8000;
  --q-artifact: #e6cc80;
  --q-heirloom: #00ccff;

  --font-display: 'Cinzel', 'Times New Roman', serif;
  --font-body: 'Alegreya Sans', 'Segoe UI', sans-serif;
  --radius: 4px;
  --gutter: 16px;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(240, 150, 40, 0.16), transparent 70%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(120, 30, 10, 0.18), transparent 70%),
    radial-gradient(ellipse 60% 40% at 0% 100%, rgba(30, 50, 110, 0.14), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-attachment: fixed;
  overflow-x: hidden;
}

a { color: var(--gold-warm); text-decoration: none; }
a:hover { color: var(--gold); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0;
  color: var(--gold);
  text-shadow: 0 1px 0 #000, 0 0 18px rgba(255, 180, 40, 0.18);
}

.hidden { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---- Header ------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, rgba(20, 15, 10, 0.97), rgba(12, 9, 6, 0.92));
  border-bottom: 1px solid var(--gold-dim);
  box-shadow: 0 1px 0 #000, 0 6px 24px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
}

.site-header::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-deep) 20%, var(--gold-soft) 50%, var(--gold-deep) 80%, transparent);
  opacity: 0.6;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(255, 190, 60, 0.35);
}
.brand img { width: 34px; height: 34px; }

.user-box { display: flex; align-items: center; gap: 12px; font-size: 0.95rem; }
.user-box .battletag { color: #8cc8ff; font-weight: 500; }
.user-box form { margin: 0; }

/* ---- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gold);
  background: linear-gradient(180deg, #9b2016 0%, #6e120b 45%, var(--red-deep) 100%);
  border: 1px solid var(--gold-soft);
  border-radius: var(--radius);
  padding: 10px 22px;
  cursor: pointer;
  text-shadow: 0 1px 1px #000;
  box-shadow:
    inset 0 1px 0 rgba(255, 220, 160, 0.35),
    inset 0 -2px 6px rgba(0, 0, 0, 0.5),
    0 0 0 1px #000,
    0 4px 14px rgba(0, 0, 0, 0.6);
  transition: filter 0.15s, transform 0.15s, box-shadow 0.15s;
}
.btn:hover {
  color: #fff3a0;
  filter: brightness(1.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 220, 160, 0.45),
    inset 0 -2px 6px rgba(0, 0, 0, 0.5),
    0 0 0 1px #000,
    0 0 18px rgba(255, 140, 40, 0.35);
}
.btn:active { transform: translateY(1px); filter: brightness(0.95); }

.btn-lg { font-size: 1.15rem; padding: 14px 34px; }

.btn-ghost {
  background: linear-gradient(180deg, #2a2117, #17120c);
  color: var(--gold-warm);
  border-color: var(--gold-dim);
  padding: 6px 14px;
  font-size: 0.85rem;
}

/* ---- Frames ------------------------------------------------------------- */

.frame {
  position: relative;
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom));
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.8),
    inset 0 0 0 3px rgba(122, 92, 46, 0.18),
    inset 0 0 40px rgba(0, 0, 0, 0.55),
    0 10px 30px rgba(0, 0, 0, 0.55);
}

/* Diamond rivets on the top corners */
.frame::before,
.frame::after {
  content: '';
  position: absolute;
  top: -5px;
  width: 9px;
  height: 9px;
  background: linear-gradient(135deg, #ffe08a, var(--gold-dim));
  border: 1px solid #000;
  transform: rotate(45deg);
  pointer-events: none;
}
.frame::before { left: -5px; }
.frame::after { right: -5px; }

.frame-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 20px 12px;
  border-bottom: 1px solid rgba(122, 92, 46, 0.5);
  background: linear-gradient(180deg, rgba(255, 200, 100, 0.06), transparent);
}
.frame-title h2 { font-size: 1.15rem; }
.frame-body { padding: 18px 20px 20px; }

.divider {
  height: 14px;
  margin: 8px auto;
  max-width: 420px;
  background:
    linear-gradient(90deg, transparent, var(--gold-dim) 30%, var(--gold-soft) 50%, var(--gold-dim) 70%, transparent) center / 100% 1px no-repeat;
  position: relative;
}
.divider::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 8px; height: 8px;
  background: var(--gold-soft);
  transform: translate(-50%, -50%) rotate(45deg);
  box-shadow: 0 0 10px rgba(255, 200, 80, 0.6);
}

/* ---- Layout ------------------------------------------------------------- */

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px var(--gutter) 64px;
}

.site-footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-faint);
  padding: 24px var(--gutter) 32px;
}

/* ---- Landing ------------------------------------------------------------ */

.landing {
  min-height: calc(100vh - 160px);
  display: grid;
  place-items: center;
  text-align: center;
  position: relative;
}

.landing-inner { max-width: 640px; position: relative; z-index: 1; }

.emblem {
  width: 132px;
  height: 132px;
  margin: 0 auto 18px;
  filter: drop-shadow(0 0 24px rgba(255, 150, 40, 0.45));
  animation: pulse 4s ease-in-out infinite;
}

.landing h1 {
  font-size: clamp(2.6rem, 9vw, 4.8rem);
  letter-spacing: 0.22em;
  margin-right: -0.22em;
  background: linear-gradient(180deg, #fff6c8 0%, var(--gold) 45%, #b06a10 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 2px 0 #000) drop-shadow(0 0 22px rgba(255, 170, 40, 0.3));
}

.tagline {
  font-family: var(--font-display);
  color: var(--gold-soft);
  letter-spacing: 0.12em;
  font-size: 1.05rem;
  margin: 6px 0 4px;
}

.landing p.lead { color: var(--text-muted); margin: 18px auto 30px; max-width: 520px; }

.feature-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 46px;
}
.feature {
  padding: 16px 12px;
  font-size: 0.92rem;
  color: var(--text-muted);
}
.feature strong {
  display: block;
  font-family: var(--font-display);
  color: var(--gold-warm);
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.alert {
  margin: 0 auto 22px;
  max-width: 520px;
  padding: 10px 14px;
  border: 1px solid #7a2a1e;
  background: rgba(90, 15, 8, 0.45);
  color: #ffb8a8;
  border-radius: var(--radius);
  font-size: 0.95rem;
}
.notice {
  margin: 0 0 18px;
  padding: 8px 14px;
  border-left: 3px solid var(--gold-dim);
  background: rgba(255, 200, 100, 0.05);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Embers */
.embers { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.embers span {
  position: absolute;
  bottom: -10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffb347;
  box-shadow: 0 0 8px 2px rgba(255, 140, 30, 0.8);
  opacity: 0;
  animation: rise linear infinite;
}

@keyframes rise {
  0% { transform: translate(0, 0) scale(1); opacity: 0; }
  10% { opacity: 0.9; }
  100% { transform: translate(var(--drift, 40px), -105vh) scale(0.3); opacity: 0; }
}
@keyframes pulse {
  0%, 100% { filter: drop-shadow(0 0 18px rgba(255, 150, 40, 0.35)); }
  50% { filter: drop-shadow(0 0 32px rgba(255, 170, 60, 0.6)); }
}

/* ---- Roster ------------------------------------------------------------- */

.roster-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.roster-head h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.roster-head .sub { color: var(--text-muted); margin-top: 2px; }

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
  padding: 0 4px;
  margin-bottom: -1px;
  position: relative;
  z-index: 1;
}

.tab {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  background: linear-gradient(180deg, #1b150e, #0f0b07);
  border: 1px solid var(--gold-deep);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 10px 16px 9px;
  cursor: pointer;
  text-align: left;
  line-height: 1.2;
}
.tab small {
  display: block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0;
  color: var(--text-faint);
}
.tab .count {
  display: inline-block;
  min-width: 22px;
  margin-left: 8px;
  padding: 0 6px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--gold-deep);
  font-size: 0.75rem;
  text-align: center;
  color: var(--gold-soft);
}
.tab:hover { color: var(--text); }
.tab[aria-selected='true'] {
  color: var(--gold);
  background: linear-gradient(180deg, #2c2215, var(--panel-top));
  border-color: var(--gold-dim);
  box-shadow: inset 0 2px 0 rgba(255, 210, 120, 0.25);
}
.tab.empty { opacity: 0.45; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font: inherit;
  font-size: 0.85rem;
  padding: 4px 12px;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--gold-deep);
  border-radius: 999px;
  cursor: pointer;
}
.chip[aria-pressed='true'] { color: var(--gold); border-color: var(--gold-soft); background: rgba(255, 200, 80, 0.08); }

.field {
  font: inherit;
  font-size: 0.92rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--gold-deep);
  border-radius: var(--radius);
  padding: 6px 10px;
  min-width: 0;
}
.field:focus { border-color: var(--gold-soft); outline: none; }
select.field { cursor: pointer; }
.toolbar .search { flex: 1 1 200px; max-width: 280px; }
.frame-title .toolbar { width: 100%; }
.toolbar-right { display: flex; gap: 6px; flex: 1 1 260px; justify-content: flex-end; max-width: 400px; }
.toolbar-right .search { max-width: none; }

.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.char-card {
  --cc: var(--gold-soft);
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px 12px 12px;
  color: var(--text);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--cc) 14%, transparent), transparent 55%),
    linear-gradient(180deg, #1a140e, #0e0a07);
  border: 1px solid var(--gold-deep);
  border-left: 3px solid var(--cc);
  border-radius: var(--radius);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5), 0 4px 14px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  overflow: hidden;
}
.char-card:hover {
  color: var(--text);
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--cc) 60%, var(--gold-deep));
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5), 0 6px 22px rgba(0, 0, 0, 0.6), 0 0 18px color-mix(in srgb, var(--cc) 30%, transparent);
}

.avatar {
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid var(--cc);
  box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--gold-dim), 0 0 14px color-mix(in srgb, var(--cc) 40%, transparent);
  background: radial-gradient(circle at 50% 35%, #3a2d1d, #0b0805);
  overflow: hidden;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--cc);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.char-info { min-width: 0; flex: 1; }
.char-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--cc);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 0 #000;
}
.char-line { font-size: 0.88rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.char-line .lvl { color: var(--gold-warm); font-weight: 500; }

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 6px;
  border-radius: 3px;
  border: 1px solid var(--gold-deep);
  color: var(--gold-soft);
  background: rgba(0, 0, 0, 0.45);
  vertical-align: 1px;
}

.faction-mark {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  border: 1px solid #000;
}
.faction-mark.ALLIANCE { background: var(--alliance); box-shadow: 0 0 8px var(--alliance); }
.faction-mark.HORDE { background: var(--horde); box-shadow: 0 0 8px var(--horde); }
.faction-mark.NEUTRAL { background: #888; }

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 42px 16px;
}
.empty-state h3 { font-size: 1.1rem; margin-bottom: 6px; }

/* ---- Loading ------------------------------------------------------------ */

.loading {
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 80px 16px;
  color: var(--text-muted);
  font-family: var(--font-display);
  letter-spacing: 0.08em;
}
.rune-spinner {
  width: 54px;
  height: 54px;
  border: 2px solid var(--gold-deep);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1.1s linear infinite;
  box-shadow: 0 0 20px rgba(255, 180, 60, 0.25);
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, #17120c 25%, #251c12 50%, #17120c 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---- Character hero ----------------------------------------------------- */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.hero {
  --cc: var(--gold-soft);
  overflow: hidden;
  min-height: 300px;
  display: flex;
  align-items: flex-end;
}
.hero::before, .hero::after { z-index: 3; }

.hero-render {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: 78% 18%;
  background-size: cover;
  opacity: 0.85;
  z-index: 0;
}
.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 8, 6, 0.96) 0%, rgba(10, 8, 6, 0.75) 45%, rgba(10, 8, 6, 0.1) 80%),
    linear-gradient(0deg, rgba(10, 8, 6, 0.95), transparent 55%),
    radial-gradient(ellipse at 75% 40%, color-mix(in srgb, var(--cc) 18%, transparent), transparent 60%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 28px 28px 24px;
  width: 100%;
}
.hero-title { color: var(--text-muted); font-style: italic; font-size: 1rem; }
.hero h1 {
  font-size: clamp(2rem, 6vw, 3.4rem);
  color: var(--cc);
  text-shadow: 0 2px 0 #000, 0 0 30px color-mix(in srgb, var(--cc) 35%, transparent);
  line-height: 1.1;
}
.hero-guild { color: var(--green); font-size: 1.05rem; margin-top: 2px; }
.hero-line { font-size: 1.08rem; margin-top: 6px; }
.hero-line .cls { color: var(--cc); font-weight: 500; }
.hero-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; color: var(--text-muted); font-size: 0.9rem; }

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}
.stat {
  min-width: 128px;
  padding: 8px 16px 9px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--gold-deep);
  border-radius: var(--radius);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.6);
}
.stat .value {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.2;
}
.stat .label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); }

.sections { display: grid; gap: 26px; margin-top: 26px; }

.unavailable { color: var(--text-faint); font-style: italic; }

/* ---- Equipment ---------------------------------------------------------- */

.paperdoll {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas: 'left right' 'bottom bottom';
  gap: 10px 32px;
  max-width: 860px;
  margin: 0 auto;
}
.paperdoll.has-render {
  grid-template-columns: 1fr minmax(200px, 340px) 1fr;
  grid-template-areas: 'left center right' 'bottom bottom bottom';
  max-width: none;
}
.pd-left { grid-area: left; }
.pd-right { grid-area: right; }
.pd-center {
  grid-area: center;
  position: relative;
  min-height: 420px;
  background: radial-gradient(ellipse at 50% 55%, color-mix(in srgb, var(--cc) 18%, transparent), transparent 65%);
}
.pd-center img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 25%;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.8));
}
.pd-bottom {
  grid-area: bottom;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 24px;
  padding-top: 8px;
  border-top: 1px solid rgba(122, 92, 46, 0.3);
}
.pd-left, .pd-right { display: grid; gap: 8px; align-content: start; }

.slot {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 2px;
  border-radius: var(--radius);
  cursor: default;
}
.slot:hover, .slot:focus-visible { background: rgba(255, 210, 120, 0.06); }
.pd-right .slot { flex-direction: row-reverse; text-align: right; }

.icon {
  --qc: var(--q-common);
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 5px;
  border: 2px solid var(--qc);
  box-shadow: 0 0 0 1px #000, inset 0 0 8px rgba(0, 0, 0, 0.8), 0 0 10px color-mix(in srgb, var(--qc) 35%, transparent);
  background: #0b0906;
  overflow: hidden;
}
.icon img { width: 100%; height: 100%; display: block; }
.icon.empty {
  border-color: #2b2219;
  box-shadow: 0 0 0 1px #000, inset 0 0 12px rgba(0, 0, 0, 0.9);
  background: radial-gradient(circle, #1b150f, #0a0806);
}

.slot-text { min-width: 0; }
.slot-name {
  font-weight: 500;
  font-size: 0.92rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 0 #000;
}
.slot-sub { font-size: 0.78rem; color: var(--text-faint); }
.slot-sub .ilvl { color: var(--gold-warm); }

.q-POOR { --qc: var(--q-poor); color: var(--q-poor); }
.q-COMMON { --qc: var(--q-common); color: var(--q-common); }
.q-UNCOMMON { --qc: var(--q-uncommon); color: var(--q-uncommon); }
.q-RARE { --qc: var(--q-rare); color: #2a8cff; }
.q-EPIC { --qc: var(--q-epic); color: #b964ff; }
.q-LEGENDARY { --qc: var(--q-legendary); color: var(--q-legendary); }
.q-ARTIFACT { --qc: var(--q-artifact); color: var(--q-artifact); }
.q-HEIRLOOM { --qc: var(--q-heirloom); color: var(--q-heirloom); }

/* ---- Tooltip ------------------------------------------------------------ */

.tooltip {
  position: fixed;
  z-index: 100;
  max-width: 340px;
  padding: 9px 12px 10px;
  background: var(--tooltip-bg);
  border: 1px solid var(--tooltip-border);
  border-radius: 5px;
  box-shadow: 0 0 0 1px #000, inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 10px 30px rgba(0, 0, 0, 0.75);
  font-size: 0.88rem;
  line-height: 1.38;
  pointer-events: none;
}
.tooltip .tt-name { font-size: 1rem; font-weight: 500; margin-bottom: 2px; }
.tooltip .tt-line { display: flex; justify-content: space-between; gap: 16px; color: #fff; }
.tooltip .tt-line.gap { margin-top: 8px; }
.tooltip .tt-line.indent { padding-left: 10px; }
.tooltip .tone-gold { color: var(--gold); }
.tooltip .tone-green { color: var(--green); }
.tooltip .tone-muted { color: #808080; }
.tooltip .tone-socket { color: #c8c8c8; }
.tooltip .tone-set-on { color: #fff6b0; }
.tooltip .tone-flavor { color: var(--gold); font-style: italic; margin-top: 4px; }

/* ---- Progress bars ------------------------------------------------------ */

.bar {
  position: relative;
  height: 16px;
  background: #090705;
  border: 1px solid #2d2318;
  border-radius: 3px;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}
.bar > span {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--pct, 0%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--bc, #c08a24) 100%, #fff 25%), var(--bc, #c08a24) 50%, color-mix(in srgb, var(--bc, #c08a24) 70%, #000));
  box-shadow: 0 0 10px color-mix(in srgb, var(--bc, #c08a24) 45%, transparent);
}
.bar > em {
  position: relative;
  display: block;
  font-style: normal;
  font-size: 0.72rem;
  line-height: 14px;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 1px #000, 0 0 2px #000;
}

/* ---- Raids -------------------------------------------------------------- */

details.expansion { border-top: 1px solid rgba(122, 92, 46, 0.3); }
details.expansion:first-child { border-top: none; }
details.expansion > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 2px;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold-warm);
}
details.expansion > summary::-webkit-details-marker { display: none; }
details.expansion > summary::before {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--gold-soft);
  border-bottom: 2px solid var(--gold-soft);
  transform: rotate(-45deg);
  transition: transform 0.15s;
  margin-right: 6px;
  flex: 0 0 auto;
}
details.expansion[open] > summary::before { transform: rotate(45deg); }
details.expansion > summary .name { flex: 1; }
details.expansion > summary .meta { font-family: var(--font-body); font-weight: 400; font-size: 0.85rem; color: var(--text-faint); }

.raid {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) 3fr;
  gap: 8px 16px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px dashed rgba(122, 92, 46, 0.2);
}
.raid-name { font-weight: 500; }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.mode { font-size: 0.78rem; color: var(--text-muted); cursor: default; }
.mode .lbl { display: flex; justify-content: space-between; margin-bottom: 2px; }
.mode .lbl b { color: var(--text); font-weight: 500; }
.mode.done .lbl b { color: var(--gold); }

.d-MYTHIC { --bc: #e07b16; }
.d-LEGACY_10_MAN, .d-LEGACY_25_MAN { --bc: #2f78c4; }
.d-LEGACY_10_MAN_HEROIC, .d-LEGACY_25_MAN_HEROIC { --bc: #8e3fd0; }

/* ---- Achievements ------------------------------------------------------- */

.ach-top { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; margin-bottom: 18px; }
.medallion {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  background: radial-gradient(circle at 50% 35%, #3c2c14, #120d07 70%);
  border: 2px solid var(--gold-soft);
  box-shadow: 0 0 0 4px #000, 0 0 0 5px var(--gold-dim), 0 0 30px rgba(255, 180, 40, 0.25), inset 0 0 20px rgba(0, 0, 0, 0.8);
}
.medallion b { display: block; font-family: var(--font-display); font-size: 1.6rem; color: var(--gold); line-height: 1; }
.medallion span { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.cat {
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid #2d2318;
  border-radius: var(--radius);
}
.cat .n { font-weight: 500; }
.cat .v { font-size: 0.85rem; color: var(--text-muted); }
.cat .v b { color: var(--gold-warm); font-weight: 500; }

.recent { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.recent li { display: flex; justify-content: space-between; gap: 12px; font-size: 0.92rem; padding: 4px 0; border-bottom: 1px dashed rgba(122, 92, 46, 0.2); }
.recent li span { color: var(--text-faint); font-size: 0.82rem; white-space: nowrap; }

.subhead {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--gold-warm);
  margin: 22px 0 10px;
  letter-spacing: 0.05em;
}
.subhead:first-child { margin-top: 0; }

/* ---- Professions -------------------------------------------------------- */

.prof-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.prof {
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid #2d2318;
  border-radius: var(--radius);
}
.prof h3 { font-size: 1rem; margin-bottom: 8px; }
.tier { font-size: 0.82rem; color: var(--text-muted); margin-top: 6px; }
.tier .bar { margin-top: 2px; --bc: #3a8c2a; }

/* ---- Reputations -------------------------------------------------------- */

.rep-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px 22px; }
.rep { font-size: 0.88rem; }
.rep .top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 2px; }
.rep .top span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep .top span:last-child { color: var(--text-muted); white-space: nowrap; }
.rep .bar { height: 14px; }
.rep .bar > em { line-height: 12px; font-size: 0.68rem; }

.s-hated { --bc: #a3150c; }
.s-hostile { --bc: #c6280d; }
.s-unfriendly { --bc: #d06a12; }
.s-neutral { --bc: #c6b017; }
.s-friendly { --bc: #2e9b1c; }
.s-honored { --bc: #1fa35c; }
.s-revered { --bc: #12a58c; }
.s-exalted { --bc: #13a6b0; }
.s-other { --bc: #2f78c4; }

.show-more { margin-top: 14px; text-align: center; }

/* ---- Utilities ---------------------------------------------------------- */

.muted { color: var(--text-faint); }
.btn.disabled { opacity: 0.45; pointer-events: none; filter: grayscale(0.4); }
.dot-key {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: 1px;
  background: var(--cc, var(--gold-soft));
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.6);
  flex: 0 0 auto;
}
.line-key { display: inline-block; width: 14px; height: 2px; border-radius: 1px; margin-right: 6px; vertical-align: 4px; }
.legend-row { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.82rem; color: var(--text-muted); margin: 0 0 10px; }
.legend-row span { display: inline-flex; align-items: center; }

/* ---- Roster toolbar, views & selection ---------------------------------- */

.head-actions { display: flex; gap: 8px; }
#compare-toggle[aria-pressed='true'] { color: var(--gold); border-color: var(--gold-soft); box-shadow: 0 0 12px rgba(255, 190, 60, 0.25); }
.toolbar-left { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.segmented {
  display: inline-flex;
  border: 1px solid var(--gold-deep);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.4);
}
.segmented button {
  font: inherit;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: none;
  border: 0;
  padding: 5px 14px;
  cursor: pointer;
}
.segmented button + button { border-left: 1px solid var(--gold-deep); }
.segmented button[aria-pressed='true'] {
  color: var(--gold);
  background: linear-gradient(180deg, rgba(255, 200, 90, 0.16), rgba(255, 200, 90, 0.04));
}

.select-mark { display: none; }
.selecting .char-card { padding-left: 42px; }
.selecting .select-mark {
  display: block;
  position: absolute;
  left: 13px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border: 1px solid var(--gold-soft);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.6);
}
.char-card[aria-pressed='true'] { border-color: var(--gold-soft); box-shadow: 0 0 0 1px var(--gold-soft), 0 0 18px rgba(255, 190, 60, 0.25); }
.char-card[aria-pressed='true'] .select-mark { background: var(--gold); }
.char-card[aria-pressed='true'] .select-mark::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #1a1206;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.compare-bar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 30;
  width: min(640px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px 10px 18px;
  background: linear-gradient(180deg, #241b11, #120d08);
  border: 1px solid var(--gold-soft);
  border-radius: 6px;
  box-shadow: 0 0 0 1px #000, 0 12px 34px rgba(0, 0, 0, 0.75), 0 0 24px rgba(255, 170, 40, 0.15);
  font-size: 0.92rem;
}
.compare-actions { display: flex; gap: 8px; }
.compare-actions .btn { padding: 6px 16px; font-size: 0.85rem; }

/* ---- Tables -------------------------------------------------------------- */

.table-wrap { overflow-x: auto; scrollbar-width: thin; }

.roster-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.roster-table th,
.roster-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(122, 92, 46, 0.22);
  white-space: nowrap;
}
.roster-table thead th {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--gold-soft);
  font-weight: 700;
  border-bottom: 1px solid var(--gold-dim);
}
.roster-table thead th button {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.roster-table thead th button:hover { color: var(--gold); }
.roster-table th[aria-sort] { color: var(--gold); }
.sort-arrow { display: inline-block; width: 1em; font-size: 0.7em; margin-left: 4px; }
.roster-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.roster-table tbody tr[data-href] { cursor: pointer; }
.roster-table tbody tr:hover { background: rgba(255, 210, 120, 0.05); }
.roster-table tr[aria-pressed='true'] { background: rgba(255, 200, 80, 0.1); box-shadow: inset 3px 0 0 var(--gold); }
.row-name { font-weight: 500; color: var(--cc); display: inline-flex; align-items: center; }
.row-name:hover { color: var(--cc); filter: brightness(1.2); }
.faction-dot { display: inline-block; width: 8px; height: 8px; transform: rotate(45deg); margin-right: 8px; border: 1px solid #000; }
.faction-dot.ALLIANCE { background: var(--alliance); }
.faction-dot.HORDE { background: var(--horde); }
.faction-dot.NEUTRAL { background: #888; }
.cell-loading {
  display: inline-block;
  width: 42px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(90deg, #1c160f 25%, #2d2317 50%, #1c160f 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.diff-cell { display: inline-flex; align-items: center; gap: 2px; }

/* ---- Overview ----------------------------------------------------------- */

.ov-tiles { margin: 0 0 8px; }
.stat-sub { font-size: 0.8rem; color: var(--text-muted); }

.dotplot { display: grid; gap: 2px; }
.dp-axis,
.dp-row { display: grid; grid-template-columns: minmax(90px, 160px) 1fr; gap: 14px; align-items: center; }
.dp-ticks { position: relative; height: 18px; margin-right: 34px; }
.dp-ticks span { position: absolute; transform: translateX(-50%); font-size: 0.75rem; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.dp-row { padding: 3px 0; border-radius: 3px; }
.dp-row:hover,
.dp-row:focus-visible { background: rgba(255, 210, 120, 0.05); }
.dp-label { display: flex; align-items: center; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-track { position: relative; height: 22px; margin-right: 34px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.dp-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, 0.06); }
.dp-dot {
  position: absolute;
  top: 50%;
  width: 11px;
  height: 11px;
  margin: -5.5px 0 0 -5.5px;
  border-radius: 50%;
  background: #e0a526;
  box-shadow: 0 0 0 2px #15110c;
}
.dp-value,
.dp-none {
  position: absolute;
  top: 50%;
  transform: translate(10px, -50%);
  font-style: normal;
  font-size: 0.8rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.dp-value.flip { transform: translate(calc(-100% - 10px), -50%); }
.dp-none { left: 0; transform: translateY(-50%); color: var(--text-faint); }

.prof-coverage { display: grid; gap: 8px; }
.pc-row {
  display: grid;
  grid-template-columns: minmax(130px, 200px) 1fr;
  gap: 12px;
  align-items: start;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(122, 92, 46, 0.2);
}
.pc-name { font-weight: 500; }
.pc-chars { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text);
  padding: 1px 10px 1px 8px;
  border: 1px solid #2d2318;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
}
.pc-chip:hover { color: var(--text); border-color: var(--gold-dim); }

/* ---- Charts ------------------------------------------------------------- */

.chart-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 14px; }
.chart-card {
  margin: 0;
  padding: 12px 14px 8px;
  background: #15110c;
  border: 1px solid #2d2318;
  border-radius: var(--radius);
}
.chart-card figcaption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--gold-warm);
  margin-bottom: 6px;
}
.delta { font-family: var(--font-body); font-weight: 500; font-size: 0.82rem; color: var(--text-muted); white-space: nowrap; }
.delta.up { color: #8fd27a; }
.delta.down { color: #e88a74; }

.chart { position: relative; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 4px; }
.chart-legend span { display: inline-flex; align-items: center; }
.chart-plot svg { display: block; overflow: visible; }
.chart-plot svg:focus-visible { outline: 1px solid var(--gold-dim); outline-offset: 2px; }
.chart .grid { stroke: rgba(255, 255, 255, 0.07); stroke-width: 1; }
.chart .tick { fill: var(--text-faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .end-label { fill: var(--text); font-size: 12px; font-weight: 500; }
.chart .end-dot { stroke: #15110c; stroke-width: 2; }
.chart .crosshair { stroke: rgba(255, 230, 180, 0.35); stroke-width: 1; }
.chart .hidden { display: none; }
.chart-tip {
  position: absolute;
  z-index: 5;
  min-width: 110px;
  padding: 6px 10px;
  background: var(--tooltip-bg);
  border: 1px solid var(--tooltip-border);
  border-radius: 4px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
  font-size: 0.82rem;
  pointer-events: none;
  white-space: nowrap;
}
.tip-date { color: var(--text-muted); font-size: 0.75rem; margin-bottom: 2px; }
.tip-row { display: flex; align-items: center; gap: 6px; }
.tip-row b { color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; }
.tip-row span { color: var(--text-muted); }

.progress-intro { color: var(--text-muted); margin: 0 0 14px; }
.progress-intro b { color: var(--text); font-weight: 500; }
.recent li span b { color: var(--text); font-weight: 500; }

details.data-table { margin-top: 16px; }
details.data-table summary { cursor: pointer; color: var(--gold-warm); font-size: 0.9rem; }
details.data-table .table-wrap { margin-top: 8px; }

/* ---- Compare ------------------------------------------------------------ */

.compare-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.9rem; table-layout: fixed; min-width: 640px; }
.compare-table th,
.compare-table td { padding: 8px 10px; vertical-align: middle; border-bottom: 1px solid rgba(122, 92, 46, 0.18); }
.compare-table th[scope='row'],
.compare-table thead td {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 170px;
  text-align: left;
  font-weight: 500;
  color: var(--text-muted);
  background: #18130d;
}
.compare-table tr.group th {
  text-align: left;
  font-family: var(--font-display);
  color: var(--gold-warm);
  font-size: 0.95rem;
  padding-top: 22px;
  border-bottom: 1px solid var(--gold-dim);
}
.cmp-head {
  position: relative;
  text-align: center;
  vertical-align: top !important;
  padding-bottom: 14px !important;
  border-bottom: 1px solid var(--gold-dim) !important;
}
.cmp-head .avatar { margin: 0 auto 6px; }
.cmp-link { display: block; color: inherit; }
.cmp-link:hover { color: inherit; }
.cmp-name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--cc, var(--text)); text-shadow: 0 1px 0 #000; }
.cmp-head .char-line { white-space: normal; font-weight: 400; }
.cmp-remove {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 26px;
  height: 26px;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text-faint);
  background: none;
  border: 1px solid transparent;
  border-radius: 50%;
  cursor: pointer;
}
.cmp-remove:hover { color: var(--gold); border-color: var(--gold-deep); }
.compare-table td.best { background: rgba(255, 200, 80, 0.07); }
.best-mark { color: var(--gold); font-size: 0.7rem; margin-left: 6px; }
.cmp-item { display: inline-flex; align-items: center; gap: 10px; min-width: 0; max-width: calc(100% - 20px); vertical-align: middle; }
.cmp-item > div:last-child { min-width: 0; }
.cmp-item .icon { width: 36px; height: 36px; }
.cmp-item .slot-name { font-size: 0.85rem; }
.cmp-raid { display: inline-grid; grid-template-columns: auto 1fr; gap: 8px; align-items: center; width: calc(100% - 20px); vertical-align: middle; }
.cmp-raid .bar { height: 8px; }
.cmp-tiers { list-style: none; margin: 0; padding: 0; font-size: 0.8rem; color: var(--text-muted); display: inline-block; }
.cmp-tiers b { color: var(--text); font-weight: 500; }

/* ---- Responsive --------------------------------------------------------- */

@media (max-width: 960px) {
  .paperdoll.has-render { grid-template-columns: 1fr 1fr; grid-template-areas: 'left right' 'bottom bottom'; }
  .pd-center { display: none; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .dp-axis, .dp-row { grid-template-columns: 96px 1fr; gap: 8px; }
  .pc-row { grid-template-columns: 1fr; gap: 4px; }
  .compare-table th[scope='row'], .compare-table thead td { width: 110px; }
  .feature-row { grid-template-columns: 1fr; margin-top: 32px; }
  .paperdoll, .paperdoll.has-render { grid-template-columns: 1fr; grid-template-areas: 'left' 'right' 'bottom'; }
  .pd-right .slot { flex-direction: row; text-align: left; }
  .pd-bottom { justify-content: flex-start; flex-direction: column; border-top: none; padding-top: 0; }
  .raid { grid-template-columns: 1fr; }
  .hero { min-height: 360px; }
  .hero-render { background-position: 60% 10%; opacity: 0.5; }
  .hero-content { padding: 22px 16px 18px; }
  .frame-body { padding: 14px; }
  .frame-title { padding: 12px 14px 10px; }
  .user-box .battletag { display: none; }
  .brand span { display: none; }
  .rep-list { grid-template-columns: 1fr; }
  .toolbar .search { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .embers { display: none; }
}
