/* ── SPA: pantallas de sección full-height ─────────────────────── */

html, body {
  overflow: hidden;
  height: 100%;
}

/* Cada sección ocupa toda la pantalla, oculta por defecto */
body > section,
body > .divider {
  display: none;
}

body > section {
  position: fixed;
  inset: 0;
  top: 56px;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-deep);
  opacity: 0;
  pointer-events: none;
  transform-origin: center center;
  will-change: opacity, transform, filter;
  display: block;
  /* transform y filter 100% gestionados por GSAP */
}

body > section:nth-child(even) {
  background: var(--bg-panel);
}

body > section.spa-active {
  pointer-events: auto;
}

/* spa-exit ya no se usa — la salida la maneja JS con style directo */

/* Hero no tiene padding-top extra porque ocupa todo */
section.hero {
  top: 0 !important;
  padding: 0 !important;
}

/* Indicador de página activa en nav */
.nav-links a.active {
  color: var(--accent-green) !important;
  background: rgba(45,106,39,0.1) !important;
}

/* Botón "inicio" / hero en nav brand */
.nav-brand {
  cursor: pointer;
}

/* Scrollbar dentro de cada sección */
body > section::-webkit-scrollbar {
  width: 5px;
}
body > section::-webkit-scrollbar-track {
  background: transparent;
}
body > section::-webkit-scrollbar-thumb {
  background: rgba(45,106,39,0.25);
  border-radius: 3px;
}
body > section::-webkit-scrollbar-thumb:hover {
  background: rgba(45,106,39,0.45);
}

/* Indicador de sección activa (punto lateral) */
.spa-dots {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.spa-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(45,106,39,0.2);
  border: 1.5px solid rgba(45,106,39,0.35);
  cursor: pointer;
  transition: background 0.25s, transform 0.25s;
}
.spa-dot.active {
  background: var(--accent-green);
  transform: scale(1.4);
}
.spa-dot:hover {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
}

/* Flecha de siguiente sección */
.spa-next-btn {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(45,106,39,0.2);
  border-radius: 100px;
  padding: 8px 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  font-family: inherit;
}
.spa-next-btn:hover {
  color: var(--accent-green);
  border-color: var(--accent-green);
  box-shadow: 0 4px 16px rgba(45,106,39,0.15);
}
.spa-next-btn svg {
  transition: transform 0.2s;
}
.spa-next-btn:hover svg {
  transform: translateY(3px);
}
.spa-next-btn.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ── Secciones sin scroll: todo cabe en pantalla ───────────────── */

/* Quitar overflow interno — sin scroll en ninguna sección */
body > section {
  overflow: hidden !important;
}

/* Reducir padding de sección al mínimo */
body > section:not(.hero) {
  padding: 0 !important;
  display: flex;
  flex-direction: column;
}

body > section:not(.hero) > .container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 18px;
  padding-bottom: 18px;
  min-height: 0;
}

/* Cabeceras de sección más compactas */
body > section:not(.hero) .section-title {
  font-size: clamp(1.2rem, 2.2vw, 1.8rem) !important;
  margin-bottom: 6px !important;
}

body > section:not(.hero) .section-desc {
  font-size: 0.78rem !important;
  line-height: 1.5 !important;
  margin-bottom: 0 !important;
}

body > section:not(.hero) [style*="margin-bottom:48px"],
body > section:not(.hero) [style*="margin-bottom:40px"],
body > section:not(.hero) [style*="margin-bottom: 48px"],
body > section:not(.hero) [style*="margin-bottom: 40px"] {
  margin-bottom: 12px !important;
}

/* Cards más compactos */
body > section:not(.hero) .card {
  padding: 14px 18px !important;
}

body > section:not(.hero) .card-big {
  font-size: 1.8rem !important;
  line-height: 1 !important;
}

body > section:not(.hero) .card-title {
  font-size: 0.85rem !important;
  margin-bottom: 6px !important;
}

body > section:not(.hero) .card-tag {
  margin-bottom: 3px !important;
}

body > section:not(.hero) .card-sub {
  font-size: 0.7rem !important;
}

body > section:not(.hero) .stat-row {
  padding: 5px 0 !important;
  font-size: 0.78rem !important;
}

/* Grids más compactos */
body > section:not(.hero) .grid-2,
body > section:not(.hero) .grid-3,
body > section:not(.hero) .grid-4 {
  gap: 10px !important;
}

/* Shot map cabe en pantalla */
body > section:not(.hero) .shotmap-layout {
  gap: 10px !important;
}

body > section:not(.hero) #pitch-canvas {
  max-height: calc(100vh - 220px) !important;
  height: auto !important;
}

body > section:not(.hero) .pitch-wrap {
  padding: 10px !important;
}

body > section:not(.hero) .pitch-controls {
  margin-bottom: 8px !important;
}

/* Charts más bajos */
body > section:not(.hero) .chart-wrap canvas {
  max-height: 180px !important;
}

/* Comparación: canvas con maintainAspectRatio:false necesita height explícita */
#comparacion .chart-wrap {
  height: 160px !important;
  position: relative !important;
}
#comparacion .chart-wrap canvas {
  max-height: 160px !important;
  height: 160px !important;
}

/* Tabs */
body > section:not(.hero) .tab-nav {
  margin-bottom: 12px !important;
  padding: 3px !important;
}

body > section:not(.hero) .tab-btn {
  padding: 6px 12px !important;
  font-size: 0.75rem !important;
}

/* Tab panes: que usen el espacio disponible sin desbordarse */
body > section:not(.hero) .tab-pane.active {
  overflow: hidden;
}

/* Predictor */
#predictor .container {
  justify-content: flex-start !important;
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}

#predictor .grid-2 {
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

#predictor .grid-2 > div {
  min-height: 0;
  overflow: hidden;
}

/* El predictor-card llena toda la altura de la columna izquierda */
#predictor .predictor-card {
  height: 100% !important;
  box-sizing: border-box !important;
}

body > section:not(.hero) .predictor-card {
  padding: 14px 16px !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

body > section:not(.hero) .pred-grid {
  gap: 8px !important;
  margin-bottom: 8px !important;
  flex-shrink: 0 !important;
}

body > section:not(.hero) .team-sel {
  padding: 8px 12px !important;
  font-size: 0.82rem !important;
}

body > section:not(.hero) .pred-btn {
  padding: 8px !important;
  margin-bottom: 8px !important;
  font-size: 0.8rem !important;
  flex-shrink: 0 !important;
}

/* Resultado ocupa el espacio restante sin expandir la tarjeta */
body > section:not(.hero) .pred-result {
  flex: 1 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body > section:not(.hero) .prob-bars {
  gap: 8px !important;
}

body > section:not(.hero) .prob-row {
  margin-bottom: 0 !important;
}

body > section:not(.hero) .prob-track {
  height: 9px !important;
}

body > section:not(.hero) .prob-pct {
  font-size: 0.82rem !important;
}

body > section:not(.hero) .pred-note {
  font-size: 0.62rem !important;
  margin-top: 6px !important;
}

body > section:not(.hero) #pred-verdict {
  margin-top: 8px !important;
  padding: 7px 12px !important;
  font-size: 0.78rem !important;
}

body > section:not(.hero) .hbar-row {
  margin-bottom: 4px !important;
}

body > section:not(.hero) .ctrl-btn {
  padding: 3px 10px !important;
  font-size: 0.72rem !important;
}

/* Side cards shot map */
body > section:not(.hero) .side-card {
  padding: 10px 14px !important;
}

body > section:not(.hero) .side-num {
  font-size: 1.5rem !important;
}

/* Timeline metodología */
body > section:not(.hero) .tl-item {
  margin-bottom: 16px !important;
}

body > section:not(.hero) .tl-title {
  font-size: 0.88rem !important;
}

body > section:not(.hero) .tl-desc {
  font-size: 0.75rem !important;
}

/* Section label */
body > section:not(.hero) .section-label {
  margin-bottom: 6px !important;
  font-size: 10px !important;
}

/* Info boxes */
body > section:not(.hero) .info-box {
  padding: 8px 12px !important;
  font-size: 0.75rem !important;
}

/* Chips */
body > section:not(.hero) .chips {
  margin-top: 5px !important;
  gap: 4px !important;
}



/* ══ TOQUE DE FÚTBOL ═════════════════════════════════════════════ */

/* Fondo de campo SVG sutil en todas las secciones */
body > section:not(.hero)::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='600' viewBox='0 0 900 600'%3E%3Crect width='900' height='600' fill='none' stroke='%232D6A27' stroke-width='3'/%3E%3Crect x='60' y='160' width='120' height='280' fill='none' stroke='%232D6A27' stroke-width='2'/%3E%3Crect x='720' y='160' width='120' height='280' fill='none' stroke='%232D6A27' stroke-width='2'/%3E%3Crect x='60' y='215' width='45' height='170' fill='none' stroke='%232D6A27' stroke-width='1.5'/%3E%3Crect x='795' y='215' width='45' height='170' fill='none' stroke='%232D6A27' stroke-width='1.5'/%3E%3Cline x1='450' y1='0' x2='450' y2='600' stroke='%232D6A27' stroke-width='2'/%3E%3Ccircle cx='450' cy='300' r='80' fill='none' stroke='%232D6A27' stroke-width='2'/%3E%3Ccircle cx='450' cy='300' r='4' fill='%232D6A27'/%3E%3Ccircle cx='150' cy='300' r='4' fill='%232D6A27'/%3E%3Ccircle cx='750' cy='300' r='4' fill='%232D6A27'/%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* El contenido queda por encima */
body > section:not(.hero) > .container {
  position: relative;
  z-index: 1;
}

/* Decoración de balón flotante en section-label */
body > section:not(.hero) .section-label::before {
  content: '⚽ ';
  font-size: 9px;
  opacity: 0.7;
}

/* Línea de césped debajo del título de sección */
body > section:not(.hero) .section-title::after {
  content: '';
  display: block;
  width: 36px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-gold));
  border-radius: 2px;
  margin-top: 6px;
}

/* Arco en el fondo de la sección shotmap */
#shotmap::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 220px;
  height: 220px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 220'%3E%3Cpath d='M0 220 Q110 0 220 220Z' fill='none' stroke='%232D6A27' stroke-width='4'/%3E%3Cline x1='0' y1='220' x2='220' y2='220' stroke='%232D6A27' stroke-width='3'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: bottom right;
}

/* Balón animado en la esquina del hero (complementa el video) */
.hero-ball-deco {
  position: absolute;
  font-size: 5rem;
  opacity: 0.06;
  pointer-events: none;
  z-index: 2;
  animation: ballFloat 8s ease-in-out infinite;
  user-select: none;
}
.hero-ball-deco.tl { top: 12%; left: 8%; animation-delay: 0s; }
.hero-ball-deco.br { bottom: 14%; right: 6%; animation-delay: 4s; }

@keyframes ballFloat {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50%       { transform: translateY(-18px) rotate(25deg); }
}

/* Bandas de campo alternadas muy sutiles en las secciones de datos */
#resumen::before, #eda::before {
  background-image: repeating-linear-gradient(
    180deg,
    rgba(45,106,39,0.018) 0px,
    rgba(45,106,39,0.018) 40px,
    rgba(45,106,39,0.008) 40px,
    rgba(45,106,39,0.008) 80px
  ),
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='600' viewBox='0 0 900 600'%3E%3Crect width='900' height='600' fill='none' stroke='%232D6A27' stroke-width='3'/%3E%3Crect x='60' y='160' width='120' height='280' fill='none' stroke='%232D6A27' stroke-width='2'/%3E%3Crect x='720' y='160' width='120' height='280' fill='none' stroke='%232D6A27' stroke-width='2'/%3E%3Cline x1='450' y1='0' x2='450' y2='600' stroke='%232D6A27' stroke-width='2'/%3E%3Ccircle cx='450' cy='300' r='80' fill='none' stroke='%232D6A27' stroke-width='2'/%3E%3C/svg%3E");
  background-size: auto, cover;
}

/* Marcador estilo tarjeta dorada que gira 3D */
/* Marcador estilo tarjeta dorada que gira 3D */
.winner-badge {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  gap: 12px;
  margin-top: 20px;
  padding: 24px 20px;
  background: linear-gradient(135deg, #DFB960, #B8892A);
  border: 2px solid #F0D080;
  border-radius: 12px;
  font-size: 1.5rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 30px rgba(184,137,42,0.45);
  text-shadow: 0 2px 4px rgba(0,0,0,0.25);
  transform-style: preserve-3d;
  animation: flipReveal 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes flipReveal {
  0% {
    transform: perspective(800px) rotateX(90deg) scale(0.8);
    opacity: 0;
  }
  100% {
    transform: perspective(800px) rotateX(0deg) scale(1);
    opacity: 1;
  }
}
