/* ==========================================================================
   Back to Twos — Consolidated Guild Theme (theme.css)
   Unified Design System: Palette, Typography, WoW Class & Role Utilities,
   Header, Navigation, Cards, Badges, Modals, and Config Components
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens & Root Variables
   -------------------------------------------------------------------------- */
:root {
  /* Active Patch Theme Canonical Tokens (Patch 12.2: Void & Azerite default) */
  --theme-bg-void: #060510;
  --theme-bg-rail: #090718;
  --theme-bg-card: #110d26;
  --theme-bg-elevated: #1a1438;
  --theme-border: rgba(168, 85, 247, 0.32);
  --theme-border-strong: rgba(245, 158, 11, 0.50);
  --theme-accent: #a855f7;
  --theme-accent-light: #c084fc;
  --theme-accent-subtle: rgba(168, 85, 247, 0.16);
  --theme-accent-secondary: #f59e0b;
  --theme-gold: #f59e0b;
  --theme-gold-light: #fde047;
  --theme-glow: rgba(168, 85, 247, 0.38);
  --theme-glow-secondary: rgba(250, 204, 21, 0.16);
  --theme-on-accent: #090614;
  --theme-text-main: #f8f7ff;

  --bg-dark: var(--theme-bg-void);
  --bg-base: var(--theme-bg-rail);
  --bg-card: var(--theme-bg-card);
  --bg-card-hover: var(--theme-bg-elevated);
  --border-card: var(--theme-border);
  --border-card-subtle: rgba(255, 255, 255, 0.08);

  /* Unified Patch Theme Surface Tokens (overridden dynamically by cache-buster in base.html) */
  --theme-site-bg: url('/static/img/branding/brand_site_bg.png?v=12');
  --theme-hero-bg: url('/static/img/branding/brand_header_bg.png?v=12');
  --theme-sidebar-bg: url('/static/img/themes/void_azerite/sidebar_bg.png?v=12');
  --theme-header-plaque: url('/static/img/themes/void_azerite/card_header_plaque.png?v=12');
  --theme-nav-plaque: url('/static/img/branding/brand_nav_btn.png?v=12');

  /* Accent Aliases (mapped onto legacy --purple-* vars for seamless page styling) */
  --venom-primary: var(--theme-accent);
  --venom-light: var(--theme-accent-light);
  --purple-primary: var(--theme-accent);
  --purple-light: var(--theme-accent-light);
  --purple-subtle: var(--theme-accent-subtle);
  --purple-border: var(--theme-border-strong);

  /* Highlights & Glows */
  --crest-pink: var(--theme-accent-light);
  --crest-pink-dark: var(--theme-accent);
  --crest-glow: var(--theme-glow);
  --crest-subtle: var(--theme-accent-subtle);

  /* Gold / Secondary Trims */
  --gold-primary: var(--theme-gold);
  --gold-light: var(--theme-gold-light);
  --gold-glow: rgba(245, 158, 11, 0.28);
  --gold-border: rgba(245, 158, 11, 0.38);

  /* Typography */
  --text-main: var(--theme-text-main);
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;

  /* Status Badges */
  --status-kill: #22c55e;
  --status-kill-bg: rgba(34, 197, 94, 0.15);
  --status-wipe: #ef4444;
  --status-prog: #facc15;

  /* Official WoW Class Palette */
  --color-death-knight: #C41E3A;
  --color-demon-hunter: #A330C9;
  --color-druid:        #FF7C0A;
  --color-evoker:       #33937F;
  --color-hunter:       #AAD372;
  --color-mage:         #3FC7EB;
  --color-monk:         #00FF98;
  --color-paladin:      #F48CBA;
  --color-priest:       #FFFFFF;
  --color-rogue:        #FFF468;
  --color-shaman:       #0070DD;
  --color-warlock:      #8788EE;
  --color-warrior:      #C69B6D;

  /* Aliases for --cls- variables */
  --cls-death-knight: var(--color-death-knight);
  --cls-demon-hunter: var(--color-demon-hunter);
  --cls-druid:        var(--color-druid);
  --cls-evoker:       var(--color-evoker);
  --cls-hunter:       var(--color-hunter);
  --cls-mage:         var(--color-mage);
  --cls-monk:         var(--color-monk);
  --cls-paladin:      var(--color-paladin);
  --cls-priest:       var(--color-priest);
  --cls-rogue:        var(--color-rogue);
  --cls-shaman:       var(--color-shaman);
  --cls-warlock:      var(--color-warlock);
  --cls-warrior:      var(--color-warrior);

  /* WoW Roles */
  --role-tank:   #3b82f6;
  --role-healer: #22c55e;
  --role-melee:  #f97316;
  --role-ranged: #a855f7;
}

/* --------------------------------------------------------------------------
   2. Global Resets, Typography & Scrollbars
   -------------------------------------------------------------------------- */
* {
  box-sizing: border-box;
}

html {
  scrollbar-width: thin;
  scrollbar-color: var(--theme-border-strong) var(--theme-bg-void);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--theme-bg-void);
}
::-webkit-scrollbar-thumb {
  background: var(--theme-border-strong);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--theme-accent-light);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--theme-bg-void);
  position: relative;
  color: var(--text-main);
  margin: 0;
  min-height: 100vh;
  padding: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--theme-bg-void);
  background-image:
    radial-gradient(ellipse at 70% 0%, var(--theme-accent-subtle) 0%, transparent 55%),
    radial-gradient(ellipse at 20% 90%, var(--theme-glow-secondary) 0%, transparent 50%),
    linear-gradient(180deg, rgba(4, 5, 12, 0.44) 0%, rgba(4, 5, 12, 0.76) 100%),
    var(--theme-site-bg);
  background-size: auto, auto, auto, cover;
  background-position: center top, center, center, center top;
  transform: translateZ(0);
}

.page-content {
  flex: 1 0 auto;
}

.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--theme-border);
  padding: 1.25rem 0;
  margin-top: 2.5rem;
  text-align: center;
  font-size: 0.84rem;
  color: var(--text-dim);
}
.site-footer strong {
  color: var(--gold-light);
}

/* --------------------------------------------------------------------------
   3. Loa Shrine Compact Non-Scrolling Left Sidebar & App Shell
   -------------------------------------------------------------------------- */
.app-shell {
  display: flex;
  min-height: 100vh;
  align-items: flex-start;
}

.site-sidebar {
  width: 248px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  background-color: var(--theme-bg-rail);
  background-image:
    linear-gradient(180deg, rgba(6, 10, 14, 0.78) 0%, rgba(4, 7, 10, 0.94) 100%),
    var(--theme-sidebar-bg);
  background-size: cover;
  background-position: center;
  border-right: 2px solid var(--theme-border-strong);
  box-shadow: inset -1px 0 0 var(--theme-border), 8px 0 28px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  z-index: 90;
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.24s ease;
}

html.nav-collapsed .site-sidebar,
body.nav-collapsed .site-sidebar {
  width: 72px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.65rem;
  min-height: 52px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  min-width: 0;
  flex: 1;
}

.sidebar-brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px var(--theme-glow));
}

.sidebar-brand-text {
  min-width: 0;
  flex: 1;
}

.sidebar-brand-title {
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--gold-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-brand-sub {
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--venom-light);
}

.sidebar-collapse-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--theme-border-strong);
  background: var(--theme-bg-elevated);
  color: var(--gold-light);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
  transition: all 0.16s ease;
}

.sidebar-collapse-btn:hover {
  background: var(--theme-accent-subtle);
  border-color: var(--venom-light);
}

html.nav-collapsed .sidebar-brand,
body.nav-collapsed .sidebar-brand {
  flex-direction: column;
  justify-content: center;
  padding: 0.5rem 0.35rem;
  gap: 0.35rem;
}

html.nav-collapsed .sidebar-brand-text,
body.nav-collapsed .sidebar-brand-text,
html.nav-collapsed .nav-item-label,
body.nav-collapsed .nav-item-label,
html.nav-collapsed .nav-item-badge,
body.nav-collapsed .nav-item-badge,
html.nav-collapsed .sidebar-section-title,
body.nav-collapsed .sidebar-section-title,
html.nav-collapsed .user-details,
body.nav-collapsed .user-details,
html.nav-collapsed .user-chevron,
body.nav-collapsed .user-chevron,
html.nav-collapsed .sidebar-footer-sub,
body.nav-collapsed .sidebar-footer-sub {
  display: none !important;
}

.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: visible;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: 0.4rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.sidebar-nav::-webkit-scrollbar {
  display: none;
}

html.nav-collapsed .sidebar-nav,
body.nav-collapsed .sidebar-nav {
  overflow: visible;
  align-items: center;
  padding: 0.45rem 0.35rem;
}

.sidebar-section-title {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.22rem 0.45rem 0.1rem;
}

.sidebar-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.58rem;
  padding: 0.32rem 0.55rem;
  border-radius: 7px;
  color: var(--theme-text-main);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  background-color: var(--theme-bg-card);
  background-image:
    linear-gradient(180deg, rgba(10, 8, 22, 0.42), rgba(5, 4, 12, 0.62)),
    var(--theme-nav-plaque);
  background-size: 100% 100%;
  border: 1px solid var(--theme-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 8px rgba(0, 0, 0, 0.45);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  transition: all 0.16s ease;
}

.sidebar-nav-item:hover,
.sidebar-nav-item.active {
  color: var(--theme-gold-light);
  border-color: var(--theme-gold-light);
  background-image:
    linear-gradient(90deg, var(--theme-accent-subtle), rgba(245, 158, 11, 0.18)),
    var(--theme-nav-plaque);
  box-shadow: 0 0 14px var(--theme-glow), inset 0 0 12px var(--theme-accent-subtle);
}

.nav-wow-ico {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--theme-gold-light);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.75), 0 0 8px var(--theme-glow);
}

.nav-item-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item-badge {
  margin-left: auto;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: var(--gold-light);
}

html.nav-collapsed .sidebar-nav-item,
body.nav-collapsed .sidebar-nav-item {
  width: 42px;
  height: 40px;
  padding: 0;
  justify-content: center;
}

html.nav-collapsed .nav-wow-ico,
body.nav-collapsed .nav-wow-ico {
  width: 28px;
  height: 28px;
}

html.nav-collapsed .sidebar-nav-item:hover::after,
body.nav-collapsed .sidebar-nav-item:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--theme-bg-card);
  border: 1px solid var(--theme-border-strong);
  color: var(--theme-text-main);
  padding: 0.34rem 0.72rem;
  border-radius: 7px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
  z-index: 160;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.75);
  pointer-events: none;
}

.sidebar-footer {
  padding: 0.45rem 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar-signin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.8rem;
  color: #05120c;
  background: linear-gradient(135deg, var(--gold-light), var(--gold-primary));
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.32);
}

.app-stage {
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1 0 auto;
  max-width: 1520px;
  margin: 0 auto;
  padding: 1.45rem 1.75rem 2.5rem;
  width: 100%;
  box-sizing: border-box;
}

.mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.95rem;
  background: var(--theme-bg-rail);
  border-bottom: 1px solid var(--theme-border-strong);
  position: sticky;
  top: 0;
  z-index: 80;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 4, 0.72);
  z-index: 85;
}

.sidebar-backdrop.open {
  display: block;
}

.mobile-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--theme-accent-subtle);
  border: 1px solid var(--theme-border-strong);
  color: var(--theme-text-main);
  font-size: 1.2rem;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
}

@media (max-width: 960px) {
  .mobile-topbar {
    display: flex;
  }
  .site-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    transform: translateX(-105%);
    width: 256px !important;
  }
  .site-sidebar.mobile-open {
    transform: translateX(0);
  }
  .main-content {
    padding: 1rem 0.9rem 4.5rem !important;
  }
}

/* User Dropdown Widget in Sidebar Footer */
.user-dropdown-wrapper {
  position: relative;
  display: block;
  width: 100%;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  background: var(--theme-accent-subtle);
  border: 1px solid var(--theme-border);
  border-radius: 9px;
  padding: 0.32rem 0.5rem;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}
.user-chip:hover {
  background: var(--theme-bg-elevated);
  border-color: rgba(251, 191, 36, 0.55);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}
html.nav-collapsed .user-chip,
body.nav-collapsed .user-chip {
  justify-content: center;
  padding: 0.28rem;
}
.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid var(--gold-primary);
  background: var(--theme-bg-card);
}
.user-avatar-placeholder {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--theme-accent-subtle);
  border: 1.5px solid var(--venom-light);
  color: var(--venom-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
}
.user-details {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: left;
  min-width: 0;
  flex: 1;
}
.user-alias {
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-subtext {
  font-size: 0.7rem;
  font-weight: 600;
}
.user-chevron {
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-left: auto;
}

.user-dropdown-menu {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  background: var(--theme-bg-card);
  border: 1px solid var(--theme-border-strong);
  box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.75);
  border-radius: 9px;
  min-width: 210px;
  z-index: 1000;
  padding: 0.4rem 0;
}
html.nav-collapsed .user-dropdown-menu,
body.nav-collapsed .user-dropdown-menu {
  left: calc(100% + 10px);
  right: auto;
  bottom: 0;
  width: 220px;
}
.user-dropdown-menu::before {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  right: 0;
  height: 10px;
}
.user-dropdown-wrapper.is-open .user-dropdown-menu {
  display: block !important;
}
.user-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  color: #cbd5e1;
  font-size: 0.8rem;
  text-decoration: none;
  transition: background 0.15s ease;
}
.user-dropdown-menu a:hover {
  background: var(--theme-accent-subtle);
  color: #fde68a;
}
.user-dropdown-divider {
  height: 1px;
  background: var(--theme-border);
  margin: 0.3rem 0;
}

/* --------------------------------------------------------------------------
   4. Buttons & Badges
   -------------------------------------------------------------------------- */
.btn-gold {
  background: linear-gradient(135deg, var(--gold-light, #fbbf24), var(--gold-primary, #d97706));
  color: var(--theme-on-accent, #04130d);
  font-weight: 700;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.4rem;
  cursor: pointer;
  font-size: 0.88rem;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.25);
  text-decoration: none;
}
.btn-gold:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  border-radius: 6px;
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  border-radius: 6px;
  padding: 0.45rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.28);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.btn-purple {
  background: linear-gradient(135deg, var(--theme-accent), var(--theme-accent-light));
  border: 1px solid var(--theme-border-strong);
  color: var(--theme-on-accent);
  font-weight: 700;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.6rem 1.25rem;
  transition: all 0.2s ease;
  box-shadow: 0 0 14px var(--theme-glow);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}
.btn-purple:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 20px var(--theme-glow);
  transform: translateY(-1px);
}

.btn-all-tiers {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: linear-gradient(135deg, var(--theme-accent-subtle) 0%, rgba(245, 158, 11, 0.16) 100%);
  border: 1px solid var(--theme-border-strong);
  color: var(--theme-text-main);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.28rem 0.65rem;
  border-radius: 9999px;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.btn-all-tiers:hover {
  background: linear-gradient(135deg, var(--theme-accent-subtle) 0%, rgba(245, 158, 11, 0.28) 100%);
  border-color: rgba(251, 191, 36, 0.75);
  color: #fde68a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--theme-glow);
}
.btn-all-tiers svg {
  transition: transform 0.2s ease;
}
.btn-all-tiers:hover svg {
  transform: translate(1px, -1px);
}

/* --------------------------------------------------------------------------
   5. WoW Class Colors (Comprehensive Multi-casing Coverage)
   -------------------------------------------------------------------------- */
/* Death Knight */
.class-Death-Knight, .class-death-knight, .class-deathknight,
.color-death-knight, .text-death-knight { color: var(--color-death-knight) !important; }
.bg-death-knight { background-color: rgba(196, 30, 58, 0.15) !important; border-color: rgba(196, 30, 58, 0.35) !important; }

/* Demon Hunter */
.class-Demon-Hunter, .class-demon-hunter, .class-demonhunter,
.color-demon-hunter, .text-demon-hunter { color: var(--color-demon-hunter) !important; }
.bg-demon-hunter { background-color: rgba(163, 48, 201, 0.15) !important; border-color: rgba(163, 48, 201, 0.35) !important; }

/* Druid */
.class-Druid, .class-druid,
.color-druid, .text-druid { color: var(--color-druid) !important; }
.bg-druid { background-color: rgba(255, 124, 10, 0.15) !important; border-color: rgba(255, 124, 10, 0.35) !important; }

/* Evoker */
.class-Evoker, .class-evoker,
.color-evoker, .text-evoker { color: var(--color-evoker) !important; }
.bg-evoker { background-color: rgba(51, 147, 127, 0.15) !important; border-color: rgba(51, 147, 127, 0.35) !important; }

/* Hunter */
.class-Hunter, .class-hunter,
.color-hunter, .text-hunter { color: var(--color-hunter) !important; }
.bg-hunter { background-color: rgba(170, 211, 114, 0.15) !important; border-color: rgba(170, 211, 114, 0.35) !important; }

/* Mage */
.class-Mage, .class-mage,
.color-mage, .text-mage { color: var(--color-mage) !important; }
.bg-mage { background-color: rgba(63, 199, 235, 0.15) !important; border-color: rgba(63, 199, 235, 0.35) !important; }

/* Monk */
.class-Monk, .class-monk,
.color-monk, .text-monk { color: var(--color-monk) !important; }
.bg-monk { background-color: rgba(0, 255, 152, 0.15) !important; border-color: rgba(0, 255, 152, 0.35) !important; }

/* Paladin */
.class-Paladin, .class-paladin,
.color-paladin, .text-paladin { color: var(--color-paladin) !important; }
.bg-paladin { background-color: rgba(244, 140, 186, 0.15) !important; border-color: rgba(244, 140, 186, 0.35) !important; }

/* Priest */
.class-Priest, .class-priest,
.color-priest, .text-priest { color: var(--color-priest) !important; }
.bg-priest { background-color: rgba(255, 255, 255, 0.12) !important; border-color: rgba(255, 255, 255, 0.3) !important; }

/* Rogue */
.class-Rogue, .class-rogue,
.color-rogue, .text-rogue { color: var(--color-rogue) !important; }
.bg-rogue { background-color: rgba(255, 244, 104, 0.15) !important; border-color: rgba(255, 244, 104, 0.35) !important; }

/* Shaman */
.class-Shaman, .class-shaman,
.color-shaman, .text-shaman { color: var(--color-shaman) !important; }
.bg-shaman { background-color: rgba(0, 112, 221, 0.15) !important; border-color: rgba(0, 112, 221, 0.35) !important; }

/* Warlock */
.class-Warlock, .class-warlock,
.color-warlock, .text-warlock { color: var(--color-warlock) !important; }
.bg-warlock { background-color: rgba(135, 136, 238, 0.15) !important; border-color: rgba(135, 136, 238, 0.35) !important; }

/* Warrior */
.class-Warrior, .class-warrior,
.color-warrior, .text-warrior { color: var(--color-warrior) !important; }
.bg-warrior { background-color: rgba(198, 155, 109, 0.15) !important; border-color: rgba(198, 155, 109, 0.35) !important; }

/* --------------------------------------------------------------------------
   6. WoW Roles & Role Badges
   -------------------------------------------------------------------------- */
.role-tank, .badge-tank, .role-tag-tank {
  color: #60a5fa !important;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.role-healer, .badge-healer, .role-tag-healer {
  color: #4ade80 !important;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.role-melee, .badge-melee, .role-tag-melee {
  color: #fb923c !important;
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.35);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.role-ranged, .badge-ranged, .role-tag-ranged {
  color: #c084fc !important;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   7. Guild Ranks & Member Badges
   -------------------------------------------------------------------------- */
.player-rank {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-left: 0.35rem;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

.player-rank[data-rank="GM"], .rank-gm {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #fca5a5 !important;
  border: 1px solid rgba(239, 68, 68, 0.5) !important;
}

.player-rank[data-rank="Officer"], .rank-officer {
  background: var(--theme-accent-subtle) !important;
  color: var(--theme-accent-light) !important;
  border: 1px solid var(--theme-border-strong) !important;
}

.player-rank[data-rank="Raider"], .rank-raider {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #bfdbfe !important;
  border: 1px solid rgba(59, 130, 246, 0.5) !important;
}

.player-rank[data-rank="Social"], .rank-social {
  background: rgba(34, 197, 94, 0.15) !important;
  color: #bbf7d0 !important;
  border: 1px solid rgba(34, 197, 94, 0.5) !important;
}

.player-rank[data-rank="Trial"], .rank-trial {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fde68a !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
}

.player-rank[data-rank="Guest"], .rank-guest {
  color: #cbd5e1 !important;
  background: var(--theme-bg-elevated) !important;
  border: 1px solid rgba(148, 163, 184, 0.4) !important;
}

.rank-web-admin {
  background: rgba(6, 182, 212, 0.15) !important;
  color: #22d3ee !important;
  border: 1px solid rgba(34, 211, 238, 0.5) !important;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.25) !important;
  font-weight: 800 !important;
  text-shadow: 0 0 8px rgba(34, 211, 238, 0.4);
}

/* --------------------------------------------------------------------------
   8. Raid Progression & Encounter Badges
   -------------------------------------------------------------------------- */
.badge-mythic-kill {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
}

.badge-heroic-kill {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
}

.badge-normal-kill {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
}

.badge-defeated {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.65rem;
  text-transform: uppercase;
}

.badge-progress {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.35);
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.65rem;
  text-transform: uppercase;
}

.badge-unattempted {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.65rem;
  text-transform: uppercase;
}

/* Difficulty Matrix Grid */
.diff-matrix {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin-top: 0.5rem;
  background: rgba(4, 7, 14, 0.65);
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--theme-border);
  font-size: 0.75rem;
}
.diff-cell {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.diff-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  font-weight: 600;
}
.diff-val {
  font-size: 0.72rem;
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   9. Cards, Glassmorphism & Layout Wrappers
   -------------------------------------------------------------------------- */
.theme-card {
  background: linear-gradient(155deg, var(--theme-bg-card), var(--theme-bg-void));
  border: 1px solid var(--theme-border-strong);
  border-radius: 10px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5), 0 0 20px var(--theme-accent-subtle);
  padding: 1.25rem;
  backdrop-filter: blur(8px);
}

.cfg-layout {
  max-width: 1250px;
  margin: 0.75rem auto 2rem;
  padding: 0 0.5rem;
}

.cfg-card {
  background: linear-gradient(155deg, var(--theme-bg-card), var(--theme-bg-void));
  border: 1px solid var(--theme-border-strong);
  border-radius: 10px;
  padding: 1.4rem;
  margin-bottom: 1.75rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.cfg-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.cfg-card-title {
  margin: 0 0 0.4rem 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.cfg-card-desc, .cfg-desc {
  color: var(--text-muted, #94a3b8);
  font-size: 0.88rem;
  margin: 0 0 1.5rem 0;
}

/* --------------------------------------------------------------------------
   10. Config Sub-Navigation Component
   -------------------------------------------------------------------------- */
.config-header-container {
  margin-bottom: 2rem;
}
.config-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}
.config-nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.5rem;
  overflow-x: auto;
}
.config-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-muted, #94a3b8);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.15s ease;
  white-space: nowrap;
}
.config-tab-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.15);
}
.config-tab-btn.active {
  color: var(--theme-on-accent, #04130d);
  background: linear-gradient(135deg, var(--gold-light, #fbbf24), var(--gold-primary, #d97706));
  border-color: transparent;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.35);
}

/* --------------------------------------------------------------------------
   11. Modal Base Styles
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-overlay.active {
  display: flex;
}
.modal-box {
  background: var(--theme-bg-card);
  border: 1px solid var(--theme-border-strong);
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.65);
}
.modal-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  color: #fff;
  font-size: 0.88rem;
  box-sizing: border-box;
  margin-bottom: 0.75rem;
}
.modal-input:focus {
  outline: none;
  border-color: var(--gold-light, #fbbf24);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}
