/* ========================================
   Lobby — boletería
   Hero with Bebas headline, paper-ticket cards in a grid, and the
   "programa" help modal. Tournament card markup is rendered by the
   _tournament_card partial — see that file for the contract.
   ======================================== */

.lobby-page {
  width: 100%;
  margin: 0 auto;
}


/* ─── Hero ─── */
.lobby-hero {
  text-align: center;
  margin-bottom: 32px;
  padding-top: 4px;
}
.lobby-title {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--font-scoreboard);
  font-size: clamp(48px, 10vw, 76px);
  line-height: 0.95;
  letter-spacing: 0.04em;
  color: var(--ink);
  margin-bottom: 8px;
}
.lobby-title > .accent { color: var(--gold); }
.lobby-title > .sep    { color: var(--muted); }
.lobby-subtitle {
  color: var(--ink-soft);
  font-size: 15px;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.5;
}

.lobby-hero .help-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: rgba(255, 210, 63, 0.12);
  color: var(--gold);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms, transform 150ms;
  flex-shrink: 0;
  margin-bottom: 8px;
}
.lobby-hero .help-btn:hover {
  background: var(--gold);
  color: var(--paper-ink);
  transform: scale(1.08);
}


/* ─── Tourney grid ─── */
.tourney-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@media (min-width: 720px) {
  .tourney-grid { grid-template-columns: repeat(2, 1fr); }
}


/* ─── Ticket card ─── */
.ticket {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1px 104px;
  min-height: 132px;
  background: linear-gradient(180deg, var(--paper), var(--paper-2));
  color: var(--paper-ink);
  border-radius: var(--radius-lg);
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32),
              0 1px 0 rgba(255, 255, 255, 0.06) inset;
  transition: transform 220ms ease, box-shadow 220ms ease;
}
.ticket:hover {
  transform: translateY(-3px) rotate(-0.3deg);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45),
              0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

/* Optional background image bleeds through at low opacity */
.ticket > .bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
}


/* Main side */
.ticket > .ticket-main {
  position: relative;
  z-index: 1;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ticket-main > .ticket-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--paper-muted);
}
.ticket-main > .ticket-top > .sep {
  width: 18px;
  height: 1px;
  background: rgba(26, 26, 21, 0.3);
}

.ticket-main > .ticket-headline {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ticket-main > .ticket-headline > .ticket-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(7, 34, 26, 0.08);
  color: var(--paper-ink);
}
.ticket-main > .ticket-headline > .ticket-icon > svg {
  width: 60%;
  height: 60%;
  object-fit: contain;
}
.ticket-main > .ticket-headline > .ticket-icon > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* Cuando hay logo subido (img), ocultamos el círculo decorativo de fondo
   para que el escudo se vea limpio en lugar de "flotando" sobre un disco. */
.ticket-main > .ticket-headline > .ticket-icon:has(> img) {
  background: transparent;
}
.ticket-main > .ticket-headline > .ticket-name {
  font-family: var(--font-scoreboard);
  font-size: 28px;
  letter-spacing: 0.03em;
  line-height: 1;
  color: var(--paper-ink);
}

.ticket-main > .ticket-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
}
.ticket-main > .ticket-foot > .ticket-status {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: var(--paper-ink);
  color: var(--paper);
  line-height: 1.2;
}
.ticket-main > .ticket-foot > .ticket-status > .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--paper);
}
.ticket-main > .ticket-foot > .ticket-status.-live { background: var(--coral); color: #fff; }
.ticket-main > .ticket-foot > .ticket-status.-live > .dot { background: #fff; animation: ticket-blink 1.4s ease-in-out infinite; }
.ticket-main > .ticket-foot > .ticket-status.-gold { background: var(--gold); color: var(--paper-ink); }
.ticket-main > .ticket-foot > .ticket-status.-gold > .dot { background: var(--paper-ink); }

.ticket-main > .ticket-foot > .ticket-played {
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(26, 26, 21, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ticket-main > .ticket-foot > .ticket-played b {
  color: var(--paper-ink);
  font-weight: 600;
}

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


/* Divider with perforations */
.ticket > .ticket-divider {
  position: relative;
  width: 1px;
  background: repeating-linear-gradient(0deg,
    rgba(26, 26, 21, 0.4) 0 5px,
    transparent 5px 10px);
  z-index: 1;
}
.ticket > .ticket-divider > .perf {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg);
  left: 50%;
  transform: translateX(-50%);
}
.ticket > .ticket-divider > .perf.-start { top: -9px; }
.ticket > .ticket-divider > .perf.-end   { bottom: -9px; }


/* Stub side */
.ticket > .ticket-stub {
  position: relative;
  z-index: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.05);
  text-align: center;
}
.ticket > .ticket-stub > .num {
  font-family: var(--font-scoreboard);
  font-size: 42px;
  line-height: 0.85;
  color: var(--paper-ink);
}
.ticket > .ticket-stub > .lbl {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(26, 26, 21, 0.6);
}
.ticket > .ticket-stub > .barcode {
  width: 56px;
  height: 14px;
  margin-top: 4px;
  background: repeating-linear-gradient(90deg,
    var(--paper-ink) 0 1px,
    transparent 1px 3px,
    var(--paper-ink) 3px 5px,
    transparent 5px 8px);
}


/* Upcoming variant — sepia paper */
.ticket.-upcoming {
  background: linear-gradient(180deg, #2a2620, #1d1a16);
  color: var(--paper);
}
.ticket.-upcoming .ticket-main > .ticket-headline > .ticket-name,
.ticket.-upcoming .ticket-main > .ticket-row b,
.ticket.-upcoming .ticket-stub > .num,
.ticket.-upcoming .ticket-stub > .lbl { color: var(--paper); }
.ticket.-upcoming .ticket-main > .ticket-top,
.ticket.-upcoming .ticket-main > .ticket-dates,
.ticket.-upcoming .ticket-main > .ticket-row { color: rgba(244, 235, 214, 0.65); }
.ticket.-upcoming .ticket-main > .ticket-top > .sep { background: rgba(244, 235, 214, 0.3); }
.ticket.-upcoming .ticket-main > .ticket-headline > .ticket-icon {
  background: rgba(244, 235, 214, 0.08);
  color: var(--paper);
}
.ticket.-upcoming > .ticket-stub { background: rgba(0, 0, 0, 0.25); }
.ticket.-upcoming > .ticket-divider {
  background: repeating-linear-gradient(0deg,
    rgba(244, 235, 214, 0.3) 0 5px,
    transparent 5px 10px);
}
.ticket.-upcoming > .ticket-stub > .barcode {
  background: repeating-linear-gradient(90deg,
    var(--paper) 0 1px,
    transparent 1px 3px,
    var(--paper) 3px 5px,
    transparent 5px 8px);
}


/* Mobile: stack stub below the main, perforations move to horizontal divider */
@media (max-width: 559px) {
  .ticket {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1px auto;
    min-height: 0;
  }
  .ticket > .ticket-divider {
    width: auto;
    height: 1px;
    background: repeating-linear-gradient(90deg,
      rgba(26, 26, 21, 0.4) 0 5px,
      transparent 5px 10px);
  }
  .ticket > .ticket-divider > .perf {
    top: 50%;
    left: auto;
    transform: translateY(-50%);
  }
  .ticket > .ticket-divider > .perf.-start { left: -9px; transform: translateY(-50%); top: 50%; }
  .ticket > .ticket-divider > .perf.-end   { right: -9px; left: auto; transform: translateY(-50%); top: 50%; }
  .ticket.-upcoming > .ticket-divider {
    background: repeating-linear-gradient(90deg,
      rgba(244, 235, 214, 0.3) 0 5px,
      transparent 5px 10px);
  }
  .ticket > .ticket-stub {
    flex-direction: row;
    gap: 12px;
    padding: 14px 16px;
  }
  .ticket > .ticket-stub > .num { font-size: 38px; }
  .ticket > .ticket-stub > .barcode { margin-top: 0; }
}


/* ─── Bottom auth bar (unauthenticated lobby) ─── */
.lobby-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px 20px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  border-top: 1px dashed var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  z-index: 100;
}
.lobby-bar > .msg {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.lobby-bar > .actions {
  display: flex;
  gap: 8px;
}
.lobby-bar > .actions > .btn {
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms, color 150ms, border-color 150ms;
}
.lobby-bar > .actions > .btn.-primary {
  background: var(--gold);
  color: var(--paper-ink);
  border: 1px solid var(--gold);
}
.lobby-bar > .actions > .btn.-primary:hover { background: #ffe170; }
.lobby-bar > .actions > .btn.-ghost {
  background: none;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.lobby-bar > .actions > .btn.-ghost:hover { border-color: var(--gold); color: var(--gold); }

@media (max-width: 559px) {
  .lobby-bar { flex-direction: column; gap: 10px; padding: 12px 14px; }
}


/* El modal "Cómo se juega" ahora usa el componente reutilizable
   shared/_info_modal con clases .info-modal__* (ver _primitives.css). */
