:root {
  --bg: #0b0a09;
  --ink: #f3efe6;
  --muted: #9c9388;
  --line: #2c2622;
  --horde: #b71b1c;
  --bone: #c4b49a;
  --alliance: #1a4fad;
  --gold: #d4b06a;
  --field: #141211;
  --raised: #1a1714;
  --panel: #100e0c;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

a { color: inherit; }

.hub-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem 1.25rem;
  min-height: 2.15rem;
  padding: 0.2rem 1.25rem;
  background: var(--panel);
  font-size: 0.85rem;
}

.hub-bar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--horde), var(--bone) 34%, var(--gold) 66%, var(--alliance));
}

.hub-bar a { color: var(--ink); text-decoration: none; border-bottom: 1px solid transparent; }
.hub-id { justify-self: start; min-width: 0; }
.hub-id span { margin: 0; }
.hub-bar .hub-title { justify-self: center; font-weight: 700; white-space: nowrap; border-bottom: 0; }
.forazeroth {
  display: inline-block;
  background-image: linear-gradient(
    90deg,
    #b71b1c 0%,
    #a32238 16%,
    #8c2a52 32%,
    #6e336e 48%,
    #503b88 64%,
    #3244a2 80%,
    #1a4fad 100%
  );
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 800% 100%;
  animation: forazerothGlow 3s ease-in-out infinite, forazerothShimmer 8s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 8px rgba(183, 27, 28, 0.45)) drop-shadow(0 0 15px rgba(26, 79, 173, 0.35));
}
@keyframes forazerothGlow {
  0%, 100% {
    filter: drop-shadow(0 0 8px rgba(183, 27, 28, 0.45)) drop-shadow(0 0 15px rgba(26, 79, 173, 0.35));
  }
  50% {
    filter: drop-shadow(0 0 12px rgba(183, 27, 28, 0.7)) drop-shadow(0 0 20px rgba(26, 79, 173, 0.55));
  }
}
@keyframes forazerothShimmer {
  0% { background-position: 0% center; }
  100% { background-position: 100% center; }
}
@media (prefers-reduced-motion: reduce) {
  .forazeroth { animation: none; }
}
.hub-bar nav { display: flex; justify-content: flex-end; justify-self: end; min-width: 0; gap: 0.35rem 1.25rem; }
.hub-bar nav a:hover, .hub-bar nav a:focus-visible, .hub-bar nav a.is-on, .hub-id a:hover, .hub-id a:focus-visible { border-bottom-color: var(--muted); }

.split { display: flex; flex: 1; min-height: 0; }
.half { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; text-decoration: none; padding: 48px 24px 40px; overflow: hidden; }
.half img, .half h1, .half p { position: relative; z-index: 1; }
.half img { width: 140px; height: auto; filter: drop-shadow(0 -14px 12px rgba(0, 0, 0, 0.8)); }
.half h1 { margin: 18px 0 8px; font-size: 42px; color: var(--ink); letter-spacing: 0; font-weight: 600; }
.half p { margin: 0; max-width: 280px; }
.half h1,
.half p {
  text-shadow: 0 -0.28em 0.32em rgba(0, 0, 0, 0.8);
}
.half-count { margin-top: 0.85rem; font-size: 1.75rem; font-weight: 600; letter-spacing: 0.04em; }
.horde { background: radial-gradient(ellipse at center, rgba(140, 24, 20, 0.55), #0b0a09 70%); }
.horde h1, .horde p { color: var(--bone); }
.alliance { background: radial-gradient(ellipse at center, rgba(20, 60, 140, 0.55), #0b0a09 70%); }
.alliance h1, .alliance p { color: var(--gold); }

.half .embers {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 50%;
  height: 42dvh;
  overflow: hidden;
  pointer-events: none;
}
.half.alliance .embers { left: 50%; }
.half .embers span {
  position: absolute;
  bottom: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff8ec 0%, #ffc56a 32%, #e25816 58%, rgba(183, 27, 28, 0) 74%);
  box-shadow: 0 0 3px 1px rgba(255, 244, 220, 0.95), 0 8px 11px 1px rgba(183, 27, 28, 0.55);
  opacity: 0;
  --sway: 6s;
  --life: 12s;
  --glow: 2.6s;
  --lag: -2s;
  animation-name: ember-sway, ember-rise, ember-glow;
  animation-duration: var(--sway), var(--life), var(--glow);
  animation-delay: 0s, var(--lag), calc(var(--lag) * 0.25);
  animation-timing-function: ease-in-out, linear, ease-in-out;
  animation-iteration-count: infinite;
}
.half .embers span:nth-child(4n + 1) {
  width: 2px;
  height: 2px;
  box-shadow: 0 0 3px 0 rgba(255, 236, 200, 1), 0 5px 7px 1px rgba(183, 27, 28, 0.45);
}
.half .embers span:nth-child(4n) {
  width: 6px;
  height: 6px;
  background: radial-gradient(circle, #fff 0%, #ffd18a 26%, #c43712 52%, rgba(122, 22, 18, 0) 74%);
  box-shadow: 0 0 4px 2px rgba(255, 220, 160, 0.9), 0 12px 16px 2px rgba(183, 27, 28, 0.55);
  --life: 16s;
  --sway: 8s;
  animation-name: ember-sway-wide, ember-rise, ember-glow;
}
.half .embers span:nth-child(3n) { animation-name: ember-sway-alt, ember-rise, ember-glow; }
.half .embers span:nth-child(4n + 2) { animation-name: ember-sway, ember-die, ember-glow; }
.half .embers span:nth-child(1) { left: 3%; --sway: 6.4s; --life: 11s; --glow: 2.4s; --lag: -1s; }
.half .embers span:nth-child(2) { left: 8%; --sway: 7s; --life: 14s; --glow: 3.1s; --lag: -6s; }
.half .embers span:nth-child(3) { left: 14%; --sway: 5.6s; --life: 9s; --glow: 2.2s; --lag: -3s; }
.half .embers span:nth-child(4) { left: 19%; --sway: 8.2s; --life: 17s; --glow: 3.4s; --lag: -9s; }
.half .embers span:nth-child(5) { left: 26%; --sway: 6s; --life: 12s; --glow: 2.6s; --lag: -2s; }
.half .embers span:nth-child(6) { left: 33%; --sway: 7.4s; --life: 15s; --glow: 2.9s; --lag: -8s; }
.half .embers span:nth-child(7) { left: 39%; --sway: 5.2s; --life: 10s; --glow: 2.1s; --lag: -4s; }
.half .embers span:nth-child(8) { left: 45%; --sway: 8.6s; --life: 18s; --glow: 3.6s; --lag: -11s; }
.half .embers span:nth-child(9) { left: 51%; --sway: 6.8s; --life: 13s; --glow: 2.5s; --lag: -5s; }
.half .embers span:nth-child(10) { left: 57%; --sway: 5.8s; --life: 9.5s; --glow: 2.8s; --lag: -7s; }
.half .embers span:nth-child(11) { left: 63%; --sway: 7.8s; --life: 16s; --glow: 2.3s; --lag: -1.5s; }
.half .embers span:nth-child(12) { left: 69%; --sway: 6.2s; --life: 11.5s; --glow: 3.2s; --lag: -10s; }
.half .embers span:nth-child(13) { left: 74%; --sway: 7.2s; --life: 14.5s; --glow: 2s; --lag: -3.5s; }
.half .embers span:nth-child(14) { left: 80%; --sway: 5.4s; --life: 8.5s; --glow: 2.7s; --lag: -6.5s; }
.half .embers span:nth-child(15) { left: 86%; --sway: 8.4s; --life: 17.5s; --glow: 3.3s; --lag: -12s; }
.half .embers span:nth-child(16) { left: 91%; --sway: 6.6s; --life: 12.5s; --glow: 2.35s; --lag: -2.5s; }
.half .embers span:nth-child(17) { left: 95%; --sway: 5.9s; --life: 10.5s; --glow: 3s; --lag: -8.5s; }
.half .embers span:nth-child(18) { left: 98%; --sway: 7.6s; --life: 15.5s; --glow: 2.45s; --lag: -4.5s; }
.half.alliance .embers span {
  background: radial-gradient(circle, #fffdf6 0%, #f0d78a 30%, #5d8fd4 56%, rgba(26, 79, 173, 0) 74%);
  box-shadow: 0 0 3px 1px rgba(255, 248, 230, 0.95), 0 8px 11px 1px rgba(26, 79, 173, 0.55);
}
.half.alliance .embers span:nth-child(4n + 1) {
  box-shadow: 0 0 3px 0 rgba(255, 248, 230, 1), 0 5px 7px 1px rgba(26, 79, 173, 0.45);
}
.half.alliance .embers span:nth-child(4n) {
  background: radial-gradient(circle, #fff 0%, #ffe7a8 26%, #8eb4ee 52%, rgba(26, 79, 173, 0) 74%);
  box-shadow: 0 0 4px 2px rgba(255, 244, 210, 0.9), 0 12px 16px 2px rgba(26, 79, 173, 0.55);
}
@keyframes ember-sway {
  0%, 100% { translate: -11px 0; }
  50% { translate: 13px 0; }
}
@keyframes ember-sway-alt {
  0%, 100% { translate: 12px 0; }
  50% { translate: -14px 0; }
}
@keyframes ember-sway-wide {
  0%, 100% { translate: -18px 0; }
  50% { translate: 16px 0; }
}
@keyframes ember-rise {
  0% { transform: translateY(10px) scale(0.45); opacity: 0; }
  2% { transform: translateY(0) scale(0.48); opacity: 1; }
  100% { transform: translateY(-42dvh) scale(0.2); opacity: 0; }
}
@keyframes ember-die {
  0% { transform: translateY(10px) scale(0.5); opacity: 0; }
  3% { transform: translateY(0) scale(0.5); opacity: 1; }
  58% { transform: translateY(-20dvh) scale(0.4); opacity: 0.35; }
  74% { transform: translateY(-26dvh) scale(0.2); opacity: 0; }
  100% { transform: translateY(-26dvh) scale(0.2); opacity: 0; }
}
@keyframes ember-glow {
  0%, 100% { filter: brightness(0.9); }
  42% { filter: brightness(1.65); }
  68% { filter: brightness(1.05); }
}
@media (prefers-reduced-motion: reduce) {
  .half .embers { display: none; }
}

.panel { width: min(560px, calc(100% - 32px)); margin: 2.5rem auto 3rem; }
.panel h1 { margin: 0 0 0.35rem; color: var(--ink); font-size: 1.35rem; font-weight: 600; letter-spacing: 0.04em; }
.panel h2 { margin: 0; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.panel a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--muted); }
.panel a:hover, .panel a:focus-visible { color: #fff; border-bottom-color: #fff; }

.gate { width: min(26rem, calc(100% - 32px)); padding: 1.5rem 1.4rem 1.35rem; background: var(--panel); border: 1px solid var(--line); }
.gate .gate-or { display: flex; align-items: center; gap: 0.75rem; margin: 1.25rem 0 1rem; color: var(--muted); font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase; }
.gate .gate-or::before, .gate .gate-or::after { content: ""; flex: 1; height: 2px; }
.gate .gate-or::before { background: linear-gradient(90deg, var(--horde), var(--bone)); }
.gate .gate-or::after { background: linear-gradient(90deg, var(--gold), var(--alliance)); }
.gate .gate-links { margin: 1.15rem 0 0; font-size: 0.9rem; }
.gate .button, .gate form button { display: block; width: 100%; text-align: center; color: var(--panel); border-bottom: 0; }
.gate .button:hover, .gate .button:focus-visible, .gate form button:hover, .gate form button:focus-visible { color: var(--panel); border-bottom: 0; }

label { display: block; margin: 0.85rem 0 0.3rem; font-size: 0.85rem; color: var(--muted); }
input, button { font: inherit; }
input { width: 100%; margin: 0; padding: 0.55rem 0.65rem; color: var(--ink); background: var(--field); border: 1px solid var(--line); }
input:focus-visible { border-color: var(--muted); outline: none; }
button, .button { display: inline-block; margin-top: 1.15rem; padding: 0.65rem 0.8rem; background: var(--ink); color: var(--panel); border: 0; text-decoration: none; cursor: pointer; }
button:hover, button:focus-visible, .button:hover, .button:focus-visible { background: #fff; color: var(--panel); border-bottom: 0; }

.census { list-style: none; padding: 0; }
.census li { margin: 10px 0; }
.choice label { display: flex; align-items: center; gap: 0.45rem; margin: 0.35rem 0; }
.choice input { width: auto; }
.note { color: var(--muted); }

body.desk .panel { width: min(86rem, calc(100% - 2.5rem)); }
.desk .note { margin: 0.45rem 0 0; }
.ruleset { margin-top: 1.75rem; }
.ruleset h2 { margin: 0; font-size: 1.15rem; letter-spacing: 0; text-transform: none; color: var(--ink); font-weight: 600; }
.ruleset h3 { margin: 1.25rem 0 0.35rem; font-size: 1rem; font-weight: 600; color: var(--ink); }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 0.85rem; }
.side { padding: 1.1rem 1.15rem 1.2rem; background: var(--panel); border: 1px solid var(--line); }
.side h3 { margin: 0 0 0.55rem; font-size: 0.85rem; font-weight: 700; letter-spacing: 0.04em; }
.side-horde { border-top: 2px solid var(--horde); }
.side-alliance { border-top: 2px solid var(--alliance); }
.side-horde h3 { color: var(--bone); }
.side-alliance h3 { color: var(--gold); }
.side p { display: flex; flex-wrap: wrap; gap: 0.45rem 0.9rem; margin: 0; }
.side a { margin: 0; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--bone); }
.side-alliance a { border-bottom-color: var(--gold); }
.side a:hover, .side a:focus-visible { color: #fff; }

.catalog-picks { display: flex; flex-wrap: wrap; gap: 0.45rem 0.9rem; margin: 0.85rem 0 0; }
.catalog-picks a { color: var(--muted); text-decoration: none; border-bottom: 1px solid transparent; }
.catalog-picks a.is-on { color: var(--ink); border-bottom-color: var(--bone); }
.catalog-picks a:hover, .catalog-picks a:focus-visible { color: #fff; }

form.catalog-find { display: flex; flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem 1rem; margin-top: 1.15rem; }
form.catalog-find label { display: flex; flex-direction: column; width: auto; margin: 0; color: var(--muted); }
form.catalog-find input, form.catalog-find select { width: 14rem; font: inherit; padding: 0.55rem 0.65rem; color: var(--ink); background: var(--field); border: 1px solid var(--line); }
form.catalog-find select:focus-visible { border-color: var(--muted); outline: none; }
form.catalog-find .level-range { display: flex; align-items: center; gap: 0.35rem; }
form.catalog-find .level-range input { width: 4.25rem; }
form.catalog-find button { width: auto; margin-top: 0; }
form.catalog-find a.clear { color: var(--muted); text-decoration: none; border-bottom: 1px solid transparent; padding-bottom: 0.55rem; }
form.catalog-find a.clear:hover, form.catalog-find a.clear:focus-visible { color: #fff; }
.lede { margin: 0.85rem 0 0; color: var(--muted); }

table.catalog { width: 100%; border-collapse: collapse; margin-top: 0.35rem; }
.catalog th, .catalog td { padding: 0.7rem 1.25rem 0.7rem 0; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.catalog th { color: var(--muted); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.catalog th a { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; }
.catalog th a.is-on { color: var(--ink); border-bottom-color: var(--bone); }
.catalog th a:hover, .catalog th a:focus-visible { color: #fff; }
.catalog td.item-name { white-space: normal; min-width: 14rem; }
.catalog td.item-name span { display: inline-block; margin-left: 0.45rem; color: var(--muted); font-size: 0.78rem; }
.catalog td.item-name a { text-decoration: none; }
.catalog td.item-name a:hover, .catalog td.item-name a:focus-visible { text-decoration: underline; }
.catalog .mark { display: inline-block; width: 2.25rem; height: 2.25rem; border: 1px solid var(--line); background-color: var(--field); background-position: center; background-repeat: no-repeat; background-size: cover; }
.table-wrap:has(.catalog) { overflow: visible; }

.catalog-pages { display: flex; align-items: baseline; gap: 1.25rem; margin-top: 1.25rem; }
.catalog-pages a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--bone); }
.catalog-pages a:hover, .catalog-pages a:focus-visible { color: #fff; }
.catalog-pages .is-on { color: var(--ink); border-bottom: 1px solid var(--bone); }
.catalog-pages .gap { color: var(--muted); }

.item-hover { position: relative; display: inline-block; vertical-align: middle; outline: none; }
.item-hover:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
.item-hover .tip { display: none; position: absolute; z-index: 5; left: 0; bottom: calc(100% + 0.35rem); width: 16.5rem; padding: 0.55rem 0.7rem 0.65rem; color: var(--ink); text-align: left; font-weight: 400; background: #070605; border: 1px solid var(--line); white-space: normal; pointer-events: none; }
.item-hover:hover .tip, .item-hover:focus-visible .tip, .item-hover .tip.is-open { display: flex; flex-direction: column; gap: 0.08rem; }
.tip-name { font-weight: 600; line-height: 1.3; }
.tip-line, .tip-pair, .tip-dps, .tip-stat, .tip-ilvl { font-size: 0.82rem; line-height: 1.35; }
.tip-pair { display: flex; justify-content: space-between; gap: 1rem; }
.tip-dps, .tip-ilvl { color: var(--muted); }
.tip-stat { color: #1eff00; }
.tip-ilvl { margin-top: 0.15rem; font-size: 0.75rem; }
.item-sheet { margin-top: 1.5rem; }
.item-sheet .item-hover { display: flex; align-items: flex-start; gap: 1rem; }
.item-sheet .mark { width: 3rem; height: 3rem; border: 1px solid var(--line); background-color: var(--field); background-position: center; background-repeat: no-repeat; background-size: cover; }
.item-sheet .tip.is-open { position: static; width: 18rem; pointer-events: auto; }

@media (max-width: 40rem) {
  .sides { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .split { flex-direction: column; }
  .half { min-height: 50dvh; }
  .half .embers,
  .half.alliance .embers { position: absolute; left: 0; width: 100%; }
}

.footer-credit {
  position: relative;
  z-index: 3;
  margin-top: auto;
  padding: 0.85rem 1.25rem 1.15rem;
  text-align: center;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--muted);
}

.footer-credit-link {
  color: var(--bone);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 0.18em;
}

.footer-credit-link:hover,
.footer-credit-link:focus-visible {
  color: var(--ink);
}
