:root {
  --bg0: #070b0c;
  --bg1: #0e1618;
  --bg2: #152022;
  --line: rgba(231, 242, 241, 0.12);
  --text: #e7f2f1;
  --muted: #7f9694;
  --accent: #2dd4bf;
  --accent-strong: #5eead4;
  --on-accent: #04201c;
  --ok: #a78bfa;
  --danger: #fb7185;
  --radius: 14px;
  --slot: 52px;
  --font-display: "Bricolage Grotesque", Georgia, serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;

  --class-warrior: #c79c6e;
  --class-paladin: #f58cba;
  --class-hunter: #abd473;
  --class-rogue: #fff569;
  --class-priest: #f5f5f5;
  --class-shaman: #0070de;
  --class-mage: #69ccf0;
  --class-warlock: #9482c9;
  --class-druid: #ff7d0a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: var(--font-body);
  background: var(--bg0);
}

body {
  position: relative;
  overflow-x: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 50% at 8% -5%, rgba(45, 212, 191, 0.14), transparent 55%),
    radial-gradient(ellipse 55% 40% at 92% 8%, rgba(167, 139, 250, 0.12), transparent 50%),
    linear-gradient(165deg, #0a1213 0%, #050808 55%, #0c1416 100%);
}

.masthead {
  padding: 2.25rem clamp(1.25rem, 4vw, 3rem) 1rem;
  max-width: 1240px;
  margin: 0 auto;
}

.site-back {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.site-back a {
  color: var(--accent-strong);
  text-decoration: none;
}

.site-back a:hover {
  text-decoration: underline;
}

.brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 5.5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--accent-strong);
}

.masthead h1 {
  margin: 0.35rem 0 0.7rem;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.6vw, 1.75rem);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.lede, .hint, .summary, .meta {
  color: var(--muted);
  line-height: 1.45;
}

.lede {
  margin: 0;
  max-width: 40rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 1.25rem;
  max-width: 1240px;
  margin: 0 auto 3rem;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
}

.panel {
  background: linear-gradient(180deg, rgba(21, 32, 34, 0.96), rgba(8, 14, 15, 0.98));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.05rem 1.1rem 1.2rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.panel-head.tight {
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
}

.panel h2, .panel h3 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.panel h2 { font-size: 1.3rem; }
.panel h3 { font-size: 0.95rem; color: var(--muted); font-weight: 500; }

.picker-block {
  margin-bottom: 0.95rem;
}

.picker-block h3 {
  margin-bottom: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-family: var(--font-body);
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.4rem;
}

.icon-grid.specs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.icon-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg0);
  color: var(--text);
  border-radius: 12px;
  padding: 0.45rem 0.3rem 0.4rem;
  cursor: pointer;
  display: grid;
  justify-items: center;
  gap: 0.28rem;
  font: inherit;
  transition: border-color 120ms ease, transform 120ms ease, background 120ms ease;
}

.icon-btn:hover,
.icon-btn:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  outline: none;
  transform: translateY(-1px);
}

.icon-btn.is-active {
  border-color: var(--class-color, var(--accent));
  background: color-mix(in srgb, var(--class-color, var(--accent)) 14%, var(--bg0));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--class-color, var(--accent)) 35%, transparent);
}

.icon-medallion {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #0a1012;
  border: 1px solid color-mix(in srgb, var(--class-color, var(--accent)) 45%, #2a3a3c);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45);
}

.wow-icon {
  width: 36px;
  height: 36px;
  display: block;
  image-rendering: auto;
}

.icon-fallback {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--muted);
  font-family: var(--font-display);
}

.icon-label {
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-align: center;
  line-height: 1.1;
}

.icon-btn.is-active .icon-label {
  color: var(--text);
}

.summary {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
}

.buff-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.1rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.buff-row h3 {
  margin-bottom: 0.2rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1rem;
  text-transform: none;
  letter-spacing: -0.02em;
}

.buff-row .hint {
  margin: 0;
  font-size: 0.82rem;
}

.toggle {
  display: inline-flex;
  padding: 0.18rem;
  border-radius: 999px;
  background: var(--bg0);
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.toggle-btn, .ghost {
  font: inherit;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.toggle-btn {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
}

.toggle-btn.is-active {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.ghost {
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  color: var(--accent-strong);
}

.dials { display: grid; gap: 0.6rem; }

.dial {
  display: grid;
  grid-template-columns: 7.2rem 1fr 3.1rem;
  gap: 0.6rem;
  align-items: center;
}

.dial span { font-size: 0.88rem; }

.dial input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.dial output {
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--accent-strong);
}

.conversions { display: grid; gap: 0.5rem; }

.conversion {
  display: grid;
  grid-template-columns: 1fr 1fr 4.5rem auto;
  gap: 0.4rem;
  align-items: center;
}

label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

select, input[type="number"] {
  width: 100%;
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg0);
  color: var(--text);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font: inherit;
}

.conversion .icon-btn,
button.icon-btn.remove {
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border-radius: 8px;
  color: var(--danger);
}

/* Paper doll — denser, game-like */
.paperdoll {
  display: grid;
  gap: 0.85rem;
  justify-items: center;
}

.paperdoll-frame {
  display: grid;
  grid-template-columns: auto minmax(180px, 240px) auto;
  gap: 0.65rem;
  align-items: center;
}

.slot-col {
  display: grid;
  gap: 0.35rem;
}

.paperdoll-center {
  display: grid;
  gap: 0.65rem;
  align-content: center;
}

.silhouette {
  position: relative;
  width: 100%;
  min-height: 292px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(21, 32, 34, 0.65), rgba(7, 11, 12, 0.95)),
    radial-gradient(ellipse at 50% 28%, rgba(45, 212, 191, 0.12), transparent 58%);
  display: grid;
  place-content: center;
  text-align: center;
  overflow: hidden;
}

.silhouette-glow {
  position: absolute;
  inset: 16% 24% 12%;
  border-radius: 42% 42% 36% 36%;
  background: linear-gradient(180deg, rgba(231, 242, 241, 0.08), rgba(45, 212, 191, 0.04));
  box-shadow: inset 0 0 36px rgba(0, 0, 0, 0.45);
}

.silhouette-class,
.silhouette-spec {
  position: relative;
  margin: 0;
}

.silhouette-class {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.silhouette-spec {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.loadout-ep {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.loadout-ep strong {
  color: var(--ok);
  font-variant-numeric: tabular-nums;
}

.weapon-row {
  display: grid;
  grid-template-columns: repeat(3, var(--slot));
  gap: 0.35rem;
  justify-content: center;
}

.gear-slot {
  width: var(--slot);
  height: var(--slot);
  padding: 0;
  border-radius: 4px;
  border: 1px solid #2a3a3c;
  background:
    linear-gradient(145deg, #10191b 0%, #070b0c 100%);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  position: relative;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45);
  transition: transform 100ms ease, box-shadow 100ms ease;
}

.gear-slot:hover,
.gear-slot:focus-visible {
  transform: translateY(-1px);
  outline: none;
  z-index: 2;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.45),
    0 0 0 1px color-mix(in srgb, var(--accent) 70%, transparent),
    0 8px 18px rgba(0, 0, 0, 0.35);
}

.gear-slot.is-empty {
  cursor: default;
  opacity: 0.78;
}

.gear-slot.is-empty:hover {
  transform: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45);
}

.slot-glyph {
  width: 22px;
  height: 22px;
  opacity: 0.35;
  color: var(--muted);
}

.slot-glyph svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.slot-mark {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  line-height: 1;
  max-width: 100%;
  padding: 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.slot-tag {
  position: absolute;
  left: 2px;
  top: 2px;
  font-size: 0.55rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(231, 242, 241, 0.55);
  pointer-events: none;
}

.quality-epic { border-color: #a335ee; box-shadow: inset 0 0 0 1px rgba(163, 53, 238, 0.35); }
.quality-legendary { border-color: #ff8000; box-shadow: inset 0 0 0 1px rgba(255, 128, 0, 0.35); }
.quality-rare { border-color: #0070dd; box-shadow: inset 0 0 0 1px rgba(0, 112, 221, 0.35); }
.quality-uncommon { border-color: #1eff00; box-shadow: inset 0 0 0 1px rgba(30, 255, 0, 0.28); }
.quality-common { border-color: #9d9d9d; }
.quality-poor { border-color: #6b6b6b; }
.quality-heirloom,
.quality-artifact { border-color: #e6cc80; }

.quality-epic .slot-mark { color: #c9a0ff; }
.quality-legendary .slot-mark { color: #ffb366; }
.quality-rare .slot-mark { color: #6db3ff; }
.quality-uncommon .slot-mark { color: #7dff7d; }

.tooltip {
  position: fixed;
  z-index: 40;
  width: min(280px, calc(100vw - 24px));
  padding: 0.85rem 0.95rem;
  border-radius: 10px;
  border: 1px solid rgba(45, 212, 191, 0.28);
  background: linear-gradient(180deg, rgba(14, 22, 24, 0.98), rgba(7, 11, 12, 0.98));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.tip-name {
  margin: 0 0 0.3rem;
  font-family: var(--font-display);
  font-size: 1.02rem;
  line-height: 1.2;
}

.tip-name.quality-epic { color: #a335ee; }
.tip-name.quality-legendary { color: #ff8000; }
.tip-name.quality-rare { color: #0070dd; }
.tip-name.quality-uncommon { color: #1eff00; }
.tip-name.quality-common { color: var(--text); }
.tip-name.quality-poor { color: #9d9d9d; }
.tip-name.quality-heirloom,
.tip-name.quality-artifact { color: #e6cc80; }

.tip-meta,
.tip-weapon,
.tip-ep {
  margin: 0.12rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.tip-stats {
  display: grid;
  gap: 0.18rem;
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}

.tip-stats div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.tip-stats strong {
  font-variant-numeric: tabular-nums;
  color: var(--ok);
}

.tip-ep {
  margin-top: 0.6rem;
  color: var(--accent-strong);
  font-weight: 600;
}

.empty {
  color: var(--muted);
  font-style: italic;
}

@media (max-width: 720px) {
  .icon-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .paperdoll-frame {
    grid-template-columns: auto 1fr auto;
  }
  .silhouette { min-height: 220px; }
  .dial { grid-template-columns: 1fr; gap: 0.25rem; }
  .conversion { grid-template-columns: 1fr 1fr; }
  .buff-row { flex-direction: column; align-items: stretch; }
}
