/* ── Metal Jack fullscreen overlay ── */
#metaljack-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 1000;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    outline: none;
}

#game-container canvas {
    display: block;
    max-width:  min(100vw, calc(100vh * 0.75));
    max-height: min(100vh, calc(100vw * 1.3334));
    width:  min(100vw, calc(100vh * 0.75));
    height: min(100vh, calc(100vw * 1.3334));
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* ── Mute button ── */
.mj-mute {
    position: absolute;
    top: 10px;
    right: 12px;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    color: #fff;
    font-size: 18px;
    padding: 5px 9px;
    cursor: pointer;
    z-index: 20;
    touch-action: manipulation;
}

/* ── Exit button ── */
.mj-exit {
    position: absolute;
    top: 10px;
    left: 12px;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.45rem;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.55);
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    padding: 6px 10px;
    text-decoration: none;
    z-index: 20;
    touch-action: manipulation;
}
.mj-exit:hover { color: #FFD700; border-color: #FFD700; }

/* ── Mobile gamepad — hidden on desktop, visible on touch screens ── */
.mj-gamepad {
    display: none;
}

@media (hover: none) and (pointer: coarse) {
    .mj-gamepad {
        display: flex;
        position: absolute;
        bottom: 48px;
        left: 0;
        right: 0;
        padding: 0 48px;
        justify-content: space-between;
        align-items: flex-end;
        pointer-events: none;
        z-index: 30;
    }

    .mj-dpad {
        display: flex;
        gap: 18px;
        pointer-events: auto;
    }

    .mj-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(10, 10, 10, 0.75);
        border: 2px solid rgba(255, 215, 0, 0.6);
        color: rgba(255, 215, 0, 0.9);
        border-radius: 8px;
        font-size: 1.3rem;
        touch-action: none;
        user-select: none;
        -webkit-user-select: none;
        cursor: pointer;
        pointer-events: auto;
        /* No active/hover states — game feedback is on canvas */
        -webkit-tap-highlight-color: transparent;
    }
    .mj-btn:active {
        background: rgba(255, 215, 0, 0.2);
        border-color: #FFD700;
    }

    .mj-dir {
        width: 96px;
        height: 96px;
        font-size: 2rem;
    }

    .mj-jump {
        width: 84px;
        height: 84px;
        font-size: 2rem;
        border-radius: 50%;
        border-color: rgba(229, 57, 53, 0.7);
        color: rgba(229, 57, 53, 0.9);
        pointer-events: auto;
    }
    .mj-jump:active {
        background: rgba(229, 57, 53, 0.25);
        border-color: #E53935;
    }
}
