/* ==========================================================================
   FANTACALCIO ULTIMATE - PREMIER DESIGN SYSTEM
   Modern Dark Aesthetic, Glassmorphism 2.0, FUT Engine & Dynamic Lighting
   ========================================================================== */

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

:root {
  /* Core Obsidian Palette */
  --bg-dark: #070a12;
  --bg-deep: #05080e;
  --bg-card: rgba(15, 23, 42, 0.78);
  --bg-card-elevated: rgba(22, 33, 58, 0.88);
  --bg-card-hover: rgba(30, 45, 78, 0.95);
  --bg-glass-input: rgba(10, 15, 29, 0.7);
  
  /* Specular Borders & Outlines */
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  --border-gold: rgba(245, 158, 11, 0.45);
  --border-gold-glow: rgba(245, 158, 11, 0.7);
  --border-cyan: rgba(6, 182, 212, 0.4);
  --border-purple: rgba(168, 85, 247, 0.4);

  /* Vivid Energy Accents */
  --primary-gold: #f59e0b;
  --primary-gold-bright: #fbbf24;
  --primary-gold-glow: rgba(245, 158, 11, 0.35);
  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.3);
  --accent-green: #10b981;
  --accent-green-glow: rgba(16, 185, 129, 0.3);
  --accent-red: #f43f5e;
  --accent-red-glow: rgba(244, 63, 94, 0.3);
  --accent-purple: #a855f7;
  --accent-purple-glow: rgba(168, 85, 247, 0.35);
  
  /* High-Contrast Typography */
  --text-main: #f8fafc;
  --text-bright: #ffffff;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  /* Geometry & Depth */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 9999px;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-main: 0 12px 36px -4px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --shadow-elevated: 0 20px 48px -6px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1);
  --shadow-glow-gold: 0 0 30px rgba(245, 158, 11, 0.25);
  --shadow-glow-cyan: 0 0 30px rgba(6, 182, 212, 0.22);
  
  --font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-fut: 'Rajdhani', 'Outfit', sans-serif;
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Global Reset & Micro-interactions
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(ellipse 90% 70% at 10% -10%, rgba(6, 182, 212, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 80% 60% at 90% 110%, rgba(245, 158, 11, 0.08) 0%, transparent 60%),
    radial-gradient(circle 800px at 50% 50%, rgba(168, 85, 247, 0.04) 0%, transparent 70%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

/* Custom Sleek Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  border: 2px solid var(--bg-deep);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-gold);
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--transition-fast), text-shadow var(--transition-fast);
}

a:hover {
  color: var(--primary-gold-bright);
  text-shadow: 0 0 12px var(--primary-gold-glow);
}

/* ==========================================================================
   Header & Iconified Sticky Navigation Bar
   ========================================================================== */
header.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(7, 10, 18, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.75);
  transition: all var(--transition-fast);
}

.nav-container {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text-bright);
  letter-spacing: -0.6px;
  white-space: nowrap;
  text-decoration: none;
  transition: transform var(--transition-fast);
}

.logo:hover {
  transform: scale(1.02);
}

.logo span.badge-logo {
  background: linear-gradient(135deg, var(--primary-gold-bright), #d97706);
  color: #0b0f19;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 900;
  letter-spacing: 0.8px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  list-style: none;
  padding: 2px 0;
}

.nav-links li {
  white-space: nowrap;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.04);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  transition: all var(--transition-smooth);
  border: 1px solid rgba(255, 255, 255, 0.09);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.nav-links a .nav-icon {
  font-size: 1.1rem;
  transition: transform var(--transition-smooth);
}

.nav-links a:hover {
  color: #ffffff;
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.28);
}

.nav-links a:hover .nav-icon {
  transform: scale(1.2) rotate(4deg);
}

.nav-links a.active {
  color: #0b0f19;
  background: linear-gradient(135deg, var(--primary-gold-bright), #d97706);
  border-color: var(--primary-gold);
  font-weight: 800;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.45);
  text-shadow: none;
}

/* Dropdown Menu (Cascata Moderno con Glassmorphism) */
.nav-links li.dropdown {
  position: relative;
}

.nav-links li.dropdown .dropdown-toggle {
  cursor: pointer;
  user-select: none;
}

.nav-links li.dropdown .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: rgba(11, 17, 32, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 8px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.95), 0 0 15px rgba(245, 158, 11, 0.15);
  z-index: 1200;
  margin-top: 0;
  list-style: none;
}

/* Invisible hover bridge */
.nav-links li.dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 12px;
  background: transparent;
  display: none;
}

@media (min-width: 1025px) {
  .nav-links li.dropdown:hover::after {
    display: block;
  }

  .nav-links li.dropdown:hover .dropdown-menu {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    animation: dropdownReveal 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
}

.nav-links li.dropdown.open .dropdown-menu {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  animation: dropdownReveal 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dropdownReveal {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.nav-links li.dropdown .dropdown-menu li {
  width: 100%;
  margin: 0;
}

.nav-links li.dropdown .dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: #f8fafc !important;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-xs);
  border: none;
  background: transparent;
  width: 100%;
  box-shadow: none;
  text-shadow: none;
  transition: all var(--transition-fast);
}

.nav-links li.dropdown .dropdown-menu a:hover {
  background: rgba(245, 158, 11, 0.22) !important;
  color: #ffffff !important;
  transform: translateX(5px);
}

/* User Badge Header */
.user-badge-header {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.user-name-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 700;
  transition: color var(--transition-fast);
}

.user-name-link:hover {
  color: var(--primary-gold);
}

.user-avatar-mini {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-gold-bright), #d97706);
  color: #0b0f19;
  font-weight: 900;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
}

.user-badge-header .credits-tag {
  background: rgba(245, 158, 11, 0.18);
  color: var(--primary-gold-bright);
  border: 1px solid var(--border-gold);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-logout-mini {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(244, 63, 94, 0.35);
  padding: 4px 8px;
  border-radius: 50%;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.btn-logout-mini:hover {
  background: var(--accent-red);
  color: #fff;
  transform: scale(1.12);
  box-shadow: 0 0 12px var(--accent-red-glow);
}

/* Mobile Toggle Button */
.mobile-menu-btn {
  display: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 1.3rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mobile-menu-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--primary-gold);
}

/* ==========================================================================
   Layout Containers & Glass Cards
   ========================================================================== */
main.main-content {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 2.2rem 1.5rem;
}

.glass-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  box-shadow: var(--shadow-main);
  transition: transform var(--transition-smooth), border-color var(--transition-smooth), box-shadow var(--transition-smooth);
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  pointer-events: none;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-elevated);
}

/* Card Hover Lift Helper */
.card-hover:hover {
  transform: translateY(-4px);
}

/* Grids */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.6rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1.6rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.4rem; }

/* Stat Highlights */
.stat-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.2rem;
  text-align: center;
  transition: all var(--transition-fast);
}
.stat-box:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--primary-gold);
  transform: translateY(-2px);
}
.stat-box .stat-val {
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.stat-box .stat-lbl {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 4px;
}

/* ==========================================================================
   Buttons & Interactive Micro-actions
   ========================================================================== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--primary-gold-bright) 0%, #d97706 100%);
  color: #0b0f19 !important;
  font-weight: 800;
  font-size: 0.92rem;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  box-shadow: 0 4px 18px var(--primary-gold-glow);
  transition: all var(--transition-fast);
  text-decoration: none;
  user-select: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.5);
  color: #000 !important;
  background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 100%);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  user-select: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #f43f5e, #dc2626);
  color: white !important;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  box-shadow: 0 4px 14px var(--accent-red-glow);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(244, 63, 94, 0.5);
  background: linear-gradient(135deg, #fb7185, #e11d48);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
  border-radius: var(--radius-xs);
}

/* ==========================================================================
   Badges, Chips & Alerts
   ========================================================================== */
.badge-role {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 9px;
  border-radius: 6px;
  font-weight: 900;
  font-size: 0.76rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  min-width: 32px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.badge-gk, .badge-p { background: linear-gradient(135deg, #eab308, #ca8a04); color: #000; }
.badge-def, .badge-d { background: linear-gradient(135deg, #0284c7, #0369a1); color: #fff; }
.badge-mid, .badge-c { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }
.badge-att, .badge-a { background: linear-gradient(135deg, #f43f5e, #e11d48); color: #fff; }

/* Status alerts */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 1.2rem;
  font-weight: 600;
  font-size: 0.94rem;
  display: flex;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(12px);
  border-left: 4px solid;
  animation: slideInAlert 0.25s ease-out;
}
@keyframes slideInAlert {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.alert-danger {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-left-color: var(--accent-red);
  color: #fda4af;
}
.alert-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-left-color: var(--accent-green);
  color: #6ee7b7;
}
.alert-warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-left-color: var(--primary-gold);
  color: #fde047;
}

/* ==========================================================================
   FUT / FIFA Cards Engine (State-of-the-Art Aesthetic)
   ========================================================================== */
.fifa-card {
  position: relative;
  width: 100%;
  max-width: 220px;
  min-height: 310px;
  height: auto;
  background: linear-gradient(160deg, #1e293b 0%, #0f172a 60%, #090d16 100%);
  border-radius: 18px;
  border: 2px solid var(--primary-gold);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.85), 0 0 20px var(--primary-gold-glow);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  overflow: hidden;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
  margin: 0 auto;
  user-select: none;
}

/* Subtle holographic diagonal glint */
.fifa-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(60deg, transparent 40%, rgba(255, 255, 255, 0.08) 50%, transparent 60%);
  transform: rotate(25deg);
  pointer-events: none;
  transition: transform 0.6s ease;
}

.fifa-card:hover {
  transform: translateY(-10px) scale(1.03);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.9), 0 0 30px rgba(245, 158, 11, 0.5);
}

.fifa-card:hover::before {
  transform: rotate(25deg) translate(20%, 20%);
}

/* Icon / Master Card (Cosmic Iridescent) */
.fifa-card.card-icon {
  background: linear-gradient(160deg, #3b0764 0%, #1e1b4b 60%, #0f172a 100%);
  border-color: #a855f7;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.85), 0 0 25px var(--accent-purple-glow);
}

.fifa-card.card-icon::before {
  background: linear-gradient(60deg, transparent 35%, rgba(168, 85, 247, 0.2) 50%, transparent 65%);
}

.fifa-card.card-icon:hover {
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.9), 0 0 35px rgba(168, 85, 247, 0.6);
}

/* Silver / Normal Card */
.fifa-card.card-silver {
  background: linear-gradient(160deg, #334155 0%, #1e293b 60%, #0f172a 100%);
  border-color: #94a3b8;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.7), 0 0 15px rgba(148, 163, 184, 0.25);
}

.fifa-card .card-top {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 1;
}

.fifa-card .ovr-rating {
  font-family: var(--font-fut);
  font-size: 2.1rem;
  font-weight: 900;
  line-height: 0.9;
  color: var(--primary-gold-bright);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  letter-spacing: -1px;
}

.fifa-card.card-icon .ovr-rating {
  color: #d8b4fe;
  text-shadow: 0 0 10px rgba(168, 85, 247, 0.6);
}

.fifa-card .player-photo {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.25);
  margin-top: -6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  z-index: 1;
}

.fifa-card .player-name {
  font-size: 1.05rem;
  font-weight: 900;
  color: #ffffff !important;
  margin-top: 12px;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  word-break: break-word;
  line-height: 1.25;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95);
  max-width: 100%;
  z-index: 1;
}

.fifa-card .player-details {
  font-size: 0.82rem;
  font-weight: 700;
  color: #cbd5e1 !important;
  margin-top: 4px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 1;
}

/* Pack opening reveal animations */
.shake-pack {
  animation: packShake 0.6s cubic-bezier(.36,.07,.19,.97) both infinite;
}
@keyframes packShake {
  10%, 90% { transform: translate3d(-2px, 0, 0) rotate(-1deg); }
  20%, 80% { transform: translate3d(3px, 0, 0) rotate(1.5deg); }
  30%, 50%, 70% { transform: translate3d(-5px, 0, 0) rotate(-2deg); }
  40%, 60% { transform: translate3d(5px, 0, 0) rotate(2deg); }
}

.zoom-in-card {
  animation: cardRevealPop 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes cardRevealPop {
  0% { transform: scale(0.3) rotate(-8deg); opacity: 0; filter: brightness(2); }
  70% { transform: scale(1.08) rotate(1deg); opacity: 1; filter: brightness(1.3); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; filter: brightness(1); }
}

/* ==========================================================================
   Realistic 3D Football Pitch (Il Campo Tattico)
   ========================================================================== */
.football-pitch {
  position: relative;
  width: 100%;
  max-width: 820px;
  height: 560px;
  margin: 0 auto;
  background-color: #15803d;
  /* Manicured Lawn Alternating Grass Stripes */
  background-image: repeating-linear-gradient(
    to bottom,
    #14532d 0px,
    #14532d 38px,
    #166534 38px,
    #166534 76px
  );
  border: 3px solid rgba(255, 255, 255, 0.85);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), inset 0 0 60px rgba(0, 0, 0, 0.4);
}

/* Halfway Line */
.football-pitch::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.75);
  transform: translateY(-50%);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.3);
}

/* Center Circle */
.football-pitch::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120px;
  height: 120px;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.3);
}

.pitch-layer {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding: 18px 12px;
  z-index: 2;
}

.pitch-row {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

/* Tactile Player Slots */
.player-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 86px;
  cursor: pointer;
  transition: transform var(--transition-smooth), filter var(--transition-fast);
  user-select: none;
}

.player-slot:hover {
  transform: translateY(-4px) scale(1.12);
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.6));
}

.player-slot .slot-badge {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(11, 17, 32, 0.92);
  border: 2.5px solid var(--primary-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.95rem;
  color: var(--primary-gold-bright);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.7), 0 0 12px var(--primary-gold-glow);
  transition: all var(--transition-fast);
}

.player-slot:hover .slot-badge {
  border-color: #ffffff;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
}

.player-slot .slot-name {
  background: rgba(7, 10, 18, 0.88);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  margin-top: 5px;
  text-align: center;
  max-width: 96px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   Modern Form Controls (Frosted Inputs & Selects)
   ========================================================================== */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select,
textarea {
  background: var(--bg-glass-input);
  border: 1px solid var(--border-color);
  color: var(--text-bright);
  font-family: var(--font-family);
  font-size: 0.95rem;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary-gold);
  box-shadow: 0 0 16px var(--primary-gold-glow), inset 0 1px 2px rgba(0, 0, 0, 0.2);
  background: rgba(15, 23, 42, 0.9);
}

label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #cbd5e1;
  margin-bottom: 6px;
  display: block;
}

/* ==========================================================================
   Tables & Data Presentation
   ========================================================================== */
.custom-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 1rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.custom-table th, .custom-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.custom-table th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.custom-table tbody tr {
  transition: background-color var(--transition-fast);
}

.custom-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

.custom-table tr:last-child td {
  border-bottom: none;
}

/* ==========================================================================
   Footer & Ad Banners
   ========================================================================== */
footer.footer {
  background: rgba(7, 10, 18, 0.96);
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 1.5rem;
  margin-top: auto;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.92rem;
}

.ad-banner-area {
  max-width: 728px;
  margin: 1.8rem auto 0;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Responsive Breakpoints & Smartphone Optimization
   ========================================================================== */
@media (max-width: 1024px) {
  header.navbar {
    padding: 0.65rem 1rem;
  }
  .nav-container {
    gap: 8px;
    position: relative;
  }
  .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: calc(100% + 0.65rem);
    left: -1rem;
    right: -1rem;
    background: rgba(7, 10, 18, 0.98);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border-bottom: 1px solid var(--border-gold);
    padding: 1.2rem 1.4rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.95);
    gap: 0.6rem;
    max-height: calc(100vh - 75px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 1500;
  }
  .nav-links.show {
    display: flex;
    animation: mobileDrawerSlide 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  @keyframes mobileDrawerSlide {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .nav-links li {
    width: 100%;
  }
  .nav-links a {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.96rem;
    justify-content: flex-start;
  }
  /* Mobile Accordion Dropdowns (strictly controlled by .open click/tap) */
  .nav-links li.dropdown:not(.open) .dropdown-menu {
    display: none !important;
  }
  .nav-links li.dropdown.open .dropdown-menu {
    display: flex !important;
    flex-direction: column !important;
    position: static !important;
    width: 100% !important;
    min-width: 100% !important;
    box-shadow: none !important;
    background: rgba(15, 23, 42, 0.85) !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
    border-radius: var(--radius-sm) !important;
    margin: 6px 0 !important;
    padding: 6px !important;
    animation: none !important;
  }
  .nav-links li.dropdown::after {
    display: none !important;
  }
  .nav-links li.dropdown .dropdown-menu a {
    padding: 11px 14px;
    font-size: 0.9rem;
  }
  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    order: 3;
    min-width: 44px;
    min-height: 44px;
  }
  .user-badge-header {
    order: 2;
    margin-left: auto;
  }
  .logo {
    order: 1;
  }
  .logo-text {
    font-size: 1.15rem;
  }
}

@media (max-width: 640px) {
  main.main-content {
    padding: 1.2rem 0.85rem;
  }
  .logo-text {
    display: none;
  }
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr !important;
    gap: 1.2rem;
  }
  .glass-card {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-sm);
  }
  /* Touch target sizes */
  .btn-primary, .btn-secondary, .btn-danger {
    min-height: 44px;
    padding: 10px 18px;
    font-size: 0.95rem;
  }
  .btn-sm {
    min-height: 38px;
    padding: 7px 12px;
  }
  /* Mobile Football Pitch Scaling */
  .football-pitch {
    max-width: 100%;
    height: 460px;
  }
  .pitch-layer {
    padding: 14px 6px;
  }
  .player-slot {
    width: auto;
    max-width: 19vw;
    min-width: 52px;
  }
  .player-slot .slot-badge {
    width: 44px;
    height: 44px;
    font-size: 0.84rem;
  }
  .player-slot .slot-name {
    font-size: 0.68rem;
    max-width: 64px;
    padding: 2px 4px;
  }
  /* Responsive Data Tables */
  .custom-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    white-space: nowrap;
  }
  .custom-table th, .custom-table td {
    padding: 10px 12px;
    font-size: 0.82rem;
  }
}

@media (max-width: 480px) {
  .user-badge-header .user-name-link strong {
    display: none;
  }
  .user-badge-header {
    padding: 4px 8px;
    gap: 6px;
  }
  .user-badge-header .credits-tag {
    padding: 3px 8px;
    font-size: 0.74rem;
  }
  .football-pitch {
    height: 410px;
  }
  .player-slot {
    min-width: 46px;
    max-width: 19vw;
  }
  .player-slot .slot-badge {
    width: 38px;
    height: 38px;
    font-size: 0.76rem;
  }
  .player-slot .slot-name {
    font-size: 0.62rem;
    max-width: 56px;
  }
  .fifa-card {
    max-width: 190px;
    min-height: 280px;
    padding: 14px 10px;
  }
  .fifa-card .player-photo {
    width: 72px;
    height: 72px;
  }
  .fifa-card .ovr-rating {
    font-size: 1.8rem;
  }
  .fifa-card .player-name {
    font-size: 0.95rem;
  }
}

/* ==========================================================================
   FANTAPAZZ-STYLE LINEUP & 4-COLUMN BENCH SYSTEM (Mobile & Desktop)
   ========================================================================== */
.fp-lineup-page-wrap {
  max-width: 1180px;
  margin: 0 auto;
}

/* 1. Top Team & INVIA Card */
.fp-team-submit-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, #2b3c46 0%, #23313a 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 13px 16px;
  margin-bottom: 12px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}

.fp-team-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.fp-shield-badge {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.35));
}

.fp-team-meta {
  min-width: 0;
}

.fp-team-title {
  color: #dcfce7;
  color: #d9f938;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fp-league-subtitle {
  color: #cbd5e1;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 1px;
}

.fp-count-sub {
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 2px;
}

.fp-midweek-pill {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  padding: 0 6px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 800;
}

.fp-btn-invia {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: linear-gradient(135deg, #d9f938 0%, #bef264 100%);
  color: #0f3d3e;
  font-weight: 900;
  font-size: 0.95rem;
  letter-spacing: 0.4px;
  padding: 11px 20px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(217, 249, 56, 0.55), 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
}

.fp-btn-invia:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(217, 249, 56, 0.8), 0 6px 14px rgba(0, 0, 0, 0.4);
}

.fp-btn-invia:active {
  transform: scale(0.96);
}

.fp-btn-locked {
  background: #475569 !important;
  color: #cbd5e1 !important;
  box-shadow: none !important;
  cursor: not-allowed;
}

/* Deadline compact strip */
.fp-deadline-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: #fde68a;
}

.fp-quick-link {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Main Grid: 2 Columns on Desktop, Stacked Pitch -> Bench on Mobile */
.fp-lineup-main-grid {
  display: grid;
  grid-template-columns: minmax(340px, 500px) 1fr;
  gap: 22px;
  align-items: start;
}

@media (max-width: 920px) {
  .fp-lineup-main-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* 2. Pitch Toolbar */
.fp-pitch-toolbar,
.fp-bench-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.fp-toolbar-left,
.fp-toolbar-right,
.fp-bench-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fp-pill-select,
.fp-pill-select:focus,
.fp-pill-select:active {
  background-color: #1e293b !important;
  color: #f8fafc !important;
  border: 1px solid rgba(245, 158, 11, 0.45) !important;
  border-radius: 10px !important;
  padding: 7px 12px !important;
  font-size: 0.85rem !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
  cursor: pointer;
  color-scheme: dark;
}

.fp-pill-select option {
  background-color: #0f172a !important;
  color: #f8fafc !important;
  font-weight: 700;
  padding: 8px;
}

.fp-pill-btn {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.fp-pill-btn:hover {
  border-color: var(--primary-gold);
  color: var(--primary-gold-bright);
}

.fp-pill-btn:active,
.fp-icon-btn:active {
  transform: scale(0.95);
}

.fp-icon-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.fp-icon-btn:hover {
  background: rgba(244, 63, 94, 0.2);
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.4);
}

/* 3. Fantapazz Pitch Card & Top/Bottom Branding Bars */
.fp-pitch-card {
  background: #232a31;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.fp-pitch-brand-bar {
  background: #232a31;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.fp-brand-logo {
  font-style: italic;
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: -0.3px;
}

.fp-brand-fanta {
  color: #facc15;
}

.fp-brand-pazz {
  color: #ffffff;
}

.fp-brand-logo small {
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 700;
}

/* 4. Realistic Green Striped Football Pitch */
.football-pitch.fp-grass-field {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 550px;
  margin: 0;
  border-radius: 10px;
  border: none;
  background-color: #6ab038;
  background-image: repeating-linear-gradient(
    to bottom,
    #6ab038 0px,
    #6ab038 42px,
    #5fa130 42px,
    #5fa130 84px
  );
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.football-pitch.fp-grass-field::before,
.football-pitch.fp-grass-field::after {
  display: none;
}

/* Pitch White Markings Overlay */
.fp-pitch-markings {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 12px;
  right: 12px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  pointer-events: none;
  z-index: 1;
}

.fp-goal-top {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 68px;
  height: 8px;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  border-bottom: none;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,0.25) 0, rgba(255,255,255,0.25) 2px, transparent 2px, transparent 5px);
}

.fp-goal-bottom {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 68px;
  height: 8px;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  border-top: none;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,0.25) 0, rgba(255,255,255,0.25) 2px, transparent 2px, transparent 5px);
}

.fp-penalty-box-top {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 52%;
  height: 76px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-top: none;
}

.fp-goal-box-top {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 46%;
  height: 26px;
  border: 1.8px solid rgba(255, 255, 255, 0.85);
  border-top: none;
}

.fp-penalty-arc-top {
  position: absolute;
  top: 62px;
  left: 50%;
  transform: translateX(-50%);
  width: 68px;
  height: 28px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-top: none;
  border-radius: 0 0 50px 50px;
}

.fp-penalty-box-bottom {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 52%;
  height: 76px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-bottom: none;
}

.fp-goal-box-bottom {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 46%;
  height: 26px;
  border: 1.8px solid rgba(255, 255, 255, 0.85);
  border-bottom: none;
}

.fp-penalty-arc-bottom {
  position: absolute;
  bottom: 62px;
  left: 50%;
  transform: translateX(-50%);
  width: 68px;
  height: 28px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-bottom: none;
  border-radius: 50px 50px 0 0;
}

.fp-halfway-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.85);
  transform: translateY(-50%);
}

.fp-center-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 98px;
  height: 98px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.fp-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.85);
}
.fp-corner-tl { top: -2px; left: -2px; border-top: none; border-left: none; border-radius: 0 0 14px 0; }
.fp-corner-tr { top: -2px; right: -2px; border-top: none; border-right: none; border-radius: 0 0 0 14px; }
.fp-corner-bl { bottom: -2px; left: -2px; border-bottom: none; border-left: none; border-radius: 0 14px 0 0; }
.fp-corner-br { bottom: -2px; right: -2px; border-bottom: none; border-right: none; border-radius: 14px 0 0 0; }

.fp-ball-deco {
  position: absolute;
  bottom: 18px;
  left: 14px;
  font-size: 1rem;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.45));
}

/* Tactical Rows Layer */
.pitch-layer.fp-tactical-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 8px 34px 8px;
  z-index: 3;
}

.pitch-row {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  width: 100%;
}

/* 5. Player Slot on Pitch (Avatar + Club Jersey + White Name Plate + Dark Match Pill) */
.player-slot.fp-pitch-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 68px;
  max-width: 96px;
  cursor: pointer;
  transition: transform 0.18s ease;
  position: relative;
}

.player-slot.fp-pitch-slot:hover {
  transform: translateY(-3px) scale(1.05);
}

/* Empty Role Token (Like the Orange 'P' Box in Screenshot 1) */
.fp-empty-role-token {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.05rem;
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.32);
}

.fp-role-bg-p { background: linear-gradient(135deg, #fb923c, #ea580c); }
.fp-role-bg-d { background: linear-gradient(135deg, #38bdf8, #0284c7); }
.fp-role-bg-c { background: linear-gradient(135deg, #f87171, #dc2626); }
.fp-role-bg-a { background: linear-gradient(135deg, #4ade80, #16a34a); }

/* Avatar + Jersey Figure Composite */
.fp-figure-wrap {
  position: relative;
  width: 68px;
  height: 46px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: -3px;
  z-index: 1;
}

.fp-mode-compact .fp-figure-wrap {
  display: none;
}

.fp-avatar-box {
  width: 44px;
  height: 44px;
  position: relative;
  z-index: 2;
  margin-right: -12px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.fp-avatar-svg,
.fp-avatar-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.fp-avatar-img {
  border-radius: 50%;
  border: 1.5px solid #fff;
}

.fp-jersey-box {
  width: 36px;
  height: 34px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.fp-jersey-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.fp-ovr-mini {
  position: absolute;
  top: -2px;
  right: 0;
  background: #f59e0b;
  color: #0f172a;
  font-size: 0.62rem;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 6px;
  z-index: 4;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

/* White Name Plate */
.fp-name-pill {
  background: #ffffff;
  color: #1e293b;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 82px;
  max-width: 21vw;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  z-index: 3;
  line-height: 1.25;
}

/* Dark Match & Status Pill */
.fp-match-pill {
  position: relative;
  background: #262626;
  color: #cbd5e1;
  font-size: 0.64rem;
  font-weight: 600;
  padding: 1.5px 6px 1.5px 17px;
  border-radius: 10px;
  margin-top: 2px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  max-width: 21vw;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.38);
  z-index: 3;
}

.fp-match-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.fp-team-own {
  color: #ffffff;
  font-weight: 900;
}

/* Status Circular Indicator (T = Green, P = Red, + = Injured, S = Suspended) */
.fp-status-badge {
  position: absolute;
  left: -3px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 900;
  border: 1.5px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.fp-status-t {
  background: #7cb518;
  color: #ffffff;
}

.fp-status-p {
  background: #e11d48;
  color: #ffffff;
}

.fp-status-inj {
  background: #ffffff;
  color: #dc2626;
  border-color: #dc2626;
  font-size: 0.66rem;
}

.fp-status-sus {
  background: #dc2626;
  color: #fde047;
}

/* ==========================================================================
   6. FANTAPAZZ 4-COLUMN BENCH SECTION (Screenshot 2)
   ========================================================================== */
.fp-bench-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #cbd5e1;
  font-weight: 800;
  font-size: 0.96rem;
}

.fp-bench-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.fp-bench-grid.fp-bench-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fp-bench-card {
  position: relative;
  border-radius: 12px;
  padding: 6px 4px 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 118px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.5);
  user-select: none;
}

.fp-bench-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

.fp-bench-card:active {
  transform: scale(0.96);
}

/* Soft Pastel Role Tints (Matching Screenshot 2) */
.fp-bench-tint-p { background: #fdf0e2; }
.fp-bench-tint-d { background: #e3f3fc; }
.fp-bench-tint-c { background: #fdeaea; }
.fp-bench-tint-a { background: #e6f8ec; }

.fp-bench-card-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
  margin-bottom: 2px;
}

.fp-bench-role-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.fp-bench-slot-num {
  color: #334155;
  font-size: 0.72rem;
  font-weight: 800;
}

.fp-bench-top-spacer {
  width: 20px;
}

.fp-bench-figure {
  width: 64px;
  height: 44px;
  margin-bottom: -2px;
}

.fp-bench-name {
  width: 94% !important;
  max-width: 100% !important;
  font-size: 0.7rem;
  padding: 2px 4px;
}

.fp-bench-match {
  width: 92%;
  max-width: 100% !important;
  min-width: 0;
  font-size: 0.61rem;
  padding: 1.5px 4px 1.5px 15px;
}

/* Empty Bench Slot Styling */
.fp-bench-empty-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 0;
}

.fp-bench-plus-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px dashed #64748b;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
}

.fp-bench-empty-lbl {
  color: #475569;
  font-size: 0.66rem;
  font-weight: 700;
}

/* ==========================================================================
   7. INTERACTIVE PLAYER SELECTION BOTTOM SHEET / MODAL
   ========================================================================== */
.fp-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  z-index: 10050;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

@media (min-width: 640px) {
  .fp-modal-backdrop {
    align-items: center;
    padding: 16px;
  }
}

.fp-modal-sheet {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-top: 2px solid rgba(245, 158, 11, 0.5);
  border-radius: 22px 22px 0 0;
  width: 100%;
  max-width: 560px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  padding: 12px 14px calc(22px + env(safe-area-inset-bottom, 0px)) 14px;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.85);
  animation: fpSheetUp 0.22s ease-out;
}

@media (min-width: 640px) {
  .fp-modal-sheet {
    border-radius: 18px;
    padding: 16px 18px 20px 18px;
  }
}

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

.fp-modal-handle {
  width: 44px;
  height: 5px;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 4px;
  margin: 0 auto 10px auto;
}

.fp-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.fp-modal-title {
  color: #f8fafc;
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0;
}

.fp-modal-subtitle {
  color: #94a3b8;
  font-size: 0.78rem;
  margin: 2px 0 0 0;
}

.fp-modal-close {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.15);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-weight: 900;
  font-size: 0.95rem;
  cursor: pointer;
  flex-shrink: 0;
}

.fp-modal-role-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.fp-role-tab-btn {
  flex: 1;
  padding: 8px 6px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #1e293b;
  color: #e2e8f0;
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
}

.fp-role-tab-btn.active {
  background: var(--primary-gold);
  color: #0f172a;
  border-color: var(--primary-gold);
}

.fp-modal-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  padding: 4px 2px;
}

/* Mobile-First Spacious Horizontal Player Rows in Modal */
.fp-picker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fp-picker-row-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(30, 41, 59, 0.92);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 9px 11px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}

.fp-picker-row-card:hover,
.fp-picker-row-card:active {
  background: rgba(30, 45, 78, 0.98);
  border-color: var(--primary-gold);
  transform: scale(0.99);
}

.fp-picker-row-card.fp-selected-card {
  border-color: #d9f938;
  background: rgba(22, 101, 52, 0.35);
  box-shadow: 0 0 14px rgba(217, 249, 56, 0.25);
}

.fp-picker-left {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.fp-picker-figure {
  position: relative;
  width: 60px;
  height: 44px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 2px 3px 0 3px;
}

.fp-picker-center {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fp-picker-name-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.fp-picker-player-name {
  color: #ffffff;
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.2;
}

.fp-picker-team-lbl {
  color: #94a3b8;
  font-size: 0.76rem;
  font-weight: 700;
}

.fp-picker-badges-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.fp-picker-match-tag {
  position: relative;
  background: #111827;
  color: #cbd5e1;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px 2px 20px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: inline-flex;
  align-items: center;
}

.fp-picker-match-tag .fp-status-badge {
  left: 1px;
  width: 15px;
  height: 15px;
  font-size: 0.56rem;
}

.fp-picker-status-chip {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  line-height: 1.25;
}

.fp-chip-starter {
  background: rgba(124, 181, 24, 0.2);
  color: #bef264;
  border: 1px solid rgba(124, 181, 24, 0.45);
}

.fp-chip-doubt {
  background: rgba(245, 158, 11, 0.2);
  color: #fde047;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.fp-chip-out {
  background: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.fp-picker-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
}

.fp-picker-ovr-badge {
  color: var(--primary-gold-bright);
  font-size: 0.8rem;
  font-weight: 900;
}

.fp-picker-choose-btn {
  background: linear-gradient(135deg, #d9f938 0%, #a3e635 100%);
  color: #0f172a;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 8px;
  white-space: nowrap;
}

.fp-modal-footer {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

/* Mobile Pitch & Bench Fine-Tuning */
@media (max-width: 520px) {
  .football-pitch.fp-grass-field {
    height: 495px;
  }
  .pitch-layer.fp-tactical-layer {
    padding: 16px 4px 26px 4px;
  }
  .player-slot.fp-pitch-slot {
    min-width: 54px;
  }
  .fp-figure-wrap {
    width: 58px;
    height: 41px;
  }
  .fp-avatar-box {
    width: 38px;
    height: 38px;
    margin-right: -11px;
  }
  .fp-jersey-box {
    width: 31px;
    height: 29px;
  }
  .fp-name-pill {
    width: 72px;
    font-size: 0.66rem;
    padding: 1.5px 3px;
  }
  .fp-match-pill {
    min-width: 62px;
    font-size: 0.58rem;
    padding: 1px 4px 1px 14px;
  }
  .fp-status-badge {
    width: 14px;
    height: 14px;
    font-size: 0.54rem;
    left: -2px;
  }
  .fp-bench-grid {
    gap: 5px;
  }
  .fp-bench-card {
    min-height: 108px;
    padding: 5px 2px 6px 2px;
  }
  .fp-bench-name {
    width: 95% !important;
    max-width: 95% !important;
    font-size: 0.64rem;
    padding: 1.5px 2px;
  }
  .fp-bench-match {
    width: 94% !important;
    max-width: 94% !important;
    min-width: 0 !important;
    font-size: 0.56rem;
    padding: 1px 2px 1px 13px;
  }
  .fp-picker-row-card {
    padding: 8px 9px;
    gap: 8px;
  }
  .fp-picker-figure {
    width: 52px;
    height: 40px;
  }
  .fp-picker-player-name {
    font-size: 0.88rem;
  }
}

