/* ========================================
   Home — tablero "Estadio"
   El torneo destacado presentado como marcador de estadio, una valla
   LED de patrocinadores y la cuenta regresiva al Mundial. Reemplaza la
   vieja grilla del home (que se mudó a /torneos). Markup en
   app/views/lobby/index.html.erb. Mobile-first.
   ======================================== */

.stadium-home { width: 100%; }


/* ─── Marcador del torneo destacado ─── */
.scoreboard-hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--line-strong);
  background: #0b0e0c;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
.scoreboard-hero > .pitch {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(10, 219, 198, 0.10), transparent 40%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 2px, transparent 2px 5px);
}
.scoreboard-hero > .pitch::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.08);
}
.scoreboard-hero > .pitch::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 160px;
  height: 160px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
}

.scoreboard-hero > .top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.14);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(244, 235, 214, 0.55);
}
.scoreboard-hero > .top > .live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--coral);
  font-weight: 700;
  flex-shrink: 0;
}
.scoreboard-hero > .top > .live > .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 8px var(--coral-glow);
  animation: stadium-blink 1.4s ease-in-out infinite;
}

.scoreboard-hero > .body {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 30px 36px;
}
.scoreboard-hero .side { text-align: center; min-width: 0; }
.scoreboard-hero .side > .k {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(244, 235, 214, 0.5);
  margin-bottom: 8px;
}
.scoreboard-hero .side > .num {
  font-family: var(--font-scoreboard);
  font-size: clamp(48px, 8vw, 104px);
  line-height: 0.82;
  color: #fff;
  text-shadow: 0 0 28px rgba(10, 219, 198, 0.25);
}
.scoreboard-hero .side > .num.-gold {
  color: var(--accent);
  text-shadow: 0 0 28px var(--green-glow);
}

.scoreboard-hero .center { text-align: center; padding: 0 10px; }
.scoreboard-hero .center > .badge {
  width: 144px;
  height: 144px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.55));
}
.scoreboard-hero .center > .badge > svg { width: 72px; height: 72px; }
.scoreboard-hero .center > .badge > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.scoreboard-hero .center > .name {
  font-family: var(--font-scoreboard);
  font-size: clamp(30px, 4.5vw, 56px);
  line-height: 0.92;
  color: #fff;
  letter-spacing: 0.02em;
}
/* Premio en el centro (reemplaza al "presentado por"). */
.scoreboard-hero .center > .prize {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid rgba(10, 219, 198, 0.4);
  border-radius: var(--radius-pill);
  background: rgba(10, 219, 198, 0.08);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.scoreboard-hero .center > .prize > b { font-family: var(--font-scoreboard); font-size: 22px; letter-spacing: 0.03em; }
.scoreboard-hero .center > .prize > svg { width: 14px; height: 14px; }
.scoreboard-hero .center > .prize.-soon {
  color: rgba(244, 235, 214, 0.55); border-color: rgba(255, 255, 255, 0.16); background: transparent;
}

/* Countdown integrado en la cancha — label arriba, clock grande centrado. */
.scoreboard-hero > .sb-count {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 24px 16px;
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
}
.sb-count__lbl {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.sb-count__lbl > svg { width: 13px; height: 13px; }
.sb-count__clk { display: flex; gap: 14px; }
.sb-count__clk .blk {
  display: flex; flex-direction: column; align-items: center; min-width: 64px; padding: 10px 0;
  border-radius: 10px; background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(10, 219, 198, 0.22);
  box-shadow: 0 0 18px rgba(10, 219, 198, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.sb-count__clk .blk > b {
  font-family: var(--font-scoreboard); font-size: 38px; line-height: 1;
  color: var(--accent); text-shadow: 0 0 14px var(--green-glow);
}
.sb-count__clk .blk > i {
  font-style: normal; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.18em;
  text-transform: uppercase; color: rgba(255, 255, 255, 0.6); margin-top: 5px;
}
@media (max-width: 719px) {
  .scoreboard-hero > .sb-count { flex-direction: column; gap: 10px; padding: 14px 18px; }
}

.scoreboard-hero > .foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
}
.scoreboard-hero > .foot > .meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(244, 235, 214, 0.55);
}
.scoreboard-hero > .foot > .meta b { color: #fff; }
.scoreboard-hero > .foot > .cta {
  margin-left: auto;
  padding: 13px 26px;
  border: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  font-weight: 700;
  font-family: var(--font);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 8px 20px var(--green-glow);
  transition: transform 160ms, box-shadow 200ms;
}
.scoreboard-hero > .foot > .cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px var(--green-glow);
}


@keyframes stadium-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) {
  .scoreboard-hero > .top > .live > .dot { animation: none; }
}


/* ─── Desktop: fill available height (app-shell) ─── */
@media (min-width: 720px) {
  /* .content es flex-column en desktop — stadium-home ocupa el resto */
  .stadium-home {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  /* Labels más compactos para ceder espacio al contenido */
  .stadium-home .section-label { margin: 10px 0 8px; }

  /* El scoreboard queda a su alto natural (antes crecía a 100vh y dejaba
     una cancha enorme vacía + empujaba todo abajo = scroll innecesario). */
  .scoreboard-hero {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
  }
}


/* ─── Mobile ─── */
@media (max-width: 719px) {
  .scoreboard-hero > .top {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px 18px;
  }
  .scoreboard-hero > .body {
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 34px 20px;
  }
  /* En mobile el nombre del torneo va primero (orden visual claro). */
  .scoreboard-hero .center { order: -1; }
  .scoreboard-hero .side > .num { font-size: 64px; }
  .scoreboard-hero > .foot {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px 18px;
  }
  .scoreboard-hero > .foot > .meta { text-align: center; }
  .scoreboard-hero > .foot > .cta { margin-left: 0; text-align: center; }
}


/* ─── Modal de participación ─── */
.participate-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 900;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.participate-modal.-open { display: flex; }

.participate-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 13, 11, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.participate-modal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  padding: 32px 28px 24px;
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.participate-modal__eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

.participate-modal__badge {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.3);
  color: var(--accent);
  margin-bottom: 14px;
  overflow: hidden;
}
.participate-modal__badge > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.participate-modal__title {
  font-family: var(--font-scoreboard);
  font-size: 34px;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--ink);
  margin-bottom: 12px;
}

.participate-modal__body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: 22px;
  max-width: 300px;
}
.participate-modal__body.-done { color: var(--accent); }
.participate-modal__body strong { color: var(--accent); font-weight: 600; }

/* Botón principal (dorado) — compartido por links y el submit */
.participate-modal__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 24px;
  border: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 22px var(--green-glow);
  transition: transform 160ms, box-shadow 200ms;
  margin-bottom: 10px;
}
.participate-modal__cta:hover {
  color: var(--paper-ink);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px var(--green-glow);
}

/* El form del button_to hereda el ancho completo */
.participate-modal__cta-form { width: 100%; margin: 0; }

/* Botón "Volver" — ghost, discreto */
.participate-modal__back {
  background: none;
  border: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 16px;
  transition: color 150ms;
}
.participate-modal__back:hover { color: var(--ink-soft); }
