/* PERFIL: ajustes del enlace activo en el menú (también aplica en Torneos) */
.Lista_NAV li a.activo{
    color: var(--color-dorado);
    text-shadow:
        0 0 8px rgba(255, 215, 0, 0.8),
        0 0 15px rgba(255, 215, 0, 0.6);
}

.torneos-pagina{
    padding: 60px 10% 100px;
    max-width: 1200px;
    margin: 0 auto;
}

/* PORTADA */
.torneos-portada{
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-2);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.12), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--borde-dorado);
    border-radius: var(--radio-lg);
    padding: 35px;
    margin-bottom: var(--space-5);
    box-shadow: var(--sombra-md);
}

.torneos-portada-texto h1{
    font-family: var(--fuente-display);
    font-size: 32px;
    letter-spacing: 0.4px;
    color: var(--color-dorado);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.torneos-portada-texto p{
    margin-top: var(--space-1);
    color: var(--texto-secundario);
    font-size: 14px;
    max-width: 520px;
    line-height: 1.5;
}
.torneos-portada-texto p a{
    color: var(--color-dorado);
    text-decoration: underline;
}

.torneos-portada-acciones{
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

.boton-crear-torneo{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    padding: 12px 28px;
    background-color: var(--color-dorado-fuerte);
    border-radius: var(--radio-pill);
    font-family: var(--fuente-display);
    font-size: 14px;
    color: var(--color-negro);
    text-decoration: none;
    box-shadow: 0 0 0 rgba(255, 215, 0, 0);
    transition: background-color var(--transicion-base), transform var(--transicion-base), box-shadow var(--transicion-base);
}

.boton-crear-torneo:hover,
.boton-crear-torneo:focus-visible{
    background-color: var(--color-dorado);
    transform: scale(1.05);
    box-shadow: var(--sombra-brillo-md);
}

.boton-torneo-rapido{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    padding: 10px 28px;
    background: transparent;
    border: 1px solid var(--borde-dorado-fuerte);
    border-radius: var(--radio-pill);
    font-family: var(--fuente-display);
    font-size: 13px;
    color: var(--color-dorado);
    text-decoration: none;
    transition: background-color var(--transicion-base), border-color var(--transicion-base), box-shadow var(--transicion-base);
}

.boton-torneo-rapido:hover,
.boton-torneo-rapido:focus-visible{
    background-color: rgba(255, 215, 0, 0.12);
    border-color: var(--color-dorado);
    box-shadow: var(--sombra-brillo-sm);
}

.torneos-mensaje-sin-sesion{
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    margin: 0;
}
.torneos-mensaje-sin-sesion a{
    color: var(--color-dorado);
    text-decoration: underline;
}

/* TÍTULOS DE SECCIÓN */
.perfil-seccion h2{
    position: relative;
    padding-bottom: 12px;
}

.perfil-seccion h2::after{
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 48px;
    height: 2px;
    background: linear-gradient(90deg, var(--color-dorado), transparent);
}

/* CONTENEDOR CON SCROLL PARA NO ALARGAR LA PÁGINA */
.torneos-scroll{
    max-height: 560px;
    overflow-y: auto;
    padding: 6px 8px 6px 4px;
    margin-right: -8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 215, 0, 0.5) rgba(255, 255, 255, 0.05);
}

.torneos-scroll::-webkit-scrollbar{
    width: 8px;
}

.torneos-scroll::-webkit-scrollbar-track{
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radio-pill);
}

.torneos-scroll::-webkit-scrollbar-thumb{
    background: rgba(255, 215, 0, 0.5);
    border-radius: var(--radio-pill);
}

.torneos-scroll::-webkit-scrollbar-thumb:hover{
    background: var(--color-dorado);
}

/* GRID DE TARJETAS DE TORNEO */
.torneos-grid{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: var(--space-3);
    padding-bottom: 4px;
}

.torneo-card{
    display: flex;
    flex-direction: column;
    background: var(--superficie-1);
    border: 1px solid var(--borde-dorado);
    border-radius: var(--radio-md);
    padding: 22px;
    transition: transform var(--transicion-base), border-color var(--transicion-base), box-shadow var(--transicion-base), background-color var(--transicion-base);
}

.torneo-card:hover{
    transform: translateY(-4px);
    border-color: var(--color-dorado);
    background: var(--superficie-2);
    box-shadow: var(--sombra-brillo-sm);
}

.torneo-card-encabezado{
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.torneo-card-titulo{
    color: var(--texto-primario);
    font-weight: bold;
    font-size: 16px;
    line-height: 1.3;
    text-decoration: none;
    transition: color var(--transicion-base);
}

.torneo-card-titulo:hover,
.torneo-card-titulo:focus-visible{
    color: var(--color-dorado);
}

.torneo-card-badges{
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.badge-rapido{
    font-family: var(--fuente-display);
    font-size: 10px;
    letter-spacing: 0.3px;
    padding: 3px 9px;
    border-radius: var(--radio-pill);
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.5);
    color: var(--color-dorado);
    white-space: nowrap;
}

.torneo-card-estado{
    font-family: var(--fuente-display);
    font-size: 11px;
    letter-spacing: 0.3px;
    padding: 5px 12px;
    border-radius: var(--radio-pill);
    white-space: nowrap;
}

.estado-borrador{
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--texto-secundario);
}

.estado-inscripciones_abiertas{
    border: 1px solid var(--color-dorado);
    color: var(--color-dorado);
}

.estado-en_curso{
    background: var(--color-dorado-fuerte);
    color: var(--color-negro);
}

.estado-finalizado{
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--texto-terciario);
}

.estado-cancelado{
    border: 1px solid var(--color-error);
    color: var(--color-error);
}

.estado-cerradas{
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--texto-terciario);
}

.estado-por_iniciar{
    border: 1px solid var(--color-advertencia);
    color: var(--color-advertencia);
}

.estado-cupo_lleno{
    border: 1px solid var(--color-advertencia);
    color: var(--color-advertencia);
}

.estado-rol-arbitro_principal{
    background: rgba(99, 179, 237, 0.2);
    border: 1px solid var(--color-info);
    color: var(--color-info);
}

.estado-rol-arbitro{
    border: 1px solid rgba(99, 179, 237, 0.5);
    color: rgba(99, 179, 237, 0.8);
}

.torneo-card-detalle{
    flex: 1;
    color: var(--texto-secundario);
    font-size: 13px;
    line-height: 1.7;
}

.torneo-card-detalle strong{
    color: rgba(255, 255, 255, 0.9);
}

.torneo-card-acciones{
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: var(--space-2);
    padding-top: 14px;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
}

.enlace-editar-torneo{
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid var(--color-dorado);
    border-radius: var(--radio-pill);
    color: var(--color-dorado);
    font-size: 12px;
    font-family: var(--fuente-display);
    text-decoration: none;
    transition: background-color var(--transicion-base), color var(--transicion-base);
}

.enlace-editar-torneo:hover,
.enlace-editar-torneo:focus-visible{
    background-color: var(--color-dorado-fuerte);
    color: var(--color-negro);
}

.mensaje-vacio{
    color: var(--texto-terciario);
    font-size: 14px;
    text-align: center;
    padding: 30px 0;
    grid-column: 1 / -1;
}

/* SECCIONES DEL FORMULARIO DE TORNEO (compartidas con Crear Torneo.html) */
.seccion-formulario{
    border: 1px solid var(--borde-dorado-sutil);
    border-radius: 14px;
    padding: 20px 22px;
    margin-bottom: var(--space-2);
    transition: border-color var(--transicion-base);
}

.seccion-formulario:hover{
    border-color: rgba(255, 215, 0, 0.45);
}

.seccion-formulario legend{
    font-family: var(--fuente-display);
    color: var(--color-dorado);
    font-size: 14px;
    padding: 0 8px;
}

.seccion-formulario h3{
    font-family: var(--fuente-display);
    color: var(--color-dorado);
    font-size: 13px;
    margin: 18px 0 10px;
}

.campo{
    margin-bottom: 14px;
    text-align: left;
}

.campo label,
.etiqueta-grupo{
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--texto-secundario);
}

.campo input[type="text"],
.campo input[type="number"],
.campo input[type="date"],
.campo input[type="time"],
.campo input[type="email"],
.campo select,
.campo textarea{
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radio-sm);
    border: 1px solid rgba(255, 215, 0, 0.3);
    background: var(--superficie-2);
    color: var(--texto-primario);
    font-family: var(--fuente-texto);
    font-size: 14px;
    transition: border-color var(--transicion-base), box-shadow var(--transicion-base), background-color var(--transicion-base);
}

.campo input:hover,
.campo select:hover,
.campo textarea:hover{
    background-color: var(--superficie-2-hover);
}

.campo input:focus-visible,
.campo select:focus-visible,
.campo textarea:focus-visible{
    outline: none;
    border-color: var(--color-dorado);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.15);
}

.campos-grid{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px 16px;
    align-items: start;
}

.campos-grid .campo{
    margin-bottom: 0;
}

.campo-checkbox label{
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.campo-checkbox input[type="checkbox"]{
    width: auto;
}

.radio-grupo{
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.checkbox-grupo{
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.checkbox-grupo label,
.radio-grupo label{
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--texto-secundario);
    cursor: pointer;
}

.checkbox-grupo input,
.radio-grupo input{
    width: auto;
}

.ayuda-campo{
    color: var(--texto-terciario);
    font-size: 12px;
    margin-bottom: var(--space-2);
}

.fase-config{
    border-top: 1px dashed rgba(255, 215, 0, 0.3);
    padding-top: 14px;
    margin-top: 14px;
}

.fase-config h3{
    margin-top: 0;
}

.parametros-sistema{
    background: var(--superficie-1);
    border-radius: var(--radio-sm);
    padding: 14px;
    margin-bottom: 12px;
}

.parametros-sistema .campos-grid,
.parametros-sistema .campo:last-child{
    margin-bottom: 0;
}

.campo-clasificados{
    margin-bottom: 0;
}

/* MENSAJES */
.mensaje-error,
.mensaje-exito{
    font-size: 13px;
    text-align: left;
    padding: 12px 16px;
    border-radius: var(--radio-sm);
    margin-bottom: var(--space-2);
}

.mensaje-error{
    color: var(--color-error);
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.4);
}

.mensaje-exito{
    color: var(--color-dorado);
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.4);
}

/* ACCIONES DEL FORMULARIO */
.acciones-formulario{
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 10px;
}

.boton-secundario-formulario{
    background: transparent;
    border: 2px solid var(--color-dorado);
    color: var(--color-dorado);
}

.boton-secundario-formulario:hover,
.boton-secundario-formulario:focus-visible{
    background: rgba(255, 215, 0, 0.15);
}

/* RESPONSIVE */
@media (max-width: 768px){
    .torneos-pagina{
        padding: 40px 6% 80px;
    }

    .torneos-scroll{
        max-height: 480px;
    }

    .torneos-portada{
        padding: 28px 22px;
        text-align: center;
        justify-content: center;
    }

    .torneos-portada-texto p{
        margin-left: auto;
        margin-right: auto;
    }

    .torneos-portada-acciones{
        align-items: center;
        width: 100%;
    }

    .seccion-formulario{
        padding: 18px;
    }

    .acciones-formulario{
        justify-content: center;
    }

    .acciones-formulario button{
        flex: 1 1 100%;
    }
}

@media (max-width: 480px){
    .torneos-pagina{
        padding: 30px 5% 70px;
    }

    .torneos-portada{
        padding: 24px 16px;
        border-radius: 16px;
    }

    .torneos-portada-texto h1{
        font-size: 26px;
    }

    .boton-crear-torneo,
    .boton-torneo-rapido{
        width: 100%;
        justify-content: center;
    }

    .torneos-grid{
        grid-template-columns: 1fr;
    }

    .torneo-card{
        padding: 18px;
    }

    .torneo-card-acciones{
        text-align: center;
    }

    .enlace-editar-torneo{
        width: 100%;
    }
}
