.games-site {
    --game-ink:#172c29;
    --game-muted:#53645e;
    --game-accent:#265848;
    --game-rule:#d9e1da;
    --game-panel:#f7faf6;
    background:#fcfdfa;
    color:var(--game-ink);
}

.games-site [hidden] {
    display:none!important;
}

.games-width {
    width:min(1120px,calc(100% - 40px));
    margin-inline:auto;
}

.games-header {
    border-bottom:1px solid var(--game-rule);
    background:#fff;
}

.games-header nav {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    min-height:66px;
}

.games-brand {
    font-family:var(--serif);
    font-size:clamp(21px,4vw,30px);
    font-weight:800;
    letter-spacing:-.045em;
}

.games-nav-link,.games-back,.game-story-link {
    color:var(--game-accent);
    font-weight:700;
}

.games-nav-link,.games-back {
    display:inline-flex;
    align-items:center;
    min-height:44px;
}

.games-main {
    min-height:65vh;
    padding-block:28px 58px;
}

.games-footer {
    display:flex;
    flex-wrap:wrap;
    gap:12px 24px;
    align-items:center;
    border-top:1px solid var(--game-rule);
    padding-block:22px 34px;
    color:var(--game-muted);
}

.games-footer a:first-child {
    font-family:var(--serif);
    font-weight:800;
    font-size:18px;
    color:var(--game-ink);
    margin-inline-end:auto;
}

.games-hero {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:22px;
    background:#e2eee0;
    border:1px solid #cfdfce;
    border-radius:18px;
    padding:clamp(24px,5vw,56px);
    margin-bottom:24px;
}

.games-hero h1,.game-heading h1 {
    font-family:var(--serif);
    letter-spacing:-.055em;
    line-height:1.02;
    margin:0;
}

.games-hero h1 {
    font-size:clamp(40px,7vw,76px);
}

.games-hero p,.game-heading>p:last-child {
    font-size:clamp(15px,2vw,18px);
    line-height:1.6;
    margin:10px 0 0;
    color:var(--game-muted);
}

.games-hero-grid {
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:5px;
    rotate:-6deg;
}

.games-hero-grid span {
    display:grid;
    place-items:center;
    width:clamp(26px,5vw,56px);
    aspect-ratio:1;
    border:1px solid #91ac98;
    border-radius:8px;
    background:#f7fbf6;
    font-family:var(--serif);
    font-size:clamp(16px,3vw,31px);
    font-weight:800;
}

.games-hero-grid span:empty {
    background:#346451;
}

.games-hero-grid span:nth-child(n+6) {
    background:#f3d8a0;
    border-color:#d7b16b;
}

.games-catalog {
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:16px;
}

.game-card {
    display:flex;
    flex-direction:column;
    overflow:hidden;
    border:1px solid var(--game-rule);
    border-radius:14px;
    background:#fff;
    --card-accent:#dfebe0;
}

.game-card-art {
    --game-icon-size: clamp(55px, 10vw, 84px);
    display:grid;
    place-items:center;
    min-height:100px;
    background:var(--card-accent);
}

.game-card--mini-crossword {
    --card-accent:#dae8db;
}

.game-card--daily-news-quiz {
    --card-accent:#f5dfae;
}

.game-card--word-groups {
    --card-accent:#e6dff0;
}

.game-card--mini-sudoku {
    --card-accent:#dceaf2;
}

.game-card--word-ladder {
    --card-accent:#f0dfd4;
}

.game-card--uganda-map-challenge {
    --card-accent:#d3e6c9;
}

.game-card--photo-puzzle {
    --card-accent:#eddfbe;
}

.game-card--headline-match {
    --card-accent:#ddedeb;
}

.game-card-copy {
    display:flex;
    flex-direction:column;
    flex:1;
    padding:16px;
}

.game-card h2 {
    font-family:var(--serif);
    font-size:clamp(19px,2.4vw,26px);
    line-height:1.13;
    letter-spacing:-.035em;
    margin:4px 0 7px;
}

.game-card-copy>p:not(.eyebrow) {
    line-height:1.55;
    color:var(--game-muted);
    margin:0 0 10px;
}

.game-play-link {
    display:inline-flex;
    align-items:center;
    gap:8px;
    min-height:44px;
    margin-top:auto;
    font-weight:700;
    color:var(--game-accent);
}

.game-heading {
    margin:15px 0 24px;
}

.game-heading h1 {
    font-size:clamp(36px,6vw,62px);
}

.game-board {
    border:1px solid var(--game-rule);
    border-radius:16px;
    background:#fff;
    padding:clamp(14px,3vw,28px);
    max-width:850px;
}

.game-instruction {
    color:var(--game-muted);
    line-height:1.55;
    margin:0 0 18px;
}

.game-controls {
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
    margin-top:16px;
}

.game-controls button,.quiz-choices button {
    min-height:44px;
    border:1px solid var(--game-rule);
    border-radius:8px;
    background:var(--game-panel);
    color:var(--game-ink);
    padding:8px 14px;
    text-align:left;
    cursor:pointer;
    font:inherit;
    font-weight:700;
}

.game-controls button:first-of-type:not(:disabled) {
    background:var(--game-accent);
    color:white;
    border-color:var(--game-accent);
}

.game-controls button:disabled {
    opacity:.55;
    cursor:default;
}

.game-board input,.game-board select {
    font:inherit;
    font-size:16px;
    color:inherit;
}

.game-board input:focus-visible,.game-board select:focus-visible,.game-board canvas:focus-visible {
    outline:2px solid var(--game-accent);
    outline-offset:2px;
}

.game-status {
    margin:16px 0 0;
    font-weight:700;
    color:var(--game-accent);
    line-height:1.55;
}

.game-status:empty {
    display:none;
}

.crossword-layout {
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);
    gap:24px;
}

.crossword-grid,.sudoku-grid {
    display:grid;
    width:min(100%,370px);
    border:2px solid var(--game-ink);
    background:var(--game-ink);
    gap:1px;
}

.crossword-grid {
    grid-template-columns:repeat(5,minmax(0,1fr));
}

.sudoku-grid {
    grid-template-columns:repeat(6,minmax(0,1fr));
}

.crossword-cell {
    position:relative;
    background:#fff;
}

.clue-number {
    position:absolute;
    top:3px;
    left:4px;
    font-size:10px;
    pointer-events:none;
}

.crossword-grid input,.sudoku-grid input {
    width:100%;
    min-width:0;
    aspect-ratio:1;
    padding:0;
    border:0;
    border-radius:0;
    background:#fff;
    text-align:center;
    font-size:clamp(17px,3vw,26px);
    font-weight:750;
}

.crossword-grid input:focus,.sudoku-grid input:focus {
    position:relative;
    outline-offset:-2px;
    background:#e5f1e7;
}

.crossword-clues {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:12px;
}

.crossword-clues h2 {
    font-size:16px;
    margin:0 0 6px;
}

.crossword-clues ol {
    padding-inline-start:24px;
    margin:0;
}

.crossword-clues button {
    background:transparent;
    border:0;
    min-height:36px;
    padding:4px 0;
    text-align:left;
    color:var(--game-ink);
    cursor:pointer;
}

.crossword-clues button:hover {
    text-decoration:underline;
}

.game-question {
    max-width:660px;
}

.game-question h2,.map-prompt {
    font-family:var(--serif);
    font-size:clamp(22px,4vw,32px);
    margin:0 0 14px;
    line-height:1.18;
}

.game-progress,.game-credit {
    color:var(--game-muted);
    font-size:12px;
}

.game-progress {
    margin-top:0;
}

.game-question blockquote {
    margin:0 0 14px;
    padding:12px 16px;
    border-left:3px solid #a0bfa4;
    background:var(--game-panel);
    line-height:1.6;
}

.quiz-choices {
    display:grid;
    gap:8px;
}

.quiz-choices button:disabled {
    cursor:default;
}

.quiz-explanation {
    padding:12px 0;
    line-height:1.55;
}

.quiz-explanation p {
    margin:0 0 4px;
}

.game-board .game-correct {
    background:#e4f4e8;
    color:#164331;
}

.game-board .game-wrong {
    background:#f8ded7;
    color:#7c2921;
}

.word-tiles {
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:6px;
    max-width:650px;
}

.word-tiles button {
    min-height:52px;
    padding:6px 2px;
    background:#f1efe6;
    border:1px solid #e2e0d7;
    border-radius:8px;
    color:var(--game-ink);
    font-weight:750;
    overflow-wrap:anywhere;
    cursor:pointer;
}

.word-tiles button[aria-pressed=true] {
    background:#32584c;
    color:white;
    border-color:#32584c;
}

.solved-groups {
    display:grid;
    gap:6px;
    max-width:650px;
}

.solved-groups:not(:empty) {
    margin-bottom:8px;
}

.solved-group {
    padding:10px;
    border-radius:8px;
    background:#f0e2ab;
    text-align:center;
}

.solved-group strong,.solved-group span {
    display:block;
}

.solved-group--1 {
    background:#d8ebcd;
}

.solved-group--2 {
    background:#d8e9f3;
}

.solved-group--3 {
    background:#e5d9ee;
}

.game-difficulty {
    display:flex;
    align-items:center;
    gap:10px;
    margin-bottom:14px;
    font-weight:700;
}

.game-difficulty select,.headline-pair select,#ladder-word {
    min-height:44px;
    padding:7px 10px;
    border:1px solid #b9c7bc;
    border-radius:7px;
    background:#fff;
}

.sudoku-grid input[readonly] {
    background:#eef3ee;
}

.sudoku-grid input.sudoku-edge-right {
    border-right:2px solid var(--game-ink);
}

.sudoku-grid input.sudoku-edge-bottom {
    border-bottom:2px solid var(--game-ink);
}

.ladder-target {
    margin-top:0;
}

.ladder-target strong {
    font-size:20px;
    letter-spacing:.12em;
}

.ladder-steps {
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    list-style:none;
    padding:0;
}

.ladder-steps li {
    background:#ebf2e9;
    border-radius:6px;
    padding:8px 10px;
    font-weight:800;
    letter-spacing:.12em;
}

#ladder-form label {
    flex-basis:100%;
    font-weight:700;
}

#ladder-word {
    width:115px;
    text-transform:uppercase;
    letter-spacing:.1em;
}

#uganda-map {
    display:block;
    width:min(100%,520px);
    height:auto;
    border:1px solid var(--game-rule);
    border-radius:10px;
    cursor:crosshair;
}

#map-result {
    max-width:560px;
    line-height:1.55;
}

#map-result:empty {
    display:none;
}

.game-credit {
    line-height:1.65;
}

.game-credit a {
    text-decoration:underline;
}

.photo-tiles {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    width:min(100%,420px);
    gap:3px;
}

.photo-tiles button {
    display:block;
    min-width:0;
    aspect-ratio:1;
    padding:0;
    border:0;
    background:#e1e8e2;
    cursor:pointer;
}

.photo-tiles button[aria-pressed=true] {
    outline:4px solid #ffd35c;
    outline-offset:-4px;
    z-index:1;
}

.photo-tiles canvas {
    display:block;
    width:100%;
    height:100%;
    pointer-events:none;
}

.photo-reveal {
    width:min(100%,530px);
    margin:16px 0 0;
}

.photo-reveal img {
    display:block;
    width:100%;
    height:auto;
    border-radius:8px;
}

.photo-reveal figcaption {
    margin-top:6px;
    color:var(--game-muted);
    line-height:1.55;
}

.headline-pairs {
    display:grid;
    gap:12px;
}

.headline-pair {
    padding:14px;
    border:1px solid var(--game-rule);
    border-radius:9px;
}

.headline-pair label,.headline-pair select {
    display:block;
    width:100%;
    line-height:1.55;
}

.headline-pair select {
    margin-top:8px;
}

.match-result:not(:empty) {
    margin-top:8px;
    line-height:1.55;
}

@media(max-width:850px) {
    .games-catalog {
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}

@media(max-width:560px) {
    .games-width {
        width:calc(100% - 24px);
    }
    .games-main {
        padding-top:16px;
    }
    .games-hero {
        grid-template-columns:1fr;
        padding:20px;
    }
    .games-hero-grid {
        display:none;
    }
    .games-catalog {
        gap:10px;
    }
    .game-card-copy {
        padding:11px;
    }
    .game-card-art {
        min-height:68px;
    }
    .crossword-layout {
        grid-template-columns:1fr;
    }
    .crossword-clues {
        margin-top:4px;
    }
    .word-tiles button {
        font-size:12px;
    }
    .game-controls button {
        padding-inline:10px;
    }
}
