/**
 * IL MODAL DELLE LINGUE — un foglio solo per tutte le pagine che lo hanno:
 * benvenuto, /auth, /maps. Prefisso `lg-`. Stava in benvenuto.css; da lì
 * /maps non poteva prenderlo senza tirarsi dietro tutto il benvenuto.
 */
/* Il velo: sopra tutto, e il modal al centro. */
.lg-velo {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(3, 12, 24, .62);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    animation: lg-appare .18s ease-out;
}

.lg-velo[hidden] {
    display: none;
}

@keyframes lg-appare {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.lg-modal {
    width: min(100%, 26rem);
    max-height: calc(100svh - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(11, 42, 71, .98) 0%, rgba(8, 33, 56, .98) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .12),
        0 24px 60px -18px rgba(0, 0, 0, .75);
    color: #eaf4fb;
    animation: lg-sale .22s cubic-bezier(.2, .8, .3, 1);
}

@keyframes lg-sale {
    from { transform: translateY(12px) scale(.97); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

.lg-testa {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    padding: .8rem .9rem .7rem 1.1rem;
    border-bottom: 1px solid rgba(255, 217, 138, .2);
}

.lg-titolo {
    margin: 0;
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--oro, #ffd98a);
}

.lg-globo {
    width: 1.15rem;
    height: 1.15rem;
    flex: none;
}

/* La X: un tondo tenue, a destra (a sinistra nelle lingue da destra). */
.lg-x {
    -webkit-appearance: none;
    appearance: none;
    flex: none;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(234, 244, 251, .1);
    color: #eaf4fb;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.lg-x:active {
    transform: scale(.92);
}

.lg-griglia {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem .4rem;
    padding: 1rem .7rem 1.1rem;
}

.lg-voce {
    -webkit-appearance: none;
    appearance: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .15rem;
    min-width: 0;
    padding: .45rem .2rem;
    border: 0;
    border-radius: 12px;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background .2s ease, transform .2s ease;
}

.lg-voce:active {
    transform: translateY(1px) scale(.97);
    background: rgba(255, 217, 138, .08);
}

.lg-bandiera {
    width: 44px;
    height: 44px;
    margin-bottom: .35rem;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
    transition: transform .25s ease, box-shadow .25s ease;
}

.lg-bandiera img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (hover: hover) {
    .lg-voce:hover {
        background: rgba(255, 217, 138, .06);
        transform: translateY(-2px);
    }

    .lg-voce:hover .lg-bandiera {
        transform: scale(1.08);
        box-shadow: 0 8px 22px rgba(255, 217, 138, .28);
    }
}

/* La lingua in uso: l'anello d'oro. */
.lg-voce.su .lg-bandiera {
    box-shadow: 0 0 0 2.5px var(--oro, #ffd98a), 0 4px 14px rgba(255, 217, 138, .3);
}

.lg-nome {
    max-width: 100%;
    font-size: .88rem;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lg-suo {
    max-width: 100%;
    font-size: .74rem;
    line-height: 1.25;
    color: rgba(234, 244, 251, .7);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lg-voce.su .lg-nome {
    color: var(--oro, #ffd98a);
}

@media (prefers-reduced-motion: reduce) {
    .lg-velo, .lg-modal { animation: none; }
}
