.pred-team-mini-logo {
    margin-right: 20px;
    margin-left: 10px;
    filter: drop-shadow(0 0 5px #00000080)
}

.pred-coaches-header {
    display: flex;
    justify-content: center;
    align-items: center
}

.pred-predictions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 400px)); /* auto-fit invece di auto-fill e max a 400px */
    gap: 25px;
    width: 100%;
    max-width: 1600px;
    margin: 2rem auto;
    padding: 0 15px;
    justify-content: center; /* Centra l'intera griglia */
}

.pred-ranking-section {
    max-width: 900px;
    margin: .5rem auto 2.5rem;
    padding: 0 15px
}

.pred-card {
    background: rgba(0, 0, 0, .7);
    border: 1px solid rgba(255, 255, 255, .1);
    border-top: 3px solid var(--primary-color);
    border-radius: 18px;
    padding: .5rem;
    display: flex;
    flex-direction: column;
    transition: transform .2s ease, box-shadow .2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, .3);
    width: 100%; /* Occupa tutta la larghezza della cella */
}

.pred-card:hover {
    /*transform: translateY(-5px);*/
    box-shadow: 0 10px 25px rgba(0, 0, 0, .5), 0 0 10px rgba(207, 174, 112, .2);
    border-color: var(--primary-color)
}

.pred-card-header,
.pred-row {
    display: flex;
    justify-content: space-between;
    align-items: center
}

.pred-card-header {
    font-family: "Montserrat Alternates", sans-serif;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 1.2rem;
    padding-bottom: .8rem;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    min-height: 40px;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 15px
}

.pred-row {
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: .95rem;
    transition: background .2s
}

.pred-row:hover {
    background: rgba(255, 255, 255, .05)
}

.pred-user {
    opacity: .8;
    font-weight: 600
}

.pred-val {
    text-align: right;
    font-weight: 700
}

.pred-pts {
    font-size: .75rem;
    opacity: .6;
    margin-left: 5px;
    font-weight: 400
}

.pred-row.is-result {
    background: rgba(207, 174, 112, .15);
    border: 1px solid rgba(207, 174, 112, .3);
    margin-bottom: 15px;
    padding: 10px
}

.pred-row.is-result .pred-user {
    color: var(--primary-color);
    opacity: 1;
    text-transform: uppercase
}

.pred-row.is-result .pred-val {
    color: #fff;
    font-size: 1.1rem
}

.pred-rank-name {
    flex-grow: 1;
    font-size: 1.1rem
}

.pred-rank-name {
    text-align: left;
    padding-left: 20px;
    color: #fff
}

.pred-rank-pos,
.pred-rank-pts,
.pred-rank-best,
.pred-rank-record {
    font-weight: 700;
    font-size: 1.1rem
}

.pred-rank-pos {
    width: 40px;
    color: var(--primary-color)
}

.pred-rank-record {
    width: 70px;
    text-align: center;
    color: #fff;
    opacity: 0.9;
    font-size: 0.95rem;
}

.pred-rank-best {
    width: 50px;
    text-align: center;
    color: var(--primary-color);
    opacity: 0.8;
}

.pred-rank-pts {
    width: 80px;
    text-align: right;
    color: #fff
}

/* Stile per la riga di intestazione */
.pred-row.pred-rank-header {
    background: rgba(207, 174, 112, .15);
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: 8px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.pred-row.pred-rank-header:hover {
    background: rgba(207, 174, 112, .15);
}

.pred-row.pred-rank-header .pred-rank-pos,
.pred-row.pred-rank-header .pred-rank-name,
.pred-row.pred-rank-header .pred-rank-record,
.pred-row.pred-rank-header .pred-rank-best,
.pred-row.pred-rank-header .pred-rank-pts {
    color: var(--primary-color);
    opacity: 1;
    font-size: 0.95rem;
}

.pred-row.best-pred,
.pred-rank-first {
    border-left: 3px solid var(--primary-color)
}

.pred-rank-first {
    background: linear-gradient(90deg, rgba(207, 174, 112, .1)0, transparent 100%)
}

.pred-row.best-pred {
    background: linear-gradient(90deg, rgba(207, 174, 112, .15)0, transparent 100%);
    font-weight: 700
}

.pred-row.best-pred .pred-pts {
    color: var(--primary-color);
    text-shadow: 0 0 8px rgba(207, 174, 112, .4)
}

.pred-card-header .pred-team-mini-logo {
    width: 35px;
    height: 35px;
    margin: 0;
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, .5))
}

.pred-rank-card-header {
    font-family: "Montserrat Alternates", sans-serif;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 1.2rem;
    padding-bottom: .8rem;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    min-height: 40px;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 15px
}

.pred-match-title{

}

.pred-match-dataora{
    font-size: 0.8rem;
    color: #fff;
}

/* Form inserimento pronostico */
.pred-input-form {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 15px 12px;
    background: rgba(255, 255, 255, .03);
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    margin-bottom: 10px;
}

.pred-input-wrapper {
    flex: 0 0 65px; /* Ridotto da 80px a 65px */
}

.pred-score-input {
    width: 100%;
    padding: 10px 8px;
    background: rgba(0, 0, 0, .5);
    border: 2px solid rgba(255, 255, 255, .2);
    border-radius: 8px;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    transition: all 0.3s ease;
    outline: none;
    font-family: "Montserrat Alternates", sans-serif; /* Font coerente con il sito */
}

.pred-score-input:focus {
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, .7);
    box-shadow: 0 0 10px rgba(207, 174, 112, .3);
}

.pred-score-input::-webkit-inner-spin-button,
.pred-score-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pred-score-input[type=number] {
    -moz-appearance: textfield;
}

.pred-submit-btn {
    flex: 1;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, rgba(207, 174, 112, .8) 100%);
    border: none;
    border-radius: 8px;
    color: #000;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(207, 174, 112, .3);
    font-family: "Montserrat Alternates", sans-serif; /* Font coerente con il sito */
}

.pred-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(207, 174, 112, .5);
    background: linear-gradient(135deg, rgba(207, 174, 112, 1) 0%, var(--primary-color) 100%);
}

.pred-submit-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(207, 174, 112, .3);
}

.pred-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.pred-submit-btn svg {
    flex-shrink: 0;
}

/* Messaggio informativo partita non iniziata */
.pred-info-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background: rgba(255, 255, 255, .03);
    border-radius: 8px;
    color: rgba(255, 255, 255, .6);
    font-size: 0.9rem;
    text-align: center;
    font-style: italic;
    margin: 10px 0;
}

.pred-info-message svg {
    flex-shrink: 0;
}

/* Navigatore settimane */
.week-navigator {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    align-items: center;
    max-width: 900px;
    margin: 0 auto 2rem;
    padding: 20px 15px;
    background: rgba(0, 0, 0, .5);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, .1);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) rgba(255, 255, 255, .1);
}

.week-navigator::-webkit-scrollbar {
    height: 8px;
}

.week-navigator::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, .1);
    border-radius: 4px;
}

.week-navigator::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.week-navigator::-webkit-scrollbar-thumb:hover {
    background: rgba(207, 174, 112, .8);
}

.week-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 80px;
    text-align: center;
    flex-shrink: 0;
    white-space: nowrap;
}

.week-btn:hover {
    background: rgba(207, 174, 112, .2);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(207, 174, 112, .3);
}

.week-btn.active {
    background: var(--primary-color);
    color: #000;
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(207, 174, 112, .5);
    font-weight: 700;
}

/* ====================
   POPUP MESSAGGI STILE LOGIN
   ==================== */

/* Overlay sfondo sfocato */
.prediction-alert-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

/* Popup stile login */
.prediction-alert-popup {
    background: #111;
    border: 2px solid var(--primary-color);
    padding: 2.5rem;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    position: relative;
    animation: kickoffZoom 0.4s ease-out;
    font-family: 'Montserrat Alternates', sans-serif;
}

/* Titolo del popup */
.prediction-alert-popup h3 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Messaggio */
.prediction-alert-message {
    color: #fff;
    text-align: center;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Pulsante chiusura */
.prediction-alert-close {
    background: var(--primary-color);
    border: none;
    padding: 14px;
    width: 100%;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    font-family: 'Montserrat Alternates', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 15px;
    transition: all 0.3s;
    color: #000;
}

.prediction-alert-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Bottone X di chiusura in alto a destra */
.prediction-close-x {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    position: absolute;
    top: 10px;
    right: 15px;
    color: var(--primary-color);
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s, color 0.2s;
}

.prediction-close-x:hover {
    color: #fff;
    transform: rotate(90deg);
}

/* Varianti per successo ed errore */
.prediction-alert-popup.success h3 {
    color: #4caf50;
}

.prediction-alert-popup.success {
    border-color: #4caf50;
}

.prediction-alert-popup.error h3 {
    color: #f44336;
}

.prediction-alert-popup.error {
    border-color: #f44336;
}

.rules-btn {
    font-family: 'Montserrat Alternates', sans-serif;
    font-weight: 700;
    font-size: 15px; 
}

/* Animazione kickoff (puoi usare quella del tuo sito) */
@keyframes kickoffZoom {
    from {
        transform: scale(0.7);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Media query per dispositivi mobili */
@media (max-width: 720px) {

    /* Nascondi le colonne Best e Record su mobile, e l'intestazione */
    .pred-ranking-section .pred-row .pred-rank-best,
    .pred-ranking-section .pred-row .pred-rank-record,
    .pred-ranking-section .pred-row.pred-rank-header {
        display: none;
    }

    /* Assicuriamoci che la riga sia un flexbox */
    .pred-ranking-section .pred-row {
        display: flex;
        align-items: center;
        width: 100%;
        padding: 8px 4px;
        /* Ridotto leggermente il padding laterale */
    }

    /* 1. Prima colonna (Posizione): Dimensione ridotta e fissa */
    .pred-ranking-section .pred-row .pred-rank-pos {
        flex: 0 0 30px;
        /* Larghezza fissa a 30px, non cresce e non restringe */
        text-align: left;
    }

    /* 2. Colonna Nome: Prende tutto lo spazio rimanente */
    .pred-ranking-section .pred-row .pred-rank-name {
        flex: 1;
        /* Occupa tutto lo spazio centrale */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        /* Se il nome è troppo lungo mette i puntini */
        padding-left: 5px;
    }

    /* 3. Colonna Punti Totali: Dimensione fissa a destra */
    .pred-ranking-section .pred-row .pred-rank-pts {
        flex: 0 0 45px;
        /* Larghezza fissa per il punteggio (es. 120) */
        text-align: right;
        font-weight: bold;
    }

    /* Navigatore settimane su mobile */
    .week-navigator {
        gap: 8px;
        padding: 15px 10px;
    }

    .week-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
        min-width: 70px;
    }
}

@media (max-width:600px) {
    .pred-predictions-grid {
        grid-template-columns: 1fr;
        padding: 0 10px
    }

    .pred-card {
        margin-bottom: 10px
    }

    .pred-ranking-section {
        width: 95%
    }

    .week-navigator {
        width: 95%;
    }

    /* Form pronostici su mobile */
    .pred-input-form {
        padding: 12px 8px;
        gap: 8px;
    }

    .pred-input-wrapper {
        flex: 0 0 60px; /* Ridotto da 70px a 60px per mobile */
    }

    .pred-score-input {
        padding: 8px 6px;
        font-size: 1.1rem;
    }

    .pred-submit-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
        gap: 6px;
    }

    .pred-submit-btn svg {
        width: 16px;
        height: 16px;
    }

    /* Popup su mobile */
    .prediction-alert-popup {
        width: 95%;
        padding: 2rem 1.5rem;
    }

    .prediction-alert-popup h3 {
        font-size: 1.1rem;
    }

    .prediction-alert-message {
        font-size: 0.95rem;
    }
}
