body {
    margin: 0;
    display: grid;
    place-items: center;
    color: #fff;
    background: #353434;
    font-family: system-ui, sans-serif;
    text-align: center;
}

.puzzle-game { width: min(94vw, 520px); }

.puzzle-game h1 {
    width: fit-content;
    margin: 0 auto 6px;
    padding: 7px 22px;
    border-radius: 11px;
    background: #a000a0;
    font-size: clamp(1.7rem, 7vw, 2.5rem);
}

.puzzle-game p { margin: 5px 0 10px; font-weight: 800; }

#board {
    width: min(90vw, 420px);
    aspect-ratio: 1;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    overflow: hidden;
    border: 5px solid #22dce8;
    border-radius: 15px;
    background: #0c67ae;
    box-shadow: 0 15px 40px rgba(0,0,0,.35);
}

.puzzle-piece {
    width: 100%;
    height: 100%;
    padding: 0;
    border: 1px solid #a000a0;
    background: none;
    cursor: pointer;
    touch-action: manipulation;
}

.puzzle-piece img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    pointer-events: none;
}

.puzzle-piece.is-blank { opacity: 0; }

.puzzle-piece:focus-visible {
    z-index: 2;
    outline: 5px solid #fff36a;
    outline-offset: -6px;
}

.puzzle-game h2 { margin: 8px 0 0; }

@media (max-height: 650px) {
    #board { width: min(64vh, 84vw, 370px); }
    .puzzle-game p { display: none; }
}
