/* ==========================================================================
   RESPONSIVE — Mobile (<=767px)
   ========================================================================== */

@media (max-width: 767px) {

    /* Tighten container */
    .app-container { padding: 8px; gap: 8px; }

    /* Stack content instead of side-by-side */
    .content-area { display: block; }

    /* Table column full-width */
    .table-column { width: 100%; }

    /* Hide desktop table, show mobile list */
    .table-wrap { display: none; }
    .mobile-list { display: block; }

    /* Filter toolbar: wrap on mobile */
    .filter-toolbar {
        flex-wrap: wrap;
        gap: 6px;
        padding: 6px 8px;
    }
    .filter-search { width: 100%; }
    .filter-search input { width: 100%; padding-left: 24px; }
    .filter-count { width: 100%; text-align: center; }
    .col-config-bar { display: none; }
    .fav-filter-btn { display: none; }

    /* Compact nav buttons on mobile */
    .app-bar-nav { gap: 2px; margin-right: 4px; }
    .app-bar-nav-btn { padding: 0 5px; font-size: var(--text-2xs); letter-spacing: 0.3px; }
    .app-bar-menu { min-width: 160px; max-width: min(90vw, 240px); }
    .status-drawer { left: 0; right: auto; max-width: min(94vw, 360px); }

    .footer-status-wrap .status-drawer {
        width: min(94vw, 360px);
    }

    .footer-theme-wrap .theme-picker-dropdown {
        width: min(94vw, 320px);
        right: 0;
    }

    .kbd-hint {
        gap: 6px;
        padding: 4px 6px;
    }

    .kbd-hint-center {
        display: none;
    }

    /* Mobile back bar */
    .mobile-back-bar {
        display: flex;
        align-items: center;
        padding: 0 8px;
        height: 36px;
        background: var(--theme-bg-surface, var(--theme-bg-panel));
        border-bottom: 1px solid var(--theme-border-strong);
        gap: 8px;
        flex-shrink: 0;
    }

    .mobile-back-btn {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        background: var(--theme-bg-surface, var(--theme-bg-panel));
        border: 1px solid var(--theme-border-strong);
        color: var(--theme-accent-secondary);
        font-family: var(--font-mono);
        font-size: var(--text-xs);
        font-weight: 800;
        text-transform: uppercase;
        padding: 3px 10px;
        cursor: pointer;
        letter-spacing: 0.3px;
    }

    /* Detail column: full-screen fixed overlay on mobile */
    .detail-column {
        position: fixed;
        inset: 0;
        z-index: 200;
        max-width: 100%;
        min-width: 0;
        max-height: 100vh;
        overflow-y: auto;
        flex: none;
        top: 0;
        background: var(--theme-bg-app);
    }

    /* Hide panel header close/star buttons on mobile (back bar handles it) */
    .detail-panel-header { font-size: var(--text-xs); }

    /* ---- Mobile player list ---- */

    .mobile-player-row {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 10px;
        border-bottom: 1px solid var(--theme-border-default, #E5E5E5);
        cursor: pointer;
        min-height: 44px;
    }
    .mobile-player-row:nth-child(odd) { background: #FFF; }
    .mobile-player-row:nth-child(even) { background: #FAFAFA; }
    .mobile-player-row:active { background: #F0F0F0; }
    .mobile-player-row.mobile-row-selected {
        background: #FFFEF5;
        border-left: 2px solid var(--theme-accent-secondary);
    }

    .mobile-row-rank {
        width: 22px;
        font-size: var(--text-xs);
        color: var(--text-muted);
        text-align: center;
        font-weight: 700;
    }

    .mobile-row-headshot {
        width: 36px;
        height: 36px;
        border: 1px solid var(--theme-border-strong);
        background: var(--theme-bg-surface, var(--theme-bg-panel));
        flex-shrink: 0;
        object-fit: cover;
    }

    .mobile-row-info {
        flex: 1;
        min-width: 0;
    }

    .mobile-row-name {
        font-size: var(--text-sm);
        font-weight: 800;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-row-meta {
        font-size: var(--text-xs);
        color: var(--text-muted);
        font-weight: 500;
    }

    .mobile-row-stat {
        text-align: right;
        flex-shrink: 0;
    }

    .mobile-row-stat-val {
        font-size: var(--text-lg);
        font-weight: 800;
        display: block;
    }

    .mobile-row-stat-lbl {
        font-size: var(--text-micro);
        font-weight: 700;
        text-transform: uppercase;
        color: var(--text-muted);
    }

}
