@media (max-width: 900px) {
    .mobile-stack-wrap {
        overflow-x: visible !important;
        overflow-y: visible !important;
        max-height: none !important;
    }

    table.mobile-stack-table,
    table.mobile-stack-table thead,
    table.mobile-stack-table tbody,
    table.mobile-stack-table tr,
    table.mobile-stack-table th,
    table.mobile-stack-table td {
        display: block;
        width: 100% !important;
        max-width: 100%;
    }

    table.mobile-stack-table {
        table-layout: auto !important;
        border-spacing: 0;
    }

    table.mobile-stack-table thead {
        display: none;
    }

    table.mobile-stack-table tbody {
        display: grid;
        gap: 0.95rem;
    }

    table.mobile-stack-table tbody tr {
        display: grid;
        gap: 0.85rem;
        padding: 1rem;
        border-radius: 20px;
        border: 1px solid rgba(201, 169, 97, 0.18);
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 247, 250, 0.96));
        box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
        overflow: hidden;
        transform: none !important;
    }

    table.mobile-stack-table th,
    table.mobile-stack-table td {
        position: static !important;
        top: auto !important;
        left: auto !important;
        min-width: 0 !important;
        width: 100% !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        text-align: left !important;
        white-space: normal !important;
    }

    table.mobile-stack-table tbody td,
    table.mobile-stack-table tbody th {
        margin: 0;
        padding: 0.8rem 0.95rem;
        border-bottom: 0 !important;
        background: rgba(248, 250, 252, 0.88) !important;
        border: 1px solid rgba(226, 232, 240, 0.85);
        border-radius: 16px !important;
        color: #0f172a !important;
        overflow-wrap: anywhere;
    }

    table.mobile-stack-table tbody td + td,
    table.mobile-stack-table tbody td + th,
    table.mobile-stack-table tbody th + td,
    table.mobile-stack-table tbody th + th {
        margin-top: 0.8rem;
    }

    table.mobile-stack-table tbody td::before,
    table.mobile-stack-table tbody th::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.35rem;
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        color: #64748b;
    }

    table.mobile-stack-table tbody td[data-label=""]::before,
    table.mobile-stack-table tbody th[data-label=""]::before {
        display: none;
    }

    table.mobile-stack-table tbody tr:hover,
    table.mobile-stack-table tbody tr:hover td,
    table.mobile-stack-table tbody tr:hover th {
        background: rgba(248, 250, 252, 0.96) !important;
    }

    table.mobile-stack-table .player-name,
    table.mobile-stack-table .team-name {
        color: #0f172a !important;
    }

    table.mobile-stack-table .player-team {
        color: #64748b !important;
    }

    table.mobile-stack-table .player-cell,
    table.mobile-stack-table .team-cell,
    table.mobile-stack-table .player-info {
        align-items: center;
        gap: 0.8rem;
    }

    table.mobile-stack-table .player-headshot,
    table.mobile-stack-table .team-logo {
        flex-shrink: 0;
    }

    .stats-table.mobile-stack-table tbody tr,
    .roster-table.mobile-stack-table tbody tr,
    .player-stats-table.mobile-stack-table tbody tr,
    .comparison-table.mobile-stack-table tbody tr {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-table.mobile-stack-table tbody td,
    .roster-table.mobile-stack-table tbody td,
    .player-stats-table.mobile-stack-table tbody td,
    .comparison-table.mobile-stack-table tbody td {
        width: auto !important;
        margin-top: 0 !important;
    }

    .stats-table.mobile-stack-table tbody td:nth-child(-n+4),
    .roster-table.mobile-stack-table tbody td:nth-child(-n+4),
    .player-stats-table.mobile-stack-table tbody td:nth-child(-n+2),
    .comparison-table.mobile-stack-table tbody td:first-child,
    .roster-table.mobile-stack-table tbody tr.section-header td {
        grid-column: 1 / -1;
    }

    .stats-table.mobile-stack-table tbody td:first-child,
    .roster-table.mobile-stack-table tbody td:first-child,
    .player-stats-table.mobile-stack-table tbody td:first-child {
        padding: 0.5rem 0.75rem;
        font-size: 0.82rem;
        font-weight: 700;
        color: #475569 !important;
        background: rgba(226, 232, 240, 0.7) !important;
    }

    .stats-table.mobile-stack-table tbody td:nth-child(2),
    .roster-table.mobile-stack-table tbody td:first-child,
    .player-stats-table.mobile-stack-table tbody td:nth-child(2) {
        background: linear-gradient(135deg, rgba(30, 58, 95, 0.08), rgba(201, 169, 97, 0.12)) !important;
        border-color: rgba(201, 169, 97, 0.28);
    }

    .stats-table.mobile-stack-table .player-name,
    .player-stats-table.mobile-stack-table .player-name {
        font-size: 1rem;
        font-weight: 700;
    }

    .stats-table.mobile-stack-table .team-cell,
    .player-stats-table.mobile-stack-table .team-cell {
        font-weight: 600;
    }

    .stats-table.mobile-stack-table .grade-cell,
    .player-stats-table.mobile-stack-table .grade-cell {
        justify-self: stretch;
        text-align: left;
    }

    .comparison-table.mobile-stack-table tbody td:not(:first-child) {
        text-align: left !important;
    }

    .roster-table.mobile-stack-table tbody tr.section-header {
        display: block;
        padding: 0;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .roster-table.mobile-stack-table tbody tr.section-header td {
        margin: 0.35rem 0 0;
        padding: 0.9rem 1rem;
        border-radius: 16px !important;
        background: linear-gradient(135deg, rgba(226, 232, 240, 0.92), rgba(241, 245, 249, 0.98)) !important;
        color: #334155 !important;
        border-color: rgba(203, 213, 225, 0.9);
    }

    .roster-table.mobile-stack-table tbody tr.player-row-clickable td:nth-child(2),
    .roster-table.mobile-stack-table tbody tr.player-row-clickable td:nth-child(3),
    .roster-table.mobile-stack-table tbody tr.player-row-clickable td:nth-child(4) {
        grid-column: span 1;
    }

    .roster-table.mobile-stack-table tbody tr.player-row-clickable td:first-child {
        grid-column: 1 / -1;
    }

    .roster-table.mobile-stack-table tbody tr.player-row-clickable td:nth-child(n+5),
    .stats-table.mobile-stack-table tbody td:nth-child(n+5),
    .player-stats-table.mobile-stack-table tbody td:nth-child(n+3) {
        min-height: 68px;
    }
}
