@import './theme.css';

/* ─── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--navy);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}
img { display: block; max-width: 100%; }
a { text-decoration: none; }

/* ─── HERO — compacto en mobile para que EN VIVO quede visible ─ */
.hero {
  background: var(--navy);
  padding: calc(env(safe-area-inset-top) + 20px) 20px 28px;
  text-align: center;
  border-bottom: 4px solid var(--gold);
  position: relative;
  overflow: hidden;
}

/* Slideshow de imágenes de fondo */
.hero-imgs {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Overlay navy encima de las fotos */
.hero-imgs::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom,
      rgba(11,31,58,.90) 0%,
      rgba(11,31,58,.62) 50%,
      rgba(11,31,58,.85) 100%);
  z-index: 1;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: saturate(.65) brightness(.75);
  animation: hero-slide 15s ease-in-out infinite;
}

.hero-img:nth-child(1) { animation-delay:  0s; }
.hero-img:nth-child(2) { animation-delay:  5s; }
.hero-img:nth-child(3) { animation-delay: 10s; }

/* Cada imagen: aparece, se mantiene y desaparece. Ciclo de 15s (5s por foto) */
@keyframes hero-slide {
  0%        { opacity: 0; }
  6%        { opacity: .58; }
  28%       { opacity: .58; }
  34%       { opacity: 0; }
  100%      { opacity: 0; }
}

/* Patrón de rejilla sutil encima de las fotos */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image:
    repeating-linear-gradient(-45deg, transparent 0, transparent 28px, rgba(255,255,255,.014) 28px, rgba(255,255,255,.014) 29px);
  pointer-events: none;
}

.hero-divider { display: none; }

.hero-logo {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--white);
  object-fit: cover;
  margin: 0 auto 14px;
  position: relative; z-index: 2;
  box-shadow:
    0 0 0 3px rgba(245,197,24,.5),
    0 0 0 7px rgba(245,197,24,.15),
    0 8px 28px rgba(0,0,0,.45);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-condensed);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(245,197,24,.1);
  border: 1px solid rgba(245,197,24,.28);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
  position: relative; z-index: 2;
}

.pulse-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
  animation: copa-pulse 1.3s ease-in-out infinite;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 3.8rem;
  line-height: .88;
  color: var(--white);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 10px;
  position: relative; z-index: 2;
}
.hero-title span { color: var(--gold); }

.hero-sub {
  font-family: var(--font-condensed);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  position: relative; z-index: 2;
}

/* ─── STATS BAR ──────────────────────────────────────────── */
.stats-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--gold);
}
.stat-cell {
  text-align: center;
  padding: 13px 8px;
}
.stat-cell + .stat-cell {
  border-left: 1px solid rgba(122,94,0,.18);
}
.stat-num {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--navy);
  line-height: 1;
}
.stat-lbl {
  font-family: var(--font-condensed);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold-text);
  margin-top: 2px;
}

/* ─── MAIN / NAV ─────────────────────────────────────────── */
.main-content {
  padding: 18px 14px 24px;
  max-width: 540px;
  margin: 0 auto;
}

.section-label {
  display: block;
  font-family: var(--font-condensed);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 11px;
}

.nav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ─── NAV CARD BASE ──────────────────────────────────────── */
.nav-card {
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 160ms var(--ease-spring), box-shadow 160ms var(--ease);
  position: relative;
}
.nav-card:active { transform: scale(.96) !important; }

.nav-card:nth-child(1) { animation: card-in .45s var(--ease-spring) .04s both; }
.nav-card:nth-child(2) { animation: card-in .45s var(--ease-spring) .10s both; }
.nav-card:nth-child(3) { animation: card-in .45s var(--ease-spring) .15s both; }
.nav-card:nth-child(4) { animation: card-in .45s var(--ease-spring) .20s both; }

@keyframes card-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── EN VIVO ─────────────────────────────────────────────── */
.nav-live {
  grid-column: 1 / -1;
  align-items: center;
  gap: 16px;
  padding: 18px 18px;
  background: var(--navy);
  border: 1.5px solid rgba(220,38,38,.3);
  box-shadow: 0 4px 20px rgba(11,31,58,.2), 0 2px 8px rgba(220,38,38,.1);
  position: relative;
}

.nav-live::before {
  content: '';
  position: absolute;
  inset-block: 0; left: 0;
  width: 4px;
  background: var(--red);
  border-radius: 0;
}

.nav-live:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(220,38,38,.22);
}

.live-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(220,38,38,.14);
  border: 1.5px solid rgba(220,38,38,.3);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.live-texts { flex: 1; min-width: 0; }

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(220,38,38,.15);
  border: 1px solid rgba(220,38,38,.28);
  color: #fca5a5;
  font-family: var(--font-condensed);
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  margin-bottom: 5px;
}
.live-badge .pulse-dot { width: 6px; height: 6px; }

.live-name {
  font-family: var(--font-condensed);
  font-size: 1.08rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--white);
  line-height: 1.1;
}

.live-desc {
  font-size: .74rem;
  color: rgba(255,255,255,.4);
  font-weight: 500;
  margin-top: 3px;
}

.live-arrow {
  font-size: 1.6rem;
  color: rgba(255,255,255,.3);
  flex-shrink: 0;
  transition: transform 160ms var(--ease-spring);
}
.nav-live:hover .live-arrow { transform: translateX(4px); }

/* ─── CARDS MITAD (Posiciones, Fixture) ──────────────────── */
.nav-half {
  flex-direction: column;
  padding: 17px 15px 13px;
  background: var(--white);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  min-height: 138px;
}
.nav-half:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.half-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-bottom: 12px;
}
.half-icon-pos { background: rgba(245,197,24,.18); }
.half-icon-fix { background: rgba(59,130,246,.12); }
.half-icon-jug { background: rgba(22,163,74,.12); flex-shrink: 0; }

.half-name {
  font-family: var(--font-condensed);
  font-size: .95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--navy);
  line-height: 1.1;
}

.half-desc {
  font-size: .72rem;
  color: var(--muted);
  font-weight: 500;
  margin-top: 3px;
  line-height: 1.3;
}

.half-arrow {
  margin-top: auto;
  padding-top: 8px;
  font-size: 1.1rem;
  color: var(--muted);
  display: block;
}

/* ─── CARD ANCHA (Jugadores) ─────────────────────────────── */
.nav-wide {
  grid-column: 1 / -1;
  align-items: center;
  gap: 14px;
  padding: 17px 18px;
  background: var(--white);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.nav-wide:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.wide-texts { flex: 1; min-width: 0; }
.wide-arrow {
  font-size: 1.3rem;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 160ms var(--ease-spring);
}
.nav-wide:hover .wide-arrow { transform: translateX(4px); }

/* ─── FOOTER ─────────────────────────────────────────────── */
.site-footer {
  background: var(--navy);
  padding: 32px 16px 24px;
  text-align: center;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.footer-logo {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--white);
  object-fit: cover;
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
  margin-bottom: 12px;
}
.footer-brand {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: .06em;
  color: var(--gold);
  margin-bottom: 4px;
}
.footer-sub {
  font-family: var(--font-condensed);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}
.footer-social {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 14px;
}
.footer-social-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-family: var(--font-condensed);
  font-size: .85rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--white);
  transition: transform 160ms var(--ease-spring), box-shadow 160ms var(--ease);
}
.footer-social-btn:hover  { transform: translateY(-2px); }
.footer-social-btn:active { transform: scale(.96); }
.footer-fb { background: #1877f2; box-shadow: 0 3px 12px rgba(24,119,242,.4); }
.footer-wa { background: #25d366; box-shadow: 0 3px 12px rgba(37,211,102,.4); }
.footer-note {
  font-size: .7rem;
  color: rgba(255,255,255,.28);
  letter-spacing: .02em;
}

/* ─── BOTTOM NAV ─────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--navy);
  display: flex;
  border-top: 1px solid rgba(255,255,255,.08);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: var(--z-sticky);
  box-shadow: 0 -4px 20px rgba(0,0,0,.25);
}
.bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 9px 2px 7px;
  gap: 3px;
  color: rgba(255,255,255,.28);
  text-decoration: none;
  font-family: var(--font-condensed);
  font-size: .57rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  transition: color 140ms var(--ease), transform 140ms var(--ease-spring);
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.bnav-item:active { transform: scale(.87); }

.bnav-active {
  color: var(--gold) !important;
}
.bnav-active::after {
  content: '';
  position: absolute;
  top: 0; left: 15%; right: 15%;
  height: 2px;
  background: var(--gold);
  border-radius: 0 0 3px 3px;
}

.bnav-live { color: rgba(220,38,38,.45); }
.bnav-live:hover { color: var(--red) !important; }

.bnav-live-wrap { position: relative; display: inline-flex; }
.bnav-live-dot {
  position: absolute;
  top: -1px; right: -3px;
  width: 7px; height: 7px;
  background: var(--red);
  border-radius: 50%;
  border: 1.5px solid var(--navy);
  animation: copa-pulse 1.3s ease-in-out infinite;
}

/* ─── TOAST ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(76px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--navy);
  color: var(--white);
  font-family: var(--font-body);
  font-size: .88rem;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s var(--ease), transform .28s var(--ease);
  white-space: nowrap;
  z-index: var(--z-toast);
  max-width: calc(100vw - 40px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (min-width: 420px) {
  .hero { padding-top: calc(env(safe-area-inset-top) + 32px); padding-bottom: 36px; }
  .hero-title { font-size: 4.8rem; }
  .hero-logo  { width: 80px; height: 80px; }
}
@media (min-width: 560px) {
  .hero-title { font-size: 5.8rem; }
  .nav-grid   { gap: 14px; }
}
@media (min-width: 700px) {
  .main-content { padding: 22px 20px 28px; }
}
