/* Home: banners, avisos, provedores e grades de jogos */
.home-promos,
.home-notice,
.home-tabs-row {
    width: min(calc(100% - 32px), 1148px);
    margin-inline: auto;
}

/* Três cards de benefícios: vidro escuro com brilho da cor de cada benefício */
.home-promos {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}
.home-promo {
    --promo: #3b82f6;
    --promo-text: #8fb8ff;
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 84px;
    padding: 12px 14px;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid color-mix(in srgb, var(--promo) 34%, transparent);
    border-radius: 14px;
    background:
        radial-gradient(120% 130% at 100% 100%, color-mix(in srgb, var(--promo) 24%, transparent), transparent 62%),
        var(--surface);
    color: #e6ebf5;
    box-shadow: inset 0 1px 0 #ffffff0f;
    transition:
        border-color 0.18s,
        transform 0.18s,
        box-shadow 0.18s;
}
.home-promo:hover {
    border-color: color-mix(in srgb, var(--promo) 60%, transparent);
    box-shadow:
        inset 0 1px 0 #ffffff14,
        0 6px 20px color-mix(in srgb, var(--promo) 18%, transparent);
    transform: translateY(-1px);
}
.home-promo:focus-visible {
    outline: 2px solid #8fb8ff;
    outline-offset: 2px;
}
.home-promo.is-affiliate {
    --promo: #f59e0b;
    --promo-text: #fbbf24;
}
.home-promo.is-checkin {
    --promo: #8b5cf6;
    --promo-text: #c4b5fd;
}
.home-promo.is-vip {
    --promo: #ec4899;
    --promo-text: #f9a8d4;
}
.home-promo.is-wheel {
    --promo: #14b8a6;
    --promo-text: #5eead4;
}
.home-promo-copy {
    position: relative;
    z-index: 1;
    display: grid;
    align-content: center;
    gap: 1px;
    min-width: 0;
    max-width: 72%;
}
.home-promo-copy small {
    color: #93a8c8;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}
.home-promo-copy strong {
    color: var(--promo-text);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.3px;
    white-space: nowrap;
}
.home-promo-copy > span {
    color: #93a8c8;
    font-size: 11px;
    line-height: 1.3;
}
.home-promo img {
    position: absolute;
    right: 8px;
    bottom: 50%;
    width: 58px;
    height: 58px;
    object-fit: contain;
    opacity: 0.92;
    transform: translateY(50%);
    filter: drop-shadow(0 4px 8px #0007);
    pointer-events: none;
}

/* Aviso correndo */
.home-notice {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    margin-bottom: 4px;
    padding: 5px 5px 5px 6px;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid #3565c7;
    border-radius: 14px;
    background:
        radial-gradient(120% 160% at 0% 50%, #2f6bea66, transparent 42%),
        linear-gradient(90deg, #163a86, #0f2552 55%, #0b1a3a);
    box-shadow:
        inset 0 1px 0 #ffffff24,
        0 6px 18px #0006;
    color: #eaf1ff;
}
.home-notice::after {
    content: '';
    position: absolute;
    inset: 0 auto 0 -40%;
    z-index: -1;
    width: 35%;
    background: linear-gradient(100deg, transparent, #ffffff14, transparent);
    transform: skewX(-18deg);
    animation: home-notice-shine 7s ease-in-out infinite;
    pointer-events: none;
}
@keyframes home-notice-shine {
    0%,
    55% {
        left: -40%;
    }
    100% {
        left: 120%;
    }
}
.home-notice-icon {
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(145deg, #ffe27a, #f59e0b);
    color: #3b2300;
    box-shadow:
        0 0 0 3px #f59e0b2e,
        0 4px 10px #f59e0b40;
}
.home-notice-icon .icon {
    width: 18px;
    height: 18px;
    stroke-width: 2.2;
}
.home-notice-icon::after {
    content: '';
    position: absolute;
    inset: -3px;
    border: 2px solid #fcd34d;
    border-radius: 12px;
    opacity: 0;
    animation: home-notice-ping 2.4s ease-out infinite;
}
@keyframes home-notice-ping {
    0% {
        opacity: 0.7;
        transform: scale(0.9);
    }
    70%,
    100% {
        opacity: 0;
        transform: scale(1.35);
    }
}
.home-notice-viewport {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 5%, #000 92%, transparent);
}
.home-notice-track {
    display: flex;
    width: max-content;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 32px;
    white-space: nowrap;
    text-shadow: 0 1px 2px #0008;
}
.home-notice-track span {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    padding-right: 18px;
}
.home-notice-track span::after {
    content: '✦';
    color: #fcd34d;
    font-size: 12px;
}
.home-notice.is-moving .home-notice-track {
    animation: home-notice-scroll var(--notice-duration, 24s) linear infinite;
}
.home-notice:hover .home-notice-track,
.home-notice:focus-within .home-notice-track,
.home-notice.is-paused .home-notice-track {
    animation-play-state: paused;
}
@keyframes home-notice-scroll {
    to {
        transform: translateX(-50%);
    }
}
.home-notice-search {
    flex: 0 0 auto;
    margin: 0;
}
.home-notice-search button {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #3565c7;
    border-radius: 10px;
    background: #0b1830b8;
    color: #cfe0ff;
    cursor: pointer;
}
.home-notice-search button:hover {
    border-color: #8fb8ff;
    color: #fff;
}
.home-notice-search button:focus-visible {
    outline: 2px solid #8fb8ff;
    outline-offset: 2px;
}
.home-notice-search .icon {
    width: 18px;
    height: 18px;
}

/* Lista de provedores fixa */
.home-provider-nav {
    position: sticky;
    top: var(--home-sticky-top, 64px);
    z-index: 30;
    max-width: 1180px;
    margin: 0 auto;
    padding: 4px 16px 4px;
    background: color-mix(in srgb, var(--background) 94%, transparent);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: box-shadow 0.2s;
}
.home-provider-nav.is-stuck {
    border-bottom: 1px solid var(--surface-border);
    box-shadow: 0 10px 24px #0008;
}
.home-provider-track {
    --track-fade-start: 0%;
    --track-fade-end: 12%;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--track-fade-start), #000 calc(100% - var(--track-fade-end)), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 var(--track-fade-start), #000 calc(100% - var(--track-fade-end)), transparent);
}
.home-provider-track::-webkit-scrollbar {
    display: none;
}
.home-provider-track.is-scrolled {
    --track-fade-start: 6%;
}
.home-provider-track.is-at-end {
    --track-fade-end: 0%;
}
.home-provider-tile {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 5px;
    flex: 0 0 82px;
    min-width: 0;
    padding: 8px 5px 7px;
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    background: var(--surface);
    color: #9fb3d4;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    transition:
        border-color 0.18s,
        background 0.18s,
        color 0.18s,
        padding 0.2s;
}
.home-provider-tile:hover {
    border-color: #3b82f680;
    color: #e6efff;
}
.home-provider-tile.is-active {
    border-color: #3b82f6;
    background: linear-gradient(180deg, #17336a, #0f1f3d);
    color: #fff;
    box-shadow:
        inset 0 -3px 0 #5b98ff,
        0 4px 14px #2563eb33;
}
.home-provider-tile:focus-visible {
    outline: 2px solid #8fb8ff;
    outline-offset: 1px;
}
.home-provider-logo {
    display: grid;
    place-items: center;
    width: 64px;
    height: 34px;
    transition: height 0.2s;
}
.home-provider-logo img,
.home-provider-logo .provider-mark-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.home-provider-logo > img {
    width: 34px;
    height: 34px;
}
.home-provider-logo .provider-mark--compact.provider-mark--image {
    width: 64px;
    height: 34px;
    padding: 0;
}
.home-provider-logo .icon {
    width: 26px;
    height: 26px;
    color: #fcd34d;
}
.home-provider-name {
    max-width: 100%;
    overflow: hidden;
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.home-provider-nav.is-stuck .home-provider-tile {
    padding-block: 5px 4px;
}
.home-provider-nav.is-stuck .home-provider-logo {
    height: 22px;
}

/* Abas e busca */
.home-tabs-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
    margin-bottom: 4px;
}
.home-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    flex: 1 1 auto;
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--surface-border);
    border-radius: 14px;
    background: var(--surface-inset);
}
.home-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    min-height: 36px;
    border-radius: 10px;
    color: #93a8c8;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    transition:
        background 0.18s,
        color 0.18s;
}
.home-tab:hover {
    color: #e6efff;
}
.home-tab.is-active {
    background: linear-gradient(180deg, #2563eb, #1e3a8a);
    color: #fff;
    box-shadow:
        inset 0 1px 0 #ffffff33,
        0 4px 14px #2563eb40;
}
.home-tab:focus-visible {
    outline: 2px solid #8fb8ff;
    outline-offset: 1px;
}
.home-tab .icon,
.home-tab img {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

/* Grades de jogos */
.home-grid-section {
    container: home-grid / inline-size;
    max-width: 1180px;
    margin: 0 auto 20px;
    padding: 0 16px;
    scroll-margin-top: calc(var(--home-sticky-top, 64px) + var(--home-nav-height, 88px) + 8px);
}
.home-grid-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 0 8px;
}
.home-grid-header .section-heading {
    min-width: 0;
}
.home-grid-header h2 {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.home-grid-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
}
.home-grid-controls button,
.home-grid-count,
.home-grid-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    border: 1px solid var(--surface-border);
    border-radius: 10px;
    font-size: 12px;
    white-space: nowrap;
}
.home-grid-controls button {
    width: 32px;
    padding: 0;
    background: var(--surface-raised);
    color: #c9d6ee;
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
}
.home-grid-controls button[hidden] {
    display: none;
}
.home-grid-controls button[aria-disabled='true'] {
    opacity: 0.35;
    cursor: default;
}
.home-grid-controls button:not([aria-disabled='true']):hover {
    border-color: #3b82f6;
    color: #fff;
}
.home-grid-count {
    gap: 4px;
    padding: 0 10px;
    background: var(--surface-inset);
    color: #93a8c8;
}
.home-grid-count b {
    color: #5b98ff;
    font-weight: 800;
}
.home-grid-more {
    padding: 0 11px;
    background: var(--surface-raised);
    color: #dbe7fb;
    font-weight: 700;
}
.home-grid-more:hover {
    border-color: #3b82f6;
}
.home-grid-controls button:focus-visible,
.home-grid-more:focus-visible {
    outline: 2px solid #8fb8ff;
    outline-offset: 2px;
}
html:has(.home-provider-nav) {
    scroll-padding-top: calc(var(--home-sticky-top, 64px) + var(--home-nav-height, 88px) + 8px);
}
.home-games-grid {
    --home-cols: 4;
    display: grid;
    grid-template-columns: repeat(var(--home-cols), minmax(0, 1fr));
    gap: 12px 8px;
    transition: opacity 0.18s;
}
.home-games-grid.is-busy {
    opacity: 0.45;
}
.home-games-grid .catalog-card.is-skeleton .game-card-img {
    border-radius: 12px;
    background: linear-gradient(100deg, transparent 30%, #ffffff0d 50%, transparent 70%) 0 0 / 200% 100%, var(--surface);
    animation: home-grid-shimmer 1.4s linear infinite;
}
@keyframes home-grid-shimmer {
    to {
        background-position: -200% 0, 0 0;
    }
}
.home-games-grid .catalog-card[hidden] {
    display: none;
}
.home-games-grid .game-card {
    width: 100%;
}
.home-games-grid .game-favorite {
    top: 3px;
    right: 3px;
    width: 26px;
    height: 26px;
}
.home-games-grid .game-card-img {
    --game-card-radius: 12px;
}
.home-grid-empty {
    display: grid;
    grid-column: 1 / -1;
    justify-items: center;
    gap: 6px;
    padding: 30px 16px;
    border: 1px dashed var(--surface-border);
    border-radius: 14px;
    color: var(--surface-muted);
    font-size: 13px;
    text-align: center;
}
.home-grid-empty strong {
    color: #e6efff;
    font-size: 15px;
}
.home-grid-empty .button {
    margin-top: 8px;
}

/* Quantidade visível antes do JavaScript paginar: 2 ou 4 linhas */
.home-grid-section[data-rows='2'] .home-games-grid:not(.is-paged) > .catalog-card:nth-child(n + 9),
.home-grid-section[data-rows='4'] .home-games-grid:not(.is-paged) > .catalog-card:nth-child(n + 17) {
    display: none;
}
@container home-grid (min-width: 560px) {
    .home-games-grid {
        --home-cols: 5;
        gap: 14px 10px;
    }
    .home-grid-section[data-rows='2'] .home-games-grid:not(.is-paged) > .catalog-card:nth-child(n + 9),
    .home-grid-section[data-rows='4'] .home-games-grid:not(.is-paged) > .catalog-card:nth-child(n + 17) {
        display: block;
    }
    .home-grid-section[data-rows='2'] .home-games-grid:not(.is-paged) > .catalog-card:nth-child(n + 11),
    .home-grid-section[data-rows='4'] .home-games-grid:not(.is-paged) > .catalog-card:nth-child(n + 21) {
        display: none;
    }
}
@container home-grid (min-width: 720px) {
    .home-games-grid {
        --home-cols: 6;
    }
    .home-grid-section[data-rows='2'] .home-games-grid:not(.is-paged) > .catalog-card:nth-child(n + 11),
    .home-grid-section[data-rows='4'] .home-games-grid:not(.is-paged) > .catalog-card:nth-child(n + 21) {
        display: block;
    }
    .home-grid-section[data-rows='2'] .home-games-grid:not(.is-paged) > .catalog-card:nth-child(n + 13),
    .home-grid-section[data-rows='4'] .home-games-grid:not(.is-paged) > .catalog-card:nth-child(n + 25) {
        display: none;
    }
}
@container home-grid (min-width: 960px) {
    .home-games-grid {
        --home-cols: 8;
    }
    .home-grid-section[data-rows='2'] .home-games-grid:not(.is-paged) > .catalog-card:nth-child(n + 13),
    .home-grid-section[data-rows='4'] .home-games-grid:not(.is-paged) > .catalog-card:nth-child(n + 25) {
        display: block;
    }
    .home-grid-section[data-rows='4'] .home-games-grid:not(.is-paged) > .catalog-card:nth-child(n + 33) {
        display: none;
    }
}

.home-tabs-search {
    display: none;
}
@media (min-width: 901px) {
    .home-tabs {
        flex: 0 1 540px;
    }
    .home-tabs-search {
        display: flex;
        align-items: center;
        gap: 9px;
        flex: 1 1 260px;
        max-width: 420px;
        height: 44px;
        margin: 0 0 0 auto;
        padding: 0 14px;
        border: 1px solid var(--surface-border);
        border-radius: 14px;
        background: var(--surface-inset);
        color: #7f93b5;
        cursor: text;
    }
    .home-tabs-search:focus-within {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px #3b82f626;
    }
    .home-tabs-search .icon {
        width: 18px;
        height: 18px;
        flex: 0 0 auto;
    }
    .home-tabs-search input {
        flex: 1;
        min-width: 0;
        border: 0;
        background: transparent;
        color: #eaf1ff;
        font-size: 14px;
        outline: none;
    }
    .home-tabs-search input::placeholder {
        color: #647a9e;
    }
    .home-notice-search {
        display: none;
    }
    .home-notice.is-empty {
        display: none;
    }
}
@media (max-width: 600px) {
    .home-promos {
        gap: 7px;
    }
    .home-promo {
        min-height: 66px;
        padding: 8px 9px;
        border-radius: 12px;
    }
    .home-promo-copy {
        max-width: 100%;
    }
    .home-promo-copy small {
        font-size: 10.5px;
    }
    .home-promo-copy strong {
        font-size: 15px;
    }
    .home-promo-copy > span {
        font-size: 10px;
    }
    .home-promo img {
        right: 4px;
        bottom: 4px;
        width: 26px;
        height: 26px;
        opacity: 0.9;
        transform: none;
    }
    .home-promo-copy small {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .home-notice {
        min-height: 42px;
        gap: 8px;
        padding: 4px 4px 4px 5px;
        border-radius: 13px;
    }
    .home-notice-icon {
        width: 30px;
        height: 30px;
        border-radius: 9px;
    }
    .home-notice-track {
        font-size: 12.5px;
        line-height: 30px;
    }
    .home-notice-search button {
        width: 32px;
        height: 32px;
    }
    .home-provider-nav {
        padding-inline: 12px;
    }
    .home-provider-tile {
        flex-basis: 72px;
        font-size: 10.5px;
    }
    .home-provider-logo {
        width: 56px;
        height: 30px;
    }
    .home-provider-logo .provider-mark--compact.provider-mark--image {
        width: 56px;
        height: 30px;
    }
    .home-tab {
        min-height: 34px;
        font-size: 12.5px;
    }
    .home-grid-section {
        padding: 0 12px;
    }
    .home-grid-header .section-heading h2 {
        font-size: 15px;
    }
    .home-grid-controls {
        gap: 4px;
    }
    .home-grid-controls button,
    .home-grid-count,
    .home-grid-more {
        height: 30px;
        font-size: 11px;
    }
    .home-grid-controls button {
        width: 28px;
    }
    .home-grid-count {
        padding: 0 7px;
    }
    .home-grid-more {
        padding: 0 8px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .home-notice.is-moving .home-notice-track,
    .home-notice::after,
    .home-notice-icon::after,
    .home-games-grid .catalog-card.is-skeleton .game-card-img {
        animation: none;
    }
    .home-promo,
    .home-provider-tile,
    .home-provider-logo,
    .home-games-grid {
        transition: none;
    }
}
@media (max-width: 600px) {
    .home-grid-header .section-image,
    .home-grid-header .section-icon {
        flex-basis: 32px;
        width: 32px;
        height: 32px;
    }
    .home-grid-header .section-image img {
        width: 32px;
        height: 32px;
    }
}
