* { box-sizing: border-box; margin: 0; padding: 0; }

.container { max-width: 1024px; margin: 0 auto; }

.bracket-scroll { margin-top: 8%;}

.bracket {
  display: flex;
  align-items: stretch;
  position: relative;
}

.col            { display: flex; flex-direction: column; min-width: 0; flex: 1; transition: opacity 0.3s ease; }
.col-16avos     { flex: 1.2; }
.col-octavos    { flex: 1.5; position: relative; z-index: 1; }
.col-cuartos    { flex: 0.6; position: relative; z-index: 2; }
.col-semifinal  { flex: 0.5; position: relative; z-index: 3; }
.col-final      { flex: 0.8; position: relative; z-index: 4; }

.shift-l.col-cuartos   { left: -55px; }
.shift-r.col-cuartos   { left:  55px; }
.shift-l.col-semifinal { left: -90px; }
.shift-r.col-semifinal { left:  90px; }

.slot.gap-top { margin-top: 0; }

.slot {
  flex: 1;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px 4px;
}

.match {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 140px;
  flex-shrink: 0;
}

.round-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #1a2f6e;
  margin-bottom: 0px;
  text-align: left;
  padding-left: 8px;
}
.round-label.final { color: #1565c0; text-align: center; padding-left: 0; padding-right: 0; }

.pill {
  display: flex;
  align-items: center;
  height: 40px;
  background: #f7f7f7;
  overflow: hidden;
  padding-right: 0;
  border: 3px solid #fff;
}

.flag {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  background: #d5d7da;
  border: 2px solid #fff;
  border-radius: 50%;
  flex-shrink: 0;
  margin: 0 2px 0 4px;
  overflow: hidden;
}

.flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.name {
  flex: 1;
  font-family: 'Petrona', serif;
  font-size: 11px;
  font-weight: 600;
  color: #434343;
  padding: 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score {
  height: 100%;
  width: 36px;
  min-width: 36px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #646464;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.pill + .pill { margin-top: -3px; }
.pen { font-size: 0.8em; font-weight: 400; opacity: 1; padding-left: 1px; }

.match.status-fixture-teams .pill  { background: #f2f3fe; }
.match.status-fixture-teams .score { background: #00117F; flex-direction: column; gap: 0; text-align: center; width: 36px; min-width: 36px; padding: 0; }
.match.status-one-team .pill       { background: #f2f3fe; }
.match.status-one-team .score      { background: #00117F; flex-direction: column; gap: 0; text-align: center; width: 36px; min-width: 36px; padding: 0; }
.match.status-one-team .pill:last-child { opacity: 1; background: #f7f7f7; }
.match.status-one-team .pill:last-child .score { background: #646464; }

.match.status-upcoming .score {
  background: #646464;
  color: #fff;
  flex-direction: column;
  gap: 0;
  text-align: center;
  width: 36px;
  min-width: 36px;
  padding: 0;
}
.match.status-fixture-teams.status-upcoming .score,
.match.status-one-team.status-upcoming .score { background: #00117F; }

.score-day  { font-family: 'Open Sans', sans-serif; font-size: 12px; font-weight: 700; line-height: 1; }
.score-mon  { font-family: 'Open Sans', sans-serif; font-size: 7px; font-weight: 600; letter-spacing: 0.3px; line-height: 1; opacity: 0.85; }
.score-time { font-family: 'Open Sans', sans-serif; font-size: 10px; font-weight: 700; line-height: 1; }

.match.status-live .pill        { background: #e4e5f7; }
.match.status-live .flag        { background: #d0dbf7; }
.match.status-live .score       { background: #2a27ff; flex-direction: column; gap: 0; text-align: center; padding: 0; }
.match.status-live .name        { color: #1a1a2e; }
.match.status-live .round-label { color: #2a27ff; }
.match.status-live .round-label::after {
  content: ' ●';
  animation: pulse-live 1.2s ease-in-out infinite;
}
@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.match.status-played .score { background: #646464; }
.pill.winner        { background: #f2f3fe; }
.pill.winner .score { background: #00117F; }

.shift-r .name { text-align: left; }
.shift-r .round-label { text-align: right; padding-left: 0; padding-right: 8px; }

/* ── Tabs ── */
.tab-short { display: none; }
.tab-long  { display: inline; }

.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  height: 46px;
  font-family: "Open Sans", sans-serif;
}
.tab {
  flex: 1;
  border: 1px solid #00117F;
  text-transform: uppercase;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  color: #00117F;
  font-size: 0.75em;
  letter-spacing: -0.4px;
  background: #fff;
  cursor: pointer;
  padding: 0;
  margin-left: -1px;
}
.tab:first-child { margin-left: 0; }
.tab:hover  { color: #fff; background-color: #00117F; }
.tab:focus  { outline: none; }
.tab.active { color: #fff; background-color: #00117F; }

@media (min-width: 768px) {
  .tab { font-size: 0.9em; letter-spacing: unset; font-weight: 600; }
}

/* ── Panel de partidos ── */
#matches-panel { padding: 0 10px 20px; }

.matches-date {
  display: block;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.8em;
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 8%;
  margin-bottom: 1.2%;
}
.matches-date-journey { color: #434343; }
.matches-date-day     { color: #868686; margin-left: 1%; }

.matches-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2%;
  margin-bottom: 4px;
}

 @media screen and (max-width: 480px) {
  .matches-grid {
    gap: 4px;
  }
}


/* Tarjeta de partido */
.match-card {
  background-color: #f7f7f7;
  display: grid;
  grid-template-columns: 80% 20%;
  height: 60px;
  position: relative;
  box-sizing: border-box;
  align-items: center;
}
@media (min-width: 524px) { .match-card { height: 80px; padding: 0; align-items: center; } }
@media (min-width: 768px) { .match-card { grid-template-columns: 85% 15%; } }

.mc-main {
  display: grid;
  grid-template-columns: 1fr 26% 1fr;
  align-content: center;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
@media (min-width: 768px) { .mc-main { grid-template-columns: 1fr 28% 1fr; padding: 4%; } }

.mc-team {
  font-family: 'Open Sans', sans-serif;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8em;
  line-height: 1.2em;
}
.mc-local { justify-content: flex-end; }
.mc-local .mc-name { text-align: right; }
.mc-away  { justify-content: flex-start; }

.mc-name {
  font-family: 'Open Sans', sans-serif;
  font-size: inherit;
  font-weight: 700;
  color: #434343;
  overflow: hidden;
  white-space: normal;
  line-height: 1.2;
}

.mc-flag {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #d5d7da;
  border: 2px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.mc-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.mc-score {
  display: flex;
  font-family: 'Open Sans', sans-serif;
  font-size: 1.2em;
  font-weight: 700;
  line-height: 1;
  justify-content: center;
  color: #434343;
}
@media (min-width: 524px) { .mc-score { font-size: 1.8em; } }
@media (min-width: 768px) { .mc-score { font-size: 1.3em; } }

.mc-score .goles { display: flex; justify-content: center; gap: 6px; }
.mc-score .sep   { font-weight: 300; }
.mc-score .hour  { display: flex; justify-content: center; font-weight: 500; }

.mc-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
}
@media (min-width: 768px) {
  .mc-actions { margin: 0; gap: 6px; padding: 8px 0; }
}

.mc-btn {
  border: 1px solid #c7c7c7;
  border-radius: 50%;
  height: 28px;
  width: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
  padding: 5px;
  box-sizing: border-box;
}
.mc-btn svg { width: 100%; height: 100%; display: block; }
.mc-btn svg path { fill: #c7c7c7; }
.mc-btn-active          { border-color: #8d0201; }
.mc-btn-active svg path { fill: #8d0201; }
.mc-btn-inactive        { border-color: #c7c7c7; cursor: default; }

/* ── Sección HOY ── */
.matches-today-section { margin-bottom: 32px; margin-top: 4rem; }
.matches-date--today { margin-top: 0; }
.matches-date-journey--today {
  color: #00117F;
  font-size: 1.1em;
  letter-spacing: 1px;
  background-image: linear-gradient(#00117F, #00117F);
  background-size: 40px 3px;
  background-repeat: no-repeat;
  background-position: left bottom;
  padding-bottom: 6px;
}
.match-card--today { background-color: #00117F; border: none; }
.match-card--today .mc-name  { color: #fff; }
.match-card--today .mc-score { color: #fff; }
.match-card--today .mc-score .goles,
.match-card--today .mc-score .hour { color: #fff; }
.match-card--today .mc-score .sep { color: rgba(255,255,255,0.6); }
.match-card--today .mc-btn-inactive { border-color: rgba(255,255,255,0.3); }
.match-card--today .mc-btn-inactive svg path { fill: rgba(255,255,255,0.3); }
.match-card--today .mc-btn-active   { border-color: #fff; }
.match-card--today .mc-btn-active svg path { fill: #fff; }

/* ── Responsive móvil ── */
@media (max-width: 768px) {
  .container { max-width: 100%; padding: 0; position: relative; }
  .bracket-scroll { margin-top: 8%; overflow-x: auto; scroll-snap-type: x mandatory; position: relative; }

  /* Degradado derecha — solo visible a la altura del bracket */
  .bracket-fade-right {
    position: absolute;
    top: 77px;
    right: 0;
    width: 15vw;
    height: 0;
    background: linear-gradient(to left, rgb(255 255 255) 65%, rgba(255,255,255,0) 100%);
    pointer-events: none;
    z-index: 999;
  }

  .tabs {
    position: sticky;
    top: 0;
    z-index: 1000;
    margin-bottom: 8px;
    background: #fff;
    padding: 0 20px;
    gap: 0;
    height: 44px;
    display: flex;
    width: 100%;
    overflow: hidden;
  }

  .tab {
    flex: 1;
    min-width: 0;
    height: 44px;
    font-size: 9px;
    letter-spacing: 0;
    padding: 0 2px;
    white-space: nowrap;
    overflow: hidden;
  }
  .tab-long  { display: none; }
  .tab-short { display: inline; }

  .bracket {
    display: grid;
    grid-template-columns: repeat(5, 100vw);
    grid-template-rows: auto auto;
    row-gap: 0;
    width: calc(100vw * 5);
  }

  .shift-l.col-cuartos,
  .shift-r.col-cuartos   { left: 0; }
  .shift-l.col-semifinal,
  .shift-r.col-semifinal { left: 0; }

  .col-16avos.side-l     { grid-column: 1; grid-row: 1; align-self: end;     scroll-snap-align: start; }
  .col-octavos.side-l    { grid-column: 2; grid-row: 1; align-self: stretch; scroll-snap-align: start; }
  .col-cuartos.shift-l   { grid-column: 3; grid-row: 1; align-self: start;   scroll-snap-align: start; }
  .col-semifinal.shift-l { grid-column: 4; grid-row: 1; align-self: start;   scroll-snap-align: start; }
  .col-final             { grid-column: 5; grid-row: 1 / span 2; align-self: start; scroll-snap-align: start; }
  .col-semifinal.shift-r { grid-column: 4; grid-row: 2; align-self: start; }
  .col-cuartos.shift-r   { grid-column: 3; grid-row: 2; align-self: start; }
  .col-octavos.side-r    { grid-column: 2; grid-row: 2; align-self: stretch; }
  .col-16avos.side-r     { grid-column: 1; grid-row: 2; align-self: start; }

  .pill  { width: 85vw; }
  .match { width: 85vw; }

  .col-16avos .slot,
  .col-octavos .slot,
  .col-cuartos .slot,
  .col-semifinal .slot,
  .col-final .slot { justify-content: flex-start; padding-left: 8px; }

  .col-cuartos   .slot { min-height: 90px; }
  .col-semifinal .slot { min-height: 90px; }
  .col-final     .slot { min-height: 90px; }

  .round-label { display: none; }

  .mc-name { font-size: 1em; max-width: 16vw; white-space: normal; overflow: hidden; line-height: 1.2; }

  /* Tarjeta más compacta en móvil */
  .mc-main  { grid-template-columns: 1fr 22% 1fr; }
  .mc-team  { font-size: 0.68em; gap: 4px; }
  .mc-flag  { width: 22px; height: 22px; flex-shrink: 0; }
  .mc-score { font-size: 0.95em; }
  .mc-btn   { height: 28px; width: 28px; padding: 5px; }
  .mc-score { font-size: 1.3em; }
  .mc-team  { font-size: 0.78em; gap: 5px; }
  .mc-flag  { width: 32px; height: 32px; }

  .matches-grid { grid-template-columns: 1fr; }
  .match-card   { width: 100%; height: auto; min-height: 60px; display: grid; grid-template-columns: 80% 20%; box-sizing: border-box; overflow: hidden; }
  #matches-panel { padding: 0 20px 20px; }
  .matches-today-section .matches-date { margin-bottom: 4%; }
}

 @media screen and (max-width: 480px) {
  .mc-score {
    font-size: 1em;
  }
}