/**
 * Padeler Torneos — Cuadro Eliminatorio Styles (torneos-cuadro.css)
 * Mobile-first, desktop landscape support, print-ready.
 */

/* ─── Bracket Scroll Container ─── */
.bracket-scroll-container {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #27272A transparent;
}
.bracket-scroll-container::-webkit-scrollbar {
  height: 6px;
}
.bracket-scroll-container::-webkit-scrollbar-track {
  background: transparent;
}
.bracket-scroll-container::-webkit-scrollbar-thumb {
  background: #27272A;
  border-radius: 9999px;
}
.bracket-scroll-container::-webkit-scrollbar-thumb:hover {
  background: #3F3F46;
}

/* ─── Bracket Column & Snap ─── */
.bracket-column {
  scroll-snap-align: start;
  flex: 0 0 260px;
  min-width: 260px;
}
@media (min-width: 640px) {
  .bracket-column {
    flex: 0 0 280px;
    min-width: 280px;
  }
}

/* ─── Match Card ─── */
.bracket-match-card {
  position: relative;
  background: rgba(24, 24, 27, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.bracket-match-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
}
.bracket-match-card.is-completed {
  border-color: rgba(163, 230, 53, 0.25);
}

/* ─── Team Slot ─── */
.bracket-team-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  min-height: 44px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s, color 0.15s;
}
.bracket-team-slot:first-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.bracket-team-slot:hover:not(.is-disabled):not(.is-bye) {
  background: rgba(255, 255, 255, 0.05);
}
.bracket-team-slot:active:not(.is-disabled):not(.is-bye) {
  background: rgba(255, 255, 255, 0.08);
}

/* Slot states */
.bracket-team-slot.is-winner {
  background: rgba(163, 230, 53, 0.12) !important;
  color: #A3E635;
  font-weight: 700;
  border-left: 3px solid #A3E635;
}
.bracket-team-slot.is-loser {
  opacity: 0.45;
  color: rgba(255, 255, 255, 0.6);
}
.bracket-team-slot.is-bye {
  opacity: 0.4;
  font-style: italic;
  cursor: default;
}
.bracket-team-slot.is-disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* ─── Seed & Winner Badges ─── */
.seed-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  margin-right: 6px;
  flex-shrink: 0;
}
.seed-pill.top-seed {
  background: rgba(163, 230, 53, 0.15);
  color: #A3E635;
  border: 1px solid rgba(163, 230, 53, 0.3);
}

/* ─── Champion Celebration Card ─── */
.champion-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(163, 230, 53, 0.15) 0%, rgba(24, 24, 27, 0.9) 60%, rgba(163, 230, 53, 0.08) 100%);
  border: 1px solid rgba(163, 230, 53, 0.4);
  box-shadow: 0 0 35px -5px rgba(163, 230, 53, 0.25);
  border-radius: 20px;
}

/* ─── Mobile Round Selector Pills ─── */
.round-pill-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  transition: all 0.15s;
  cursor: pointer;
}
.round-pill-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.round-pill-btn.is-active {
  background: rgba(163, 230, 53, 0.15);
  border-color: #A3E635;
  color: #A3E635;
  box-shadow: 0 0 12px -2px rgba(163, 230, 53, 0.3);
}

/* ─── Print Stylesheet (Landscape) ─── */
@media print {
  @page {
    size: landscape;
    margin: 0.6cm;
  }
  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 10pt !important;
  }
  header,
  footer,
  #setup-card,
  #action-bar-normal,
  #seo-content,
  #subtle-cta,
  #mobileMenu,
  #menuToggle,
  .bg-ambient-layer,
  .shiny-cta,
  #mobileRoundSelector,
  .no-print {
    display: none !important;
  }
  .print-only-header {
    display: block !important;
    margin-bottom: 12pt;
    padding-bottom: 6pt;
    border-bottom: 2pt solid #000;
  }
  #outputSection {
    display: block !important;
  }
  .bracket-scroll-container {
    overflow: visible !important;
  }
  .bracket-grid {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
    gap: 8pt !important;
  }
  .bracket-column {
    flex: 1 1 0 !important;
    min-width: 0 !important;
  }
  .bracket-match-card {
    background: #ffffff !important;
    border: 1pt solid #000000 !important;
    border-radius: 4pt !important;
    margin-bottom: 6pt !important;
    box-shadow: none !important;
  }
  .bracket-team-slot {
    color: #000000 !important;
    padding: 4pt 6pt !important;
    min-height: 22pt !important;
  }
  .bracket-team-slot.is-winner {
    background: #e5e5e5 !important;
    font-weight: bold !important;
    border-left: 3pt solid #000 !important;
    color: #000000 !important;
  }
  .seed-pill {
    background: #eee !important;
    color: #000 !important;
    border: 0.5pt solid #888 !important;
  }
  .champion-card {
    background: #f4f4f5 !important;
    border: 2pt solid #000 !important;
    color: #000 !important;
    box-shadow: none !important;
  }
}
