/* ==========================================================================
   FAPC CÓRDOBA - ESTILOS OFICIALES OPTIMIZADOS (ZERO BLOAT)
   Diseño Widescreen Pro + Fondos Estéticos Visibles de Ajedrez
   ========================================================================== */

:root {
  --primary: #7A0026;         /* Borgoña FAPC */
  --primary-hover: #59001b;
  --primary-light: #fbebf0;
  --accent: #d97706;          /* Dorado ajedrecístico */
  --accent-hover: #b45309;
  --success: #15803d;         /* Verde inscripción */
  --success-hover: #166534;
  --fide-blue: #1d4ed8;       /* Azul FIDE / Chess-Results */
  --fide-blue-hover: #1e40af;
  
  --bg-main: #f1f5f9;
  --bg-surface: rgba(255, 255, 255, 0.94);
  --bg-alt: #f8fafc;
  --border: #cbd5e1;
  --border-light: rgba(203, 213, 225, 0.9);
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-inverse: #ffffff;
  
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.08);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.06);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.12), 0 4px 6px -4px rgb(0 0 0 / 0.08);
  --shadow-card: 0 14px 28px -4px rgb(0 0 0 / 0.1), 0 10px 10px -5px rgb(0 0 0 / 0.04);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  --font-stack: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Fondo Modo Claro: Tablero de ajedrez visible de 80px */
  --bg-board-pattern: 
    linear-gradient(45deg, #e2e8f0 25%, transparent 25%), 
    linear-gradient(-45deg, #e2e8f0 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #e2e8f0 75%), 
    linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
  --bg-board-color: #f8fafc;
  --bg-board-size: 80px 80px;
  --bg-board-pos: 0 0, 0 40px, 40px -40px, -40px 0px;
}

[data-theme="dark"] {
  --bg-main: #0a0f1d;
  --bg-surface: rgba(16, 24, 40, 0.92);
  --bg-alt: #131c31;
  --border: #243452;
  --border-light: rgba(255, 255, 255, 0.1);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary-light: rgba(122, 0, 38, 0.35);
  
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 20px -3px rgb(0 0 0 / 0.6);
  --shadow-card: 0 20px 30px -5px rgb(0 0 0 / 0.7);

  /* Fondo Modo Oscuro: Tablero de ajedrez nocturno visible */
  --bg-board-pattern: 
    linear-gradient(45deg, #111a2e 25%, transparent 25%), 
    linear-gradient(-45deg, #111a2e 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #111a2e 75%), 
    linear-gradient(-45deg, transparent 75%, #111a2e 75%);
  --bg-board-color: #090e1a;
  --bg-board-size: 80px 80px;
  --bg-board-pos: 0 0, 0 40px, 40px -40px, -40px 0px;
}

html, body {
  overflow-x: hidden !important;
  max-width: 100vw;
  width: 100%;
  position: relative;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-stack);
  background-color: var(--bg-board-color);
  background-image: var(--bg-board-pattern);
  background-size: var(--bg-board-size);
  background-position: var(--bg-board-pos);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease;
}

/* ==========================================================================
   FONDOS ESTÉTICOS ALTERNATIVOS (SELECCIONABLES EN VIVO)
   ========================================================================== */

/* Fondo 1: Tablero de Ajedrez (Por defecto) */
body.bg-tablero {
  background-color: var(--bg-board-color);
  background-image: var(--bg-board-pattern);
  background-size: var(--bg-board-size);
  background-position: var(--bg-board-pos);
  background-attachment: fixed;
}

/* Fondo 2: Wallpaper de Piezas de Ajedrez SVG */
body.bg-piezas {
  background-color: var(--bg-main);
  background-image: url('assets/patterns/pieces_light.svg');
  background-size: 140px 140px;
  background-attachment: fixed;
}

[data-theme="dark"] body.bg-piezas {
  background-color: #090e1a;
  background-image: url('assets/patterns/pieces_dark.svg');
  background-size: 140px 140px;
}

/* Fondo 3: Resplandor Mesh Gradient Borgoña & Dorado */
body.bg-resplandor {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(122, 0, 38, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(217, 119, 6, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(2, 132, 199, 0.06) 0%, transparent 50%);
  background-size: auto;
  background-attachment: fixed;
}

[data-theme="dark"] body.bg-resplandor {
  background-color: #070a14;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(122, 0, 38, 0.35) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(217, 119, 6, 0.25) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.1) 0%, transparent 50%);
}

/* Fondo 4: Cuadrícula Técnica Blueprint */
body.bg-blueprint {
  background-color: var(--bg-main);
  background-image: 
    linear-gradient(to right, rgba(148, 163, 184, 0.25) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.25) 1px, transparent 1px);
  background-size: 32px 32px;
  background-attachment: fixed;
}

[data-theme="dark"] body.bg-blueprint {
  background-color: #070b16;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* Fondo 5: Minimal Dots (Micropuntos Ultra Limpios - Estilo Vercel/Linear) */
body.bg-micropuntos {
  background-color: #f8fafc;
  background-image: radial-gradient(rgba(100, 116, 139, 0.22) 1.2px, transparent 1.2px);
  background-size: 20px 20px;
  background-attachment: fixed;
}

[data-theme="dark"] body.bg-micropuntos {
  background-color: #0b0f19;
  background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1.2px, transparent 1.2px);
  background-size: 20px 20px;
}

/* Fondo 6: Madera Nórdica Staunton (Lino & Veta Sutil de Torneo) */
body.bg-madera {
  background-color: #fbf8f3;
  background-image: 
    repeating-linear-gradient(45deg, rgba(180, 130, 80, 0.04) 0px, rgba(180, 130, 80, 0.04) 2px, transparent 2px, transparent 8px),
    radial-gradient(ellipse at top, rgba(245, 235, 220, 0.6) 0%, transparent 70%);
  background-attachment: fixed;
}

[data-theme="dark"] body.bg-madera {
  background-color: #120e0e;
  background-image: 
    repeating-linear-gradient(45deg, rgba(217, 119, 6, 0.05) 0px, rgba(217, 119, 6, 0.05) 2px, transparent 2px, transparent 8px),
    radial-gradient(ellipse at top, rgba(122, 0, 38, 0.2) 0%, transparent 70%);
}

/* Fondo 7: Mármol Real Carrara & Onyx Granito */
body.bg-marmol {
  background-color: #f8f9fa;
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(226, 232, 240, 0.7) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(203, 213, 225, 0.5) 0%, transparent 50%),
    linear-gradient(120deg, transparent 40%, rgba(148, 163, 184, 0.08) 50%, transparent 60%);
  background-attachment: fixed;
}

[data-theme="dark"] body.bg-marmol {
  background-color: #090a0f;
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(30, 41, 59, 0.6) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(122, 0, 38, 0.15) 0%, transparent 50%),
    linear-gradient(120deg, transparent 40%, rgba(255, 255, 255, 0.03) 50%, transparent 60%);
}

/* Fondo 8: Isométrico 3D (Estructura Hexagonal & Diamante) */
body.bg-geometrico {
  background-color: #f5f7fa;
  background-image: 
    linear-gradient(30deg, rgba(100, 116, 139, 0.07) 12%, transparent 12.5%, transparent 87%, rgba(100, 116, 139, 0.07) 87.5%, rgba(100, 116, 139, 0.07)),
    linear-gradient(150deg, rgba(100, 116, 139, 0.07) 12%, transparent 12.5%, transparent 87%, rgba(100, 116, 139, 0.07) 87.5%, rgba(100, 116, 139, 0.07)),
    linear-gradient(30deg, rgba(100, 116, 139, 0.07) 12%, transparent 12.5%, transparent 87%, rgba(100, 116, 139, 0.07) 87.5%, rgba(100, 116, 139, 0.07)),
    linear-gradient(150deg, rgba(100, 116, 139, 0.07) 12%, transparent 12.5%, transparent 87%, rgba(100, 116, 139, 0.07) 87.5%, rgba(100, 116, 139, 0.07)),
    linear-gradient(60deg, rgba(122, 0, 38, 0.05) 25%, transparent 25.5%, transparent 75%, rgba(122, 0, 38, 0.05) 75%, rgba(122, 0, 38, 0.05)),
    linear-gradient(60deg, rgba(122, 0, 38, 0.05) 25%, transparent 25.5%, transparent 75%, rgba(122, 0, 38, 0.05) 75%, rgba(122, 0, 38, 0.05));
  background-size: 40px 70px;
  background-position: 0 0, 0 0, 20px 35px, 20px 35px, 0 0, 20px 35px;
  background-attachment: fixed;
}

[data-theme="dark"] body.bg-geometrico {
  background-color: #07090e;
  background-image: 
    linear-gradient(30deg, rgba(255, 255, 255, 0.04) 12%, transparent 12.5%, transparent 87%, rgba(255, 255, 255, 0.04) 87.5%, rgba(255, 255, 255, 0.04)),
    linear-gradient(150deg, rgba(255, 255, 255, 0.04) 12%, transparent 12.5%, transparent 87%, rgba(255, 255, 255, 0.04) 87.5%, rgba(255, 255, 255, 0.04)),
    linear-gradient(30deg, rgba(255, 255, 255, 0.04) 12%, transparent 12.5%, transparent 87%, rgba(255, 255, 255, 0.04) 87.5%, rgba(255, 255, 255, 0.04)),
    linear-gradient(150deg, rgba(255, 255, 255, 0.04) 12%, transparent 12.5%, transparent 87%, rgba(255, 255, 255, 0.04) 87.5%, rgba(255, 255, 255, 0.04)),
    linear-gradient(60deg, rgba(122, 0, 38, 0.12) 25%, transparent 25.5%, transparent 75%, rgba(122, 0, 38, 0.12) 75%, rgba(122, 0, 38, 0.12)),
    linear-gradient(60deg, rgba(122, 0, 38, 0.12) 25%, transparent 25.5%, transparent 75%, rgba(122, 0, 38, 0.12) 75%, rgba(122, 0, 38, 0.12));
  background-size: 40px 70px;
  background-position: 0 0, 0 0, 20px 35px, 20px 35px, 0 0, 20px 35px;
}

/* 1. Barra de Navegación Oficial FAPC #6600b4 - Sticky / Fijo Arriba */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: #6600b4;
  color: #ffffff;
  border-bottom: 2px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
}

.nav-container {
  max-width: 1560px;
  width: 96%;
  margin: 0 auto;
  padding: 0.35rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.fapc-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.25));
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.top-nav .federation-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #ffffff;
  line-height: 1;
}

.top-nav .federation-subtitle {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  line-height: 1.1;
}

/* Menú Estructurado FAPC */
.fapc-menu-bar {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.fapc-menu-item {
  position: relative;
}

.fapc-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.45rem 0.65rem;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
}

.fapc-nav-link:hover,
.fapc-menu-item:hover > .fapc-nav-link,
.fapc-menu-item.open > .fapc-nav-link {
  background-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.fapc-nav-link.active {
  background-color: rgba(255, 255, 255, 0.28);
  font-weight: 700;
}

.nav-arrow {
  font-size: 0.68rem;
  opacity: 0.9;
  display: inline-block;
  transition: transform 0.18s ease;
}

.fapc-menu-item:hover .nav-arrow,
.fapc-menu-item.open .nav-arrow {
  transform: rotate(180deg);
}

/* Dropdown Menus */
.fapc-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #500091;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.38);
  padding: 0.4rem;
  display: none;
  flex-direction: column;
  gap: 0.15rem;
  z-index: 1050;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: fapcDropdownFade 0.15s ease-out;
}

@keyframes fapcDropdownFade {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.fapc-menu-item:hover .fapc-dropdown-menu,
.fapc-menu-item.open .fapc-dropdown-menu {
  display: flex;
}

.fapc-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.75rem;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  border-radius: 5px;
  transition: all 0.12s ease;
  white-space: nowrap;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: inherit;
}

.fapc-dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding-left: 0.95rem;
}

/* Grilla de Meses */
.fapc-dropdown-months {
  min-width: 260px;
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
}

.fapc-menu-item:hover .fapc-dropdown-months,
.fapc-menu-item.open .fapc-dropdown-months {
  display: grid;
}

.fapc-dropdown-item.full-row {
  grid-column: 1 / -1;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 0.2rem;
  padding-bottom: 0.5rem;
}

/* Grilla de Días */
.fapc-dropdown-days {
  min-width: 230px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

/* Selector de Fondos en el Navbar Morado */
.top-nav .bg-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
}

.top-nav .bg-selector-label {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.72rem;
}

.top-nav .bg-select {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
}

.top-nav .bg-select option {
  background: #33005a;
  color: #ffffff;
}

.top-nav .btn-primary {
  background: #ffffff;
  color: #6600b4;
  font-weight: 700;
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.top-nav .btn-primary:hover {
  background: #f3e8ff;
  color: #500091;
  transform: translateY(-1px);
}

.top-nav .btn-icon {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.55rem;
  font-size: 0.9rem;
  cursor: pointer;
  color: #ffffff;
  transition: background 0.15s ease;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.top-nav .btn-icon:hover {
  background: rgba(255, 255, 255, 0.2);
}

.mobile-menu-btn {
  display: none;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 1.15rem;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  line-height: 1;
}

/* 2. Hero Banner - Finito y Minimalista */
.hero-banner {
  background: linear-gradient(135deg, var(--primary) 0%, #4a0017 100%);
  color: var(--text-inverse);
  padding: 0.75rem 1rem 0.65rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

.hero-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}

.hero-content {
  max-width: 850px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.badge-fada {
  display: inline-block;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fef08a;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.25rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-banner h1 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.15rem;
  line-height: 1.15;
}

.hero-desc {
  font-size: 0.8rem;
  opacity: 0.88;
  max-width: 580px;
  margin: 0 auto 0.45rem;
  line-height: 1.25;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  max-width: 700px;
  margin: 0 auto;
}

.stat-card {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  padding: 0.2rem 0.6rem;
  backdrop-filter: blur(8px);
}

.stat-number {
  font-size: 0.92rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
}

.stat-label {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  text-transform: none;
}

.stat-speed .stat-number {
  color: #4ade80;
}

/* ==========================================================================
   CONMUTADOR DE SECCIÓN: TORNEOS vs DÓNDE IR A CLASES (MINIMALISTA)
   ========================================================================== */
.main-section-switcher {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 700px;
  margin: 0 auto 1.35rem;
  background: var(--bg-surface);
  padding: 0.25rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.main-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.main-tab-btn:hover {
  background: var(--bg-alt);
  color: var(--text-main);
}

.main-tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(122, 0, 38, 0.22);
}

.tab-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  font-weight: 700;
}

.main-tab-btn:not(.active) .tab-badge {
  background: var(--border);
  color: var(--text-muted);
}

/* PANEL DE CONTROL DE CLASES (LUNES A DOMINGO) - ULTRA MINIMALISTA */
.clases-controls-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  margin-bottom: 1.15rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.clases-day-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.day-pill {
  padding: 0.28rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.day-pill:hover {
  background: var(--border);
  border-color: var(--border);
}

.day-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(122, 0, 38, 0.2);
}

.clases-search-filter-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 0.55rem;
  align-items: center;
}

.clases-search-filter-row .search-box {
  margin-bottom: 0;
}

.clases-search-filter-row .search-box input {
  height: 35px;
  padding: 0.35rem 2rem 0.35rem 2.2rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.select-filter {
  height: 35px;
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 500;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
  width: 100%;
}

.select-filter:focus {
  border-color: var(--primary);
}

/* INSIGNIAS ESPECÍFICAS DE CLASES */
.badge-dia {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.badge-gratis {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.badge-profesor {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

/* 3. Panel de Controles y Filtros (Glassmorphism) */
.main-container {
  max-width: 1540px;
  width: 95%;
  margin: 0 auto;
  padding: 1.75rem 1rem 3.5rem;
  flex: 1;
}

.controls-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  margin-bottom: 1.15rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 0.65rem;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  padding: 0.45rem 2.2rem 0.45rem 2.5rem;
  font-size: 0.88rem;
  height: 38px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  outline: none;
  transition: all 0.15s ease;
}

.search-box input:focus {
  border-color: var(--primary);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px rgba(122, 0, 38, 0.15);
}

.clear-btn {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-right: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pill-btn {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.28rem 0.65rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill-btn:hover {
  background: var(--border);
}

.pill-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-inverse);
  box-shadow: 0 2px 4px rgba(122, 0, 38, 0.25);
}

.view-toggle-group {
  display: flex;
  background: var(--bg-alt);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.view-btn {
  background: none;
  border: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: calc(var(--radius-md) - 3px);
  cursor: pointer;
}

.view-btn.active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.results-counter {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ==========================================================================
   4. TARJETAS WIDESCREEN PRO: AFICHE GRANDE A LA IZQUIERDA + DATOS A LA DERECHA
   ========================================================================== */

.cards-grid {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.tournament-card-pro {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: minmax(480px, 560px) 1fr;
  align-items: stretch;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

@media (min-width: 1400px) {
  .tournament-card-pro {
    grid-template-columns: 580px 1fr;
  }
}

.tournament-card-pro:hover {
  transform: translateY(-3px);
  border-color: #94a3b8;
  box-shadow: 0 25px 35px -5px rgb(0 0 0 / 0.15), 0 10px 15px -5px rgb(0 0 0 / 0.08);
}

/* COLUMNA IZQUIERDA: AFICHE PROTAGÓNICO COMPLETO SIN RECORTES */
.card-poster-col {
  position: relative;
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.95) 0%, rgba(226, 232, 240, 0.9) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  cursor: pointer;
  border-right: 1px solid var(--border);
  min-width: 0;
  box-sizing: border-box;
}

[data-theme="dark"] .card-poster-col {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.9) 100%);
}

.card-poster-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
}

.card-poster-img {
  max-height: 640px;
  width: auto;
  max-width: 100%;
  object-fit: contain; /* NUNCA corta el afiche; se ve 100% de arriba a abajo */
  border-radius: var(--radius-md);
  border: 3px solid #ffffff;
  box-shadow: 0 14px 32px -6px rgba(15, 23, 42, 0.3);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: block;
  margin: 0 auto;
  box-sizing: border-box;
}

[data-theme="dark"] .card-poster-img {
  border: 2px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.6);
}

.card-poster-col:hover .card-poster-img {
  transform: scale(1.02);
  box-shadow: 0 18px 36px -6px rgba(15, 23, 42, 0.35);
}

/* El botón de zoom ahora está anclado a la esquina superior del propio afiche */
.poster-zoom-badge {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 5;
  background: rgba(15, 23, 42, 0.88);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.card-poster-col:hover .poster-zoom-badge {
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(1.05);
}

.card-subtitle-pro {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: -0.25rem;
}

/* COLUMNA DERECHA: TODOS LOS DATOS Y BOTONES ÚTILES APROVECHANDO EL ANCHO */
.card-details-col {
  padding: 1.15rem 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.65rem;
}

.details-badges-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.badge-elo-fide {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.badge-elo-social {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.badge-status {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.badge-status.proximo {
  background: #dcfce7;
  color: #15803d;
}

.badge-status.destacado {
  background: #fef3c7;
  color: #b45309;
}

.badge-status.finalizado {
  background: #f1f5f9;
  color: #64748b;
}

.badge-cat-tag {
  background: var(--bg-alt);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.card-title-pro {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-main);
  letter-spacing: -0.015em;
}

/* FICHA EN 2 COLUMNAS APROVECHANDO EL ANCHO */
.details-specs-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 1.25rem;
  background: var(--bg-alt);
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.spec-cell {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.3;
}

.spec-icon {
  font-size: 1.05rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.spec-content {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.spec-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.spec-val {
  color: var(--text-main);
  font-size: 0.85rem;
}

.spec-val-highlight {
  font-weight: 800;
  color: #15803d;
  font-size: 0.88rem;
}

.spec-link-whatsapp {
  color: #15803d;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.84rem;
}

.spec-link-whatsapp:hover {
  text-decoration: underline;
}

.spec-sub {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* BOTONERAS HORIZONTALES COMPACTAS */
.details-actions-wrapper-compact {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.actions-horizontal-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.btn-action-inscribir-compact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--success);
  color: #ffffff;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 6px rgba(21, 128, 61, 0.25);
  transition: all 0.15s ease;
}

.btn-action-inscribir-compact:hover {
  background: var(--success-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(21, 128, 61, 0.35);
}

.btn-action-status-closed {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--bg-alt);
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 700;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  cursor: default;
}

.btn-action-chessresults-compact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--fide-blue);
  color: #ffffff;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.25);
  transition: all 0.15s ease;
  text-align: center;
}

.btn-action-chessresults-compact:hover {
  background: var(--fide-blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(29, 78, 216, 0.35);
}

.details-sub-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
}

.btn-action-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.55rem 0.25rem;
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-action-sub:hover {
  background: var(--border);
  color: var(--primary);
}

/* 5. Vista en Tabla Compacta */
.table-container {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
}

.tournaments-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.tournaments-table th {
  background: var(--bg-alt);
  padding: 0.8rem 1rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.tournaments-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.tournaments-table tr:hover {
  background: var(--bg-alt);
}

.table-date {
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.table-title {
  font-weight: 700;
  color: var(--text-main);
}

.table-thumb {
  width: 48px;
  height: 66px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 6. Modales */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
}

.modal-dialog {
  position: relative;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 10;
}

.modal-lightbox {
  max-width: 650px;
  text-align: center;
}

.modal-header-clean {
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.lightbox-body {
  padding: 1rem;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.lightbox-footer {
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-top: 1px solid var(--border);
}

.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
}

.form-grid {
  padding: 1.25rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.form-group input, .form-group select, .form-group textarea {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  color: var(--text-main);
  font-size: 0.88rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.modal-table {
  max-width: 750px;
}

.modal-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.modal-search {
  width: 100%;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  color: var(--text-main);
}

.table-scroll {
  max-height: 55vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.afiliados-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.afiliados-table th, .afiliados-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.afiliados-table th {
  position: sticky;
  top: 0;
  background: var(--bg-alt);
}

/* Botones universales */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--primary);
  color: var(--text-inverse);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-whatsapp {
  background: #25d366;
  color: #fff;
}

.btn-whatsapp:hover {
  background: #20bd5a;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--bg-surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

/* 7. Footer */
.main-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  margin-top: auto;
  backdrop-filter: blur(8px);
}

.footer-container {
  max-width: 1540px;
  width: 95%;
  margin: 0 auto;
  padding: 2.2rem 1rem 1.5rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr;
  gap: 1.5rem;
}

.footer-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.footer-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.social-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.social-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  transition: color 0.15s ease;
}

.social-links a:hover {
  color: var(--primary);
}

.footer-tech {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   8. RESPONSIVE MÓVIL (AFICHE 100% COMPLETO SIN RECORTES)
   ========================================================================== */

@media (max-width: 1200px) {
  .tournament-card-pro {
    grid-template-columns: 460px 1fr;
    max-height: none;
  }
  .card-poster-img {
    max-height: 580px;
  }
}

@media (max-width: 960px) {
  .tournament-card-pro {
    grid-template-columns: 400px 1fr;
    max-height: none;
  }
  .card-poster-col {
    min-height: auto;
    max-height: none;
    padding: 0.6rem;
  }
  .card-poster-img {
    max-height: 520px;
  }
  .details-specs-2col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-container {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    width: 100%;
  }

  .federation-subtitle {
    display: none;
  }

  .nav-actions {
    gap: 0.35rem;
  }

  .bg-selector-wrapper {
    padding: 0.2rem 0.35rem;
    font-size: 0.75rem;
  }

  .bg-selector-label {
    display: none;
  }

  .bg-select {
    max-width: 125px;
    font-size: 0.75rem;
  }

  #btnNuevoTorneo .btn-text {
    display: none;
  }

  #btnNuevoTorneo {
    padding: 0.45rem 0.65rem;
  }

  .hero-banner h1 {
    font-size: 1.55rem;
  }
  
  .hero-stats {
    grid-template-columns: 1fr 1fr;
  }
  
  .footer-container {
    grid-template-columns: 1fr;
  }
  
  .main-links {
    display: none;
  }

  .main-container {
    width: 100%;
    max-width: 100%;
    padding: 0.6rem 0.35rem 2rem;
  }

  .main-section-switcher {
    flex-direction: row;
    gap: 0.25rem;
    padding: 0.2rem;
    max-width: 100%;
    margin-bottom: 0.75rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .main-section-switcher::-webkit-scrollbar {
    display: none;
  }

  .main-tab-btn {
    padding: 0.42rem 0.55rem;
    font-size: 0.8rem;
    flex: 0 0 auto;
    width: auto;
  }

  .clases-controls-panel {
    padding: 0.5rem 0.65rem;
    margin-bottom: 0.85rem;
    gap: 0.45rem;
  }

  .clases-day-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 0.25rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .clases-day-pills::-webkit-scrollbar {
    display: none;
  }

  .clases-search-filter-row {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
  }

  .section-header h2 {
    font-size: 1.15rem;
  }

  .tournament-card-pro {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    max-height: none;
    border-radius: var(--radius-md);
  }

  .card-poster-col {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: auto;
    max-height: none;
    padding: 0.85rem 1rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.95) 0%, rgba(226, 232, 240, 0.9) 100%);
  }

  [data-theme="dark"] .card-poster-col {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.9) 100%);
  }

  .card-poster-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
  }

  .card-poster-img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: min(520px, 68vh); /* Pantalla 1: afiche 100% completo, sin recortes ni desborde */
    object-fit: contain;
    margin: 0 auto;
    border-radius: var(--radius-sm);
    border: 3px solid #ffffff;
    box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.25);
    box-sizing: border-box;
  }

  [data-theme="dark"] .card-poster-img {
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 10px 28px -4px rgba(0, 0, 0, 0.5);
  }

  .poster-floating-cartelito {
    top: 8px;
    left: 8px;
    font-size: 0.70rem;
    padding: 0.25rem 0.55rem;
  }

  .poster-zoom-badge {
    padding: 0.25rem 0.55rem;
    font-size: 0.7rem;
    top: 0.4rem;
    right: 0.4rem;
  }

  /* Pantalla 2: toda la ficha técnica y botonera sin scrolear */
  .card-details-col {
    padding: 0.75rem 0.65rem;
    height: auto;
    max-height: none;
    gap: 0.35rem;
  }

  .details-badges-row {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .details-badges-row::-webkit-scrollbar {
    display: none;
  }

  .badge-status {
    font-size: 0.64rem;
    font-weight: 800;
    padding: 0.16rem 0.4rem;
    white-space: nowrap;
  }

  .badge-cat-tag {
    font-size: 0.64rem;
    font-weight: 700;
    padding: 0.16rem 0.4rem;
    white-space: nowrap;
  }

  .badge-elo-fide {
    font-size: 0.64rem;
    font-weight: 800;
    padding: 0.16rem 0.4rem;
    white-space: nowrap;
  }

  .card-title-pro {
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.25;
    margin: 0.05rem 0;
  }

  .card-subtitle-pro {
    font-size: 0.76rem;
    font-weight: 600;
    margin: 0 0 0.1rem 0;
  }

  /* Ficha en 2 Columnas también en móvil gracias al 20% más de ancho */
  .details-specs-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 0.55rem;
    padding: 0.55rem 0.65rem;
    border-radius: var(--radius-sm);
  }

  .spec-cell {
    gap: 0.35rem;
    font-size: 0.74rem;
    line-height: 1.22;
  }

  .spec-icon {
    font-size: 0.88rem;
    margin-top: 0.05rem;
  }

  .spec-label {
    font-size: 0.6rem;
    letter-spacing: 0.02em;
  }

  .spec-val {
    font-size: 0.74rem;
    line-height: 1.2;
  }

  .spec-val-highlight {
    font-size: 0.78rem;
  }

  .spec-link-whatsapp {
    font-size: 0.74rem;
  }

  .spec-sub {
    font-size: 0.66rem;
  }

  .details-actions-wrapper-compact {
    gap: 0.35rem;
    padding-top: 0.45rem;
    margin-top: 0.15rem;
  }

  /* Botones principales lado a lado en 2 columnas */
  .actions-horizontal-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
  }

  .btn-action-inscribir-compact,
  .btn-action-chessresults-compact,
  .btn-action-status-closed {
    padding: 0.48rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Botones secundarios lado a lado en 3 columnas */
  .details-sub-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.3rem;
  }

  .btn-action-sub {
    padding: 0.42rem 0.15rem;
    font-size: 0.68rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .form-group.full-width {
    grid-column: span 1;
  }
}

/* ==========================================================================
   SECCIÓN DE CONTACTO OFICIAL FAPC (UNA SOLA PÁGINA)
   ========================================================================== */
.contacto-section {
  max-width: 1100px;
  margin: 0 auto;
}

.contacto-header {
  margin-bottom: 1.25rem;
  text-align: left;
}

.contacto-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
}

.contacto-header p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.contacto-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

.contacto-channels-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contacto-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.contacto-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.contacto-card.whatsapp-highlight {
  border-color: #22c55e;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.06) 0%, var(--bg-surface) 100%);
}

.contacto-card-icon {
  font-size: 1.5rem;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wa-icon {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}
.email-icon {
  background: rgba(2, 132, 199, 0.12);
  color: #0369a1;
}
.social-icon {
  background: rgba(168, 85, 247, 0.12);
  color: #7e22ce;
}
.pin-icon {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.contacto-card-info {
  flex: 1;
}

.channel-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.2rem;
}

.wa-badge {
  background: #dcfce7;
  color: #15803d;
}
.email-badge {
  background: #e0f2fe;
  color: #0369a1;
}
.social-badge {
  background: #f3e8ff;
  color: #7e22ce;
}

.contacto-card-info h3 {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
  color: var(--text-main);
}

.channel-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: #16a34a;
  letter-spacing: 0.02em;
  margin-bottom: 0.2rem;
}

.channel-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: block;
}

.btn-channel {
  margin-top: 0.55rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.btn-wa {
  background: #25D366;
  color: #ffffff;
  width: 100%;
}

.btn-wa:hover {
  background: #1eb956;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.email-item {
  margin-top: 0.35rem;
  font-size: 0.82rem;
}

.email-role {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.74rem;
  display: block;
}

.email-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  word-break: break-all;
}

.email-link:hover {
  text-decoration: underline;
}

.social-buttons-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.45rem;
  flex-wrap: wrap;
}

.btn-social {
  flex: 1;
  min-width: 140px;
  padding: 0.4rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  text-align: center;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text-main);
  transition: all 0.15s ease;
}

.btn-ig:hover {
  background: #E1306C;
  color: white;
  border-color: #E1306C;
}
.btn-fb:hover {
  background: #1877F2;
  color: white;
  border-color: #1877F2;
}

.sede-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 0.15rem;
}

/* Columna Formulario */
.contacto-form-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.form-header h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.15rem;
}

.form-header p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.contact-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.contact-form label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  border-color: var(--primary);
  background: var(--bg-surface);
}

.contact-form textarea {
  resize: vertical;
  min-height: 75px;
}

.contact-form .form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.contact-form .form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-top: 0.25rem;
}

.btn-send {
  padding: 0.55rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.btn-send-wa {
  background: #25D366;
  color: #ffffff;
}
.btn-send-wa:hover {
  background: #1eb956;
}

.btn-send-mail {
  background: var(--primary);
  color: #ffffff;
}
.btn-send-mail:hover {
  background: var(--primary-hover);
}

.form-disclaimer {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.25rem;
  line-height: 1.25;
}

@media (max-width: 900px) {
  .contacto-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* ==========================================================================
   12. SECCIÓN ENTIDADES AFILIADAS (RED OFICIAL DE CLUBES)
   ========================================================================== */
.entidades-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.5rem 0 3rem;
}

.entidades-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.entidades-header h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0.35rem 0 0.25rem;
  letter-spacing: -0.02em;
}

.entidades-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 1rem;
  line-height: 1.4;
}

.entidades-stats-bar {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.stat-pill .pill-number {
  color: var(--primary);
  font-weight: 800;
}

.entidades-controls {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.entidades-search-box {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
}

.entidades-search-box .search-icon {
  position: absolute;
  left: 0.85rem;
  font-size: 1rem;
  pointer-events: none;
  opacity: 0.6;
}

.entidades-search-box input {
  width: 100%;
  padding: 0.6rem 2.2rem 0.6rem 2.5rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-body);
  color: var(--text-main);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.entidades-search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.15);
}

.entidades-zone-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

.zone-pill {
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.zone-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.zone-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(184, 134, 11, 0.25);
}

.zone-pill .zone-count {
  font-size: 0.75rem;
  opacity: 0.85;
}

.entidades-results-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  padding: 0 0.25rem;
}

.entidades-grid {
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

/* Tarjeta Individual de Entidad: Pantalla Completa Widescreen con Afiche Enorme */
.entidad-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 24px;
  padding: 2.25rem;
  min-height: calc(100vh - 200px);
  max-height: 850px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  box-shadow: 0 10px 35px rgba(0,0,0,0.06);
}

.entidad-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 18px 45px rgba(0,0,0,0.12);
}

.entidad-card.card-suspended {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.02);
}

.entidad-card-layout {
  display: grid;
  grid-template-columns: 550px 1fr;
  gap: 3rem;
  align-items: stretch;
  height: 100%;
}

@media (max-width: 1100px) {
  .entidad-card-layout {
    grid-template-columns: 440px 1fr;
    gap: 2rem;
  }
}

@media (max-width: 860px) {
  .entidad-card {
    min-height: auto;
    max-height: none;
    padding: 1.25rem;
  }
  .entidad-card-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Columna Izquierda: Flyer / Logo Enorme que Ocupa la Pantalla */
.entidad-col-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.entidad-crest-wrap {
  width: 100%;
  height: 100%;
  min-height: 560px;
  max-height: 720px;
  background: #ffffff;
  border: 2.5px solid var(--border-color);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.2s ease;
  box-shadow: 0 8px 25px rgba(0,0,0,0.07);
}

@media (max-width: 860px) {
  .entidad-crest-wrap {
    min-height: 380px;
    max-height: 480px;
    padding: 16px;
  }
}

.entidad-crest-wrap:hover {
  transform: scale(1.02);
  border-color: var(--primary);
  box-shadow: 0 14px 35px rgba(0,0,0,0.16);
}

.entidad-crest {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Columna Derecha: Cabecera, Datos y Botones */
.entidad-col-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  height: 100%;
}

.entidad-badges-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.badge-official {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-suspended {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-city {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  background: var(--bg-body);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.entidad-name {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  margin: 0.3rem 0 1.25rem;
  word-break: break-word;
  letter-spacing: -0.02em;
}

.entidad-alert-banner {
  background: rgba(239, 68, 68, 0.08);
  border-left: 4px solid #ef4444;
  padding: 0.65rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #b91c1c;
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

.entidad-details-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  flex: 1;
}

.entidad-meta-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  line-height: 1.45;
}

.entidad-meta-item .meta-icon {
  font-size: 1.25rem;
  opacity: 0.9;
  flex-shrink: 0;
  margin-top: 2px;
}

.entidad-meta-item .meta-text {
  color: var(--text-main);
  word-break: break-word;
}

.entidad-meta-item .meta-label {
  font-weight: 700;
  color: var(--text-muted);
}

.entidad-actions-row {
  display: flex;
  gap: 0.85rem;
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.entidad-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  flex: 1 1 140px;
  min-height: 48px;
}

.entidad-btn-wa {
  background: #25D366;
  color: #ffffff;
}
.entidad-btn-wa:hover {
  background: #1eb956;
}

.entidad-btn-mail {
  background: var(--bg-body);
  border-color: var(--border-color);
  color: var(--text-main);
}
.entidad-btn-mail:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.entidad-meta-item a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-all;
  transition: color 0.2s ease;
}
.entidad-meta-item a:hover {
  color: var(--primary-hover);
}

.entidad-btn-social {
  background: var(--bg-body);
  border-color: var(--border-color);
  color: var(--text-main);
}
.entidad-btn-social:hover {
  background: #405DE6;
  color: #ffffff;
  border-color: #405DE6;
}

.entidad-btn-fb {
  background: #1877F2;
  color: #ffffff;
}
.entidad-btn-fb:hover {
  background: #0d65d9;
}

.entidad-btn-ig {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: #ffffff;
}
.entidad-btn-ig:hover {
  opacity: 0.92;
}

.entidad-btn-web {
  background: var(--bg-body);
  border-color: var(--border-color);
  color: var(--text-main);
}
.entidad-btn-web:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.entidad-btn-clases {
  background: rgba(184, 134, 11, 0.1);
  border-color: rgba(184, 134, 11, 0.3);
  color: var(--primary);
}
.entidad-btn-clases:hover {
  background: var(--primary);
  color: #ffffff;
}

/* Modal de Ficha de Club */
.modal-club {
  max-width: 600px;
}

.modal-club-header-info h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-club-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
  text-align: center;
}

.modal-club-logo-wrap {
  width: 140px;
  height: 140px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
}

.modal-club-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.modal-club-details {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
}


/* ==========================================================================
   13. SECCIÓN SUBCATEGORÍAS & INSTITUCIONAL (UNA SOLA COLUMNA, UNA IMAGEN POR PÁGINA)
   ========================================================================== */
.subcategorias-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.5rem 0 3rem;
}

.subcategorias-controls {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.subcategorias-search-box {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
}

.subcategorias-search-box .search-icon {
  position: absolute;
  left: 0.85rem;
  font-size: 1rem;
  pointer-events: none;
}

.subcategorias-search-box input {
  width: 100%;
  padding: 0.6rem 2.2rem 0.6rem 2.5rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.subcategorias-search-box input:focus {
  border-color: #6600b4;
}

.subcategorias-pills {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.sub-pill {
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.sub-pill:hover {
  border-color: #6600b4;
  color: #6600b4;
}

.sub-pill.active {
  background: #6600b4;
  color: #ffffff;
  border-color: #6600b4;
  box-shadow: 0 2px 6px rgba(102, 0, 180, 0.25);
}

.sub-pill .sub-count {
  font-size: 0.75rem;
  opacity: 0.85;
}

.subcategorias-results-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  padding: 0 0.25rem;
}

.subcategorias-grid {
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

/* Tarjeta Individual de Subcategoría: Widescreen, 1 Imagen por Pantalla, Detalles a la Derecha */
.subcategoria-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 24px;
  padding: 2.25rem;
  min-height: calc(100vh - 200px);
  max-height: 850px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  box-shadow: 0 10px 35px rgba(0,0,0,0.06);
}

.subcategoria-card:hover {
  transform: translateY(-4px);
  border-color: #6600b4;
  box-shadow: 0 18px 45px rgba(102, 0, 180, 0.14);
}

.subcategoria-card-layout {
  display: grid;
  grid-template-columns: 550px 1fr;
  gap: 3rem;
  align-items: stretch;
  height: 100%;
}

/* Columna Izquierda: AFICHE / DOCUMENTO ENORME */
.subcategoria-flyer-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.subcategoria-flyer-wrap {
  width: 550px;
  height: 720px;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  border: 2px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 10px 25px rgba(0,0,0,0.18);
  position: relative;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.subcategoria-flyer-wrap:hover {
  transform: scale(1.015);
  box-shadow: 0 14px 32px rgba(0,0,0,0.25);
}

.subcategoria-flyer-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: #0b0f19;
  display: block;
  transition: transform 0.2s ease;
}

.subcategoria-flyer-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%);
  padding: 1.5rem 1rem 0.75rem;
  text-align: center;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.subcategoria-flyer-wrap:hover .subcategoria-flyer-overlay {
  opacity: 1;
}

/* Columna Derecha: DETALLES */
.subcategoria-details-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.5rem 0;
}

.subcategoria-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.sub-badge {
  display: inline-block;
  padding: 0.22rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: rgba(102, 0, 180, 0.12);
  color: #6600b4;
  border: 1px solid rgba(102, 0, 180, 0.25);
}

.sub-badge-year {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
}

.subcategoria-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  margin: 0 0 0.45rem;
  letter-spacing: -0.02em;
}

/* Título Arriba (Nombre) y Abajo el Torneo */
.subcategoria-nombre {
  font-size: 2.15rem;
  font-weight: 850;
  color: var(--text-main);
  line-height: 1.15;
  margin: 0 0 0.5rem;
  letter-spacing: -0.025em;
}

.subcategoria-torneo-card {
  background: rgba(102, 0, 180, 0.05);
  border: 1.5px solid rgba(102, 0, 180, 0.22);
  border-left: 4px solid #6600b4;
  border-radius: 10px;
  padding: 0.85rem 1.15rem;
  margin-bottom: 1.15rem;
}

.subcategoria-torneo-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: #6600b4;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.25rem;
}

.subcategoria-torneo-titulo {
  font-size: 1.25rem;
  font-weight: 750;
  color: var(--text-main);
  margin: 0 0 0.25rem;
  line-height: 1.3;
}

.subcategoria-torneo-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  display: block;
}

/* Vista previa de la tabla del torneo */
.subcategoria-tabla-preview-box {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 0.85rem;
  margin-bottom: 1.15rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.subcategoria-tabla-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.subcategoria-tabla-thumb-wrap {
  width: 100%;
  height: 190px;
  border-radius: 8px;
  overflow: hidden;
  background: #0f172a;
  position: relative;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.subcategoria-tabla-thumb-wrap:hover {
  transform: scale(1.01);
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}

.subcategoria-tabla-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.subcategoria-tabla-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.subcategoria-tabla-thumb-wrap:hover .subcategoria-tabla-overlay {
  opacity: 1;
}

.btn-view-table {
  background: #0284c7;
  color: #ffffff;
  font-weight: 700;
  padding: 0.65rem 1.15rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-view-table:hover {
  background: #0369a1;
  transform: translateY(-1px);
}

.subcategoria-subtitulo {
  font-size: 1rem;
  font-weight: 600;
  color: #6600b4;
  margin: 0 0 1.25rem;
  line-height: 1.35;
}

.subcategoria-desc-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem 1.45rem;
  margin-bottom: 1.25rem;
}

.subcategoria-desc-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

.subcategoria-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.sub-meta-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sub-meta-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.sub-meta-val {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.subcategoria-actions-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.btn-zoom-sub {
  background: #6600b4;
  color: #ffffff;
  font-weight: 700;
  padding: 0.65rem 1.2rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-zoom-sub:hover {
  background: #500091;
  transform: translateY(-1px);
}

.btn-download-sub {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.65rem 1.1rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.btn-download-sub:hover {
  border-color: #6600b4;
  color: #6600b4;
}

.btn-chess-results {
  background: #1e3a8a;
  color: #ffffff;
  padding: 0.65rem 1.1rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  transition: all 0.15s ease;
}

.btn-chess-results:hover {
  background: #1e40af;
  transform: translateY(-1px);
}

.btn-outline-fapc {
  border: 1px dashed var(--border-color);
  color: var(--text-muted);
  padding: 0.65rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.btn-outline-fapc:hover {
  border-color: #6600b4;
  color: #6600b4;
}

@media (max-width: 1200px) {
  .subcategoria-card-layout {
    grid-template-columns: 460px 1fr;
    gap: 2rem;
  }
  .subcategoria-flyer-wrap {
    width: 460px;
    height: 600px;
  }
}

@media (max-width: 900px) {
  .subcategoria-card {
    min-height: auto;
    max-height: none;
    padding: 1.25rem;
  }
  .subcategoria-card-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .subcategoria-flyer-wrap {
    width: 100%;
    height: auto;
    max-height: 500px;
  }
  .subcategoria-title {
    font-size: 1.35rem;
  }
  .subcategoria-meta-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   MODAL VISOR CHESS-RESULTS OFICIAL (INTEGRACIÓN)
   ========================================================================== */
.btn-nav-chess {
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.btn-nav-chess:hover {
  color: var(--accent);
}

.modal-chess-exact {
  max-width: 920px;
  width: 95%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.modal-chess-header {
  background: #334166;
  color: #fff;
  padding: 0.65rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #dd8c40;
}

.modal-chess-body {
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #ffffff;
}

.chess-input-bar {
  display: flex;
  gap: 0.5rem;
  background: #f4f4f4;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #d0d7e5;
}

.chess-input-bar input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.88rem;
  outline: none;
  background: #fff;
  color: #000;
}

.chess-input-bar input:focus {
  border-color: #334166;
}

.chess-exact-scroll-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 70vh;
  padding: 0.25rem;
  background: #ffffff;
  border: 1px solid #d0d7e5;
}

/* ==========================================================================
   ESTILOS EXACTOS TAL CUAL CHESS-RESULTS (StylesI.CSS)
   ========================================================================== */
.cr-exact-container {
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 9pt !important;
  color: #000 !important;
  background: #fff !important;
  padding: 6px !important;
  text-align: left;
}

.cr-exact-container h2 {
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 13pt !important;
  color: #334166 !important;
  font-weight: bold !important;
  margin: 0 0 8px 0 !important;
  text-align: left !important;
}

.cr-exact-container table.CRs1,
.cr-exact-container table {
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 9pt !important;
  border-collapse: separate !important;
  border-spacing: 1px !important;
  background-color: #fff !important;
  border: 0 !important;
  margin: 0 !important;
  width: auto !important;
}

.cr-exact-container tr.CRg1b {
  background-color: #dbdfe8 !important;
  font-weight: bold !important;
}

.cr-exact-container tr.CRg1 {
  background-color: #f4f4f4 !important;
}

.cr-exact-container tr.CRg2 {
  background-color: #ebecf1 !important;
}

.cr-exact-container th,
.cr-exact-container td {
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 9pt !important;
  padding: 2px 6px !important;
  border: 0 !important;
  color: #000 !important;
  line-height: 1.35 !important;
  white-space: nowrap !important;
}

.cr-exact-container th.CRc,
.cr-exact-container td.CRc {
  text-align: center !important;
}

.cr-exact-container th.CRr,
.cr-exact-container td.CRr {
  text-align: right !important;
}

.cr-exact-container th.CR,
.cr-exact-container td.CR {
  text-align: left !important;
}

.cr-exact-container a {
  color: #0000cc !important;
  text-decoration: underline !important;
}

.cr-exact-container a:hover {
  color: #cc0000 !important;
}

.cr-exact-container p.CR {
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 8pt !important;
  color: #685b5b !important;
  margin-top: 10px !important;
  line-height: 1.3 !important;
  text-align: left !important;
}


/* ==========================================================================
   CARTELITO LLAMATIVO DE CUENTA REGRESIVA DE TORNEOS (DÍAS RESTANTES)
   ========================================================================== */
.cartelito-countdown {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  color: #ffffff !important;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: default;
}

.cartelito-countdown:hover {
  transform: translateY(-1px) scale(1.02);
}

.cartelito-countdown.countdown-next-week {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.4);
}

.cartelito-countdown.countdown-this-week {
  background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.45);
}

.cartelito-countdown.countdown-urgent,
.cartelito-countdown.countdown-today {
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  box-shadow: 0 4px 16px rgba(225, 29, 72, 0.5);
}

.cartelito-countdown.countdown-tomorrow {
  background: linear-gradient(135deg, #f97316 0%, #d97706 100%);
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.4);
}

.cartelito-countdown.countdown-future {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  box-shadow: 0 3px 12px rgba(37, 99, 235, 0.35);
}

.cartelito-countdown.countdown-concluido {
  background: #64748b;
  color: #f1f5f9 !important;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: none;
  font-weight: 700;
}

.countdown-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  animation: countdownPulse 1.6s infinite;
}

.countdown-concluido .countdown-pulse-dot {
  display: none;
}

@keyframes countdownPulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  }
  70% {
    transform: scale(1.15);
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

.poster-floating-cartelito {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
  color: #ffffff !important;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.poster-floating-cartelito.countdown-next-week {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.95), rgba(234, 88, 12, 0.95));
}
.poster-floating-cartelito.countdown-this-week {
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.95), rgba(220, 38, 38, 0.95));
}
.poster-floating-cartelito.countdown-today,
.poster-floating-cartelito.countdown-urgent {
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.95), rgba(190, 18, 60, 0.95));
}
.poster-floating-cartelito.countdown-tomorrow {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.95), rgba(217, 119, 6, 0.95));
}
.poster-floating-cartelito.countdown-concluido {
  background: rgba(100, 116, 139, 0.9);
}

.spec-countdown-tag {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 850;
  color: #ffffff !important;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.spec-countdown-tag.countdown-next-week { background: #ea580c; }
.spec-countdown-tag.countdown-this-week { background: #dc2626; }
.spec-countdown-tag.countdown-urgent,
.spec-countdown-tag.countdown-today { background: #e11d48; }
.spec-countdown-tag.countdown-tomorrow { background: #f97316; }
.spec-countdown-tag.countdown-concluido { background: #64748b; }

.table-countdown-badge {
  display: inline-block;
  margin-top: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 800;
  color: #ffffff;
}
.table-countdown-badge.countdown-next-week { background: #ea580c; }
.table-countdown-badge.countdown-this-week { background: #dc2626; }
.table-countdown-badge.countdown-concluido { background: #64748b; }

/* ==========================================================================
   CÓRDOBA CAPITAL: MAPA EN GRANDE Y DIRECTORIO DE SEDES CON FOTITO DE FLYER
   ========================================================================== */
.cba-map-toggle-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(102, 0, 180, 0.08);
  border: 1.5px solid rgba(102, 0, 180, 0.25);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1.25rem;
  margin: 1rem 0;
  gap: 1rem;
}

.cba-toggle-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-main);
}

.cba-toggle-buttons {
  display: flex;
  gap: 0.5rem;
}

.btn-toggle-cba {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-toggle-cba.active {
  background: #6600b4;
  color: #ffffff;
  border-color: #6600b4;
  box-shadow: 0 2px 8px rgba(102, 0, 180, 0.35);
}

.cba-map-container {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.cba-map-header-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.cba-map-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  font-weight: 850;
  color: #6600b4;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.cba-map-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6600b4;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(102, 0, 180, 0.7);
  animation: countdownPulse 1.6s infinite;
}

.cba-map-title {
  font-size: 1.45rem;
  font-weight: 850;
  color: var(--text-main);
  margin: 0 0 0.25rem;
}

.cba-map-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
  max-width: 720px;
}

.btn-maps-all {
  background: #0284c7;
  color: #ffffff;
  padding: 0.6rem 1.15rem;
  border-radius: 8px;
  font-weight: 750;
  font-size: 0.85rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.btn-maps-all:hover {
  background: #0369a1;
  transform: translateY(-1px);
}

/* MARCO DEL MAPA EN GRANDE */
.cba-big-map-frame-wrap {
  width: 100%;
  height: 480px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  border: 1.5px solid var(--border-color);
  background: #e2e8f0;
  margin-bottom: 1.25rem;
}

.cba-big-google-map {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.cba-map-current-target {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.88);
  color: #ffffff;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  backdrop-filter: blur(4px);
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* FILTRO DE BARRIOS DE CÓRDOBA CAPITAL */
.cba-barrios-filter-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.cba-barrio-pill {
  background: var(--bg-alt);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cba-barrio-pill.active {
  background: #6600b4;
  color: #ffffff;
  border-color: #6600b4;
}

.cba-venues-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.cba-venues-heading {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

.cba-venues-count {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* GRID DE SEDES CON FOTITO PEQUEÑA DEL FLYER Y LINKS */
.cba-venues-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1rem;
}

.cba-venue-card {
  display: flex;
  background: var(--bg-alt);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 0.85rem;
  gap: 0.85rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.cba-venue-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  border-color: #6600b4;
}

/* FOTITO PEQUEÑA DEL FLYER */
.venue-thumb-box {
  flex-shrink: 0;
  width: 72px;
  height: 96px;
  border-radius: 8px;
  overflow: hidden;
  background: #0f172a;
  position: relative;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.venue-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.venue-thumb-box:hover .venue-thumb-img {
  transform: scale(1.08);
}

.venue-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.venue-thumb-box:hover .venue-thumb-overlay {
  opacity: 1;
}

/* CONTENIDO DE LA SEDE */
.venue-content-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.venue-badges-line {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}

.venue-barrio-tag {
  background: rgba(102, 0, 180, 0.1);
  color: #6600b4;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.venue-arancel-tag {
  background: #f1f5f9;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 750;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.venue-arancel-tag.gratis {
  background: #dcfce7;
  color: #15803d;
}

.venue-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 0.25rem;
  line-height: 1.25;
}

.venue-address-line {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.venue-schedule-line {
  font-size: 0.76rem;
  color: var(--text-main);
  margin-bottom: 0.65rem;
  line-height: 1.35;
}

/* LINKS A LOS LUGARES */
.venue-links-group {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.btn-venue-gmaps,
.btn-venue-directions,
.btn-venue-embed,
.btn-venue-wa {
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 750;
  text-decoration: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.15s ease;
}

.btn-venue-gmaps {
  background: #0284c7;
  color: #ffffff;
}

.btn-venue-gmaps:hover {
  background: #0369a1;
}

.btn-venue-directions {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-venue-directions:hover {
  background: var(--border-color);
}

.btn-venue-embed {
  background: rgba(102, 0, 180, 0.12);
  color: #6600b4;
  border: 1px solid rgba(102, 0, 180, 0.25);
}

.btn-venue-embed:hover {
  background: #6600b4;
  color: #ffffff;
}

.btn-venue-wa {
  background: #16a34a;
  color: #ffffff;
}

.btn-venue-wa:hover {
  background: #15803d;
}

@media (max-width: 768px) {
  .cba-big-map-frame-wrap {
    height: 330px;
  }
  .cba-venues-grid {
    grid-template-columns: 1fr;
  }
  .cba-map-toggle-bar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ==========================================================================
   SECCIÓN RANKINGS OFICIALES FAPC (CATEGORÍAS FIDE)
   ========================================================================== */

.rankings-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1rem;
}

.rankings-header-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.2rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.4rem 1.8rem;
  box-shadow: var(--shadow-sm);
}

.rankings-badge-tag {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.4rem;
}

.rankings-title-col h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 0.3rem 0;
}

.rankings-title-col p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0;
  max-width: 750px;
}

.rankings-sync-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
}

.btn-sync-rankings {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.65rem 1.2rem;
  background: linear-gradient(135deg, var(--primary) 0%, #a00032 100%);
  color: #fff;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(122, 0, 38, 0.3);
}

.btn-sync-rankings:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(122, 0, 38, 0.45);
}

.btn-sync-rankings.loading .sync-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

.sync-status {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* KPI Cards Grid */
.rankings-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.rankings-kpi-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}

.rankings-kpi-card:hover {
  transform: translateY(-2px);
}

.rankings-kpi-card.highlight-kpi {
  border-color: var(--accent);
  background: linear-gradient(145deg, var(--bg-surface) 0%, rgba(217, 119, 6, 0.06) 100%);
}

.kpi-icon {
  font-size: 2rem;
  line-height: 1;
}

.kpi-info {
  display: flex;
  flex-direction: column;
}

.kpi-num {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.kpi-lbl {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Controls Panel & Filters */
.rankings-controls-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.rankings-categories-wrapper {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.control-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.rankings-category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.cat-pill {
  padding: 0.42rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.cat-pill:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.cat-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(122, 0, 38, 0.35);
  font-weight: 700;
}

.rankings-subfilters-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border-light);
}

.subfilter-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.rankings-rhythm-pills, .rankings-gender-pills {
  display: flex;
  gap: 0.35rem;
}

.rhythm-pill, .gender-pill {
  padding: 0.38rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.rhythm-pill:hover, .gender-pill:hover {
  background: #e2e8f0;
}

.rhythm-pill.active, .gender-pill.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent-hover);
  font-weight: 700;
}

.rankings-search-box {
  min-width: 280px;
  flex: 1;
  max-width: 420px;
}

/* Results Bar */
.rankings-results-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  padding: 0 0.4rem;
}

.rankings-results-bar h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 0.15rem 0;
}

.rankings-results-count {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Rankings Table */
.rankings-table-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
  max-height: 65vh;
  position: relative;
}

.rankings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  text-align: left;
}

.rankings-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-alt);
}

.rankings-table th {
  padding: 0.75rem 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.rankings-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  vertical-align: middle;
}

.rankings-table tbody tr:hover {
  background: rgba(122, 0, 38, 0.03);
}

/* Columna activa del ritmo seleccionado */
.rankings-table th.active-col {
  background: rgba(217, 119, 6, 0.12);
  color: var(--accent-hover);
  border-bottom-color: var(--accent);
}

.rankings-table td.active-col {
  background: rgba(217, 119, 6, 0.05);
  font-weight: 800;
  color: var(--primary);
  font-size: 0.95rem;
}

/* Badges de Podio */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 800;
}

.podium-1 {
  background: linear-gradient(135deg, #ffd700 0%, #f59e0b 100%);
  color: #78350f;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
}

.podium-2 {
  background: linear-gradient(135deg, #e2e8f0 0%, #94a3b8 100%);
  color: #1e293b;
  box-shadow: 0 2px 6px rgba(148, 163, 184, 0.4);
}

.podium-3 {
  background: linear-gradient(135deg, #fdba74 0%, #d97706 100%);
  color: #7c2d12;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.4);
}

.podium-normal {
  color: var(--text-muted);
  font-weight: 600;
}

/* Badges de Títulos FIDE */
.fide-title-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  margin-right: 0.4rem;
  text-transform: uppercase;
}

.title-gm { background: #7A0026; color: #fff; }
.title-im { background: #6600b4; color: #fff; }
.title-fm { background: #1d4ed8; color: #fff; }
.title-cm { background: #0284c7; color: #fff; }
.title-wgm, .title-wim, .title-wfm, .title-wcm { background: #db2777; color: #fff; }

.player-name-wrapper {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.player-fullname {
  font-weight: 700;
  color: var(--text-main);
}

.gender-tag-f {
  font-size: 0.72rem;
  color: #db2777;
  font-weight: 700;
  background: #fdf2f8;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.fide-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--fide-blue);
  text-decoration: none;
  font-weight: 600;
  font-family: monospace;
  font-size: 0.84rem;
  padding: 0.15rem 0.4rem;
  background: rgba(29, 78, 216, 0.08);
  border-radius: 4px;
  transition: background 0.15s ease;
}

.fide-link:hover {
  background: rgba(29, 78, 216, 0.18);
  text-decoration: underline;
}

.cat-pill-table {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.3rem;
}

.status-active { background: #16a34a; }
.status-inactive { background: #94a3b8; }

/* Dark Theme Overrides */
[data-theme="dark"] .cat-pill {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

[data-theme="dark"] .cat-pill:hover {
  background: #334155;
}

[data-theme="dark"] .rhythm-pill, [data-theme="dark"] .gender-pill {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

[data-theme="dark"] .rankings-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .rankings-table th.active-col {
  background: rgba(217, 119, 6, 0.2);
}

[data-theme="dark"] .rankings-table td.active-col {
  background: rgba(217, 119, 6, 0.1);
  color: #fbbf24;
}

[data-theme="dark"] .gender-tag-f {
  background: rgba(219, 39, 119, 0.2);
  color: #f472b6;
}

@media (max-width: 900px) {
  .rankings-header-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .rankings-sync-col {
    align-items: flex-start;
  }
  .rankings-subfilters-row {
    flex-direction: column;
    align-items: stretch;
  }
  .rankings-search-box {
    max-width: 100%;
  }
}


/* ==========================================================================
   BARRA DE SINCRONIZACIÓN Y PUBLICACIÓN AUTOMÁTICA CON X (TWITTER)
   ========================================================================== */
.x-sync-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(135deg, #0f1419 0%, #1a222d 100%);
  color: #fff;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.x-sync-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.x-badge-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #000;
  color: #fff;
  border-radius: 10px;
  font-size: 1.4rem;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.x-sync-desc {
  display: flex;
  flex-direction: column;
}

.x-sync-desc strong {
  font-size: 1rem;
  color: #ffffff;
  letter-spacing: 0.2px;
}

.x-sync-sub {
  font-size: 0.82rem;
  color: #94a3b8;
  margin-top: 2px;
}

.x-sync-sub strong {
  color: #38bdf8;
}

.x-sync-buttons {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.btn-x-sync {
  background: #1d9bf0;
  color: #fff;
  border: none;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.btn-x-sync:hover {
  background: #1a8cd8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(29, 155, 240, 0.35);
}

.btn-x-sync.syncing .btn-x-icon {
  animation: spin 1s linear infinite;
}

.btn-x-import {
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.55rem 0.95rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.btn-x-import:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  transform: translateY(-1px);
}

.modal-import-dialog {
  max-width: 580px;
  width: 90%;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .modal-import-dialog {
  background: #1e293b;
  color: #f1f5f9;
}

[data-theme="dark"] .modal-import-dialog textarea,
[data-theme="dark"] .modal-import-dialog input {
  background: #0f172a;
  color: #f1f5f9;
  border-color: #334155;
}

[data-theme="dark"] .modal-import-dialog p {
  color: #94a3b8;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

@media (max-width: 768px) {
  .x-sync-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    padding: 0.9rem;
  }
  .x-sync-buttons {
    width: 100%;
    justify-content: stretch;
  }
  .btn-x-sync, .btn-x-import {
    flex: 1;
    justify-content: center;
    font-size: 0.82rem;
    padding: 0.5rem;
  }
}


/* ==========================================================================
   ESTILOS DEDICADOS RANKINGS 2700CHESS FAPC CÓRDOBA
   ========================================================================== */

/* Barra de Ritmos Principales (Estilo 2700chess Header Tabs) */
.chess2700-rhythm-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #3c372c;
  padding: 0.4rem 0.6rem;
  border-radius: 12px;
  width: fit-content;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.chess2700-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  color: #d5cfc0;
  border: none;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chess2700-tab-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.chess2700-tab-btn.active {
  background: #6a6352;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Barra de Categorías por Edad y Rama */
.chess2700-cat-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.2rem 0;
  scrollbar-width: thin;
}

.chess2700-cat-btn {
  white-space: nowrap;
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chess2700-cat-btn:hover {
  border-color: #94a3b8;
  color: var(--text-main);
  background: var(--bg-alt);
}

.chess2700-cat-btn.active {
  background: #7A0026;
  border-color: #7A0026;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(122, 0, 38, 0.35);
}

/* Barra de Filtros 2700chess (Fondo Crema/Dorado Clásico) */
/* Barra de Filtros 2700chess Compacta */
.chess2700-toolbar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  background: #eae5d8;
  border: 1px solid #d5cfc0;
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .chess2700-toolbar {
  background: #252a36;
  border-color: #384252;
}

.chess2700-filter-col {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.chess2700-label {
  font-size: 0.70rem;
  font-weight: 700;
  color: #635d4f;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

[data-theme="dark"] .chess2700-label {
  color: #94a3b8;
}

.chess2700-select {
  background: #ffffff;
  border: 1px solid #c8c2b0;
  border-radius: 5px;
  padding: 0.3rem 0.55rem;
  font-size: 0.80rem;
  font-weight: 600;
  color: #2c271e;
  outline: none;
  min-width: 140px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

[data-theme="dark"] .chess2700-select {
  background: #182234;
  border-color: #3b4758;
  color: #f1f5f9;
}

.chess2700-select:focus {
  border-color: #7A0026;
}

.chess2700-range-inputs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.chess2700-input-num {
  width: 56px;
  background: #ffffff;
  border: 1px solid #c8c2b0;
  border-radius: 5px;
  padding: 0.3rem 0.4rem;
  font-size: 0.80rem;
  font-weight: 600;
  color: #2c271e;
  text-align: center;
  outline: none;
}

[data-theme="dark"] .chess2700-input-num {
  background: #182234;
  border-color: #3b4758;
  color: #f1f5f9;
}

.chess2700-range-sep {
  color: #7c7565;
  font-weight: 700;
  font-size: 0.78rem;
}

.chess2700-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.chess2700-search-icon {
  position: absolute;
  left: 0.55rem;
  font-size: 0.78rem;
  color: #8c8574;
}

.chess2700-input-text {
  background: #ffffff;
  border: 1px solid #c8c2b0;
  border-radius: 5px;
  padding: 0.3rem 0.55rem 0.3rem 1.8rem;
  font-size: 0.80rem;
  color: #2c271e;
  outline: none;
  min-width: 180px;
}

[data-theme="dark"] .chess2700-input-text {
  background: #182234;
  border-color: #3b4758;
  color: #f1f5f9;
}

.chess2700-actions-col {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 0.35rem;
}

.chess2700-btn-reset {
  background: #d8d1c0;
  border: 1px solid #bfb7a4;
  color: #4b4538;
  padding: 0.34rem 0.7rem;
  border-radius: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chess2700-btn-reset:hover {
  background: #cbbfab;
  color: #2b271d;
}

[data-theme="dark"] .chess2700-btn-reset {
  background: #334155;
  border-color: #475569;
  color: #e2e8f0;
}

/* Tabla 2700chess Clásica Ultra Compacta (Sin Scroll Horizontal) */
.chess2700-table-wrapper {
  background: #fbf9f4;
  border: 1px solid #d5cfc0;
  border-radius: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  width: 100%;
}

[data-theme="dark"] .chess2700-table-wrapper {
  background: #1a202c;
  border-color: #2d3748;
}

.chess2700-table {
  width: 100%;
  border-collapse: collapse;
  font-family: inherit;
  font-size: 0.80rem;
  table-layout: auto;
}

.chess2700-table thead th {
  background: #dfd9c7;
  color: #453f32;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 0.45rem 0.5rem;
  border-bottom: 2px solid #c2b9a1;
  white-space: nowrap;
}

[data-theme="dark"] .chess2700-table thead th {
  background: #252d3d;
  color: #cbd5e1;
  border-bottom-color: #384252;
}

.chess2700-table tbody tr {
  border-bottom: 1px solid #e7e2d4;
  transition: background 0.15s ease;
}

.chess2700-table tbody tr:nth-child(even) {
  background: #f4f0e6;
}

[data-theme="dark"] .chess2700-table tbody tr {
  border-bottom-color: #262e3d;
}

[data-theme="dark"] .chess2700-table tbody tr:nth-child(even) {
  background: #1f2737;
}

.chess2700-table tbody tr:hover {
  background: #eae2cf !important;
}

[data-theme="dark"] .chess2700-table tbody tr:hover {
  background: #2c384e !important;
}

.chess2700-table td {
  padding: 0.32rem 0.5rem;
  vertical-align: middle;
  color: #2c271e;
}

[data-theme="dark"] .chess2700-table td {
  color: #f1f5f9;
}

/* Columna # y Podio */
.cell-2700-rank {
  text-align: center;
  width: 32px;
  font-weight: 700;
  font-size: 0.82rem;
  color: #4b4538;
  padding: 0.3rem 0.15rem;
}

/* Variación de Puesto (↑↓) */
.cell-2700-posvar {
  text-align: center;
  width: 36px;
  white-space: nowrap;
  font-weight: 700;
  font-size: 0.74rem;
  padding: 0.3rem 0.15rem;
}

.pos-up {
  color: #16a34a;
}

.pos-down {
  color: #dc2626;
}

.pos-equal {
  color: #94a3b8;
}

.pos-new {
  color: #2563eb;
  font-size: 0.70rem;
  background: #dbeafe;
  padding: 0.05rem 0.25rem;
  border-radius: 3px;
}

/* Avatar / Foto Circular */
.cell-2700-avatar {
  width: 28px;
  text-align: center;
  padding: 0.3rem 0.15rem;
}

.avatar-2700-img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #c2b9a1;
  background: #fff;
  vertical-align: middle;
}

.avatar-2700-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #d5cfc0;
  color: #4b4538;
  font-weight: 800;
  font-size: 0.62rem;
  border: 1px solid #baa284;
}

[data-theme="dark"] .avatar-2700-placeholder {
  background: #334155;
  color: #f8fafc;
  border-color: #475569;
}

/* Nombre y FIDE Link */
.cell-2700-name {
  font-weight: 700;
  color: #1a1611;
  white-space: nowrap;
  font-size: 0.82rem;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="dark"] .cell-2700-name {
  color: #ffffff;
}

.player-name-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.player-name-link:hover {
  color: #7A0026;
  text-decoration: underline;
}

[data-theme="dark"] .player-name-link:hover {
  color: #38bdf8;
}

/* Club / Federación */
.cell-2700-fed {
  font-size: 0.76rem;
  color: #554e41;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="dark"] .cell-2700-fed {
  color: #94a3b8;
}

/* Columna Elo FIDE Oficial */
.cell-2700-elo {
  font-weight: 800;
  font-size: 0.88rem;
  text-align: right;
  width: 66px;
  color: #1c1813;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

[data-theme="dark"] .cell-2700-elo {
  color: #f8fafc;
}

/* Variación Mensual de Elo (+/-) */
.cell-2700-var {
  text-align: right;
  width: 52px;
  font-weight: 800;
  font-size: 0.80rem;
  white-space: nowrap;
}

.var-pos {
  color: #16a34a;
}

.var-neg {
  color: #dc2626;
}

.var-neutral {
  color: #94a3b8;
  font-weight: 600;
}

/* Tendencia Sparkline SVG */
.cell-2700-trend {
  text-align: center;
  width: 56px;
  padding: 0.15rem 0.25rem;
}

.sparkline-svg {
  width: 48px;
  height: 16px;
  vertical-align: middle;
  cursor: pointer;
  overflow: visible;
}

.sparkline-path {
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sparkline-up { stroke: #16a34a; }
.sparkline-down { stroke: #dc2626; }
.sparkline-stable { stroke: #0284c7; }

.sparkline-point {
  fill: #fff;
  stroke-width: 1.2;
}

/* Partidas */
.cell-2700-games {
  text-align: center;
  width: 42px;
  font-weight: 600;
  font-size: 0.76rem;
  color: #635d4f;
}

[data-theme="dark"] .cell-2700-games {
  color: #94a3b8;
}

@media (max-width: 768px) {
  .chess2700-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .chess2700-range-inputs, .chess2700-search-box {
    width: 100%;
  }
  .chess2700-input-text {
    width: 100%;
    min-width: 100%;
  }
}


/* ==========================================================================
   OPTIMIZACIONES MÓVILES ZERO-OVERFLOW (NINGUNA SECCIÓN TIENE SCROLL HORIZONTAL)
   ========================================================================== */

.player-club-mobile {
  display: none;
}

@media (max-width: 900px) {
  .nav-container {
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    position: relative !important;
    box-sizing: border-box !important;
    padding: 0.5rem 0.65rem !important;
  }
  
  .mobile-menu-btn {
    display: inline-flex !important;
  }
  
  .fapc-menu-bar {
    display: none !important;
  }
  
  .fapc-menu-bar.mobile-open {
    display: flex !important;
    flex-direction: column !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    background: #59001b !important;
    padding: 0.75rem 1rem !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5) !important;
    z-index: 1000 !important;
    gap: 0.35rem !important;
    box-sizing: border-box !important;
  }
  
  .fapc-dropdown-menu {
    position: static !important;
    box-shadow: none !important;
    background: rgba(0, 0, 0, 0.25) !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0.4rem 0.5rem !important;
  }

  .nav-actions {
    gap: 0.25rem !important;
  }

  .bg-selector-wrapper {
    max-width: 130px;
    padding: 0.15rem 0.3rem !important;
    font-size: 0.72rem !important;
  }

  .btn-text {
    display: none !important;
  }

  #btnNuevoTorneo {
    padding: 0.35rem 0.55rem !important;
  }
}

@media (max-width: 768px) {
  /* Contenedores principales inmunes a overflow */
  .main-container {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  .tournaments-section,
  .entidades-section,
  .subcategorias-section,
  .chess2700-section {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  /* Grid de sedes con fotito en clases */
  .cba-venues-grid {
    grid-template-columns: 1fr !important;
  }

  .cba-venue-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Rankings 2700chess en Móvil: CERO SCROLL HORIZONTAL */
  .chess2700-rhythm-tabs {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    padding: 0.25rem 0.35rem !important;
  }

  .chess2700-tab-btn {
    flex: 1 !important;
    justify-content: center !important;
    padding: 0.35rem 0.25rem !important;
    font-size: 0.78rem !important;
  }

  .chess2700-cat-bar {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    box-sizing: border-box !important;
    padding: 0.25rem 0 !important;
  }

  .chess2700-cat-bar::-webkit-scrollbar {
    display: none !important;
  }

  .chess2700-toolbar {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    padding: 0.45rem 0.6rem !important;
  }

  .rankings-kpi-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.35rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .rankings-kpi-card {
    padding: 0.45rem 0.55rem !important;
  }

  .rankings-kpi-card .kpi-num {
    font-size: 0.85rem !important;
  }

  .rankings-kpi-card .kpi-lbl {
    font-size: 0.64rem !important;
  }

  .chess2700-table-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
    border-radius: 8px !important;
  }

  .chess2700-table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: auto !important;
    box-sizing: border-box !important;
    font-size: 0.75rem !important;
  }

  .chess2700-table thead th {
    padding: 0.35rem 0.25rem !important;
    font-size: 0.68rem !important;
  }

  .chess2700-table td {
    padding: 0.3rem 0.25rem !important;
  }

  /* Ocultar columnas secundarias en móvil */
  .th-2700-fed, .cell-2700-fed {
    display: none !important;
  }

  .th-2700-games, .cell-2700-games {
    display: none !important;
  }

  /* Mostrar club debajo del nombre */
  .player-club-mobile {
    display: block !important;
    font-size: 0.66rem !important;
    color: #64748b !important;
    font-weight: 500 !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    max-width: 130px !important;
    margin-top: 2px !important;
  }

  [data-theme="dark"] .player-club-mobile {
    color: #94a3b8 !important;
  }

  .cell-2700-rank {
    width: 24px !important;
    font-size: 0.76rem !important;
    padding: 0.25rem 0.05rem !important;
  }

  .cell-2700-posvar {
    width: 26px !important;
    font-size: 0.68rem !important;
    padding: 0.25rem 0.05rem !important;
  }

  .cell-2700-avatar {
    width: 24px !important;
    padding: 0.25rem 0.05rem !important;
  }

  .avatar-2700-img, .avatar-2700-placeholder {
    width: 20px !important;
    height: 20px !important;
    font-size: 0.58rem !important;
  }

  .cell-2700-name {
    font-size: 0.75rem !important;
    padding: 0.25rem 0.25rem !important;
    max-width: 135px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .cell-2700-elo {
    width: 55px !important;
    font-size: 0.80rem !important;
    padding: 0.25rem 0.15rem !important;
    text-align: right !important;
  }

  .cell-2700-var {
    width: 42px !important;
    font-size: 0.74rem !important;
    padding: 0.25rem 0.15rem !important;
    text-align: right !important;
  }

  .cell-2700-trend {
    width: 42px !important;
    padding: 0.15rem 0.1rem !important;
    text-align: center !important;
  }

  .sparkline-svg {
    width: 38px !important;
    height: 14px !important;
  }
}


/* ==========================================================================
   ESTÁNDAR DEFINITIVO ZERO-OVERFLOW: NINGUNA SECCIÓN HACE SCROLL HORIZONTAL
   ========================================================================== */

/* 1. Protección estricta en el viewport */
html {
  overflow-x: clip !important;
  max-width: 100vw !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

body {
  overflow-x: clip !important;
  max-width: 100vw !important;
  width: 100% !important;
  position: relative !important;
  box-sizing: border-box !important;
}

@media (max-width: 900px) {
  /* Header y Navbar inmunes a desborde */
  .top-nav {
    width: 100% !important;
    max-width: 100vw !important;
    overflow: visible !important;
    box-sizing: border-box !important;
    padding: 0 !important;
  }

  .nav-container {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    padding: 0.45rem 0.6rem !important;
    overflow: visible !important;
  }

  .brand-group {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: 60% !important;
    overflow: hidden !important;
  }

  .brand-text {
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .federation-title {
    font-size: 0.92rem !important;
    white-space: nowrap !important;
  }

  .federation-subtitle {
    display: none !important;
  }

  .nav-actions {
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    gap: 0.3rem !important;
  }

  .top-nav .bg-selector-wrapper {
    display: none !important;
  }

  .btn-text {
    display: none !important;
  }

  #btnNuevoTorneo {
    padding: 0.35rem 0.5rem !important;
    font-size: 0.85rem !important;
  }

  #themeToggle, #mobileNavToggle {
    padding: 0.35rem 0.45rem !important;
    min-width: 32px !important;
    font-size: 0.95rem !important;
  }

  /* Drawer de Navegación Móvil */
  .fapc-menu-bar {
    display: none !important;
  }

  .fapc-menu-bar.mobile-open {
    display: flex !important;
    flex-direction: column !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    background: #59001b !important;
    padding: 0.75rem 1rem !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5) !important;
    z-index: 1000 !important;
    gap: 0.4rem !important;
    box-sizing: border-box !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
  }

  .mobile-menu-bg-item {
    margin-top: 0.5rem !important;
    padding-top: 0.5rem !important;
    border-top: 1px solid rgba(255, 255, 255, 0.2) !important;
  }

  .mobile-bg-picker {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.35rem !important;
  }

  .mobile-bg-label {
    font-size: 0.75rem !important;
    color: #e2e8f0 !important;
    font-weight: 600 !important;
  }

  .bg-select-mobile {
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: #fff !important;
    padding: 0.4rem 0.6rem !important;
    border-radius: 6px !important;
    font-size: 0.82rem !important;
    outline: none !important;
  }
}

@media (max-width: 768px) {
  /* Contenedor Principal Inmune a Desborde */
  .main-container {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: clip !important;
    box-sizing: border-box !important;
    padding-left: 0.45rem !important;
    padding-right: 0.45rem !important;
  }

  /* Conmutador de Secciones en Móvil: WRAP Limpio en 2 filas, CERO scroll H */
  .main-section-switcher {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.25rem !important;
    overflow-x: visible !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0.35rem 0.25rem !important;
    border-radius: 12px !important;
    margin-bottom: 0.75rem !important;
    box-sizing: border-box !important;
  }

  .main-tab-btn {
    flex: 0 1 auto !important;
    padding: 0.32rem 0.5rem !important;
    font-size: 0.74rem !important;
    white-space: nowrap !important;
    border-radius: 8px !important;
  }

  .main-tab-btn .tab-badge {
    padding: 0.1rem 0.35rem !important;
    font-size: 0.62rem !important;
  }

  /* Badges de Torneos y Clases: CERO Scroll Horizontal, WRAP Inteligente */
  .details-badges-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.25rem !important;
    overflow-x: visible !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .badge-status, .badge-detail, .badge-elo-fide, .badge-tipo-evento, .badge-tiempo {
    white-space: normal !important;
    word-break: break-word !important;
    font-size: 0.68rem !important;
    padding: 0.2rem 0.45rem !important;
  }

  /* Selector de Días de Clases: WRAP en 2 filas compactas */
  .clases-day-pills {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.25rem !important;
    overflow-x: visible !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .day-pill {
    flex: 0 1 auto !important;
    padding: 0.28rem 0.55rem !important;
    font-size: 0.73rem !important;
    white-space: nowrap !important;
    border-radius: 6px !important;
  }

  /* Barra de Categorías de Rankings 2700chess: WRAP en 3 filas compactas */
  .chess2700-cat-bar {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.25rem !important;
    overflow-x: visible !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0.25rem 0 !important;
  }

  .chess2700-cat-btn {
    flex: 0 1 auto !important;
    padding: 0.26rem 0.5rem !important;
    font-size: 0.71rem !important;
    white-space: nowrap !important;
    border-radius: 6px !important;
  }

  /* Tabla Rankings 2700chess en Móvil: CERO SCROLL HORIZONTAL */
  .chess2700-table-wrapper {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
  }

  .chess2700-table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    box-sizing: border-box !important;
    border-collapse: collapse !important;
  }

  .th-2700-fed, .cell-2700-fed,
  .th-2700-games, .cell-2700-games {
    display: none !important;
  }

  .th-2700-rank, .cell-2700-rank { width: 22px !important; padding: 0.2rem 0.05rem !important; text-align: center !important; font-size: 0.73rem !important; }
  .th-2700-posvar, .cell-2700-posvar { width: 22px !important; padding: 0.2rem 0.05rem !important; text-align: center !important; font-size: 0.68rem !important; }
  .th-2700-avatar, .cell-2700-avatar { width: 26px !important; padding: 0.2rem 0.05rem !important; text-align: center !important; }
  .avatar-2700-img, .avatar-2700-placeholder { width: 20px !important; height: 20px !important; font-size: 0.56rem !important; }
  
  .th-2700-name, .cell-2700-name { 
    width: auto !important; 
    min-width: 0 !important; 
    padding: 0.2rem 0.25rem !important; 
    overflow: hidden !important; 
    text-overflow: ellipsis !important; 
    font-size: 0.74rem !important;
  }
  
  .th-2700-elo, .cell-2700-elo { width: 50px !important; padding: 0.2rem 0.1rem !important; text-align: right !important; font-size: 0.78rem !important; }
  .th-2700-var, .cell-2700-var { width: 38px !important; padding: 0.2rem 0.1rem !important; text-align: right !important; font-size: 0.72rem !important; }
  .th-2700-trend, .cell-2700-trend { width: 40px !important; padding: 0.2rem 0.05rem !important; text-align: center !important; }
  .sparkline-svg { width: 36px !important; height: 13px !important; }

  /* Grids de Contenido: 1 Columna 100% de Ancho, sin rebasar pantalla */
  .tournaments-grid,
  .cba-venues-grid,
  .entidades-grid,
  .subcategorias-grid {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .tournament-card,
  .cba-venue-card,
  .entidad-card,
  .subcategoria-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Banner de Twitter / X */
  .x-sync-banner {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    gap: 0.65rem !important;
    padding: 0.75rem 0.65rem !important;
  }

  .x-sync-left {
    width: 100% !important;
    max-width: 100% !important;
  }

  .x-sync-buttons {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.4rem !important;
  }

  .btn-x-sync, .btn-x-import {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Paneles de Control y Filtros */
  .controls-panel, .clases-controls-panel {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0.5rem 0.6rem !important;
  }

  .search-box, .chess2700-toolbar {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .chess2700-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.4rem !important;
    padding: 0.45rem 0.55rem !important;
  }

  .chess2700-filter-col, .chess2700-actions-col {
    width: 100% !important;
  }

  .chess2700-select, .chess2700-input-text {
    width: 100% !important;
    min-width: 0 !important;
  }

  .chess2700-btn-reset {
    width: 100% !important;
    text-align: center !important;
  }
}

/* Reglas Responsivas de Contacto en Móvil */
@media (max-width: 768px) {
  .contacto-grid {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    gap: 1rem !important;
  }
  .contacto-channels-col, .contacto-form-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
  }
  .contacto-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0.75rem !important;
  }
  .contacto-card-info {
    width: 100% !important;
    max-width: calc(100% - 50px) !important;
    min-width: 0 !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
  }
  .social-buttons-row {
    flex-direction: column !important;
    width: 100% !important;
  }
  .btn-social {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    justify-content: center !important;
  }
  .btn-channel {
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: center !important;
    white-space: normal !important;
  }
}

/* Reglas Responsivas de Contacto en Móvil */
@media (max-width: 768px) {
  .contacto-grid {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    gap: 1rem !important;
  }
  .contacto-channels-col, .contacto-form-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
  }
  .contacto-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0.75rem !important;
  }
  .contacto-card-info {
    width: 100% !important;
    max-width: calc(100% - 50px) !important;
    min-width: 0 !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
  }
  .social-buttons-row {
    flex-direction: column !important;
    width: 100% !important;
  }
  .btn-social {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    justify-content: center !important;
  }
  .btn-channel {
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: center !important;
    white-space: normal !important;
  }
}

@media (max-width: 768px) {
  .contacto-form-col {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
  }
  .contacto-form-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    padding: 0.85rem !important;
  }
  .contact-form {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .contact-form .form-row-2,
  .contact-form .form-actions {
    grid-template-columns: 1fr !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .contact-form input,
  .contact-form select,
  .contact-form textarea {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}


/* ==========================================================================
   RANKINGS 2700CHESS: FILTRO ULTRA-SLIM, MICRO-KPIS Y FILAS 100% PAREJAS
   ========================================================================== */

/* 1. Barra de Filtros Ultra Slim */
.chess2700-toolbar {
  background: #eae5d8 !important;
  border: 1px solid #d5cfc0 !important;
  border-radius: 6px !important;
  padding: 0.2rem 0.5rem !important;
  margin-bottom: 0.35rem !important;
  box-sizing: border-box !important;
}

[data-theme="dark"] .chess2700-toolbar {
  background: #202634 !important;
  border-color: #333d4e !important;
}

.chess2700-toolbar-inner {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 0.4rem 0.8rem !important;
}

.chess2700-filter-col {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.25rem !important;
}

.chess2700-label {
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  color: #635d4f !important;
  text-transform: uppercase !important;
  letter-spacing: 0.2px !important;
  margin: 0 !important;
  white-space: nowrap !important;
}

[data-theme="dark"] .chess2700-label {
  color: #94a3b8 !important;
}

.chess2700-select {
  height: 26px !important;
  padding: 0 0.4rem !important;
  font-size: 0.76rem !important;
  font-weight: 600 !important;
  border-radius: 4px !important;
  border: 1px solid #c8c2b0 !important;
  background: #ffffff !important;
  color: #2c271e !important;
  outline: none !important;
}

[data-theme="dark"] .chess2700-select {
  background: #182234 !important;
  border-color: #3b4758 !important;
  color: #f1f5f9 !important;
}

.chess2700-range-inputs {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.2rem !important;
}

.chess2700-input-num {
  width: 48px !important;
  height: 26px !important;
  padding: 0 0.25rem !important;
  font-size: 0.76rem !important;
  border-radius: 4px !important;
  border: 1px solid #c8c2b0 !important;
  text-align: center !important;
}

.chess2700-input-text {
  height: 26px !important;
  padding: 0 0.4rem 0 1.6rem !important;
  font-size: 0.76rem !important;
  border-radius: 4px !important;
  border: 1px solid #c8c2b0 !important;
  min-width: 140px !important;
}

.chess2700-search-icon {
  font-size: 0.72rem !important;
  left: 0.45rem !important;
}

.chess2700-btn-reset, .chess2700-btn-sync {
  height: 26px !important;
  padding: 0 0.5rem !important;
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  border-radius: 4px !important;
  border: 1px solid #bfb7a4 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.25rem !important;
}

.chess2700-btn-reset {
  background: #d8d1c0 !important;
  color: #4b4538 !important;
}

.chess2700-btn-sync {
  background: #7A0026 !important;
  border-color: #59001b !important;
  color: #ffffff !important;
}

.chess2700-btn-sync:hover {
  background: #92002e !important;
}

/* 2. Micro-Strip de KPIs (1/3 de la altura original) */
.rankings-kpi-strip {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 0.35rem 0.5rem !important;
  margin-bottom: 0.35rem !important;
}

.kpi-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.3rem !important;
  background: #fbf9f4 !important;
  border: 1px solid #e2dcd0 !important;
  border-radius: 4px !important;
  padding: 0.15rem 0.45rem !important;
  font-size: 0.72rem !important;
  color: #453f32 !important;
  height: 22px !important;
  box-sizing: border-box !important;
}

[data-theme="dark"] .kpi-chip {
  background: #1e2533 !important;
  border-color: #2f3a4d !important;
  color: #cbd5e1 !important;
}

.kpi-chip.kpi-chip-leader {
  border-color: #f59e0b !important;
  background: #fffbeb !important;
  font-weight: 700 !important;
}

[data-theme="dark"] .kpi-chip.kpi-chip-leader {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: #b45309 !important;
}

.kpi-chip.kpi-chip-gainer {
  border-color: #10b981 !important;
  background: #ecfdf5 !important;
}

[data-theme="dark"] .kpi-chip.kpi-chip-gainer {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: #047857 !important;
}

.kpi-chip-val {
  font-weight: 800 !important;
  color: #1a1611 !important;
}

[data-theme="dark"] .kpi-chip-val {
  color: #f8fafc !important;
}

.kpi-chip-sub {
  font-size: 0.68rem !important;
  color: #64748b !important;
}

/* 3. Filas de la Tabla 100% PAREJAS (Exactamente el mismo alto) */
.chess2700-table-wrapper {
  max-height: none !important;
  overflow-y: visible !important;
}

.chess2700-table {
  width: 100% !important;
  border-collapse: collapse !important;
  table-layout: auto !important;
}

.chess2700-table thead tr {
  height: 28px !important;
}

.chess2700-table thead th {
  height: 28px !important;
  padding: 0.15rem 0.4rem !important;
  font-size: 0.70rem !important;
  font-weight: 800 !important;
  vertical-align: middle !important;
  box-sizing: border-box !important;
}

.chess2700-table tbody tr {
  height: 30px !important;
  max-height: 30px !important;
  box-sizing: border-box !important;
}

.chess2700-table tbody td {
  height: 30px !important;
  max-height: 30px !important;
  padding: 0.1rem 0.4rem !important;
  vertical-align: middle !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
}

/* Podio en una sola línea horizontal (Sin wrap) */
.cell-2700-rank {
  width: 38px !important;
  min-width: 38px !important;
  text-align: center !important;
  white-space: nowrap !important;
  font-weight: 800 !important;
  font-size: 0.78rem !important;
  padding: 0.1rem 0.2rem !important;
}

.podium-rank {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  font-size: 0.76rem !important;
}

.podium-rank.gold { color: #b45309 !important; }
.podium-rank.silver { color: #475569 !important; }
.podium-rank.bronze { color: #92400e !important; }

/* Variación de puesto */
.cell-2700-posvar {
  width: 34px !important;
  min-width: 34px !important;
  text-align: center !important;
  white-space: nowrap !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
}

/* Avatar Foto e Iniciales IDÉNTICOS en tamaño */
.cell-2700-avatar {
  width: 26px !important;
  min-width: 26px !important;
  text-align: center !important;
  padding: 0 !important;
}

.avatar-2700-img, .avatar-2700-placeholder {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
  border-radius: 50% !important;
  vertical-align: middle !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.58rem !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
}

/* Celda de Nombre Pareja */
.cell-2700-name {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: 0.80rem !important;
  line-height: 1 !important;
  vertical-align: middle !important;
}

.cell-2700-name > * {
  vertical-align: middle !important;
}

.badge-title {
  display: inline-block !important;
  height: 16px !important;
  line-height: 16px !important;
  font-size: 0.62rem !important;
  font-weight: 800 !important;
  padding: 0 4px !important;
  margin-right: 4px !important;
  border-radius: 3px !important;
  vertical-align: middle !important;
}

.player-name-link {
  display: inline !important;
  vertical-align: middle !important;
  font-size: 0.80rem !important;
  line-height: 1 !important;
}

.gender-tag-f {
  display: inline-block !important;
  height: 15px !important;
  line-height: 15px !important;
  font-size: 0.60rem !important;
  padding: 0 3px !important;
  border-radius: 3px !important;
  vertical-align: middle !important;
  margin-left: 4px !important;
}

/* Club / Sede */
.cell-2700-fed {
  font-size: 0.76rem !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  vertical-align: middle !important;
  line-height: 1 !important;
}

/* Elo */
.cell-2700-elo {
  font-size: 0.82rem !important;
  font-weight: 800 !important;
  text-align: right !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
  line-height: 1 !important;
}

/* Variación */
.cell-2700-var {
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  text-align: right !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
  line-height: 1 !important;
}

/* Trend Sparkline */
.cell-2700-trend {
  text-align: center !important;
  vertical-align: middle !important;
  padding: 0 !important;
}

.sparkline-svg {
  width: 44px !important;
  height: 14px !important;
  vertical-align: middle !important;
  display: inline-block !important;
}

/* Games */
.cell-2700-games {
  text-align: center !important;
  font-size: 0.76rem !important;
  vertical-align: middle !important;
  line-height: 1 !important;
}


/* Compactación vertical estricta para mostrar >= 15 jugadores sin scroll en 768px */
@media (min-width: 769px) {
  .main-container {
    padding-top: 0.75rem !important;
  }
  .main-section-switcher {
    margin-bottom: 0.65rem !important;
  }
  .rankings-section {
    margin-top: 0 !important;
  }
  .chess2700-rhythm-tabs {
    padding: 0.18rem 0.4rem !important;
    gap: 0.35rem !important;
    margin-bottom: 0.3rem !important;
    border-radius: 8px !important;
  }
  .chess2700-tab-btn {
    padding: 0.25rem 0.65rem !important;
    font-size: 0.78rem !important;
  }
  .chess2700-cat-bar {
    padding: 0.1rem 0 !important;
    margin-bottom: 0.3rem !important;
    gap: 0.3rem !important;
  }
  .chess2700-cat-btn {
    padding: 0.22rem 0.55rem !important;
    font-size: 0.74rem !important;
  }
  .chess2700-toolbar {
    padding: 0.15rem 0.45rem !important;
    margin-bottom: 0.25rem !important;
  }
  .rankings-kpi-strip {
    margin-bottom: 0.25rem !important;
  }
}


/* Optimización para 15+ jugadores visibles en pantallas de 768px */
@media (min-width: 900px) {
  .top-nav {
    padding: 0 !important;
  }
  .nav-container {
    padding: 0.25rem 1rem !important;
  }
  .fapc-logo {
    width: 28px !important;
    height: 28px !important;
  }
  .federation-title {
    font-size: 0.95rem !important;
  }
  .fapc-nav-link {
    padding: 0.25rem 0.6rem !important;
    font-size: 0.80rem !important;
  }
  .main-container {
    padding-top: 0.25rem !important;
  }
  .main-section-switcher {
    padding: 0.15rem 0.25rem !important;
    margin-bottom: 0.35rem !important;
  }
  .main-tab-btn {
    padding: 0.25rem 0.75rem !important;
    font-size: 0.78rem !important;
  }
  .chess2700-rhythm-tabs {
    padding: 0.15rem 0.35rem !important;
    margin-bottom: 0.25rem !important;
  }
  .chess2700-cat-bar {
    padding: 0.1rem 0 !important;
    margin-bottom: 0.25rem !important;
  }
  .chess2700-toolbar {
    padding: 0.15rem 0.45rem !important;
    margin-bottom: 0.2rem !important;
  }
  .chess2700-toolbar-inner {
    flex-wrap: nowrap !important;
    gap: 0.5rem !important;
  }
  .rankings-kpi-strip {
    margin-bottom: 0.2rem !important;
  }
  .chess2700-table thead tr {
    height: 26px !important;
  }
  .chess2700-table thead th {
    height: 26px !important;
    padding: 0.1rem 0.35rem !important;
    font-size: 0.68rem !important;
  }
  .chess2700-table tbody tr {
    height: 28px !important;
    max-height: 28px !important;
  }
  .chess2700-table tbody td {
    height: 28px !important;
    max-height: 28px !important;
    padding: 0.05rem 0.35rem !important;
  }
}


/* Forzar que cada columna del toolbar sea en una sola línea horizontal (inline) */
.chess2700-filter-col {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.3rem !important;
  height: 26px !important;
}

.chess2700-label {
  display: inline-block !important;
  margin: 0 !important;
  line-height: 26px !important;
}


/* ==========================================================================
   TOOLBAR HORIZONTAL CONTINUO Y TARJETAS KPI COMPACTAS (1/3 DE ALTURA)
   ========================================================================== */

/* Toolbar Horizontal Siempre en 1 Fila en Escritorio */
.chess2700-toolbar {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex-wrap: wrap !important;
  gap: 0.4rem 0.75rem !important;
  background: #eae5d8 !important;
  border: 1px solid #d5cfc0 !important;
  border-radius: 6px !important;
  padding: 0.25rem 0.65rem !important;
  box-sizing: border-box !important;
  margin-bottom: 0.35rem !important;
  width: 100% !important;
}

[data-theme="dark"] .chess2700-toolbar {
  background: #202634 !important;
  border-color: #333d4e !important;
}

.chess2700-toolbar-inner {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 0.4rem 0.75rem !important;
  width: 100% !important;
}

.chess2700-filter-col {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.3rem !important;
  margin: 0 !important;
  height: 28px !important;
}

.chess2700-label {
  font-size: 0.70rem !important;
  font-weight: 700 !important;
  color: #635d4f !important;
  text-transform: uppercase !important;
  letter-spacing: 0.2px !important;
  margin: 0 !important;
  white-space: nowrap !important;
  line-height: 28px !important;
}

[data-theme="dark"] .chess2700-label {
  color: #94a3b8 !important;
}

.chess2700-select {
  height: 28px !important;
  padding: 0 0.5rem !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  border-radius: 4px !important;
  border: 1px solid #c8c2b0 !important;
  background: #ffffff !important;
  color: #2c271e !important;
  outline: none !important;
}

[data-theme="dark"] .chess2700-select {
  background: #182234 !important;
  border-color: #3b4758 !important;
  color: #f1f5f9 !important;
}

.chess2700-range-inputs {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.2rem !important;
}

.chess2700-input-num {
  width: 50px !important;
  height: 28px !important;
  padding: 0 0.25rem !important;
  font-size: 0.78rem !important;
  border-radius: 4px !important;
  border: 1px solid #c8c2b0 !important;
  text-align: center !important;
}

.chess2700-input-text {
  height: 28px !important;
  padding: 0 0.4rem 0 1.6rem !important;
  font-size: 0.78rem !important;
  border-radius: 4px !important;
  border: 1px solid #c8c2b0 !important;
  min-width: 140px !important;
}

.chess2700-actions-col {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
}

.chess2700-btn-reset, .chess2700-btn-sync {
  height: 28px !important;
  padding: 0 0.6rem !important;
  font-size: 0.76rem !important;
  font-weight: 700 !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.25rem !important;
  box-sizing: border-box !important;
}

.chess2700-btn-reset {
  background: #d8d1c0 !important;
  border: 1px solid #bfb7a4 !important;
  color: #4b4538 !important;
}

.chess2700-btn-sync {
  background: #7A0026 !important;
  border: 1px solid #59001b !important;
  color: #ffffff !important;
}

/* Tarjetas KPI Compactas (4 Columnas, Altura ~34px, 1/3 de lo anterior) */
.rankings-kpi-cards-compact {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 0.5rem !important;
  margin-bottom: 0.35rem !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

@media (max-width: 768px) {
  .rankings-kpi-cards-compact {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.35rem !important;
  }
}

.kpi-card-mini {
  display: flex !important;
  align-items: center !important;
  gap: 0.45rem !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 6px !important;
  padding: 0.25rem 0.55rem !important;
  height: 34px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

[data-theme="dark"] .kpi-card-mini {
  background: #1e2533 !important;
  border-color: #2f3a4d !important;
}

.kpi-card-mini.leader-card {
  border-left: 3px solid #f59e0b !important;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, #ffffff 100%) !important;
}

[data-theme="dark"] .kpi-card-mini.leader-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, #1e2533 100%) !important;
}

.kpi-card-mini.gainer-card {
  border-left: 3px solid #10b981 !important;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, #ffffff 100%) !important;
}

[data-theme="dark"] .kpi-card-mini.gainer-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, #1e2533 100%) !important;
}

.kpi-mini-icon {
  font-size: 1.15rem !important;
  line-height: 1 !important;
  flex-shrink: 0 !important;
}

.kpi-mini-content {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  min-width: 0 !important;
  overflow: hidden !important;
  line-height: 1.1 !important;
}

.kpi-mini-val {
  font-size: 0.78rem !important;
  font-weight: 800 !important;
  color: #1a1611 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

[data-theme="dark"] .kpi-mini-val {
  color: #f8fafc !important;
}

.kpi-mini-val.gainer-text {
  color: #059669 !important;
}

[data-theme="dark"] .kpi-mini-val.gainer-text {
  color: #10b981 !important;
}

.kpi-mini-lbl {
  font-size: 0.62rem !important;
  font-weight: 600 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.2px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Columna # sin medallas y ancho parejo */
.th-2700-rank, .cell-2700-rank {
  width: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  text-align: center !important;
  padding: 0.05rem 0.15rem !important;
  font-size: 0.80rem !important;
  font-weight: 700 !important;
  line-height: 28px !important;
  height: 28px !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  color: #4b4538 !important;
}

[data-theme="dark"] .th-2700-rank, [data-theme="dark"] .cell-2700-rank {
  color: #cbd5e1 !important;
}


/* ==========================================================================
   PANEL DE BÚSQUEDA Y FILTROS ULTRA COMPACTO EN 2 LÍNEAS (TORNEOS)
   ========================================================================== */
.controls-panel-2lines {
  padding: 0.45rem 0.75rem !important;
  margin-bottom: 0.85rem !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.45rem !important;
}

/* LÍNEA 1: Buscador + Selector de Vista */
.controls-line-1 {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.65rem !important;
  width: 100% !important;
}

.controls-line-1 .search-box {
  flex: 1 !important;
  margin-bottom: 0 !important;
  position: relative !important;
  display: flex !important;
  align-items: center !important;
}

.controls-line-1 .search-box input {
  width: 100% !important;
  height: 34px !important;
  padding: 0.35rem 2.2rem 0.35rem 2.3rem !important;
  font-size: 0.84rem !important;
  border-radius: var(--radius-sm) !important;
  border: 1px solid var(--border) !important;
  background: var(--bg-alt) !important;
  box-sizing: border-box !important;
}

.controls-line-1 .search-icon {
  position: absolute !important;
  left: 0.75rem !important;
  font-size: 0.85rem !important;
  color: var(--text-muted) !important;
  pointer-events: none !important;
}

.controls-line-1 .clear-btn {
  position: absolute !important;
  right: 0.65rem !important;
  height: auto !important;
}

.controls-line-1 .view-toggle-group {
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  height: 34px !important;
  padding: 2px !important;
  background: var(--bg-alt) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  box-sizing: border-box !important;
}

.controls-line-1 .view-btn {
  height: 28px !important;
  padding: 0.2rem 0.65rem !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.3rem !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

/* LÍNEA 2: Filtros Compactos en Hilera Única Horizontal */
.controls-line-2.filter-row-compact {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 0.85rem !important;
  width: 100% !important;
  overflow-x: auto !important;
  white-space: nowrap !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: thin !important;
  padding-bottom: 2px !important;
}

.controls-line-2 .filter-group {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 0.3rem !important;
  flex-shrink: 0 !important;
}

.controls-line-2 .filter-label {
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  color: var(--text-muted) !important;
  margin-right: 0.15rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  flex-shrink: 0 !important;
}

.controls-line-2 .pill-btn {
  padding: 0.18rem 0.52rem !important;
  font-size: 0.74rem !important;
  font-weight: 600 !important;
  height: 26px !important;
  line-height: 22px !important;
  border-radius: var(--radius-full) !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
}

@media (max-width: 600px) {
  .controls-panel-2lines {
    padding: 0.4rem 0.5rem !important;
    gap: 0.35rem !important;
  }
  .controls-line-1 .search-box input {
    font-size: 0.78rem !important;
    padding-left: 2rem !important;
  }
  .controls-line-1 .view-btn {
    padding: 0.2rem 0.45rem !important;
    font-size: 0.72rem !important;
  }
  .controls-line-2.filter-row-compact {
    gap: 0.65rem !important;
  }
}


/* ==========================================================================
   OPTIMIZACIONES ULTRA COMPACTAS DE RANKINGS Y FIX DE ELO MÓVIL
   ========================================================================== */

/* 1. Barra Unificada Superior de Rankings (Rhythm + Categories en 1 Hilera) */
.chess2700-top-bar-unified {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.65rem !important;
  margin-bottom: 0.35rem !important;
  width: 100% !important;
  overflow-x: auto !important;
  white-space: nowrap !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: thin !important;
}

.chess2700-top-bar-unified .chess2700-rhythm-tabs {
  display: inline-flex !important;
  flex-shrink: 0 !important;
  margin-bottom: 0 !important;
  height: 30px !important;
}

.chess2700-top-bar-unified .chess2700-cat-bar {
  display: inline-flex !important;
  flex-shrink: 0 !important;
  margin-bottom: 0 !important;
  gap: 0.25rem !important;
  height: 30px !important;
  align-items: center !important;
}

.chess2700-top-bar-unified .chess2700-tab-btn {
  height: 28px !important;
  padding: 0.2rem 0.6rem !important;
  font-size: 0.78rem !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.3rem !important;
}

.chess2700-top-bar-unified .chess2700-cat-btn {
  height: 26px !important;
  padding: 0.15rem 0.5rem !important;
  font-size: 0.74rem !important;
  line-height: 22px !important;
}

/* 2. Toolbar Ultra Compacta sin botón de Sync */
.chess2700-toolbar {
  margin-bottom: 0.35rem !important;
  padding: 0.25rem 0.65rem !important;
  height: 34px !important;
  display: flex !important;
  align-items: center !important;
  box-sizing: border-box !important;
}

.chess2700-toolbar-inner {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.65rem !important;
  width: 100% !important;
}

.chess2700-filter-col {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.25rem !important;
}

.chess2700-label {
  font-size: 0.74rem !important;
}

.chess2700-select, .chess2700-input-num, .chess2700-input-text {
  height: 26px !important;
  font-size: 0.78rem !important;
  padding: 0.15rem 0.4rem !important;
}

.chess2700-btn-reset {
  height: 26px !important;
  padding: 0.15rem 0.5rem !important;
  font-size: 0.75rem !important;
}

/* 3. Tarjetas KPI Miniatura Ultra Pegadas */
.rankings-kpi-cards-compact {
  margin-bottom: 0.35rem !important;
  gap: 0.5rem !important;
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
}

.kpi-card-mini {
  height: 30px !important;
  padding: 0.15rem 0.45rem !important;
}

.kpi-mini-icon {
  font-size: 0.95rem !important;
}

.kpi-mini-val {
  font-size: 0.78rem !important;
}

.kpi-mini-lbl {
  font-size: 0.62rem !important;
}

/* 4. Tabla Ajustada */
.chess2700-table-wrapper {
  margin-top: 0.25rem !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* 5. FIX CRÍTICO DE ELO EN PANTALLAS MÓVILES (CELULAR) */
@media (max-width: 650px) {
  /* Ocultar Trend, Games y Club en celular para priorizar 100% el ELO */
  .th-2700-trend, .cell-2700-trend,
  .th-2700-games, .cell-2700-games,
  .th-2700-fed, .cell-2700-fed {
    display: none !important;
  }

  /* Tabla al 100% exacta sin desbordar el contenedor */
  table.chess2700-table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    box-sizing: border-box !important;
  }

  .th-2700-rank, .cell-2700-rank {
    width: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    padding: 0.15rem 0.05rem !important;
    font-size: 0.74rem !important;
    text-align: center !important;
  }

  .th-2700-posvar, .cell-2700-posvar {
    width: 20px !important;
    min-width: 20px !important;
    max-width: 20px !important;
    padding: 0.15rem 0.05rem !important;
    font-size: 0.68rem !important;
    text-align: center !important;
  }

  .th-2700-avatar, .cell-2700-avatar {
    width: 26px !important;
    min-width: 26px !important;
    max-width: 26px !important;
    padding: 0.15rem 0.05rem !important;
    text-align: center !important;
  }

  .avatar-2700-img, .avatar-2700-placeholder {
    width: 20px !important;
    height: 20px !important;
    font-size: 0.54rem !important;
  }

  .th-2700-name, .cell-2700-name {
    width: auto !important;
    min-width: 0 !important;
    padding: 0.15rem 0.25rem !important;
    font-size: 0.74rem !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* COLUMNA ELO: 100% VISIBLE, DESTACADA Y DENTRO DEL VIEWPORT */
  .th-2700-elo, .cell-2700-elo {
    width: 65px !important;
    min-width: 65px !important;
    max-width: 65px !important;
    padding: 0.15rem 0.25rem !important;
    text-align: right !important;
    font-size: 0.88rem !important;
    font-weight: 800 !important;
    color: #7a0026 !important;
    box-sizing: border-box !important;
  }

  .th-2700-var, .cell-2700-var {
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    padding: 0.15rem 0.15rem !important;
    text-align: right !important;
    font-size: 0.72rem !important;
    box-sizing: border-box !important;
  }

  /* Entidades: layout limpio sin buscador ni pastillas */
  .entidades-grid {
    margin-top: 0.5rem !important;
  }
}
