/* Game landing pages share the directory's palette and framed hero. */
body.arcade-site.games-landing-page.game-home {
    --home-surface: #fff;
    --home-raised: #e5e5e5;
    --home-border: #d5d5d5;
    --home-ink: #252525;
    --home-muted: #585858;
    --home-accent: #505050;
    background: radial-gradient(ellipse at 80% 0, #183f36 0, transparent 45%), #101923;
}
body.arcade-site.games-landing-page.game-home:not(.dark-mode) { background: #f0f0f0; }
body.arcade-site.games-landing-page.game-home.dark-mode {
    --home-surface: #182632;
    --home-raised: #213440;
    --home-border: #40515d;
    --home-ink: #e3eaec;
    --home-muted: #becdd7;
    --home-accent: #c2fa6b;
}
body.games-landing-page .game-home-sections::before,
body.games-landing-page .wordsearch-more-section::before { content: none; }
body.games-landing-page .wordsearch-more-section { margin-top: 32px; padding: 0; }
body.games-landing-page .wordsearch-page-heading { margin: 0; padding: 3px 0; }
body.games-landing-page .wordsearch-toolbar { min-height: 44px; }
body.games-landing-page .wordsearch-toolbar .games-breadcrumbs { display: block; margin: 0; font-size: 13px; }
body.games-landing-page .wordsearch-toolbar .wordsearch-theme-toggle { font-size: 14px; margin-inline-start: 0; }
body.games-landing-page .wordsearch-header .wordsearch-masthead {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    overflow: hidden;
    padding: 28px;
    border: 1px solid #3c6355;
    border-radius: 16px;
    background: linear-gradient(115deg, #1c302e, #15252c 70%);
    box-shadow: 0 16px 40px #0003;
}
body.games-landing-page:not(.dark-mode) .wordsearch-header .wordsearch-masthead {
    background: #e8e8e8;
    border-color: #d2d2d2;
    box-shadow: 0 4px 16px #00000006;
}
body.games-landing-page .games-hero-copy .games-brand { flex-wrap: nowrap; }
body.games-landing-page .wordsearch-masthead h1 {
    margin: 16px 0 12px;
    color: #e3eaec;
    font-size: clamp(28px, 3vw, 35px);
    font-weight: 900;
    line-height: 1.22;
    letter-spacing: -1px;
    text-wrap: balance;
}
body.games-landing-page:not(.dark-mode) .wordsearch-masthead h1 { color: #252525; }
body.games-landing-page .wordsearch-masthead .games-intro { max-width: 560px; font-size: 15px; line-height: 1.5; color: #d0dce0; }
body.games-landing-page .wordsearch-masthead .games-hero-note { font-size: 12px; line-height: 1.6; color: #afc3bf; }
body.games-landing-page:not(.dark-mode) .wordsearch-masthead .games-intro { color: #505050; }
body.games-landing-page:not(.dark-mode) .wordsearch-masthead .games-hero-note { color: #666; }
body.games-landing-page .game-home-sections .games-section-heading { margin: 24px 0 16px; }
body.games-landing-page .game-home-sections .games-section-heading h2 { font-size: clamp(22px, 2.3vw, 28px); font-weight: 700; line-height: 1.3; letter-spacing: normal; overflow-wrap: normal; }
body.games-landing-page .games-eyebrow { font-size: 10px; letter-spacing: 2px; font-weight: 700; }
body.games-landing-page .wordsearch-difficulties .games-card { background: #fff; border-color: #d4dfd6; border-radius: 16px; box-shadow: 0 3px 0 #dce5dc, 0 8px 20px #253d2d06; }
body.games-landing-page.dark-mode .wordsearch-difficulties .games-card { background: #e1e7e9; border-color: #c5d1d4; box-shadow: 0 6px 0 #070e16; }
body.games-landing-page .wordsearch-difficulties .games-card h3,
body.games-landing-page.dark-mode .wordsearch-difficulties .games-card h3 { color: #162332; font-weight: 700; }
body.games-landing-page .wordsearch-difficulties .games-card p,
body.games-landing-page.dark-mode .wordsearch-difficulties .games-card p { color: #455465; }
body.games-landing-page.dark-mode .anagrams-card-art .anagrams-letter-tiles > span {
    background: hsl(var(--card-hue), 36%, 83%);
    border-color: hsl(var(--card-hue), 28%, 67%);
    color: hsl(var(--card-hue), 35%, 23%);
    box-shadow: 0 3px 0 hsl(var(--card-hue), 24%, 59%);
}
body.games-landing-page .wordsearch-difficulties .games-card:hover { border-color: var(--accent); }
body.games-landing-page .wordsearch-difficulties .games-card-action { background: #162332; color: #fff; border-color: #162332; }
body.games-landing-page .wordsearch-difficulties .games-card:hover .games-card-action { background: var(--accent); border-color: var(--accent); }
body.games-landing-page .wordsearch-size-panel { margin-top: 28px; border: 1px solid var(--home-border); border-radius: 14px; }
body.games-landing-page .wordsearch-steps { gap: 24px; }

/* Hero and directory cards render the same artwork at a 2:1 ratio. */
.game-hub-art {
    --accent: #c2fa6b;
    --accent-ink: #233d10;
    position: relative;
    width: 100%;
    max-width: 360px;
    aspect-ratio: 2 / 1;
    justify-self: center;
    border: 1px solid #cbd1d2;
    border-radius: 16px;
    background: #f1f3f2;
    box-shadow: 0 4px 8px #18262d06, 0 14px 28px #18262d0c;
    transform: rotate(-5deg);
}
.game-hub-art--anagrams { --accent: #c7b9ff; --accent-ink: #382466; }
.game-hub-art--hangman { --accent: #ffcf69; --accent-ink: #573905; }
.game-hub-art--scramble { --accent: #83e0f5; --accent-ink: #103e50; }
.game-hub-art > .games-card-image { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; border-radius: 15px; }
.game-hub-art > .games-card-art { min-height: 0; aspect-ratio: 2 / 1; border-radius: 15px; }
.games-landing-page.dark-mode .game-hub-art { border-color: #46616a; background: #1b2d32; box-shadow: 0 8px 24px #0003; }
.games-landing-page.dark-mode .game-hub-art > :is(.games-card-image, .games-card-art) { filter: brightness(.90); }

/* Let the word grid carry the hero, with the directory's neutral surface. */
:is(.game-hub-art--search, .game-hub-art--scramble, .game-hub-art--anagrams) { width: 88%; max-width: 320px; justify-self: end; margin-inline-end: 12px; box-shadow: 0 3px 12px #18262d08; }
.game-hub-art--search .wordsearch-artwork-background { fill: #f1f3f2; }
.game-hub-art--search circle.wordsearch-artwork-background { display: none; }
.game-hub-art--search .wordsearch-artwork-tile { fill: #fff; stroke: #d6dfda; stroke-width: 1; }
.game-hub-art--search .wordsearch-artwork-tile.is-selected { fill: #567b65; stroke: #567b65; }
.game-hub-art--search .wordsearch-artwork-letter { fill: #344b42; }
.game-hub-art--search .wordsearch-artwork-letter.is-selected { fill: #fff; }
.games-landing-page.dark-mode :is(.game-hub-art--search, .game-hub-art--scramble, .game-hub-art--anagrams) { box-shadow: 0 3px 12px #0002; }
.games-landing-page.dark-mode .game-hub-art--search > .games-card-image { filter: none; }
.dark-mode .game-hub-art--search .wordsearch-artwork-background { fill: #1d3033; }
.dark-mode .game-hub-art--search .wordsearch-artwork-tile { fill: #2c4245; stroke: #49605e; }
.dark-mode .game-hub-art--search .wordsearch-artwork-tile.is-selected { fill: #aac6b5; stroke: #aac6b5; }
.dark-mode .game-hub-art--search .wordsearch-artwork-letter { fill: #dce6e3; }
.dark-mode .game-hub-art--search .wordsearch-artwork-letter.is-selected { fill: #20352a; }
/* Give letter-game heroes playful tiles on a quiet surface. */
:is(.game-hub-art--scramble, .game-hub-art--anagrams) > .games-card-art { background: #f1f3f2; }
:is(.game-hub-art--scramble, .game-hub-art--anagrams) .games-card-art > span {
    --tile-hue: 145;
    box-sizing: border-box;
    min-width: 44px;
    min-height: 54px;
    background: hsl(var(--tile-hue), 38%, 86%);
    color: hsl(var(--tile-hue), 30%, 27%);
    border: 1px solid hsl(var(--tile-hue), 25%, 75%);
    border-radius: 9px;
    box-shadow: 0 4px 0 hsl(var(--tile-hue), 22%, 68%), 0 7px 10px #18262d12, inset 0 1px 0 #ffffffa6;
    font-size: 28px;
    font-weight: 800;
    transform: translateY(3px) rotate(-5deg);
}
:is(.game-hub-art--scramble, .game-hub-art--anagrams) .games-card-art > span:nth-child(4n + 2) { --tile-hue: 42; transform: translateY(-6px) rotate(5deg); }
:is(.game-hub-art--scramble, .game-hub-art--anagrams) .games-card-art > span:nth-child(4n + 3) { --tile-hue: 265; transform: translateY(5px) rotate(-3deg); }
:is(.game-hub-art--scramble, .game-hub-art--anagrams) .games-card-art > span:nth-child(4n) { --tile-hue: 205; transform: translateY(-4px) rotate(4deg); }
.games-landing-page.dark-mode :is(.game-hub-art--scramble, .game-hub-art--anagrams) > .games-card-art { background: #1d3033; filter: none; }
.dark-mode :is(.game-hub-art--scramble, .game-hub-art--anagrams) .games-card-art > span {
    background: hsl(var(--tile-hue), 25%, 72%);
    color: hsl(var(--tile-hue), 30%, 19%);
    border-color: hsl(var(--tile-hue), 20%, 61%);
    box-shadow: 0 4px 0 hsl(var(--tile-hue), 20%, 48%), 0 7px 10px #0002, inset 0 1px 0 #ffffff59;
}
@media (max-width: 850px) {
    body.games-landing-page .wordsearch-header .wordsearch-masthead { gap: 20px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
    body.games-landing-page .games-brand span { display: none; }
}
@media (max-width: 600px) {
    body.games-landing-page .wordsearch-header .wordsearch-masthead { grid-template-columns: minmax(0, 1fr); padding: 24px 22px; border-radius: 12px; }
    body.games-landing-page .wordsearch-masthead h1 { font-size: 30px; }
    body.games-landing-page .wordsearch-toolbar .wordsearch-theme-toggle { font-size: 14px; }
    .game-hub-art { max-width: 300px; margin: 10px auto 12px; transform: rotate(-3deg); }
    :is(.game-hub-art--search, .game-hub-art--scramble, .game-hub-art--anagrams) { max-width: 264px; justify-self: center; margin-inline: auto; }
    body.games-landing-page .games-eyebrow { font-size: 9px; letter-spacing: 1px; }
}

/* Word-search and compact anagram cards share the difficulty palette and decoration. */
.wordsearch-difficulties [data-home-difficulty] {
    --difficulty-art-image: radial-gradient(circle at 100% 0, var(--difficulty-decoration) 0 52px, transparent 53px),
        radial-gradient(circle at 0 100%, var(--difficulty-decoration) 0 38px, transparent 39px);
}
.wordsearch-difficulties [data-home-difficulty="0"] { --difficulty-art-bg: hsl(145, 42%, 85%); --difficulty-decoration: #b8dbc8; }
.wordsearch-difficulties [data-home-difficulty="1"] { --difficulty-art-bg: #cee3f6; --difficulty-decoration: #bbd5ed; }
.wordsearch-difficulties [data-home-difficulty="2"] { --difficulty-art-bg: #e1d3f3; --difficulty-decoration: #d0bde9; }
