:root {
  --bg: #0d0b1a;
  --bg-soft: #14112a;
  --card: #1a1633;
  --card-2: #211c40;
  --line: #322a5c;
  --line-soft: #2a2350;
  --text: #e8e5f7;
  --text-dim: #a49dcc;
  --text-faint: #6f689c;
  --accent: #8b7ff0;
  --accent-2: #57d4f0;
  --req: #4ade80;
  --req-bg: rgba(74, 222, 128, 0.12);
  --req-border: rgba(74, 222, 128, 0.35);
  --info: #60a5fa;
  --info-bg: rgba(96, 165, 250, 0.12);
  --info-border: rgba(96, 165, 250, 0.35);
  --avoid: #f87171;
  --avoid-bg: rgba(248, 113, 113, 0.12);
  --avoid-border: rgba(248, 113, 113, 0.35);
  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background:
    radial-gradient(1100px 500px at 80% -10%, rgba(139, 127, 240, 0.14), transparent 60%),
    radial-gradient(900px 450px at 0% 0%, rgba(87, 212, 240, 0.08), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  line-height: 1.5;
}

.wrap { max-width: 1780px; margin: 0 auto; padding: 0 28px; }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--line-soft);
  background: rgba(13, 11, 26, 0.7);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon { font-size: 30px; filter: drop-shadow(0 0 12px rgba(139, 127, 240, 0.6)); }
.brand h1 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.brand .accent { color: var(--accent); }
.tagline { font-size: 12px; color: var(--text-dim); }

/* Selector de clase/spec estilo Method */
.spec-picker { position: relative; }
.picker-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 14px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.picker-toggle:hover { border-color: var(--accent); }
.picker-toggle img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--line);
  display: block;
}
.picker-sep { color: var(--text-faint); }
.picker-caret { color: var(--text-faint); font-size: 11px; margin-left: 2px; }

.picker-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 50;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 18px;
  width: max-content;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  /* sin barra de scroll visible (se puede seguir haciendo scroll si no cabe) */
  scrollbar-width: none;
  -ms-overflow-style: none;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  column-gap: 28px;
}
.picker-panel::-webkit-scrollbar { display: none; }
.picker-panel.open { display: grid; }

@media (max-width: 720px) {
  .picker-panel {
    grid-template-columns: 1fr;
    left: 0;
    right: auto;
    width: min(calc(100vw - 60px), 420px);
  }
}

.picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 2px;
  border-bottom: 1px solid var(--line-soft);
}
.picker-row:last-child { border-bottom: none; }
.picker-class { font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.picker-specs { display: flex; gap: 6px; }

.spec-icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.1s, border-color 0.1s, box-shadow 0.1s;
}
.spec-icon-btn img { width: 100%; height: 100%; display: block; }
.spec-icon-btn:hover:not(.disabled) {
  transform: scale(1.1);
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(139, 127, 240, 0.5);
}
.spec-icon-btn.active { border-color: var(--accent-2); box-shadow: 0 0 8px rgba(87, 212, 240, 0.5); }
.spec-icon-btn.disabled {
  cursor: not-allowed;
  opacity: 0.75;
}
.spec-icon-btn.disabled img { filter: grayscale(1) brightness(0.45); }

/* ---------- Spec head ---------- */
.spec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 26px 0 14px;
}
.spec-title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.spec-title .class-name { opacity: 0.85; }
.patch-badge {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-2);
  background: rgba(87, 212, 240, 0.1);
  border: 1px solid rgba(87, 212, 240, 0.3);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- Controls ---------- */
.controls {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.control-group {
  display: flex;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}
.tab-btn {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  gap: 7px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  background: var(--accent);
  color: #0d0b1a;
}
.tab-btn.active.variant-sunfury { background: #f0a35e; }

/* ---------- Opener ---------- */
.opener {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 18px;
}
.opener-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-right: 4px;
}
.opener-step { display: flex; align-items: center; gap: 10px; }
.opener-arrow { color: var(--text-faint); font-size: 13px; }

/* ---------- Ability chip ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 6px;
  border-radius: 10px;
  border: 1px solid;
  font-weight: 700;
  font-size: 13.5px;
  white-space: nowrap;
}
.chip-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid;
  display: block;
  object-fit: cover;
}

/* ---------- Table ---------- */
.table-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 18px;
}
.table-scroll { overflow-x: auto; }

.prio-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}
.prio-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  background: var(--card-2);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  cursor: help;
}
.prio-table th.th-action { color: var(--accent-2); }
.prio-table td {
  padding: 6px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.prio-table tbody tr { transition: background 0.12s; }
.prio-table tbody tr:hover { background: rgba(139, 127, 240, 0.07); }
.prio-table tbody tr:last-child td { border-bottom: none; }

.prio-num {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-faint);
  width: 44px;
}
tr:nth-child(-n+3) .prio-num { color: var(--accent); }

.cond {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid;
  white-space: nowrap;
}
.cond-req   { color: var(--req);   background: var(--req-bg);   border-color: var(--req-border); }
.cond-info  { color: var(--info);  background: var(--info-bg);  border-color: var(--info-border); }
.cond-avoid { color: var(--avoid); background: var(--avoid-bg); border-color: var(--avoid-border); }
.cond-none  { color: var(--text-faint); font-family: var(--mono); font-size: 13px; }

.td-action { width: 64px; text-align: center; }

/* Icono de acción con tooltip (nombre de la habilidad) */
.action-icon { position: relative; display: inline-block; }
.action-icon img {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 2px solid;
  display: block;
  object-fit: cover;
  cursor: help;
}
a.action-icon, a.chip { text-decoration: none; }

.th-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted var(--text-faint);
}
.th-link:hover { color: var(--accent-2); border-bottom-color: var(--accent-2); }

/* Tooltip propio solo como respaldo para acciones sin ID de Wowhead */
span.action-icon::after {
  content: attr(data-tip);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(4px);
  background: #0a0817;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 11px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s, transform 0.12s;
  z-index: 30;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}
span.action-icon:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.td-note {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.35;
  max-width: 300px;
  min-width: 200px;
}

/* Arrow separator before the action column */
.td-arrow {
  width: 30px;
  text-align: center;
  color: var(--text-faint);
  font-size: 16px;
}

/* ---------- Panels ---------- */
.panels {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  margin-bottom: 24px;
}
@media (max-width: 800px) { .panels { grid-template-columns: 1fr; } }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.panel h3 {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 12px;
}
.panel ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.panel li {
  font-size: 13.5px;
  color: var(--text-dim);
  padding-left: 18px;
  position: relative;
}
.panel li::before {
  content: "◆";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 9px;
  top: 5px;
}
.panel li strong { color: var(--text); }

.legend-grid { display: flex; flex-direction: column; gap: 10px; }
.legend-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-dim); }
.legend-resource { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.legend-resource .res-name { font-weight: 700; color: var(--text); font-size: 13px; }
.legend-resource .res-hint { font-size: 12px; color: var(--text-dim); }

/* ---------- Footer ---------- */
.site-footer {
  padding: 18px 4px 40px;
  font-size: 12.5px;
  color: var(--text-faint);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.site-footer a { color: var(--text-dim); text-decoration: none; border-bottom: 1px dotted var(--text-faint); }
.site-footer a:hover { color: var(--accent); }
.sources { display: flex; gap: 14px; flex-wrap: wrap; }
