@font-face {
  font-family: 'HelveticaNeueLT';
  src: url('font/Helvetica%20Neue%20LT%20Std%2045%20Light.ttf') format('truetype');
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'HelveticaNeueLT';
  src: url('font/Helvetica%20Neue%20LT%20Std%2065%20Medium.ttf') format('truetype');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'HelveticaNeueLT';
  src: url('font/Helvetica%20Neue%20LT%20Std%2075%20Bold.ttf') format('truetype');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('font/Poppins-Regular.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('font/Poppins-SemiBold.ttf') format('truetype');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('font/Poppins-Bold.ttf') format('truetype');
  font-weight: 700; font-style: normal; font-display: swap;
}

* { box-sizing: border-box; }
:root {
  --brand: #00c4b0;
  --brand-dark: #00a896;
  --ink: #f0f4ff;
  --paper: #0a0b14;
  --muted: #9ca3af;
  --line: #1e2133;
  --soft: #111827;
}
[data-theme="dark"] {
  --brand: #00c4b0;
  --brand-dark: #00a896;
  --ink: #f0f4ff;
  --paper: #0a0b14;
  --muted: #9ca3af;
  --line: #1e2133;
  --soft: #111827;
}
html, body {
  font-family: 'HelveticaNeueLT', 'Poppins', -apple-system, Segoe UI, Roboto, sans-serif;
  font-weight: 500;
  margin: 0; padding: 0;
  background: var(--paper) !important; color: var(--ink) !important;
  min-height: 100vh; width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}
main { background: var(--paper) !important; }

/* Quita el auto-link / auto-color del navegador en móvil sobre texto plano */
a[x-apple-data-detectors],
a[x-apple-data-detectors] *,
.muted, .reglas-list, .auth-foot { color: inherit; }
.muted { color: var(--muted) !important; }
.auth-foot { color: var(--muted) !important; }
header {
  background: var(--paper);
  padding: 1rem 2rem; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  border-bottom: 3px solid var(--brand);
}
header h1 { margin: 0; font-size: 1.4rem; display: flex; align-items: center; gap: .6rem; color: var(--ink); }
header h1 .logo { height: 70px; width: auto; display: block; }
header nav { color: var(--ink); }
header nav a { color: var(--ink); margin-left: 1rem; text-decoration: none; font-weight: 700; }
header nav a:hover { color: var(--brand); }
main { max-width: 1100px; margin: 2rem auto; padding: 0 1rem; }
.banner-portada { width: 100%; background: #0a0b14; }
.banner-portada img {
  width: 100%; height: auto; display: block;
  /* Difuminado: el borde inferior se funde con el fondo oscuro de la página */
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
}
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 1.5rem;
  margin-bottom: 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,.06); overflow: visible;
}
h1, h2, h3 { font-family: 'HelveticaNeueLT', 'Poppins', sans-serif; font-weight: 700; }
h2 { margin-top: 0; color: var(--ink); }
h3 { color: var(--brand); }
button, .btn { font-family: 'HelveticaNeueLT', 'Poppins', sans-serif; font-weight: 700; }
input, select { font-family: 'HelveticaNeueLT', 'Poppins', sans-serif; }
form label { display: block; margin: .5rem 0 .25rem; font-size: .9rem; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local], select {
  width: 100%; padding: .5rem; border: 1px solid var(--line);
  background: var(--paper); color: var(--ink); border-radius: 8px;
}
input[type=number] { width: 70px; text-align: center; }
input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(21,112,239,.18); }
button, .btn {
  background: var(--brand); color: var(--paper); border: 0; padding: .6rem 1.2rem;
  border-radius: 8px; font-weight: 700; cursor: pointer; text-decoration: none;
  display: inline-block; margin-top: .5rem;
}
button:hover { background: var(--brand-dark); }
table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
th, td { padding: .6rem; text-align: left; border-bottom: 1px solid var(--line); }
th { background: var(--soft); color: var(--ink); }
tr:hover { background: var(--soft); }
.fila-yo { background: var(--soft); font-weight: 700; }
.fila-yo td { color: var(--ink); }

/* Selector de campeón con banderas */
.campeon-picker { position: relative; flex: 1; min-width: 240px; }
.cp-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  background: var(--paper); color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; padding: .55rem .75rem; font-weight: 600; margin: 0; cursor: pointer;
}
.cp-toggle:hover { background: var(--soft); }
.cp-toggle .flag-img { width: 26px; height: 17px; }
.cp-list {
  position: absolute; z-index: 50; top: calc(100% + 4px); left: 0; right: 0;
  max-height: 320px; overflow-y: auto; background: var(--paper);
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0,0,0,.18); padding: .25rem;
}
.cp-group { font-size: .72rem; font-weight: 700; color: var(--muted); padding: .5rem .6rem .2rem; text-transform: uppercase; letter-spacing: .05em; }
.cp-item {
  display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left;
  background: none; color: var(--ink); border: 0; padding: .45rem .6rem;
  border-radius: 8px; cursor: pointer; font-weight: 600; margin: 0;
}
.cp-item:hover { background: var(--soft); color: var(--ink); }
.cp-item .flag-img { width: 28px; height: 19px; }
.campeon-elegido { display: flex; align-items: center; gap: .6rem; font-size: 1.1rem; }
.campeon-elegido .flag-img { width: 36px; height: 24px; }

/* Tabla del ranking */
.tabla-ranking .col-num { text-align: center; white-space: nowrap; width: 1%; }
.tabla-ranking .col-nombre { word-break: break-word; }
.tabla-ranking td.col-num:first-child { font-size: 1.1rem; }

@media (max-width: 520px) {
  .tabla-ranking { margin-top: .5rem; font-size: .85rem; }
  .tabla-ranking th, .tabla-ranking td { padding: .5rem .4rem; }
  .tabla-ranking th { font-size: .7rem; text-transform: uppercase; letter-spacing: .03em; }
  .tabla-ranking .col-nombre { line-height: 1.25; }
  .tabla-ranking td.col-num:first-child { font-size: 1rem; }
  .pag-btn { padding: .35rem .65rem; font-size: .8rem; }
}

/* Paginación del ranking */
.paginacion { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin-top: 1.25rem; }
.pag-btn {
  display: inline-block; padding: .45rem .85rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  font-weight: 700; text-decoration: none; font-size: .9rem;
}
a.pag-btn:hover { background: var(--soft); color: var(--brand); }
.pag-actual { background: var(--brand); color: var(--paper); border-color: var(--brand); }
.partido { display: grid; grid-template-columns: 1fr 80px 1fr; align-items: center; gap: .5rem; padding: .75rem; border-bottom: 1px solid var(--line); }
.partido .equipo { font-weight: 700; color: var(--ink); }
.partido .equipo.local { text-align: right; }
.partido .marcador { display: flex; gap: .25rem; align-items: center; justify-content: center; }
.partido .info { grid-column: 1 / -1; font-size: .8rem; color: var(--muted); }
.cerrado { opacity: .55; }
.badge { display: inline-block; padding: .2rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--brand); color: var(--paper); }
.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; padding: .75rem; border-radius: 8px; margin-bottom: 1rem; }
.ok { background: var(--soft); color: var(--brand-dark); border: 1px solid var(--brand); padding: .75rem; border-radius: 8px; margin-bottom: 1rem; }
.muted { color: var(--muted); font-size: .85rem; }
.reglas { background: var(--soft); padding: 1rem; border-radius: 8px; border: 1px solid var(--line); }
.reglas li { margin: .25rem 0; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
.flag { font-size: 1.4rem; vertical-align: middle; }
.admin-tag { font-size: .85rem; font-weight: 700; background: var(--brand); color: var(--paper); padding: .2rem .6rem; border-radius: 999px; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 1rem; }
.modal[hidden] { display: none; }
.modal-card { background: var(--paper); border-radius: 14px; padding: 1.75rem; max-width: 440px; width: 100%; box-shadow: 0 20px 40px rgba(0,0,0,.25); animation: pop .15s ease-out; }
.modal-card h3 { margin: 0 0 .75rem; color: var(--ink); font-size: 1.25rem; }
.modal-card p { margin: .5rem 0; line-height: 1.4; }
.modal-actions { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1.5rem; }

/* Modal con borde neón azul giratorio (mismo look que las tarjetas .match-glow) */
.modal-card.modal-glow {
  position: relative; overflow: hidden; z-index: 0;
  background: transparent; border: 1px solid transparent;
  box-shadow: 0 20px 40px rgba(0,0,0,.35), 0 8px 30px rgba(29,78,216,.3);
}
.modal-card.modal-glow::before {
  content: ''; position: absolute; z-index: -2;
  top: 50%; left: 50%; width: 210%; height: 210%;
  transform: translate(-50%, -50%);
  background: conic-gradient(from 0deg,
    #182238 0deg, #1d4ed8 55deg, #3b82f6 80deg, #22d3ee 100deg,
    #182238 165deg, #182238 360deg);
  animation: rotate-glow 7s linear infinite;
}
.modal-card.modal-glow::after {
  content: ''; position: absolute; z-index: -1; inset: 2px;
  border-radius: 12px;
  background:
    radial-gradient(at 0% 70%, hsla(221,83%,53%,.35) 0, transparent 55%),
    radial-gradient(at 100% 100%, hsla(190,90%,50%,.30) 0, transparent 55%),
    radial-gradient(at 50% 0%, hsla(224,64%,33%,.28) 0, transparent 60%),
    #0a0b14;
}
.modal-card.modal-glow h3 { color: #eaf1ff; }
.modal-card.modal-glow p  { color: #c7d2e5; }
.btn-cancel { background: var(--soft); color: var(--ink); border: 1px solid var(--line); padding: .6rem 1.2rem; border-radius: 8px; font-weight: 700; cursor: pointer; }
.btn-cancel:hover { background: var(--line); }
.btn-danger { background: #dc2626; color: var(--paper); border: 0; padding: .6rem 1.2rem; border-radius: 8px; font-weight: 700; cursor: pointer; }
.btn-danger:hover { background: #b91c1c; }
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Tarjeta de foto */
.foto-card {
  display: flex; align-items: center; gap: 1rem;
  text-decoration: none; color: var(--ink) !important;
  cursor: pointer;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: var(--paper) !important; padding: 1.25rem;
  border: 0;
  transition: transform .15s, box-shadow .15s;
}
.foto-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(21,112,239,.3); }
.foto-card .muted { color: rgba(255,255,255,.85) !important; }
.foto-icon { font-size: 2rem; flex-shrink: 0; background: rgba(255,255,255,.18); width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.foto-title { font-size: 1.05rem; font-weight: 700; color: var(--paper); }
.foto-arrow { margin-left: auto; font-size: 1.5rem; font-weight: 700; opacity: .85; }

/* Pantalla de login / registro */
.auth-wrap { max-width: 460px; width: 100%; margin: 2rem auto; padding: 0 1rem; }
.auth-card { padding: 2rem; overflow: visible; }
.auth-head { text-align: center; margin-bottom: 1.5rem; }
.auth-head h2 { color: var(--ink); margin-bottom: .25rem; font-size: 1.5rem; }
.auth-form label { display: block; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 1rem; }
.auth-form input { width: 100%; padding: .75rem .9rem; font-size: 1rem; }
.btn-block { width: 100%; padding: .85rem; font-size: 1rem; margin-top: 1.5rem; }
.auth-foot { text-align: center; margin-top: 1.5rem; color: var(--muted); font-size: .9rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.auth-foot a { font-weight: 700; }

/* Mobile: auth fill width */
@media (max-width: 520px) {
  /* Encabezado en columna: logo arriba, menú centrado abajo */
  header { flex-direction: column; gap: .5rem; padding: .6rem .75rem .55rem; }
  header h1 .logo { height: 44px; }
  header nav { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .3rem 1rem; }
  header nav a { margin-left: 0; font-size: .85rem; white-space: nowrap; }
  .theme-toggle { margin-left: 0; padding: .25rem .6rem; font-size: .9rem; }
  .card { padding: 1rem; }
  .auth-wrap { margin: 1rem auto; padding: 0 .75rem; max-width: 100%; }
  .auth-card { padding: 1.25rem; }
  .auth-head h2 { font-size: 1.25rem; }
  .reglas-card { padding: 1.25rem; }
  .reglas-list li { padding: .6rem 0; gap: .75rem; }
  .pts { width: 38px; height: 38px; font-size: 1rem; }
  main { margin: 1rem auto; }
}

/* Reglas */
.reglas-card { padding: 1.75rem; }
.reglas-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.reglas-list li { display: flex; align-items: center; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.reglas-list li:last-child { border-bottom: 0; }
.pts { flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem; color: var(--paper); }
.pts-5 { background: var(--brand); }
.pts-3 { background: #0f56b9; }
.pts-2 { background: #4b9aff; }
.pts-0 { background: #9ca3af; }
.pts-10 { background: #e63946; }
.reglas-intro { margin: .75rem 0 .4rem; font-size: .95rem; color: var(--muted); }
.pronosticos-list { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .4rem; }
.pronosticos-list li { font-size: .97rem; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.pronosticos-list li:last-child { border-bottom: 0; }

/* Banderas reales */
.flag-img { width: 36px; height: 24px; object-fit: cover; border-radius: 3px; box-shadow: 0 1px 3px rgba(0,0,0,.18); display: inline-block; vertical-align: middle; }
.td-partido { white-space: nowrap; }
.td-partido .flag-img { width: 28px; height: 19px; margin: 0 .25rem; }
.flag-placeholder { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 24px; background: var(--soft); border-radius: 3px; font-size: 1rem; }

/* Resumen del usuario */
.user-summary { display: flex; justify-content: space-between; align-items: center; background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%); color: var(--paper); border-radius: 12px; padding: 1.25rem 1.75rem; margin-bottom: 1.5rem; box-shadow: 0 4px 14px rgba(21,112,239,.25); }
.user-hello { font-size: 1.2rem; }
.user-summary,
.user-summary * { color: #ffffff !important; }
.user-summary .muted { color: rgba(255,255,255,.9) !important; }
.user-stats { text-align: right; }
.stat-num { font-size: 2.5rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .7rem; letter-spacing: .15em; opacity: .85; margin-top: .25rem; }

/* Título de fase */
.fase-title { margin: 2rem 0 1rem; padding-bottom: .5rem; border-bottom: 2px solid var(--brand); color: var(--ink); font-size: 1.3rem; }

/* Tarjeta de partido */
.match-card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.25rem; margin-bottom: .85rem; transition: box-shadow .2s, transform .1s; }
.match-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.match-card.cerrado { background: var(--soft); }
.match-card.jugado { background: linear-gradient(0deg, rgba(21,112,239,.04), rgba(21,112,239,.04)), var(--paper); border-color: var(--brand); }

.match-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .8rem; color: var(--muted); margin-bottom: .75rem; padding-bottom: .75rem; border-bottom: 1px dashed var(--line); }
.match-meta { flex: 1; min-width: 200px; }
.chip { display: inline-block; padding: .2rem .65rem; border-radius: 999px; font-size: .7rem; font-weight: 700; background: var(--soft); color: var(--brand-dark); border: 1px solid var(--line); text-transform: uppercase; letter-spacing: .05em; }
.chip-success { background: var(--brand); color: var(--paper); border-color: var(--brand); }
.chip-warn { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.chip-open { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.chip-cierre { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }

.match-body { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; }
.team { display: flex; align-items: center; gap: .75rem; }
.team-local { justify-content: flex-end; text-align: right; }
.team-visita { justify-content: flex-start; }
.team-name { font-size: 1.05rem; font-weight: 700; color: var(--ink); }

.score-box { display: flex; align-items: center; gap: .6rem; background: var(--soft); padding: .5rem .75rem; border-radius: 10px; border: 1px solid var(--line); }
.score-side { display: flex; flex-direction: column; align-items: center; gap: .2rem; }
.score-side input { width: 50px; padding: .4rem; font-size: 1.2rem; font-weight: 700; text-align: center; border: 1px solid var(--line); background: var(--paper); border-radius: 6px; }
.score-side input:disabled { background: var(--soft); color: var(--muted); cursor: not-allowed; }
.score-label { font-size: .65rem; font-weight: 700; letter-spacing: .08em; color: var(--brand-dark); background: var(--paper); padding: .1rem .35rem; border-radius: 4px; border: 1px solid var(--line); min-width: 38px; text-align: center; }
.score-sep { font-size: .8rem; color: var(--muted); font-weight: 700; align-self: center; }

.match-foot { margin-top: .75rem; padding-top: .5rem; border-top: 1px dashed var(--line); font-size: .85rem; color: var(--muted); text-align: center; }

/* Campos extra de pronóstico (primer anotador, minuto, MVP) */
.pronostico-extras { display: flex; flex-direction: column; gap: .9rem; margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.pron-field { display: flex; flex-direction: column; gap: .4rem; }
.pron-label { font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: .4rem; }
.pts-badge { background: var(--brand); color: #000; font-size: .72rem; font-weight: 700; padding: .1rem .45rem; border-radius: 999px; }
.pron-opciones-equipo { display: flex; gap: .6rem; flex-wrap: wrap; }
.pron-opcion { display: flex; align-items: center; gap: .4rem; padding: .45rem .8rem; border: 2px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 600; font-size: .9rem; transition: border-color .15s, background .15s; }
.pron-opcion input[type=radio] { display: none; }
.pron-opcion:has(input:checked), .pron-opcion.selected { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 15%, transparent); }
.pron-opcion:hover { border-color: var(--brand); }
.input-minuto { width: 100px; text-align: center; font-size: 1.1rem; font-weight: 700; }

/* Botón guardar fijo abajo (móvil y desktop) */
.sticky-save {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--paper); padding: .85rem 1.25rem;
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(0,0,0,.1);
  z-index: 100;
  display: flex; justify-content: center; align-items: center;
}
.sticky-save .btn-block {
  display: block;
  margin: 0; max-width: 420px; width: 100%;
}
/* Espacio al final para que el botón fijo no tape el último partido */
form#forma-pronosticos { padding-bottom: 6rem; }

/* Responsivo */
@media (max-width: 640px) {
  .user-summary { flex-direction: column; gap: 1rem; text-align: center; padding: 1rem; }
  .user-stats { text-align: center; }
  .stat-num { font-size: 2rem; }

  .match-card { padding: .75rem; margin-bottom: .6rem; }
  .match-head { font-size: .7rem; gap: .35rem; margin-bottom: .5rem; padding-bottom: .5rem; }
  .match-meta { min-width: 0; flex-basis: 100%; }
  .chip { padding: .15rem .5rem; font-size: .65rem; }

  /* Apilado vertical en móvil: equipo arriba, vs en medio, equipo abajo */
  .match-body { grid-template-columns: 1fr; gap: .5rem; text-align: center; }
  .team { justify-content: center; min-width: 0; }
  .team-local, .team-visita { justify-content: center; text-align: center; }
  .team-name { font-size: 1rem; line-height: 1.2; white-space: normal; word-break: break-word; }
  .flag-img { width: 32px; height: 22px; flex-shrink: 0; }

  .score-box { padding: .5rem .75rem; gap: .5rem; justify-content: center; }
  .score-side input { width: 56px; padding: .45rem; font-size: 1.2rem; }
  .score-label { font-size: .7rem; min-width: 42px; padding: .15rem .4rem; }
  .score-sep { font-size: .75rem; }

  .fase-title { font-size: 1.1rem; margin: 1.25rem 0 .75rem; }
  .sticky-save { padding: .75rem; bottom: .5rem; }
}

@media (max-width: 380px) {
  .team-name { font-size: .9rem; }
  .flag-img { width: 28px; height: 19px; }
}


/* Banner institucional */
.banner-wrap { max-width: 1100px; margin: 1.25rem auto 0; padding: 0 1rem; }
.banner-img { display: block; width: 100%; height: auto; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
@media (max-width: 520px) {
  .banner-wrap { margin-top: .75rem; padding: 0 .75rem; }
  .banner-img { border-radius: 8px; }
}

/* Dark mode toggle */
.theme-toggle {
  background: var(--soft); border: 1px solid var(--line); color: var(--ink);
  border-radius: 999px; padding: .35rem .75rem; font-size: 1rem;
  cursor: pointer; margin-left: 1rem; display: inline-flex; align-items: center;
  transition: background .2s;
}
.theme-toggle:hover { background: var(--line); }

/* ===== Botones del menú con borde de gradiente animado (estilo Uiverse) ===== */
header nav { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
header nav a.nav-btn {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  padding: .6rem 1.3rem; margin-left: 0;
  border-radius: 14px; background: #111215;
  color: #fff !important; font-weight: 700; text-decoration: none;
  line-height: 1; white-space: nowrap; transition: box-shadow .3s, transform .15s;
}
/* Capa del gradiente que gira (se ve como borde luminoso) */
header nav a.nav-btn::before {
  content: ''; position: absolute; z-index: -2; inset: -150%;
  background: conic-gradient(from 0deg,
    #4fff5d 0deg, transparent 60deg, #397bff 140deg, transparent 220deg,
    #22e710 300deg, #4fff5d 360deg);
  opacity: .55; animation: nav-spin 6s linear infinite;
  animation-play-state: paused; transition: opacity .3s;
}
/* Máscara interior: deja ver solo un borde de 2px del gradiente */
header nav a.nav-btn::after {
  content: ''; position: absolute; z-index: -1; inset: 2px;
  border-radius: 12px; background: #111215;
}
header nav a.nav-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(79,255,93,.30), 0 0 30px rgba(57,123,255,.20);
}
header nav a.nav-btn:hover::before { opacity: 1; animation-play-state: running; }
/* La página actual mantiene el borde encendido y girando */
header nav a.nav-btn.nav-activo::before { opacity: 1; animation-play-state: running; }
@keyframes nav-spin { to { transform: rotate(1turn); } }

@media (max-width: 640px) {
  header nav a.nav-btn { padding: .45rem .8rem; font-size: .82rem; border-radius: 11px; }
  header nav a.nav-btn::after { border-radius: 9px; }
}

/* Botón con borde de gradiente animado (mismo efecto que el menú), reutilizable */
.btn-glow {
  position: relative; isolation: isolate; overflow: hidden;
  background: #111215 !important; color: #fff !important; border: none;
  border-radius: 12px; transition: box-shadow .3s, transform .15s;
}
.btn-glow::before {
  content: ''; position: absolute; z-index: -2; inset: -150%;
  background: conic-gradient(from 0deg,
    #4fff5d 0deg, transparent 60deg, #397bff 140deg, transparent 220deg,
    #22e710 300deg, #4fff5d 360deg);
  animation: nav-spin 6s linear infinite;
}
.btn-glow::after {
  content: ''; position: absolute; z-index: -1; inset: 3px;
  border-radius: 9px; background: #111215;
}
.btn-glow:hover {
  background: #111215 !important; transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(79,255,93,.35), 0 0 34px rgba(57,123,255,.25);
}
/* En el botón fijo de guardar, el resplandor reemplaza a la sombra turquesa previa */
.sticky-save .btn-glow { box-shadow: 0 0 16px rgba(79,255,93,.25), 0 0 28px rgba(57,123,255,.18); }

/* Resumen del usuario: un poco más de presencia y un trofeo de fondo */
.user-summary { position: relative; overflow: hidden; }
.user-summary::after {
  content: '🏆'; position: absolute; right: 1.25rem; bottom: -.75rem;
  font-size: 5.5rem; opacity: .12; transform: rotate(-12deg); pointer-events: none;
}
.stat-num { text-shadow: 0 2px 8px rgba(0,0,0,.18); }

/* Título de fase con acento a la izquierda en vez de solo subrayado */
.fase-title {
  display: flex; align-items: center; gap: .6rem;
  border-bottom: none; padding: .1rem 0 .1rem .9rem; margin: 2rem 0 1rem;
  border-left: 4px solid var(--brand); font-size: 1.35rem; letter-spacing: .01em;
}

/* Tarjeta de partido: sombra y elevación más suaves y modernas */
.match-card {
  position: relative; border-radius: 14px; padding: 1.1rem 1.35rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.match-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.30); transform: translateY(-2px); }

/* Partido ya jugado: barra de acento a la izquierda para distinguirlo de un vistazo */
.match-card.jugado { border-color: var(--brand); }
.match-card.jugado::before {
  content: ''; position: absolute; left: 0; top: 14px; bottom: 14px;
  width: 4px; background: var(--brand); border-radius: 0 3px 3px 0;
}
/* Partido cerrado esperando resultado: acento ámbar */
.match-card.cerrado::before {
  content: ''; position: absolute; left: 0; top: 14px; bottom: 14px;
  width: 4px; background: #f59e0b; border-radius: 0 3px 3px 0; opacity: .5;
}

/* Caja del marcador con un halo sutil al enfocar un input */
.score-box { transition: border-color .15s, box-shadow .15s; }
.score-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,196,176,.15); }
.score-side input { transition: border-color .15s; }
.score-side input:focus { border-color: var(--brand); }

/* Bloque de campos extra con fondo tenue para separarlo del marcador */
.pronostico-extras {
  background: var(--soft); border-radius: 10px;
  padding: 1rem 1.1rem; margin-top: 1rem; border-top: none;
}
.pron-opcion { background: var(--paper); }

/* Pie del partido jugado: resaltar los puntos ganados */
.match-foot strong:last-of-type { color: var(--brand); }

/* Botón de guardar fijo: un poco más destacado */
.sticky-save .btn-block { box-shadow: 0 4px 14px rgba(0,196,176,.35); font-size: 1.05rem; }

@media (max-width: 640px) {
  .fase-title { font-size: 1.15rem; padding-left: .7rem; }
  .user-summary::after { font-size: 4rem; right: .5rem; }
  .pronostico-extras { padding: .85rem; }
}

/* ===== Refinamiento de la tarjeta de partido ===== */
.match-card { padding: 1.35rem 1.5rem; }

/* El enfrentamiento se centra como un bloque compacto (menos hueco a los lados) */
.match-body { max-width: 560px; margin: 0 auto; gap: 1.25rem; }
.match-body .flag-img { width: 46px; height: 31px; border-radius: 4px; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.team { gap: .85rem; }
.team-name { font-size: 1.15rem; letter-spacing: .01em; }

/* Marcador más grande y presente: casillas cuadradas */
.score-box { padding: .55rem .85rem; gap: .8rem; border-radius: 14px; }
.score-side { gap: .35rem; }
.score-side input { width: 58px; height: 54px; font-size: 1.6rem; border-radius: 10px; }
.score-sep { font-size: .85rem; opacity: .6; letter-spacing: .1em; }

/* Campos extra: título y separación más claros */
.pronostico-extras { gap: 1.1rem; padding: 1.15rem 1.25rem; border: 1px solid var(--line); }
.pron-label { font-size: .9rem; font-weight: 600; color: var(--ink); }

/* "Primer equipo en anotar": dos columnas iguales, más parejo y limpio */
.pron-opciones-equipo { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.pron-opcion { justify-content: center; padding: .65rem .75rem; font-size: .95rem; }

@media (max-width: 640px) {
  .match-card { padding: 1rem; }
  .match-body { gap: .55rem; }
  .score-side input { width: 54px; height: 50px; font-size: 1.4rem; }
  .team-name { font-size: 1rem; }
}

/* ===== Tarjeta con borde azul giratorio (estilo Uiverse, en azul) ===== */
.match-card.match-glow {
  position: relative; overflow: hidden; z-index: 0;
  background: transparent; border: 1px solid transparent;
  box-shadow: 0 8px 30px rgba(29,78,216,.18);
}
/* Haz de luz azul que gira y forma el borde */
.match-card.match-glow::before {
  content: ''; position: absolute; z-index: -2;
  top: 50%; left: 50%; width: 210%; height: 210%;
  transform: translate(-50%, -50%);
  background: conic-gradient(from 0deg,
    #182238 0deg, #1d4ed8 55deg, #3b82f6 80deg, #22d3ee 100deg,
    #182238 165deg, #182238 360deg);
  animation: rotate-glow 7s linear infinite;
}
/* Superficie interior oscura con destellos azules (deja ver el borde de 2px) */
.match-card.match-glow::after {
  content: ''; position: absolute; z-index: -1; inset: 2px;
  border-radius: 12px;
  background:
    radial-gradient(at 0% 70%, hsla(221,83%,53%,.35) 0, transparent 55%),
    radial-gradient(at 100% 100%, hsla(190,90%,50%,.30) 0, transparent 55%),
    radial-gradient(at 50% 0%, hsla(224,64%,33%,.28) 0, transparent 60%),
    #0a0b14;
}
@keyframes rotate-glow { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* Tarjeta azul reutilizable: interior oscuro con destellos azules y borde
   azul estático (mismo estilo que el recuadro de puntos y la tarjeta del partido). */
.card.card-azul {
  border: none; border-radius: 14px;
  background: transparent;
  box-shadow: none;
}

/* Botón con borde de gradiente animado y resplandor (estilo Uiverse, en azul) */
.btn-neon {
  position: relative; z-index: 0;
  background: linear-gradient(0deg, #000, #272727) !important;
  color: #fff !important; border: none; border-radius: 10px;
  cursor: pointer; font-weight: 700;
}
.btn-neon::before, .btn-neon::after {
  content: ''; position: absolute; left: -2px; top: -2px; z-index: -1;
  width: calc(100% + 4px); height: calc(100% + 4px);
  border-radius: 10px;
  background: linear-gradient(45deg,
    #1d4ed8, #22d3ee, #3b82f6, #0ea5e9, #38bdf8, #2563eb,
    #1d4ed8, #22d3ee, #3b82f6, #0ea5e9);
  background-size: 400%;
  animation: steam-azul 20s linear infinite;
}
.btn-neon::after { filter: blur(22px); }
.btn-neon:hover { background: linear-gradient(0deg, #000, #272727) !important; }
@keyframes steam-azul {
  0%   { background-position: 0 0; }
  50%  { background-position: 400% 0; }
  100% { background-position: 0 0; }
}

/* Botón verde animado (Trivia) */
.btn-neon-verde {
  position: relative; z-index: 0;
  background: linear-gradient(0deg, #000, #272727) !important;
  color: #fff !important; border: none; border-radius: 10px;
  cursor: pointer; font-weight: 700;
}
.btn-neon-verde::before, .btn-neon-verde::after {
  content: ''; position: absolute; left: -2px; top: -2px; z-index: -1;
  width: calc(100% + 4px); height: calc(100% + 4px);
  border-radius: 10px;
  background: linear-gradient(45deg,
    #16a34a, #4ade80, #22c55e, #86efac, #15803d,
    #16a34a, #4ade80, #22c55e, #86efac, #15803d);
  background-size: 400%;
  animation: steam-verde 20s linear infinite;
}
.btn-neon-verde::after { filter: blur(22px); }
.btn-neon-verde:hover { background: linear-gradient(0deg, #000, #272727) !important; }
@keyframes steam-verde {
  0%   { background-position: 0 0; }
  50%  { background-position: 400% 0; }
  100% { background-position: 0 0; }
}

/* Círculos de puntos con anillo de gradiente turquesa (marca) animado */
.reglas-list .pts { position: relative; z-index: 0; }
.reglas-list .pts::before, .reglas-list .pts::after {
  content: ''; position: absolute; inset: -3px; z-index: -1;
  border-radius: 50%;
  background: linear-gradient(45deg,
    #00c4b0, #14e0c0, #2dd4bf, #22d3ee, #0d9488, #00a896, #00c4b0, #14e0c0);
  background-size: 400%;
  animation: steam-azul 20s linear infinite;
}
.reglas-list .pts::after { filter: blur(9px); }

/* Contenedor de pronósticos sin marco: la tarjeta del partido queda suelta */
.card.card-sin-marco {
  background: transparent; border: none; box-shadow: none;
  padding: 0; margin-bottom: 0;
}

/* MVP por equipo: un desplegable separado para cada selección */
.mvp-split { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.mvp-col { display: flex; flex-direction: column; gap: .35rem; }
.mvp-team { display: flex; align-items: center; gap: .45rem; font-size: .9rem; font-weight: 700; color: var(--ink); }
.mvp-team .flag-img { width: 26px; height: 17px; }
.mvp-select { width: 100%; }

/* Resumen del MVP elegido (arriba del selector) */
.mvp-resumen {
  border: 1px dashed var(--line, rgba(128,128,128,.35));
  border-radius: 12px; padding: .55rem .7rem; margin-bottom: .7rem;
}
.mvp-resumen .mvp-resumen-vacio { color: var(--muted, #888); font-size: .85rem; }
.mvp-resumen .mvp-resumen-pick { display: none; align-items: center; gap: .7rem; }
.mvp-resumen.tiene { border-style: solid; border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, transparent); }
.mvp-resumen.tiene .mvp-resumen-vacio { display: none; }
.mvp-resumen.tiene .mvp-resumen-pick { display: flex; }
.mvp-resumen-foto {
  width: 54px; height: 54px; border-radius: 50%; object-fit: cover; object-position: top center;
  background: rgba(128,128,128,.15); flex: 0 0 auto;
}
.mvp-resumen-info { display: flex; flex-direction: column; min-width: 0; }
.mvp-resumen-nombre { font-size: 1rem; font-weight: 700; color: var(--ink); line-height: 1.2; }
.mvp-resumen-meta { font-size: .8rem; color: var(--muted, #888); }
.mvp-resumen-quitar {
  margin-left: auto; flex: 0 0 auto; cursor: pointer;
  width: 30px; height: 30px; border-radius: 50%; line-height: 1;
  border: 1px solid var(--line, rgba(128,128,128,.35)); background: transparent;
  color: var(--ink); font-size: .85rem; transition: background .15s, border-color .15s;
}
.mvp-resumen-quitar:hover { border-color: #e11d48; color: #e11d48; }

/* Selector de MVP con foto: cada selección es un panel colapsable (details) */
.mvp-col {
  border: 1px solid var(--line, rgba(128,128,128,.3));
  border-radius: 12px; overflow: hidden; align-self: start;
}
.mvp-col > summary.mvp-team {
  list-style: none; cursor: pointer; -webkit-user-select: none; user-select: none;
  display: flex; align-items: center; gap: .45rem;
  padding: .6rem .75rem; font-size: .95rem; font-weight: 700; color: var(--ink);
}
.mvp-col > summary.mvp-team::-webkit-details-marker { display: none; }
.mvp-col > summary.mvp-team::after {
  content: '▾'; margin-left: auto; font-size: .8rem; opacity: .6; transition: transform .2s;
}
.mvp-col[open] > summary.mvp-team::after { transform: rotate(180deg); }
.mvp-team .flag-img { width: 24px; height: 16px; flex: 0 0 auto; }
.mvp-team-nom { white-space: nowrap; }
.mvp-elegido {
  color: var(--brand); font-weight: 600; font-size: .82rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.mvp-count {
  margin-left: auto; flex: 0 0 auto; font-size: .72rem; font-weight: 700;
  background: rgba(128,128,128,.18); color: var(--ink);
  border-radius: 999px; padding: .05rem .5rem;
}
.mvp-elegido:not([hidden]) ~ .mvp-count { margin-left: .35rem; }

.mvp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: .55rem;
  max-height: 420px; overflow-y: auto;
  padding: .6rem; border-top: 1px solid var(--line, rgba(128,128,128,.3));
}
.mvp-card {
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  padding: .7rem .4rem; border: 1px solid var(--line, rgba(128,128,128,.3));
  border-radius: 12px; background: transparent;
  cursor: pointer; text-align: center; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.mvp-card:hover:not(:disabled) { border-color: var(--brand); transform: translateY(-2px); }
.mvp-card:disabled { cursor: default; opacity: .6; }
.mvp-card.selected { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand) inset; }
.mvp-foto {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover; object-position: top center;
  background: rgba(128,128,128,.15); flex: 0 0 auto;
}
.mvp-foto-ph { display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.mvp-nombre { font-size: .82rem; font-weight: 600; line-height: 1.2; color: var(--ink); }
.mvp-pos { font-size: .68rem; color: var(--muted, #888); }
@media (max-width: 560px) {
  .mvp-split { grid-template-columns: 1fr; gap: .7rem; }
  .mvp-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); max-height: 360px; }
  .mvp-foto { width: 62px; height: 62px; }
}

/* Recuadro de puntos: mismo estilo que la tarjeta del partido (interior oscuro
   con destellos azules) pero con borde azul ESTÁTICO, sin girar. */
.user-summary.summary-glow {
  position: relative; overflow: hidden; z-index: 0;
  border: 1.5px solid transparent; border-radius: 12px;
  background:
    radial-gradient(at 0% 70%, hsla(221,83%,53%,.35) 0, transparent 55%) padding-box,
    radial-gradient(at 100% 100%, hsla(190,90%,50%,.30) 0, transparent 55%) padding-box,
    radial-gradient(at 50% 0%, hsla(224,64%,33%,.28) 0, transparent 60%) padding-box,
    linear-gradient(#0a0b14, #0a0b14) padding-box,
    linear-gradient(120deg, #1d4ed8, #22d3ee, #3b82f6) border-box;
  box-shadow: 0 8px 30px rgba(29,78,216,.18);
}
/* Sin haz giratorio ni marca de agua: interior limpio como el cuadro de abajo */
.user-summary.summary-glow::before,
.user-summary.summary-glow::after { display: none; }

/* ===== Bracket de eliminatorias ===== */
.bracket-card { padding: 1.25rem 1.25rem 1rem; }
.bracket-summary {
  list-style: none; cursor: pointer; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem; font-weight: 800; font-size: 1.15rem;
  color: var(--ink);
}
.bracket-summary::-webkit-details-marker { display: none; }
.bracket-ico { margin-right: .35rem; }
.bracket-hint { font-size: .72rem; font-weight: 600; color: var(--muted); }
.bracket-card[open] .bracket-summary { margin-bottom: .5rem; }

.bracket-scroll {
  overflow-x: auto; padding: .5rem .25rem 1rem;
  -webkit-overflow-scrolling: touch;
}
.bracket-cols { display: inline-flex; gap: 1.25rem; min-width: 100%; }
.bracket-col { display: flex; flex-direction: column; gap: .75rem; min-width: 190px; }
.bracket-col-title {
  font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em;
  color: var(--brand); text-align: center; padding-bottom: .25rem;
  border-bottom: 2px solid var(--line);
}

.bk-match {
  border: 1px solid var(--line); border-radius: 10px; background: var(--soft);
  padding: .4rem .5rem; display: flex; flex-direction: column; gap: .25rem;
}
.bk-match.bk-jugado { border-color: var(--brand); }
.bk-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: .68rem; color: var(--muted);
}
.bk-fin { color: var(--brand); font-weight: 700; }

.bk-team {
  display: flex; align-items: center; gap: .45rem;
  padding: .2rem .15rem; border-radius: 6px;
}
.bk-team.bk-gana { background: rgba(21,112,239,.12); font-weight: 800; }
.bk-flag { width: 22px; display: inline-flex; flex: 0 0 auto; }
.bk-flag .flag-img { width: 22px; height: auto; border-radius: 2px; }
.bk-flag .flag-placeholder { color: var(--muted); }
.bk-name {
  flex: 1 1 auto; font-size: .82rem; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bk-score {
  flex: 0 0 auto; min-width: 1.1rem; text-align: center; font-weight: 800;
  color: var(--ink); font-variant-numeric: tabular-nums;
}

/* ===== Bracket en móvil ===== */
@media (max-width: 600px) {
  .bracket-card { padding: 1rem .75rem; }
  /* El área scrolleable usa todo el ancho de la tarjeta (rompe el padding) */
  .bracket-scroll {
    margin-left: -.75rem; margin-right: -.75rem;
    padding: .5rem .75rem 1rem;
    scroll-snap-type: x proximity;
  }
  .bracket-cols { gap: .75rem; }
  .bracket-col { min-width: 168px; scroll-snap-align: start; }
  .bracket-col-title { font-size: .72rem; }
  .bk-name { font-size: .78rem; }
  .bk-meta { font-size: .64rem; }
}

/* ===== Header de secciones (Predictions League / Match IQ / Crack Frame) ===== */
/* Se muestra en todas las páginas mediante nav_secciones() en config.php. */
.nav-secciones {
  display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center;
  max-width: 960px; margin: 1rem auto 0; padding: 0 1rem;
}
.nav-sec-btn {
  position: relative; isolation: isolate; overflow: hidden;
  flex: 1 1 220px; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .1rem; padding: .8rem 1rem; border-radius: 14px;
  background: #111215; color: #fff !important; text-decoration: none;
  text-align: center; line-height: 1.2;
  transition: box-shadow .3s, transform .15s;
}
.nav-sec-titulo { font-weight: 800; font-size: 1rem; }
.nav-sec-sub { font-size: .78rem; opacity: .85; font-weight: 600; }
/* Capa del gradiente que gira (borde luminoso), reutiliza la animación nav-spin */
.nav-sec-btn::before {
  content: ''; position: absolute; z-index: -2; inset: -150%;
  background: conic-gradient(from 0deg,
    #4fff5d 0deg, transparent 60deg, #397bff 140deg, transparent 220deg,
    #22e710 300deg, #4fff5d 360deg);
  opacity: .5; animation: nav-spin 6s linear infinite;
  animation-play-state: paused; transition: opacity .3s;
}
/* Máscara interior: deja ver solo un borde de 2px del gradiente */
.nav-sec-btn::after {
  content: ''; position: absolute; z-index: -1; inset: 2px;
  border-radius: 12px; background: #111215;
}
.nav-sec-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(79,255,93,.30), 0 0 30px rgba(57,123,255,.20);
}
.nav-sec-btn:hover::before,
.nav-sec-btn.activo::before { opacity: 1; animation-play-state: running; }
/* La sección actual se ve un poco más presente */
.nav-sec-btn.activo { box-shadow: 0 0 16px rgba(79,255,93,.22), 0 0 28px rgba(57,123,255,.16); }

@media (max-width: 640px) {
  .nav-secciones { gap: .5rem; }
  .nav-sec-btn { flex-basis: 100%; padding: .6rem .8rem; }
  .nav-sec-titulo { font-size: .92rem; }
  .nav-sec-sub { font-size: .72rem; }
}
