/*
 * EGGY_POOL_LOBBY_LANDSCAPE_SHELL_V1
 *
 * Dedicated phone-landscape Pool Hall.
 * Desktop and portrait remain unchanged.
 */

@media
    (pointer: coarse)
    and (orientation: landscape)
    and (max-height: 600px)
{
    body[data-template="eggy_pool_lobby"] .p-staffBar,
    body[data-template="eggy_pool_lobby"] .p-header,
    body[data-template="eggy_pool_lobby"] .p-nav,
    body[data-template="eggy_pool_lobby"] .p-navSticky,
    body[data-template="eggy_pool_lobby"] .p-sectionLinks,
    body[data-template="eggy_pool_lobby"] .p-body-header,
    body[data-template="eggy_pool_lobby"] .p-breadcrumbs,
    body[data-template="eggy_pool_lobby"] .p-breadcrumbs--container,
    body[data-template="eggy_pool_lobby"] .p-footer,
    body[data-template="eggy_pool_lobby"] .u-scrollButtons
    {
        display: none !important;
    }

    body[data-template="eggy_pool_lobby"]
    {
        margin: 0 !important;
        overflow-x: hidden !important;
        background: #080b0d;
    }

    body[data-template="eggy_pool_lobby"] .p-pageWrapper,
    body[data-template="eggy_pool_lobby"] .p-body,
    body[data-template="eggy_pool_lobby"] .p-body-inner
    {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
    }

    body[data-template="eggy_pool_lobby"] .p-body-inner
    {
        padding: 6px !important;
    }

    body[data-template="eggy_pool_lobby"] .epPoolLobbyV2
    {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;

        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    body[data-template="eggy_pool_lobby"] .epPoolLobbyV2 > .block
    {
        margin: 0 !important;
    }


    /* --------------------------------------------------------
       COMPACT GAME-LOBBY HEADER
       -------------------------------------------------------- */

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__hero
    {
        order: 0;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__hero .block-container
    {
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 8px !important;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__heroInner
    {
        min-height: 0 !important;

        padding: 6px 8px !important;

        display: grid !important;
        grid-template-columns:
            minmax(0, 1fr)
            auto !important;

        align-items: center !important;
        gap: 8px !important;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__intro
    {
        min-width: 0;

        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__eyebrow,

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__description
    {
        display: none !important;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__title
    {
        margin: 0 !important;

        flex: 0 0 auto;

        font-size: 19px !important;
        line-height: 1 !important;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__status
    {
        min-width: 0;

        margin: 0 !important;

        font-size: 9px !important;
        line-height: 1.2 !important;

        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__metrics
    {
        display: grid !important;
        grid-template-columns:
            repeat(3, 76px) !important;

        gap: 4px !important;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__metric
    {
        min-height: 35px !important;

        padding: 4px 5px !important;

        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-direction: column !important;

        border-radius: 6px !important;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__metric strong
    {
        font-size: 15px !important;
        line-height: 1 !important;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__metric span
    {
        margin-top: 2px;

        font-size: 7px !important;
        line-height: 1 !important;

        white-space: nowrap;
    }


    /* --------------------------------------------------------
       CONTENT ORDER
       -------------------------------------------------------- */

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__current
    {
        order: 1;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__waiting
    {
        order: 2;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__available
    {
        order: 3;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__matches
    {
        order: 4;
    }


    /* --------------------------------------------------------
       AVAILABLE TABLES
       -------------------------------------------------------- */

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__available .block-container,

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__current .block-container,

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__waiting .block-container,

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__matches .block-container
    {
        padding: 6px 8px !important;
        border-radius: 8px !important;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__sectionBar
    {
        min-height: 30px !important;

        margin: 0 0 5px !important;
        padding: 0 !important;

        align-items: center !important;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__sectionHeading
    {
        gap: 6px !important;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__sectionIcon
    {
        width: 27px !important;
        height: 27px !important;

        flex: 0 0 27px !important;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__sectionTitle
    {
        font-size: 12px !important;
        line-height: 1 !important;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__sectionDescription,

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__legend
    {
        display: none !important;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__availableTools
    {
        gap: 5px !important;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__availableTools .button,

    body[data-template="eggy_pool_lobby"]
    #epPoolLobbyCreateHeader,

    body[data-template="eggy_pool_lobby"]
    .epPoolAiChallenge
    {
        min-height: 28px !important;

        padding: 4px 9px !important;

        font-size: 10px !important;
        line-height: 18px !important;

        border-radius: 6px !important;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__count
    {
        min-width: 24px;

        padding: 3px 6px !important;

        font-size: 9px !important;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__availableGrid
    {
        display: grid !important;
        grid-template-columns:
            repeat(3, minmax(0, 1fr)) !important;

        gap: 5px !important;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__tableCard
    {
        min-height: 0 !important;

        padding: 7px !important;

        border-radius: 7px !important;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__tableTop
    {
        gap: 5px !important;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__tableTitle
    {
        font-size: 12px !important;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__tableDetails
    {
        margin-top: 4px !important;

        gap: 3px !important;

        font-size: 9px !important;
        line-height: 1.2 !important;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__tableFooter
    {
        margin-top: 5px !important;
        padding-top: 5px !important;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__tableFooter .button,

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__action
    {
        min-height: 26px !important;

        padding: 3px 8px !important;

        font-size: 9px !important;
    }


    /* --------------------------------------------------------
       WAITING / CURRENT / MATCHES
       -------------------------------------------------------- */

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__waitingGrid
    {
        display: grid !important;
        grid-template-columns:
            repeat(3, minmax(0, 1fr)) !important;

        gap: 5px !important;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__waitingCard,

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__currentRow,

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__matchRow
    {
        min-height: 0 !important;

        padding: 6px 8px !important;

        gap: 6px !important;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__matchesList
    {
        display: grid !important;
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;

        gap: 5px !important;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__createTile
    {
        min-height: 0 !important;

        padding: 8px !important;
    }
}


@media
    (pointer: coarse)
    and (orientation: landscape)
    and (max-height: 600px)
    and (max-width: 740px)
{
    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__availableGrid,

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__waitingGrid
    {
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;
    }

    body[data-template="eggy_pool_lobby"]
    .epPoolLobbyV2__metrics
    {
        grid-template-columns:
            repeat(3, 62px) !important;
    }
}
