/* ============================================================
   V19 — SCALABLE ARCADE.
   The game windows grow with the screen instead of stopping
   at their fixed size. The page column on game pages widens
   (but stays clear of the fixed side rails), the stage grows
   with it, and the canvas is backed at display size x DPR
   (js/mm-scale.js) so it stays crisp instead of going soft.
   Game logic still plays in its fixed virtual resolution —
   only the rendering scales, so speeds, sizes, scoring and
   difficulty are exactly as before. Below 1280px nothing
   changes: phones and small laptops play exactly as before.
   ============================================================ */

/* --- Wider page + stage on big screens only --- */
@media (min-width: 1280px) {
    /* Page: up to 1240px, but always 220px narrower than the
       viewport so the fixed side rails (92px a side, 6px in)
       never sit on top of the game. At a 1280px viewport that
       is a 1060px page; at 1600px and up it is the full 1240px. */
    .mm-page.mm-page-wide {
        max-width: min(1240px, calc(100vw - 220px));
    }

    /* Stage + canvas: fill the widened page, up to 1160px of
       game. The old 480/720px caps in v16/v18 are overridden
       here; aspect ratio is kept by height:auto on the canvas. */
    .mm-page-wide .mm-game-stage {
        max-width: 1160px;
    }
    .mm-page-wide .mm-game-stage canvas {
        max-width: none;
    }

    /* Snake is square: cap it lower so it doesn't grow into a
       1160px-tall tower — 780px is still over twice its old size. */
    .mm-page-wide .mm-game-stage-square {
        max-width: 780px;
    }

    /* Whack-a-Mutant: bigger tubes, bigger mutants, same 3x3
       grid, same pop timing and scoring. */
    .mm-page-wide .mm-whack-grid {
        max-width: 900px;
        gap: 16px;
    }
    .mm-page-wide .mm-whack-tube {
        height: 250px;
    }
    .mm-page-wide .mm-whack-tube::after {
        /* The potion at the bottom of the tube */
        height: 48px;
    }
    .mm-page-wide .mm-whack-mutant,
    .mm-page-wide .mm-whack-mutant svg {
        width: 168px;
        height: 168px;
    }
    .mm-page-wide .mm-whack-mutant {
        margin-left: -84px;
        /* Hidden: 168px mutant + 8px from the bottom of a
           250px tube needs 200px down to clear the rim. */
        transform: translateY(200px);
    }
    .mm-page-wide .mm-whack-points {
        font-size: 1.5em;
    }
    .mm-page-wide .mm-whack-tube.whacked .mm-whack-mutant {
        animation: mm-whack-squash-big 0.25s ease-in;
    }
}

@keyframes mm-whack-squash-big {
    0%   { transform: translateY(0) scale(1); }
    50%  { transform: translateY(0) scale(1.25, 0.7); }
    100% { transform: translateY(200px) scale(1); }
}

/* --- Full screen (any viewport) ---
   The whole game page goes full screen, so the score bar stays
   visible; the title and mutant row hide to give the game room.
   The canvas is capped by height too, so a wide-but-short
   screen gets a game that fits instead of one that scrolls. */
.mm-page-wide:fullscreen {
    max-width: none;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background: #000;
    padding: 16px;
}
.mm-page-wide:fullscreen h1,
.mm-page-wide:fullscreen .mm-tube-row {
    display: none;
}
.mm-page-wide:fullscreen .mm-game-stage {
    max-width: none;
}
.mm-page-wide:fullscreen .mm-game-stage canvas {
    max-width: 100%;
    max-height: calc(100vh - 170px);
}
.mm-page-wide:fullscreen .mm-whack-grid {
    max-width: 1100px;
}
