/**
 * ProPlayer Social — Mobile (refactor: hierarquia clara, menos ruído)
 *
 * Escopo: body.ppsm-social-scope
 * Breakpoints: 991px (layout app), 480px (extra compacto)
 */

@media (max-width: 991px) {

    html {
        scroll-behavior: smooth;
    }

    /* ---------- Página ---------- */
    body.ppsm-social-scope .page-main {
        padding-top: 4px !important;
        padding-bottom: 28px !important;
    }
    body.ppsm-social-scope .column.main {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }
    body.ppsm-season-scope.ppsm-social-scope .column.main {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
    body.ppsm-social-scope .ppsm-wrap {
        padding: 0 0 40px !important;
    }

    body.ppsm-social-scope .ppsm-wrap > * + * {
        margin-top: 20px !important;
    }

    /* Ocultar navegação secundária do hero no mobile (já reordenado no PHTML) */
    body.ppsm-social-scope .ppsm-hub-desktop-only {
        display: none !important;
    }

    /* ---------- HEADER (fora do hub /community/page/view — lá manda ppsm-hub-page.css) ---------- */
    body.ppsm-social-scope .ppsm-hero:not(.ppsm-hero--hub-profile) {
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        box-shadow: none !important;
        margin-left: -14px;
        margin-right: -14px;
        width: calc(100% + 28px);
    }
    body.ppsm-social-scope .ppsm-hero:not(.ppsm-hero--hub-profile) .ppsm-hero__cover {
        height: 96px !important;
    }
    body.ppsm-social-scope .ppsm-hero:not(.ppsm-hero--hub-profile) .ppsm-hero__body {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 8px !important;
        padding: 0 16px 16px !important;
    }
    body.ppsm-social-scope .ppsm-hero:not(.ppsm-hero--hub-profile) .ppsm-hero__avatar {
        width: 80px !important;
        height: 80px !important;
        font-size: 26px !important;
        margin-top: -42px !important;
        border-width: 3px !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12) !important;
    }
    body.ppsm-social-scope .ppsm-hero:not(.ppsm-hero--hub-profile) .ppsm-hero__badges {
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px !important;
        margin: 0 0 2px !important;
    }
    body.ppsm-social-scope .ppsm-hero:not(.ppsm-hero--hub-profile) .ppsm-hero__title {
        font-size: 1.2rem !important;
        font-weight: 800 !important;
        letter-spacing: -0.02em !important;
    }
    body.ppsm-social-scope .ppsm-hero:not(.ppsm-hero--hub-profile) .ppsm-hero__subtitle {
        font-size: 0.82rem !important;
        color: var(--ppsm-muted) !important;
    }
    body.ppsm-social-scope .ppsm-hero:not(.ppsm-hero--hub-profile) .ppsm-hero__bio {
        font-size: 13px !important;
        line-height: 1.5 !important;
        margin: 6px 0 0 !important;
        text-align: center !important;
        max-width: 100% !important;
    }

    /* CTA seguir: destaque moderado (não “botão gigante”) */
    body.ppsm-social-scope .ppsm-hero:not(.ppsm-hero--hub-profile) .ppsm-hero__actions {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100%;
        max-width: 280px;
        margin: 8px auto 0 !important;
        gap: 8px !important;
    }
    body.ppsm-social-scope .ppsm-hero:not(.ppsm-hero--hub-profile) .ppsm-hero__actions > *,
    body.ppsm-social-scope .ppsm-hero:not(.ppsm-hero--hub-profile) .ppsm-hero__actions form {
        width: 100% !important;
    }
    body.ppsm-social-scope .ppsm-hero:not(.ppsm-hero--hub-profile) .ppsm-hero__actions .ppsm-btn--follow {
        background: var(--ppsm-accent) !important;
        color: #fff !important;
        border: 1px solid var(--ppsm-accent) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
        padding: 10px 16px !important;
        font-size: 14px !important;
        min-height: 44px !important;
        border-radius: 12px !important;
    }
    body.ppsm-social-scope .ppsm-hero:not(.ppsm-hero--hub-profile) .ppsm-hero__actions .ppsm-btn--follow:hover {
        background: var(--ppsm-accent-hover) !important;
        transform: none !important;
    }
    body.ppsm-social-scope .ppsm-hero:not(.ppsm-hero--hub-profile) .ppsm-hero__actions .ppsm-btn--unfollow,
    body.ppsm-social-scope .ppsm-hero:not(.ppsm-hero--hub-profile) .ppsm-hero__actions .ppsm-btn--auth-login {
        padding: 10px 16px !important;
        font-size: 14px !important;
        min-height: 44px !important;
        border-radius: 12px !important;
    }

    /* ---------- STATS: sem “card”, só 3 métricas ---------- */
    body.ppsm-social-scope .ppsm-stat--hub-extra {
        display: none !important;
    }
    body.ppsm-social-scope .ppsm-stats:not(.ppsm-stats--hub) {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        align-items: stretch !important;
        gap: 0 !important;
        margin: 0 !important;
        padding: 12px 4px !important;
        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        border-bottom: 1px solid var(--ppsm-border) !important;
    }
    body.ppsm-social-scope .ppsm-stats:not(.ppsm-stats--hub) .ppsm-stat {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        padding: 4px 2px !important;
        border-radius: 0 !important;
        position: relative;
    }
    body.ppsm-social-scope .ppsm-stats:not(.ppsm-stats--hub) .ppsm-stat:not(:last-child)::after {
        content: "";
        position: absolute;
        right: 0;
        top: 18%;
        bottom: 18%;
        width: 1px;
        background: var(--ppsm-border);
        opacity: 0.85;
    }
    body.ppsm-social-scope .ppsm-stats:not(.ppsm-stats--hub) .ppsm-stat:hover {
        background: transparent !important;
    }
    body.ppsm-social-scope .ppsm-stats:not(.ppsm-stats--hub) .ppsm-stat__icon {
        font-size: 0.85rem !important;
        margin-bottom: 2px !important;
        opacity: 0.88;
    }
    body.ppsm-social-scope .ppsm-stats:not(.ppsm-stats--hub) .ppsm-stat__val {
        font-size: 1.1rem !important;
        font-weight: 800 !important;
        color: var(--ppsm-text) !important;
    }
    body.ppsm-social-scope .ppsm-stats:not(.ppsm-stats--hub) .ppsm-stat__label {
        font-size: 10px !important;
        font-weight: 600 !important;
        color: var(--ppsm-muted) !important;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    /* ---------- Partilha: só ícone ---------- */
    body.ppsm-social-scope .ppsm-share {
        justify-content: flex-end !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
    }
    body.ppsm-social-scope .ppsm-share__expanded {
        display: none !important;
    }
    body.ppsm-social-scope .ppsm-share__icon-btn {
        display: inline-flex !important;
        width: 40px !important;
        height: 40px !important;
        border-radius: 50% !important;
        border: 1px solid var(--ppsm-border) !important;
        background: var(--ppsm-surface) !important;
        color: var(--ppsm-muted) !important;
        box-shadow: none !important;
    }

    /* ---------- Abas: coluna no mobile (uma aba por linha) ---------- */
    body.ppsm-social-scope .ppsm-tabs {
        position: sticky !important;
        top: 0 !important;
        z-index: 25 !important;
        margin: 0 -14px !important;
        width: calc(100% + 28px) !important;
        padding: 8px 0 12px !important;
        background: linear-gradient(180deg, rgba(245, 245, 245, 0.97) 0%, rgba(245, 245, 245, 0.88) 100%) !important;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: none !important;
        border-bottom: 1px solid var(--ppsm-border) !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    /*
     * Uma aba = uma linha inteira: Grid 1 coluna (à prova de inline-flex / wrap do tema).
     */
    body.ppsm-social-scope .ppsm-tabs {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    body.ppsm-social-scope nav.ppsm-tabs__nav {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        grid-auto-flow: row !important;
        gap: 8px !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 12px !important;
        box-sizing: border-box !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
        scroll-snap-type: none !important;
        -webkit-overflow-scrolling: auto !important;
    }
    body.ppsm-social-scope button.ppsm-tabs__btn {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        justify-self: stretch !important;
        grid-column: 1 / -1 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: none !important;
        box-sizing: border-box !important;
        scroll-snap-align: none !important;
        padding: 10px 14px !important;
        min-height: 46px !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        gap: 10px !important;
        border: none !important;
        border-radius: 12px !important;
        background: transparent !important;
        color: var(--ppsm-text-soft) !important;
        box-shadow: none !important;
        text-align: left !important;
        white-space: nowrap !important;
    }
    body.ppsm-social-scope button.ppsm-tabs__btn .ppsm-tabs__count {
        margin-left: auto !important;
        min-width: 20px !important;
        padding: 1px 6px !important;
        font-size: 10px !important;
        font-weight: 800 !important;
        background: rgba(0, 0, 0, 0.06) !important;
        color: var(--ppsm-text) !important;
        border: none !important;
    }
    body.ppsm-social-scope .ppsm-tabs__btn i {
        font-size: 14px !important;
        color: inherit !important;
        opacity: 0.85;
    }
    body.ppsm-social-scope .ppsm-tabs__btn:hover:not(.is-active) {
        background: rgba(0, 0, 0, 0.04) !important;
        color: var(--ppsm-text) !important;
        box-shadow: none !important;
    }
    body.ppsm-social-scope .ppsm-tabs__btn.is-active {
        background: rgba(0, 0, 0, 0.08) !important;
        color: var(--ppsm-text) !important;
        font-weight: 800 !important;
        box-shadow: none !important;
        border: none !important;
    }
    body.ppsm-social-scope .ppsm-tabs__btn.is-active .ppsm-tabs__count {
        background: rgba(0, 0, 0, 0.12) !important;
        color: var(--ppsm-text) !important;
    }

    /* Reforço vs. Luma / merge de CSS */
    html body.ppsm-social-scope nav.ppsm-tabs__nav {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
    }
    html body.ppsm-social-scope button.ppsm-tabs__btn {
        display: flex !important;
        grid-column: 1 / -1 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    html body.ppsm-social-scope .ppsm-tabs__btn.is-active {
        background-color: rgba(0, 0, 0, 0.08) !important;
        color: var(--ppsm-text) !important;
        border: none !important;
    }
    html body.ppsm-social-scope .ppsm-tabs__btn.is-active i {
        color: var(--ppsm-text) !important;
    }

    /* Botões dashboard (vista de temporada) — uma linha por botão */
    body.ppsm-social-scope .ppsm-tabs .ppsm-dash__actions {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
        padding: 0 12px !important;
        gap: 8px !important;
        box-sizing: border-box !important;
    }
    body.ppsm-social-scope .ppsm-tabs button.ppsm-dash__btn {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        flex: none !important;
        justify-content: flex-start !important;
        min-height: 48px !important;
        border: none !important;
        border-radius: 12px !important;
        background: transparent !important;
        color: var(--ppsm-text-soft) !important;
        box-shadow: none !important;
        font-weight: 600 !important;
        font-size: 13px !important;
    }
    body.ppsm-social-scope .ppsm-tabs button.ppsm-dash__btn.is-active {
        background: rgba(0, 0, 0, 0.08) !important;
        color: var(--ppsm-text) !important;
        font-weight: 800 !important;
    }
    body.ppsm-social-scope .ppsm-tabs .ppsm-dash__count {
        margin-left: auto !important;
    }

    /* Temporada: abas dash — versão mobile clean (sem border 2px black) */
    html body.ppsm-season-scope.ppsm-social-scope .ppsm-tabs.ppsm-tabs--season {
        position: sticky !important;
        top: 0 !important;
        z-index: 30 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: none !important;
        padding: 8px 0 !important;
        box-sizing: border-box !important;
        background: rgba(245, 245, 245, 0.95) !important;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: none !important;
        border-bottom: 1px solid #e5e5e5 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    html body.ppsm-season-scope.ppsm-social-scope .ppsm-tabs.ppsm-tabs--season .ppsm-dash__actions--season {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        scrollbar-width: none !important;
        gap: 4px !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 4px !important;
        box-sizing: border-box !important;
        background: #ffffff !important;
        border: 1px solid #e5e5e5 !important;
        border-radius: 12px !important;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    }
    html body.ppsm-season-scope.ppsm-social-scope .ppsm-tabs.ppsm-tabs--season .ppsm-dash__actions--season::-webkit-scrollbar {
        display: none !important;
    }
    html body.ppsm-season-scope.ppsm-social-scope .ppsm-tabs.ppsm-tabs--season button.ppsm-season-tab.ppsm-dash__btn {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: min(100%, 148px) !important;
        min-height: 44px !important;
        margin: 0 !important;
        padding: 8px 12px !important;
        border-radius: 8px !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        cursor: pointer !important;
        font-family: inherit !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        text-align: center !important;
        white-space: nowrap !important;
        line-height: 1.25 !important;
        box-shadow: none !important;
        transform: none !important;
        -webkit-appearance: none !important;
        appearance: none !important;
    }
    html body.ppsm-season-scope.ppsm-social-scope .ppsm-tabs.ppsm-tabs--season button.ppsm-season-tab.ppsm-dash__btn:not(.is-active) {
        background: transparent !important;
        color: #525252 !important;
        border: 1px solid transparent !important;
    }
    html body.ppsm-season-scope.ppsm-social-scope .ppsm-tabs.ppsm-tabs--season button.ppsm-season-tab.ppsm-dash__btn:not(.is-active) i {
        color: #737373 !important;
    }
    html body.ppsm-season-scope.ppsm-social-scope .ppsm-tabs.ppsm-tabs--season button.ppsm-season-tab.ppsm-dash__btn:not(.is-active) .ppsm-dash__count {
        margin-left: 4px !important;
        background: rgba(0, 0, 0, 0.06) !important;
        color: #525252 !important;
        border: none !important;
        padding: 1px 6px !important;
        font-size: 10px !important;
        font-weight: 700 !important;
        border-radius: 999px !important;
    }
    html body.ppsm-season-scope.ppsm-social-scope .ppsm-tabs.ppsm-tabs--season button.ppsm-season-tab.ppsm-dash__btn:not(.is-active):hover {
        background: #f5f5f5 !important;
        color: #0a0a0a !important;
        border-color: transparent !important;
    }
    html body.ppsm-season-scope.ppsm-social-scope .ppsm-tabs.ppsm-tabs--season button.ppsm-season-tab.ppsm-dash__btn:not(.is-active):hover i {
        color: #0a0a0a !important;
    }
    html body.ppsm-season-scope.ppsm-social-scope .ppsm-tabs.ppsm-tabs--season button.ppsm-season-tab.ppsm-dash__btn.is-active {
        background: #0a0a0a !important;
        color: #ffffff !important;
        border: 1px solid #0a0a0a !important;
        box-shadow: inset 0 -3px 0 rgba(255, 255, 255, 0.35) !important;
    }
    html body.ppsm-season-scope.ppsm-social-scope .ppsm-tabs.ppsm-tabs--season button.ppsm-season-tab.ppsm-dash__btn.is-active i {
        color: #ffffff !important;
    }
    html body.ppsm-season-scope.ppsm-social-scope .ppsm-tabs.ppsm-tabs--season button.ppsm-season-tab.ppsm-dash__btn.is-active .ppsm-dash__count {
        margin-left: 4px !important;
        background: rgba(255, 255, 255, 0.18) !important;
        color: #ffffff !important;
        border: none !important;
        padding: 1px 6px !important;
        font-size: 10px !important;
        font-weight: 700 !important;
        border-radius: 999px !important;
    }
    html body.ppsm-season-scope.ppsm-social-scope .ppsm-tabs.ppsm-tabs--season button.ppsm-season-tab.ppsm-dash__btn.is-active:hover {
        background: #1f2937 !important;
        color: #ffffff !important;
        border-color: #1f2937 !important;
    }

    body.ppsm-social-scope .ppsm-dash__actions--page a.ppsm-dash__btn {
        flex: 1 1 100% !important;
        width: 100% !important;
    }

    /* ---------- Conteúdo: cards só onde importa ---------- */
    body.ppsm-social-scope .ppsm-tab-panel > * + * {
        margin-top: 20px !important;
    }
    body.ppsm-social-scope .ppsm-tab-panel > * {
        margin-bottom: 0 !important;
    }

    body.ppsm-social-scope .ppsm-overview__block + .ppsm-overview__block {
        margin-top: 22px !important;
    }
    body.ppsm-social-scope .ppsm-card--elevated {
        border-radius: 16px !important;
        padding: 16px 14px !important;
        border: 1px solid var(--ppsm-border) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
        background: var(--ppsm-surface) !important;
    }
    body.ppsm-social-scope .ppsm-overview .ppsm-card__head {
        margin-bottom: 12px !important;
        align-items: flex-start !important;
    }
    body.ppsm-social-scope .ppsm-overview .ppsm-card__title {
        font-size: 0.92rem !important;
    }
    body.ppsm-social-scope .ppsm-overview .ppsm-card__actions .ppsm-btn--sm {
        padding: 7px 12px !important;
        font-size: 12px !important;
        min-height: 36px !important;
    }

    /* Season snippet dentro do card: menos “card dentro de card” */
    body.ppsm-social-scope .ppsm-overview .ppsm-season-card {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        background: transparent !important;
    }
    body.ppsm-social-scope .ppsm-overview .ppsm-season-card::before {
        display: none !important;
    }

    body.ppsm-social-scope .ppsm-hub-spotlight {
        margin-bottom: 12px !important;
        border-radius: 14px !important;
    }

    body.ppsm-social-scope .ppsm-medals--in-card {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }
    body.ppsm-social-scope .ppsm-overview .ppsm-medal {
        padding: 12px 10px !important;
        border-radius: 14px !important;
        box-shadow: none !important;
    }
    body.ppsm-social-scope .ppsm-overview .ppsm-medal:hover {
        transform: none !important;
    }

    body.ppsm-social-scope .ppsm-hub-tlink {
        padding: 12px !important;
        border-radius: 14px !important;
    }

    /* Outras abas: menos peso visual */
    body.ppsm-social-scope .ppsm-tab-panel:not([data-panel="overview"]) .ppsm-card {
        border-radius: 16px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    }
    body.ppsm-social-scope .ppsm-season-card {
        border-radius: 16px !important;
    }

    /* Chips ranking: scroll leve */
    body.ppsm-social-scope .ppsm-chips {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        scrollbar-width: none;
        gap: 6px !important;
        padding-bottom: 4px !important;
        margin-bottom: 12px !important;
    }
    body.ppsm-social-scope .ppsm-chips::-webkit-scrollbar {
        display: none;
    }
    body.ppsm-social-scope .ppsm-chip {
        flex: 0 0 auto;
        padding: 8px 12px !important;
        font-size: 12px !important;
        border-radius: 999px !important;
    }

    /* Tabelas: scroll horizontal só no wrapper (.ppsm-table-wrap).
       NUNCA aplicar display:block + nowrap no <table> dentro do wrap — isso
       expande o layout e causa overflow horizontal na página inteira. */
    body.ppsm-social-scope .ppsm-card > .ppsm-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 12px;
        white-space: nowrap;
    }

    body.ppsm-social-scope .ppsm-table-wrap {
        display: block;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    body.ppsm-social-scope .ppsm-table-wrap .ppsm-table {
        display: table !important;
        width: 100%;
        min-width: 560px;
        max-width: none;
        white-space: normal !important;
        font-size: 12px;
        overflow: visible !important;
    }

    /*
     * Stack (cartões): este ficheiro carrega DEPOIS de ppsm-social.css.
     * A regra genérica .ppsm-table-wrap .ppsm-table usa display:table + min-width:560px;
     * sem isto, empata em especificidade com o STRICT a 768px e o mobile GANHA — o layout stack quebra.
     */
    /* ================================================================
     * ESCOPO: aba "Classificação & histórico"
     * Estratégia: nenhum descendente pode passar da largura do pai.
     * - max-width: 100% impede que qualquer filho fique > pai
     * - min-width: 0 destrava o encolhimento (filhos de flex/grid)
     * - box-sizing: border-box deixa borders/padding caberem em 100%
     * ================================================================ */
    body.ppsm-social-scope .ppsm-tab-panel[data-panel="rest"],
    body.ppsm-social-scope .ppsm-tab-panel[data-panel="rest"] * {
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    /* Cadeia de blocos: ocupam 100% e clipam o que tentar transbordar. */
    body.ppsm-social-scope .ppsm-wrap,
    body.ppsm-social-scope .ppsm-wrap--season,
    body.ppsm-social-scope .ppsm-tab-panel,
    body.ppsm-social-scope .ppsm-tab-panel > *,
    body.ppsm-social-scope .ppsm-season-rest-stack,
    body.ppsm-social-scope .ppsm-season-rest-stack__block,
    body.ppsm-social-scope .ppsm-tab-panel > .ppsm-card,
    body.ppsm-social-scope .ppsm-season-rest-stack__block > .ppsm-card {
        width: 100% !important;
    }

    body.ppsm-social-scope .ppsm-tab-panel[data-panel="rest"],
    body.ppsm-social-scope .ppsm-tab-panel[data-panel="rest"] .ppsm-season-rest-stack,
    body.ppsm-social-scope .ppsm-tab-panel[data-panel="rest"] .ppsm-season-rest-stack__block,
    body.ppsm-social-scope .ppsm-tab-panel[data-panel="rest"] > .ppsm-card,
    body.ppsm-social-scope .ppsm-season-rest-stack__block > .ppsm-card,
    body.ppsm-social-scope .ppsm-season-rest-stack__block > .ppsm-empty {
        overflow-x: clip !important;
        overflow-x: hidden !important;
    }

    /* Conteúdos típicos do cartão: garantir quebra de palavra (sem expandir). */
    body.ppsm-social-scope .ppsm-tab-panel[data-panel="rest"] .ppsm-card__head,
    body.ppsm-social-scope .ppsm-tab-panel[data-panel="rest"] .ppsm-card__title,
    body.ppsm-social-scope .ppsm-tab-panel[data-panel="rest"] .ppsm-card__hint,
    body.ppsm-social-scope .ppsm-tab-panel[data-panel="rest"] .ppsm-timeline,
    body.ppsm-social-scope .ppsm-tab-panel[data-panel="rest"] .ppsm-timeline__item,
    body.ppsm-social-scope .ppsm-tab-panel[data-panel="rest"] .ppsm-timeline__title,
    body.ppsm-social-scope .ppsm-tab-panel[data-panel="rest"] .ppsm-timeline__desc,
    body.ppsm-social-scope .ppsm-tab-panel[data-panel="rest"] .ppsm-timeline__date {
        word-break: break-word !important;
        overflow-wrap: anywhere !important;
        white-space: normal !important;
    }

    body.ppsm-social-scope .ppsm-tab-panel[data-panel="rest"] .ppsm-card__head {
        flex-wrap: wrap !important;
    }

    body.ppsm-social-scope .ppsm-table-wrap--stack {
        position: relative !important;
        float: none !important;
        clear: none !important;
        display: block !important;
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        overflow-x: clip !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
        contain: inline-size !important;
        isolation: isolate !important;
        -webkit-overflow-scrolling: auto;
        overscroll-behavior-x: none !important;
    }

    body.ppsm-social-scope .ppsm-table-wrap--stack .ppsm-table {
        display: block !important;
        position: relative !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
        table-layout: fixed !important;
        white-space: normal !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
        box-sizing: border-box !important;
    }

    /* Sem position:absolute no thead — em WebKit isso + nowrap podia alargar o layout. */
    body.ppsm-social-scope .ppsm-table-wrap--stack .ppsm-table thead {
        display: none !important;
    }

    body.ppsm-social-scope .ppsm-table-wrap--stack .ppsm-table tbody {
        display: block !important;
        width: 100% !important;
    }

    body.ppsm-social-scope .ppsm-table-wrap--stack .ppsm-table tr {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-bottom: 10px !important;
        padding: 10px !important;
        box-sizing: border-box !important;
        border: 1px solid var(--ppsm-border, #e5e5e5) !important;
        border-radius: 8px !important;
    }

    /* GRID 2 colunas com minmax(0, ...) é o padrão mais robusto contra overflow:
       a coluna de valor pode realmente encolher (flex teimava em não shrink). */
    body.ppsm-social-scope .ppsm-table-wrap--stack .ppsm-table td {
        display: grid !important;
        grid-template-columns: minmax(0, 40%) minmax(0, 1fr) !important;
        align-items: start !important;
        gap: 6px 8px !important;
        margin-bottom: 6px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: hidden !important;
        word-break: break-word !important;
        overflow-wrap: anywhere !important;
        box-sizing: border-box !important;
    }

    body.ppsm-social-scope .ppsm-table-wrap--stack .ppsm-table td strong {
        min-width: 0 !important;
        max-width: 100% !important;
        word-break: break-word !important;
        overflow-wrap: anywhere !important;
        font-weight: 700 !important;
    }

    body.ppsm-social-scope .ppsm-table-wrap--stack .ppsm-table td::before {
        content: attr(data-label) !important;
        font-weight: 700 !important;
        font-size: 10px !important;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--ppsm-muted, #737373);
        min-width: 0 !important;
        max-width: 100% !important;
        word-break: break-word !important;
        overflow-wrap: anywhere !important;
        align-self: center;
    }

    body.ppsm-social-scope .ppsm-table-wrap--stack .ppsm-table td > * {
        min-width: 0 !important;
        max-width: 100% !important;
        text-align: right !important;
        justify-self: end !important;
        box-sizing: border-box !important;
    }

    body.ppsm-social-scope .ppsm-table-wrap--stack .ppsm-badge,
    body.ppsm-social-scope .ppsm-table-wrap--stack .ppsm-badge--table-cell {
        display: inline-flex !important;
        max-width: 100% !important;
        width: auto !important;
        min-width: 0 !important;
        padding: 3px 8px !important;
        font-size: 10px !important;
        white-space: normal !important;
        word-break: break-word !important;
        overflow-wrap: anywhere !important;
        flex-wrap: wrap !important;
        justify-content: flex-end !important;
        text-align: right !important;
        box-sizing: border-box !important;
    }

    body.ppsm-social-scope .ppsm-table-wrap--stack .ppsm-table td > .ppsm-cell-player {
        text-align: left !important;
        justify-content: flex-end !important;
    }

    /* Rank rows */
    body.ppsm-social-scope .ppsm-rank-row {
        border-radius: 14px !important;
    }
    body.ppsm-social-scope .ppsm-rank-row:hover {
        transform: none !important;
    }

    /* Lock */
    body.ppsm-social-scope .ppsm-lock {
        border-radius: 14px !important;
    }

    /* Botões globais: garantir tap target ≥ 44px (WCAG 2.5.5) */
    body.ppsm-social-scope a.ppsm-btn,
    body.ppsm-social-scope button.ppsm-btn {
        min-height: var(--ppsm-tap, 44px) !important;
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }
}

/* ---------- Small mobile ---------- */
@media (max-width: 480px) {
    body.ppsm-social-scope .column.main {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    body.ppsm-social-scope .ppsm-hero {
        margin-left: -12px;
        margin-right: -12px;
        width: calc(100% + 24px);
    }
    body.ppsm-social-scope .ppsm-tabs {
        margin: 0 -12px !important;
        width: calc(100% + 24px) !important;
    }
    body.ppsm-social-scope .ppsm-hero__cover {
        height: 88px !important;
    }
    body.ppsm-social-scope .ppsm-hero__avatar {
        width: 72px !important;
        height: 72px !important;
        font-size: 22px !important;
        margin-top: -38px !important;
    }
    body.ppsm-social-scope .ppsm-hero__title {
        font-size: 1.1rem !important;
    }
    body.ppsm-social-scope .ppsm-stat__val {
        font-size: 1rem !important;
    }
    body.ppsm-social-scope .ppsm-stat__label {
        font-size: 9px !important;
    }
    body.ppsm-social-scope .ppsm-tabs__btn {
        font-size: 12.5px !important;
        padding: 7px 10px !important;
    }
}

/* ---------- Toque: feedback leve ---------- */
@media (hover: none) and (pointer: coarse) {
    body.ppsm-social-scope a.ppsm-btn:active,
    body.ppsm-social-scope button.ppsm-btn:active {
        transform: scale(0.98) !important;
    }
    body.ppsm-social-scope .ppsm-hub-tlink:active {
        opacity: 0.92;
    }
}

/* ==================================================================
   Season view — restante (desktop + espaçamento + hero + cartões)
   Ficheiro ppsm-season-view.css pode não estar em pub/static; isto garante carregamento.
   ================================================================== */
body.ppsm-season-scope .ppsm-wrap.ppsm-wrap--season {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    padding-bottom: 28px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}
body.ppsm-season-scope .ppsm-wrap--season > .ppsm-season-breadcrumb {
    margin: 0 0 14px !important;
}
body.ppsm-season-scope .ppsm-wrap--season > .ppsm-hero--season {
    margin-bottom: 18px !important;
}
body.ppsm-season-scope .ppsm-wrap--season > .ppsm-card--season-edit {
    margin-bottom: 18px !important;
}
body.ppsm-season-scope .ppsm-wrap--season > .ppsm-lock {
    margin-bottom: 20px !important;
}
body.ppsm-season-scope .ppsm-wrap--season > .ppsm-stats {
    margin-bottom: 18px !important;
}
body.ppsm-season-scope .ppsm-wrap--season > .ppsm-tabs.ppsm-tabs--season {
    margin-bottom: 22px !important;
}
body.ppsm-season-scope .ppsm-wrap--season > .ppsm-stats + .ppsm-tabs.ppsm-tabs--season {
    margin-top: 2px !important;
}
body.ppsm-season-scope .ppsm-wrap--season .ppsm-tab-panel > * + * {
    margin-top: 22px !important;
}
body.ppsm-season-scope .ppsm-wrap--season .ppsm-tab-panel > .ppsm-card + .ppsm-card {
    margin-top: 20px !important;
}
body.ppsm-season-scope .ppsm-wrap--season .ppsm-season-rest-stack__block > * + * {
    margin-top: 20px !important;
}
body.ppsm-season-scope .ppsm-season-breadcrumb {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 13px !important;
    color: #525252 !important;
}
body.ppsm-season-scope .ppsm-season-breadcrumb__link {
    color: #000000 !important;
    font-weight: 700 !important;
    text-decoration: none !important;
}
body.ppsm-season-scope .ppsm-season-breadcrumb__link:hover {
    color: #404040 !important;
    text-decoration: underline !important;
}
body.ppsm-season-scope .ppsm-season-breadcrumb__sep {
    font-size: 10px !important;
    color: #737373 !important;
}
body.ppsm-season-scope .ppsm-season-breadcrumb__current {
    font-weight: 600 !important;
    color: #171717 !important;
}
body.ppsm-season-scope .ppsm-tabs.ppsm-tabs--season {
    position: sticky !important;
    top: 0 !important;
    z-index: 30 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    background: transparent !important;
    border: none !important;
    border-radius: 14px !important;
    box-shadow: none !important;
}
body.ppsm-season-scope .ppsm-tabs.ppsm-tabs--season .ppsm-dash__actions--season {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 6px !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
    border: 1px solid #e5e5e5 !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
}
body.ppsm-season-scope .ppsm-tabs.ppsm-tabs--season .ppsm-dash__actions--season::-webkit-scrollbar {
    display: none !important;
}
body.ppsm-season-scope .ppsm-tabs.ppsm-tabs--season button.ppsm-season-tab.ppsm-dash__btn {
    flex: 0 0 auto !important;
    width: auto !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 8px 14px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    font-family: inherit !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    text-align: left !important;
    white-space: nowrap !important;
    line-height: 1.25 !important;
    transition: background-color 0.15s ease, color 0.15s ease !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-shadow: none !important;
    transform: none !important;
}
body.ppsm-season-scope .ppsm-tabs.ppsm-tabs--season button.ppsm-season-tab.ppsm-dash__btn:not(.is-active) {
    background: transparent !important;
    color: #525252 !important;
    border: 1px solid transparent !important;
}
body.ppsm-season-scope .ppsm-tabs.ppsm-tabs--season button.ppsm-season-tab.ppsm-dash__btn:not(.is-active) i {
    color: #737373 !important;
}
body.ppsm-season-scope .ppsm-tabs.ppsm-tabs--season button.ppsm-season-tab.ppsm-dash__btn:not(.is-active) .ppsm-dash__count {
    margin-left: 4px !important;
    background: rgba(0, 0, 0, 0.06) !important;
    color: #525252 !important;
    border: none !important;
    padding: 1px 7px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    border-radius: 999px !important;
}
body.ppsm-season-scope .ppsm-tabs.ppsm-tabs--season button.ppsm-season-tab.ppsm-dash__btn:not(.is-active):hover {
    background: #f5f5f5 !important;
    color: #0a0a0a !important;
    border-color: transparent !important;
}
body.ppsm-season-scope .ppsm-tabs.ppsm-tabs--season button.ppsm-season-tab.ppsm-dash__btn:not(.is-active):hover i {
    color: #0a0a0a !important;
}
body.ppsm-season-scope .ppsm-tabs.ppsm-tabs--season button.ppsm-season-tab.ppsm-dash__btn:not(.is-active):hover .ppsm-dash__count {
    background: rgba(0, 0, 0, 0.1) !important;
    color: #0a0a0a !important;
}
body.ppsm-season-scope .ppsm-tabs.ppsm-tabs--season button.ppsm-season-tab.ppsm-dash__btn.is-active {
    background: #0a0a0a !important;
    color: #ffffff !important;
    border: 1px solid #0a0a0a !important;
    box-shadow: inset 0 -3px 0 rgba(255, 255, 255, 0.35) !important;
}
body.ppsm-season-scope .ppsm-tabs.ppsm-tabs--season button.ppsm-season-tab.ppsm-dash__btn.is-active i {
    color: #ffffff !important;
}
body.ppsm-season-scope .ppsm-tabs.ppsm-tabs--season button.ppsm-season-tab.ppsm-dash__btn.is-active .ppsm-dash__count {
    margin-left: 4px !important;
    background: rgba(255, 255, 255, 0.18) !important;
    color: #ffffff !important;
    border: none !important;
    padding: 1px 7px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    border-radius: 999px !important;
}
body.ppsm-season-scope .ppsm-tabs.ppsm-tabs--season button.ppsm-season-tab.ppsm-dash__btn.is-active:hover {
    background: #1f2937 !important;
    color: #ffffff !important;
    border-color: #1f2937 !important;
}
body.ppsm-season-scope .ppsm-tabs.ppsm-tabs--season button.ppsm-season-tab.ppsm-dash__btn:focus-visible {
    outline: 2px solid #0a0a0a !important;
    outline-offset: 2px !important;
}
/* ==================================================================
   Season detail — wrap, breadcrumb, tabs sticky (overrides desktop)
   Hero/stat/tournament-list usam classes novas (.ppsm-season-hero,
   .ppsm-stat-card, .ppsm-tournament-item) e estão definidas em
   ppsm-social.css. Aqui ficam apenas regras de layout do scope.
   ================================================================== */
body.ppsm-season-scope .ppsm-grid--season-tournaments {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
}
@media (min-width: 640px) {
    body.ppsm-season-scope .ppsm-wrap.ppsm-wrap--season {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
    body.ppsm-season-scope .ppsm-tabs.ppsm-tabs--season {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }
    body.ppsm-season-scope .ppsm-tabs.ppsm-tabs--season .ppsm-dash__actions--season {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        gap: 8px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    body.ppsm-season-scope .ppsm-tabs.ppsm-tabs--season button.ppsm-season-tab.ppsm-dash__btn {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: 148px !important;
    }
    body.ppsm-season-scope .ppsm-grid--season-tournaments {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 14px !important;
    }
}
@media (min-width: 960px) {
    body.ppsm-season-scope .ppsm-grid--season-tournaments {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 16px !important;
    }
    body.ppsm-season-scope .ppsm-wrap.ppsm-wrap--season {
        max-width: 1100px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    body.ppsm-season-scope .ppsm-tabs.ppsm-tabs--season {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        border-radius: 14px !important;
        border: 1px solid #e5e5e5 !important;
    }
}
