/* =============================================================================
   Najeźdźcy / Invaders — game-specific styles (canvas frame, mobile controls).
   Loaded together with games.css via $extraCss. The playfield is deliberately
   dark (classic pixel-arcade look), so the space colours are literals like in
   games-asteroidy.css; chrome uses site design tokens.
   ============================================================================= */

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

#najCanvas {
    display: block;
    width: 100%;
    max-width: 720px;
    background: #0a0e1c;
    border: 1px solid #26304a;
    border-radius: var(--border-radius);
    box-shadow: 0 0 18px rgba(110, 226, 110, 0.16), var(--shadow-sm);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

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

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

.naj-controls {
    max-width: 720px;
    margin: 0.75rem auto 0;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.6rem;
}

.naj-ctl {
    min-height: 64px;
    font-size: 1.7rem;
    line-height: 1;
    border: 1px solid #26304a;
    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;
}

.naj-ctl:active {
    background: #1d2745;
}

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

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

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

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

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

/* Desktop with a keyboard: hide the touch buttons. */
/* 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) {
    .naj-controls {
        display: none;
    }
}

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