/* POKER VIP - lobby : header bas et adaptatif, liste des tables responsive.
 * Affichage uniquement. Chargé après les <style> de lobby.php. */

/* ---------- Header : même gabarit que la table ---------- */
html body > header.top {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 7px 16px !important;
    min-height: 0 !important;
}
html body > header.top .lobby-account {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
}
html body > header.top > span:last-child {
    margin-left: auto !important;
    flex: 0 0 auto !important;
}
html body > header.top .brand {
    font-size: 16px !important;
    letter-spacing: 2px !important;
    white-space: nowrap !important;
}

html body > header.top #player-menu-trigger,
html body > header.top #reward-ad-open,
html body > header.top .auth-link,
html body > header.top .logout-link {
    box-sizing: border-box !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    padding: 0 12px !important;
    font-size: 12px !important;
    line-height: 1 !important;
    border-radius: 9px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    flex: 0 0 auto !important;
    box-shadow: none !important;
}
html body > header.top #player-menu-trigger {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    gap: 8px !important;
    padding: 0 11px 0 4px !important;
    overflow: hidden !important;
}
html body > header.top #player-menu-trigger .global-player-avatar {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    border-width: 1.5px !important;
}
html body > header.top #player-menu-trigger .global-player-name,
html body > header.top #player-menu-trigger .global-player-chips {
    font-size: 12px !important;
    line-height: 1 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
html body > header.top .reward-ad-header-btn { gap: 6px !important; padding-left: 7px !important; }
html body > header.top .reward-gift {
    width: 22px !important;
    height: 22px !important;
    font-size: 14px !important;
}

@media (max-width: 1279px) { html body > header.top .free-poker-notice { display: none !important; } }
@media (max-width: 1060px) { html body > header.top #player-menu-trigger .global-player-name { display: none !important; } }
@media (max-width: 900px) {
    html body > header.top #reward-ad-open { font-size: 0 !important; gap: 0 !important; padding-right: 7px !important; }
    html body > header.top #reward-ad-open .reward-gift { font-size: 14px !important; }
}
@media (max-width: 720px) {
    html body > header.top { padding: 4px 8px !important; gap: 6px !important; }
    html body > header.top .lobby-account { gap: 5px !important; flex: 1 1 auto !important; }
    html body > header.top #player-menu-trigger,
    html body > header.top #reward-ad-open,
    html body > header.top .auth-link,
    html body > header.top .logout-link {
        height: 30px !important; min-height: 30px !important; max-height: 30px !important;
        font-size: 10px !important;
    }
    html body > header.top #reward-ad-open { font-size: 0 !important; gap: 0 !important; padding: 0 6px !important; }
    html body > header.top #reward-ad-open .reward-gift { font-size: 14px !important; }
    html body > header.top .auth-link { padding: 0 8px !important; }
    html body > header.top #player-menu-trigger .global-player-avatar {
        width: 22px !important; height: 22px !important; min-width: 22px !important;
    }
    html body > header.top .brand { font-size: 12px !important; letter-spacing: 1px !important; }
}
@media (max-width: 480px) {
    html body > header.top > span:last-child { display: none !important; }
    html body > header.top #reward-ad-open { padding: 0 5px !important; }
}

/* ---------- Page ---------- */
#lobby { padding: 16px 0 10px; gap: 12px; }
html body #poker-vip-legal-footer { margin-top: 0 !important; padding: 10px 12px !important; flex: 0 0 auto; }
html body #poker-vip-legal-footer .legal-disclaimer { margin-top: 4px !important; }

.category { min-height: 0; padding: 14px 20px; }

@media (max-width: 900px) {
    #lobby { width: calc(100% - 24px); }
    td { padding: 11px 12px; }
    th { padding: 12px; }
}

@media (max-width: 700px) {
    #lobby { width: calc(100% - 16px); padding: 8px 0 6px; gap: 8px; }
    .heading { flex-wrap: wrap; gap: 2px 10px; }
    .heading h1 { font-size: 19px; margin: 0; }
    #totals { font-size: 11px; white-space: normal; }
    .categories { gap: 6px; }
    .category { min-height: 0; padding: 8px 6px; text-align: center; }
    .category strong { font-size: 13px; }
    .category span { margin-top: 3px; font-size: 10px; line-height: 1.25; }

    /* Liste : une carte par table, tri en barre de puces */
    .list-panel { background: transparent; border: 0; box-shadow: none; border-radius: 0; }
    table, thead, tbody { display: block; width: 100%; min-width: 0; }
    thead {
        position: sticky; top: 0; z-index: 2;
        background: #0e2119; padding: 0 0 6px;
    }
    thead tr { display: flex; gap: 6px; flex-wrap: wrap; }
    th { display: block; padding: 0; background: transparent; }
    th:last-child { display: none; }
    .sort-button {
        padding: 5px 8px; font-size: 9px; letter-spacing: 0;
        border: 1px solid #66785c; border-radius: 999px; background: #17372a;
    }
    .sort-button.active { border-color: #eac16e; }
    .sort-arrow { min-width: 9px; }
    thead tr { gap: 4px; }
    tbody tr {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-areas: "name name join" "blinds players spect";
        gap: 6px 8px; align-items: center;
        margin: 0 0 8px; padding: 10px 12px;
        border: 1px solid #4f6a58; border-radius: 12px;
        background: linear-gradient(135deg, #17372a, #0e2119);
    }
    tbody tr:hover { background: linear-gradient(135deg, #1f4633, #12271e); }
    td { display: block; padding: 0; border: 0; font-size: 13px; min-width: 0; }
    td:nth-child(1) { grid-area: name; font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
    td:nth-child(2) { grid-area: blinds; }
    td:nth-child(3) { grid-area: players; }
    td:nth-child(4) { grid-area: spect; }
    td:nth-child(5) { grid-area: join; justify-self: end; }
    td:nth-child(2)::before, td:nth-child(3)::before, td:nth-child(4)::before {
        display: block; margin-bottom: 2px;
        font-size: 9px; font-weight: 700; letter-spacing: .6px;
        color: #8fa896; text-transform: uppercase;
    }
    td:nth-child(2)::before { content: "Blinds"; }
    td:nth-child(3)::before { content: "Players"; }
    td:nth-child(4)::before { content: "Spectators"; }
    td.empty {
        grid-area: 1 / 1 / 2 / -1 !important; justify-self: stretch !important;
        padding: 22px 0 !important; text-align: center; font-size: 13px;
    }
    td.empty::before { content: none !important; }
    .join { padding: 9px 18px; font-size: 12px; }
}

/* Écran très bas (téléphone en paysage) : header et pied de page restent
 * affichés ; c'est le contenu du lobby (titre, catégories, liste) qui défile. */
@media (max-height: 520px) {
    html, body { height: 100%; overflow: hidden; }
    html body > header.top { padding-top: 3px !important; padding-bottom: 3px !important; }
    html body > header.top #player-menu-trigger,
    html body > header.top #reward-ad-open,
    html body > header.top .auth-link,
    html body > header.top .logout-link {
        height: 28px !important; min-height: 28px !important; max-height: 28px !important;
    }
    #lobby {
        flex: 1 1 auto; min-height: 0;
        overflow-y: auto; overflow-x: hidden;
        -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
        padding: 0 0 8px; gap: 8px;
    }
    #lobby > .heading { padding-top: 8px; }
    #lobby > .heading, #lobby > .categories { flex: none; }
    .heading p { display: none; }
    .heading h1 { font-size: 18px; margin: 0; }
    .category { padding: 6px 10px; }
    .category strong { font-size: 14px; }
    .category span { margin-top: 2px; }
    .list-panel { flex: none; overflow: visible; }
    thead { top: 0; }
    html body #poker-vip-legal-footer { padding: 5px 10px !important; }
    html body #poker-vip-legal-footer .legal-disclaimer { display: none; }
}
