/* ===== HERO / INTRO ===== */
.team-intro {
    display: flex;
    align-items: center;
    flex-direction: column;
    padding: 3rem 1rem 1rem;
    background: linear-gradient(135deg, #d41f88, #3fb7ff);
    color: #fff;
    justify-content: center;
}
.team-intro .title { display: flex; align-items: center; justify-content: center; }
.team-intro .title .DCRT-logo { height: 50px; width: auto; }
.team-intro .title h1 { font-family: 'Monument Extended'; font-size: 2.5rem; margin: 0; }
.team-intro .subtitle { font-family: 'Monument Extended'; font-size: 0.9rem; margin: 0; }

/* ===== LAYOUT CONTENUTO ===== */
.team-roster { max-width: 1200px; margin: 0 auto; padding: 2rem 1rem; text-align: center; }

/* ===== FILTRI ===== */
.filter-buttons { text-align: center; margin-bottom: 1.5rem; }
.filter-btn {
    background: none; border: 2px solid var(--blue); padding: 6px 12px; margin: 0 6px;
    font-size: 0.85rem; cursor: pointer; border-radius: 14px; font-family: 'Monument Extended';
    color: var(--blue); transition: background-color .25s ease, color .25s ease, transform .1s ease;
}
.filter-btn.acc {
    border: 2px solid var(--acc);
    color: var(--acc);
}
.filter-btn.iracing {
    border: 2px solid var(--iracing);
    color: var(--iracing);
}
.filter-btn.lmu {
    border: 2px solid var(--lmu);
    color: var(--lmu);
}
.filter-btn.streamer {
    border: 2px solid var(--twitch);
    color: var(--twitch);
}
.filter-btn.active, .filter-btn:hover { background-color: var(--blue); color: #fff; }
.filter-btn.active.acc, .filter-btn.acc:hover { background-color: var(--acc); color: #fff; }
.filter-btn.active.iracing, .filter-btn.iracing:hover { background-color: var(--iracing); color: #fff; }
.filter-btn.active.lmu, .filter-btn.lmu:hover { background-color: var(--lmu); color: #fff; }
.filter-btn.active.streamer, .filter-btn.streamer:hover { background-color: var(--twitch); color: #fff; }
.filter-btn:active { transform: scale(.98); }

/* ===== GRIGLIA PILOTI (desktop base) ===== */
.pilot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

/* ===== CARD ===== */
.pilot-card {
    position: relative; /* serve per overlay & badge */
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0,0,0,.06);
    border-top: 4px solid var(--blue);
    transition: transform .2s ease, box-shadow .2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}
.pilot-card:hover { transform: translateY(-2px); box-shadow: 0 12px 22px rgba(0,0,0,.08); }
.pilot-card:focus-within { transform: translateY(-2px); box-shadow: 0 12px 22px rgba(0,0,0,.08); }

/* ===== IMMAGINE / HEADER ===== */
.pilot-header { position: relative; width: 100%; }
.pilot-avatar {
    width: 100%;
    height: 220px;               /* desktop */
    object-fit: contain;
    display: block;
    background-color: var(--lightgray);
    padding: 10px;
    transition: transform .25s ease;
    position: relative; z-index: 1;
}
.pilot-card:hover .pilot-avatar { transform: scale(1.02); }
.pilot-card:focus-within .pilot-avatar { transform: scale(1.02); }

/* Bollino numero */
.pilot-number-img {
    position: absolute;
    bottom: -20px; left: 20px;   /* posizione di base */
    width: 50px; height: 50px;
    border-radius: 50%;
    background: var(--dark);
    object-fit: contain;
    box-shadow: 0 2px 6px rgba(0,0,0,.1);
    z-index: 3;                  /* sempre sopra overlay */
    pointer-events: none;
    transition: bottom .25s ease; /* per animare il rialzo su hover */
}

/* ===== CONTENUTO CARD ===== */
.pilot-card-content { padding: 1rem 1.2rem 1.2rem; }
.pilot-number { font-weight: bold; font-size: 1rem; color: var(--darkgray); margin: 0; }
.pilot-card h3 { font-size: 1.2rem; font-family: 'Monument Extended'; margin: .3rem 0 .6rem; }
.badge-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: .5rem; }
.badge {
    background-color: var(--pink); color: #fff; padding: 3px 6px; border-radius: 4px;
    font-size: .75rem; font-family: 'Monument Extended'; text-transform: uppercase;
}
.badge.acc {background: var(--acc);}
.badge.iracing {background: var(--iracing);}
.badge.lmu {background: var(--lmu);}
.badge.streamer {background: var(--twitch);}

/* ===== OVERLAY (Soluzione B) ===== */
.pilot-extra {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: .75rem 1rem;
    background: rgba(191, 22, 105, .95); /* il tuo magenta con poca trasparenza */
    color: #fff;
    opacity: 0; pointer-events: none;
    transition: opacity .25s ease;
    z-index: 2;
    /* Altezza massima dinamica: desktop = nessun limite; mobile = impostata via var nei breakpoint */
    max-height: var(--overlay-max-height, none);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-bottom-left-radius: 16px; border-bottom-right-radius: 16px;
}
.pilot-card:hover .pilot-extra,
.pilot-card:focus-within .pilot-extra,
.pilot-card:active .pilot-extra { opacity: 1; pointer-events: auto; }

.pilot-extra .fullname { font-weight: bold; margin: 0 0 .25rem; font-size: .95rem; }
.pilot-extra .pilot-bio {
    font-size: .85rem;
    line-height: 1.3;
    margin: 0;
    text-align: justify;
    text-justify: inter-word;
}

/* Evita vecchie animazioni che cambiavano l’altezza */
.pilot-card:hover .pilot-avatar, .pilot-extra { max-height: var(--overlay-max-height, none); transform: none; }

/* Testi lunghi */
.pilot-card h3, .pilot-number { overflow-wrap: anywhere; }

#stickyButton {
    position: fixed;
    bottom: 100px;
    left: 30px;
    z-index: 9999;
    background: var(--green);
    color: var(--white);
    border: none;
    padding: 15px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: background-color 0.2s;
    max-width: 20rem;
    font-family: "Monument Extended";
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.6); }
    70% { transform: scale(1.05); box-shadow: 0 0 20px 10px rgba(255,51,102, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,51,102, 0); }
}

/* ====== COMPACT DA 1150PX IN GIÙ ====== */
@media (max-width: 1150px) {
    /* layout */
    .pilot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; padding: 1.2rem 0; }

    /* card */
    .pilot-card { border-radius: 14px; box-shadow: 0 6px 14px rgba(0,0,0,.06); }
    .pilot-avatar { height: 170px; padding: 8px; }
    .pilot-card-content { padding: .7rem .9rem .9rem; }

    /* testi */
    .pilot-card h3 { font-size: 1.05rem; margin: .25rem 0 .45rem; line-height: 1.2; }
    .badge-list { gap: 4px; margin-bottom: .3rem; }
    .badge { font-size: .68rem; padding: 2px 5px; }

    /* overlay: limita e usa stessa quota per il badge */
    .pilot-card { --overlay-max-height: 130px; }
    .pilot-extra { font-size: .78rem; line-height: 1.3; padding: .6rem .75rem; }
    .pilot-extra .fullname{
        padding-top: 5px;
    }
    .pilot-extra .pilot-bio {
        font-size: .80rem;
    }
    .pilot-number-img { width: 40px; height: 40px; left: 14px; bottom: -14px; }
}

/* ====== SOTTO I 700PX: 2 COLONNE ====== */
@media (max-width: 700px) {
    .pilot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; padding: .9rem 0; }
    .pilot-avatar { height: 150px; }
    .pilot-card-content { padding: .6rem .7rem .75rem; }
    .pilot-card h3 { font-size: .98rem; margin: .2rem 0 .35rem; }
    .badge { font-size: .62rem; padding: 2px 4px; }

    /* overlay + badge coerenti */
    .pilot-card { --overlay-max-height: 105px; }
    .pilot-extra { font-size: .74rem; padding: .55rem .7rem; }
    .pilot-extra .fullname{
        padding-top: 5px;
    }
    .pilot-extra .pilot-bio {
        font-size: .70rem;
    }
    .pilot-number-img { width: 36px; height: 36px; left: 10px; bottom: -12px; }
}

@media (max-width: 480px) {
    #stickyButton {
        left: 30px;
        right: 30px;
        max-width: 30rem;
        bottom: 30px;
    }
    .badge { font-size: .5rem; }
    .pilot-card h3 { font-size: .8rem; }
}

/* ===== UTILI ===== */
.section-text { display: none !important; } /* descrizione rimossa */
.pilot-card:focus { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ===== FILTRI: tutti su UNA riga ===== */
.filter-buttons{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: .25rem .5rem 1rem;
    overflow-x: auto;           /* scroll orizzontale quando serve */
    overflow-y: hidden;
    white-space: nowrap;        /* evita il ritorno a capo */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;      /* Firefox: nasconde la scrollbar */
}
.filter-buttons::-webkit-scrollbar{ display: none; } /* WebKit */

/* i bottoni non devono allargarsi/andare a capo */
.filter-btn{
    flex: 0 0 auto;             /* larghezza intrinseca, niente wrap */
    margin: 0;                  /* usiamo gap del container */
}

/* compatta leggermente su schermi piccoli */
@media (max-width: 990px){
    .filter-btn{
        font-size: .78rem;
        border-radius: 14px;
    }
    .filter-buttons {
        justify-content: flex-start;   /* parte da sinistra */
    }
}

/* opzionale: lieve fade ai bordi mentre si può scrollare */
.filter-buttons{
    position: relative;
    mask-image: linear-gradient( to right, transparent 0, black 16px, black calc(100% - 16px), transparent 100%);
    -webkit-mask-image: linear-gradient( to right, transparent 0, black 16px, black calc(100% - 16px), transparent 100%);
}