@font-face {
    font-family: 'DM Serif Text';
    src: url('/css/fonts/headings.woff2') format('woff2');
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

:root {
    --bg: #f5f6f2;
    --surface: #fff;
    --ink: #17253a;
    --muted: #465368;
    --line: #d8ded6;
    --header: #fff;
    --accent: #343fad;
    --accent-hover: #28328d;
    --button-ink: #fff;
    --focus: #4451d2;
    --link: #354399;
    --shadow: #22385117;
    --heading-font: 'DM Serif Text', Georgia, serif;
    --card-radius: 9px;
    --panel-radius: 16px;
    --button-radius: 7px;
}

h1, h2 { font-weight: 400; }
.puzzle-home { padding-top: clamp(28px, 4.6vw, 62px); }
.puzzle-home h2, .game-detail-layout h2 { font-size: clamp(1.5rem, 2.9vw, 2.55rem); }

.puzzle-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(235px, .42fr);
    align-items: end;
    gap: 14px 44px;
    padding-bottom: clamp(16px, 2.5vw, 28px);
    border-bottom: 2px solid var(--ink);
}
.puzzle-intro h1 { font-size: clamp(2.55rem, 6.5vw, 5.75rem); line-height: .96; }
.puzzle-intro p { color: var(--muted); line-height: 1.55; max-width: 34ch; }

.puzzle-spotlight {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(265px, 1fr);
    gap: clamp(14px, 2vw, 26px);
    margin-top: 18px;
}
.puzzle-feature {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, .92fr);
    gap: clamp(12px, 3vw, 39px);
    align-items: center;
    padding: clamp(20px, 3vw, 42px);
    border-radius: var(--panel-radius);
    background-color: #343fad;
    color: #fff;
}
.feature-copy h2 { font-size: clamp(2.25rem, 4.1vw, 4.15rem); line-height: .94; }
.feature-copy p:not(.feature-kicker) { margin-top: 13px; line-height: 1.5; color: #f1f2ff; }
.feature-kicker { margin-bottom: 12px; color: #fff1a8; font-size: .78rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.feature-button { margin-top: 20px; background: #fae887; border-color: #fae887; color: var(--ink); }
.feature-button:hover { background: #fff3b0; border-color: #fff3b0; }
.feature-button:focus-visible { outline-color: #fff; }
.feature-art {
    display: grid;
    align-items: center;
    padding: clamp(8px, 1.55vw, 21px);
    border-radius: 12px;
    background: #283485;
    background-image:
        linear-gradient(#ffffff13 1px, transparent 1px),
        linear-gradient(90deg, #ffffff13 1px, transparent 1px);
    background-size: 16px 16px;
}
.feature-art img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; border-radius: 7px; background: #242b70; }

.quick-picks { padding: clamp(14px, 1.8vw, 24px); border-radius: var(--panel-radius); background: #e8efe9; }
.quick-picks h2 { margin-bottom: 10px; }
.quick-games .game-card {
    flex-direction: row;
    align-items: center;
    border: 0;
    border-top: 1px solid #c6d3c8;
    border-radius: 0;
    padding-block: 6px;
    background: transparent;
}
.quick-games .game-card:hover { background: #f6faf6; box-shadow: none; }
.quick-games img { width: 42px; aspect-ratio: 1; border-radius: 6px; }
.quick-games .card-caption { padding-block: 5px; }

.discovery, .puzzle-collections { margin-top: clamp(32px, 5vw, 64px); }
.discovery h2, .puzzle-collections > h2 { margin-bottom: 16px; }
.discovery-games, .related-games { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.discovery-games .game-card img { aspect-ratio: 16 / 9; }
.discovery-games .card-caption { font-size: .92rem; }

.puzzle-collections { border-top: 2px solid var(--ink); padding-top: clamp(15px, 2.4vw, 28px); }
.collection-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 2.15vw, 26px); }
.collection-card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--panel-radius); }
.collection-heading {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    padding: 11px clamp(12px, 1.5vw, 20px);
    border-bottom: 1px solid var(--line);
    border-radius: var(--panel-radius) var(--panel-radius) 0 0;
    background: #e9eee9;
}
.collection-card:nth-child(4n + 2) .collection-heading,
.collection-card:nth-child(4n + 3) .collection-heading { background: #eceefe; }
.collection-heading h3 { margin: 0; font-family: var(--heading-font); font-size: clamp(1.2rem, 2vw, 1.65rem); font-weight: 400; line-height: 1.1; }
.collection-games { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 10px; padding: clamp(9px, 1.35vw, 16px); }

.collection-games .game-card, .related-games .game-card, .listing .game-card { flex-direction: row; align-items: center; }
.collection-games img, .related-games img, .listing .game-card img { width: 56px; aspect-ratio: 1; }
.collection-games .card-caption, .related-games .card-caption { padding: 6px 8px; }

.listing .page-heading { background: #e9eee9; border-top: 2px solid var(--ink); padding: clamp(16px, 3vw, 34px); }
.listing .tile-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.listing .game-card img { width: clamp(48px, 5.7vw, 74px); }

.puzzle-detail > .load-status { padding-top: 30px; }
.game-masthead { background: #192642; color: #fff; }
.game-masthead-inner { padding-block: clamp(24px, 4vw, 54px) clamp(38px, 6.4vw, 88px); }
.game-masthead .back-link { color: #e6ecfd; margin-bottom: 16px; }
.game-masthead .back-link:focus-visible { outline-color: #fff; }
.game-masthead h1 { font-size: clamp(2.1rem, 5.5vw, 5.1rem); max-width: 24ch; overflow-wrap: anywhere; }
.game-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(190px, 245px);
    gap: clamp(24px, 3.6vw, 48px) clamp(24px, 4.4vw, 62px);
    align-items: start;
}
.game-launch {
    display: grid;
    justify-items: center;
    grid-column: 2;
    grid-row: 1 / span 2;
    gap: 14px;
    margin-top: -36px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--panel-radius);
    box-shadow: 0 8px 28px var(--shadow);
}
.game-launch .detail-cover { width: min(100%, 156px); }
.game-launch .button { width: 100%; }
.game-overview { grid-column: 1; grid-row: 1; padding-top: clamp(24px, 4vw, 46px); }
.game-overview p { margin-top: 12px; max-width: 70ch; color: var(--muted); line-height: 1.72; overflow-wrap: anywhere; }
.game-related { grid-column: 1; grid-row: 2; border-top: 1px solid var(--line); padding-top: 20px; }
.game-related h2 { margin-bottom: 14px; }
@media (max-width: 1050px) {
    .listing .tile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .related-games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 850px) {
    .puzzle-spotlight { grid-template-columns: minmax(0, 1fr); }
    .puzzle-feature { grid-template-columns: minmax(0, 1.3fr) minmax(0, .9fr); }
    .feature-art { width: 100%; max-width: 280px; justify-self: end; }
    .quick-games { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 15px; }
}
@media (max-width: 650px) {
    .puzzle-intro { grid-template-columns: minmax(0, 1fr); }
    .collection-grid { grid-template-columns: minmax(0, 1fr); }
    .discovery-games, .listing .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .game-detail-layout { display: flex; flex-direction: column; gap: 22px; }
    .game-launch {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        width: 100%;
        margin-top: -22px;
        padding: 12px;
    }
    .game-launch .detail-cover { width: clamp(65px, 22vw, 104px); }
    .game-overview { padding-top: 0; width: 100%; }
    .game-related { width: 100%; }
}
@media (max-width: 420px) {
    .puzzle-feature { padding: 15px; gap: 11px; }
    .feature-copy h2 { font-size: clamp(1.75rem, 7.2vw, 2rem); }
    .feature-copy p:not(.feature-kicker) { font-size: .85rem; }
    .feature-button { padding-inline: 9px; font-size: .8rem; }
    .quick-games { gap: 0 8px; }
    .quick-games img { width: 34px; }
    .collection-games img, .related-games img { width: 43px; }
    .discovery-games .card-caption { font-size: .84rem; }
}

.adx-slot {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    width: min(100%, 336px);
    margin-inline: auto;
    padding-block: 50px;
}

/* Keep the featured section tall enough to separate the homepage ad slots. */
.ad-break-content {
    display: grid;
    min-block-size: max(0px, calc(100vh - 98px));
    min-block-size: max(0px, calc(100lvh - 98px));
}

.adx-slot + main { padding-top: 0; }
.adx-slot + .home-after-ad { margin-top: 0; }
.home-after-ad + .new-collections { margin-top: clamp(24px, 3vw, 44px); }

@media (min-width: 851px) {
    .ad-break-content > div { display: grid; grid-template-rows: auto 1fr; }
    .ad-break-content .quick-picks { display: grid; grid-template-rows: auto 1fr; }
    .ad-break-content .quick-games { display: grid; grid-auto-rows: 1fr; }
}
