/* ===== MOBILE GAME HELPERS ===== */

/* Exit Button - Fixed position top-left */
.game-exit-btn {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(220, 38, 38, 0.95);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    transition: transform 0.15s ease, background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.game-exit-btn:hover,
.game-exit-btn:active {
    background: rgba(185, 28, 28, 1);
    transform: scale(1.05);
}

.game-exit-btn svg {
    width: 16px;
    height: 16px;
}

/* Prevent zooming and scrolling during gameplay */
.game-container,
.game-root,
.game-stage,
canvas,
.grid,
.square,
.btn,
button {
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Responsive canvas - scale to fit screen */
canvas {
    max-width: 100%;
    height: auto !important;
}

/* Ensure game containers are responsive */
.game-root,
.game-stage,
.game-container {
    max-width: 100%;
    overflow: hidden;
}

/* Mobile-friendly button sizes */
@media (max-width: 640px) {
    .game-exit-btn {
        padding: 8px 12px;
        font-size: 12px;
        top: 8px;
        left: 8px;
    }

    /* Larger touch targets on mobile */
    .square,
    .btn,
    .col button,
    .cell {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Prevent body scroll when game is active */
body.game-active {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Full-screen game mode */
.game-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9990;
    background: inherit;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}