/* ═══════════════════════════════════════════════════════════════════
   MUNDIAL 2026 — Estilos cuánticos
   Paleta navy/cyan/magenta + tipografía editorial Playfair + Inter.
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --bg-deep: #0a0e27;
  --bg-mid: #14193a;
  --cyan: #00d4ff;
  --cyan-soft: #4de5ff;
  --magenta: #ff006e;
  --gold: #ffd166;
  --text: #e8eaf6;
  --text-dim: #8a92b0;
  --text-dimmer: #5a6385;
  --glass: rgba(20, 26, 60, 0.55);
  --glass-bright: rgba(28, 36, 78, 0.72);
  --border: rgba(0, 212, 255, 0.18);
  --border-hover: rgba(0, 212, 255, 0.45);
  --green: #4ade80;
  --rule: rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, #1a2150 0%, var(--bg-deep) 60%, #060919 100%);
  background-attachment: fixed;
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#tsparticles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── NAV ─────────────────────────────────────────────────────────── */
nav.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}
.logo {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.logo .atom {
  color: var(--cyan);
  font-size: 26px;
  filter: drop-shadow(0 0 12px rgba(0, 212, 255, 0.6));
  animation: glow 4s ease-in-out infinite;
}
.logo .small {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 13px;
  font-family: 'Inter';
  letter-spacing: 0.5px;
}
.nav-items {
  display: flex;
  gap: 32px;
  align-items: center;
}
.nav-items a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: color 0.2s;
  position: relative;
}
.nav-items a:hover { color: var(--cyan); }
.nav-items a.active { color: var(--text); }
.nav-items a.active::after {
  content: '';
  position: absolute;
  bottom: -22px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}
.user-chip {
  background: var(--glass);
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-chip::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

/* ─── FLASH MESSAGES ─────────────────────────────────────────────── */
.flashes { margin-top: 16px; }
.flash {
  background: rgba(255, 0, 110, 0.08);
  border: 1px solid rgba(255, 0, 110, 0.35);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 8px;
}

/* ─── HERO ───────────────────────────────────────────────────────── */
.hero { padding: 72px 0 36px; }
.hero-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--cyan);
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 500;
}
.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: 56px;
  font-weight: 700;
  line-height: 1.08;
  margin: 18px 0 14px;
  max-width: 880px;
  letter-spacing: -0.5px;
}
.hero-title em {
  font-style: italic;
  color: var(--cyan);
  text-shadow: 0 0 28px rgba(0, 212, 255, 0.35);
}
.hero-sub {
  font-size: 17px;
  color: var(--text-dim);
  max-width: 620px;
  font-weight: 300;
}

/* ─── WAVE CARD ──────────────────────────────────────────────────── */
.wave-card {
  margin-top: 44px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 26px;
  overflow: hidden;
  position: relative;
}
.wave-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: 0.5;
}
.wave-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 12px;
}
.wave-header h3 {
  font-family: 'Playfair Display';
  font-weight: 700;
  font-size: 19px;
}
.wave-legend {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono';
  align-items: center;
}
.wave-legend span { display: flex; align-items: center; gap: 6px; }
.wave-legend i { width: 10px; height: 2px; display: inline-block; }
.wave-svg {
  width: 100%;
  height: 180px;
  display: block;
}
.wave-svg path {
  fill: none;
  stroke-width: 2;
  opacity: 0.85;
  filter: drop-shadow(0 0 4px currentColor);
}
.w-bra { stroke: #ffd166; color: #ffd166; }
.w-arg { stroke: #74acdf; color: #74acdf; }
.w-fra { stroke: var(--cyan); color: var(--cyan); }
.w-esp { stroke: var(--magenta); color: var(--magenta); }
.w-eng { stroke: #ffffff; color: #ffffff; }

/* ─── PRIMARY GRID (3 cards principales) ─────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 36px;
}
.card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 26px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  overflow: hidden;
}
.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 70%;
  height: 100%;
  background: linear-gradient(115deg, transparent 30%, rgba(0, 212, 255, 0.05) 50%, transparent 70%);
  transition: left 0.7s ease;
  pointer-events: none;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(0, 212, 255, 0.12);
  border-color: var(--border-hover);
}
.card:hover::after { left: 120%; }
.card-title {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  font-weight: 600;
}
.card-info {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  transition: all 0.2s;
  font-family: 'JetBrains Mono';
}
.card-info:hover { color: var(--cyan); border-color: var(--cyan); }
.card-flag {
  font-size: 40px;
  margin: 16px 0 6px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}
.card-name {
  font-family: 'Playfair Display';
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.2px;
}
.card-value {
  font-family: 'JetBrains Mono';
  font-size: 44px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-top: 12px;
  letter-spacing: -1px;
}
.card-value .unit {
  font-size: 22px;
  color: var(--text-dim);
  font-weight: 400;
  margin-left: 2px;
}
.card-delta {
  font-family: 'JetBrains Mono';
  font-size: 13px;
  color: var(--green);
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.card-delta.down { color: var(--magenta); }
.card-ci {
  font-family: 'JetBrains Mono';
  font-size: 11px;
  color: var(--text-dimmer);
  margin-top: 6px;
  letter-spacing: 0.3px;
}

/* ─── QUINIELA LIST ──────────────────────────────────────────────── */
.quiniela-list { margin-top: 14px; }
.quiniela-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.quiniela-row:last-child { border-bottom: 0; }
.rank {
  font-family: 'JetBrains Mono';
  font-size: 14px;
  color: var(--text-dim);
  width: 18px;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--bg-deep);
}
.quiniela-name {
  flex: 1;
  font-size: 14px;
}
.quiniela-name .stars {
  color: var(--gold);
  font-size: 11px;
  margin-left: 4px;
}
.quiniela-pts {
  font-family: 'JetBrains Mono';
  font-size: 15px;
  font-weight: 500;
}

/* ─── SECONDARY GRID (mini-cards) ────────────────────────────────── */
.secondary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 24px;
}
.mini-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 22px;
}
.mini-title {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  font-weight: 600;
}
.mini-list { margin-top: 16px; }
.mini-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 14px;
}
.mini-item:last-child { border-bottom: 0; }
.mini-item .val {
  font-family: 'JetBrains Mono';
  color: var(--cyan);
  font-weight: 500;
}

/* ─── MINI ONDA EN CARDS ─────────────────────────────────────────── */
/* Va como PRIMER hijo de la card. Como las cards tienen position:relative,
   este SVG absolute queda en el fondo. Los hijos block siguientes pintan
   encima por orden natural de pintado. */
.mini-wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28px;
  width: 100%;
  pointer-events: none;
  opacity: 0.55;
}
.mini-wave path {
  fill: none;
  stroke-width: 1.6;
  filter: drop-shadow(0 0 3px currentColor);
}
@keyframes mini-flow {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-120px); }
}
.mini-wave g { animation: mini-flow 14s linear infinite; }

/* ─── TOP 10 CARD (favoritos al título) ──────────────────────────── */
.top10-card {
  margin-top: 36px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 30px;
}
.top10-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.top10-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--cyan);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 6px;
}
.top10-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.3px;
  color: var(--text);
}
.top10-info {
  font-family: 'JetBrains Mono';
  font-size: 11px;
  color: var(--text-dim);
  cursor: help;
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  letter-spacing: 1.5px;
}
.top10-info:hover {
  color: var(--cyan);
  border-color: var(--cyan);
}
.top10-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.top10-row {
  display: grid;
  grid-template-columns: 28px 44px 1fr 2fr 70px;
  gap: 14px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.2s;
}
.top10-row:last-child { border-bottom: 0; }
.top10-row:hover { background: rgba(0, 212, 255, 0.03); }
.top10-rank {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--text-dim);
  text-align: center;
  font-weight: 500;
}
.top10-shield {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}
.top10-shield img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.top10-flag { font-size: 28px; }
.top10-name {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: 17px;
  color: var(--text);
  letter-spacing: -0.2px;
}
.top10-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.top10-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.35);
  transition: width 0.6s ease;
}
.top10-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  color: var(--cyan);
  text-align: right;
  font-weight: 500;
}
.top10-pct .unit {
  font-size: 12px;
  color: var(--text-dim);
  margin-left: 1px;
}
@media (max-width: 720px) {
  .top10-row {
    grid-template-columns: 22px 32px 1fr 60px;
    gap: 10px;
  }
  .top10-bar { display: none; }
  .top10-name { font-size: 14px; }
}

/* ─── CHART CARD ─────────────────────────────────────────────────── */
.chart-card {
  margin-top: 36px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 30px;
}
.chart-card h3 {
  font-family: 'Playfair Display';
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.chart-card p {
  color: var(--text-dim);
  font-size: 13px;
  margin-top: 6px;
}
.chart-card em {
  color: var(--cyan-soft);
  font-style: italic;
}
.chart-wrap {
  margin-top: 22px;
  height: 340px;
  position: relative;
}

/* ─── FOOTER ─────────────────────────────────────────────────────── */
footer {
  margin-top: 60px;
  padding: 30px 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-dim);
  font-size: 13px;
  flex-wrap: wrap;
  gap: 12px;
}
footer strong {
  color: var(--cyan);
  font-family: 'JetBrains Mono';
  font-weight: 500;
}

/* ─── LOGIN ──────────────────────────────────────────────────────── */
.login-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  background: var(--glass-bright);
  border: 1px solid var(--border);
  border-radius: 22px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 44px 38px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 212, 255, 0.08);
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo .atom {
  display: inline-block;
  font-size: 44px;
  color: var(--cyan);
  filter: drop-shadow(0 0 18px rgba(0, 212, 255, 0.7));
  animation: glow 4s ease-in-out infinite;
}
.login-title {
  display: block;
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 28px;
  letter-spacing: 1px;
  margin-top: 10px;
}
.login-subtitle {
  font-family: 'JetBrains Mono';
  font-size: 11px;
  color: var(--cyan);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 4px;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.login-form label {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: -10px;
}
.login-form input {
  background: rgba(10, 14, 39, 0.5);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--text);
  font-family: 'Inter';
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.login-form input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}
.login-form button {
  background: linear-gradient(135deg, var(--cyan), #0099cc);
  color: var(--bg-deep);
  font-family: 'Inter';
  font-weight: 600;
  font-size: 15px;
  border: 0;
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  letter-spacing: 0.5px;
  margin-top: 8px;
  transition: transform 0.15s, box-shadow 0.2s;
}
.login-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(0, 212, 255, 0.35);
}
.login-hint {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-dimmer);
  line-height: 1.5;
}

/* ─── ANIMACIONES ────────────────────────────────────────────────── */
@keyframes glow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.4)); }
  50% { filter: drop-shadow(0 0 18px rgba(0, 212, 255, 0.8)); }
}
@keyframes wave-flow {
  0% { transform: translateX(0); }
  100% { transform: translateX(-200px); }
}
.wave-svg g { animation: wave-flow 12s linear infinite; }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero, .wave-card, .grid > *, .secondary-grid > *, .chart-card {
  animation: fade-up 0.6s ease-out backwards;
}
.wave-card { animation-delay: 0.1s; }
.grid > *:nth-child(1) { animation-delay: 0.2s; }
.grid > *:nth-child(2) { animation-delay: 0.25s; }
.grid > *:nth-child(3) { animation-delay: 0.3s; }
.secondary-grid > *:nth-child(1) { animation-delay: 0.35s; }
.secondary-grid > *:nth-child(2) { animation-delay: 0.4s; }
.secondary-grid > *:nth-child(3) { animation-delay: 0.45s; }
.chart-card { animation-delay: 0.5s; }

/* ─── RESPONSIVE ─────────────────────────────────────────────────── */
/* ─── HAMBURGUESA (mobile nav) ───────────────────────────────── */
.nav-toggle { display: none; }
.nav-burger {
  display: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  flex-direction: column;
  justify-content: space-around;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--glass);
  transition: border-color 0.2s;
}
.nav-burger:hover { border-color: var(--cyan); }
.nav-burger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

@media (max-width: 920px) {
  .grid, .secondary-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 36px; }
  .hero { padding: 48px 0 24px; }

  /* Mostrar la hamburguesa */
  .nav-burger { display: flex; }

  /* Ocultar los items por default en mobile */
  .nav-items {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(10, 14, 39, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px 16px;
    z-index: 100;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  }
  .nav-items a {
    padding: 14px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 15px;
    width: 100%;
  }
  .nav-items a:last-of-type { border-bottom: 0; }
  .nav-items a.active::after { display: none; }
  .nav-items a.active {
    color: var(--cyan);
  }
  .nav-items .user-chip {
    align-self: flex-start;
    margin-top: 8px;
  }

  /* Cuando el checkbox está checked, mostrar el menú */
  .nav-toggle:checked ~ .nav-items {
    display: flex;
  }

  /* Animación del icon */
  .nav-toggle:checked ~ .nav-burger span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .nav-toggle:checked ~ .nav-burger span:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle:checked ~ .nav-burger span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* Nav.top necesita position: relative para el menu absolute */
  nav.top { position: relative; }
}
@media (max-width: 520px) {
  .container { padding: 0 16px; }
  .hero-title { font-size: 28px; }
  .card-value { font-size: 36px; }
}
