/* Reset & Root Design Tokens */
:root {
  --bg-main: #0b0f19;
  --bg-card: #151d2a;
  --bg-card-hover: #1c2738;
  --border-color: #26354a;
  --border-light: rgba(255, 255, 255, 0.1);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --accent-purple: #8b5cf6;

  /* Team Colors: Strictly Blue for Home (Fríos) and Red for Away (Cálidos) */
  --team-home-bg: linear-gradient(135deg, #2563eb, #1d4ed8);
  --team-home-border: #93c5fd;

  --team-away-bg: linear-gradient(135deg, #dc2626, #991b1b);
  --team-away-border: #fca5a5;

  /* Pitch Colors */
  --pitch-bg: radial-gradient(circle at center, #064e3b 0%, #022c22 100%);
  --pitch-lines: rgba(255, 255, 255, 0.8);

  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-brand: 'Outfit', 'Inter', sans-serif;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.dark-theme {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Header Navbar */
.main-header {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  font-size: 1.8rem;
  color: var(--accent-emerald);
  filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.4));
}

.brand-title {
  font-family: var(--font-brand);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  display: block;
}

/* View Switcher Tabs */
.mode-switcher {
  display: flex;
  background: rgba(15, 23, 42, 0.9);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.mode-btn:hover {
  color: var(--text-primary);
}

.mode-btn.active {
  background: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--accent-blue);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-blue-hover);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-success {
  background: var(--accent-emerald);
  color: #ffffff;
}

.btn-success:hover {
  background: #059669;
}

.btn-danger {
  background: var(--accent-red);
  color: #ffffff;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-secondary {
  background: #334155;
  color: var(--text-primary);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: var(--bg-card-hover);
}

.btn-danger.btn-outline {
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--accent-red);
}

.btn-danger.btn-outline:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* Main Container Layout */
.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Top Match Summary Bar (Public) */
.top-bar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-card);
}

.top-bar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.match-info-group {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.match-main-info {
  display: flex;
  flex-direction: column;
}

.match-title {
  font-family: var(--font-brand);
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}

.match-badges-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.match-badge {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 800;
}

.formation-badge {
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
}

.home-bg {
  background: rgba(59, 130, 246, 0.2);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.away-bg {
  background: rgba(239, 68, 68, 0.2);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.home-text { color: var(--accent-blue) !important; }
.away-text { color: var(--accent-red) !important; }

.match-meta-inline {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.meta-inline-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.meta-inline-item i {
  color: var(--accent-blue);
}

/* =======================================================
   ADMIN CONFIG CARD & INPUT CONTROLS CSS (RESTORED & ENHANCED)
   ======================================================= */
.admin-config-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-family: var(--font-brand);
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.form-control {
  background: #0f172a !important;
  color: var(--text-primary) !important;
  border: 1.5px solid var(--border-color) !important;
  border-radius: var(--radius-md) !important;
  padding: 0.65rem 0.85rem !important;
  font-family: var(--font-main) !important;
  font-size: 0.875rem !important;
  transition: all 0.2s ease !important;
  outline: none !important;
  width: 100%;
}

.form-control:focus {
  border-color: var(--accent-blue) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
  background: #1e293b !important;
}

.form-control::placeholder {
  color: var(--text-muted);
  font-size: 0.825rem;
}

select.form-control option {
  background: #0f172a;
  color: #ffffff;
  padding: 0.5rem;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.preset-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.preset-label {
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.preset-btn {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-btn:hover {
  background: var(--bg-card-hover);
  color: #ffffff;
}

.preset-btn.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.preset-btn.away-preset.active {
  background: var(--accent-red);
  border-color: var(--accent-red);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.admin-actions-bar {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

.admin-actions-left, .admin-actions-right {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* =======================================================
   TACTICAL PITCH & TOKENS
   ======================================================= */
.pitch-section {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
}

.pitch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pitch-mode-tag {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent-emerald);
}

.pitch-subtitle {
  display: block;
  font-size: 0.725rem;
  color: var(--text-muted);
}

.pitch-view-selector {
  display: flex;
  gap: 0.3rem;
  background: var(--bg-main);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.view-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.35rem 0.8rem;
  font-size: 0.775rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.view-toggle-btn.active {
  background: var(--accent-blue);
  color: #ffffff;
}

/* Pitch Wrapper */
.horizontal-pitch-wrapper {
  background: var(--pitch-bg);
  border: 2.5px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.65);
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1000 / 620;
  margin: 0 auto;
}

.horizontal-pitch {
  position: relative;
  width: 100%;
  height: 100%;
}

.horizontal-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: block;
}

.vertical-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: none;
}

.vertical-pitch-mode .horizontal-svg {
  display: none !important;
}

.vertical-pitch-mode .vertical-svg {
  display: block !important;
}

.vertical-pitch-mode {
  aspect-ratio: 620 / 1000 !important;
  max-width: 520px !important;
  height: min(720px, 80vh) !important;
  margin: 0 auto !important;
}

.pitch-tokens-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Player Tokens */
.player-token {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  user-select: none;
  z-index: 10;
  touch-action: none;
  transition: transform 0.15s ease;
}

.player-token:hover {
  transform: translate(-50%, -50%) scale(1.1);
  z-index: 30;
}

.admin-mode .player-token {
  cursor: grab;
}

.admin-mode .player-token:active {
  cursor: grabbing;
  z-index: 50;
  transform: translate(-50%, -50%) scale(1.2);
}

.token-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 1.1rem;
  color: #ffffff;
  border: 2.5px solid #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  position: relative;
}

.team-home .token-circle {
  background: var(--team-home-bg) !important;
  border-color: var(--team-home-border) !important;
}

.team-away .token-circle {
  background: var(--team-away-bg) !important;
  border-color: var(--team-away-border) !important;
}

.role-tag {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #0f172a;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 0.55rem;
  font-weight: 800;
  padding: 1px 3px;
  border-radius: 4px;
}

.captain-badge {
  position: absolute;
  bottom: -3px;
  left: -3px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
  border: 1.5px solid #ffffff;
  font-size: 0.65rem;
  font-weight: 900;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.5);
  z-index: 5;
}

.card-captain-badge {
  background: linear-gradient(135deg, rgba(245,158,11,0.25), rgba(217,119,6,0.25));
  border: 1px solid rgba(245,158,11,0.6);
  color: var(--accent-amber);
  font-size: 0.775rem;
  font-weight: 800;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.token-label {
  margin-top: 3px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 0.675rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.2);
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  max-width: 105px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ball-token {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
  font-size: 1.15rem;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.9), 0 4px 10px rgba(0, 0, 0, 0.6);
  z-index: 20;
  touch-action: none;
}

/* Squads Parallel Container */
.squads-container-below {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  width: 100%;
  margin-top: 0.5rem;
}

.squad-team-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.squad-team-card.home-card { border-top: 4px solid var(--accent-blue); }
.squad-team-card.away-card { border-top: 4px solid var(--accent-red); }

.squad-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.squad-team-title {
  font-family: var(--font-brand);
  font-size: 1.15rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.count-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.squad-section-title {
  font-size: 0.775rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.squad-grid-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem;
}

.squad-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  cursor: pointer;
}

.squad-item:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: var(--bg-card-hover);
}

.squad-item.selected {
  border-color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.08);
}

.player-info-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.player-select-cb {
  width: 17px;
  height: 17px;
  accent-color: var(--accent-amber);
  cursor: pointer;
}

.squad-number {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #ffffff;
}

.squad-number.home-number { background: #2563eb; }
.squad-number.away-number { background: #dc2626; }

.squad-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.squad-role-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
}

/* =======================================================
   WORLD CUP STYLE PLAYER TRADING CARD MODAL ("Lámina del Mundial")
   ======================================================= */
.trading-card-container {
  position: relative;
  max-width: 360px;
  width: 90%;
  animation: cardZoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardZoomIn {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.card-close-btn {
  position: absolute;
  top: -15px;
  right: -15px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-red);
  color: #ffffff;
  border: 2px solid #ffffff;
  font-size: 1.4rem;
  font-weight: 800;
  cursor: pointer;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.football-card {
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  border: 4px solid #f59e0b;
  border-radius: 20px;
  padding: 1.25rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(245, 158, 11, 0.2);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

/* Holographic Shine Effect */
.football-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.06) 45%, 
    rgba(255, 255, 255, 0.15) 50%, 
    rgba(255, 255, 255, 0.06) 55%, 
    transparent 100%
  );
  transform: rotate(25deg);
  pointer-events: none;
}

.football-card.home-card-theme {
  border-color: #3b82f6;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.8), inset 0 0 25px rgba(59, 130, 246, 0.25);
}

.football-card.away-card-theme {
  border-color: #ef4444;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.8), inset 0 0 25px rgba(239, 68, 68, 0.25);
}

.card-header-foil {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-team-tag {
  font-family: var(--font-brand);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-dorsal-badge {
  font-family: var(--font-brand);
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
  color: #f59e0b;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.card-photo-container {
  position: relative;
  width: 100%;
  height: 200px;
  background: #090d16;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-avatar-fallback {
  font-size: 5rem;
  color: rgba(255, 255, 255, 0.25);
}

.home-card-theme .card-avatar-fallback { color: rgba(59, 130, 246, 0.4); }
.away-card-theme .card-avatar-fallback { color: rgba(239, 68, 68, 0.4); }

.card-role-pill {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.9);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-details-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-player-name {
  font-family: var(--font-brand);
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1.1;
  color: #ffffff;
  text-align: center;
}

.card-nickname-badge {
  align-self: center;
  font-size: 0.775rem;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-amber);
  border: 1.5px solid rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-bio-section {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem;
  border-radius: 8px;
  margin-top: 0.25rem;
}

.bio-label {
  font-size: 0.725rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 0.25rem;
}

.bio-text {
  font-size: 0.825rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.card-footer-branding {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 700;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.5rem;
}

/* CSV Guide Box */
.csv-format-guide {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  padding: 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;

}

.csv-format-guide code {
  display: block;
  background: #090d16;
  color: var(--accent-emerald);
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  margin: 0.4rem 0;
  font-family: monospace;
  font-size: 0.85rem;
}

.csv-example-box {
  background: #050811;
  color: #94a3b8;
  padding: 0.5rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.75rem;
  white-space: pre-wrap;
  margin-top: 0.4rem;
  border-left: 3px solid var(--accent-blue);
}

/* Bulk Action Floating Bar */
.bulk-action-bar {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--accent-amber);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  z-index: 500;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translate(-50%, 100%); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.bulk-action-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.bulk-buttons {
  display: flex;
  gap: 0.5rem;
}

/* Color Guide Modal */
.modal-lg { max-width: 720px; }

.color-guide-modal-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.color-wheel-wrapper {
  text-align: center;
  background: #0f172a;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.color-wheel-img {
  max-width: 100%;
  max-height: 380px;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.color-teams-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.color-rule-card {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.color-rule-card.warm-rule { border-top: 3.5px solid var(--accent-red); }
.color-rule-card.cool-rule { border-top: 3.5px solid var(--accent-blue); }

.rule-title { font-size: 0.95rem; font-weight: 800; }
.rule-desc { font-size: 0.775rem; color: var(--text-secondary); }

.color-tags-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.color-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.color-chip .dot { width: 8px; height: 8px; border-radius: 50%; }

/* Warm Chips */
.chip-red { background: rgba(239, 68, 68, 0.2); color: #f87171; border-color: rgba(239, 68, 68, 0.4); }
.chip-red .dot { background: #ef4444; }
.chip-orange { background: rgba(249, 115, 22, 0.2); color: #fb923c; border-color: rgba(249, 115, 22, 0.4); }
.chip-orange .dot { background: #f97316; }
.chip-yellow { background: rgba(234, 179, 8, 0.2); color: #facc15; border-color: rgba(234, 179, 8, 0.4); }
.chip-yellow .dot { background: #eab308; }
.chip-pink { background: rgba(236, 72, 153, 0.2); color: #f472b6; border-color: rgba(236, 72, 153, 0.4); }
.chip-pink .dot { background: #ec4899; }
.chip-white { background: #ffffff; color: #0f172a; border-color: #cbd5e1; font-weight: 800; }
.chip-white .dot { background: #0f172a; }

/* Cool Chips */
.chip-blue { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border-color: rgba(59, 130, 246, 0.4); }
.chip-blue .dot { background: #3b82f6; }
.chip-green { background: rgba(16, 185, 129, 0.2); color: #34d399; border-color: rgba(16, 185, 129, 0.4); }
.chip-green .dot { background: #10b981; }
.chip-purple { background: rgba(168, 85, 247, 0.2); color: #c084fc; border-color: rgba(168, 85, 247, 0.4); }
.chip-purple .dot { background: #a855f7; }
.chip-cyan { background: rgba(6, 182, 212, 0.2); color: #22d3ee; border-color: rgba(6, 182, 212, 0.4); }
.chip-cyan .dot { background: #06b6d4; }
.chip-black { background: #000000; color: #ffffff; border-color: #334155; font-weight: 800; }
.chip-black .dot { background: #ffffff; }

.rule-note {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

/* Modals & Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 92%;
  max-width: 480px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.85);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-card form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.modal-header {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}

.modal-body { 
  padding: 1.1rem; 
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  max-height: 62vh;
}

.modal-footer {
  padding: 0.85rem 1.1rem;
  background: var(--bg-main);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
}

.toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 2000;
}

.toast {
  background: var(--bg-card);
  border-left: 4px solid var(--accent-blue);
  color: var(--text-primary);
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.toast.success { border-left-color: var(--accent-emerald); }
.toast.error { border-left-color: var(--accent-red); }

.hidden { display: none !important; }

.desc-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.desc-chip {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.725rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.desc-chip:hover {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #ffffff;
}

.photo-preview-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-color);
}

@media (max-width: 992px) {
  .squads-container-below { grid-template-columns: 1fr; }
  .color-teams-grid { grid-template-columns: 1fr; }
  .admin-actions-bar { flex-direction: column; align-items: stretch; }
  .admin-actions-left, .admin-actions-right { flex-direction: column; width: 100%; }
}

@media (max-width: 768px) {
  .top-bar-content {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .top-bar-actions {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }

  .top-bar-actions button {
    width: 100%;
    margin-right: 0 !important;
    justify-content: center;
  }

  .pitch-header {
    flex-direction: column;
    align-items: stretch;
  }

  .pitch-view-selector {
    width: 100%;
    justify-content: space-between;
  }

  /* Cancha vertical por defecto en móviles si no se fuerza horizontal */
  .tactical-board-wrapper:not(.horizontal-forced) .horizontal-svg {
    display: none !important;
  }

  .tactical-board-wrapper:not(.horizontal-forced) .vertical-svg {
    display: block !important;
  }

  .tactical-board-wrapper:not(.horizontal-forced) {
    aspect-ratio: 620 / 1000 !important;
    max-width: 100% !important;
    height: 560px !important;
    margin: 0 auto !important;
  }
}
