/* ==========================================================================
   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.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap");

: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;

    /* 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(--ink);
    background-color: #f8f9fb;
    background-image: radial-gradient(circle at 2px 2px, rgba(136, 149, 165, .28) 1.4px, transparent 1.4px);
    background-size: 22px 22px;
    /* 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: 1px solid var(--line);
    background-color: #fff;
    background-image:
        radial-gradient(circle at 2px 2px, rgba(124, 58, 237, .08) 1px, transparent 1px),
        linear-gradient(to bottom, #fff 0%, #f8fafc 100%);
    background-size: 30px 30px, 100% 100%;
    /* `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; }

/* Coin balance + earn button row */
.reward-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 8px 0;
    padding: 8px 12px;
    border: 1px solid var(--accent-2);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(255, 193, 7, .12);
}

.coin-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px 5px 8px;
    border: 1px solid var(--accent-2);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}
.coin-balance {
    min-width: 22px;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--gold);
}

/* Coin token, drawn in CSS so there is no image dependency. */
.coin-3d {
    display: inline-block;
    width: 22px;
    height: 22px;
    flex: none;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #fff3bd 0%, #ffc531 45%, #c98a05 100%);
    box-shadow:
        inset 0 -2px 3px rgba(120, 70, 0, .45),
        inset 0 2px 3px rgba(255, 255, 255, .7);
    animation: coinSpin 3.6s linear infinite;
    user-select: none;
}
.coin-3d.sm { width: 15px; height: 15px; }
.coin-3d.modal-coin { width: 56px; height: 56px; }

/* Gentle spin. Never squash below ~0.55 or a paused frame reads as an egg
   rather than a coin. */
@keyframes coinSpin {
    0%, 100% { transform: rotateY(0deg)   scaleX(1);   }
    50%      { transform: rotateY(180deg) scaleX(.55); }
}
@media (prefers-reduced-motion: reduce) { .coin-3d { animation: none; } }

.earn-coins-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 0;
    border-radius: 20px;
    font: inherit;
    font-size: .85rem;
    font-weight: 700;
    white-space: nowrap;
    color: #fff;
    background: var(--accent-2);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}
.earn-coins-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 16px rgba(59, 130, 246, .4); }
.earn-coins-btn:active { transform: translateY(0); }
.earn-coins-btn[disabled] { opacity: .65; cursor: progress; transform: none; }

/* Counting down: greyed and clearly "waiting", not broken or loading. The
   button stays enabled so it never looks dead — taps are simply ignored by
   the script while the timer runs. */
.earn-coins-btn.is-cooling,
.bottom-nav-item.is-cooling {
    cursor: default;
    opacity: .75;
}
.earn-coins-btn.is-cooling {
    background: #9aa7b8;
    box-shadow: none;
}
.earn-coins-btn.is-cooling .coin-3d { animation: none; }

/* ------------------------------------------------- processing state ----- */

/* Swaps the coin for a spinner while the reward is being processed. */
.earn-coins-btn.is-processing,
.bottom-nav-item.is-processing { cursor: progress; opacity: .85; }

.earn-coins-btn.is-processing .coin-3d,
.bottom-nav-item.is-processing .bn-icon { display: none; }

.earn-coins-btn.is-processing::before,
.bottom-nav-item.is-processing::before {
    content: "";
    width: 16px;
    height: 16px;
    flex: none;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
.bottom-nav-item.is-processing::before {
    width: 15px;
    height: 15px;
    border-color: rgba(24, 119, 242, .3);
    border-top-color: var(--accent);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------- reward success ----- */

.reward-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 15, 30, .62);
    backdrop-filter: blur(5px);
    animation: fadeIn .18s ease;
}
.reward-modal[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.reward-content {
    position: relative;
    width: 100%;
    max-width: 320px;
    padding: 28px 22px 22px;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: linear-gradient(180deg, #fff 0%, #f7faff 100%);
    box-shadow: 0 22px 55px rgba(0, 0, 0, .32);
    overflow: hidden;
    animation: rewardPop .42s cubic-bezier(.2, 1.3, .4, 1);
}
@keyframes rewardPop {
    0%   { opacity: 0; transform: scale(.82) translateY(18px); }
    60%  { opacity: 1; transform: scale(1.03) translateY(0); }
    100% { transform: scale(1); }
}

.reward-coin-hero { display: grid; place-items: center; margin-bottom: 12px; }
.reward-coin {
    width: 66px;
    height: 66px;
    animation: rewardCoin .9s ease-out;
}
@keyframes rewardCoin {
    0%   { transform: scale(.3) rotate(-25deg); opacity: 0; }
    55%  { transform: scale(1.15) rotate(8deg);  opacity: 1; }
    100% { transform: scale(1) rotate(0); }
}

.reward-title {
    margin: 0 0 6px;
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--ink);
}
.reward-amount {
    margin: 0 0 4px;
    font-size: 1.6rem;
    font-weight: 800;
    color: #16a34a;
}
.reward-balance {
    margin: 0 0 18px;
    font-size: .85rem;
    color: var(--muted);
}
.reward-content .play-now-btn { margin: 0 auto; }

/* Confetti: 12 pieces on staggered falls. Purely decorative. */
.reward-confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.reward-confetti span {
    position: absolute;
    top: -14px;
    width: 8px;
    height: 12px;
    opacity: 0;
    border-radius: 2px;
    animation: confettiFall 1.5s ease-in forwards;
}
.reward-confetti span:nth-child(1)  { left:  6%; background: #ffc531; animation-delay: .02s; }
.reward-confetti span:nth-child(2)  { left: 15%; background: #1877F2; animation-delay: .16s; }
.reward-confetti span:nth-child(3)  { left: 24%; background: #ec4899; animation-delay: .07s; }
.reward-confetti span:nth-child(4)  { left: 33%; background: #22c55e; animation-delay: .24s; }
.reward-confetti span:nth-child(5)  { left: 42%; background: #a855f7; animation-delay: .11s; }
.reward-confetti span:nth-child(6)  { left: 51%; background: #ffc531; animation-delay: .30s; }
.reward-confetti span:nth-child(7)  { left: 60%; background: #1877F2; animation-delay: .05s; }
.reward-confetti span:nth-child(8)  { left: 69%; background: #ec4899; animation-delay: .21s; }
.reward-confetti span:nth-child(9)  { left: 78%; background: #22c55e; animation-delay: .13s; }
.reward-confetti span:nth-child(10) { left: 86%; background: #a855f7; animation-delay: .27s; }
.reward-confetti span:nth-child(11) { left: 93%; background: #ffc531; animation-delay: .09s; }
.reward-confetti span:nth-child(12) { left: 48%; background: #1877F2; animation-delay: .34s; }

@keyframes confettiFall {
    0%   { opacity: 1; transform: translateY(0) rotate(0); }
    100% { opacity: 0; transform: translateY(300px) rotate(420deg); }
}

/* Celebration is decoration — never motion-sickness fuel. */
@media (prefers-reduced-motion: reduce) {
    .reward-confetti { display: none; }
    .reward-content,
    .reward-coin,
    .reward-modal { animation: none; }
    .earn-coins-btn.is-processing::before,
    .bottom-nav-item.is-processing::before { animation-duration: 2s; }
}
.bottom-nav-item.is-cooling { color: #9aa7b8; }
.bottom-nav-item[disabled] { background: none; }

.ad-tag {
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .5px;
    background: rgba(0, 0, 0, .28);
}

/* ------------------------------------------------- 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: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    margin: 16px 0 20px;
    justify-items: center;
}

.game-item {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
    cursor: pointer;
    transition: transform .18s ease;
    -webkit-tap-highlight-color: transparent;
}
.game-item:hover { transform: translateY(-4px) scale(1.02); }
.game-item[hidden] { display: none; }

.game-item-link { display: flex; flex-direction: column; height: 100%; }

.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;
    height: 130px;
    flex: none;
    background: #eef1f5;
    overflow: hidden;
}
.game-thumb img { width: 100%; height: 130px; object-fit: cover; transition: transform .32s ease; }
.game-item:hover .game-thumb img { transform: scale(1.07); }

.game-thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .25);
    opacity: 0;
    transition: opacity .2s ease;
    pointer-events: none;
}
.game-item:hover .game-thumb::after { opacity: 1; }

.game-item h3 {
    margin: 8px 10px 2px;
    font-size: .82rem;
    font-weight: 500;
    line-height: 1.3;
    color: #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-live-users {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: .65rem;
    color: var(--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; }
@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); }
}

.coin-cost-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 2px 0 4px;
    font-size: .7rem;
    font-weight: 600;
    color: var(--gold-2);
}

.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 { 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 -16px 16px;
    padding: 20px;
    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; }

/* ---------------------------------------------------------------- modal -- */

.coin-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 15, 30, .6);
    backdrop-filter: blur(4px);
}
.coin-modal[hidden] { display: none; }

.coin-modal-content {
    position: relative;
    width: 100%;
    max-width: 340px;
    /* On short screens (landscape phone) the popup scrolls instead of having
       its buttons clipped off the bottom. */
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    padding: 26px 20px 20px;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .28);
    animation: popIn .2s ease;
}
@keyframes popIn {
    from { opacity: 0; transform: translateY(12px) scale(.96); }
    to   { opacity: 1; transform: none; }
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #9a9aa8;
    background: #f1f2f6;
    cursor: pointer;
}
.modal-close-btn:hover { color: var(--ink); background: #e4e6ee; }

.modal-coin-hero { display: grid; place-items: center; margin-bottom: 10px; }
.coin-modal h3 { margin: 0 0 6px; font-size: 1.25rem; }
.coin-modal p { margin: 0 0 5px; font-size: .85rem; color: var(--muted); }
.modal-balance { margin-bottom: 16px !important; }
.coin-modal .earn-coins-btn { width: 100%; justify-content: center; }

.modal-divider { position: relative; margin: 14px 0; font-size: .72rem; color: #b0b0bc; }
.modal-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0; right: 0;
    height: 1px;
    background: var(--line);
}
.modal-divider span { position: relative; padding: 0 10px; background: #fff; }

.skip-ad-btn {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 20px;
    font: inherit;
    font-size: .85rem;
    color: var(--muted);
    background: #fff;
    cursor: pointer;
}
.skip-ad-btn:hover { color: var(--accent); border-color: var(--accent-2); }

/* ---------------------------------------------------------------- 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-top: 20px;
    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-top: 6px; 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 -16px;
    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-bottom: env(safe-area-inset-bottom, 0px);
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(10px);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, .08);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: var(--nav-tap);   /* comfortable tap target */
    padding: 6px 2px;
    border: 0;
    font: inherit;
    font-size: .6rem;
    font-weight: 600;
    color: #8b8b9a;
    background: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color .15s ease;
}
.bn-icon { font-size: 1.15rem; line-height: 1; }
.bottom-nav-item.active { color: var(--accent); }
.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; }
