/* Contenedor para botones de la derecha, visible en escritorio */
.cs-header-actions {
    display: flex;
    align-items: center;
    gap: 1.5em; /* Espacio entre el modo y el menú móvil */
}

/* Ocultar el botón de menú móvil en escritorio */
.cs-mobile-nav-toggle {
    display: none;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 2001;
}
.cs-mobile-nav-toggle span {
    display: block;
    width: 30px;
    height: 3px;
    background: var(--cs-green-neon);
    border-radius: 10px;
    transition: all 0.3s linear;
    transform-origin: 1px;
}
html.cs-light .cs-mobile-nav-toggle span {
    background: var(--cs-green-dark);
}

@media (max-width: 1200px) {
    .cs-header-title {
        display: none;
    }
}

@media (max-width: 992px) {
    /* === FIX: ALINEACIÓN DEL HEADER === */
    .cs-header-container {
        align-items: center;
    }

    .cs-header-actions {
        gap: 1em;
    }
    
    /* Ocultar la navegación de escritorio y mostrar el botón móvil */
    .cs-nav {
        display: none;
    }
    .cs-mobile-nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
    }
    
    .cs-header-container {
        justify-content: space-between;
    }

    /* === MEJORA: ESTILOS PARA EL MENÚ ABIERTO (OVERLAY) === */
    body.cs-nav-open .cs-nav {
        display: flex;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(10, 14, 19, 0.98);
        backdrop-filter: blur(8px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: 2em;
        overflow-y: auto;
        padding-bottom: 5em;
        gap: 1.5em;
        transform: translateX(0);
        transition: opacity 0.3s ease-in-out;
        z-index: 2000;
        opacity: 1;
    }

    /* Animación del icono de hamburguesa a "X" */
    body.cs-nav-open .cs-mobile-nav-toggle span:nth-child(1) {
        transform: rotate(45deg);
    }
    body.cs-nav-open .cs-mobile-nav-toggle span:nth-child(2) {
        opacity: 0;
        transform: translateX(20px);
    }
    body.cs-nav-open .cs-mobile-nav-toggle span:nth-child(3) {
        transform: rotate(-45deg);
    }

    /* === MEJORA: ESTILOS DE LOS ENLACES DEL MENÚ MÓVIL === */
    .cs-nav-separator {
        display: none;
    }
    .cs-nav a {
        font-size: 1.8em;
        padding: 0.5em 1em;
        width: 80%;
        text-align: center;
        border-radius: 12px;
    }
    .cs-nav a span {
        display: inline;
    }
}

@media (max-width: 768px) {
    .cs-header-container {
        height: 70px;
    }
    .cs-header-logo {
        height: 48px;
    }
    .cs-card {
        padding: 1.5em 1em;
    }
    .cs-mode-toggle {
        width: 40px;
        height: 40px;
        margin: 0;
    }
    .cs-nav a .cs-nav-icon {
        display: none;
    }
    .cs-dashboard-grid {
        grid-template-columns: 1fr;
    }
    .cs-hero-btn {
        font-size: 1.2em;
        padding: 0.8em 2.5em;
    }
    .cs-hero-actions {
        flex-direction: column;
        align-items: center;
    }
    .cs-leaderboard-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5em;
    }
	.cs-fixture-filters {
		flex-wrap: nowrap;
		overflow-x: auto;
		padding-bottom: 10px; 
		-webkit-overflow-scrolling: touch;
	}
    .cs-fixture-filters .cs-select-filter {
        padding: 0.8em;
        font-size: 1em;
    }
    
    /* === INICIO: SOLUCIÓN OPTIMIZADA PARA FIXTURE MÓVIL === */
    .cs-match-row {
        flex-wrap: wrap;
        justify-content: center; /* Centra los equipos en la fila */
        align-items: center;
        padding: 1em;
        gap: 1em 0.5em; /* Espacio vertical y horizontal */
    }

    .cs-team {
        flex-basis: auto; /* Permite que el tamaño se ajuste al contenido */
        flex-grow: 1; /* Permite que crezcan para llenar espacio */
        flex-direction: column;
        text-align: center;
        gap: 0.5em;
    }

    .cs-team-name {
        font-size: 0.85em; /* Nombres más pequeños */
        line-height: 1.2;
        word-break: break-word; /* Evita desbordamiento de nombres largos */
    }

    .cs-team img {
        width: 40px;
        height: 40px;
    }

    .cs-match-center-info {
        flex-basis: auto; /* Se ajusta al contenido */
        min-width: 0;
        margin: 0;
        padding: 0;
    }
    
    .cs-match-time, .cs-match-result {
        font-size: 1.5em; /* Reduce el tamaño del resultado/hora */
    }

    /* Compacta el formulario de predicción */
    .cs-predict-form, 
    .cs-prediction-area-inner {
        display: flex;
        flex-wrap: wrap; /* Permite que los controles se reordenen */
        justify-content: center;
        align-items: center;
        gap: 0.8em;
    }

    .cs-predict-controls {
        flex-basis: 100%; /* El botón SAVE ocupa su propia línea */
        text-align: center;
    }

    .cs-outcome-btns {
        margin: 0;
    }
    
    .cs-outcome-btns .cs-outcome-btn {
        padding: 0.4em 0.8em; /* Botones más pequeños */
        font-size: 0.9em;
    }

    .cs-predict-inputs input[type="number"] {
        width: 48px; /* Entradas de marcador más pequeñas */
        height: 48px;
        font-size: 1.5em;
    }
    /* === FIN: SOLUCIÓN OPTIMIZADA PARA FIXTURE MÓVIL === */
    
    .cs-landing-teaser {
        grid-template-columns: 1fr;
    }
    .cs-profile-form-grid {
        grid-template-columns: 1fr;
    }
    .cs-landing-box {
        padding: 2em 1.5em;
    }
    .cs-landing-box .cs-hero-title {
        font-size: clamp(2rem, 12vw, 3.5rem);
        letter-spacing: 2px;
    }
    .cs-landing-box .cs-hero-subtitle {
        font-size: 1rem;
        margin-bottom: 2em;
    }
    .cs-landing-box .cs-hero-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 1em;
    }
    .cs-landing-box .cs-hero-btn {
        font-size: 1.2em;
        padding: 0.8em 1.5em;
    }

    /* FIX: Interfaz de Mensajería para Móviles */
    .cs-messaging-wrapper {
        position: relative;
        overflow: hidden;
        height: 75vh;
    }
    .cs-conversations-list,
    .cs-conversation-panel {
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        transition: transform 0.3s ease-in-out;
    }
    .cs-conversations-list {
        transform: translateX(0);
        z-index: 2;
    }
    .cs-conversation-panel {
        transform: translateX(100%);
        z-index: 1;
    }
    .cs-messaging-wrapper.is-chat-open .cs-conversations-list {
        transform: translateX(-100%);
    }
    .cs-messaging-wrapper.is-chat-open .cs-conversation-panel {
        transform: translateX(0);
    }
    .cs-conversation-panel-header {
        position: sticky;
        top: 0;
        z-index: 10;
        padding: .5em .8em;
    }
    .cs-back-to-conv-list-btn {
        display: block;
        background: none;
        border: 2px solid var(--cs-border-dark);
        color: var(--cs-green-neon);
        font-size: 1.5em;
        line-height: 1;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        cursor: pointer;
        margin-right: .5em;
    }
    #cs-messages-container {
        padding: 1em;
    }
    #cs-send-message-form textarea {
        font-size: 16px;
        min-height: 50px;
    }
    #cs-send-message-form button {
        font-size: 1em;
        padding: 0 1.5em;
    }
}

@media (max-width: 480px) {
    .cs-leaderboard-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5em;
    }
    .cs-leaderboard-player {
        width: 100%;
    }
    .cs-leaderboard-rank {
        width: auto;
        font-size: 1.2em;
        align-self: flex-end;
        order: -1;
    }
    .cs-leaderboard-points {
        width: 100%;
        text-align: left;
        margin-top: 0.5em;
        padding-top: 0.5em;
        border-top: 1px solid var(--cs-border-dark);
    }
    .cs-friends-activity-widget .cs-skeleton-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .cs-friends-activity-widget .cs-activity-list li {
        font-size: 0.9em;
    }
    .cs-profile-header {
        flex-direction: column;
        text-align: center;
    }
    .cs-profile-tabs a {
        font-size: 1em;
        padding: 0.8em 1em;
    }
    .cs-player-card-hero {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 380px) {
    .cs-nav a {
        font-size: 1.5em;
        padding: 0.6em 1em;
    }
}
/* --- INICIO: FIX DEFINITIVO PARA FIXTURE MÓVIL (v2) --- */
@media (max-width: 768px) {
    .cs-match-row {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 1em;
        padding: 1.5em 1em;
    }

    .cs-team {
        flex-basis: 100px; /* Ancho base para cada equipo */
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.5em;
    }

    .cs-team-name {
        font-size: 0.9em;
        line-height: 1.2;
        word-break: break-word;
    }
    
    .cs-match-center-info {
        /* Se convierte en la fila inferior que contiene la predicción */
        flex-basis: 100%; 
        order: 3; /* Se mueve debajo de los equipos */
        min-width: 0; /* Anula el ancho problemático */
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1em;
        padding-top: 1.5em;
        margin-top: 1em;
        border-top: 1px solid var(--cs-border-dark);
    }

    /* El bloque de la hora/resultado se queda entre los equipos */
    .cs-match-main-info .cs-match-time-score {
        flex-grow: 0;
    }

    /* Apilamos los controles dentro del formulario para máxima compactibilidad */
    .cs-prediction-area-inner {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1em;
    }

    .cs-predict-form input[type="number"] {
        width: 55px;
        height: 55px;
        font-size: 1.8em;
    }

    /* --- LÍNEA AÑADIDA PARA CENTRAR EL BOTÓN --- */
    .cs-predict-controls {
        text-align: center;
    }
}
/* --- FIN: FIX DEFINITIVO PARA FIXTURE MÓVIL (v2) --- */