/* Home-only presentation. Load before the published frontend design so that
   administrator CSS and theme tokens remain authoritative. Lobby dimensions,
   column settings and the filter modal's position utilities are left intact. */

:where(html[data-frontend-page="home"]) .home-lobby {
    padding-block: 28px 36px;
}

:where(html[data-frontend-page="home"]) .home-lobby-layout,
:where(html[data-frontend-page="home"]) .home-lobby-catalog {
    width: 100%;
    min-width: 0;
}

:where(html[data-frontend-page="home"]) .home-catalog-heading {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

:where(html[data-frontend-page="home"]) .home-catalog-heading-copy {
    min-width: 0;
}

:where(html[data-frontend-page="home"]) .home-catalog-title {
    margin: 0;
    color: var(--fd-text, #f8fafc);
    font-size: clamp(24px, 2.2vw, 32px);
    font-weight: var(--ui-weight-strong, 600);
    letter-spacing: -.035em;
    line-height: 1.25;
}

:where(html[data-frontend-page="home"]) .home-catalog-description {
    margin: 8px 0 0;
    color: var(--fd-muted, #94a3b8);
    font-size: 13px;
    line-height: 1.7;
}

/* Only layout and appearance live here. The existing JS adds/removes fixed,
   width, transform and stacking utilities when this toolbar becomes a modal. */
:where(html[data-frontend-page="home"]) .home-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 12px;
    border-radius: var(--fd-radius, 18px);
    background-color: var(--fd-background, #0f172a);
    box-shadow: 0 8px 28px rgb(0 0 0 / .12);
}

:where(html[data-frontend-page="home"]) .home-search-control {
    grid-column: 1 / -1;
    grid-row: 1;
    min-width: 0;
    width: 100%;
}

:where(html[data-frontend-page="home"]) .home-provider-control {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    width: 100%;
}

:where(html[data-frontend-page="home"]) .home-toolbar button:where(#favoriteFilterBtn) {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    width: 100%;
}

:where(html[data-frontend-page="home"]) .home-toolbar button:where(#providerBtn, #favoriteFilterBtn) {
    min-height: 46px;
    padding-inline: 12px;
    border-radius: var(--fd-radius, 11px);
    font-size: 13px;
    line-height: 20px;
}

:where(html[data-frontend-page="home"]) .home-provider-control > button:where(#providerBtn) {
    width: 100%;
}

:where(html[data-frontend-page="home"]) .home-toolbar :where(#favoriteFilterBtn > span) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:where(html[data-frontend-page="home"]) .home-search-control input:where(#liveSearchInput) {
    width: 100%;
    min-height: 48px;
    padding-block: 11px;
    padding-inline: 44px 14px;
    border-radius: var(--fd-radius, 11px);
    background-color: var(--fd-input, #1e293b);
    color: var(--fd-input-text, #f8fafc);
    line-height: 24px;
    transition: border-color .18s ease, box-shadow .18s ease;
}

:where(html[data-frontend-page="home"]) .home-search-control i:where(.fa-magnifying-glass) {
    left: 16px;
    color: var(--fd-muted, #94a3b8);
}

:where(html[data-frontend-page="home"]) .home-search-control input:where(#liveSearchInput)::placeholder {
    color: var(--fd-muted, #94a3b8);
    opacity: 1;
}

:where(html[data-frontend-page="home"]) .home-search-control input:where(#liveSearchInput):focus {
    border-color: var(--fd-accent, #facc15);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--fd-accent, #facc15) 14%, transparent);
}

:where(html[data-frontend-page="home"]) .home-provider-control div:where(#providerDropdown) {
    width: min(320px, calc(100vw - 56px));
    border-radius: var(--fd-radius, 12px);
    box-shadow: 0 14px 36px rgb(0 0 0 / .3);
}

:where(html[data-frontend-page="home"]) .home-provider-control :where(#providerList label) {
    min-height: 42px;
}

:where(html[data-frontend-page="home"]) .home-lobby :where([data-lobby-section]) {
    margin-block: 32px;
}

:where(html[data-frontend-page="home"]) .home-lobby :where([data-lobby-section]) > h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--fd-border, #334155);
    color: var(--fd-text, #f8fafc);
    font-size: 18px;
    font-weight: var(--ui-weight-strong, 600);
    line-height: 1.4;
    letter-spacing: .015em;
}

:where(html[data-frontend-page="home"]) .home-lobby :where([data-lobby-section]) > h3::before {
    content: "";
    flex: 0 0 4px;
    width: 4px;
    height: 19px;
    border-radius: 4px;
    background-color: var(--fd-accent, #facc15);
}

:where(html[data-frontend-page="home"]) .home-lobby .recent-games {
    margin-bottom: 32px;
}

:where(html[data-frontend-page="home"]) .home-lobby .recent-games-heading {
    margin-bottom: 20px;
}

:where(html[data-frontend-page="home"]) .home-lobby .recent-games-heading h2 {
    color: var(--fd-text, #f8fafc);
    font-size: 18px;
    letter-spacing: .015em;
}

:where(html[data-frontend-page="home"]) .home-lobby .recent-games-heading > span {
    border-color: var(--fd-border, #334155);
    background-color: var(--fd-surface, #1e293b);
    color: var(--fd-accent, #facc15);
}

/* Card sizing, image ratios, title heights and responsive columns are owned
   by the existing lobby styles; these rules change only their finish. */
:where(html[data-frontend-page="home"]) .home-lobby :is([data-frontend-game-card], .recent-game-card) {
    border-color: var(--fd-border, #334155);
    background-color: var(--fd-surface, #1e293b);
    box-shadow: 0 4px 16px rgb(0 0 0 / .1);
    transition: border-color .18s ease, box-shadow .18s ease;
}

:where(html[data-frontend-page="home"]) .home-lobby :where(.lobby-game-title) {
    background-color: var(--fd-surface, #1e293b);
}

:where(html[data-frontend-page="home"]) .home-lobby :where(.recent-game-name) {
    color: var(--fd-text, #e2e8f0);
}

:where(html[data-frontend-page="home"]) .home-lobby :is(button, a, input, [tabindex]):focus-visible,
:where(html[data-frontend-page="home"]) :where(#floatingFilterContainer) > button:focus-visible {
    outline: 2px solid var(--fd-accent, #facc15);
    outline-offset: 3px;
}

:where(html[data-frontend-page="home"]) :where(#floatingFilterContainer) > button {
    min-height: 46px;
    box-shadow: 0 6px 20px rgb(0 0 0 / .22);
}

@media (min-width: 768px) {
    :where(html[data-frontend-page="home"]) .home-toolbar {
        grid-template-columns: minmax(0, 1fr) minmax(170px, 220px) max-content;
        gap: 12px;
        padding: 14px;
    }

    :where(html[data-frontend-page="home"]) .home-search-control {
        grid-column: 1;
        grid-row: 1;
    }

    :where(html[data-frontend-page="home"]) .home-provider-control {
        grid-column: 2;
        grid-row: 1;
    }

    :where(html[data-frontend-page="home"]) .home-toolbar button:where(#favoriteFilterBtn) {
        grid-column: 3;
        grid-row: 1;
    }

    :where(html[data-frontend-page="home"]) .home-toolbar button:where(#providerBtn, #favoriteFilterBtn) {
        min-height: 48px;
        padding-inline: 16px;
    }
}

@media (max-width: 639px) {
    :where(html[data-frontend-page="home"]) .home-lobby {
        padding-block: 20px 24px;
    }

    :where(html[data-frontend-page="home"]) .home-catalog-heading {
        margin-bottom: 16px;
    }

    :where(html[data-frontend-page="home"]) .home-catalog-description {
        font-size: 12px;
        line-height: 1.65;
    }

    :where(html[data-frontend-page="home"]) .home-toolbar {
        padding: 10px;
    }

    :where(html[data-frontend-page="home"]) .home-toolbar button:where(#providerBtn, #favoriteFilterBtn) {
        padding-inline: 10px;
        font-size: 12px;
    }

    :where(html[data-frontend-page="home"]) .home-lobby :where([data-lobby-section]) {
        margin-block: 26px;
    }

    :where(html[data-frontend-page="home"]) .home-lobby :where([data-lobby-section]) > h3,
    :where(html[data-frontend-page="home"]) .home-lobby .recent-games-heading h2 {
        font-size: 16px;
    }

    :where(html[data-frontend-page="home"]) .home-lobby .recent-games {
        margin-bottom: 28px;
    }

    :where(html[data-frontend-page="home"]) .home-lobby .recent-games-heading {
        margin-bottom: 16px;
    }
}

@media (hover: hover) and (pointer: fine) {
    :where(html[data-frontend-page="home"]) .home-lobby :is([data-frontend-game-card], .recent-game-card):hover {
        border-color: var(--fd-accent, #facc15);
        box-shadow: 0 8px 24px rgb(0 0 0 / .18);
    }
}

@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
    :where(html[data-frontend-page="home"]) .home-lobby [data-frontend-game-card]:hover [data-game-image] {
        transform: scale(1.035);
    }
}

@media (prefers-reduced-motion: reduce) {
    :where(html[data-frontend-page="home"]) .home-lobby :is([data-frontend-game-card], .recent-game-card, [data-game-image], button, input),
    :where(html[data-frontend-page="home"]) :where(#floatingFilterContainer, #floatingFilterContainer > button) {
        transition: none;
    }

    :where(html[data-frontend-page="home"]) .home-lobby [data-frontend-game-card]:hover [data-game-image] {
        transform: none;
    }
}
