/* ==========================================================================
   POKÉMON LEGION RPG - Modern Centralized Design System
   Cinematic Web RPG Interface - Glassmorphism, Ténèbres Mode & Responsive Layout
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@400;500;600;700;800;900&display=swap');

:root {
  /* Core Canvas & Surfaces */
  --bg-canvas: #090d16;
  --bg-surface: #0e1422;
  --bg-card: rgba(16, 24, 40, 0.85);
  --bg-card-hover: rgba(23, 34, 56, 0.95);
  --bg-card-solid: #111a2d;
  --bg-header-grad: linear-gradient(135deg, #181f38 0%, #201742 100%);
  
  /* Borders & Overlays */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(59, 130, 246, 0.35);
  --border-focus: #3b82f6;
  --border-gold: rgba(245, 158, 11, 0.4);

  /* Primary Accents */
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-glow: rgba(59, 130, 246, 0.4);
  --accent-gold: #f59e0b;
  --accent-cyan: #06b6d4;
  --accent-purple: #a855f7;
  --accent-green: #10b981;
  --accent-red: #ef4444;

  /* Typography */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', var(--font-body);

  /* Elevation & Rounding */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.2);
  --shadow-gold: 0 0 25px rgba(245, 158, 11, 0.2);

  /* Official Pokémon Type Colors */
  --type-normal: #9ca3af;
  --type-fire: #f97316;
  --type-water: #38bdf8;
  --type-grass: #22c55e;
  --type-electric: #eab308;
  --type-ice: #67e8f9;
  --type-fighting: #b91c1c;
  --type-poison: #a855f7;
  --type-ground: #d97706;
  --type-flying: #818cf8;
  --type-psychic: #ec4899;
  --type-bug: #84cc16;
  --type-rock: #a16207;
  --type-ghost: #7c3aed;
  --type-dragon: #6366f1;
  --type-steel: #94a3b8;
  --type-dark: #334155;
  --type-fairy: #f472b6;
  --type-shiny: #fbbf24;
  --type-golden: #f59e0b;
  --type-shadow: #475569;
  --type-mystic: #c084fc;
}

/* ==========================================================================
   Global Reset & Base Canvas
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0 !important;
  padding: 0 !important;
  background-color: var(--bg-canvas) !important;
  background-image: 
    radial-gradient(circle at 50% 0%, #1e1744 0%, transparent 50%),
    radial-gradient(circle at 10% 25%, rgba(30, 58, 138, 0.2) 0%, transparent 40%),
    radial-gradient(circle at 90% 65%, rgba(88, 28, 135, 0.2) 0%, transparent 40%),
    linear-gradient(180deg, #090d16 0%, #060910 100%) !important;
  background-attachment: fixed !important;
  color: var(--text-main) !important;
  font-family: var(--font-body) !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
  min-height: 100vh !important;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading) !important;
  color: var(--text-main) !important;
  margin: 0 !important;
  font-weight: 700 !important;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: inline-block;
  vertical-align: middle;
}

/* ==========================================================================
   Centralized Master Game Layout
   ========================================================================== */
.wrapper {
  max-width: 1300px !important;
  width: 95% !important;
  margin: 16px auto 40px auto !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 18px !important;
  position: relative !important;
  float: none !important;
  height: auto !important;
  overflow: visible !important;
}

/* 3-Column Cohesive Layout */
.content-wrapper {
  display: grid !important;
  grid-template-columns: 250px minmax(0, 1fr) 260px !important;
  gap: 20px !important;
  width: 100% !important;
  margin: 0 !important;
  align-items: start !important;
  float: none !important;
  text-align: left !important;
}

/* ==========================================================================
   Top Game Navigation & Statut Bar (HUD)
   ========================================================================== */
.game-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  background: rgba(14, 20, 34, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-logo-img,
.game-logo-img,
img.brand-logo-img,
img.game-logo-img {
  width: 36px !important;
  height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  object-fit: contain !important;
  filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.6)) !important;
  border-radius: 8px !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
}

.brand-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #ffffff 0%, #93c5fd 60%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}

.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green);
  animation: pulse-green 2s infinite ease-in-out;
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.9); }
}

.topbar-sep {
  color: var(--border-subtle);
  font-weight: 300;
}

.welcome-text {
  font-size: 13px;
  color: var(--text-muted);
}

.welcome-text strong {
  color: #fff;
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.quick-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: all 0.2s ease;
}

.quick-stat:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.quick-stat.money-stat .stat-val {
  color: var(--accent-gold);
  font-weight: 700;
  font-family: var(--font-heading);
}

.quick-stat.coins-stat .stat-val {
  color: var(--accent-cyan);
  font-weight: 700;
  font-family: var(--font-heading);
}

.quick-stat.time-stat .stat-val {
  color: #a5b4fc;
  font-family: monospace;
  font-size: 12px;
}

/* ==========================================================================
   Hero Banner Frame
   ========================================================================== */
.banner-hero {
  position: relative;
  width: 100% !important;
  height: 220px !important;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card), 0 0 35px rgba(59, 130, 246, 0.18);
  background: url('../layout/banner_legendary.jpg') center center / cover no-repeat !important;
  display: flex;
  align-items: flex-end;
}

/* Fallback if legacy banner class is used */
.banner {
  width: 100% !important;
  height: 200px !important;
  border-radius: var(--radius-lg) !important;
  border: 1px solid var(--border-subtle) !important;
  background: url('../layout/banner_legendary.jpg') center center / cover no-repeat !important;
  margin: 0 !important;
  float: none !important;
}

.banner-overlay {
  width: 100%;
  padding: 24px 32px;
  background: linear-gradient(0deg, rgba(9, 13, 22, 0.95) 0%, rgba(9, 13, 22, 0.6) 60%, transparent 100%);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}

.banner-title-wrap {
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.9);
}

.banner-main-title {
  font-size: 34px !important;
  font-weight: 900 !important;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #ffffff 0%, #bae6fd 50%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  margin-bottom: 4px !important;
}

.banner-subtitle {
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.banner-quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-hero {
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 13px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.25s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-explore {
  background: rgba(59, 130, 246, 0.5);
  color: #fff !important;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-explore:hover {
  background: rgba(59, 130, 246, 0.85);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.btn-heal {
  background: rgba(239, 68, 68, 0.45);
  color: #fff !important;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-heal:hover {
  background: rgba(239, 68, 68, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.btn-gym {
  background: rgba(245, 158, 11, 0.45);
  color: #fff !important;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-gym:hover {
  background: rgba(245, 158, 11, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

/* ==========================================================================
   Centralized Interactive Team Bar (Party Section)
   ========================================================================== */
.party-section {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-card);
}

.party-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.party-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: #e2e8f0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.party-icon {
  color: var(--accent-gold);
}

.party-manage-link {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.party-manage-link:hover {
  color: var(--primary-hover);
}

.party-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

/* Individual Slot Card */
.party-slot {
  position: relative;
  background: rgba(14, 20, 34, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  transition: all 0.25s ease;
  cursor: pointer;
}

.party-slot:hover {
  background: var(--bg-card-hover);
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.party-slot.active-slot {
  border-color: rgba(59, 130, 246, 0.25);
}

.slot-badge-lvl {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(59, 130, 246, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.5);
  color: #93c5fd;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  font-family: var(--font-heading);
}

.slot-sprite-wrap {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.slot-sprite {
  max-width: 100%;
  max-height: 100%;
  image-rendering: pixelated;
}

.slot-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.slot-nickname {
  font-size: 11px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
  text-align: center;
}

/* Micro HP Bar */
.slot-hp-bar-bg {
  width: 80%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 2px;
}

.slot-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #10b981);
  border-radius: 999px;
}

/* Type Badges */
.slot-type-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.type-normal { background: var(--type-normal); }
.type-fire { background: var(--type-fire); }
.type-water { background: var(--type-water); }
.type-grass { background: var(--type-grass); }
.type-electric { background: var(--type-electric); color: #000; }
.type-ice { background: var(--type-ice); color: #000; }
.type-fighting { background: var(--type-fighting); }
.type-poison { background: var(--type-poison); }
.type-ground { background: var(--type-ground); }
.type-flying { background: var(--type-flying); }
.type-psychic { background: var(--type-psychic); }
.type-bug { background: var(--type-bug); color: #000; }
.type-rock { background: var(--type-rock); }
.type-ghost { background: var(--type-ghost); }
.type-dragon { background: var(--type-dragon); }
.type-steel { background: var(--type-steel); }
.type-dark { background: var(--type-dark); }
.type-fairy { background: var(--type-fairy); }
.type-shiny { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.type-golden { background: linear-gradient(135deg, #f59e0b, #eab308); color: #000; }
.type-shadow { background: #334155; }

/* Empty Party Slot */
.party-slot.empty-slot {
  background: rgba(14, 20, 34, 0.3);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  opacity: 0.75;
}

.party-slot.empty-slot:hover {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(14, 20, 34, 0.5);
}

.empty-pokeball {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
}

.empty-pokeball img {
  width: 26px;
  height: 26px;
}

.empty-label {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 500;
  margin-top: 4px;
}

/* Rich Tooltip / Hover Popover */
.party-popover {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: 250px;
  background: #0f172a;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), var(--shadow-glow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 1000;
  text-align: left;
}

.party-slot:hover .party-popover {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.popover-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.popover-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.popover-titles h4 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.popover-species {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

.popover-gender {
  font-size: 11px;
  color: #38bdf8;
}

.popover-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.stat-pill {
  background: rgba(255, 255, 255, 0.03);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  display: flex;
  justify-content: space-between;
}

.stat-pill span {
  color: var(--text-muted);
}

.stat-pill strong {
  color: #38bdf8;
  font-family: var(--font-heading);
}

/* ==========================================================================
   Sidebars (Left & Right Navigation)
   ========================================================================== */
.left-nav, .right-nav {
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  width: 100% !important;
  min-width: 0 !important;
  float: none !important;
  margin: 0 !important;
}

.nav-card {
  background: var(--bg-card) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-md) !important;
  overflow: hidden !important;
  box-shadow: var(--shadow-card) !important;
}

.nav-card-header {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: var(--bg-header-grad) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  padding: 10px 14px !important;
  font-family: var(--font-heading) !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  color: #e0e7ff !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}

.nav-icon {
  font-size: 14px;
}

.nav-links {
  list-style: none !important;
  margin: 0 !important;
  padding: 4px 0 !important;
}

.nav-links li {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
}

.nav-links a {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 8px 14px !important;
  color: #cbd5e1 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
  border-left: 2px solid transparent !important;
}

.nav-links a:hover {
  color: #fff !important;
  background: rgba(59, 130, 246, 0.12) !important;
  border-left-color: var(--primary) !important;
  padding-left: 18px !important;
}

.nav-links .link-logout {
  color: #f87171 !important;
}

.nav-links .link-logout:hover {
  background: rgba(239, 68, 68, 0.12) !important;
  border-left-color: var(--accent-red) !important;
}

/* Rocheet Card Styling */
.rocket-card {
  border-color: rgba(239, 68, 68, 0.25) !important;
}

.rocket-header {
  background: linear-gradient(135deg, #3b0764 0%, #450a0a 100%) !important;
}

/* Trainer Card Widget (Right Sidebar) */
.trainer-card-widget {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.trainer-avatar-frame {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.35);
  margin-bottom: 10px;
}

.trainer-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #0f172a;
}

.trainer-username {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #fff !important;
  margin-bottom: 2px !important;
}

.trainer-id-pill {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: inline-block;
}

.trainer-userbar {
  margin-bottom: 12px;
}

.trainer-userbar img {
  border-radius: 4px;
}

.trainer-finances {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.finance-pill {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
}

.f-label {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.f-value {
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--accent-gold);
}

.trainer-stats-row {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat-badge {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px;
  display: flex;
  flex-direction: column;
}

.sb-title {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.sb-val {
  font-size: 13px;
  font-weight: 700;
  color: #38bdf8;
  font-family: var(--font-heading);
}

/* ==========================================================================
   Center Main Content Column & Cards
   ========================================================================== */
.content {
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  float: none !important;
}

.content-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.content li.header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  background: var(--bg-header-grad) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-bottom: none !important;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  padding: 14px 22px !important;
  color: #fff !important;
  font-family: var(--font-heading) !important;
  box-shadow: var(--shadow-card) !important;
}

.content-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
}

.ch-icon {
  font-size: 18px;
}

.ch-badge {
  font-size: 11px;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.5);
  color: #93c5fd;
  padding: 3px 10px;
  border-radius: 999px;
}

.content li.main {
  background: var(--bg-card) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid var(--border-subtle) !important;
  border-top: none !important;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg) !important;
  padding: 24px !important;
  box-shadow: var(--shadow-card) !important;
  min-height: 480px;
}

/* ==========================================================================
   Dashboard Showcase Hub (3 Cards Grid)
   ========================================================================== */
.showcase-hub {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.showcase-card {
  position: relative;
  background: rgba(20, 29, 48, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.25s ease;
}

.showcase-card:hover {
  background: rgba(26, 38, 64, 0.85);
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.sc-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(59, 130, 246, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93c5fd;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}

.champ-badge {
  background: rgba(245, 158, 11, 0.25);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fde68a;
}

.donate-badge {
  background: rgba(236, 72, 153, 0.25);
  border-color: rgba(236, 72, 153, 0.5);
  color: #fbcfe8;
}

.sc-img-wrap {
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px 0 12px 0;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

.sc-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.champ-avatar-wrap {
  border-radius: 50%;
  border: 2px solid var(--accent-gold);
  padding: 3px;
  background: #0f172a;
}

.champ-avatar-wrap img {
  border-radius: 50%;
}

.sc-name {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #fff !important;
  margin-bottom: 6px !important;
}

.sc-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.champ-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.champ-meta strong {
  color: var(--accent-gold);
}

.sc-btn {
  margin-top: auto;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  transition: all 0.2s ease;
  display: inline-block;
}

.btn-promo {
  background: rgba(59, 130, 246, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.5);
  color: #93c5fd !important;
}

.btn-promo:hover {
  background: rgba(59, 130, 246, 0.8);
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.btn-champ {
  background: rgba(245, 158, 11, 0.25);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fde68a !important;
}

.btn-champ:hover {
  background: rgba(245, 158, 11, 0.8);
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.btn-donate {
  background: rgba(236, 72, 153, 0.25);
  border: 1px solid rgba(236, 72, 153, 0.5);
  color: #fbcfe8 !important;
}

.btn-donate:hover {
  background: rgba(236, 72, 153, 0.8);
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.4);
}

/* ==========================================================================
   News & Announcements Board
   ========================================================================== */
.news-board {
  background: rgba(14, 20, 34, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
}

.news-board-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.news-board-header h3 {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #e2e8f0 !important;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.nb-icon {
  font-size: 16px;
}

.empty-news-box {
  padding: 24px;
  text-align: center;
  color: var(--text-dim);
  font-style: italic;
}

.news-item-card {
  display: flex;
  gap: 18px;
  background: rgba(20, 29, 48, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
  transition: all 0.2s ease;
}

.news-item-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(24, 35, 58, 0.65);
}

.news-card-author-sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100px;
  flex-shrink: 0;
  text-align: center;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding-right: 14px;
}

.author-avatar-wrap {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  margin-bottom: 6px;
}

.author-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #0f172a;
  border: 1px solid var(--border-subtle);
}

.author-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #0f172a;
}

.author-status-dot.online { background: var(--accent-green); }
.author-status-dot.offline { background: var(--text-dim); }

.author-name-link {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 2px;
  color: #fff;
}

.author-name-link.red { color: #f87171 !important; }
.author-name-link.blue { color: #60a5fa !important; }
.author-name-link.gold { color: #fbbf24 !important; }
.author-name-link.pink { color: #f472b6 !important; }
.author-name-link.trainer,
.author-name-link.black { color: #e2e8f0 !important; }

.author-rank-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  text-transform: uppercase;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

.author-rank-badge.rank-red { background: rgba(248, 113, 113, 0.2) !important; color: #f87171 !important; }
.author-rank-badge.rank-blue { background: rgba(96, 165, 250, 0.2) !important; color: #60a5fa !important; }
.author-rank-badge.rank-gold { background: rgba(251, 191, 36, 0.2) !important; color: #fbbf24 !important; }
.author-rank-badge.rank-pink { background: rgba(244, 114, 182, 0.2) !important; color: #f472b6 !important; }
.author-rank-badge.rank-trainer,
.author-rank-badge.rank-black { background: rgba(255, 255, 255, 0.12) !important; color: #e2e8f0 !important; }

.author-userbar img {
  border-radius: 3px;
  max-width: 100%;
}

.news-card-body {
  flex: 1;
  min-width: 0;
}

.news-meta-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.news-title {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #fff !important;
}

.news-date {
  font-size: 11px;
  color: var(--text-dim);
}

.news-content-text {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.6;
}

/* ==========================================================================
   Global Centralized Footer
   ========================================================================== */
.game-footer {
  margin-top: 20px;
  background: rgba(14, 20, 34, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.footer-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.fstat-num {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  color: #38bdf8;
  margin-bottom: 2px;
}

.fstat-text {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.footer-bottom-info {
  text-align: center;
}

.footer-copyright {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.footer-disclaimer {
  font-size: 11px;
  color: var(--text-dim);
  max-width: 800px;
  margin: 0 auto 12px auto;
  line-height: 1.5;
}

.footer-links {
  font-size: 12px;
}

.footer-links a {
  color: var(--text-muted);
  margin: 0 4px;
}

.footer-links a:hover {
  color: var(--primary-hover);
}

/* ==========================================================================
   Universal Form, Table & Button Controls (Game-Wide)
   ========================================================================== */
table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  margin: 14px 0 !important;
  background: rgba(14, 20, 34, 0.5) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-md) !important;
  overflow: hidden !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2) !important;
}

th {
  background: linear-gradient(135deg, #1e293b 0%, #1e1b4b 100%) !important;
  color: #e2e8f0 !important;
  font-family: var(--font-heading) !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  padding: 12px 14px !important;
  border: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  text-align: center !important;
}

td {
  padding: 10px 14px !important;
  border: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
  background: transparent !important;
  color: #cbd5e1 !important;
  font-size: 13px !important;
  text-align: center !important;
}

tr:last-child td {
  border-bottom: none !important;
}

tr:hover td {
  background: rgba(59, 130, 246, 0.05) !important;
}

td a,
td a:visited {
  color: #60a5fa !important;
  text-decoration: none !important;
}

td a:hover {
  color: #93c5fd !important;
  text-decoration: underline !important;
}

/* Global High-Contrast Safeguards for Ténèbres Theme */
b[style*="color:black"],
b[style*="color: black"],
b[style*="color:#000"],
b[style*="color: #000"],
b[style*="color:#000000"],
b[style*="color: #000000"],
span[style*="color:black"],
span[style*="color: black"],
span[style*="color:#000"],
span[style*="color: #000"],
font[color="black"],
font[color="#000"],
font[color="#000000"] {
  color: #e2e8f0 !important;
}

/* Button & Form Inputs */
.button, 
input[type="submit"], 
input[type="button"], 
button {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #fff !important;
  padding: 8px 18px !important;
  border-radius: var(--radius-sm) !important;
  font-family: var(--font-heading) !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  min-height: 36px !important;
}

.button:hover, 
input[type="submit"]:hover, 
input[type="button"]:hover, 
button:hover {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.5) !important;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
select,
textarea {
  background: rgba(15, 23, 42, 0.8) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-sm) !important;
  padding: 8px 12px !important;
  color: #fff !important;
  font-family: var(--font-body) !important;
  font-size: 13px !important;
  transition: all 0.2s ease !important;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
  outline: none !important;
  border-color: var(--border-focus) !important;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.35) !important;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1100px) {
  .content-wrapper {
    grid-template-columns: 220px minmax(0, 1fr) !important;
  }
  .right-nav {
    grid-column: span 2;
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px !important;
  }
  .party-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .showcase-hub {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .content-wrapper {
    grid-template-columns: 1fr !important;
  }
  .right-nav {
    grid-column: span 1;
    grid-template-columns: 1fr !important;
  }
  .party-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .banner-hero {
    height: 180px !important;
  }
  .banner-overlay {
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   Landing & Registration Page Modern Styling
   ========================================================================== */
.landing-hero-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(30, 41, 59, 0.8) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.landing-hero-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.landing-title {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.landing-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 22px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 20px 0 24px 0;
}

.feature-box {
  background: rgba(14, 20, 34, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: all 0.25s ease;
}

.feature-box:hover {
  transform: translateY(-3px);
  border-color: var(--border-focus);
  background: rgba(20, 29, 48, 0.8);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.feature-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
  border: 1px solid rgba(59, 130, 246, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 10px;
}

.feature-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.feature-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.landing-cta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}

.btn-cta-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  color: #fff !important;
  font-size: 15px !important;
  padding: 12px 28px !important;
  border-radius: var(--radius-md) !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.4) !important;
}

.btn-cta-primary:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.6) !important;
}

.btn-cta-secondary {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid var(--border-subtle) !important;
  color: #e2e8f0 !important;
  font-size: 15px !important;
  padding: 12px 24px !important;
  border-radius: var(--radius-md) !important;
  font-weight: 600 !important;
}

.btn-cta-secondary:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}

/* Modern Register Form Styles */
.register-card-wrapper {
  max-width: 680px;
  margin: 0 auto;
  background: rgba(14, 20, 34, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-card);
}

.form-grid-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.form-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.character-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 18px 0;
}

@media (max-width: 600px) {
  .character-picker-grid {
    grid-template-columns: 1fr;
  }
}

.preview-selection-card {
  background: rgba(10, 15, 29, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.2s ease;
}

.preview-selection-card:hover {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.preview-image-box {
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
}

.preview-image-box img {
  max-width: 100%;
  max-height: 100%;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}

/* ==========================================================================
   BATTLE ARENA & COMBAT ENGINE SYSTEM
   ========================================================================== */

.battle-arena-card {
  background: radial-gradient(circle at 50% 30%, rgba(20, 29, 48, 0.95) 0%, rgba(9, 13, 22, 0.98) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
  margin: 15px auto;
  max-width: 900px;
}

.battle-stage {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  min-height: 280px;
  padding: 20px 30px;
  position: relative;
  background: url('../images/battlecenter.png') center bottom / cover no-repeat;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 20px;
  overflow: hidden;
}

.battle-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 13, 22, 0.4) 0%, rgba(9, 13, 22, 0.75) 100%);
  pointer-events: none;
}

.combatant-zone {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 220px;
}

.combatant-zone.player {
  align-items: flex-start;
}

.combatant-zone.enemy {
  align-items: flex-end;
}

.combat-info-card {
  background: rgba(14, 20, 34, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  margin-bottom: 12px;
}

.combat-info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 6px;
}

.hp-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.hp-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
}

.hp-fill.high {
  background: linear-gradient(90deg, #10b981, #34d399);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.hp-fill.medium {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.hp-fill.low {
  background: linear-gradient(90deg, #ef4444, #f87171);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.pokemon-sprite-box {
  position: relative;
  width: 140px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.pokemon-sprite {
  max-width: 120px;
  max-height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.6));
  transition: transform 0.2s ease;
}

.podium-base {
  width: 160px;
  height: 28px;
  background: radial-gradient(ellipse at center, rgba(59, 130, 246, 0.4) 0%, rgba(59, 130, 246, 0) 70%);
  border-radius: 50%;
  margin-top: -15px;
  z-index: 1;
}

.podium-base.enemy-base {
  background: radial-gradient(ellipse at center, rgba(239, 68, 68, 0.4) 0%, rgba(239, 68, 68, 0) 70%);
}

.floating-dmg {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 800;
  color: #ef4444;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  z-index: 10;
  animation: floatDmg 1s forwards ease-out;
}

.floating-dmg.critical {
  color: #fbbf24;
  font-size: 20px;
  text-shadow: 0 0 12px rgba(245, 158, 11, 0.8), 0 2px 8px rgba(0, 0, 0, 0.9);
}

@keyframes floatDmg {
  0% {
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.8);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -10px) scale(1.15);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, -25px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -35px) scale(0.9);
  }
}

.battle-log-feed {
  background: rgba(14, 20, 34, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 13px;
  line-height: 1.6;
  color: #cbd5e1;
  min-height: 48px;
  margin-bottom: 20px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

.moves-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 600px) {
  .moves-grid {
    grid-template-columns: 1fr;
  }
  .battle-stage {
    padding: 10px;
  }
  .combatant-zone {
    width: 140px;
  }
  .pokemon-sprite-box {
    width: 100px;
    height: 100px;
  }
  .pokemon-sprite {
    max-width: 90px;
    max-height: 90px;
  }
}

.move-btn {
  display: block;
  background: rgba(20, 29, 48, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.move-btn:hover {
  background: rgba(30, 43, 70, 0.85);
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
}

.move-btn.selected {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.25) 0%, rgba(59, 130, 246, 0.15) 100%);
  border-color: #3b82f6;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

.move-btn strong {
  color: #fff;
  font-size: 14px;
}

/* Combat Keyframe Animations */
.anim-player-attack {
  animation: playerAttack 0.3s ease-in-out;
}

@keyframes playerAttack {
  0% { transform: translateX(0); }
  50% { transform: translate(35px, -15px) scale(1.08); }
  100% { transform: translateX(0); }
}

.anim-enemy-attack {
  animation: enemyAttack 0.3s ease-in-out;
}

@keyframes enemyAttack {
  0% { transform: translateX(0); }
  50% { transform: translate(-35px, 15px) scale(1.08); }
  100% { transform: translateX(0); }
}

.anim-hit {
  animation: hitFlash 0.35s ease;
}

@keyframes hitFlash {
  0%, 100% { filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.6)); }
  25%, 75% { filter: drop-shadow(0 0 12px #ef4444) brightness(1.6) contrast(1.2); transform: scale(0.95); }
  50% { transform: translate(-8px, 4px) scale(0.95); }
}

.anim-shake {
  animation: stageShake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes stageShake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(3px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-5px, 0, 0); }
  40%, 60% { transform: translate3d(5px, 0, 0); }
}

.anim-faint {
  animation: faintDown 0.7s forwards ease-in;
}

@keyframes faintDown {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(40px) scale(0.8); }
}

/* ==========================================================================
   AUTHENTIC POKÉMON GBA/DS UNIFIED BATTLE CONSOLE (IN-SCREEN COMMANDS)
   ========================================================================== */

.pokemon-battle-console {
  background: #090d16;
  border: 3px solid #1e293b;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  position: relative;
  max-width: 840px;
  margin: 15px auto;
  user-select: none;
}

.battle-screen-viewport {
  position: relative;
  height: 340px;
  background: 
    radial-gradient(ellipse 70% 30% at 75% 42%, rgba(34, 197, 94, 0.25) 0%, transparent 70%),
    radial-gradient(ellipse 80% 35% at 25% 82%, rgba(34, 197, 94, 0.35) 0%, transparent 70%),
    linear-gradient(180deg, #1e3a5f 0%, #1e293b 45%, #143522 75%, #0f2317 100%);
  overflow: hidden;
  border-bottom: 2px solid #334155;
}

/* Subtle battlefield scanline / arena texture */
.battle-screen-viewport::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 120%, rgba(255, 255, 255, 0.03) 0%, transparent 60%);
  pointer-events: none;
}

/* Combat HUD Plates (Top-Left Enemy, Bottom-Right Player) */
.hud-plate {
  position: absolute;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 8px 14px;
  width: 220px;
  box-sizing: border-box;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 10;
  transition: all 0.3s ease;
}

.hud-plate.enemy-hud {
  top: 20px;
  left: 24px;
  border-left: 4px solid #f87171;
}

.hud-plate.player-hud {
  bottom: 24px;
  right: 24px;
  border-right: 4px solid #34d399;
}

.hud-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.hud-name {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-level {
  font-size: 11px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
}

.enemy-hud .hud-level {
  color: #f87171;
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.player-hud .hud-level {
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.hud-hp-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.hp-badge {
  font-size: 9px;
  font-weight: 900;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

.hud-hp-num {
  font-size: 11px;
  text-align: right;
  color: #94a3b8;
  font-weight: 600;
}

/* Battle Podiums & Sprites */
.battle-podium {
  position: absolute;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.battle-podium.enemy-podium {
  top: 35px;
  right: 60px;
  width: 170px;
  height: 160px;
}

.battle-podium.player-podium {
  bottom: 20px;
  left: 60px;
  width: 190px;
  height: 170px;
}

.sprite-wrapper {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pokemon-sprite {
  max-width: 125px;
  max-height: 125px;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.65));
  animation: sprite-bob 3s ease-in-out infinite alternate;
}

.sprite-enemy {
  max-width: 110px;
  max-height: 110px;
}

.sprite-player {
  max-width: 130px;
  max-height: 130px;
}

@keyframes sprite-bob {
  0% { transform: translateY(0); }
  100% { transform: translateY(-5px); }
}

.podium-shadow {
  width: 140px;
  height: 24px;
  background: radial-gradient(ellipse at center, rgba(16, 185, 129, 0.45) 0%, rgba(16, 185, 129, 0) 70%);
  border-radius: 50%;
  margin-top: -12px;
  z-index: 1;
}

.podium-shadow.enemy-shadow {
  width: 130px;
  background: radial-gradient(ellipse at center, rgba(59, 130, 246, 0.4) 0%, rgba(59, 130, 246, 0) 70%);
}

/* Lower Integrated Command Dock */
.battle-command-dock {
  background: #0f172a;
  display: grid;
  grid-template-columns: 42% 58%;
  min-height: 125px;
  padding: 12px;
  gap: 12px;
  align-items: stretch;
  position: relative;
  box-sizing: border-box;
}

/* Left: Dialogue / Story Box */
.dialog-box {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 14px 16px;
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.dialog-box strong {
  color: #60a5fa;
}

/* Right: 4-Moves 2x2 Inline Grid */
.action-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.moves-command-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  height: 100%;
}

.move-command-btn {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 12px;
  color: #fff;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.move-command-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(51, 65, 85, 0.95) 0%, rgba(30, 41, 59, 0.98) 100%);
  border-color: rgba(96, 165, 250, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25);
}

.move-command-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.move-command-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.m-name {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.m-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
}

.m-type-pill {
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-size: 9px;
}

.m-power {
  color: #94a3b8;
  font-weight: 600;
}

/* End Game Banner Dock inside command area */
.battle-end-dock {
  grid-column: 1 / -1;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
}

/* Responsive GBA Layout */
@media (max-width: 720px) {
  .battle-screen-viewport {
    height: 300px;
  }
  .hud-plate {
    width: 170px;
    padding: 6px 10px;
  }
  .hud-plate.enemy-hud {
    top: 10px;
    left: 10px;
  }
  .hud-plate.player-hud {
    bottom: 12px;
    right: 10px;
  }
  .battle-podium.enemy-podium {
    top: 25px;
    right: 20px;
  }
  .battle-podium.player-podium {
    bottom: 15px;
    left: 20px;
  }
  .pokemon-sprite {
    max-width: 90px;
    max-height: 90px;
  }
  .battle-command-dock {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .dialog-box {
    min-height: 48px;
  }
}

/* Pokémon Type Colors for Command Buttons */
.type-pill-normal   { background: #6b7280; color: #fff; }
.type-pill-fire     { background: #ea580c; color: #fff; }
.type-pill-water    { background: #0284c7; color: #fff; }
.type-pill-grass    { background: #16a34a; color: #fff; }
.type-pill-electric { background: #ca8a04; color: #fff; }
.type-pill-ice      { background: #0891b2; color: #fff; }
.type-pill-fighting { background: #b91c1c; color: #fff; }
.type-pill-poison   { background: #9333ea; color: #fff; }
.type-pill-ground   { background: #d97706; color: #fff; }
.type-pill-flying   { background: #4f46e5; color: #fff; }
.type-pill-psychic  { background: #db2777; color: #fff; }
.type-pill-bug      { background: #65a30d; color: #fff; }
.type-pill-rock     { background: #78716c; color: #fff; }
.type-pill-ghost    { background: #7c3aed; color: #fff; }
.type-pill-dragon   { background: #4338ca; color: #fff; }
.type-pill-dark     { background: #334155; color: #fff; }
.type-pill-steel    { background: #64748b; color: #fff; }
.type-pill-fairy    { background: #e11d48; color: #fff; }

/* ==========================================================================
   SPA Seamless Page Navigation (Top Progress Bar & Smooth Fade Transition)
   ========================================================================== */
#spa-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #818cf8, #fbbf24, #10b981);
  background-size: 200% 100%;
  animation: spaGradientMove 1.5s linear infinite;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.8), 0 0 5px rgba(251, 191, 36, 0.6);
  z-index: 999999;
  pointer-events: none;
  opacity: 0;
  transition: width 0.2s ease, opacity 0.2s ease;
}

@keyframes spaGradientMove {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.spa-transition-fade {
  animation: spaFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes spaFadeIn {
  from {
    opacity: 0.75;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
