/* CoachPanel V20.0.3.171 · Partidos por disputar: botones iguales + formación dentro de Convocatoria.
   Editar = solo datos del partido. Convocatoria = lista + formación en campo. */

/* EDITAR PARTIDO: exclusivamente datos del partido. */
#editorPartido[data-editor-mode="editor"] .match-participation-panel,
#editorPartido[data-editor-mode="editor"] .match-lineup-summary-grid,
#editorPartido[data-editor-mode="editor"] .match-editor-events-grid,
#editorPartido[data-editor-mode="editor"] .match-editor-observations-card{
  display:none!important;
}
#editorPartido[data-editor-mode="editor"] .match-editor-data-card{
  display:block!important;
  margin-bottom:0!important;
}

/* CONVOCATORIA: lista de jugadores + formación en campo. No muestra datos ni eventos del partido. */
#editorPartido[data-editor-mode="callup"] .match-editor-data-card,
#editorPartido[data-editor-mode="callup"] .match-editor-events-grid,
#editorPartido[data-editor-mode="callup"] .match-editor-observations-card{
  display:none!important;
}
#editorPartido[data-editor-mode="callup"] .match-participation-panel{
  display:block!important;
  margin-top:0!important;
}
#editorPartido[data-editor-mode="callup"] .match-lineup-summary-grid{
  display:grid!important;
  margin-top:14px!important;
}
#editorPartido[data-editor-mode="callup"] .match-lineup-card{
  display:block!important;
}
/* El resumen de partido no pertenece a Convocatoria. */
#editorPartido[data-editor-mode="callup"] .match-summary-card{
  display:none!important;
}

#editorPartido .match-callup-footer-actions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px 12px;
  border-top:1px solid rgba(255,255,255,.07);
}
#editorPartido .match-callup-footer-actions>button{
  flex:0 0 auto;
  min-height:40px;
}
#editorPartido .match-callup-footer-actions>p{
  margin:0!important;
  text-align:right;
}

/* iPad y ordenador: las cuatro acciones operativas tienen exactamente la misma geometría.
   Una única fila de cuatro columnas iguales elimina cualquier ancho dependiente del texto. */
@media (min-width:761px){
  #partidosPorDisputar .upcoming-match-row{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    grid-template-rows:auto auto auto auto!important;
    column-gap:10px!important;
    row-gap:10px!important;
  }
  #partidosPorDisputar .upcoming-match-row>td:nth-child(1){
    grid-column:1/3!important;
    grid-row:1!important;
  }
  #partidosPorDisputar .upcoming-match-row>td:nth-child(3){
    grid-column:3/5!important;
    grid-row:1!important;
    justify-self:end!important;
  }
  #partidosPorDisputar .upcoming-match-row>.match-card-fixture{
    grid-column:1/-1!important;
    grid-row:2!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:100%!important;
    padding-block:14px!important;
    text-align:center!important;
  }
  #partidosPorDisputar .match-card-fixture .match-teams-cell{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)!important;
    align-items:center!important;
    width:100%!important;
    max-width:none!important;
    margin-inline:auto!important;
    padding-inline:clamp(10px,2vw,24px)!important;
    column-gap:clamp(10px,1.5vw,18px)!important;
    box-sizing:border-box!important;
  }
  #partidosPorDisputar .match-card-fixture .team-mini{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    min-width:0!important;
    gap:8px!important;
    text-align:center!important;
  }
  #partidosPorDisputar .match-card-fixture .team-mini:first-child,
  #partidosPorDisputar .match-card-fixture .team-mini:last-child{
    flex-direction:row!important;
    justify-content:center!important;
    text-align:center!important;
  }
  #partidosPorDisputar .match-card-fixture .team-mini-name{
    max-width:340px!important;
    font-size:clamp(15px,1.35vw,18px)!important;
    font-weight:850!important;
    line-height:1.15!important;
    text-align:center!important;
  }
  #partidosPorDisputar .match-card-fixture .match-vs{
    justify-self:center!important;
    min-width:34px!important;
    margin:0!important;
    font-size:14px!important;
    font-weight:900!important;
    text-align:center!important;
  }
  #partidosPorDisputar .upcoming-match-row>td:nth-child(4){grid-column:1!important;grid-row:3!important}
  #partidosPorDisputar .upcoming-match-row>td:nth-child(5){grid-column:2!important;grid-row:3!important}
  #partidosPorDisputar .upcoming-match-row>td:nth-child(6){grid-column:3!important;grid-row:3!important}
  #partidosPorDisputar .upcoming-match-row>td:nth-child(7){grid-column:4!important;grid-row:3!important}
  #partidosPorDisputar .upcoming-match-row>td:nth-child(8){grid-column:1/-1!important;grid-row:4!important}

  #partidosPorDisputar .upcoming-match-row>td.match-card-action:not(.match-card-delete){
    display:flex!important;
    align-items:stretch!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
  }
  #partidosPorDisputar .upcoming-match-row>td.match-card-action:not(.match-card-delete)>button{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:46px!important;
    min-height:46px!important;
    max-height:46px!important;
    margin:0!important;
    padding:0 8px!important;
    box-sizing:border-box!important;
    font-size:11.5px!important;
    line-height:1!important;
    white-space:nowrap!important;
  }
}

@media(max-width:760px){
  html body:not(.family-live-mode) #partidos #editorPartido[data-editor-mode="callup"] .match-editor-events-grid{
    display:none!important;
  }
  #editorPartido .match-callup-footer-actions{align-items:stretch;flex-direction:column}
  #editorPartido .match-callup-footer-actions>button{width:100%}
  #editorPartido .match-callup-footer-actions>p{text-align:left}
}

/* V20.0.3.167 · Editar partido es exclusivamente la ficha de datos. */
#partidos #editorPartido[data-editor-mode="editor"] .match-participation-panel,
#partidos #editorPartido[data-editor-mode="editor"] .match-lineup-summary-grid,
#partidos #editorPartido[data-editor-mode="editor"] .match-editor-events-grid,
#partidos #editorPartido[data-editor-mode="editor"] .match-editor-observations-card{
  display:none!important;
}
#partidos #editorPartido[data-editor-mode="editor"] .match-editor-data-card{
  display:block!important;
  margin-bottom:0!important;
}

@media(max-width:760px){
  #partidosPorDisputar .upcoming-match-row>.match-card-fixture,
  #partidosPorDisputar .match-card-fixture{
    padding-block:12px!important;
  }
}


/* COACHPANEL V1.03.1 - UPCOMING MATCH MOBILE FRAME */
@media (max-width:760px){
  body:not(.family-live-mode) #partidosPorDisputar .upcoming-match-row{
    position:relative!important;
    display:block!important;
    width:100%!important;
    margin:0 0 18px!important;
    padding:4px!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
    border:2px solid #d7dee1!important;
    border-radius:20px!important;
    background:#fff!important;
    box-shadow:0 9px 23px rgba(17,24,39,.12)!important;
  }
  body:not(.family-live-mode) #partidosPorDisputar .upcoming-match-row::before{
    content:""!important;
    position:absolute!important;
    z-index:2!important;
    top:0!important;
    left:17px!important;
    right:17px!important;
    height:4px!important;
    border-radius:0 0 5px 5px!important;
    background:#42c84f!important;
    pointer-events:none!important;
  }
  body:not(.family-live-mode) #partidosPorDisputar .upcoming-match-row>.cp-mobile-card-cell{
    display:block!important;
    width:100%!important;
    padding:0!important;
    border:0!important;
    background:transparent!important;
  }
  body:not(.family-live-mode) #partidosPorDisputar .cp-mobile-match-card{
    width:100%!important;
    margin:0!important;
    box-sizing:border-box!important;
    border:1px solid rgba(66,200,79,.20)!important;
    border-radius:15px!important;
    background:#fff!important;
    box-shadow:none!important;
  }
  body:not(.family-live-mode) #partidosPorDisputar .upcoming-match-row:last-child{
    margin-bottom:4px!important;
  }
}


/* =========================================================
   PARTIDO JUGADO · FICHA POSTPARTIDO
   ========================================================= */

#editorPartido[data-editor-mode="played"] .match-lineup-summary-grid{
  display:none!important;
}

#editorPartido[data-editor-mode="played"] .match-editor-data-card,
#editorPartido[data-editor-mode="played"] .match-participation-panel,
#editorPartido[data-editor-mode="played"] .match-editor-events-grid,
#editorPartido[data-editor-mode="played"] .match-editor-observations-card{
  display:block!important;
}

#editorPartido[data-editor-mode="played"] .card,
#editorPartido[data-editor-mode="played"] .match-participation-panel{
  background:#fff!important;
  border:1px solid #e1e8e1!important;
  border-radius:18px!important;
  box-shadow:none!important;
}

#editorPartido[data-editor-mode="played"] .player-name,
#editorPartido[data-editor-mode="played"] .name,
#editorPartido[data-editor-mode="played"] .match-lineup-player-label{
  background:#fff!important;
  color:#111!important;
  border:1px solid #dce7dc!important;
  border-radius:999px!important;
  padding:3px 8px!important;
}

#editorPartido[data-editor-mode="played"] .match-editor-events-grid{
  gap:14px!important;
}
#editorPartido[data-editor-mode="played"] .match-editor-events-grid>.card.cp-postmatch-changes-hidden{
  display:none!important;
}

/* =========================================================
   PARTIDO JUGADO · PREMIUM FINAL V3.1
   ========================================================= */

/* Neutraliza el fondo oscuro heredado alrededor de la participación */
html body:not(.family-live-mode) #partidos #editorPartido[data-editor-mode="played"] .match-participation-simple,
html body:not(.family-live-mode) #partidos #editorPartido[data-editor-mode="played"] .match-participation-simple .match-participation-list-wrap{
  background:#fff!important;
  background-image:none!important;
  border-color:#dce6dd!important;
  box-shadow:none!important;
}

/* Cabecera y zona de añadir jugador */
html body #partidos #editorPartido[data-editor-mode="played"] .match-participation-heading{
  background:#fff!important;
  background-image:none!important;
  color:#17231b!important;
  border-bottom:1px solid #e2e9e3!important;
  padding:14px 16px!important;
}

html body #partidos #editorPartido[data-editor-mode="played"] .cp-played-add-player{
  margin:12px 12px 4px!important;
  padding:12px!important;
  background:#f5faf5!important;
  background-image:none!important;
  border:1px solid #d7e8d9!important;
  border-radius:14px!important;
}

/* Cuadrícula y controles */
html body #partidos #editorPartido[data-editor-mode="played"] #tablaParticipacion{
  background:#fff!important;
  background-image:none!important;
  padding:10px 12px 14px!important;
  gap:10px!important;
}

html body #partidos #editorPartido[data-editor-mode="played"] .cp-played-controls{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(72px,auto))!important;
  justify-content:end!important;
  gap:5px!important;
}

html body #partidos #editorPartido[data-editor-mode="played"] .cp-played-control{
  min-width:72px!important;
  justify-content:center!important;
  padding:5px 7px!important;
  box-sizing:border-box!important;
}

html body #partidos #editorPartido[data-editor-mode="played"] .cp-played-player-row.is-starter{
  background:#fbfefb!important;
  border-color:#b9e5bd!important;
  box-shadow:inset 3px 0 0 #42c84f!important;
}

html body #partidos #editorPartido[data-editor-mode="played"] .cp-played-player-row:not(.is-starter){
  background:#fff!important;
  border-color:#e4e9e5!important;
  box-shadow:none!important;
}

@media(max-width:760px){
  html body #partidos #editorPartido[data-editor-mode="played"] .cp-played-controls{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    width:100%!important;
  }
  html body #partidos #editorPartido[data-editor-mode="played"] .cp-played-control{
    min-width:0!important;
  }
}

/* PARTIDO JUGADO - LAYOUT DESKTOP V3.2 */
@media (min-width:761px){
  html body #partidos #editorPartido[data-editor-mode="played"]{
    width:min(1240px,calc(100% - 32px))!important;
    max-width:1240px!important;
    margin-inline:auto!important;
  }

  html body #partidos #editorPartido[data-editor-mode="played"] .match-editor-events-grid{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:14px!important;
    align-items:start!important;
  }

  html body #partidos #editorPartido[data-editor-mode="played"] .match-editor-events-grid > .card:nth-child(3){
    grid-column:1 / -1!important;
  }
}


/* PLAYED FULL DESKTOP WIDTH V3.4 */
@media (min-width:1101px){
  html body #partidos:has(> #editorPartido[data-editor-mode="played"]){
    width:min(1500px,calc(100vw - 64px))!important;
    max-width:1500px!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }
  html body #partidos #editorPartido[data-editor-mode="played"]{
    width:100%!important;
    max-width:none!important;
    margin-left:auto!important;
    margin-right:auto!important;
    transform:none!important;
  }
}
