/* ===================================================================
   MORDHEIM CAMPAIGN MANAGER - ENHANCED BATTLE SETUP LAYOUT
   Verbesserte UX/UI fuer Schlachtvorbereitung mit Animationen
   Burger-Menu fuer Mobile Navigation
   Version: 2026-02-09
   =================================================================== */

/* Reset Body Margins */
html, body {
  margin: 0 !important;
  padding: 0 !important;
}

/* ===== TOP NAVIGATION BAR ===== */
#top-nav {
  background: linear-gradient(180deg, #1a1614 0%, #0d0b0a 100%);
  border-bottom: 2px solid var(--color-gold, #c9a959);
  position: sticky;
  top: 0;
  z-index: 10001;
  width: 100%;
  height: 56px;
}

.top-nav-inner {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 20px;
}

.top-nav-brand a {
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-gold, #c9a959);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-nav-brand .nav-logo {
  height: 36px;
  width: auto;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
  transition: filter 0.2s ease;
}

.top-nav-brand a:hover .nav-logo {
  filter: drop-shadow(0 2px 4px rgba(201, 169, 89, 0.4));
}

.top-nav-brand a:hover {
  color: #e0c77a;
}

.top-nav-links {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ===================================================================
   NAV ITEMS — Scoped under .top-nav-links for high specificity.
   Overrides mordheim-theme.css "a { color: gold }" and
   browser button defaults. Uses parent > element+class selectors.
   =================================================================== */

/* Base — ALL nav items: <a> links AND <button> triggers */
.top-nav-links a.top-nav-link,
.top-nav-links button.top-nav-dropdown-trigger {
  font-family: 'Lato', -apple-system, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #777;
  text-decoration: none;
  padding: 7px 14px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  background: transparent;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  /* Full button reset */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  outline: none;
  line-height: 1.4;
  margin: 0;
  box-sizing: border-box;
}

.top-nav-links a.top-nav-link .nav-icon {
  font-size: 1rem;
  line-height: 1;
}

.top-nav-links a.top-nav-link .nav-label,
.top-nav-links button.top-nav-dropdown-trigger .nav-label {
  font-family: 'Lato', -apple-system, sans-serif;
}

/* Hover — gold shimmer */
.top-nav-links a.top-nav-link:hover,
.top-nav-links .top-nav-dropdown:hover > button.top-nav-dropdown-trigger {
  color: #e0e0e0;
  background: rgba(201, 169, 89, 0.08);
  border-color: rgba(201, 169, 89, 0.3);
  text-decoration: none;
}

/* Active — gold accent */
.top-nav-links a.top-nav-link.active,
.top-nav-links .top-nav-dropdown.active > button.top-nav-dropdown-trigger {
  color: var(--color-gold, #c9a959);
  background: rgba(201, 169, 89, 0.08);
  border-color: rgba(201, 169, 89, 0.35);
  text-decoration: none;
}

/* Dropdown container */
.top-nav-dropdown {
  position: relative;
  display: inline-flex;
}

/* Dropdown arrow */
.dropdown-arrow {
  font-size: 0.55rem;
  opacity: 0.4;
  transition: transform 0.2s, opacity 0.2s;
  margin-left: 2px;
}

.top-nav-dropdown:hover .dropdown-arrow {
  transform: rotate(180deg);
  opacity: 0.7;
}

/* Dropdown menu — invisible bridge via padding-top */
.top-nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding-top: 4px;
  min-width: 200px;
  z-index: 1000;
}

.top-nav-dropdown-menu-inner {
  background: var(--bg-card, #2d2d2d);
  border: 1px solid var(--border-color, #444);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  overflow: hidden;
  padding: 4px 0;
}

.top-nav-dropdown:hover > .top-nav-dropdown-menu {
  display: block;
}

.top-nav-dropdown-menu-inner a.dropdown-item {
  display: block;
  padding: 10px 16px;
  color: var(--text-secondary, #b0b0b0);
  text-decoration: none;
  font-family: 'Lato', sans-serif;
  font-size: 0.88rem;
  transition: all 0.15s;
  white-space: nowrap;
}

.top-nav-dropdown-menu-inner a.dropdown-item:hover {
  background: rgba(201,169,89,0.1);
  color: var(--color-gold, #c9a959);
  text-decoration: none;
}

/* ===================================================================
   GREETING BAR (inside .header-titles from site-header)
   =================================================================== */

#header-greeting .greeting-text {
  color: var(--text-muted, #888);
  font-family: 'Lato', sans-serif;
  font-size: 0.95rem;
}

#header-greeting .greeting-name {
  color: var(--color-gold, #c9a959);
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 600;
}

#header-greeting .greeting-warband,
#header-greeting .greeting-titles {
  color: var(--text-secondary, #b0b0b0);
  font-size: 0.88rem;
}

#header-greeting .greeting-warband strong,
#header-greeting .greeting-titles strong {
  color: var(--text-primary, #e0e0e0);
}

/* Hide dropdown menus on mobile (burger menu takes over) */
@media (max-width: 900px) {
  .top-nav-dropdown-menu {
    display: none !important;
  }
}

.top-nav-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* ===== FLYOUT MENU ===== */
.flyout-container {
  position: relative;
}

.flyout-trigger {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  color: var(--text-secondary, #a0998f);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.flyout-trigger .nav-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.flyout-trigger:hover {
  color: var(--text-primary, #e8e2d9);
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.2);
}

.flyout-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: linear-gradient(180deg, #2a2520 0%, #1a1614 100%);
  border: 1px solid var(--color-gold, #c9a959);
  border-radius: 8px;
  min-width: 220px;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 10002;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.flyout-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.flyout-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: var(--text-primary, #e8e2d9);
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.flyout-item:hover {
  background: rgba(201, 169, 89, 0.15);
  color: var(--color-gold, #c9a959);
}

/* ===== BURGER MENU BUTTON (nur mobil sichtbar) ===== */
.burger-btn {
  display: none; /* Desktop: versteckt */
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.burger-btn:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(201, 169, 89, 0.4);
}

.burger-btn .burger-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-secondary, #a0998f);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Burger -> X Animation */
.burger-btn.open .burger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
  background: var(--color-gold, #c9a959);
}
.burger-btn.open .burger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.burger-btn.open .burger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
  background: var(--color-gold, #c9a959);
}

/* ===== MOBILE MENU OVERLAY ===== */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  opacity: 0;
  pointer-events: none; /* KRITISCH: Unsichtbares Overlay darf keine Klicks fangen! */
  transition: opacity 0.2s ease;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.mobile-menu-overlay.visible {
  opacity: 1;
  pointer-events: auto; /* Nur wenn sichtbar: Klicks abfangen */
}

/* ===== MOBILE DROPDOWN MENU ===== */
.mobile-menu {
  display: none;
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, #1a1614 0%, #0d0b0a 100%);
  border-bottom: 2px solid var(--color-gold, #c9a959);
  z-index: 10001;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, box-shadow 0.3s ease;
  box-shadow: none;
}

.mobile-menu.open {
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.mobile-menu-inner {
  padding: 8px 0;
}

/* Mobile Navigation Links */
.mobile-menu .mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  color: var(--text-secondary, #a0998f);
  text-decoration: none;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu .mobile-nav-link:hover,
.mobile-menu .mobile-nav-link:active {
  color: var(--text-primary, #e8e2d9);
  background: rgba(255,255,255,0.05);
  border-left-color: rgba(201, 169, 89, 0.3);
}

.mobile-menu .mobile-nav-link.active {
  color: var(--color-gold, #c9a959);
  background: rgba(201, 169, 89, 0.1);
  border-left-color: var(--color-gold, #c9a959);
}

.mobile-menu .mobile-nav-link .nav-icon {
  font-size: 1.2rem;
  width: 28px;
  text-align: center;
}

/* Mobile Menu Trenner */
.mobile-menu-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 169, 89, 0.3), transparent);
  margin: 8px 20px;
}

/* Mobile Menu Section Label */
.mobile-menu-section {
  padding: 10px 20px 4px;
  font-size: 0.7rem;
  color: var(--text-muted, #888);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-family: 'Cinzel', serif;
}

/* Mobile User Info am unteren Rand */
.mobile-user-info {
  padding: 12px 20px;
  border-top: 1px solid rgba(201, 169, 89, 0.15);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-user-info .user-avatar {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.mobile-user-info .user-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-user-info .user-name {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  color: var(--text-primary, #e8e2d9);
}

.mobile-user-info .user-role {
  font-size: 0.75rem;
  color: var(--text-muted, #888);
}

/* ===== RESPONSIVE: Burger Menu ab 768px ===== */
@media (max-width: 768px) {
  .burger-btn {
    display: flex;
  }

  .top-nav-links,
  .top-nav-right .flyout-container {
    display: none !important;
  }

  /* User Badge auf mobil versteckt - Profil ist im Burger Menu */
  #user-nav-badge {
    display: none !important;
  }

  .mobile-menu,
  .mobile-menu-overlay {
    display: block;
  }

  /* Top Nav kompakter */
  .top-nav-inner {
    padding: 0 12px;
  }
}

/* ===== USER BADGE ===== */
.user-badge-link {
  text-decoration: none;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.2s;
}

.user-badge:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--color-gold, #c9a959);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-blood, #8b0000);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  color: var(--color-gold, #c9a959);
  font-size: 0.9rem;
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-name {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  color: var(--text-primary, #e8e2d9);
}

.admin-badge {
  font-size: 0.7rem;
  background: var(--color-gold, #c9a959);
  color: #1a1a1a;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.login-link {
  background: rgba(201, 169, 89, 0.1);
  border: 1px solid rgba(201, 169, 89, 0.3);
}

.login-link:hover {
  background: rgba(201, 169, 89, 0.2) !important;
  color: var(--color-gold, #c9a959) !important;
}

/* ===== SITE HEADER (EDGE-TO-EDGE) ===== */
#page-header {
  width: 100%;
  padding: 0;
}

.site-header {
  text-align: center;
  padding: 0;
  background: #1a1614;
  border-bottom: 3px solid var(--color-gold, #c9a959);
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.towncrier-banner {
  width: 100%;
  background: linear-gradient(180deg,
  #7a6850 0%,
  #9a8868 15%,
  #b09878 50%,
  #9a8868 85%,
  #7a6850 100%
  );
  padding: 12px 20px;
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.2),
    inset 0 -2px 4px rgba(0,0,0,0.2),
    0 4px 12px rgba(0,0,0,0.5);
  position: relative;
}

.towncrier-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
}

.site-header .towncrier-logo {
  max-width: 320px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.site-header .header-titles {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 20px;
  flex-wrap: wrap;
  width: 100%;
  background: linear-gradient(180deg, #1a1614 0%, #0d0b0a 100%);
}

.site-header .campaign-name {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-gold, #c9a959);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.site-header .header-divider {
  color: rgba(201, 169, 89, 0.5);
  font-size: 0.9rem;
}

.site-header .page-subtitle {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  font-weight: 400;
  color: rgba(201, 169, 89, 0.8);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* ===================================================================
   CAMPAIGN SWITCHER BAR (Datensatz: Kampagne / Sandbox)
   =================================================================== */
.campaign-switcher-bar {
  background: rgba(0,0,0,0.4);
  border-bottom: 1px solid var(--border-color, #3a3633);
  padding: 12px 20px;
}

.campaign-switcher-bar .inner {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

/* ===== SANDBOX BANNER (UNTER der Navigation) ===== */
.sandbox-banner {
  position: sticky !important;
  top: 56px !important;
  z-index: 10000 !important;
  margin: 0 !important;
}

/* Body padding IMMER auf 0 */
body, body.sandbox-mode {
  padding-top: 0 !important;
}

/* ===================================================================
   ENHANCED BATTLE SETUP - New Styles
   =================================================================== */

/* Battle Setup Container */
.battle-setup.enhanced {
  max-width: 1400px;
  margin: 0 auto;
  padding: 30px 20px;
}

/* Battle Header mit Progress */
.battle-setup.enhanced .battle-header {
  text-align: center;
  margin-bottom: 40px;
  padding: 30px 20px;
  background: linear-gradient(135deg, rgba(139, 0, 0, 0.15), rgba(139, 0, 0, 0.05));
  border: 2px solid rgba(201, 169, 89, 0.3);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.battle-header .header-icon {
  font-size: 3rem;
  margin-bottom: 15px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.battle-header h2 {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  color: var(--color-gold, #c9a959);
  margin: 0 0 10px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.battle-header .header-status {
  font-size: 1.1rem;
  color: var(--text-primary, #e8e2d9);
  margin: 0 0 25px;
}

.battle-header .header-status .highlight-team1 {
  color: var(--color-gold, #c9a959);
  font-weight: 600;
}

.battle-header .header-status .highlight-team2 {
  color: #c45050;
  font-weight: 600;
}

/* Selection Progress Bar */
.selection-progress {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  max-width: 600px;
  margin: 0 auto;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.4;
  transition: all 0.3s ease;
}

.progress-step.active {
  opacity: 1;
  transform: scale(1.1);
}

.progress-step.complete {
  opacity: 1;
}

.step-number {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--bg-card, #2a2a2a);
  border: 3px solid rgba(201, 169, 89, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-muted, #888);
  transition: all 0.3s ease;
}

.progress-step.active .step-number {
  background: var(--color-gold, #c9a959);
  border-color: var(--color-gold, #c9a959);
  color: #1a1a1a;
  box-shadow: 0 0 20px rgba(201, 169, 89, 0.5);
  animation: pulse-step 2s ease-in-out infinite;
}

.progress-step.complete .step-number {
  background: rgba(201, 169, 89, 0.3);
  border-color: var(--color-gold, #c9a959);
  color: var(--color-gold, #c9a959);
}

.progress-step.complete .step-number::after {
  content: '\2713';
  position: absolute;
  font-size: 1.5rem;
}

@keyframes pulse-step {
  0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(201, 169, 89, 0.5); }
  50% { transform: scale(1.05); box-shadow: 0 0 30px rgba(201, 169, 89, 0.7); }
}

.step-label {
  font-size: 0.85rem;
  color: var(--text-muted, #888);
  text-align: center;
  transition: all 0.3s ease;
}

.progress-step.active .step-label {
  color: var(--color-gold, #c9a959);
  font-weight: 600;
}

.progress-line {
  width: 60px;
  height: 3px;
  background: rgba(201, 169, 89, 0.2);
  transition: all 0.3s ease;
}

.progress-line.complete {
  background: var(--color-gold, #c9a959);
  box-shadow: 0 0 10px rgba(201, 169, 89, 0.5);
}

/* ===================================================================
   MATCHUP ARENA - Enhanced & Always Visible
   =================================================================== */

.battle-matchup-arena {
  background: linear-gradient(135deg, var(--bg-card, #2d2d2d) 0%, var(--bg-secondary, #242424) 100%);
  border: 2px solid var(--color-gold, #c9a959);
  border-radius: 16px;
  padding: 30px;
  margin-bottom: 40px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  transition: all 0.4s ease;
}

.battle-matchup-arena.animated {
  animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.matchup-header {
  text-align: center;
  margin-bottom: 25px;
}

.matchup-header h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  color: var(--color-gold, #c9a959);
  margin: 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Matchup Teams Layout */
.matchup-teams {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  margin-bottom: 25px;
}

.matchup-team {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: rgba(0,0,0,0.3);
  border-radius: 12px;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.matchup-team.team-1 {
  border-color: rgba(201, 169, 89, 0.4);
  background: linear-gradient(135deg, rgba(201, 169, 89, 0.1), rgba(201, 169, 89, 0.05));
}

.matchup-team.team-2 {
  border-color: rgba(165, 42, 42, 0.4);
  background: linear-gradient(135deg, rgba(165, 42, 42, 0.1), rgba(165, 42, 42, 0.05));
}

.team-badge {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.team-1 .team-badge {
  background: var(--color-gold, #c9a959);
  color: #1a1a1a;
}

.team-2 .team-badge {
  background: #c45050;
  color: white;
}

.team-info {
  flex: 1;
}

.team-name {
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-gold, #c9a959);
  margin-bottom: 5px;
  display: block;
}

.team-type {
  font-size: 0.85rem;
  color: var(--text-muted, #888);
  margin-bottom: 8px;
  display: block;
}

.team-rating {
  font-size: 1rem;
  color: var(--text-primary, #e8e2d9);
  font-weight: 600;
  margin-bottom: 5px;
  display: block;
}

.team-record {
  font-size: 0.9rem;
  color: var(--text-secondary, #aaa);
  display: block;
  margin-bottom: 8px;
}

.team-streak {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 5px;
}

.team-streak.win {
  background: rgba(46, 125, 50, 0.3);
  color: #66bb6a;
  border: 1px solid rgba(102, 187, 106, 0.3);
}

.team-streak.loss {
  background: rgba(198, 40, 40, 0.3);
  color: #ef5350;
  border: 1px solid rgba(239, 83, 80, 0.3);
}

/* VS Circle */
.matchup-vs {
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vs-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-blood, #8b0000), var(--color-blood-dark, #5c0000));
  border: 3px solid var(--color-gold, #c9a959);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  box-shadow: 0 0 30px rgba(201, 169, 89, 0.4);
  animation: rotate-slow 20s linear infinite;
}

@keyframes rotate-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.vs-text {
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-gold, #c9a959);
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.vs-swords {
  font-size: 1.5rem;
  margin-top: 5px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Matchup Details */
.matchup-details {
  text-align: center;
  padding: 20px 0;
  border-top: 1px solid rgba(201, 169, 89, 0.2);
  border-bottom: 1px solid rgba(201, 169, 89, 0.2);
  margin-bottom: 20px;
}

.matchup-prediction {
  font-size: 1.1rem;
  color: var(--color-gold, #c9a959);
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.prediction-icon {
  font-size: 1.3rem;
}

.matchup-underdog {
  font-size: 0.95rem;
  color: var(--text-secondary, #aaa);
  margin-top: 10px;
}

.matchup-underdog strong {
  color: var(--color-gold, #c9a959);
  font-weight: 600;
}

.matchup-even {
  font-size: 0.95rem;
  color: var(--text-secondary, #aaa);
  font-style: italic;
}

/* Matchup Actions */
.matchup-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(201, 169, 89, 0.3);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 6px 20px rgba(201, 169, 89, 0.5);
    transform: scale(1.02);
  }
}

/* ===================================================================
   MATCHUP PLACEHOLDER - For Selection Process
   =================================================================== */

.battle-matchup-arena.placeholder {
  background: linear-gradient(135deg, rgba(45, 45, 45, 0.5), rgba(36, 36, 36, 0.5));
  border-style: dashed;
}

.matchup-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 20px;
}

.placeholder-slot {
  flex: 1;
  max-width: 300px;
  min-height: 140px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.placeholder-slot.slot-1 {
  border: 2px dashed rgba(201, 169, 89, 0.3);
  background: rgba(201, 169, 89, 0.05);
}

.placeholder-slot.slot-2 {
  border: 2px dashed rgba(165, 42, 42, 0.3);
  background: rgba(165, 42, 42, 0.05);
}

.placeholder-slot.filled {
  border-style: solid;
  animation: fillSlot 0.4s ease-out;
}

@keyframes fillSlot {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.slot-empty {
  text-align: center;
  padding: 20px;
  opacity: 0.5;
  transition: all 0.3s ease;
}

.slot-empty.active {
  opacity: 1;
  animation: pulse-slow 2s ease-in-out infinite;
}

@keyframes pulse-slow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.slot-number {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(201, 169, 89, 0.1);
  border: 2px solid rgba(201, 169, 89, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-muted, #888);
  margin: 0 auto 10px;
}

.slot-text {
  font-size: 0.9rem;
  color: var(--text-muted, #888);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.slot-filled {
  padding: 20px;
  text-align: center;
}

.slot-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 auto 10px;
  color: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.slot-1 .slot-badge {
  background: var(--color-gold, #c9a959);
  color: #1a1a1a;
}

.slot-2 .slot-badge {
  background: #c45050;
}

.slot-name {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-gold, #c9a959);
  margin-bottom: 5px;
}

.slot-rating {
  font-size: 0.9rem;
  color: var(--text-secondary, #aaa);
}

.placeholder-vs {
  font-size: 2rem;
  color: var(--color-gold, #c9a959);
  opacity: 0.3;
}

/* ===================================================================
   WARBAND CARDS - Enhanced with Stats
   =================================================================== */

.battle-cards-section {
  margin-bottom: 40px;
}

.cards-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid rgba(201, 169, 89, 0.2);
}

.cards-header h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  color: var(--color-gold, #c9a959);
  margin: 0;
}

.cards-count {
  font-size: 0.9rem;
  color: var(--text-muted, #888);
  background: rgba(201, 169, 89, 0.1);
  padding: 6px 14px;
  border-radius: 20px;
}

/* Cards Grid */
.battle-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

/* Enhanced Battle Card */
.battle-card {
  background: linear-gradient(135deg, var(--bg-card, #2d2d2d) 0%, var(--bg-secondary, #242424) 100%);
  border: 2px solid rgba(201, 169, 89, 0.2);
  border-radius: 12px;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.battle-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--color-gold, #c9a959), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.battle-card:hover::before {
  opacity: 1;
}

.battle-card:hover {
  border-color: var(--color-gold, #c9a959);
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.4), 0 0 20px rgba(201, 169, 89, 0.2);
}

.battle-card.selected-1 {
  border-color: var(--color-gold, #c9a959);
  background: linear-gradient(135deg, rgba(201, 169, 89, 0.15), rgba(201, 169, 89, 0.05));
  box-shadow: 0 0 20px rgba(201, 169, 89, 0.4);
  transform: scale(1.03);
}

.battle-card.selected-2 {
  border-color: #c45050;
  background: linear-gradient(135deg, rgba(165, 42, 42, 0.15), rgba(165, 42, 42, 0.05));
  box-shadow: 0 0 20px rgba(165, 42, 42, 0.4);
  transform: scale(1.03);
}

.battle-card.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.card-disabled-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--text-muted, #888);
}

/* Selection Badge */
.sel-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
  color: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  z-index: 10;
  animation: pop-in 0.3s ease-out;
}

@keyframes pop-in {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.sel-badge.b1 { background: var(--color-gold, #c9a959); color: #1a1a1a; }
.sel-badge.b2 { background: #c45050; }

/* Card Header */
.card-header {
  padding: 20px 20px 15px;
  border-bottom: 1px solid rgba(201, 169, 89, 0.2);
}

.bc-name {
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-gold, #c9a959);
  margin-bottom: 5px;
  line-height: 1.3;
}

.bc-type {
  font-size: 0.8rem;
  color: var(--text-muted, #888);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Card Rating */
.card-rating {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 20px;
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid rgba(201, 169, 89, 0.2);
}

.rating-icon {
  font-size: 1.3rem;
}

.rating-value {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-gold, #c9a959);
}

.rating-label {
  font-size: 0.8rem;
  color: var(--text-muted, #888);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Card Warriors */
.card-warriors {
  display: flex;
  justify-content: space-around;
  padding: 15px 20px;
  border-bottom: 1px solid rgba(201, 169, 89, 0.2);
}

.warrior-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.warrior-icon {
  font-size: 1.3rem;
}

.warrior-count {
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary, #e8e2d9);
}

.warrior-label {
  font-size: 0.7rem;
  color: var(--text-muted, #888);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Card Stats - NEW */
.card-stats {
  padding: 15px 20px;
  background: rgba(0,0,0,0.15);
}

.stat-record {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.stat-label {
  color: var(--text-muted, #888);
}

.stat-value {
  color: var(--text-primary, #e8e2d9);
  font-weight: 600;
}

.stat-winrate {
  color: var(--color-gold, #c9a959);
  font-weight: 700;
}

.stat-streak {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.stat-streak.win {
  background: rgba(46, 125, 50, 0.2);
  color: #66bb6a;
  border: 1px solid rgba(102, 187, 106, 0.3);
}

.stat-streak.loss {
  background: rgba(198, 40, 40, 0.2);
  color: #ef5350;
  border: 1px solid rgba(239, 83, 80, 0.3);
}

.stat-last {
  font-size: 0.8rem;
  color: var(--text-secondary, #aaa);
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.75rem;
}

.result-badge.win {
  background: rgba(46, 125, 50, 0.3);
  color: #66bb6a;
  border: 1px solid rgba(102, 187, 106, 0.3);
}

.result-badge.loss {
  background: rgba(198, 40, 40, 0.3);
  color: #ef5350;
  border: 1px solid rgba(239, 83, 80, 0.3);
}

.stat-novice {
  text-align: center;
  color: var(--text-muted, #888);
  font-style: italic;
  font-size: 0.85rem;
}

/* Card Player */
.bc-player {
  padding: 12px 20px;
  border-top: 1px solid rgba(201, 169, 89, 0.2);
  font-size: 0.9rem;
  color: var(--color-gold, #c9a959);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bc-player:hover {
  background: rgba(201, 169, 89, 0.1);
  color: #fff;
}

/* ===================================================================
   BATTLE HISTORY SECTION
   =================================================================== */

.battle-history-section {
  background: linear-gradient(135deg, rgba(53, 53, 53, 0.3), rgba(45, 45, 45, 0.3));
  border: 1px solid rgba(201, 169, 89, 0.2);
  border-radius: 12px;
  padding: 25px;
  text-align: center;
}

.battle-history-section h3 {
  font-family: 'Cinzel', serif;
  color: var(--color-gold, #c9a959);
  font-size: 1.2rem;
  margin: 0 0 10px;
}

.town-cryer-voice {
  font-style: italic;
  color: var(--text-muted, #888);
  font-size: 0.95rem;
}

/* ===================================================================
   SETUP EMPTY STATE
   =================================================================== */

.setup-empty {
  text-align: center;
  padding: 80px 20px;
}

.setup-empty h2 {
  font-family: 'Cinzel', serif;
  color: var(--color-gold, #c9a959);
  font-size: 2rem;
  margin-bottom: 15px;
}

.setup-empty p {
  color: var(--text-secondary, #aaa);
  font-size: 1.1rem;
}

/* ===================================================================
   PLAYER PROFILE MODAL
   =================================================================== */

.player-profile {
  padding: 10px 0;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color, #3a3633);
  margin-bottom: 20px;
}

.profile-avatar {
  font-size: 3rem;
  width: 70px;
  height: 70px;
  background: rgba(212, 175, 55, 0.1);
  border: 2px solid var(--color-gold, #c9a959);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-info h3 {
  font-family: 'Cinzel', serif;
  color: var(--color-gold, #c9a959);
  font-size: 1.3rem;
  margin: 0 0 5px;
}

.profile-email {
  color: var(--text-muted, #888);
  font-size: 0.9rem;
  margin: 0;
}

.profile-section {
  margin-bottom: 20px;
}

.profile-section h4 {
  font-family: 'Cinzel', serif;
  color: var(--text-primary, #e8e2d9);
  font-size: 1rem;
  margin: 0 0 12px;
}

.profile-warband {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border-color, #3a3633);
  border-radius: 8px;
  padding: 15px;
}

.profile-warband strong {
  display: block;
  font-family: 'Cinzel', serif;
  color: var(--color-gold, #c9a959);
  font-size: 1.1rem;
  margin-bottom: 5px;
}

.profile-warband .wb-type,
.profile-warband .wb-rating {
  font-size: 0.9rem;
  color: var(--text-secondary, #aaa);
  margin-right: 15px;
}

.profile-stats {
  display: flex;
  gap: 20px;
}

.profile-stats .stat {
  flex: 1;
  text-align: center;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border-color, #3a3633);
  border-radius: 8px;
  padding: 15px 10px;
}

.profile-stats .stat-value {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  color: var(--color-gold, #c9a959);
  margin-bottom: 5px;
}

.profile-stats .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted, #888);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===================================================================
   RESPONSIVE DESIGN
   =================================================================== */

@media (max-width: 1100px) {
  .battle-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  .matchup-teams {
    flex-direction: column;
    gap: 20px;
  }

  .matchup-team {
    width: 100%;
  }

  .vs-circle {
    width: 60px;
    height: 60px;
  }
}

@media (max-width: 800px) {
  .battle-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
  }

  .selection-progress {
    gap: 10px;
  }

  .step-number {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }

  .step-label {
    font-size: 0.75rem;
  }

  .progress-line {
    width: 30px;
  }

  .battle-matchup-arena {
    padding: 20px;
  }

  .matchup-actions {
    flex-direction: column;
  }

  .matchup-actions .btn {
    width: 100%;
  }
}

@media (max-width: 500px) {
  .battle-header h2 {
    font-size: 1.5rem;
  }

  .battle-header .header-status {
    font-size: 0.95rem;
  }

  .matchup-placeholder {
    flex-direction: column;
    gap: 15px;
  }

  .placeholder-vs {
    transform: rotate(90deg);
  }
}
