:root {
  --bg-deep: #070811;
  --panel-bg: rgba(14, 16, 30, 0.90);
  --panel-solid: #101222;
  --panel-elev: rgba(24, 27, 48, 0.94);
  --gold-1: #fde68a;
  --gold-2: #d4a64a;
  --gold-3: #8c621b;
  --text-1: #f8fafc;
  --text-2: #cbd5e1;
  --text-3: #94a3b8;
  --border-subtle: rgba(212, 166, 74, 0.34);
  --border-glow: rgba(253, 230, 138, 0.65);
  --parchment-bg: linear-gradient(160deg, #fcf6e6 0%, #f3e4c3 100%);
  --parchment-ink: #2a1c0d;
  --emerald: #10b981;
  --cyan: #38bdf8;
  --purple: #a855f7;
  --amber: #f59e0b;
  --rose: #f43f5e;
  --radius-lg: 14px;
  --radius-md: 10px;
  --spring: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-deep);
  color: var(--text-1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  line-height: 1.48;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.world-backdrop {
  position: fixed;
  inset: 0;
  background-image: url("assets/bg_citadel.jpg");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  opacity: 0.42;
  z-index: -2;
  transform: translateZ(0);
}

.world-vignette {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 15%, rgba(18, 16, 38, 0.25) 0%, rgba(7, 8, 17, 0.92) 78%);
  z-index: -1;
}

.app-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px 16px 56px;
}

/* Top Bar */
.wow-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--panel-bg);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 232, 163, 0.18);
  backdrop-filter: blur(12px);
  margin-bottom: 12px;
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-crest {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4c1d95, #b45309);
  border: 1.5px solid var(--gold-2);
  display: grid;
  place-items: center;
  font-size: 20px;
  box-shadow: 0 0 18px rgba(212, 166, 74, 0.35);
}

.brand-kicker {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-1);
}

.brand-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}

/* Hero Switcher */
.hero-switcher {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px 6px 7px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 18, 34, 0.85);
  color: var(--text-2);
  cursor: pointer;
  text-align: left;
  transition: transform 0.16s var(--spring), border-color 0.16s ease, box-shadow 0.16s ease;
}

.hero-pill:hover { border-color: var(--gold-2); }
.hero-pill:active { transform: scale(0.96); }

.hero-pill.active {
  border-color: var(--gold-1);
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.35), rgba(212, 166, 74, 0.22));
  color: #ffffff;
  box-shadow: 0 0 18px rgba(212, 166, 74, 0.32);
}

.hero-pill[data-hero="leo"].active {
  background: linear-gradient(135deg, rgba(194, 65, 12, 0.38), rgba(212, 166, 74, 0.22));
}

.hero-pill strong { display: block; font-size: 13.5px; line-height: 1.15; }
.hero-pill small { display: block; font-size: 11px; color: var(--gold-1); }

.mini-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--gold-2);
}

.top-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Buttons */
.wow-btn {
  min-height: 38px;
  padding: 7px 13px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(25, 29, 52, 0.9);
  color: var(--text-1);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.15s var(--spring), background 0.15s ease, border-color 0.15s ease;
}
.wow-btn:hover { border-color: var(--gold-1); background: rgba(38, 44, 78, 0.95); }
.wow-btn:active { transform: scale(0.96); }

.wow-btn-gold {
  background: linear-gradient(180deg, #eab308 0%, #a16207 100%);
  border-color: #fde047;
  color: #1c1002;
  box-shadow: 0 2px 12px rgba(234, 179, 8, 0.28);
}
.wow-btn-gold:hover { background: linear-gradient(180deg, #facc15 0%, #b45309 100%); color: #110900; }

.wow-btn-arcane {
  background: linear-gradient(180deg, #7c3aed 0%, #4c1d95 100%);
  border-color: #c084fc;
  color: #ffffff;
}
.wow-btn-arcane.active-sandbox {
  background: linear-gradient(180deg, #059669 0%, #065f46 100%);
  border-color: #6ee7b7;
}

.wow-btn-danger {
  background: rgba(127, 29, 29, 0.72);
  border-color: rgba(248, 113, 113, 0.5);
  color: #fee2e2;
}
.wow-btn-ghost {
  background: rgba(15, 18, 34, 0.7);
}

/* Active Hero HUD */
.hero-hud-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--panel-bg);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 232, 163, 0.16);
  backdrop-filter: blur(12px);
  margin-bottom: 14px;
}

.hud-portrait-wrap {
  position: relative;
  width: 78px;
  height: 78px;
}

.hud-avatar {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--gold-2);
  box-shadow: 0 0 22px rgba(212, 166, 74, 0.45);
}

.hud-level-orb {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fbbf24, #b45309);
  border: 2px solid #fffbeb;
  color: #1c1002;
  font-size: 13px;
  font-weight: 900;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.hud-main { min-width: 0; }

.hud-title-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.hud-name { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.hud-class { font-size: 13px; font-weight: 600; color: var(--gold-1); }

.hud-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.status-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.pill-off { background: rgba(30, 41, 59, 0.8); color: var(--text-3); }
.pill-rested { background: rgba(37, 99, 235, 0.25); border-color: #60a5fa; color: #bfdbfe; box-shadow: 0 0 12px rgba(59, 130, 246, 0.35); }
.pill-base { background: rgba(16, 185, 129, 0.22); border-color: #34d399; color: #a7f3d0; }

.xp-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--text-2);
}
.pts-highlight { color: var(--gold-1); }

.xp-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: rgba(8, 10, 20, 0.95);
  border: 1px solid rgba(212, 166, 74, 0.35);
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #7c3aed, #c084fc);
  transition: width 0.35s var(--spring);
}

.xp-rested-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.35), transparent);
  pointer-events: none;
}

.hud-resources {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.res-box {
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(10, 12, 24, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-width: 132px;
}
.res-label { font-size: 11px; color: var(--text-3); font-weight: 600; }
.res-val { font-size: 13.5px; font-weight: 800; color: #ffffff; margin-top: 2px; }
.res-gold .res-val { color: #fde047; }
.res-mana .res-val { color: #67e8f9; }

/* Navigation Tabs */
.wow-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 14px;
  scrollbar-width: none;
}
.wow-tabs::-webkit-scrollbar { display: none; }

.wow-tab {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(16, 18, 34, 0.85);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s var(--spring), border-color 0.15s ease, background 0.15s ease;
}
.tab-badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(253, 230, 138, 0.2);
  border: 1px solid rgba(253, 230, 138, 0.45);
  color: var(--gold-1);
}
.tab-badge.badge-alert {
  background: rgba(244, 63, 94, 0.28);
  border-color: #fb7185;
  color: #ffe4e6;
}
.wow-tab:active { transform: scale(0.97); }
.wow-tab.active {
  background: linear-gradient(180deg, rgba(212, 166, 74, 0.28), rgba(140, 98, 27, 0.32));
  border-color: var(--gold-1);
  color: #ffffff;
  box-shadow: 0 0 18px rgba(212, 166, 74, 0.25);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.22s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* Talent Topbar */
.talent-topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.class-gift-banner {
  flex: 1 1 360px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(18, 21, 38, 0.92);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--gold-1);
  font-size: 13px;
  color: var(--text-2);
}
.class-gift-banner strong { color: var(--gold-1); }

.talent-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pts-counter-pill {
  padding: 7px 13px;
  border-radius: 10px;
  background: rgba(12, 14, 26, 0.92);
  border: 1.5px solid var(--gold-2);
  font-size: 13px;
}
.pts-counter-pill strong { color: #fde047; font-size: 16px; margin: 0 3px; }
.pts-spent-sub { font-size: 11.5px; color: var(--text-3); }

/* Mobile Branch Tabs */
.mobile-branch-tabs {
  display: none;
  gap: 6px;
  margin-bottom: 12px;
}

.branch-switch-btn {
  flex: 1;
  padding: 9px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(16, 18, 34, 0.9);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}
.branch-switch-btn.active {
  border-color: var(--gold-1);
  background: rgba(212, 166, 74, 0.22);
  color: #ffffff;
}

/* 3-Column WoW Talent Trees */
.talent-trees-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.talent-branch-card {
  position: relative;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-subtle);
  background-color: #0b0d18;
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 232, 163, 0.18);
  display: flex;
  flex-direction: column;
}

.branch-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.34;
  filter: saturate(1.1) contrast(1.05);
  pointer-events: none;
}

.branch-bg-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 12, 22, 0.72) 0%, rgba(10, 12, 22, 0.52) 45%, rgba(10, 12, 22, 0.85) 100%);
  pointer-events: none;
}

.branch-header {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(10, 12, 22, 0.84);
  border-bottom: 1px solid rgba(212, 166, 74, 0.32);
}

.branch-title { margin: 0; font-size: 15.5px; font-weight: 800; color: #ffffff; display: flex; align-items: center; gap: 6px; }
.branch-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.branch-pts-badge {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(212, 166, 74, 0.22);
  border: 1px solid var(--gold-2);
  color: var(--gold-1);
  font-size: 12.5px;
  font-weight: 800;
}

.branch-canvas {
  position: relative;
  z-index: 2;
  padding: 16px 14px 20px;
}

.branch-svg-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.tier-rows {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tier-row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: start;
  justify-items: center;
  min-height: 76px;
}

.tier-tag {
  position: absolute;
  left: -4px;
  top: 28px;
  transform: translateY(-50%);
  font-size: 9.5px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.38);
  pointer-events: none;
}

.talent-slot {
  grid-column: var(--col);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.talent-node-box {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.talent-info-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 4;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: #0f172a;
  color: #cbd5e1;
  font-size: 10.5px;
  font-weight: 800;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: transform 0.14s var(--spring), border-color 0.14s ease, color 0.14s ease;
}
.talent-info-btn:hover {
  border-color: var(--gold-1);
  color: var(--gold-1);
  transform: scale(1.1);
}

.talent-node {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 12px;
  border: 2.5px solid #475569;
  background: radial-gradient(circle at 30% 25%, #242942, #0d101d);
  color: #ffffff;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  transition: transform 0.14s var(--spring), border-color 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.talent-node:active { transform: scale(0.92); }
.talent-icon { font-size: 26px; line-height: 1; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.65)); }

.talent-node.is-locked {
  filter: grayscale(0.88) brightness(0.62);
  border-color: #334155;
  cursor: not-allowed;
}
.talent-node.is-prereq-locked {
  filter: grayscale(0.7) brightness(0.75);
  border-color: #64748b;
  border-style: dashed;
  cursor: not-allowed;
}

.talent-node.is-available {
  border-color: #34d399;
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.talent-node.is-available:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.65);
}

.talent-node.is-invested {
  border-color: #38bdf8;
  background: radial-gradient(circle at 30% 25%, #1e3a8a, #0f172a);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.5);
}

.talent-node.is-maxed {
  border-color: #fde047;
  background: radial-gradient(circle at 30% 25%, #854d0e, #271705);
  box-shadow: 0 0 20px rgba(250, 204, 21, 0.58), inset 0 1px 0 rgba(254, 240, 138, 0.45);
}

.talent-node.is-epic {
  width: 64px;
  height: 64px;
  border-radius: 16px;
}
.talent-node.is-epic.is-available {
  border-color: #c084fc;
  box-shadow: 0 0 22px rgba(192, 132, 252, 0.65);
}
.talent-node.is-epic.is-maxed {
  border-color: #fde047;
  background: radial-gradient(circle at 30% 25%, #7e22ce, #3b0764);
  box-shadow: 0 0 28px rgba(250, 204, 21, 0.78), 0 0 14px rgba(192, 132, 252, 0.8);
}

.talent-node.just-upgraded {
  animation: burstPop 0.45s var(--spring);
}
@keyframes burstPop {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(253, 224, 71, 0.85); }
  50% { transform: scale(1.12); box-shadow: 0 0 0 14px rgba(253, 224, 71, 0); }
  100% { transform: scale(1); }
}

.talent-rank-badge {
  position: absolute;
  bottom: -6px;
  right: -6px;
  padding: 1px 6px;
  border-radius: 6px;
  background: #090b14;
  border: 1.5px solid #475569;
  font-size: 10.5px;
  font-weight: 800;
  color: #cbd5e1;
  pointer-events: none;
}
.is-available .talent-rank-badge { border-color: #34d399; color: #6ee7b7; }
.is-invested .talent-rank-badge { border-color: #38bdf8; color: #bae6fd; }
.is-maxed .talent-rank-badge { border-color: #fde047; color: #fde047; }

.talent-type-dot {
  position: absolute;
  top: -5px;
  left: -5px;
  font-size: 11px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
}

.talent-short-label {
  margin-top: 7px;
  font-size: 10.5px;
  font-weight: 700;
  color: #e2e8f0;
  text-align: center;
  max-width: 96px;
  line-height: 1.18;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
}

/* Bottom Benefits Panel */
.benefits-panel {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(16, 20, 38, 0.96), rgba(10, 12, 24, 0.98));
  border: 2px solid var(--gold-2);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(253, 230, 138, 0.25);
}

.benefits-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(212, 166, 74, 0.28);
  margin-bottom: 14px;
}

.benefits-kicker { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold-1); }
.benefits-title { margin: 2px 0 0; font-size: 18px; font-weight: 800; color: #ffffff; }
.benefits-build-tag {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(212, 166, 74, 0.16);
  border: 1px solid var(--gold-2);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gold-1);
}

.benefits-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.stat-tile {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(24, 28, 52, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.stat-tile.has-boost {
  border-color: rgba(52, 211, 153, 0.5);
  background: rgba(16, 185, 129, 0.12);
}
.stat-tile-k { font-size: 11px; color: var(--text-3); font-weight: 600; }
.stat-tile-v { font-size: 16px; font-weight: 800; color: #ffffff; margin-top: 2px; }
.stat-tile.has-boost .stat-tile-v { color: #6ee7b7; }

.benefits-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.benefit-col {
  padding: 12px;
  border-radius: 12px;
  background: rgba(10, 12, 24, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.benefit-col h4 { margin: 0 0 10px; font-size: 13.5px; color: var(--gold-1); }
.benefit-list { display: flex; flex-direction: column; gap: 8px; }

.benefit-item {
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(28, 33, 58, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12.5px;
}
.benefit-item strong { display: block; color: #ffffff; margin-bottom: 2px; }
.benefit-item span { color: var(--text-2); font-size: 12px; }

.use-power-btn {
  margin-top: 7px;
  width: 100%;
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid #60a5fa;
  background: rgba(37, 99, 235, 0.35);
  color: #dbeafe;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.use-power-btn:disabled {
  border-color: #475569;
  background: rgba(30, 41, 59, 0.5);
  color: #94a3b8;
  cursor: not-allowed;
}

.empty-benefit { font-size: 12.5px; color: var(--text-3); font-style: italic; }

/* Quests Parchment Board */
.quest-day-pill {
  display: inline-block;
  margin-bottom: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(212, 166, 74, 0.18);
  border: 1px solid var(--gold-2);
  color: var(--gold-1);
  font-size: 11.5px;
  font-weight: 800;
}

.section-intro-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--panel-bg);
  border: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}
.section-intro-bar h3 { margin: 0; font-size: 17px; }
.section-intro-bar p { margin: 3px 0 0; font-size: 13px; color: var(--text-2); }

.quest-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chip {
  min-height: 34px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(20, 24, 44, 0.9);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.filter-chip.active { background: var(--gold-1); color: #1c1002; border-color: #fffbeb; }

.quests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.quest-parchment {
  background: var(--parchment-bg);
  color: var(--parchment-ink);
  border: 2px solid #b78535;
  border-radius: var(--radius-lg);
  padding: 15px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), inset 0 0 24px rgba(180, 130, 50, 0.18);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.quest-parchment.is-epic-quest {
  background: linear-gradient(155deg, #2e1065 0%, #1e1b4b 100%);
  color: #f8fafc;
  border-color: #fde047;
}

.q-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.q-tag {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(120, 53, 15, 0.14);
  color: #78350f;
}
.is-epic-quest .q-tag { background: rgba(253, 224, 71, 0.22); color: #fde047; }

.q-title { margin: 0; font-size: 16px; font-weight: 800; }

.q-story {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.48;
  font-style: italic;
  color: #4a2e10;
  background: rgba(255, 255, 255, 0.56);
  padding: 8px 10px;
  border-left: 3px solid #b45309;
  border-radius: 6px;
}
.is-epic-quest .q-story { background: rgba(255, 255, 255, 0.08); color: #e9d5ff; border-color: #c084fc; }

.q-steps {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.44;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.q-deliverable {
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(180, 83, 9, 0.11);
  border: 1px dashed rgba(146, 64, 14, 0.45);
  font-size: 12px;
  line-height: 1.4;
}
.is-epic-quest .q-deliverable {
  background: rgba(253, 224, 71, 0.12);
  border-color: rgba(253, 224, 71, 0.4);
  color: #fef08a;
}

.q-feedback-box {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(225, 29, 72, 0.13);
  border: 1px solid rgba(190, 18, 60, 0.45);
  color: #881337;
  font-size: 12px;
  font-weight: 700;
}
.is-epic-quest .q-feedback-box {
  background: rgba(244, 63, 94, 0.22);
  color: #ffe4e6;
}

.q-loot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.loot-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  color: #fde68a;
}

.q-action-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.q-done-btn {
  width: 100%;
  min-height: 38px;
  border-radius: 10px;
  border: 1.5px solid #92400e;
  background: linear-gradient(180deg, #f59e0b, #b45309);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.14s var(--spring);
}
.q-done-btn:active { transform: scale(0.97); }
.q-done-btn.status-pending {
  background: linear-gradient(180deg, #1d4ed8, #1e3a8a);
  border-color: #93c5fd;
  color: #eff6ff;
  cursor: default;
}
.q-done-btn.status-cooldown {
  background: linear-gradient(180deg, #047857, #064e3b);
  border-color: #6ee7b7;
  color: #ecfdf5;
  cursor: not-allowed;
}
.q-done-btn:disabled:not(.status-pending):not(.status-cooldown) {
  background: #475569;
  border-color: #64748b;
  color: #cbd5e1;
  cursor: not-allowed;
}

.q-cancel-btn {
  flex-shrink: 0;
  min-height: 38px;
  padding: 0 11px;
  border-radius: 10px;
  border: 1px solid rgba(185, 28, 28, 0.5);
  background: rgba(185, 28, 28, 0.12);
  color: #991b1b;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.is-epic-quest .q-cancel-btn {
  color: #fecdd3;
  background: rgba(244, 63, 94, 0.22);
}

.epic-quests-section { margin-top: 22px; }
.epic-section-title { margin: 0 0 4px; font-size: 18px; color: var(--gold-1); }
.epic-section-sub { margin: 0 0 12px; font-size: 13px; color: var(--text-2); }

/* GM Panel & Approval Queue */
.gm-card, .gm-box, .gm-approvals-box {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--panel-bg);
  border: 1px solid var(--border-subtle);
}
.gm-approvals-box {
  border-color: var(--gold-2);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  margin-bottom: 14px;
}
.gm-approvals-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.gm-approvals-header h4 { margin: 0; font-size: 16px; color: var(--gold-1); }
.gm-sub-copy { margin: 3px 0 0; font-size: 12.5px; color: var(--text-2); }

.gm-pending-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 12px;
}
.gm-approval-card {
  padding: 14px;
  border-radius: 12px;
  background: rgba(20, 24, 44, 0.92);
  border: 1.5px solid rgba(253, 230, 138, 0.38);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.gm-approval-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--gold-1);
  font-weight: 800;
}
.gm-hero-chip {
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.28);
  border: 1px solid rgba(192, 132, 252, 0.5);
  color: #f3e8ff;
}
.gm-hero-chip.is-leo {
  background: rgba(217, 119, 6, 0.28);
  border-color: rgba(251, 191, 36, 0.5);
  color: #fef3c7;
}
.gm-note-box {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(8, 10, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12.5px;
  color: #e2e8f0;
}
.gm-approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.gm-return-row {
  display: flex;
  gap: 6px;
}
.gm-return-row .wow-input {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  min-height: 34px;
  padding: 5px 10px;
}

.gm-pin-row, .gm-pin-set { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.wow-input, .wow-textarea {
  min-height: 38px;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(8, 10, 20, 0.9);
  color: #ffffff;
  font-size: 13.5px;
  font-family: inherit;
}
.wow-textarea {
  width: 100%;
  resize: vertical;
  min-height: 82px;
}
.gm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-top: 12px; }
.gm-btn-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.file-label { text-align: center; }

/* Modals & Tooltip */
.hidden { display: none !important; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(5, 6, 14, 0.78);
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: #101326;
  border: 2px solid var(--gold-2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(30, 41, 59, 0.9);
  color: #ffffff;
  cursor: pointer;
}

.roadmap-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.roadmap-item { padding: 10px 12px; border-radius: 10px; background: rgba(24, 28, 52, 0.85); border: 1px solid rgba(255, 255, 255, 0.12); font-size: 13px; }

.wow-tooltip {
  position: fixed;
  z-index: 70;
  max-width: 410px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  padding: 13px 15px;
  border-radius: 10px;
  background: rgba(9, 11, 22, 0.97);
  border: 1.5px solid var(--gold-2);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.85);
  pointer-events: none;
  font-size: 12.5px;
  line-height: 1.45;
}
.tt-title { font-weight: 800; font-size: 14px; color: var(--gold-1); margin-bottom: 3px; }
.tt-meta { font-size: 11px; color: var(--cyan); margin-bottom: 7px; font-weight: 700; }
.tt-direct { color: #fef08a; font-weight: 700; margin-bottom: 7px; }
.tt-ranks-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.tt-ranks-hdr {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #cbd5e1;
  margin-bottom: 2px;
}
.tt-rank-row {
  font-size: 12px;
  line-height: 1.38;
  padding: 3px 6px;
  border-radius: 6px;
}
.tt-rank-row.is-unlocked {
  background: rgba(16, 185, 129, 0.16);
  color: #a7f3d0;
  border-left: 2.5px solid #34d399;
}
.tt-rank-row.is-next {
  background: rgba(245, 158, 11, 0.16);
  color: #fde68a;
  border-left: 2.5px solid #fbbf24;
}
.tt-rank-row.is-future {
  background: rgba(30, 41, 59, 0.45);
  color: #cbd5e1;
  border-left: 2.5px solid rgba(148, 163, 184, 0.35);
}
.tt-desc { color: #e2e8f0; margin-bottom: 5px; }
.tt-next { color: #6ee7b7; font-size: 11.5px; font-weight: 700; margin-bottom: 6px; }
.tt-prereqs {
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(30, 41, 59, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 11.5px;
  margin-bottom: 6px;
}
.tt-deep {
  color: #cbd5e1;
  font-size: 11.5px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 6px;
  margin-top: 4px;
}
.tt-hint { color: #94a3b8; font-size: 11px; margin-top: 6px; }

/* Tienda del Reino */
.shop-wallet-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.shop-gold-pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(212, 166, 74, 0.16);
  border: 1px solid var(--gold-2);
  font-size: 13px;
  color: #fde68a;
}
.shop-gold-pill strong { color: #fde047; font-size: 15px; }

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.shop-card {
  padding: 15px;
  border-radius: var(--radius-lg);
  background: var(--panel-bg);
  border: 1.5px solid var(--border-subtle);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}
.shop-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.shop-icon { font-size: 28px; line-height: 1; }
.shop-cat-badge {
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #bae6fd;
}
.shop-title { margin: 4px 0 3px; font-size: 15.5px; font-weight: 800; color: #ffffff; }
.shop-desc { font-size: 12.5px; color: var(--text-2); line-height: 1.42; }
.shop-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.price-old {
  font-size: 13px;
  color: var(--text-3);
  text-decoration: line-through;
}
.price-now {
  font-size: 17px;
  font-weight: 800;
  color: #fde047;
}
.price-disc-tag {
  font-size: 11px;
  font-weight: 800;
  color: #6ee7b7;
}
.price-nodisc-tag {
  font-size: 11px;
  font-weight: 700;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 999px;
  padding: 2px 7px;
}

.shop-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 10px;
}
.shop-history-item {
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--panel-bg);
  border: 1px solid rgba(52, 211, 153, 0.35);
  font-size: 12.5px;
}
.shop-history-item strong { display: block; color: #ffffff; margin-bottom: 2px; }
.shop-history-item span { color: var(--text-3); font-size: 11.5px; }

.gm-shop-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gm-shop-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.gm-shop-row .wow-input[type="number"] { width: 88px; }
.gm-custom-shop-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.gm-custom-shop-pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px;
}

/* PC Control & Interactive Game Checklist */
.pc-control-box {
  margin-bottom: 14px;
}
.pc-hero-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pc-status-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(8, 10, 20, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 10px;
}
.pc-meta-copy { font-size: 12.5px; font-weight: 700; color: #e2e8f0; }
.pc-evt-copy { font-size: 12px; color: #fda4af; font-weight: 700; }
.pill-study { background: rgba(124, 58, 237, 0.25); border-color: #c084fc; color: #f3e8ff; }

.pc-mode-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.pc-checklist-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.pc-checklist-toolbar .wow-input {
  flex: 1 1 240px;
  min-width: 0;
}
.pc-checklist-wrap {
  max-height: 310px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(8, 10, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 10px;
}
.pc-game-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(24, 28, 52, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.pc-game-row.is-checked {
  border-color: rgba(244, 63, 94, 0.55);
  background: rgba(136, 19, 55, 0.24);
}
.pc-game-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: #f43f5e;
  flex-shrink: 0;
}
.pc-game-info {
  min-width: 0;
  flex: 1;
}
.pc-game-info strong {
  display: block;
  font-size: 12.5px;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pc-game-info small {
  display: block;
  font-size: 11px;
  color: var(--text-3);
}
.pc-manual-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.pc-manual-row .wow-input {
  flex: 1 1 170px;
  min-width: 0;
}
.cloud-sync-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast-container {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
}
.toast {
  padding: 11px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1e1b4b, #4c1d95);
  border: 1.5px solid var(--gold-1);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65);
  animation: fadeIn 0.2s ease;
}

/* Responsive Breakpoints */
@media (max-width: 1023px) {
  .hero-hud-card { grid-template-columns: 1fr; }
  .hud-portrait-wrap { margin: 0 auto; }
  .mobile-branch-tabs { display: flex; }
  .talent-trees-grid { grid-template-columns: 1fr; }
  .talent-branch-card.mobile-hidden { display: none; }
  .benefits-columns { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .app-shell { padding: 10px 10px 44px; }
  .wow-topbar { padding: 10px 12px; }
  .brand-title { font-size: 17px; }
  .gm-btn-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Google Auth Gate & Session Pill */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(circle at top, rgba(30, 27, 75, 0.94), rgba(5, 7, 16, 0.98));
  backdrop-filter: blur(10px);
}
.auth-gate.hidden { display: none; }
.auth-card {
  width: min(100%, 420px);
  padding: 28px 24px;
  text-align: center;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(17, 22, 42, 0.98), rgba(10, 12, 24, 0.98));
  border: 2px solid var(--gold-2);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.85), 0 0 36px rgba(212, 166, 74, 0.18);
}
.auth-crest {
  font-size: 42px;
  margin-bottom: 6px;
}
.auth-title {
  margin: 4px 0 8px;
  font-size: 24px;
  font-weight: 800;
  color: #fde68a;
  letter-spacing: -0.02em;
}
.auth-sub {
  margin: 0 0 18px;
  font-size: 13.5px;
  line-height: 1.45;
  color: #cbd5e1;
}
.google-signin-slot {
  min-height: 46px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
}
.auth-status-msg {
  font-size: 12.5px;
  font-weight: 600;
  color: #93c5fd;
  min-height: 18px;
}
.auth-status-msg.is-error { color: #fda4af; }
.auth-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 4px 3px 11px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(212, 166, 74, 0.45);
  font-size: 12px;
  font-weight: 700;
  color: #fde68a;
}
.auth-user-pill.hidden { display: none; }
.auth-logout-btn {
  min-height: 28px;
  padding: 3px 10px;
  font-size: 11.5px;
  border-radius: 999px;
}
