/* ===== Reset básico ===== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: Oswald, sans-serif; color: #111; background: #fff; }
img { display: block; max-width: 100%; }

/* ===== A4 print ===== */
@page { size: A4; margin: 12mm; }

.no-print { display: block; }
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .page { width: auto; margin: 0; }
  /* Evitar cortes feos */
  .day { break-inside: avoid; page-break-inside: avoid; }
  .row { break-inside: avoid; page-break-inside: avoid; }
  .card { break-inside: avoid; page-break-inside: avoid; }
}

/* ===== Toolbar ===== */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 12px 16px;
}
.btn {
  appearance: none;
  border: 0;
  background: #111;
  color: #fff;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

/* ===== Layout ===== */
.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 18px 18px 28px;
}

.hero {
  text-align: center;
}
.hero__title {
  margin: 0;
  font-size: 44px;
  font-weight: 900;
  letter-spacing: .5px;
}
.hero__subtitle {
  margin: 6px 0 0;
  font-size: 26px;
  font-weight: 900;
}

/* ===== Secciones por día ===== */
.day {
  margin-top: 14px;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  overflow: hidden;
}
.day__bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: #f3f3f3;
  padding: 10px 14px;
  font-weight: 700;
}
.day__bar span {
  font-size: 18px;
}

/* Filas de 2 columnas (como tu imagen) */
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid #e6e6e6;
}

/* ===== Tarjeta partido ===== */
.card {
  padding: 14px 14px;
  min-height: 120px;
  position: relative;
}
.card + .card {
  border-left: 1px solid #e6e6e6;
}

.group {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .6px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.card__body {
  display: grid;
  grid-template-columns: 1fr 1px 170px;
  align-items: center;
  gap: 12px;
}

.teams {
  display: grid;
  gap: 10px;
}
.team {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center;
  font-size: 22px;
  font-weight: 700;
}
.flag {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid #e6e6e6;
  background: #fff;
}
.flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.divider {
  width: 1px;
  height: 64px;
  background: #bcbcbc;
  justify-self: center;
}

.when {
  text-align: right;
  font-weight: 800;
  font-size: 17px;
  line-height: 1.25;
}
.when .date { display: block; }
.when .time { display: block; }

/* Responsive: si querés en móvil 1 columna */
@media (max-width: 720px) {
  .row { grid-template-columns: 1fr; }
  .card + .card { border-left: 0; border-top: 1px solid #e6e6e6; }
  .hero__title { font-size: 34px; }
  .hero__subtitle { font-size: 20px; }
}

.note-print{
  margin: 14px 0 0;
  font-size: 12px;
  color: #333;
  font-style: italic;
  text-align: center;
}

.toolbar{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
  margin-top:12px;
}

.search{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  margin-bottom: 50px;
}

.search input{
  width:min(420px, 80vw);
  height:40px;
  padding:0 12px;
  border:1px solid #ddd;
  border-radius:10px;
  font-family: "PT Sans", sans-serif;
  font-size:14px;
}

.btn--ghost{
  background:#fff;
  color:#111;
  border:1px solid #ddd;
}
.btn--ghost:hover{
  border-color:#bbb;
}

.count{
  font-size: 12px;
  color:#333;
  opacity:.85;
}

.no-results{
  margin: 10px auto 0;
  max-width: 900px;
  text-align: center;
  font-size: 13px;
  color:#333;
  opacity:.9;
}

/* ===== Print optimizado ===== */

@media print {
  /* Solo imprimimos el main del fixture */
  #headerContainer,
  #footerContainer,
  .no-print {
    display: none !important;
  }

  /* achicamos márgenes al máximo razonable */
  @page { size: A4; margin: 6mm; }

  .page { padding: 0; margin: 0; max-width: none; }

  /* Título + bajada chicos */
  .hero { margin: 0 0 6mm 0; }
  .hero__title { font-size: 20px; line-height: 1.1; margin: 0; }
  .hero__subtitle { font-size: 12px; line-height: 1.1; margin: 3px 0 0; }

  .note-print { font-size: 9px; margin-top: 6mm; }

  /* Barra de día compacta */
  .day__bar { padding: 4px 6px; }
  .day__bar span { font-size: 10px; }

  /* Tarjetas ultra compactas */
  .card { padding: 5px 6px; min-height: 0; }
  .group { font-size: 9px; margin: 0 0 4px; letter-spacing: .2px; }

  .card__body { grid-template-columns: 1fr 1px 90px; gap: 6px; }

  .teams { gap: 6px; }
  .team { font-size: 10.5px; grid-template-columns: 14px 1fr; gap: 6px; }

  .flag { width: 14px; height: 14px; border-width: 1px; }

  .divider { height: 34px; }

  .when { font-size: 10px; line-height: 1.15; }

  /* Evitar cortes feos */
  .day, .row, .card { break-inside: avoid; page-break-inside: avoid; }
}

.match-day {
  width: 60px;
  min-width: 60px;
  height: 64px; /* un poquito más alto */
}

.match-days__months {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 20px;
}

.match-days__month {
  flex: 1;
  font-size: 28px;
  font-weight: 700;
  color: #9a9a9a;
  line-height: 1;
  position: relative;
}

.match-days__month::after {
  content: "";
  display: inline-block;
  vertical-align: middle;
  width: calc(100% - 90px);
  height: 1px;
  background: #d9d9d9;
  margin-left: 14px;
  transform: translateY(-6px);
}

.match-days__track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0 10px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.match-days__track::-webkit-scrollbar {
  height: 6px;
}

.match-days__track::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 999px;
}

.match-day {
  width: 62px;
  min-width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 1px solid #d6d6d6;
  background: #fff;
  color: #222;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 0 0 auto;
}

.match-day:hover {
  border-color: #888;
}

.match-day__dow {
  font-size: 14px;
  line-height: 1;
}

.match-day__num {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.match-day.active {
  background: #5b5b5b;
  border-color: #5b5b5b;
  color: #fff;
}

@media (max-width: 768px) {
  .match-days__month {
    font-size: 22px;
  }

  .match-day {
    width: 52px;
    min-width: 52px;
    height: 52px;
  }

  .match-day__dow {
    font-size: 13px;
  }

  .match-day__num {
    font-size: 24px;
  }
}

.match-day__month {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.7;
  line-height: 1;
}

.match-days__scroll {
  cursor: grab;
}

.match-days__scroll.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.match-days__track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0 12px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;

  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
}

.match-days__track::-webkit-scrollbar {
  display: none;
}

.match-days__track.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.match-day {
  width: 69px;
  min-width: 69px;
  height: 69px;
  gap: 4px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.match-day__dow {
  font-size: 13px;
  line-height: 1;
}

.match-day__num {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}

.match-day__month {
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  opacity: 0.75;
}

@media (max-width: 768px) {
  .team {
    font-size: 16px;
  }
  .page {
    padding: 0;
  }
}