/* =============================================================================
   Lądownik / Lander — game-specific styles (canvas frame, flight HUD, mobile
   controls). Loaded together with games.css via $extraCss. The playfield is
   deliberately dark (night-sky vector-arcade look), so the space colours are
   literals like in games-asteroidy.css; chrome uses site design tokens.
   ============================================================================= */

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

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

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

/* ---------------- Flight HUD (fuel bar + speed readouts) ---------------- */

.lad-hud {
    max-width: 720px;
    margin: 0 auto 0.6rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 1.1rem;
    font-size: 0.9rem;
    color: var(--color-gray-700);
}

.lad-hud-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.lad-hud-item strong {
    font-variant-numeric: tabular-nums;
    min-width: 2ch;
    text-align: right;
}

/* Fuel gauge. */
.lad-fuel {
    display: inline-block;
    width: 90px;
    height: 10px;
    border: 1px solid #26304a;
    border-radius: 5px;
    background: #131a30;
    overflow: hidden;
    vertical-align: middle;
}

.lad-fuel-fill {
    display: block;
    height: 100%;
    width: 100%;
    background: #4da3ff;
    border-radius: 4px;
    transition: width 0.15s linear;
}

.lad-fuel-fill--low {
    background: #e05d5d;
}

/* Speed readouts: green when within the safe-landing limits, red otherwise. */
.lad-ok {
    color: #1d9e55;
}

.lad-bad {
    color: #d64545;
}

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

.lad-controls {
    max-width: 720px;
    margin: 0.75rem auto 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
}

.lad-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;
}

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

.lad-ctl--thrust {
    background: #2b1a10;
    border-color: #59331c;
}

.lad-ctl--thrust:active {
    background: #4a2c17;
}

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

.lad-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) {
    .lad-controls {
        display: none;
    }
}

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

    .lad-hud {
        font-size: 0.82rem;
        gap: 0.4rem 0.8rem;
    }

    .lad-fuel {
        width: 64px;
    }
}
