/* Games: navigation floats over one continuous illustrated masthead. */
/* The scene reaches the viewport edges; catalog and navigation retain their readable width. */
.games-page .page-shell {
    --games-inset: clamp(1rem, 3vw, 2rem);
    max-width: none;
    padding-top: 0;
}
.games-page .section-stack,
.games-page .tumblethorn-footer { max-width: 1496px; margin-inline: auto; }
.games-page .top-nav.site-nav {
    position: absolute;
    top: 1rem;
    left: max(var(--games-inset), calc((100% - 1496px) / 2));
    right: max(var(--games-inset), calc((100% - 1496px) / 2));
    margin: 0;
}
.games-page .hero-page { margin: 0 calc(-1 * var(--games-inset)) 0.75rem; }
.games-page .hero-showcase-games {
    --games-bottom-fade: clamp(6rem, 12vw, 11rem);
    --games-image-position: right center;
    --games-image-size: auto 100%;
    isolation: isolate;
    display: flex;
    align-items: center;
    min-height: clamp(30rem, 40vw, 37rem);
    padding: 10rem max(calc(var(--games-inset) + 4vw), calc((100% - 1392px) / 2)) 2.5rem;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}
/* Fade only the artwork and its wash, keeping text and controls fully opaque. */
.games-page .hero-showcase-games::before,
.games-page .hero-showcase-games::after {
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - var(--games-bottom-fade)), transparent 100%);
    mask-image: linear-gradient(to bottom, #000 calc(100% - var(--games-bottom-fade)), transparent 100%);
}
.games-page .hero-showcase-games::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background: url('../web-assets/hero-games.webp') var(--games-image-position) / var(--games-image-size) no-repeat, #e9f5df;
}
@media (min-width: 721px) {
    .games-page .hero-showcase-games::after {
        left: auto;
        height: 100%;
        width: auto;
        aspect-ratio: 3 / 2;
        -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%), linear-gradient(#000 calc(100% - var(--games-bottom-fade)), transparent);
        mask-image: linear-gradient(90deg, transparent, #000 22%), linear-gradient(#000 calc(100% - var(--games-bottom-fade)), transparent);
        -webkit-mask-composite: source-in;
        mask-composite: intersect;
    }
}
.games-page .hero-showcase-games::before {
    z-index: -1;
    background: linear-gradient(90deg, #e9f5df 0%, #e9f5dff5 24%, #e9f5dfc4 36%, #e9f5df4d 50%, transparent 64%);
}
.games-page .hero-showcase-games .hero-copy {
    width: 43%;
    max-width: 29rem;
    padding: 0;
    margin: 0;
    align-items: flex-start;
    text-align: left;
    transform: none;
}
.games-page .hero-showcase-games .hero-title {
    margin: 0;
    font-size: clamp(3.75rem, 7.5vw, 7rem);
    line-height: 1.05;
    letter-spacing: -0.035em;
    color: #087f3e;
    background: none;
    text-shadow: 0 2px 0 #ffffffb3;
}
.games-page .hero-showcase-games .hero-subtitle {
    margin: 1rem 0 0;
    max-width: 25ch;
    color: #205b50;
    font-size: clamp(1.1rem, 1.7vw, 1.4rem);
    line-height: 1.5;
}
.games-page .hero-showcase-games .hero-actions { width: auto; margin: 1.5rem 0 0; }
.games-page .hero-showcase-games .hero-actions .hero-primary-cta:nth-child(1) {
    color: #fff;
    background: linear-gradient(180deg, #31ab5b, #087f3e);
    border: 1px solid #ffffffc9;
    box-shadow: 0 4px 10px #205b5030;
}
@media (min-width: 721px) and (max-width: 1180px) {
    .games-page .hero-showcase-games { min-height: 28rem; padding-top: 7rem; }
}
@media (max-width: 720px) {
    .games-page .hero-showcase-games {
        min-height: 0;
        padding: calc(9rem + 58vw) 1.25rem 1.5rem;
        border-radius: 0;
        --games-bottom-fade: 5rem;
        --games-image-position: center 9rem;
        --games-image-size: 100% auto;
    }
    .games-page .hero-showcase-games::before {
        background: linear-gradient(180deg, #e9f5df 0 9rem, transparent 11rem, transparent calc(9rem + 40vw), #e9f5df calc(9rem + 58vw));
    }
    .games-page .hero-showcase-games .hero-copy { width: 100%; max-width: none; }
    .games-page .hero-showcase-games .hero-title { font-size: clamp(3.25rem, 12vw, 4.5rem); }
    .games-page .hero-showcase-games .hero-subtitle { font-size: 1.1rem; margin-top: 0.6rem; }
    .games-page .hero-showcase-games .hero-actions { margin-top: 1rem; }
}


.games-family-panel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; padding: 1.6rem 1.5rem; background: linear-gradient(110deg, #fff5fa, #f5f8ff); }
.games-family-intro, .games-family-point { display: grid; grid-template-columns: 3.3rem minmax(0, 1fr); gap: 0.7rem; align-items: start; min-width: 0; }
.games-family-panel > * + * { padding-left: 1rem; border-left: 1px solid #d9def0; }
.games-family-panel img { width: 100%; height: 5rem; object-fit: contain; }
.games-family-panel h2, .games-family-panel h3 { color: #6523be; font-size: 1.05rem; line-height: 1.3; }
.games-family-panel h2 { color: #c72665; }
.games-family-panel p { margin-top: 0.55rem; color: #283e72; font-size: 0.9rem; line-height: 1.5; }
.games-family-panel a { display: inline-flex; gap: 0.4rem; align-items: center; min-height: 2.75rem; color: #c72665; font-weight: 800; font-size: 0.85rem; text-decoration: none; }
.games-family-panel a:hover { text-decoration: underline; }

.games-family-panel { min-width: 0; border: 1px solid #ffffffdc; border-radius: 1.75rem; box-shadow: 0 5px 18px #335e8b0b; }
.games-family-panel h2, .games-family-panel h3, .games-family-panel p { margin: 0; }
.games-family-panel p { margin-top: 0.55rem; }
.games-family-book-icon { display: block; width: 100%; height: 5rem; background: #7122d2; mask: url('../images/nav-icons/books.png') center / contain no-repeat; -webkit-mask: url('../images/nav-icons/books.png') center / contain no-repeat; }

/* The real game remains the focus, followed by two supporting cards. */
.games-page .games-content { position: relative; isolation: isolate; gap: 1.25rem; padding-bottom: 1.25rem; }
.games-play-panel, .games-how-panel, .games-coming-panel {
    min-width: 0; padding: clamp(1.25rem, 3vw, 2.5rem); border: 1px solid #ffffffdc;
    border-radius: 1.75rem; background: #fffffff2; box-shadow: 0 5px 18px #335e8b0b;
}
.games-page #apple-catcher { scroll-margin-top: 1rem; }
.games-page #apple-catcher .section-head { margin: 0 0 1.5rem; }
.games-page #apple-catcher .section-header { margin: 0; color: #087f3e; font-size: clamp(1.8rem, 3.5vw, 2.8rem); line-height: 1.2; text-shadow: none; }
.games-page #apple-catcher .section-subtitle { margin: 0.65rem 0 0; font-size: 1.05rem; line-height: 1.5; font-weight: 700; }
.games-page .game-frame-wrap { max-width: 920px; padding: 0.6rem; border: 1px solid #e0e8dd; border-radius: 1.5rem; background: #fff; box-shadow: 0 4px 10px #283e7220; backdrop-filter: none; }
.games-page .game-frame { border-radius: 1rem; aspect-ratio: 4 / 3; }
.games-page .content-note { font-size: 0.95rem; line-height: 1.5; margin: 1rem auto 0; }
.games-details { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 1.25rem; }
.games-details h2 { margin: 0; color: #126536; font-size: clamp(1.45rem, 2.5vw, 2rem); line-height: 1.2; text-align: center; }
.games-details > section > p { margin: 0.65rem 0 1rem; color: #205b50; text-align: center; line-height: 1.5; font-weight: 700; }
.games-how-panel h2 { display: flex; align-items: center; justify-content: center; gap: 0.65rem; }
.games-controller-icon { width: 2.5rem; height: 2.5rem; background: #126536; mask: url('../images/nav-icons/games.png') center / contain no-repeat; -webkit-mask: url('../images/nav-icons/games.png') center / contain no-repeat; }
.games-instructions { display: grid; gap: 0.65rem; list-style: none; padding: 0; margin: 1.25rem 0 0; text-align: left; }
.games-instructions li { display: grid; grid-template-columns: 3.7rem minmax(0, 1fr); align-items: center; gap: 1rem; padding: 0.75rem; border: 1px solid #e0e8e0; border-radius: 0.75rem; background: #f7faf7; }
.games-instructions h3 { margin: 0; color: #205b50; font-size: 1rem; }
.games-instructions p { margin: 0.25rem 0 0; color: #283e72; font-size: 0.9rem; line-height: 1.45; }
.games-instructions img { width: 2.8rem; height: 2.8rem; object-fit: contain; justify-self: center; }
.games-key-pair, .games-pause-icon { color: #126536; text-align: center; font-size: 1.8rem; font-weight: 900; white-space: nowrap; }
.games-key-pair { font-size: 1.35rem; }
.games-coming-panel { position: relative; overflow: hidden; background: linear-gradient(#f7fceeea, #f7fcee80), url('../web-assets/games-coming-garden.webp') center / cover; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.games-mystery { position: relative; display: grid; place-items: center; width: 11rem; height: 11rem; margin: 0.5rem auto 0; }
.games-mystery::before { content: ''; position: absolute; inset: 0; background: #48644e; opacity: 0.65; mask: url('../web-assets/home-parents-tumble-v1.webp') center / contain no-repeat; -webkit-mask: url('../web-assets/home-parents-tumble-v1.webp') center / contain no-repeat; }
.games-mystery span { z-index: 1; color: #fff6c9; font-size: 4rem; font-weight: 900; padding-top: 1.5rem; }
.games-sparkle { position: absolute; color: #d7a63c; font-size: 3rem; }
.games-sparkle-one { left: 12%; bottom: 22%; }
.games-sparkle-two { right: 12%; bottom: 38%; }
@media (max-width: 1000px) {
    .games-family-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .games-family-panel > :nth-child(3) { border-left: 0; padding-left: 0; }
    .games-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .games-instructions li { gap: 0.6rem; grid-template-columns: 2.8rem minmax(0, 1fr); }
}
@media (max-width: 720px) {
    .games-details { grid-template-columns: minmax(0, 1fr); }
    .games-coming-panel { min-height: 22rem; }
    .games-page .game-frame-wrap { padding: 0.25rem; border-radius: 1rem; }
    .games-page .game-frame { aspect-ratio: 4 / 4; }
    .games-page .games-play-panel { padding-inline: 0.6rem; }
}
@media (max-width: 480px) {
    .games-family-panel { grid-template-columns: minmax(0, 1fr); }
    .games-family-panel > * + *, .games-family-panel > :nth-child(3) { border-left: 0; padding: 1rem 0 0; border-top: 1px solid #d9def0; }
    .games-family-panel img { height: 4.5rem; }
}

.games-page .games-instructions li h3, .games-page .games-instructions li p { text-align: left; }

/* Native modal expansion preserves the iframe and contains keyboard focus. */
.games-page dialog.game-frame-wrap { position: relative; color: #145b36; }
.game-view-toolbar { display: flex; justify-content: flex-end; padding-bottom: 0.35rem; }
.game-view-toolbar button { min-height: 44px; padding: 0.45rem 0.9rem; border: 1px solid #b6d5bf; border-radius: 999px; color: #145b36; background: #f2faf3; font: 800 0.95rem var(--font-body); cursor: pointer; }
.game-view-toolbar button[hidden] { display: none; }
.game-view-toolbar button:focus-visible { outline: 3px solid #145b36; outline-offset: 2px; }
.games-page dialog.game-frame-wrap:modal { position: fixed; inset: 0; display: flex; flex-direction: column; width: calc(100vw - 1rem); height: calc(100dvh - 1rem); max-width: none; max-height: none; padding: 0.5rem; margin: auto; border-radius: 1rem; background: #eff8ee; }
.game-frame-wrap::backdrop { background: #17392bea; }
.games-page .game-frame-wrap:modal .game-frame { flex: 1; min-height: 0; height: 100%; aspect-ratio: auto; }
.game-view-open { overflow: hidden; }


@media (max-width: 720px) { .games-page .hero-showcase-games::after { background-image: url('../web-assets/responsive/games-hero-960.webp'); } }
