body.games {
    background: #101923;
    background-image: radial-gradient(ellipse at 80% 0, #183f36 0, transparent 45%);
    color: #f4f7fa;
    font-family: Arial, sans-serif;
    font-size: 16px;
}
.games .games-content {
    width: min(1200px, 92%);
    box-sizing: border-box;
    padding: 16px 0 32px;
    background: transparent;
}

.games-hero {
    position: relative;
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    align-items: center;
    gap: 24px;
    overflow: hidden;
    padding: 20px 24px;
    border: 1px solid #3c6355;
    border-radius: 16px;
    background: linear-gradient(115deg, #1c302e, #15252c 70%);
    box-shadow: 0 16px 40px #0003;
}
.games-brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font-weight: 900; font-size: 19px; letter-spacing: 1px; }
/* Inline artwork keeps the baseline used by the standalone SVG asset. */
.wordsearch-artwork text { dominant-baseline: alphabetic; }
.games-brand img { display: block; flex: 0 0 32px; width: 32px; height: 32px; }
.games-brand span { border-left: 1px solid #657970; padding-left: 12px; color: #bded78; font-size: 10px; letter-spacing: 1px; }
.games .games-content h1 { margin: 16px 0 12px; color: #fff; text-align: left; font-size: clamp(28px, 3vw, 35px); line-height: 1.06; letter-spacing: -1px; font-weight: 900; }
.games-content h1 span { color: #c2fa6b; }
.games-intro { max-width: 560px; color: #d0dce0; font-size: 15px; line-height: 1.5; margin: 0; }
.games-hero-button { display: inline-flex; gap: 28px; align-items: center; padding: 16px 22px; border-radius: 10px; color: #15230f; background: #c2fa6b; box-shadow: 0 4px 0 #7aa930; font-weight: 800; text-decoration: none; }
.games-hero-button:hover { background: #d5ff98; }
.games-hero-note { margin: 12px 0 0; color: #afc3bf; font-size: 12px; line-height: 1.6; }
/* Equal block padding keeps both captions equally inset from the frame. */
.games-hero-art { position: relative; padding: 20px 12px; transform: rotate(-5deg); }
.games-hero-art::before { content: ''; position: absolute; inset: 0; border: 1px solid #4c6c58; border-radius: 16px; background: repeating-linear-gradient(0deg, transparent, transparent 31px, #6dbe7410 32px), repeating-linear-gradient(90deg, transparent, transparent 31px, #6dbe7410 32px); }
.games-art-caption { position: relative; transform: translateY(-8px); display: block; text-align: center; color: #c2fa6b; font-size: 11px; font-weight: bold; letter-spacing: 3px; line-height: 18px; }
.games-letter-row { position: relative; display: flex; justify-content: center; gap: 10px; padding: 12px 0; }
.games-letter-row > span { display: grid; place-items: center; width: 48px; height: 54px; border: 2px solid #e9ffc7; border-radius: 13px; background: #c2fa6b; color: #172a19; box-shadow: 0 7px 0 #678e37, 0 16px 25px #0004; font-weight: 900; font-size: 32px; }
.games-letter-row > span:nth-child(2) { transform: translateY(-12px) rotate(7deg); background: #fff; border-color: #fff; box-shadow: 0 7px 0 #92a0a3, 0 16px 25px #0004; }
.games-letter-row > span:nth-child(4) { transform: translateY(8px) rotate(6deg); }
.games-art-bottom { position: relative; transform: translateY(8px); display: flex; align-items: center; justify-content: space-around; color: #c6d6cd; font-size: 12px; line-height: 18px; }
.games-art-bottom b { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #c2fa6b; font-size: 28px; line-height: 1; }
.games-section-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin: 24px 0 16px; scroll-margin-top: 24px; }
.games-eyebrow { color: #c2fa6b; font-size: 10px; letter-spacing: 2px; font-weight: bold; }
.games .games-section-heading h2 { color: #fff; font-size: clamp(22px, 2.3vw, 28px); margin: 6px 0 0; }
.games-section-count { flex-shrink: 0; border: 1px solid #4a5c67; border-radius: 20px; padding: 7px 12px; font-size: 12px; color: #c5d0d9; }
.games-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.games-card {
    --accent: #c2fa6b;
    --accent-ink: #233d10;
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 14px;
    border: 2px solid #e4ebef;
    border-radius: 12px;
    background: #f5f8fa;
    color: #1c2938;
    text-decoration: none;
    box-shadow: 0 6px 0 #070e16;
    transform-origin: center;
    transition: transform .18s ease, border-color .18s ease;
}
.games-card--anagrams { --accent: #c7b9ff; --accent-ink: #382466; }
.games-card--hangman { --accent: #ffcf69; --accent-ink: #573905; }
.games-card--scramble { --accent: #83e0f5; --accent-ink: #103e50; }
/* Fresh mint and jade bring out the found word. */
.games-card--search { --accent: #72d6af; --accent-ink: #164e40; }
.games-card--search .wordsearch-artwork-background { fill: #b5dfca; }
.games-card--search circle.wordsearch-artwork-background { fill: #53b99a; opacity: .4; }
.games-card--search circle.wordsearch-artwork-background:last-of-type { fill: #8cd8c5; opacity: 1; }
.games-card--search .wordsearch-artwork-grid { transform: rotate(-6deg); transform-origin: 180px 90px; }
.games-card--search .wordsearch-artwork-tile { fill: #effbf5; stroke: #246c5540; stroke-width: 1; filter: drop-shadow(0 3px 0 #246c5533); }
.games-card--search .wordsearch-artwork-tile.is-selected { fill: #4dcca3; stroke: #269675; filter: drop-shadow(0 3px 0 #269675); }
.games-card--search .wordsearch-artwork-letter { fill: #23634e; }
.games-card--search .wordsearch-artwork-letter.is-selected { fill: #103f32; }
.games-card:hover { border-color: var(--accent); }
@media (hover: hover) and (pointer: fine) {
    .games-card:hover { transform: scale(1.03); z-index: 1; }
}
.games-card:focus-visible, .games-hero-button:focus-visible, .games-brand:focus-visible { outline: 3px solid #fff; outline-offset: 5px; }
.games-card-image { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; border-radius: 10px; }
/* A one-pixel optical offset balances capitals within the font's line box. */
.games-card-tag { display: inline-flex; align-items: center; justify-content: center; align-self: flex-start; margin-top: 12px; padding: 6px 7px 4px; border-radius: 5px; background: var(--accent); color: var(--accent-ink); font-size: 10px; line-height: 1.5; font-weight: 800; letter-spacing: .7px; }
.games-card h3 { margin: 10px 0 8px; color: #162332; font-size: 22px; line-height: 1.2; }
.games-card p { margin: 0 0 16px; color: #455465; font-size: 14px; line-height: 1.5; }
.games-card-action { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding: 11px 10px; border: 1px solid #162332; border-radius: 8px; background: #162332; color: #fff; font-size: 13px; font-weight: bold; }
.games-card-action > span { color: var(--accent); font-size: 22px; line-height: 1; }
.games-card:hover .games-card-action { background: var(--accent); border-color: var(--accent-ink); color: var(--accent-ink); }
.games-card:hover .games-card-action > span { color: inherit; }
.games-languages { margin-top: 28px; padding: 0; }
.games-languages .games-section-heading { margin-bottom: 16px; }
.games-language-intro { color: #c0cdd7; line-height: 1.5; margin-bottom: 16px; }
.games footer { color: #aebcc9; padding: 24px 0; }
.games footer.page-container { background-color: transparent; }
.games footer a { color: #d1e0ed; }
@media (min-width: 1200px) {
    .games-hero { padding: 20px 24px; }
}
@media (max-width: 850px) {
    .games-hero { padding: 22px; gap: 16px; }
    .games-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .games-letter-row { gap: 7px; }

    .games-letter-row > span { width: 49px; height: 60px; font-size: 34px; }
    .games-art-caption { font-size: 9px; letter-spacing: 1px; }
}
@media (max-width: 600px) {
    .games .games-content { width: 92%; padding-top: 20px; }
    .games-hero { grid-template-columns: minmax(0, 1fr); padding: 26px 22px; border-radius: 12px; }
    .games .games-content h1 { font-size: 30px; margin-top: 16px; }
    .games-hero-art { display: none; }
    .games-letter-row > span { width: 58px; height: 65px; font-size: 36px; }
    .games-art-bottom > span { max-width: none; }
    .games-intro { font-size: 15px; }
    .games-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .games-section-heading { margin-top: 24px; }
    .games-eyebrow { font-size: 9px; letter-spacing: 1px; }
    .games-section-count { font-size: 11px; padding: 6px 9px; }
    .games-card { padding: 14px; }
    .games-card-image { height: 120px; object-fit: contain; background: var(--accent); }
    .games-card h3 { font-size: 22px; }
    .games-languages { margin-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
    .games-card { transition: none; }
    .games-card:hover { transform: none; }
}

/* The directory adapts to the number of published games in each language. */
.games-directory-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), var(--game-card-max, 1fr))); }
.games-directory-grid--compact { --game-card-max: 288px; justify-content: center; }

.games-hero-copy { min-width: 0; }
.games .games-hero-copy h1 { line-height: 1.22; overflow-wrap: break-word; }
.games-directory .games-letter-row { gap: clamp(4px, .7vw, 10px); }
.games-directory .games-letter-row > span { min-width: 0; flex: 0 1 48px; }
.games-directory .games-art-caption, .games-directory .games-art-bottom { letter-spacing: normal; }
.games-directory .games-art-bottom { padding-inline: 0 24px; text-align: center; }
.games-card-art { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; min-height: 150px; padding: 12px; box-sizing: border-box; border-radius: 10px; background: var(--accent); }
.games-card-art > span { display: grid; place-items: center; min-width: 38px; min-height: 46px; padding: 4px; background: #fff; border-radius: 8px; color: var(--accent-ink); font-size: 26px; font-weight: bold; box-shadow: 0 4px 0 #16233230; }
.games-card-art--search > span:nth-child(odd) { background: var(--accent-ink); color: #fff; }
.games-card-art--anagrams > span:nth-child(even) { transform: translateY(-12px) rotate(8deg); }
.games-directory .games-card-tag { max-width: 100%; box-sizing: border-box; line-height: 1.5; }
.games-about { margin-top: 32px; padding-top: 24px; border-top: 1px solid #4a5c67; }
.games-directory .games-about h2 { color: #fff; font-size: 22px; margin: 0 0 12px; }
.games-about p { max-width: 900px; margin: 0; color: #c0cdd7; line-height: 1.7; }
html:is([lang="th"], [lang="hi"], [lang="ja"], [lang="zh"]) .games-directory :is(h1, .games-eyebrow, .games-card-tag, .games-brand) { letter-spacing: normal; line-height: 1.5; }
@media (max-width: 640px) {
    .games-directory-grid { grid-template-columns: minmax(0, 1fr); }
    .games-directory .games-card-art { min-height: 120px; }
    .games-directory .games-section-heading { align-items: center; }
}
