@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #1e293b;
    color: #e2e8f0;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.contenedor-principal {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    background-color: #0f172a;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 1100px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin: 40px auto;
    flex: 1;
}

.panel-izquierdo, .panel-derecho {
    background-color: #1e293b;
    padding: 25px;
    border-radius: 8px;
}

.panel-izquierdo h1 {
    font-size: 2.2em;
    color: #cbd5e1;
    margin-bottom: 10px;
}

.panel-izquierdo p {
    font-size: 1em;
    color: #94a3b8;
    margin-bottom: 20px;
}

.area-ingreso h2 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.contenedor-textarea {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

#areaJugadores {
    width: 100%;
    height: 100%; /* Más alto para que entren 10 jugadores cómodos */
    height: 220px;
    background-color: #334155;
    border: 1px solid #475569;
    border-radius: 6px;
    padding: 15px;
    font-family: inherit;
    font-size: 1em;
    color: #e2e8f0;
    resize: none;
    box-sizing: border-box;

}

#areaJugadores:focus {
    outline: none;
    border-color: #38bdf8;
    border-radius: 6px;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.4);
}

.contador-jugadores {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #e2e8f0;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
}

.botones-accion {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-limpiar {
    background-color: #475569;
    color: #e2e8f0;
}

.btn-limpiar:hover {
    background-color: #64748b;
}

.btn-sortear {
    background-color: #0ea5e9;
    color: #ffffff;
}

.btn-sortear:hover {
    background-color: #38bdf8;
}

/* Panel Derecho */
.panel-derecho h2 {
    text-align: center;
    font-size: 1.8em;
    margin-bottom: 15px;
    color: #cbd5e1;
}

.info-partido {
    display: grid;
    grid-template-columns: 48px 1fr 1.2fr;
    gap: 18px 12px;
    background: #19223a;
    border-radius: 14px;
    padding: 24px 18px;
    margin: 24px 0 32px 0;
    box-shadow: 0 2px 12px #0002;
    max-width: 420px;
    width: 100%;
}

.info-partido p {
    display: contents;
}

.info-partido .icono {
    font-size: 2.1em;
    display: flex;
    align-items: center;
    justify-content: center;
    grid-column: 1;
}

.info-partido strong {
    font-size: 1.18em;
    color: #e0e6ed;
    font-weight: 500;
    align-self: center;
    grid-column: 2;
}

.info-partido .editar {
    background: transparent;
    border: 2px solid #fff;
    border-radius: 12px;
    padding: 6px 18px;
    min-width: 80px;
    font-size: 1.25em;
    color: #fff;
    outline: none;
    transition: border 0.2s, background 0.2s, color 0.2s;
    margin-left: 0;
    margin-right: 0;
    text-align: center;
    grid-column: 3;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    box-sizing: border-box;
    cursor: text;
    display: inline-block;
}

.info-partido .editar:focus,
.info-partido .editar.sin-borde {
    border: 2.5px solid #00aeff;
    background: #0f172a;
    color: #00aeff;
}




.campo-juego {
    background-color: #064e3b;
    border: 3px solid #16a34a;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    padding: 20px;
    min-height: 250px;
    background-image:
        radial-gradient(circle at center, white 2px, transparent 2px),
        linear-gradient(to bottom, transparent 49.5%, #16a34a 49.5%, #16a34a 50.5%, transparent 50.5%);
    background-size: 100% 100%, 100% 100%;
}

.equipo {
    width: 45%;
}

.equipo h3 {
    font-size: 1.4em;
    margin-bottom: 15px;
    text-align: center;
    padding-bottom: 5px;
}

#equipo-blanco h3 {
    color: black;
    background-color: white;
    border-radius: 4px;
    padding: 4px;
}

#equipo-negro h3 {
    color: white;
    background-color: black;
    border-radius: 4px;
    padding: 4px;
}

.equipo ul {
    list-style: none;
}

.equipo li {
    padding: 8px;
    margin-bottom: 8px;
    border-radius: 4px;
    font-weight: 500;
}

#equipo-blanco li {
    background-color: rgba(255, 255, 255, 0.9);
    color: #0f172a;
}

#equipo-negro li {
    background-color: #0f172a;
    color: #e2e8f0;
    border: 1px solid #334155;
}

.goalkeeper {
    font-weight: bold;
}

.goalkeeper::after {
    content: ' 🧤';
}

/* Agrega esto a tu style.css */
.icono-guantes, .icono-botin {
    width: 22px;
    height: 22px;
    vertical-align: middle;
    cursor: pointer;
    margin-right: 4px;
    transition: filter 0.2s;
}
.icono-guantes.seleccionado {
    filter: drop-shadow(0 0 4px #ffd700);
}
.goalkeeper {
    font-weight: bold;
    color: #0077cc;
}

#lista-jugadores {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    padding: 10px 0 0 0;
    list-style: none;
    margin: 0;
}

#lista-jugadores li {
    background: #19223a;
    color: #fff;
    border-radius: 8px;
    padding: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.12em;
    min-width: 110px;
    box-shadow: 0 2px 8px #0002;
    transition: background 0.2s, color 0.2s;
    cursor: pointer;
    border: 2px solid transparent;
}

#lista-jugadores li.es-arquero {
    background: #ffe066;
    color: #222;
    font-weight: bold;
    border: 2px solid #ffd700;
}

#lista-jugadores .icono-jugador {
    font-size: 1.4em;
    min-width: 28px;
    text-align: center;
    transition: filter 0.2s;
}

#lista-jugadores li.es-arquero .icono-jugador {
    filter: drop-shadow(0 0 2px #ffd700);
}
.icono-jugador, .icono-arquero {
    cursor: pointer;
    font-size: 1.5em;
    transition: filter 0.2s;
}
.icono-arquero.seleccionado {
    filter: drop-shadow(0 0 4px #ffd700);
}
/* ...existing code... */

/* --- Adaptación responsive para mobile --- */
@media (max-width: 800px) {
    body {
        align-items: flex-start;
        min-height: unset;
    }
    .contenedor-principal {
        display: flex;
        flex-direction: column;
        gap: 20px;
        width: 100%;
        max-width: 100vw;
        padding: 10px;
        border-radius: 0;
        box-shadow: none;
    }
    .panel-izquierdo, .panel-derecho {
        padding: 15px;
        border-radius: 8px;
        width: 100%;
        box-sizing: border-box;
    }
    .panel-izquierdo {
        order: 1;
    }
    .panel-derecho {
        order: 2;
    }
    .campo-juego {
        flex-direction: column;
        align-items: center;
        padding: 10px;
        min-height: 180px;
    }
    .equipo {
        width: 100%;
        margin-bottom: 18px;
    }
    .equipo:last-child {
        margin-bottom: 0;
    }
    .equipo h3 {
        font-size: 1.1em;
        margin-bottom: 10px;
    }
    .botones-accion {
        flex-direction: column;
        gap: 10px;
    }

    .contenedor-textarea {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    background: #334155; /* igual que el textarea */
    border: 1px solid #475569;
    border-radius: 6px;
    padding: 0 0 0 0; /* espacio abajo para la lista y el contador */
    box-sizing: border-box;
}

#areaJugadores {
    width: 100%;
    min-height: 180px;
    background-color: transparent; /* para que se vea el fondo del contenedor */
    border: none;
    border-radius: 6px 6px 0 0;
    padding: 15px;
    font-family: inherit;
    font-size: 1em;
    color: #e2e8f0;
    resize: none;
    box-sizing: border-box;
}

#lista-jugadores {
    margin: 8px;
    padding: 0 15px 0 15px;
    list-style: none;
    background: transparent;
}

#lista-jugadores li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2em;
    margin-bottom: 6px;
    color: #e2e8f0;
}
    .contador-jugadores {
        bottom: 8px;
        right: 8px;
        font-size: 0.85em;
        padding: 3px 8px;
    }
    .info-partido {
        font-size: 0.98em;
        padding: 10px;
    }

    .info-partido {
    padding: 14px 3vw;
    max-width: 400px;
  }
  .info-partido p {
    font-size: 0.98rem;
  }
}

    @media (max-width: 800px) {
    #lista-blanco,
    #lista-negro {
        display: grid;
        grid-template-rows: repeat(4, 40px);
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px 0;
        width: 100%;
        max-width: 340px;
        margin: 0 auto;
        padding: 0;
        justify-items: center;
        align-items: center;
    }
    #lista-blanco li,
    #lista-negro li {
        min-width: max-content;
        text-align: center;
        word-break: break-all;
        border-radius: 4px;
        padding: 6px 8px;
        font-weight: 500;
        justify-self: center;
        background: rgba(255,255,255,0.9);
        color: #0f172a;
        border: none;
    }
    #lista-negro li {
        background: #0f172a;
        color: #e2e8f0;
        border: 1px solid #334155;
    }

    /* --- EQUIPO BLANCO --- */
    /* Arquero blanco arriba, centrado */
    #lista-blanco li.goalkeeper,
    #lista-blanco li:nth-child(1).goalkeeper {
        background: #ffe066 !important;
        color: #0f172a !important;
        font-weight: bold;
        grid-row: 1;
        grid-column: 2;
        width: max-content;
        min-width: unset;
        margin-left: auto;
        margin-right: auto;
        display: block;
    }
    /* Defensores blancos */
    #lista-blanco li:nth-child(2) { grid-row: 2; grid-column: 1; }
    #lista-blanco li:nth-child(3) { grid-row: 2; grid-column: 3; }
    /* Delanteros blancos */
    #lista-blanco li:nth-child(4) { grid-row: 3; grid-column: 1; }
    #lista-blanco li:nth-child(5) { grid-row: 3; grid-column: 3; }

    /* --- EQUIPO NEGRO --- */
    /* Arquero negro abajo, centrado */
    #lista-negro li.goalkeeper,
    #lista-negro li:nth-child(1).goalkeeper {
        background: #ffe066 !important;
        color: #0f172a !important;
        font-weight: bold;
        grid-row: 4;
        grid-column: 2;

        width: max-content;
        min-width: unset;
        margin-left: auto;
        margin-right: auto;
        display: block;
    }
    /* Delanteros negros */
    #lista-negro li:nth-child(2) { grid-row: 3; grid-column: 1; }
    #lista-negro li:nth-child(3) { grid-row: 3; grid-column: 3; }
    /* Defensores negros */
    #lista-negro li:nth-child(4) { grid-row: 2; grid-column: 1; }
    #lista-negro li:nth-child(5) { grid-row: 2; grid-column: 3; }
}

@media (max-width: 600px) {
   .info-partido {
    max-width: 100%;
    padding: 10px 2vw 6px 2vw;
  }
  .info-partido p {
    font-size: 0.98rem;
    max-width: 96vw;
    padding: 0px 0;
  }
  .info-partido .editar {
    max-width: 90vw;
    font-size: 0.97em;
  }
}
  .info-partido strong {
    min-width: 90px;
    font-size: 0.97em;
  }
  .info-partido .icono {
    font-size: 1.2em;
    min-width: 22px;
  }
   #lista-jugadores {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(5, 1fr);
  }
  




/* Mejoras para pantallas muy pequeñas */
@media (max-width: 480px) {
    .panel-izquierdo h1 {
        font-size: 1.3em;
    }
    .area-ingreso h2 {
        font-size: 1.1em;
    }
    .panel-derecho h2 {
        font-size: 1.2em;
    }
    .campo-juego {
        min-height: 120px;
        padding: 5px;
    }
    .equipo li {
        font-size: 0.98em;
        padding: 6px;
    }
    .icono-guantes, .icono-botin {
        width: 18px;
        height: 18px;
        margin-right: 2px;
    }
}

/* FOOTER */

/* Footer Ocho */
.footer-ocho {
  width: 100%;
  background: transparent;
  padding: 20px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: auto;
}

.footer-content {
  display: flex;
  align-items: center;
  gap: 24px;
  background: rgba(15, 23, 42, 0.95);
  border-radius: 12px;
  padding: 16px 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-text {
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.5px;
  font-family: 'Roboto', sans-serif;
}

.footer-text em {
  font-style: italic;
  font-weight: 600;
  font-size: 14px;
  color: #38bdf8;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

.footer-icons {
  display: flex;
  gap: 16px;
}

.footer-icons img {
  width: 22px;
  height: 22px;
  filter: brightness(0) invert(1);
  opacity: 0.8;
  transition: all 0.3s ease;
  cursor: pointer;
}

.footer-icons img:hover {
  opacity: 1;
  transform: translateY(-2px) scale(1.1);
  filter: brightness(0) invert(1) drop-shadow(0 0 8px rgba(56, 189, 248, 0.6));
}

/* Adaptación mobile */
@media (max-width: 800px) {
  body {
    display: block;
  }
  
  .contenedor-principal {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 100vw;
    padding: 10px;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    flex: none;
  }
  
  .footer-ocho {
    margin-top: 20px;
    padding: 15px 0;
  }
  
  .footer-content {
    background: rgba(15, 23, 42, 1);
    padding: 12px 24px;
    gap: 16px;
  }
  
  .footer-text {
    font-size: 12px;
  }
  
  .footer-text em {
    font-size: 13px;
  }
  
  .footer-icons {
    gap: 14px;
  }
  
  .footer-icons img {
    width: 20px;
    height: 20px;
  }
}


@keyframes fadeInMove {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.campo-juego li {
    animation: fadeInMove 0.5s cubic-bezier(.4,1.4,.6,1) both;
}


/* Modal de alerta personalizado */
.modal-alerta-oculto {
  display: none;
}
#modal-alerta {
  position: fixed;
  z-index: 9999;
  left: 0; top: 0; right: 0; bottom: 0;
  background: rgba(20,30,50,0.65);
  align-items: center;
  justify-content: center;
}
.modal-alerta-contenido {
  background: #2a3950;
  color: #fff;
  border-radius: 16px;
  padding: 38px 32px 28px 32px;
  box-shadow: 0 4px 32px #0008;
  min-width: 320px;
  max-width: 90vw;
  text-align: center;
  position: relative;
  font-size: 1.25em;
}
.modal-alerta-cerrar {
  position: absolute;
  top: 0px; right: 18px;
  background: none;
  border: none;
  font-size: 2em;
  color: #fff;
  cursor: pointer;
  transition: color 0.2s;
}
.modal-alerta-cerrar:hover {
  color: #38bdf8;
}
.modal-alerta-aceptar {
  margin-top: 28px;
  background: #0ea5e9;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 0;
  width: 100%;
  font-size: 1.1em;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}
.modal-alerta-aceptar:hover {
  background: #38bdf8;
}

/* Estilos para el historial de equipos */
.contenedor-guardar {
    margin: 20px 0;
    text-align: center;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-guardar {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-guardar:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-guardar:disabled {
    background: #374151;
    color: #6b7280;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-ver-historial {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-ver-historial:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* Modal del historial */
.modal-historial-oculto {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

#modal-historial {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-historial-contenido {
    background: #1e293b;
    border-radius: 16px;
    width: 100%;
    max-width: 900px;
    max-height: 85vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid #334155;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalAppear 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-historial-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid #334155;
    background: #0f172a;
}

.modal-historial-header h3 {
    color: #cbd5e1;
    font-size: 1.4em;
    margin: 0;
    font-weight: 600;
}

.modal-historial-cerrar {
    background: none;
    border: none;
    font-size: 2em;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.modal-historial-cerrar:hover {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    transform: scale(1.1);
}

.modal-historial-body {
    padding: 25px 30px;
    overflow-y: auto;
    flex: 1;
}

.controles-historial {
    text-align: center;
    margin-bottom: 25px;
}

.btn-limpiar-historial {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-limpiar-historial:hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

.lista-historial {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #64748b #1e293b;
}

.lista-historial::-webkit-scrollbar {
    width: 8px;
}

.lista-historial::-webkit-scrollbar-track {
    background: #1e293b;
    border-radius: 4px;
}

.lista-historial::-webkit-scrollbar-thumb {
    background: #64748b;
    border-radius: 4px;
}

.lista-historial::-webkit-scrollbar-thumb:hover {
    background: #74909b;
}

.historial-vacio {
    text-align: center;
    color: #64748b;
    font-style: italic;
    padding: 40px 20px;
    font-size: 1.1em;
}

/* Estilos para historial compacto */
.item-historial-compacto {
    background-color: #0f172a;
    border: 1px solid #334155;
    border-radius: 12px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.item-historial-compacto:hover {
    border-color: #0ea5e9;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.1);
}

.historial-fila {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.historial-fila:hover {
    background-color: rgba(148, 163, 184, 0.05);
}

.historial-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.historial-fecha-compacta {
    font-size: 0.85em;
    color: #94a3b8;
    font-weight: 500;
}

.historial-resultado-compacto {
    font-size: 0.9em;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
}

.historial-resultado-compacto.resultado-blanco {
    background-color: rgba(241, 245, 249, 0.1);
    color: #f1f5f9;
}

.historial-resultado-compacto.resultado-negro {
    background-color: rgba(15, 23, 42, 0.3);
    color: #e2e8f0;
    border: 1px solid #334155;
}

.historial-resultado-compacto.resultado-empate {
    background-color: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
}

.historial-resultado-compacto.resultado-sin {
    background-color: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
}

.historial-controles {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-editar-resultado {
    background: #0ea5e9;
    color: white;
    border: none;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.btn-editar-resultado:hover {
    background: #0284c7;
    opacity: 1;
    transform: translateY(-1px);
}

.btn-eliminar-item {
    background: #dc2626;
    color: white;
    border: none;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.btn-eliminar-item:hover {
    background: #b91c1c;
    opacity: 1;
    transform: translateY(-1px);
}

.historial-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8em;
    color: #0ea5e9;
    margin-left: 8px;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(14, 165, 233, 0.3);
    background: rgba(14, 165, 233, 0.1);
    user-select: none;
}

.historial-toggle:hover {
    background: rgba(14, 165, 233, 0.2);
    border-color: rgba(14, 165, 233, 0.5);
    transform: translateY(-1px);
}

.historial-toggle.expanded {
    background: rgba(14, 165, 233, 0.15);
    border-color: rgba(14, 165, 233, 0.4);
}

.toggle-text {
    font-weight: 500;
    font-size: 0.85em;
}

.toggle-icon {
    font-size: 1em;
    transition: transform 0.2s ease;
}

.historial-detalles {
    border-top: 1px solid #334155;
    background-color: #1e293b;
}

.historial-equipos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
}

.historial-equipo {
    background-color: #0f172a;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #334155;
}

.historial-equipo h4 {
    font-size: 1em;
    margin-bottom: 12px;
    text-align: center;
    font-weight: 600;
    padding: 8px;
    border-radius: 6px;
}

.historial-equipo.blanco h4 {
    color: #0f172a;
    background-color: #f1f5f9;
}

.historial-equipo.negro h4 {
    color: #f1f5f9;
    background-color: #0f172a;
    border: 1px solid #334155;
}

.historial-equipo ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.historial-equipo li {
    padding: 8px 12px;
    margin-bottom: 6px;
    border-radius: 6px;
    font-size: 0.95em;
    background-color: #334155;
    color: #e2e8f0;
    transition: background-color 0.2s ease;
}

.historial-equipo li:hover {
    background-color: #475569;
}

.historial-equipo li.goalkeeper {
    background-color: #fbbf24;
    color: #000;
    font-weight: 600;
}

.historial-equipo li.goalkeeper:hover {
    background-color: #f59e0b;
}

/* Estilos para edición de resultado */
.editar-resultado-section {
    padding: 20px;
    background-color: #334155;
    border-top: 1px solid #475569;
}

.editar-resultado-section h4 {
    color: #e2e8f0;
    margin-bottom: 15px;
    font-size: 0.95em;
}

.botones-resultado-edit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.btn-resultado-edit {
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-resultado-edit.blanco {
    background-color: #f1f5f9;
    color: #0f172a;
}

.btn-resultado-edit.blanco:hover {
    background-color: #e2e8f0;
    transform: translateY(-2px);
}

.btn-resultado-edit.negro {
    background-color: #0f172a;
    color: #f1f5f9;
    border: 1px solid #334155;
}

.btn-resultado-edit.negro:hover {
    background-color: #1e293b;
    transform: translateY(-2px);
}

.btn-resultado-edit.empate {
    background-color: #fbbf24;
    color: #0f172a;
}

.btn-resultado-edit.empate:hover {
    background-color: #f59e0b;
    transform: translateY(-2px);
}

.btn-resultado-edit.sin {
    background-color: #64748b;
    color: #f1f5f9;
}

.btn-resultado-edit.sin:hover {
    background-color: #475569;
    transform: translateY(-2px);
}

.btn-cancelar-edit {
    background-color: #6b7280;
    color: #f1f5f9;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancelar-edit:hover {
    background-color: #4b5563;
    transform: translateY(-1px);
}

/* Responsivo para el modal */
@media (max-width: 800px) {
    #modal-historial {
        padding: 10px;
    }
    
    .modal-historial-contenido {
        max-height: 90vh;
    }
    
    .modal-historial-header {
        padding: 20px;
    }
    
    .modal-historial-body {
        padding: 20px;
    }
    
    .historial-equipos {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .historial-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .contenedor-guardar {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-guardar,
    .btn-ver-historial {
        width: 100%;
    }
}

/* Responsivo para historial compacto */
@media (max-width: 600px) {
    .historial-fila {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px;
    }
    
    .historial-info {
        width: 100%;
    }
    
    .historial-controles {
        width: 100%;
        justify-content: space-between;
    }
    
    .historial-toggle {
        padding: 8px 10px;
        font-size: 0.75em;
    }
    
    .toggle-text {
        font-size: 0.8em;
    }
    
    .historial-equipos {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }
    
    .botones-resultado-edit {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .btn-editar-resultado,
    .btn-eliminar-item {
        padding: 8px 12px;
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    .historial-fecha-compacta {
        font-size: 0.8em;
    }
    
    .historial-resultado-compacto {
        font-size: 0.85em;
    }
    
    .editar-resultado-section {
        padding: 15px;
    }
    
    .historial-controles {
        gap: 6px;
    }
    
    .historial-toggle {
        padding: 6px 8px;
        gap: 4px;
    }
    
    .toggle-text {
        font-size: 0.75em;
    }
    
    .toggle-icon {
        font-size: 0.9em;
    }
}

/* Sección de resultado del partido */
.seccion-resultado {
    background-color: #0f172a;
    border-radius: 12px;
    padding: 20px;
    margin: 25px 0;
    border: 1px solid #334155;
    text-align: center;
    animation: fadeInMove 0.5s ease-out;
}

.seccion-resultado h3 {
    color: #cbd5e1;
    margin-bottom: 20px;
    font-size: 1.3em;
    font-weight: 600;
}

.opciones-resultado {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.btn-resultado {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-gano-blanco {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    color: #1e293b;
    border: 2px solid #64748b;
}

.btn-gano-blanco:hover {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(100, 116, 139, 0.3);
}

.btn-empate {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    border: 2px solid #d97706;
}

.btn-empate:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.btn-gano-negro {
    background: linear-gradient(135deg, #374151, #1f2937);
    color: #f9fafb;
    border: 2px solid #6b7280;
}

.btn-gano-negro:hover {
    background: linear-gradient(135deg, #1f2937, #111827);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(31, 41, 55, 0.4);
}

.resultado-seleccionado {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid #38bdf8;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.resultado-seleccionado p {
    color: #38bdf8;
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 10px;
}

.btn-cambiar {
    background: transparent;
    color: #38bdf8;
    border: 1px solid #38bdf8;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cambiar:hover {
    background: #38bdf8;
    color: #0f172a;
}

/* Estilos para mostrar resultados en el historial */
.historial-resultado {
    text-align: center;
    padding: 10px;
    margin: 10px 0;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1em;
}

.resultado-blanco {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    color: #1e293b;
    border: 2px solid #64748b;
}

.resultado-empate {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    border: 2px solid #d97706;
}

.resultado-negro {
    background: linear-gradient(135deg, #374151, #1f2937);
    color: #f9fafb;
    border: 2px solid #6b7280;
}

/* Estilos para resultado en historial */
.resultado-historial-section {
    padding: 20px;
    background-color: #334155;
    border-top: 1px solid #475569;
    margin-top: 15px;
    border-radius: 8px;
}

.resultado-historial-section h4 {
    color: #e2e8f0;
    margin-bottom: 15px;
    font-size: 1em;
    text-align: center;
}

.resultado-estado {
    margin-bottom: 15px;
}

.resultado-actual {
    padding: 12px 16px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    margin-bottom: 10px;
}

.resultado-actual.resultado-blanco {
    background-color: rgba(241, 245, 249, 0.1);
    color: #000;
    border: 1px solid rgba(241, 245, 249, 0.3);
}

.resultado-actual.resultado-negro {
    background-color: rgba(15, 23, 42, 0.5);
    color: #e2e8f0;
    border: 1px solid #475569;
}

.resultado-actual.resultado-empate {
    background-color: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.sin-resultado {
    text-align: center;
    color: #94a3b8;
}

.sin-resultado p {
    margin-bottom: 10px;
    font-style: italic;
}

.btn-cambiar-resultado, .btn-agregar-resultado {
    background-color: #0ea5e9;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
}

.btn-cambiar-resultado:hover, .btn-agregar-resultado:hover {
    background-color: #0284c7;
    transform: translateY(-1px);
}

.opciones-resultado-historial {
    text-align: center;
}

.botones-resultado-historial {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.btn-resultado-historial {
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-resultado-historial.blanco {
    background-color: #f1f5f9;
    color: #0f172a;
}

.btn-resultado-historial.blanco:hover {
    background-color: #e2e8f0;
    transform: translateY(-2px);
}

.btn-resultado-historial.negro {
    background-color: #0f172a;
    color: #f1f5f9;
    border: 1px solid #334155;
}

.btn-resultado-historial.negro:hover {
    background-color: #1e293b;
    transform: translateY(-2px);
}

.btn-resultado-historial.empate {
    background-color: #fbbf24;
    color: #0f172a;
}

.btn-resultado-historial.empate:hover {
    background-color: #f59e0b;
    transform: translateY(-2px);
}

.btn-cancelar-resultado {
    background-color: #6b7280;
    color: #f1f5f9;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancelar-resultado:hover {
    background-color: #4b5563;
    transform: translateY(-1px);
}

/* Loading spinner para sorteo */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    text-align: center;
    color: #e2e8f0;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    border: 4px solid rgba(14, 165, 233, 0.2);
    border-top: 4px solid #0ea5e9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-text {
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 10px;
    color: #0ea5e9;
}

.loading-subtext {
    font-size: 1em;
    color: #94a3b8;
    opacity: 0.8;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animación de texto parpadeante */
.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* Responsive para loading */
@media (max-width: 600px) {
    .loading-spinner {
        width: 60px;
        height: 60px;
        border-width: 3px;
    }
    
    .loading-text {
        font-size: 1.1em;
    }
    
    .loading-subtext {
        font-size: 0.9em;
    }
}
