/* Shared layout scaffold for normal-flow game pages.
 *
 * Every game written before this file carries its own copy of the same
 * html/body, .game-container, .content, .title and .home-link rules, forty
 * near-identical blocks that a new game had to remember to reproduce. Games
 * that link this file get the scaffold for free and only write the styles
 * specific to their board.
 *
 * Opt-in on purpose. It is linked between main.css and the game's own
 * style.css, so a game can still override anything here, and the existing
 * fullscreen games (which set `position: fixed` on .game-container and are
 * detected by main.js) are completely unaffected because they never link it.
 *
 * Selectors stay at single-class specificity for the same reason: a game's
 * own style.css loads afterwards and must win ties.
 */

html,
body {
    margin: 0;
    background: linear-gradient(135deg, #FFF9E6 0%, #FFE8B3 100%);
    background-attachment: fixed;
    color: var(--color-text);
    -webkit-tap-highlight-color: transparent;
}

/* Not fixed: these pages scroll, so the board, the controls and the
   .game-about copy all live in one normal document flow. */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    box-sizing: border-box;
    padding: 1.5rem 1rem 4.5rem;
    user-select: none;
    -webkit-user-select: none;
}

.content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 520px;
}

.title {
    font-size: clamp(1.5rem, 5vw, 2rem);
    font-weight: 700;
    margin: 0 0 1rem;
    color: var(--color-text);
}

.best-score {
    margin: 0.75rem 0 0;
    font-weight: 600;
    color: var(--color-text-light);
}

/* Anchored below the game rather than fixed to the viewport, so it cannot
   cover the board on a short screen. main.js still guards it against
   game click handlers via protectFromGameEvents. */
.home-link {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-md);
    background: var(--color-card-bg);
    border: 2px solid var(--color-border);
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
}

.home-link:hover {
    border-color: var(--color-primary-dark);
}

.home-link:focus-visible {
    outline: 3px solid var(--color-text);
    outline-offset: 2px;
}

.share-container {
    margin-top: 0.75rem;
    min-height: 1px;
}

@media (max-width: 400px) {
    .game-container { padding: 1rem 0.5rem 4rem; }
}
