.word-game {
    grid-template-columns:minmax(0,1fr) minmax(0,36rem);
    gap:clamp(1rem,4.5vw,4.2rem);
}
.word-game .panel {padding:clamp(.75rem,2.5vw,1.5rem)}
.word-game .modes {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:.25rem;
    width:min(100%,20rem);
    margin:0 auto 1.15rem;
    padding:.25rem;
    border:1px solid var(--line);
    border-radius:.95rem;
    background:var(--bg);
}
.word-game .modes button {border-color:transparent;background:transparent}
.word-game .modes button[aria-pressed=true] {background:var(--brand);color:var(--on)}
.word-game #board {width:min(100%,21.4rem);gap:.4rem}
.word-game .guess {gap:.4rem}
.word-game .tile {
    aspect-ratio:1;
    min-height:0;
    font-size:clamp(1.35rem,4vw,2.05rem);
    line-height:1;
    border-radius:.65rem;
}
.word-game .tile small {right:.27rem;bottom:.21rem;font-size:.71rem}
.word-game #status {
    display:grid;
    place-items:center;
    block-size:2.65rem;
    margin:.25rem 0;
    font-size:.9rem;
    line-height:1.25;
}
.word-game #keyboard {gap:.4rem}
.word-game .keyrow {gap:.32rem}
.word-game .keyrow button {
    max-width:3.25rem;
    min-height:50px;
    border-radius:.65rem;
    font-size:1.05rem;
}
.word-game #submit {margin-top:.4rem;min-height:48px}

@media(max-width:760px) {
    .word-game {grid-template-columns:minmax(0,1fr);width:min(35rem,calc(100% - 1rem));margin-top:1rem}
    .word-game .panel {padding:.65rem}
    .word-game #board {width:min(84%,19rem)}
    .word-game .modes {margin-bottom:.7rem}
    .word-game .keyrow {gap:.2rem}
    .word-game .keyrow button {min-height:44px;font-size:clamp(.78rem,3.75vw,1rem)}
}

/* Keep every row square even when the viewport is resized without a reload. */
.word-game #board {container-type:inline-size}
.word-game .guess {height:calc((100cqi - 1.6rem) / 5)}
.word-game .tile {width:100%;height:100%}
@media(max-width:760px) {
    .word-game {margin-top:.65rem;gap:.65rem}
    .word-game .intro {display:grid;grid-template-columns:1fr auto;align-items:center;column-gap:.5rem}
    .word-game .intro h1,.word-game .intro p,.word-game .intro .legend {grid-column:1/-1}
    .word-game .intro h1 {margin-top:.4rem}
    .word-game .intro p {margin:.22rem 0}
    .word-game .intro .legend {margin:.3rem 0 0}
    .word-game #stats {grid-column:2;grid-row:1;font-size:.85rem}
    .word-game #status {block-size:2.25rem;margin:.15rem 0}
}
