/* ============================================================================
   play.css — immersive, one-game-per-viewport vertical feed (/play).
   Mobile-first. Each slide fills the viewport; swipe up/down to change games.
   Built on the base.css tokens; the global bars are dimmed at runtime by
   play.js (GlobalApp.toggleGlobalHeader(false)).

   Bold bits:
   * every slide carries its own accent (set inline by play.js from the game's
     group) — Hero, badge, glow, chips and the primary CTA all recolour.
   * the slide is min-height:100dvh (not fixed height), so a tall slide grows
     and stays fully reachable instead of being clipped on short phones.
   * desktop centres a real stage with an oversized ghost icon; mobile keeps
     the thumb-friendly bottom alignment.
   ========================================================================== */

body.feed-page {
    margin: 0;
    background: var(--global-bg-body);
    overflow: hidden;
    height: 100dvh;
}

.feed {
    position: fixed;
    inset: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overscroll-behavior-y: contain;
}

.feed::-webkit-scrollbar {
    display: none;
}

/* --- Slide -------------------------------------------------------- */
.feed-slide {
    position: relative;
    min-height: 100dvh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    isolation: isolate;
    padding: calc(84px + env(safe-area-inset-top)) var(--s-5) calc(96px + env(safe-area-inset-bottom));

    /* Per-slide accent (play.js sets --a* inline; fall back to the brand). */
    --accent: var(--a, var(--global-accent));
    --accent-hover: var(--a-hover, var(--global-accent-hover));
    --accent-active: var(--a-active, var(--global-accent-active));
    --accent-contrast: var(--a-contrast, #fff);
    --accent-glow: var(--a-glow, var(--global-accent-glow));
    --accent-soft: color-mix(in oklab, var(--accent) 14%, transparent);
}

/* Ambient glow tinted per game */
.feed-slide::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -12%;
    width: min(130vw, 1040px);
    aspect-ratio: 1;
    transform: translateX(-50%);
    background: radial-gradient(closest-side, color-mix(in oklab, var(--accent) 34%, transparent), transparent 72%);
    opacity: 0.6;
    filter: blur(8px);
    pointer-events: none;
    z-index: 0;
}

/* Oversized watermark icon, clipped by the slide */
.fs-ghost {
    position: absolute;
    top: 34%;
    right: -16%;
    width: 58vh;
    height: 58vh;
    transform: translateY(-50%) rotate(-6deg);
    color: var(--accent);
    opacity: 0.045;
    pointer-events: none;
    z-index: 0;
}

.fs-ghost svg {
    width: 100%;
    height: 100%;
}

.fs-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* --- Top line: Today badge + plan/streak -------------------------- */
.fs-topline {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    flex-wrap: wrap;
    margin-bottom: var(--s-4);
}

.fs-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--r-pill);
    background: var(--accent);
    color: var(--accent-contrast);
    font-size: var(--fs-xs);
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow: 0 6px 18px var(--accent-glow);
}

.fs-plan {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--r-pill);
    background: color-mix(in oklab, var(--text-primary) 6%, transparent);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.fs-plan b {
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* --- Hero card ---------------------------------------------------- */
.fs-hero {
    position: relative;
    width: 92px;
    height: 92px;
    display: grid;
    place-items: center;
    border-radius: 28px;
    background: var(--bg-surface-glass, var(--bg-surface));
    border: 1px solid var(--glass-border, var(--border));
    backdrop-filter: blur(16px);
    box-shadow: var(--glass-shadow, var(--shadow-md)), inset 0 0 0 1px color-mix(in oklab, var(--accent) 16%, transparent);
    color: var(--accent);
    margin-bottom: var(--s-5);
}

.fs-hero svg {
    width: 44px;
    height: 44px;
}

.fs-title {
    position: relative;
    font-size: clamp(2.4rem, 12vw, 3.6rem);
    font-weight: 900;
    letter-spacing: -0.035em;
    line-height: 0.98;
    margin: 0 0 var(--s-2);
    color: var(--text-primary);
}

.fs-tag {
    position: relative;
    color: var(--accent);
    font-size: var(--fs-sm);
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 0 0 var(--s-4);
}

.fs-why {
    position: relative;
    color: var(--text-secondary);
    font-size: var(--fs-lg);
    line-height: 1.5;
    margin: 0 0 var(--s-5);
    max-width: 46ch;
    text-wrap: pretty;
}

.fs-chips {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    margin-bottom: var(--s-5);
}

.fs-actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--s-3);
    flex-wrap: wrap;
}

.fs-start {
    font-weight: 900;
    font-size: var(--fs-lg);
    padding: 16px 26px;
    gap: var(--s-2);
}

.fs-customize {
    font-weight: 700;
}

/* --- Swipe hint (recommended slide, touch, once) ------------------ */
.fs-hint {
    position: absolute;
    left: 50%;
    bottom: calc(40px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-tertiary);
    font-size: var(--fs-2xs);
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    animation: hint-bob 2s var(--ease) infinite;
    pointer-events: none;
    z-index: 3;
}

.fs-hint svg {
    width: 20px;
    height: 20px;
}

@keyframes hint-bob {
    0%, 100% { transform: translate(-50%, 0); opacity: 0.5; }
    50% { transform: translate(-50%, 6px); opacity: 1; }
}

/* --- Progress rail (right) ---------------------------------------- */
.feed-progress {
    position: fixed;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    z-index: 30;
}

.fp-dot {
    appearance: none;
    border: 0;
    padding: 0;
    width: 8px;
    height: 8px;
    border-radius: var(--r-pill);
    background: color-mix(in oklab, var(--global-text-primary) 22%, transparent);
    cursor: pointer;
    position: relative;
    transition: width 0.28s var(--ease), background 0.28s var(--ease), transform 0.2s var(--ease);
}

.fp-dot:hover {
    background: color-mix(in oklab, var(--global-text-primary) 45%, transparent);
}

.fp-dot.active {
    width: 26px;
    background: var(--accent);
}

/* --- Exit button -------------------------------------------------- */
.feed-exit {
    position: fixed;
    top: calc(14px + env(safe-area-inset-top));
    left: 14px;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--glass-border, var(--border));
    background: var(--bg-surface-glass, var(--bg-surface));
    backdrop-filter: blur(16px);
    color: var(--global-text-primary);
    cursor: pointer;
    z-index: 40;
    box-shadow: var(--glass-shadow, var(--shadow-md));
    transition: color 0.2s ease, transform 0.15s var(--ease);
}

.feed-exit:hover {
    color: var(--accent);
    transform: translateY(-1px);
}

.feed-exit:active {
    transform: scale(0.96);
}

/* --- Desktop nav arrows ------------------------------------------- */
.feed-nav {
    display: none;
}

/* ==================================================================
   Desktop: a real centred stage, labelled rail, arrows.
   ================================================================== */
@media (min-width: 900px) {
    .feed-slide {
        align-items: center;
        text-align: center;
        justify-content: center;
        padding-top: calc(96px + env(safe-area-inset-top));
    }

    .fs-inner {
        align-items: center;
        max-width: 620px;
    }

    .fs-ghost {
        right: -6%;
        width: 82vh;
        height: 82vh;
        opacity: 0.05;
    }

    .fs-hero {
        width: 120px;
        height: 120px;
        border-radius: 36px;
    }

    .fs-hero svg {
        width: 56px;
        height: 56px;
    }

    .fs-title {
        font-size: clamp(3rem, 6.5vw, 4.8rem);
    }

    .fs-why {
        font-size: 1.1rem;
    }

    .fs-topline,
    .fs-chips,
    .fs-actions {
        justify-content: center;
    }

    .fs-hint {
        display: none;
    }

    .fp-dot::after {
        content: attr(data-label);
        position: absolute;
        right: calc(100% + 14px);
        top: 50%;
        transform: translateY(-50%) translateX(4px);
        padding: 5px 10px;
        border-radius: var(--r-xs);
        background: var(--bg-surface-2);
        color: var(--text-primary);
        border: 1px solid var(--border);
        box-shadow: var(--shadow-md);
        font-size: var(--fs-xs);
        font-weight: 700;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.16s ease, transform 0.16s ease;
    }

    .fp-dot:hover::after,
    .fp-dot:focus-visible::after {
        opacity: 1;
        transform: translateY(-50%);
    }

    .feed-nav {
        display: flex;
        gap: 10px;
        position: fixed;
        bottom: 28px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 30;
    }

    .feed-nav-btn {
        width: 44px;
        height: 44px;
        display: grid;
        place-items: center;
        border-radius: 50%;
        border: 1px solid var(--glass-border, var(--border));
        background: var(--bg-surface-glass, var(--bg-surface));
        backdrop-filter: blur(16px);
        color: var(--global-text-primary);
        cursor: pointer;
        box-shadow: var(--glass-shadow, var(--shadow-md));
        transition: color 0.18s ease, transform 0.18s var(--ease), opacity 0.18s ease;
    }

    .feed-nav-btn:hover:not(:disabled) {
        color: var(--accent);
        transform: translateY(-1px);
    }

    .feed-nav-btn:disabled {
        opacity: 0.3;
        cursor: default;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fs-hint {
        animation: none;
    }
}
