/* Leggibilita mobile: ritocchi finali senza alterare le griglie esistenti. */
.mobile-brand-name {
    display: none;
}

.portrait-required {
    display: none;
}

@media (max-width: 760px) {
    :root {
        --mobile-dock: 76px;
        --mobile-tabs: 50px;
    }

    /* Home: elimina il vuoto sopra l'hero mantenendo respiro sotto la topbar. */
    .portal-page {
        padding-top: var(--mobile-topbar);
    }

    .portal-page .topbar {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        z-index: 86;
        width: 100%;
    }

    .topbar .logo-link {
        min-width: 0;
        gap: 8px;
    }

    .topbar .mobile-brand-name {
        display: block;
        overflow: hidden;
        color: #fff;
        font: 900 italic clamp(15px, 4.6vw, 20px)/1 var(--display);
        letter-spacing: .025em;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .portal-page .home-hero {
        padding-top: 0 !important;
    }

    .portal-page .hero-copy {
        padding-top: 11px;
    }

    .portal-page .live-label {
        margin-bottom: 17px;
        font-size: 11px;
        line-height: 1.2;
        letter-spacing: .09em;
        white-space: nowrap;
    }

    .portal-page .hero-copy > p {
        font-size: 15px;
        line-height: 1.55;
    }

    .portal-page .home-seo-copy p,
    .portal-page .section-title p,
    .portal-page .game-content p,
    .portal-page .manifesto p {
        font-size: 14px;
        line-height: 1.55;
    }

    .portal-page .home-seo-copy a,
    .portal-page .game-content small,
    .portal-page .game-cta,
    .portal-page .manifesto span {
        font-size: 11px;
    }

    /* La scheda FantaRosaNero conserva le leggende anche su smartphone. */
    .portal-page .home-game.fantasy {
        isolation: isolate;
        background: #09090b;
        border-color: #ff3f9b66;
    }

    .portal-page .home-game.fantasy::before {
        content: "";
        position: absolute;
        z-index: 0;
        inset: 0;
        background: url('/images/palermo-legends-hall.webp') 42% center / auto 100% no-repeat;
        filter: saturate(.92) contrast(1.08) brightness(.72);
        transform: scale(1.02);
    }

    .portal-page .home-game.fantasy::after {
        content: "";
        position: absolute;
        z-index: 1;
        inset: 0;
        width: auto;
        height: auto;
        border: 0;
        border-radius: 0;
        background: linear-gradient(180deg, #09090b38 0%, #09090b88 42%, #09090bf5 88%),
                    linear-gradient(90deg, #09090b8c, transparent 70%);
        pointer-events: none;
    }

    .portal-page .home-game.fantasy .game-number,
    .portal-page .home-game.fantasy .game-icon,
    .portal-page .home-game.fantasy .game-legend-slogan {
        z-index: 3;
    }

    .portal-page .home-game.fantasy .game-content {
        text-shadow: 0 2px 10px #000, 0 0 28px #000;
    }

    /* Titoli secondari e testi descrittivi delle pagine interne. */
    .site-main > .page-head .eyebrow,
    .site-main .section-kicker,
    .site-main .panel-kicker {
        font-size: 10px;
        line-height: 1.25;
    }

    .site-main .notice,
    .site-main .import-state,
    .site-main .empty-state,
    .site-main .section-description,
    .site-main .panel-description {
        font-size: 14px;
        line-height: 1.5;
    }

    /* Barra delle sottosezioni: testo piu grande, sempre su una riga. */
    .mobile-section-tabs button {
        min-width: 98px;
        max-width: 150px;
        padding-inline: 9px;
    }

    .mobile-section-tabs button span {
        font-size: 9px;
        line-height: 1;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    /* Menu inferiore: etichette leggibili senza andare a capo. */
    .game-dock a {
        flex-basis: 78px;
        width: 78px;
        height: 70px;
        font-size: 9.5px !important;
        line-height: 1 !important;
        white-space: nowrap;
    }

    /* Menu hamburger: descrizioni piu leggibili, struttura invariata. */
    .mobile-game-menu header,
    .mobile-menu-section {
        font-size: 11px;
    }

    .mobile-game-menu > a b,
    .mobile-menu-action b,
    .mobile-game-menu > a small,
    .mobile-menu-action small {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .mobile-game-menu > a small,
    .mobile-menu-action small {
        font-size: 12px;
        line-height: 1.25;
    }

    /* Tab amministrative: scorrono orizzontalmente e non spezzano le parole. */
    .admin-tabs a,
    .settings-subtabs a {
        font-size: 12px;
        line-height: 1.1;
        white-space: nowrap;
    }

    .settings-subtabs {
        grid-template-columns: repeat(5, minmax(102px, 1fr));
    }

    .service-toggle span {
        font-size: 12px;
    }
}

@media (max-width: 350px) {
    .portal-page .live-label {
        font-size: 10px;
        letter-spacing: .065em;
    }

    .game-dock a {
        flex-basis: 74px;
        width: 74px;
        font-size: 9px !important;
    }
}

@media (max-width: 950px) and (orientation: landscape) {
    body {
        overflow: hidden !important;
    }

    .portrait-required {
        position: fixed;
        z-index: 10000;
        inset: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 12px;
        padding: 28px;
        background: radial-gradient(circle at 50% 35%, #401329, #09090b 60%);
        color: #fff;
        text-align: center;
    }

    .portrait-required img {
        width: 76px;
        height: 76px;
        object-fit: contain;
    }

    .portrait-required strong {
        font: 900 italic 38px/1 var(--display);
        color: var(--pink);
    }

    .portrait-required span {
        max-width: 430px;
        font-size: 16px;
        line-height: 1.45;
    }

    .portrait-required i {
        margin-top: 4px;
        font-size: 42px;
        color: var(--pink);
        animation: portrait-phone 1.5s ease-in-out infinite;
    }
}

@keyframes portrait-phone {
    50% { transform: rotate(-90deg); }
}

@media (prefers-reduced-motion: reduce) {
    .portrait-required i { animation: none; }
}

.pwa-manual-help {
    margin-top: 18px;
    padding: 15px;
    border-left: 3px solid var(--pink);
    background: #0c0c10;
    color: #bbb;
    line-height: 1.5;
}

.pwa-manual-help b,
.pwa-manual-help span,
.pwa-manual-help small {
    display: block;
}

.pwa-install__open[hidden],
.pwa-install__button[hidden] {
    display: none !important;
}

.pwa-install__open i {
    font-size: 20px;
}

/* Secondo passaggio mobile: nessun testo funzionale viene troncato. */
@media (max-width: 760px) {
    .portal-page .live-label {
        font-size: 12px;
        letter-spacing: .055em;
    }

    .topbar .mobile-brand-name {
        flex: 1 1 auto;
        overflow: visible;
        font-size: clamp(17px, 5vw, 21px);
        text-overflow: clip;
    }

    .site-main > .page-head .eyebrow,
    .site-main .eyebrow,
    .section-title > span,
    .game-content small,
    .manifesto span {
        font-size: 12px;
        line-height: 1.3;
    }

    .site-main > .page-head .eyebrow {
        overflow: visible;
        text-overflow: clip;
    }

    .panel p,
    .panel li,
    .rules li,
    .pwa-install__copy > p,
    .pwa-install__status,
    .home-seo-copy p,
    .section-title p,
    .game-content p,
    .manifesto p {
        font-size: 15px;
        line-height: 1.55;
    }

    .panel small,
    .player-row small,
    .lineup-player small,
    .season-row small,
    .stats small,
    .membership-stats small,
    .import-last-run,
    .calendar-counter {
        font-size: 12px;
        line-height: 1.35;
    }

    .mobile-section-tabs button {
        min-width: max-content;
        max-width: none;
        padding-inline: 13px;
    }

    .mobile-section-tabs button span {
        overflow: visible;
        font-size: 11px;
        text-overflow: clip;
    }

    .game-dock a,
    .game-dock .dock-disabled {
        flex-basis: 88px;
        width: 88px;
        font-size: 11px !important;
        letter-spacing: 0;
    }

    .mobile-game-menu > a b,
    .mobile-menu-action b,
    .mobile-game-menu > a small,
    .mobile-menu-action small {
        overflow: visible;
        text-overflow: clip;
        white-space: nowrap;
    }

    .mobile-game-menu > a b,
    .mobile-menu-action b {
        font-size: 23px;
    }

    .mobile-game-menu > a small,
    .mobile-menu-action small {
        font-size: 13px;
    }

    .mobile-game-menu header,
    .mobile-menu-section {
        font-size: 12px;
    }

    .admin-tabs a,
    .settings-subtabs a {
        flex: 0 0 auto;
        min-width: max-content;
        overflow: visible;
        padding-inline: 15px;
        font-size: 13px;
        text-overflow: clip;
    }

    .settings-subtabs {
        display: flex;
        grid-template-columns: none;
        overflow-x: auto;
    }

    .pwa-platforms span,
    .game-cta,
    .button-small,
    .import-actions .button,
    .service-toggle span {
        font-size: 12px;
    }
}

@media (max-width: 350px) {
    .portal-page .live-label {
        font-size: 11px;
        letter-spacing: .035em;
    }

    .topbar .mobile-brand-name {
        font-size: 16px;
    }
}

.pwa-manual-help b {
    margin-bottom: 6px;
    color: #fff;
    text-transform: uppercase;
}

.pwa-manual-help strong {
    color: var(--pink);
}

.pwa-manual-help small {
    margin-top: 8px;
    color: #8f8990;
}
