/* =========================
   GOOGLE FONT
========================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* =========================
   VARIABLES
========================= */
:root {
  --usa-blue: #1e3a8a;
  --canada-red: #c1121f;
  --mexico-green: #16a34a;
  --dark: #0f172a;
  --white: #ffffff;
}

/* =========================
   RESET / BASE
========================= */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background:
    linear-gradient(
      rgba(15, 23, 42, 0.85),
      rgba(15, 23, 42, 0.85)
    ),
    url("/img/estadio-bg.jpg") center / cover no-repeat fixed;
  color: #f8fafc;
}

/* =========================
   HEADER
========================= */
.app-header {
  width: 100%;
  background: var(--dark);
  color: white;
  padding: 15px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 20;
}

.app-header .logo {
  font-size: 20px;
  font-weight: 700;
}

.app-header .logo span {
  color: var(--mexico-green);
}

.app-header .user-area {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logout-btn {
  padding: 8px 14px;
  background: rgba(255,255,255,0.12);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.logout-btn:hover {
  background: rgba(255,255,255,0.2);
}

/* =========================
   PAGE CONTAINER (CENTRADO REAL)
========================= */
.page-container {
  min-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  text-align: center;
}

/* =========================
   TARJETA PRINCIPAL (APP CARD)
========================= */
.app-card {
  max-width: 420px;
  margin: 0 auto;
  padding: 40px 36px;
  border-radius: 22px;
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #f8fafc;

  box-shadow:
    0 30px 60px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.12);

  backdrop-filter: blur(14px);
  position: relative;
  z-index: 5;

  animation: cardEnter 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.app-card.wide {
  max-width: 520px;
}

.app-card h1,
.app-card h2 {
  font-weight: 700;
  margin-bottom: 10px;
}

.app-card p {
  opacity: 0.9;
  margin-bottom: 24px;
}

/* =========================
   FORMULARIOS
========================= */
.form-group {
  margin-bottom: 16px;
  text-align: left;
}

.app-card label {
  font-size: 13px;
  color: #e0e7ff;
  margin-bottom: 4px;
  display: block;
}

.app-card input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  border: none;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
}

.app-card input:focus {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(59,130,246,0.35),
    0 8px 20px rgba(0,0,0,0.15);
}

/* =========================
   BOTONES
========================= */
.primary-btn {
  width: 100%;
  height: 48px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  background: #22c55e;
  color: #0f172a;
  transition: all 0.15s ease;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.35);
}

.primary-btn:active {
  transform: translateY(0);
}

/* =========================
   MENSAJES
========================= */
.success {
  color: #22c55e;
}

.error {
  color: #f87171;
}

/* =========================
   SPINNER / LOADING
========================= */
.btn-loading {
  pointer-events: none;
  opacity: 0.85;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top: 3px solid #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =========================
   PAGO
========================= */
.pago-card {
  text-align: center;
}

.pago-info p {
  font-size: 18px;
  margin: 6px 0;
}

.pago-qr {
  margin: 24px 0;
}

.pago-qr img {
  width: 220px;
  max-width: 100%;
  border-radius: 12px;
  background: #ffffff;
  padding: 10px;
}

.pago-msg {
  margin-top: 18px;
  font-weight: 600;
}

/* =========================
   FIXTURE BLOQUEADO
========================= */
.fixture-locked {
  filter: blur(4px);
  pointer-events: none;
  opacity: 0.6;
}

.lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.lock-card {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  padding: 32px 28px;
  border-radius: 18px;
  color: #ffffff;
  text-align: center;
  max-width: 380px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}

/* =========================
   PELOTAS FLOTANTES
========================= */
.floating-balls {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.floating-balls span {
  position: absolute;
  font-size: 48px;
  opacity: 0.08;
  animation: floatBall 20s linear infinite;
}

.floating-balls span:nth-child(1) { left: 10%; animation-duration: 18s; }
.floating-balls span:nth-child(2) { left: 50%; animation-duration: 22s; }
.floating-balls span:nth-child(3) { left: 80%; animation-duration: 26s; }

@keyframes floatBall {
  from { transform: translateY(100vh) rotate(0deg); }
  to   { transform: translateY(-120vh) rotate(360deg); }
}

/* =========================
   ANIMACIÓN ENTRADA CARD
========================= */
@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
/* =========================
   UX AMBIENTAL (FONDO)
========================= */

.app-card {
  position: relative;
  z-index: 5;
  backdrop-filter: blur(14px);
}
/* =========================
   FIXTURE TABS (SOLO CSS)
========================= */

.fixture-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 24px auto 16px;
  max-width: 900px;
}

.fixture-tab {
  padding: 8px 14px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #0f172a;
  font-weight: 600;
  font-size: 13px;
  cursor: default; /* sin JS todavía */
}

.fixture-tab.active {
  background: #2563eb;
  color: #ffffff;
}

.fixture-panel {
  max-width: 900px;
  margin: 0 auto 32px;
  min-height: 120px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.22);
}
/* =========================
   FIXTURE - PARTIDOS
========================= */

.fixture-match {
  display: grid;
  grid-template-columns: 1fr 60px 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #e5e7eb;
  font-size: 14px;
}

.fixture-match:last-child {
  border-bottom: none;
}

.fixture-team {
  font-weight: 600;
}

.fixture-time {
  text-align: center;
  font-size: 12px;
  color: #475569;
}
/* Asegurar contraste en el fixture */
.fixture-panel {
  color: #0f172a;
}

.fixture-team {
  color: #0f172a;
}
.match-group {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 2px;
}
.match-datetime {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  grid-column: 1 / -1;
}
/* ===== TARJETA PARTIDO FIXTURE ===== */

.fixture-match {
  display: grid;
  grid-template-columns: 40px 1fr auto 1fr 40px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #e5e7eb;
  gap: 12px;
}

.fixture-match:last-child {
  border-bottom: none;
}

.match-group {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 4px;
}

.match-datetime {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
}

.goal-input {
  width: 36px;
  height: 32px;
  text-align: center;
  font-size: 14px;
  border: 1px solid #cbd5f5;
  border-radius: 6px;
}

.fixture-team {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.flag {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  object-fit: cover;
}

.team-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
/* =========================
   FIXTURE – COMPACTO Y CENTRADO
========================= */

.fixture-panel {
  display: flex;
  flex-direction: column;
  gap: 10px; /* menos separación entre cards */
}

.fixture-match {
  background: #ffffff;
  border-radius: 12px;
  padding: 10px 14px; /* más compacto */
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  display: grid;
  grid-template-columns: 34px 1fr auto 1fr 34px;
  align-items: center;
  column-gap: 10px;
}

/* Grupo */
.match-group {
  grid-column: 1 / -1;
  font-size: 10.5px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 4px;
  text-align: center; /* más prolijo */
}

/* Equipos */
.fixture-team {
  display: flex;
  align-items: center;
  justify-content: center; /* centra visualmente */
  gap: 6px;
  font-weight: 600;
  font-size: 13px; /* apenas más chico */
  color: #0f172a;
  white-space: nowrap;
}

.fixture-team span {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hora */
.fixture-time {
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
  text-align: center;
}

/* Inputs */
.goal-input {
  width: 32px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid #c7d2fe;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 0;
}

/* Focus */
.goal-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* Banderas */
.flag {
  width: 18px;
  height: 13px;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}
/* =========================
   CLASIFICACIÓN – ENCABEZADOS
========================= */

.groups-grid table {
  width: 100%;
  border-collapse: collapse;
}

.groups-grid thead th {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-align: center;
  padding: 6px 4px;
}

.groups-grid thead th:first-child {
  text-align: left;
}

.groups-grid tbody td {
  font-size: 13px;
  padding: 6px 4px;
  text-align: center;
}

.groups-grid tbody td:first-child {
  text-align: left;
}
/* =========================
   FIXTURE – TEXTO DE EQUIPOS
========================= */

.fixture-team {
  font-size: 14.5px;   /* antes ~13px */
}

.fixture-team span {
  font-size: 14.5px;
  font-weight: 600;
}
/* =========================
   FIXTURE – CONTRASTE Y LEGIBILIDAD
========================= */

/* Card */
.fixture-match {
  background: linear-gradient(
    180deg,
    rgba(30, 41, 59, 0.85),
    rgba(15, 23, 42, 0.85)
  );
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Texto de equipos */
.fixture-team,
.fixture-team span {
  color: #ffffff;          /* blanco real */
  font-weight: 600;
}

/* Hora */
.fixture-time {
  color: #e2e8f0;          /* gris muy claro */
}

/* Grupo */
.match-group {
  color: #cbd5f5;          /* violeta suave */
}

/* =========================
   INPUT GOLES – BLANCO DESTACADO
========================= */

.goal-input {
  background: #ffffff;              /* blanco real */
  color: #0f172a;                   /* texto oscuro */
  border: 2px solid #c7d2fe;        /* borde suave azul */
  border-radius: 8px;

  width: 34px;
  height: 32px;

  font-size: 14px;
  font-weight: 700;
  text-align: center;

  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.35);

  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.1s ease;
}

/* Hover: sensación de botón editable */
.goal-input:hover {
  border-color: #93c5fd;
}

/* Focus: MUY claro dónde se escribe */
.goal-input:focus {
  border-color: #2563eb;
  box-shadow:
    0 0 0 2px rgba(37, 99, 235, 0.45),
    0 4px 10px rgba(0, 0, 0, 0.45);
  outline: none;
  transform: scale(1.05);
}

/* Disabled (partido iniciado) */
.goal-input:disabled {
  background: #e5e7eb;
  color: #64748b;
  border-color: #cbd5e1;
  cursor: not-allowed;
  box-shadow: none;
}

/* =========================
   BOTÓN GUARDAR POR PARTIDO
========================= */

.match-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.btn-save-match {
  background: linear-gradient(180deg, #2563eb, #1e40af);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-save-match:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.55);
}

.btn-save-match:active {
  transform: translateY(0);
}
/* =========================
   PARTIDO BLOQUEADO
========================= */

.goal-input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-save-match:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.fixture-match:has(.goal-input:disabled) {
  opacity: 0.85;
}
/* =========================
   CHECK DE PRONÓSTICO GUARDADO
========================= */

.match-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.save-check {
  display: none;
  font-size: 18px;
  color: #22c55e; /* verde éxito */
}
/* =========================
   MENSAJE INLINE DE ERROR
========================= */

.save-error {
  display: none;
  font-size: 12px;
  color: #fbbf24; /* amarillo advertencia */
  font-weight: 600;
}
