/* ==========================================================================
   games.css — the game lobby pages: /slot/ and /nakhon365-online-casino/.
   Loaded after style.css + responsive.css; colours, radii and shadows are the tokens of style.css.
   Shared parts: .game-page, .game-page-hero, .game-section, .provider-list / .provider-card,
   .game-filter, .game-tiles / .game-tile, .game-cta. Page differences: .page-slot / .page-casino.
   (The home page already owns .game-card / .game-grid for its rows, hence .game-tile here.)

   1. Page frame   2. Provider cards   3. Filter   4. Game tiles   5. Text + CTA   6. Responsive
   ========================================================================== */

/* 1. Page frame ------------------------------------------------------------ */
.game-page-hero { padding-top: 18px; padding-bottom: 18px; }       /* compact: this is a lobby, the lists matter */
.game-section { margin-top: var(--space-lg); }
.game-section > .section-title { margin-bottom: 12px; }

/* 2. Provider cards ---------------------------------------------------------
   One card = one provider: picture on top, name + kind + action below.
   --row  a single line that scrolls sideways (slot page)
   --grid six / four / three / two per row (casino page) */
.provider-list { list-style: none; }
.provider-list--row {
    display: flex; gap: 10px; padding: 3px 1px 8px;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
    scrollbar-width: thin; scrollbar-color: var(--bg-active) transparent;
}
.provider-list--row > .provider-card { flex: 0 0 132px; scroll-snap-align: start; }
.provider-list--grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--gap); }
.provider-card__link {
    display: flex; flex-direction: column; height: 100%; overflow: hidden;
    border: 1px solid var(--border); border-radius: var(--radius-card);
    background: var(--bg-card);
    transition: transform 200ms ease-out, border-color 200ms ease-out, box-shadow 200ms ease-out;
}
.provider-card__image { display: block; width: 100%; height: auto; transition: transform 220ms ease-out; }
.provider-card__body { display: grid; gap: 1px; padding: 8px 10px 10px; border-top: 1px solid var(--border); }
.provider-card__name { color: var(--text-primary); font-size: 14px; font-weight: 500; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.provider-card__kind { color: var(--text-muted); font-size: 12px; line-height: 1.4; }
.provider-card__cta, .game-cta {
    display: flex; align-items: center; justify-content: center;
    min-height: 30px; margin-top: 7px; padding: 0 10px;
    border: 1px solid rgba(63, 214, 148, .3); border-radius: var(--radius-btn);
    background: var(--green-face); color: var(--text-strong);
    font-size: 13px; font-weight: 500; line-height: 1;
}
.provider-card__link:focus-visible, .game-tile__link:focus-visible { outline: 2px solid var(--logo-gold-light); outline-offset: 2px; }
@media (hover: hover) {
    .provider-card__link:hover, .game-tile__link:hover { transform: translateY(-2px); border-color: rgba(250, 226, 113, .4); box-shadow: var(--shadow-card), var(--glow-hover); }
    .provider-card__link:hover .provider-card__image, .game-tile__link:hover img { transform: scale(1.02); }
}

/* 3. Filter: pills; the pressed one is gold --------------------------------- */
.game-filter { display: flex; gap: 8px; margin-bottom: 14px; padding-bottom: 2px; overflow-x: auto; scrollbar-width: none; }
.game-filter::-webkit-scrollbar { display: none; }
.game-filter__btn {
    display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto;
    min-height: 38px; padding: 0 14px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-pill);
    background: var(--bg-card); color: var(--text-secondary);
    font-size: 14px; font-weight: 400; white-space: nowrap;
    transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}
.game-filter__btn:hover { border-color: var(--border-hover); color: var(--text-strong); }
.game-filter__btn[aria-pressed="true"] { border-color: var(--border-gold); background: var(--bg-active); color: var(--logo-gold-light); font-weight: 500; }
.game-filter__count { color: var(--text-muted); font-size: 12px; }
.game-filter__btn[aria-pressed="true"] .game-filter__count { color: var(--logo-gold-main); }

/* 4. Game tiles: cover, name, provider, action ------------------------------- */
.game-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--gap); list-style: none; }
.game-tile[hidden] { display: none; }
.game-tile__link {
    display: flex; flex-direction: column; height: 100%; padding: 0 0 10px; overflow: hidden;
    border: 1px solid var(--border); border-radius: var(--radius-card);
    background: var(--bg-card);
    transition: transform 200ms ease-out, border-color 200ms ease-out, box-shadow 200ms ease-out;
}
.game-tile__thumb { display: block; overflow: hidden; aspect-ratio: 326 / 440; background: var(--bg-deep); }
.game-tile__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 220ms ease-out; }
.game-tile__name { margin: 8px 10px 0; color: var(--text-primary); font-size: 14px; font-weight: 500; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-tile__provider { margin: 1px 10px 0; color: var(--text-muted); font-size: 12px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-tile .game-cta { margin: 8px 10px 0; }

/* 5. Text + closing CTA ----------------------------------------------------- */
.game-page__text.article { max-width: none; margin-top: var(--space-xl); padding-top: var(--space-lg); }
.game-page__text .article__section { margin-top: 0; }
.game-page__text .article__section > p { max-width: 860px; }
.game-page__cta { margin-top: var(--space-lg); margin-bottom: var(--space-md); border-color: rgba(250, 226, 113, .22); }
.game-page__brand { margin-right: 6px; color: var(--logo-gold-light); font-weight: 500; letter-spacing: .02em; }

/* 6. Responsive -------------------------------------------------------------- */
@media (max-width: 1199px) {
    .provider-list--grid, .game-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    .provider-list--grid, .game-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .provider-list--row > .provider-card { flex-basis: 118px; }
    .game-section { margin-top: var(--space-md); }
}
@media (max-width: 599px) {
    .provider-list--grid, .game-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .provider-card__cta, .game-cta { min-height: 44px; font-size: 14px; }      /* thumb-sized action on phones */
    .game-filter__btn { min-height: 44px; }
    .game-page__cta .btn { min-height: 44px; }
}
