/* ==========================================================================
   XPlay Games — fixed-width portal column (398px on desktop, fluid on mobile)
   Light theme; the empty space either side is where AdSense side rails land.
   ========================================================================== */

/* Poppins is loaded from inc/header.php with preconnect hints, NOT @import.
   An @import here chains requests — the browser must finish downloading this
   file before it even discovers the font URL — which delays first paint on
   mobile by a full round trip. */

:root {
    --accent:       #1877F2;
    --accent-2:     #3B82F6;
    --accent-dark:  #2563EB;
    --gradient:     linear-gradient(135deg, #1877F2 0%, #ec4899 100%);
    --ink:          #1C1C2E;
    --muted:        #888;
    --line:         #E6E7E8;
    --gold:         #cc8800;
    --gold-2:       #B8860B;
    --green:        #22a35b;
    --play-blue:    #0B57D0;
    --play-chip:    #EAF0F8;
    --play-ink:     #202124;
    --play-muted:   #4A4D50;

    /* Width of the page column — the bottom nav matches it exactly. */
    --col-w:        398px;

    /* Single source of truth for the sticky tab bar. The safe-area inset is
       the home-indicator strip on notched iPhones; it must be added to the
       tap-target height, not just used as padding, or the last slice of page
       content ends up hidden behind the bar. */
    --nav-tap:      56px;
    --nav-h:        calc(var(--nav-tap) + env(safe-area-inset-bottom, 0px));
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    /* `dvh` tracks the *visible* viewport as the mobile URL bar hides and
       shows. Plain `vh` is locked to the tallest state, which makes the page
       overshoot and jitter while scrolling. `vh` stays as the fallback. */
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--play-ink);
    background-color: #fff;
    background-image: none;
    background-size: auto;
    /* NOTE: no `background-attachment: fixed` here. On a long page it forces a
       full-height composited layer that Chrome drops mid-scroll, blanking the
       page to white. Scrolling the pattern with the page is the safe default. */
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* The page column. Stays narrow so ad side-rails have room to render. */
.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 12px 20px;
    position: relative;
    z-index: 1;
    border: 0;
    background-color: #fff;
    background-image: none;
    background-size: auto;
    /* `overflow-x: clip` contains the negative-margin sections without creating
       a scroll container, which is what broke painting on long pages. */
    overflow-x: clip;
}

@media (min-width: 480px) {
    .container {
        max-width: 398px;
        padding: 0 16px 20px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, .08);
    }
}

/* --------------------------------------------------------------- header -- */

/* Brand row was removed, so the header no longer needs to hold space for it. */
.site-header { padding-top: 4px; }

/* ------------------------------------------------------ tabbed app UI -- */

.store-main {
    margin: 0 -12px;
    padding-bottom: 10px;
    overflow: hidden;
}

@media (min-width: 480px) {
    .store-main { margin: 0 -16px; }
}

.store-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .98);
    border-bottom: 1px solid #c7c9cc;
}

.store-actionbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 66px;
    padding: 10px 24px 4px;
}

.store-play-mark {
    position: relative;
    width: 34px;
    height: 34px;
    flex: none;
}
.store-play-mark span,
.store-play-mark::before,
.store-play-mark::after {
    position: absolute;
    inset: 0;
    content: "";
    clip-path: polygon(0 0, 100% 50%, 0 100%);
    border-radius: 6px;
}
.store-play-mark span { background: #34A853; transform: translateX(-3px) scale(.95); }
.store-play-mark::before { background: #4285F4; transform: translateX(4px) scale(.72); }
.store-play-mark::after { background: linear-gradient(135deg, #EA4335 0 47%, #FBBC04 48% 100%); transform: translateX(11px) scale(.58); }

.store-actions { display: flex; align-items: center; gap: 22px; color: var(--play-muted); }
.store-icon-btn,
.store-mic {
    position: relative;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    font: inherit;
    color: transparent;
    background: transparent;
}
.store-icon-btn::before {
    position: absolute;
    left: 9px;
    top: 6px;
    width: 15px;
    height: 18px;
    border: 3px solid var(--play-muted);
    border-top-width: 4px;
    border-radius: 11px 11px 5px 5px;
    content: "";
}
.store-icon-btn::after {
    position: absolute;
    left: 14px;
    top: 25px;
    width: 6px;
    height: 3px;
    border-radius: 0 0 6px 6px;
    background: var(--play-muted);
    content: "";
}
.store-mic::before {
    position: absolute;
    left: 12px;
    top: 5px;
    width: 10px;
    height: 19px;
    border: 3px solid var(--play-muted);
    border-radius: 9px;
    content: "";
}
.store-mic::after {
    position: absolute;
    left: 9px;
    top: 19px;
    width: 16px;
    height: 12px;
    border-bottom: 3px solid var(--play-muted);
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    content: "";
}
.store-avatar {
    position: relative;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #a7d68b;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
    cursor: pointer;
}
.store-avatar:disabled { cursor: wait; opacity: .7; }
.store-avatar .ad-tag {
    position: absolute;
    right: -5px;
    bottom: -3px;
    min-width: 20px;
    padding: 2px 4px;
    border: 2px solid #fff;
    border-radius: 5px;
    color: #fff;
    background: #5f6368;
    font-size: 9px;
    font-weight: 700;
    line-height: 11px;
    letter-spacing: 0;
}

.store-tabs {
    display: flex;
    gap: 34px;
    overflow-x: auto;
    padding: 0 24px;
    scrollbar-width: none;
}
.store-tabs::-webkit-scrollbar { display: none; }
.store-tab {
    position: relative;
    flex: none;
    padding: 11px 0 10px;
    font-size: 1.02rem;
    font-weight: 500;
    color: #3f4346;
}
.store-tab.active { color: var(--play-blue); }
.store-tab.active::after {
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: -1px;
    height: 4px;
    border-radius: 4px 4px 0 0;
    background: var(--play-blue);
    content: "";
}

.store-search {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin: 22px 24px 20px;
    padding: 9px 12px 9px 16px;
    border-radius: 34px;
    background: var(--play-chip);
}
.store-search input {
    min-width: 0;
    border: 0;
    outline: 0;
    font: inherit;
    font-size: 1.1rem;
    color: var(--play-muted);
    background: transparent;
}
.store-search-submit {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 13px;
    border: 0;
    border-radius: 20px;
    color: #fff;
    background: var(--play-blue);
    font: inherit;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
}
.store-search-submit:disabled { cursor: wait; opacity: .7; }
.store-search-submit .ad-tag {
    position: absolute;
    top: 2px;
    right: 7px;
    color: rgba(255, 255, 255, .65);
    font-size: .45rem;
    font-weight: 700;
    letter-spacing: .5px;
    pointer-events: none;
}
.store-search-icon {
    position: relative;
    width: 28px;
    height: 28px;
    color: transparent;
}
.store-search-icon::before {
    position: absolute;
    left: 3px;
    top: 2px;
    width: 15px;
    height: 15px;
    border: 3px solid var(--play-muted);
    border-radius: 50%;
    content: "";
}
.store-search-icon::after {
    position: absolute;
    left: 20px;
    top: 19px;
    width: 11px;
    height: 3px;
    border-radius: 3px;
    background: var(--play-muted);
    transform: rotate(45deg);
    transform-origin: left center;
    content: "";
}

.store-hero-row,
.games-grid.compact-row {
    display: grid;
    grid-auto-flow: column;
    gap: 14px;
    overflow-x: auto;
    padding: 18px 24px 8px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}
.store-hero-row { grid-auto-columns: calc(100% - 48px); }
.store-hero-row::-webkit-scrollbar,
.games-grid.compact-row::-webkit-scrollbar { display: none; }

.store-hero-card {
    display: grid;
    grid-template-rows: 170px auto;
    overflow: hidden;
    border-radius: 18px;
    background: #f6f8fb;
    scroll-snap-align: start;
}
.store-hero-art { position: relative; overflow: hidden; background: #111; }
.store-hero-art img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.82); }
.store-hero-art::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, .72));
    content: "";
}
.store-hero-copy { display: grid; gap: 2px; padding: 13px 16px 16px; text-align: left; }
.store-hero-copy strong { font-size: 1.05rem; line-height: 1.25; }
.store-hero-copy small { color: var(--play-muted); }

.store-feed,
.store-feed-row { padding-top: 20px; }
.store-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0 24px;
    text-align: left;
}
.store-section-heading h1,
.store-section-heading h2 {
    margin: 0;
    font-size: 1.28rem;
    line-height: 1.24;
    font-weight: 600;
    color: var(--play-ink);
}
.store-arrow {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: none;
    border-radius: 50%;
    font-size: 2rem;
    line-height: 1;
    color: #3f4346;
    background: #E8EEF7;
}

.store-tab-ad {
    margin: 0;
    padding: 16px 24px 6px;
    background: #fff;
}
.store-tab-ad .ad-placeholder,
.store-tab-ad .adsbygoogle {
    min-height: 120px;
    border-radius: 18px;
}

.store-app-promo { padding: 22px 24px 10px; }
.store-app-promo .store-hero-card { grid-template-rows: 155px auto; }

.store-category-grid {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 18px 24px 6px;
}
.store-category-grid .category-card {
    height: 96px;
    border: 0;
    border-radius: 22px;
    background: #f5f7fb;
}

.book-shelf { padding: 26px 0 8px; }
.book-shelf .store-section-heading { align-items: flex-start; }
.book-shelf .store-section-heading p {
    margin: 4px 0 0;
    font-size: .96rem;
    color: var(--play-muted);
}
.book-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 135px;
    gap: 18px;
    overflow-x: auto;
    padding: 24px 24px 8px;
    scrollbar-width: none;
}
.book-row::-webkit-scrollbar { display: none; }
.book-card { display: grid; gap: 8px; text-align: left; }
.book-card img {
    width: 135px;
    height: 178px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 10px rgba(60, 64, 67, .2);
}
.book-card strong {
    display: -webkit-box;
    min-height: 42px;
    overflow: hidden;
    font-size: .9rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--play-muted);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}
.book-card span {
    justify-self: start;
    padding: 1px 8px;
    border-radius: 12px;
    font-size: .82rem;
    color: var(--play-muted);
    background: #F0F3F7;
}

.store-copy-section {
    margin: 22px 0 16px;
    border: 0;
    background: #fff;
}
.store-copy-section h2 {
    border-bottom: 0;
    border-image-source: none;
    color: var(--play-ink);
}
.store-copy-section p { color: var(--play-muted); }

.store-detail-main {
    margin: 0 -12px;
    padding: 0 24px 20px;
    overflow: hidden;
}
@media (min-width: 480px) {
    .store-detail-main { margin: 0 -16px; }
}
.store-detail-header { padding: 18px 0 8px; }
.store-detail-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    margin-bottom: 18px;
}
.store-detail-actions > div { display: flex; align-items: center; gap: 18px; }
.store-back,
.store-save,
.store-more {
    position: relative;
    width: 38px;
    height: 38px;
    border: 0;
    font: inherit;
    color: transparent;
    background: transparent;
}
.store-back { color: var(--play-muted); font-size: 2.7rem; line-height: .7; }
.store-save::before {
    position: absolute;
    left: 10px;
    top: 6px;
    width: 17px;
    height: 24px;
    border: 3px solid var(--play-muted);
    content: "";
}
.store-save::after {
    position: absolute;
    left: 19px;
    top: 10px;
    width: 3px;
    height: 12px;
    background: var(--play-muted);
    box-shadow: -5px 5px 0 var(--play-muted), 5px 5px 0 var(--play-muted);
    content: "";
}
.store-more::before {
    position: absolute;
    left: 17px;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--play-muted);
    box-shadow: 0 10px 0 var(--play-muted), 0 20px 0 var(--play-muted);
    content: "";
}
.store-app-title {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 22px;
    align-items: center;
}
.store-app-title img {
    width: 100px;
    height: 100px;
    border-radius: 22px;
    object-fit: cover;
    box-shadow: 0 2px 12px rgba(60, 64, 67, .16);
}
.store-app-title h1 {
    margin: 0 0 6px;
    font-size: 1.7rem;
    line-height: 1.15;
    font-weight: 500;
}
.store-app-title a {
    font-size: 1rem;
    line-height: 1.35;
    color: var(--play-blue);
}
.store-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin: 22px 0 8px;
    color: var(--play-muted);
}
.store-stats span {
    display: grid;
    gap: 4px;
    place-items: center;
    min-width: 0;
    padding: 0 8px;
    border-right: 1px solid #c7c9cc;
    text-align: center;
}
.store-stats span:last-child { border-right: 0; }
.store-stats strong { font-size: 1.12rem; color: var(--play-ink); }
.store-stats small { font-size: .78rem; white-space: nowrap; }
.store-install {
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 56px;
    border-radius: 28px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    background: #155BD8;
}
.store-detail-main .player-section { margin: 0 0 20px; }
.store-screenshot-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 118px;
    gap: 16px;
    overflow-x: auto;
    margin: 8px -24px 22px;
    padding: 0 24px 8px;
    scrollbar-width: none;
}
.store-screenshot-strip::-webkit-scrollbar { display: none; }
.store-screenshot-strip img {
    width: 118px;
    height: 205px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 2px 10px rgba(60, 64, 67, .16);
}
.store-section-heading.no-pad { padding: 0; }

/* ------------------------------------------------- search + categories -- */

.search-category-container { margin-bottom: 6px; }

.search-container { margin: 0 0 12px; }

.game-search-input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--line);
    border-radius: 10px;
    font: inherit;
    font-size: .95rem;
    color: var(--ink);
    background: #fff;
    outline: none;
    transition: border-color .2s ease;
}
.game-search-input::placeholder { color: #a0a0b0; }
.game-search-input:focus { border-color: var(--accent); }

.category-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
}
.category-filters::-webkit-scrollbar { display: none; }

.category-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: none;
    padding: 7px 13px;
    border: 1px solid var(--line);
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 600;
    color: #5b5b6b;
    background: #fff;
    cursor: pointer;
    transition: all .18s ease;
}
.category-btn:hover { border-color: var(--accent-2); color: var(--accent); }
.category-btn.active {
    color: #fff;
    border-color: transparent;
    background: var(--accent-2);
}
.cat-icon { font-size: .9rem; }

/* -------------------------------------------------------------- titles -- */

.all-games-section { text-align: center; padding-top: 14px; }

.section-title {
    display: inline-block;
    width: auto;
    margin: 0 0 4px;
    padding-bottom: 8px;
    font-size: 1.4em;
    font-weight: 600;
    color: #7e7e7e;
    border-bottom: 4px solid;
    border-image-slice: 1;
    border-image-source: var(--gradient);
}
.section-title .count {
    margin-left: 6px;
    font-size: .6em;
    font-weight: 700;
    color: #a8a8b4;
}

/* ----------------------------------------------------------- game grid -- */

.games-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
    width: 100%;
    margin: 18px 0 20px;
    padding: 0 24px;
    justify-items: stretch;
}
.store-feed .games-grid {
    grid-auto-flow: column;
    grid-auto-columns: minmax(250px, 74%);
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}
.store-feed .games-grid::-webkit-scrollbar { display: none; }
.games-grid.compact-row {
    grid-auto-columns: minmax(210px, 62%);
    grid-template-columns: none;
    margin-top: 0;
}

.game-item {
    position: relative;
    width: 100%;
    border: 0;
    border-radius: 0;
    background: #fff;
    overflow: visible;
    cursor: pointer;
    transition: transform .18s ease;
    -webkit-tap-highlight-color: transparent;
}
.game-item:hover { transform: none; }
.game-item[hidden] { display: none; }

.game-item-link {
    display: grid;
    grid-template-columns: 72px 1fr;
    grid-template-rows: auto auto;
    gap: 7px 12px;
    align-items: center;
    min-height: 90px;
}

.entry-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px 7px 3px 4px;
    border: 1px solid rgba(255, 215, 0, .3);
    border-radius: 10px;
    font-size: .65rem;
    font-weight: 700;
    color: #FFD700;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(4px);
    pointer-events: none;
}

.game-thumb {
    position: relative;
    display: block;
    grid-row: 1 / 3;
    width: 72px;
    height: 72px;
    flex: none;
    background: #eef1f5;
    border-radius: 17px;
    box-shadow: 0 2px 8px rgba(60, 64, 67, .18);
    overflow: hidden;
}
.game-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .32s ease; }
.game-item:hover .game-thumb img { transform: none; }

/* Lazy thumbnails fade in instead of popping. Scoped to .js (set by an inline
   script in the head) so users without JS still see every image. */
.js .game-thumb img {
    opacity: 0;
    transition: opacity .28s ease, transform .32s ease;
}
.js .game-thumb img.img-ok { opacity: 1; }

.game-thumb::after { display: none; }

.game-copy { min-width: 0; align-self: end; text-align: left; }
.game-copy h3,
.game-item h3 {
    margin: 0;
    font-size: .98rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--play-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.game-copy small { display: block; margin-top: 3px; font-size: .82rem; color: var(--play-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.card-live-users {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    align-self: start;
    font-size: .82rem;
    color: var(--play-muted);
}
.card-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    animation: pulse 2s infinite;
}
.card-live-count { color: var(--green); font-weight: 700; }
.rating-star { color: var(--play-blue); margin-left: 2px; }
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(34, 163, 91, .6); }
    70%  { box-shadow: 0 0 0 6px rgba(34, 163, 91, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 163, 91, 0); }
}

.play-now-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: calc(100% - 16px);
    margin: auto 8px 10px;
    padding: 9px 0;
    border: 0;
    border-radius: 10px;
    font: inherit;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .3px;
    color: #fff;
    background: var(--accent-2);
    cursor: pointer;
    transition: background .15s ease, transform .1s ease;
}
.play-now-btn::before { content: "▶"; font-size: .65em; }
.play-now-btn:hover { background: var(--accent-dark); }
.play-now-btn:active { transform: scale(.97); }
.play-now-btn.lg { width: auto; margin: 0 auto; padding: 12px 34px; font-size: .95rem; }

.more-button-container { margin-bottom: 6px; }

.no-results { margin: 20px 0; font-size: .9rem; color: var(--muted); }
.no-results[hidden] { display: none; }

/* ------------------------------------------------------ category cards -- */

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}
.category-card {
    position: relative;
    height: 110px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    transition: transform .18s ease;
}
.category-card:hover { transform: translateY(-4px); }
.category-card img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.55); }
.category-card-body {
    position: absolute;
    inset: auto 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 10px;
    text-align: left;
    color: #fff;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .78));
}
.category-card-body strong { font-size: .9rem; }
.category-card-body small { font-size: .68rem; opacity: .85; }

/* ---------------------------------------------------------- play page -- */

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin: 10px 0;
    font-size: .72rem;
    color: var(--muted);
}
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb strong { color: var(--ink); font-weight: 600; }

.player-section { margin-bottom: 18px; }

.player-frame {
    position: relative;
    /* `min-width` pins the box to the full column. Without it, capping the
       height makes `aspect-ratio` solve for a narrower width instead, and the
       game shrinks to a thin strip on short screens. */
    width: 100%;
    min-width: 100%;
    aspect-ratio: 3 / 4;
    /* Cap against the live viewport so the control bar is never pushed off
       screen. Tall phone -> the 3:4 ratio wins; short/landscape -> this does. */
    max-height: calc(100dvh - var(--nav-h) - 150px);
    min-height: 240px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px 16px 0 0;
    background: #0d0d18;
}
.player-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.player-frame:fullscreen { aspect-ratio: auto; height: 100%; border-radius: 0; }

.player-gate { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; overflow: hidden; }
.player-gate[hidden] { display: none; }
.gate-art {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(16px) brightness(.4);
    transform: scale(1.12);
}
.gate-inner { position: relative; padding: 18px; text-align: center; color: #fff; }
.gate-inner h1,
.gate-inner h2 { margin: 0 0 8px; font-size: 1.35rem; }
.gate-cost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 16px;
    font-size: .85rem;
    font-weight: 700;
    color: #FFD700;
}
.gate-external { display: block; margin-top: 12px; font-size: .72rem; color: rgba(255, 255, 255, .72); }
.gate-external:hover { color: #fff; text-decoration: underline; }

.player-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 16px 16px;
    background: #fff;
}
.player-bar-info { display: flex; align-items: center; gap: 9px; min-width: 0; }
.player-bar-icon { width: 40px; height: 40px; flex: none; border-radius: 9px; object-fit: cover; }
.player-bar-info strong { display: block; font-size: .82rem; }
.player-bar-info .card-live-users { justify-content: flex-start; }
.player-bar-actions { display: flex; gap: 6px; flex: none; }

.embed-note {
    margin: 10px 0 0;
    padding: 10px 12px;
    border: 1px solid #ffe3a3;
    border-radius: 10px;
    font-size: .75rem;
    line-height: 1.5;
    color: #8a6100;
    background: #fff8e6;
}
.embed-note[hidden] { display: none; }
.embed-note a { color: var(--accent); text-decoration: underline; }

.game-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 20px;
    font-size: .68rem;
    font-weight: 600;
    color: #5b5b6b;
    background: #fff;
}

/* ---------------------------------------------------------------- about -- */

.what-is-section {
    position: relative;
    margin: 0 0 16px;
    padding: 20px 16px;
    color: var(--ink);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: linear-gradient(135deg, #f8fafc 0%, #fff 50%, #f8fafc 100%);
}
.what-is-section h2 {
    display: inline-block;
    margin: 0 0 10px;
    padding-bottom: 5px;
    font-size: 1.15em;
    border-bottom: 3px solid;
    border-image-slice: 1;
    border-image-source: var(--gradient);
}
.what-is-section p {
    margin: 0 0 12px;
    font-size: .85em;
    line-height: 1.65;
    color: var(--muted);
}
.what-is-section p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- misc -- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 15px;
    border: 0;
    border-radius: 1rem;
    font: inherit;
    font-size: .8rem;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    cursor: pointer;
    transition: all .2s;
}
.btn:hover { background: var(--accent-2); transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--wide { width: 100%; padding: .75rem 1rem; }

/* Ad slots — matched to the reference placements. */
.ad-slot { margin: 10px 0; text-align: center; }
.ad-slot.ad-top { min-height: 280px; }

.ad-placeholder {
    display: grid;
    place-items: center;
    min-height: 100px;
    border: 1px dashed #d6d9e0;
    border-radius: 10px;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #b9bdc7;
    background: #fbfcfe;
}
.ad-top .ad-placeholder { min-height: 280px; }

.site-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 20px 16px 0;
    margin-top: 20px;
    border-top: 1px solid var(--line);
}
.footer-copy { width: 100%; text-align: center; font-size: .68rem; color: #b0b0bc; }

.toast {
    position: fixed;
    left: 50%;
    bottom: 22px;
    z-index: 200;
    transform: translateX(-50%);
    padding: 11px 20px;
    border-radius: 20px;
    font-size: .85rem;
    font-weight: 700;
    color: #fff;
    background: var(--accent-2);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .25);
    animation: popIn .2s ease;
}
.toast[hidden] { display: none; }

/* ------------------------------------------------------------- a11y ----- */

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ------------------------------------------------------- page intro ----- */

.page-intro { padding: 12px 0 4px; }

.page-intro h1 {
    margin: 0 0 6px;
    font-size: 1.32rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--ink);
}
.play-h1 { margin: 0 0 10px; font-size: 1.15em; }

.page-intro-text {
    margin: 0;
    font-size: .82rem;
    line-height: 1.6;
    color: var(--muted);
}

/* --------------------------------------------------- deferred cards ----- */

.game-item[hidden] { display: none !important; }

/* ---------------------------------------------------------- pagination -- */

.page-range {
    margin: 4px 0 12px;
    font-size: .72rem;
    color: var(--muted);
}
.page-range[hidden] { display: none; }

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 4px 0 18px;
}
.pagination[hidden] { display: none; }

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 38px;          /* comfortable tap target */
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--ink);
    background: #fff;
    transition: all .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.page-btn:hover { border-color: var(--accent-2); color: var(--accent); }

.page-btn.is-current {
    color: #fff;
    border-color: transparent;
    background: var(--accent-2);
}
.page-btn.is-disabled {
    color: #c2c2cc;
    background: #f7f8fa;
    pointer-events: none;
}
.page-gap { padding: 0 2px; color: var(--muted); font-size: .8rem; }

/* ------------------------------------------------- quick categories ----- */

.quick-cats { padding: 6px 16px 0; text-align: center; }

.quick-cats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 14px 0 20px;
}

.quick-cat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 62px;
    padding: 8px 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    font-size: .62rem;
    font-weight: 600;
    color: #5b5b6b;
    background: #fff;
    transition: all .18s ease;
}
.quick-cat .cat-icon { font-size: 1.15rem; }
.quick-cat:hover, .quick-cat:active { border-color: var(--accent-2); color: var(--accent); }

/* -------------------------------------------------- collapsible SEO ----- */

.seo-details, .faq-item {
    border-top: 1px solid var(--line);
}
.seo-details { margin-top: 12px; }

.seo-details summary, .faq-item summary {
    padding: 12px 24px 12px 0;
    position: relative;
    font-size: .82rem;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    list-style: none;
    -webkit-tap-highlight-color: transparent;
}
.seo-details summary::-webkit-details-marker,
.faq-item summary::-webkit-details-marker { display: none; }

.seo-details summary::after, .faq-item summary::after {
    content: "＋";
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    font-size: .95rem;
    color: var(--accent-2);
}
.seo-details[open] summary::after, .faq-item[open] summary::after { content: "－"; }

.seo-details-body { padding-bottom: 4px; }
.faq-item p {
    margin: 0 0 12px;
    font-size: .8rem;
    line-height: 1.65;
    color: var(--muted);
}

.faq-section {
    margin: 0;
    padding: 18px 16px 6px;
    border-top: 1px solid var(--line);
    background: #fff;
}
.faq-section > h2 {
    margin: 0 0 4px;
    font-size: 1.1rem;
}

.legal h2 { margin-top: 18px; font-size: 1rem; }
.legal a { color: var(--accent); text-decoration: underline; }
.legal code {
    padding: 1px 5px;
    border-radius: 4px;
    font-size: .9em;
    background: #f1f2f6;
}

/* -------------------------------------------------- sticky bottom nav --- */

.bottom-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 90;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    max-width: var(--col-w);   /* line up with the page column, not wider */
    margin: 0 auto;
    padding: 8px 8px env(safe-area-inset-bottom, 0px);
    border-top: 0;
    background: #EEF3FA;
    backdrop-filter: blur(10px);
    box-shadow: 0 -2px 14px rgba(60, 64, 67, .08);
}

.bottom-nav-item {
    position: relative;
    display: grid;
    grid-template-rows: 28px 20px;
    align-items: center;
    justify-content: center;
    justify-items: center;
    gap: 4px;
    min-height: var(--nav-tap);   /* comfortable tap target */
    padding: 6px 2px;
    border: 0;
    font: inherit;
    font-size: .82rem;
    font-weight: 500;
    color: #3f4346;
    background: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color .15s ease;
}
.bottom-nav-item .ad-tag {
    position: absolute;
    top: 2px;
    left: calc(50% + 11px);
    min-width: 20px;
    padding: 1px 4px;
    border: 2px solid #EEF3FA;
    border-radius: 5px;
    color: #fff;
    background: #5f6368;
    font-size: 8px;
    font-weight: 700;
    line-height: 10px;
    letter-spacing: 0;
}
.bn-icon {
    position: relative;
    display: block;
    width: 44px;
    height: 28px;
    border-radius: 18px;
}
.bn-label { line-height: 20px; }
.bn-icon::before,
.bn-icon::after { position: absolute; content: ""; }
.bottom-nav-item.active { color: #00639B; }
.bottom-nav-item.active .bn-icon { background: #BFE6FF; }
.bn-gamepad::before { left: 9px; top: 5px; width: 20px; height: 12px; border: 3px solid currentColor; border-radius: 7px 7px 10px 10px; }
.bn-gamepad::after { left: 14px; top: 9px; width: 4px; height: 4px; background: currentColor; box-shadow: 8px 0 0 currentColor; }
.bn-grid::before { left: 12px; top: 4px; width: 7px; height: 7px; border-radius: 2px; background: currentColor; box-shadow: 12px 0 0 currentColor, 0 12px 0 currentColor, 12px 12px 0 currentColor; }
.bn-search::before { left: 9px; top: 2px; width: 15px; height: 15px; border: 3px solid currentColor; border-radius: 50%; }
.bn-search::after { left: 26px; top: 18px; width: 10px; height: 3px; border-radius: 3px; background: currentColor; transform: rotate(45deg); transform-origin: left center; }
.bn-book::before { left: 11px; top: 1px; width: 16px; height: 19px; border: 3px solid currentColor; border-radius: 2px; }
.bn-book::after { left: 21px; top: 4px; width: 5px; height: 9px; background: currentColor; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%); }
.bottom-nav-item:active { transform: scale(.94); }

/* Reserve exactly the bar's real height (tap target + home-indicator inset)
   so the footer is never trapped underneath it on any device. */
body { padding-bottom: calc(var(--nav-h) + 10px); }

.modal-fineprint {
    margin: 10px 0 0 !important;
    font-size: .68rem !important;
    color: #a8a8b4 !important;
}

/* ---------------------------------------------------------- footer ------ */

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 14px;
    width: 100%;
}
.footer-links a {
    font-size: .74rem;
    font-weight: 600;
    color: var(--accent);
}
.footer-links a:hover { text-decoration: underline; }
