/* Emergency print fix: keep 32-team (5-round) bracket inside its own A4 landscape sheet. */
.tournament-bracket-print[style*="repeat(5"] {
  height: 158mm !important;
  max-height: 158mm !important;
  gap: 1.5mm !important;
}
.tournament-bracket-print[style*="repeat(5"] .tournament-bracket-print__round h3 {
  margin-bottom: .35mm !important;
  padding-bottom: .3mm !important;
  font-size: 5.8pt !important;
}
.tournament-bracket-print[style*="repeat(5"] .tournament-bracket-print__matches {
  min-height: 0 !important;
  gap: 0 !important;
}
.tournament-bracket-print[style*="repeat(5"] .tournament-bracket-print__match {
  min-height: 0 !important;
  border-radius: .7mm !important;
}
.tournament-bracket-print[style*="repeat(5"] .tournament-bracket-print__match small {
  padding: .12mm .55mm !important;
  font-size: 4.3pt !important;
  line-height: .95 !important;
}
.tournament-bracket-print[style*="repeat(5"] .tournament-bracket-print__match span {
  padding: .14mm .55mm !important;
  font-size: 4.7pt !important;
  line-height: .96 !important;
}
.tournament-bracket-print[style*="repeat(5"] .tournament-bracket-print__connectors {
  inset: 5mm 0 0 !important;
  height: calc(100% - 5mm) !important;
}

/* A category/page must never visually bleed into the following sheet on screen or paper. */
.tournament-print-page--landscape {
  overflow: hidden !important;
}

@media print {
  .tournament-print-page--landscape {
    height: 210mm !important;
    max-height: 210mm !important;
    overflow: hidden !important;
  }
}
/* Match the physical print sheet to the layout dimensions. Without an @page
   size, mobile Chrome can default to Letter portrait and scale the A4 layout
   down, making the calendar unnecessarily small. */
@page tournament-print-portrait {
  size: A4 portrait;
  margin: 0;
}

@page tournament-print-landscape {
  size: A4 landscape;
  margin: 0;
}

@media print {
  .tournament-print-page--portrait {
    page: tournament-print-portrait;
  }

  .tournament-print-page--landscape {
    page: tournament-print-landscape;
    height: 210mm !important;
    max-height: 210mm !important;
    overflow: hidden !important;
  }
}
