/* game-kit.css - Shared mobile/full-screen layer for every mini-game page (loaded by includes/game_kit.php).
   Works on the common layout: .main-container > .back-home, .game-header, ...game..., .leaderboard-section */

/* ---- full-screen button ---- */
.gk-fullscreen-btn {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right, 0px));
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    z-index: 2500;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 48px;
    padding: 0 1.1rem;
    border-radius: 50vmax;
    border: 1px solid #00d4ff;
    background: rgba(8, 12, 30, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #00d4ff;
    font: 700 0.85rem 'Inter', system-ui, sans-serif;
    cursor: pointer;
    box-shadow: 0 0 18px rgba(0, 212, 255, 0.4);
    transition: transform 0.2s, background 0.2s;
}

.gk-fullscreen-btn:hover,
.gk-fullscreen-btn:focus-visible {
    background: rgba(0, 212, 255, 0.18);
    transform: translateY(-2px);
}

.gk-fullscreen-btn i {
    font-size: 1.05rem;
}

/* ---- focus (full-screen) mode: only the game, its stats and controls ---- */
.main-container.gk-focus {
    position: fixed;
    inset: 0;
    z-index: 2400;
    width: 100%;
    max-width: none;
    height: 100%;
    margin: 0;
    padding: max(0.6rem, env(safe-area-inset-top, 0px)) 0.8rem calc(5rem + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
    background: radial-gradient(circle at 20% 20%, #0f1428, #060812 70%);
}

.main-container:fullscreen {
    background: radial-gradient(circle at 20% 20%, #0f1428, #060812 70%);
    overflow-y: auto;
}

.main-container.gk-focus > .back-home,
.main-container.gk-focus > .game-header,
.main-container.gk-focus > .leaderboard-section,
.main-container.gk-focus > .champions-section {
    display: none !important;
}

.main-container.gk-focus > * {
    margin-left: auto;
    margin-right: auto;
}

body.gk-focus-on {
    overflow: hidden;
}

body.gk-focus-on .pub-menu-toggle,
body.gk-focus-on .pub-nav,
body.gk-focus-on .pub-footer {
    display: none !important;
}

/* ---- play areas: dragging on the game never scrolls or zooms the page ---- */
.main-container canvas,
.main-container #gameCanvas {
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.main-container .game-area,
.main-container .memory-grid,
.main-container .word-grid,
.main-container .visual-keyboard,
.main-container .controls,
.main-container .color-selector,
.main-container .color-indicator {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* ---- phones ---- */
@media (max-width: 600px) {
    .main-container > .game-header {
        margin-bottom: 0.6rem;
    }

    .main-container > .game-header h1 {
        font-size: clamp(1.5rem, 8vw, 2rem) !important;
        line-height: 1.1;
        margin-bottom: 0.3rem;
    }

    .main-container > .game-header p {
        font-size: 0.85rem !important;
        margin: 0.2rem 0 0;
    }

    .main-container > .back-home {
        margin-left: 3.5rem; /* clear of the round menu button */
    }
}

/* fingers, not mouse pointers: every game button at least 44px tall */
@media (pointer: coarse) {
    .main-container button,
    .main-container .mode-btn,
    .main-container .speed-btn,
    .main-container .difficulty-btn,
    .main-container .category-btn,
    .main-container .control-btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* landscape phones: tighter stats so the play area fits on screen */
@media (max-height: 500px) and (orientation: landscape) {
    .main-container > .game-header p {
        display: none;
    }

    .main-container.gk-focus > .game-stats {
        margin-bottom: 0.4rem;
    }
}
