/* =====================================================
   CONEIX ELS AMICS — CSS
   ===================================================== */

.fam-section {
    padding: 0 0 1.5rem;
}

/* TÍTOLS DE SECCIÓ */
.fam-section-title {
    font-size: clamp(2rem, 4.5vw, 2.8rem);
    font-weight: 900;
    color: var(--verde);
    text-align: center;
    margin-bottom: .25rem;
}

.fam-section-sub {
    font-size: 1.2rem;
    color: var(--muted);
    text-align: center;
    margin-bottom: 2rem;
}

.fam-section-top {
    padding-top: calc(var(--header-h) + .5rem);
}

/* SR. MOEBIUS — GUIA */
.fam-guia {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
}

.fam-guia-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: .75rem;
    animation: mini-bounce 4s ease-in-out infinite;
}

.fam-guia-salut {
    font-size: clamp(2.2rem, 5vw, 3rem);
    color: var(--verde);
    margin-bottom: .5rem;
}

.fam-guia-logo {
    height: 60px;
    width: auto;
    margin: .5rem auto;
}

.fam-guia-text {
    font-size: 1.4rem;
    color: var(--text);
    line-height: 1.7;
    margin-bottom: .25rem;
}

/* GRID PERSONATGES 2 COLUMNES */
.fam-chars-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

/* FITXA PERSONATGE */
.fam-char {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1.5rem;
}

.fam-char-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1rem;
}

.fam-char-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    animation: mini-bounce 3s ease-in-out infinite;
}

.fam-chars-grid .fam-char:nth-child(2) .fam-char-img { animation-delay: .4s; }
.fam-chars-grid .fam-char:nth-child(3) .fam-char-img { animation-delay: .8s; }
.fam-chars-grid .fam-char:nth-child(4) .fam-char-img { animation-delay: 1.2s; }
.fam-chars-grid .fam-char:nth-child(5) .fam-char-img { animation-delay: 1.6s; }

/* Tooltip hover personatge */
.fam-char-hover-wrap {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.fam-char-tooltip {
    position: absolute;
    bottom: 105%;
    left: 50%;
    transform: translateX(-50%) scale(.9);
    background: var(--white);
    color: var(--negro);
    font-size: .85rem;
    font-weight: 700;
    padding: .5rem .9rem;
    border-radius: var(--r);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

.fam-char-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--white);
}

.fam-char-hover-wrap:hover .fam-char-tooltip {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

@keyframes mini-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.fam-char-wide {
    grid-column: 1 / -1;
    max-width: 50%;
    margin: 0 auto;
}

/* Etiqueta contenidor */
.fam-container {
    display: inline-block;
    font-size: .95rem;
    font-weight: 800;
    color: var(--white);
    padding: .3rem .9rem;
    border-radius: var(--r-full);
}

.fam-container-groc  { background: #d4a017; }
.fam-container-blau  { background: var(--azul); }
.fam-container-verd  { background: #2e7d32; }
.fam-container-marro { background: var(--marron); }
.fam-container-gris  { background: var(--gris); }

/* Info */
.fam-char-info h3 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--negro);
    margin-bottom: .1rem;
}

.fam-role {
    display: inline-block;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: .75rem;
}

.fam-char-info p {
    font-size: 1.3rem;
    color: var(--text);
    line-height: 1.9;
    margin-bottom: .5rem;
}

.fam-frase {
    font-style: italic;
    font-weight: 700;
    color: var(--verde) !important;
    margin-bottom: .75rem !important;
}

/* Accepta / No accepta */
.fam-accepts,
.fam-rejects {
    font-size: 1.2rem;
    line-height: 1.8;
    padding: .6rem .9rem;
    border-radius: var(--r);
    margin-bottom: .5rem;
}

.fam-accepts {
    background: #e8f5e9;
    color: #2e7d32;
}

.fam-rejects {
    background: #ffebee;
    color: #c62828;
}

/* Amic */
.fam-friend {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    margin-top: .75rem;
    padding: .75rem;
    background: var(--bg);
    border-radius: var(--r);
    font-size: 1.15rem;
    color: var(--text);
    line-height: 1.75;
    text-align: center;
}

.fam-friend-group {
    display: flex;
    gap: .5rem;
    justify-content: center;
}

.fam-friend-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

/* AMICS ESPECIALS — GRID */
.fam-amics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.fam-amic-card {
    padding: 1.25rem 1rem;
    text-align: center;
}

.fam-amic-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin: 0 auto .5rem;
    animation: mini-bounce 3.5s ease-in-out infinite;
}

.fam-amic-role {
    display: block;
    font-size: .9rem;
    font-weight: 700;
    color: var(--verde);
    margin-bottom: .3rem;
}

.fam-amic-card h3 {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--negro);
    margin-bottom: .2rem;
}

.fam-amic-card p {
    font-size: 1.1rem;
    color: var(--muted);
    line-height: 1.75;
}

/* RESPONSIVE — TABLET */
@media (max-width: 900px) {
    .fam-guia {
        flex-direction: column;
        text-align: center;
    }

    .fam-guia-img {
        width: 110px;
        height: 110px;
    }

    .fam-chars-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }

    .fam-char-wide {
        max-width: 100%;
    }

    .fam-amics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* RESPONSIVE — MÒBIL */
@media (max-width: 640px) {
    .fam-char {
        padding: 1.25rem .75rem;
    }

    .fam-amics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: .75rem;
    }
}
