/* =============================================================================
   Stonoga / Bug Blaster — game-specific styles (canvas frame, touch controls).
   Loaded together with games.css via $extraCss. The playfield is deliberately
   dark (classic pixel-arcade garden look), so the board colours are literals
   like in games-najezdzcy.css; chrome uses site design tokens.
   ============================================================================= */

.sto-canvas-wrap {
    max-width: 560px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

#stoCanvas {
    display: block;
    width: 100%;
    max-width: 560px;
    background: #0c1410;
    border: 1px solid #24402e;
    border-radius: var(--border-radius);
    box-shadow: 0 0 18px rgba(143, 227, 168, 0.16), var(--shadow-sm);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

#stoCanvas:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ---------------- On-screen mobile controls ---------------- */

.sto-controls {
    max-width: 560px;
    margin: 0.75rem auto 0;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.6rem;
    align-items: stretch;
}

.sto-drag-note {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    line-height: 1.3;
    color: #9fb8a8;
    border: 1px dashed #24402e;
    border-radius: var(--border-radius);
    background: #10201a;
    user-select: none;
    -webkit-user-select: none;
}

.sto-ctl {
    min-height: 64px;
    min-width: 120px;
    padding: 0 1.2rem;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
    border: 1px solid #24402e;
    border-radius: var(--border-radius);
    background: #131a30;
    color: #e8f0ff;
    cursor: pointer;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.sto-ctl--fire {
    background: #14301a;
    border-color: #2a5c33;
    color: #b3ffc1;
}

.sto-ctl--fire:active {
    background: #1e5729;
}

/* ---------------- Stats modal extra ---------------- */

.sto-best-line {
    margin-top: 0.75rem;
    color: var(--color-gray-700);
}

/* ---------------- Responsive ---------------- */

/* Desktop with a keyboard: hide the touch controls. */
/* Hide touch buttons only on true desktops (fine pointer + hover) — iPads and other
   large touch devices keep them (width alone wrongly hid them on tablets). */
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
    .sto-controls {
        display: none;
    }
}

@media (max-width: 600px) {
    .sto-ctl {
        min-height: 58px;
        min-width: 100px;
        font-size: 1.05rem;
    }

    .sto-drag-note {
        font-size: 0.8rem;
    }
}
