/* --- Responsive, estilos por grupo --- */
.tabla-posiciones-fixed {
  min-width: 100%;
  width: 100%;
  table-layout: auto;
  background: #222;
  border: 2px solid #FFD600;
  border-radius: 6px;
  margin: 0 auto;
  border-collapse: separate;
  border-spacing: 0;
}

/* Wrapper para scroll horizontal controlado en móviles */
.tabla-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1em;
}

.tabla-wrapper .tabla-posiciones-fixed {
  min-width: 650px;
}
.tabla-posiciones-fixed th, .tabla-posiciones-fixed td {
  vertical-align: middle;
  text-align: center;
  padding: 8px 4px;
  border: none;
  font-size: 1em;
  font-weight: bold;
  color: #FFD600;
  word-break: break-word;
}
.tabla-posiciones-fixed th {
  background: #F7B600;
  color: #1a1a1a;
  font-size: 0.95em;
  font-weight: bold;
  height: 40px;
  padding: 8px 6px;
  white-space: nowrap;
}
.tabla-posiciones-fixed td {
  color: #fff;
  font-weight: normal;
  height: 44px;
  padding: 10px 6px;
}
.equipo-grande {
  font-size: 1.1em;
  font-weight: bold;
  color: #FFD600;
}

/* Columnas de tabla con ancho mínimo para evitar aglomeración */
.tabla-posiciones-fixed th:first-child,
.tabla-posiciones-fixed td:first-child {
  min-width: 50px;
  padding-left: 10px;
}

.tabla-posiciones-fixed th:nth-child(2),
.tabla-posiciones-fixed td:nth-child(2) {
  min-width: 140px;
  text-align: left;
  padding-left: 12px;
}

.tabla-posiciones-fixed th:not(:first-child):not(:nth-child(2)),
.tabla-posiciones-fixed td:not(:first-child):not(:nth-child(2)) {
  min-width: 40px;
}
.grupo-card {
  border: 4px solid #FFD600;
  background: #B71C1C;
  border-radius: 12px;
  box-shadow: 0 2px 12px #0008;
  margin-bottom: 2em;
  padding: 1em;
}
.copa-titulo {
  color: #FFD600;
  font-weight: bold;
  margin-top: 1em;
}
.copa-lista {
  color: #FFF;
  background: #222;
  border-radius: 6px;
  margin-top: .5em;
  padding: .5em 1em;
  font-weight: bold;
}
.cruce-copa {
  margin-top: 1em;
  background: #FFEB3B;
  border-radius: 11px;
  padding: 1em;
  box-shadow: 0 2px 12px #0006;
}
.cruce-copa-titulo {
  color: #B71C1C;
  font-weight: bold;
  font-size: 1.25em;
  margin-bottom: 7px;
}

/* --- PARTIDO: centrado y botón a la derecha - responsive --- */
.cruce-partido {
  margin-bottom: .8em;
  padding: 1em 1em;
  border-radius: 10px;
  background: #222;
  color: #FFD600;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.5em;
  font-size: 1em;
  min-height: 130px;
  box-sizing: border-box;
  border: 2px solid #FFD600;
  /* Estilo por grupo */
}
.cruce-partido[data-grupo] {
  box-shadow: 0 3px 16px #0007;
  border-left: 8px solid #FFD600;
}
.cruce-partido-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  min-height: 120px;
}

/* Cuando hay penales, ajustar hacia arriba */
.cruce-partido-main.con-penales {
  justify-content: flex-start;
  padding-top: 15px;
}

.cruce-equipos {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 10px 0;
  padding: 10px 50px 10px 10px; /* Espacio para botón derecho */
  gap: 10px;
  flex-wrap: nowrap;
}

/* RESPONSIVE LAYOUT: Flexbox en lugar de position absolute */
.goles-local,
.goles-visitante {
  width: 48px;
  height: 36px;
  text-align: center;
  font-size: 1.15em;
  background: #222;
  color: #FFD600;
  border: 2px solid #FFD600;
  border-radius: 7px;
  margin: 0;
  box-sizing: border-box;
  flex-shrink: 0;
}

/* EQUIPOS: Layout flexible responsive */
.equipo-local,
.equipo-visitante {
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  max-width: 200px;
  font-size: 1.1em;
  font-weight: bold;
}

.equipo-local {
  text-align: right;
  padding-right: 10px;
}

.equipo-visitante {
  text-align: left;
  padding-left: 10px;
}

.cruce-input {
  width: 48px;
  height: 36px;
  text-align: center;
  font-size: 1.15em;
  background: #222;
  color: #FFD600;
  border: 2px solid #FFD600;
  border-radius: 7px;
  margin: 0;
  box-sizing: border-box;
}

.vs {
  display: none;
}

/* Asegurar que el vs de Copa de Amistad se muestre */
.cruce-amistad .cruce-vs {
  display: inline-flex !important;
}
.cruce-penales {
  margin-top: 0.3em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  margin-bottom: 0.2em;
  flex-wrap: wrap;
}
.penales-label {
  font-size: 1em;
  font-weight: bold;
  color: #FFD600;
  margin-right: 0.7em;
}
.cruce-input.penales-local,
.cruce-input.penales-visitante {
  width: 36px;
  font-size: 1.1em;
  border: 2px solid #FFD600;
  background: #222;
  color: #FFD600;
  border-radius: 7px;
  text-align: center;
  margin-right: 2px;
}

/* === RESPONSIVE DESIGN PARA MOBILE Y TABLET === */

/* Nuevos estilos para la estructura mejorada de penales */
.penales-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.penal-inputs-row {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.penal-input-group {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin: 0.1rem;
}

/* Responsive para tablas de grupos en móviles verticales */
@media (max-width: 768px) and (orientation: portrait) {
  .grupo-card {
    padding: 0.5em;
    margin-bottom: 1.5em;
  }
  
  .tabla-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .tabla-posiciones-fixed {
    min-width: 100%;
    font-size: 0.75em;
  }
  
  .tabla-posiciones-fixed th,
  .tabla-posiciones-fixed td {
    padding: 6px 3px;
    font-size: 0.85em;
  }
  
  .tabla-posiciones-fixed th:nth-child(2),
  .tabla-posiciones-fixed td:nth-child(2) {
    min-width: 100px;
    padding-left: 8px;
  }
  
  .tabla-posiciones-fixed th:first-child,
  .tabla-posiciones-fixed td:first-child {
    min-width: 35px;
    padding-left: 6px;
  }
  
  .tabla-posiciones-fixed th:not(:first-child):not(:nth-child(2)),
  .tabla-posiciones-fixed td:not(:first-child):not(:nth-child(2)) {
    min-width: 32px;
  }
  
  .equipo-grande {
    font-size: 0.95em;
  }
}

/* Responsive para móviles en modo horizontal (landscape) */
@media (max-width: 915px) and (orientation: landscape) {
  .grupo-card {
    padding: 0.3em;
    margin-bottom: 1em;
  }
  
  .tabla-posiciones-fixed {
    font-size: 0.65em;
    min-width: 100%;
  }
  
  .tabla-posiciones-fixed th,
  .tabla-posiciones-fixed td {
    padding: 4px 2px;
    font-size: 0.75em;
  }
  
  .tabla-posiciones-fixed th {
    height: 28px;
    padding: 4px 3px;
    font-size: 0.7em;
  }
  
  .tabla-posiciones-fixed td {
    height: 32px;
    padding: 5px 3px;
  }
  
  .tabla-posiciones-fixed th:nth-child(2),
  .tabla-posiciones-fixed td:nth-child(2) {
    min-width: 70px;
    padding-left: 5px;
    font-size: 0.75em;
  }
  
  .tabla-posiciones-fixed th:first-child,
  .tabla-posiciones-fixed td:first-child {
    min-width: 25px;
    padding-left: 4px;
    font-size: 0.7em;
  }
  
  .tabla-posiciones-fixed th:not(:first-child):not(:nth-child(2)),
  .tabla-posiciones-fixed td:not(:first-child):not(:nth-child(2)) {
    min-width: 24px;
    font-size: 0.65em;
  }
  
  .equipo-grande {
    font-size: 0.8em;
  }
  
  /* Ajustar wrapper para evitar scroll horizontal innecesario */
  .tabla-wrapper {
    overflow-x: visible;
  }
  
  .tabla-wrapper .tabla-posiciones-fixed {
    min-width: 100%;
  }
}

/* Responsive para móviles pequeños en horizontal */
@media (max-width: 667px) and (orientation: landscape) {
  .grupo-card {
    padding: 0.2em;
    margin-bottom: 0.8em;
    border-width: 2px;
  }
  
  .tabla-posiciones-fixed {
    font-size: 0.6em;
  }
  
  .tabla-posiciones-fixed th,
  .tabla-posiciones-fixed td {
    padding: 3px 2px;
    font-size: 0.7em;
  }
  
  .tabla-posiciones-fixed th {
    height: 26px;
    padding: 3px 2px;
    font-size: 0.65em;
  }
  
  .tabla-posiciones-fixed td {
    height: 30px;
    padding: 4px 2px;
  }
  
  .tabla-posiciones-fixed th:nth-child(2),
  .tabla-posiciones-fixed td:nth-child(2) {
    min-width: 60px;
    padding-left: 4px;
    font-size: 0.7em;
  }
  
  .tabla-posiciones-fixed th:first-child,
  .tabla-posiciones-fixed td:first-child {
    min-width: 22px;
    padding-left: 3px;
    font-size: 0.65em;
  }
  
  .tabla-posiciones-fixed th:not(:first-child):not(:nth-child(2)),
  .tabla-posiciones-fixed td:not(:first-child):not(:nth-child(2)) {
    min-width: 22px;
    font-size: 0.6em;
  }
  
  .equipo-grande {
    font-size: 0.75em;
  }
}

/* Responsive para pantallas medianas (tablets) */
@media (max-width: 768px) {
  .cruce-partido {
    flex-direction: column;
    padding: 1rem 0.5rem;
    min-height: auto;
    gap: 1rem;
  }
  
  .cruce-equipos {
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
    text-align: center;
    padding: 10px;
    position: relative;
  }
  
  .equipo-grande,
  .equipo-local,
  .equipo-visitante {
    font-size: 1rem;
    margin: 0;
    word-break: break-word;
    max-width: 100%;
    text-align: center;
    padding: 0;
  }
  
  .cruce-input,
  .goles-local,
  .goles-visitante {
    width: 50px;
    height: 40px;
    font-size: 1.2rem;
    margin: 0 0.3rem;
  }
  
  /* Botón Gestionar Partido en móviles - mover a posición visible */
  .btn-gestionar-partido {
    position: static;
    transform: none;
    width: 100%;
    max-width: 200px;
    height: 45px;
    margin: 0.5rem auto;
    order: -1; /* Mover al principio */
  }
  
  /* Botón Guardar en móviles */
  .cruce-btn {
    position: static;
    width: 100%;
    max-width: 200px;
    margin: 0.5rem auto;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
  }
  
  .penales-container {
    flex-direction: column;
    gap: 0.8rem;
    padding: 1rem 0;
  }
  
  .penal-inputs-row {
    gap: 0.4rem;
    justify-content: center;
  }
  
  .penales-label {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    text-align: center;
  }
  
  .cruce-input.penales-local,
  .cruce-input.penales-visitante {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
    margin: 0;
  }
  
  .penal-indicator {
    width: 30px;
    height: 30px;
  }
  
  .cruce-vs {
    font-size: 1.5rem;
    margin: 0.5rem 0;
    font-weight: bold;
    padding: 0 6px;
  }
}

/* Responsive para pantallas pequeñas (móviles) */
@media (max-width: 480px) {
  .grupo-card {
    padding: 0.4em;
    margin-bottom: 1.2em;
    border-width: 3px;
  }
  
  .tabla-posiciones-fixed {
    font-size: 0.7em;
  }
  
  .tabla-posiciones-fixed th,
  .tabla-posiciones-fixed td {
    padding: 5px 2px;
    font-size: 0.8em;
  }
  
  .tabla-posiciones-fixed th {
    height: 35px;
    padding: 6px 4px;
  }
  
  .tabla-posiciones-fixed td {
    height: 38px;
    padding: 8px 4px;
  }
  
  .tabla-posiciones-fixed th:nth-child(2),
  .tabla-posiciones-fixed td:nth-child(2) {
    min-width: 85px;
    padding-left: 6px;
    font-size: 0.85em;
  }
  
  .tabla-posiciones-fixed th:first-child,
  .tabla-posiciones-fixed td:first-child {
    min-width: 30px;
    padding-left: 5px;
  }
  
  .tabla-posiciones-fixed th:not(:first-child):not(:nth-child(2)),
  .tabla-posiciones-fixed td:not(:first-child):not(:nth-child(2)) {
    min-width: 28px;
    font-size: 0.75em;
  }
  
  .equipo-grande {
    font-size: 0.9em;
  }
  
  .cruce-partido {
    padding: 0.8rem 0.5rem;
    margin-bottom: 1rem;
  }
  
  .equipo-local,
  .equipo-visitante {
    font-size: 0.95rem;
    word-break: break-word;
    text-align: center;
    max-width: 100%;
    padding: 0;
  }
  
  .cruce-input,
  .goles-local,
  .goles-visitante {
    width: 45px;
    height: 35px;
    font-size: 1.1rem;
  }
  
  /* Botones más compactos en móviles pequeños */
  .btn-gestionar-partido {
    max-width: 100%;
    font-size: 0.9rem;
  }
  
  .cruce-btn {
    max-width: 100%;
    font-size: 0.9rem;
    padding: 0.7rem 1.2rem;
  }
  
  .penales-container {
    gap: 0.6rem;
    padding: 0.8rem 0;
  }
  
  .penal-inputs-row {
    gap: 0.3rem;
  }
  
  .penales-label {
    font-size: 1rem;
  }
  
  .cruce-input.penales-local,
  .cruce-input.penales-visitante {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }
  
  .penal-indicator {
    width: 28px;
    height: 28px;
  }
  
  .cruce-vs {
    font-size: 1.2rem;
    margin: 0.4rem 0;
    padding: 0 4px;
  }
  
  /* Botón guardar responsive */
  .cruce-btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    margin-top: 1rem;
    width: 100%;
    max-width: 150px;
  }
}

/* Responsive para pantallas muy pequeñas */
@media (max-width: 360px) {
  .grupo-card {
    padding: 0.3em;
    margin-bottom: 1em;
    border-width: 2px;
  }
  
  .tabla-posiciones-fixed {
    font-size: 0.65em;
  }
  
  .tabla-posiciones-fixed th,
  .tabla-posiciones-fixed td {
    padding: 4px 2px;
    font-size: 0.75em;
  }
  
  .tabla-posiciones-fixed th {
    height: 32px;
    padding: 5px 3px;
  }
  
  .tabla-posiciones-fixed td {
    height: 35px;
    padding: 6px 3px;
  }
  
  .tabla-posiciones-fixed th:nth-child(2),
  .tabla-posiciones-fixed td:nth-child(2) {
    min-width: 75px;
    padding-left: 5px;
    font-size: 0.8em;
  }
  
  .tabla-posiciones-fixed th:first-child,
  .tabla-posiciones-fixed td:first-child {
    min-width: 28px;
    padding-left: 4px;
  }
  
  .tabla-posiciones-fixed th:not(:first-child):not(:nth-child(2)),
  .tabla-posiciones-fixed td:not(:first-child):not(:nth-child(2)) {
    min-width: 26px;
    font-size: 0.7em;
  }
  
  .equipo-grande {
    font-size: 0.85em;
  }
  
  .cruce-equipos {
    gap: 0.6rem;
    padding: 5px;
  }
  
  .equipo-local,
  .equipo-visitante {
    font-size: 0.85rem;
    max-width: 100%;
  }
  
  .cruce-input,
  .goles-local,
  .goles-visitante {
    width: 40px;
    height: 32px;
    font-size: 1rem;
  }
  
  .penales-container {
    gap: 0.5rem;
  }
  
  .penal-inputs-row {
    gap: 0.2rem;
  }
  
  .cruce-input.penales-local,
  .cruce-input.penales-visitante {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }
  
  .penal-indicator {
    width: 25px;
    height: 25px;
  }
  
  .penales-label {
    font-size: 0.85rem;
  }
  
  .btn-gestionar-partido {
    height: 40px;
    font-size: 0.85rem;
  }
  
  .cruce-btn {
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
  }
  
  /* Tablas más compactas */
  .tabla-posiciones-fixed th,
  .tabla-posiciones-fixed td {
    font-size: 0.75rem;
    padding: 5px 3px;
  }
  
  .tabla-posiciones-fixed th:nth-child(2),
  .tabla-posiciones-fixed td:nth-child(2) {
    min-width: 100px;
    font-size: 0.8rem;
  }
  
  /* Acordeones y títulos */
  .cruce-copa-titulo {
    font-size: 1rem;
    padding: 0.5rem;
  }
  
  .copa-accordion-btn {
    font-size: 1rem;
    padding: 0.5rem 0.8rem;
  }
}

/* Asegurar que las tablas también sean responsive */
@media (max-width: 768px) {
  .tabla-posiciones-fixed {
    font-size: 0.85rem;
  }
  
  .tabla-posiciones-fixed th,
  .tabla-posiciones-fixed td {
    padding: 6px 4px;
    font-size: 0.85rem;
  }
  
  .tabla-posiciones-fixed th:nth-child(2),
  .tabla-posiciones-fixed td:nth-child(2) {
    min-width: 120px;
    padding-left: 8px;
  }
  
  .grupo-card {
    padding: 0.8rem;
    margin-bottom: 1.5rem;
  }
}

/* Mejorar el layout general para móviles */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  .copa-accordion-content {
    padding: 1rem 0.5rem;
  }
  
  .cruce-copa-titulo {
    font-size: 1.1rem;
    padding: 0.8rem;
    text-align: center;
  }
}
.penal-indicator {
  display: inline-block;
  width: 34px;
  height: 28px;
  border-radius: 6px;
  border: 2px solid #f2c400; /* borde amarillo */
  background: transparent;
  margin-left: 6px;
  margin-right: 6px;
  vertical-align: middle;
  position: relative;
  box-sizing: border-box;
}

/* estado convertido */
.penal-indicator.checked {
  background: #ffffff;
  border-color: #e6b800;
}

/* estado fallado (visualmente cruz roja) */
.penal-indicator.fail {
  background: transparent;
  border-color: #f2c400;
}

/* pseudo-elementos para mostrar ✓ o ✕ */
.penal-indicator.checked::after,
.penal-indicator.fail::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  pointer-events: none;
  color: #222;
}
.penal-indicator.checked::after { content: "✓"; color: #0b0b0b; }
.penal-indicator.fail::after    { content: "✕"; color: #b91c1c; }

/* Mantener compatibilidad - ocultamos/neutralizamos los emoji antiguos si aún existen */
.penal-ok, .penal-fail {
  display: none; /* migramos al indicador visual para tener control total por CSS */
}

/* Opcional: input de penal (clase penal-input para listeners) */
input.cruce-input.penal-input {
  width: 34px;
  height: 28px;
  padding: 0;
  margin: 0;
  text-align: center;
  border-radius: 6px;
  border: 2px solid transparent;
  background: transparent;
  box-sizing: border-box;
  font-weight: 600;
  color: #222;
}

/* Si preferís ocultar el número dentro del input y usar solo el indicador,
   descomentá estas líneas (ej. para UX sólo visual):
*/
/*
input.cruce-input.penal-input {
  color: transparent;
  caret-color: transparent;
}
*/
/* === FIN indicador === */

.penal-ok {
  color: #2ecc40;
  font-size: 2.5em;
  font-weight: bold;
  vertical-align: middle;
  margin-left: 2px;
  margin-right: 5px;
}
.penal-fail {
  color: #ff4136;
  font-size: 1.3em;
  font-weight: bold;
  vertical-align: middle;
  margin-left: 2px;
  margin-right: 5px;
}
.penal-ok svg {
  display: inline;
  vertical-align: middle;
  position: relative;
  top: -7px;   /* Ajusta este valor (-2px, -3px, -1px según el caso) */
}
.penal-ok { font-weight: bold; }
.penal-fail { color: #F06292 !important; font-weight: bold; font-size: 1.2em; }
.cruce-btn {
  background: #B71C1C;
  color: #FFD600;
  border: none;
  border-radius: 8px;
  padding: 0.7em 1.7em;
  font-weight: bold;
  cursor: pointer;
  font-size: 1.1em;
  transition: background .2s;
  box-shadow: 0 2px 8px #0004;
  align-self: flex-end;
  margin-left: auto;
  white-space: nowrap;
}

/* Botón Gestionar Partido - mejorado para responsive */
.btn-gestionar-partido {
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  background: #FFD600;
  border-color: #FFD600;
  width: 50px;
  height: 50px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 0;
  min-width: 50px;
  flex-shrink: 0;
}

/* Estilos específicos para Copa de Amistad - Versión simple */
.cruce-amistad .cruce-equipos-amistad {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px;
  gap: 40px;
  position: relative;
}

.cruce-amistad .inputs-row-amistad {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.cruce-amistad .cruce-input {
  margin: 0 !important;
  position: static !important;
  width: 60px !important;
  height: 36px !important;
  right: auto !important;
  left: auto !important;
}

.cruce-amistad .cruce-vs {
  margin: 0 10px !important;
  font-weight: bold !important;
  font-size: 18px !important;
  color: #fff !important;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.9) !important;
  border-left: 2px solid #ffd700 !important;
  border-right: 2px solid #ffd700 !important;
  padding: 4px 8px !important;
  background: rgba(255,215,0,0.1) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  visibility: visible !important;
  z-index: 10 !important;
  position: relative !important;
  min-width: 30px !important;
  height: 30px !important;
}

.cruce-amistad .cruce-btn {
  position: absolute;
  right: 15px;
  flex-shrink: 0;
}

/* Borde amarillo izquierdo para contenedores negros */
.cruce-amistad.cruce-partido,
.cruce-oro.cruce-partido,
.cruce-plata.cruce-partido {
  border-left: 8px solid #ffd700 !important;
}

/* Aplicar el mismo estilo a Copa de Oro y Copa de Plata */
.cruce-oro .cruce-equipos,
.cruce-plata .cruce-equipos {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px;
  gap: 40px;
  position: relative;
}

.cruce-oro .inputs-row,
.cruce-plata .inputs-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.cruce-oro .cruce-input,
.cruce-plata .cruce-input {
  position: static !important;
  width: 60px !important;
  height: 36px !important;
  right: auto !important;
  left: auto !important;
  margin: 0 !important;
}

.cruce-oro .cruce-vs,
.cruce-plata .cruce-vs {
  display: inline-flex !important;
  visibility: visible !important;
  margin: 0 10px !important;
  font-weight: bold !important;
  font-size: 18px !important;
  color: #fff !important;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.9) !important;
  border-left: 2px solid #ffd700 !important;
  border-right: 2px solid #ffd700 !important;
  padding: 4px 8px !important;
  background: rgba(255,215,0,0.1) !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 30px !important;
  height: 30px !important;
}

.cruce-oro .cruce-btn,
.cruce-plata .cruce-btn {
  position: absolute;
  right: 15px;
}

/* Los estilos de acordeón manejan la visibilidad correctamente */

/* ESTILO CORRECTO DEL VS EN COPA DE AMISTAD */
.cruce-partido.cruce-amistad .inputs-row-amistad .cruce-vs {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: static !important;
  transform: none !important;
  margin: 0 10px !important;
  font-weight: bold !important;
  font-size: 18px !important;
  color: #fff !important;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.9) !important;
  border-left: 2px solid #ffd700 !important;
  border-right: 2px solid #ffd700 !important;
  padding: 4px 8px !important;
  background: rgba(255,215,0,0.1) !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 30px !important;
  height: 30px !important;
}

/* Cuando no hay penales, mantener el botón a la derecha pero bajar los inputs */
.cruce-partido:not(.con-penales) .cruce-btn {
  align-self: flex-end;
  margin-left: 2em;
}
.cruce-btn:disabled {
  background: #888;
  color: #333;
  cursor: default;
}
/* Acordeón animado */
.copa-accordion {
  margin-bottom: 1.3em;
}
.copa-accordion-btn {
  background: #FFD600;
  color: #B71C1C;
  font-weight: bold;
  padding: 0.7em 1.2em;
  width: 100%;
  text-align: left;
  border: none;
  border-radius: 11px 11px 0 0;
  cursor: pointer;
  font-size: 1.2em;
  margin-bottom: 0;
  transition: background 0.2s;
}
.copa-accordion-btn.active,
.copa-accordion-btn:focus {
  background: #F7B600;
}
.copa-accordion-content {
  background: #FFEB3B;
  border-radius: 0 0 11px 11px;
  padding: 1em;
  box-shadow: 0 2px 12px #0006;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(.4,0,.2,1), padding 0.2s;
}
.copa-accordion-content.open {
  max-height: 3000px; /* aumentado para incluir todos los partidos + final */
  padding: 1em;
  transition: max-height 0.35s cubic-bezier(.4,0,.2,1), padding 0.2s;
}

/* Responsive */
@media (max-width: 900px) {
  .cruce-partido {
    flex-direction: column;
    min-height: auto;
    align-items: stretch;
    padding: 1em 0.5em;
  }
  
  .cruce-equipos {
    flex-direction: column;
    padding: 10px;
  }
  
  .cruce-btn {
    position: static;
    margin: 0.5rem auto;
    width: 100%;
    max-width: 250px;
  }
  
  .btn-gestionar-partido {
    position: static;
    transform: none;
    width: 100%;
    max-width: 250px;
    margin: 0.5rem auto;
  }
  
  .cruce-partido-main {
    width: 100%;
    align-items: center;
  }
  
  .grupo-card {
    padding: 1em 0.5em;
  }
  
  /* Inputs más visibles en tablets */
  .cruce-input,
  .goles-local,
  .goles-visitante {
    width: 55px;
    height: 38px;
  }
}
@media (max-width: 600px) {
  .cruce-partido {
    min-height: auto;
    padding: 0.8em 0.5em;
    font-size: 0.9em;
  }
  
  .cruce-btn {
    font-size: 0.95em;
    padding: 0.8em 1.2em;
    max-width: 100%;
  }
  
  .cruce-equipos {
    gap: 0.5em;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .cruce-penales {
    gap: 0.3em;
    flex-wrap: wrap;
  }
  
  .cruce-input,
  .goles-local,
  .goles-visitante {
    width: 48px;
    height: 36px;
    font-size: 1.1em;
    margin: 0;
  }
  
  .grupo-card {
    margin-bottom: 1em;
    padding: 0.8em 0.5em;
  }

  .cruce-input.penales-local {
    border-color: #ff4136 !important;
  }
  
  .cruce-input.penales-visitante {
    border-color: #FFD600 !important;
  }
  
  .mensaje-guardado {
    color: #4caf50;
    font-weight: bold;
    text-align: center;
    margin-top: 10px;
  }
  
  /* Container principal con padding lateral */
  .container {
    padding: 0 0.5rem;
  }
}
/* Forzar borde ROJO fijo en los inputs problemáticos (goles y penales) */
.cruce-input.goles-local,
.cruce-input.goles-visitante,
.cruce-input.penales-local,
.cruce-input.penales-visitante,
input.penal-input {
  border: 2px solid #b91c1c !important;   /* rojo fijo */
  background: #222 !important;
  color: #FFD600 !important;              /* texto amarillo por defecto */
  box-shadow: none !important;
}

/* Mantener rojo también en foco y hacer un halo sutil rojo */
.cruce-input.goles-local:focus,
.cruce-input.goles-visitante:focus,
.cruce-input.penales-local:focus,
.cruce-input.penales-visitante:focus,
input.penal-input:focus {
  border-color: #b91c1c !important;
  box-shadow: 0 0 0 6px rgba(185,28,28,0.12) !important; /* halo rojo */
  background: #111 !important;
  color: #fff !important; /* texto blanco al editar para contraste */
  outline: none !important;
}

/* Evitar que los spans indicadores (✓/✕) se confundan con inputs */
.penal-indicator {
  pointer-events: none;
}
/* ✓ en VERDE para penal convertido */
.penal-indicator.checked {
  background: #ffffff;           /* mantiene fondo blanco para contraste */
  border-color: #2ecc40;        /* borde verde */
}

/* símbolo (pseudo-elemento) en verde */
.penal-indicator.checked::after {
  content: "✓";
  color: #2ecc40;               /* tilde verde */
  font-weight: 700;
  font-size: 16px;
}

/* cruz sigue roja */
.penal-indicator.fail {
  border-color: #f2c400;
}
.penal-indicator.fail::after {
  content: "✕";
  color: #b91c1c;
}

/* Si todavía tenés los spans antiguos (.penal-ok/.penal-fail) y querés color verde allí también,
   descomenta la siguiente regla (o mantenela si migraste y aún los usás) */
/*
.penal-ok { display:inline-block; color:#2ecc40; font-weight:700; }
.penal-fail { display:inline-block; color:#b91c1c; font-weight:700; }
*/

/* Ocultar botones de guardar cuando no está autenticado */
body:not(.user-authenticated) .btn-guardar-cruce,
body:not(.user-authenticated) .btn-editar-cruce {
  display: none !important;
}