/* ============================================================
 * In-game chrome — game container, status bar, mobile controls.
 * ============================================================ */

#game-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: calc(100vw * 2 / 3);
    max-height: 100vh;
    max-width: calc(100vh * 3 / 2);
}

canvas {
    background-color: black;
    display: block;
}

/* ---------- Top status bar (mute + pause) ---------- */

.status-bar {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    z-index: 10;
}

.status-bar-img {
    width: clamp(24px, 5vw, 40px);
    height: auto;
}

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

.mobile-controls {
    position: fixed;
    bottom: 1vh;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 var(--space-md);
    z-index: 20;
    pointer-events: none;
}

.controls-left,
.controls-center,
.controls-right {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-sm);
    pointer-events: all;
}

.controls-center {
    flex-direction: column;
    gap: 0.2rem;
}

.control-btn {
    background: none;
    border: none;
    padding: 8px;
    height: clamp(50px, 8vh, 60px);
    width: clamp(50px, 8vh, 60px);
    opacity: 0.7;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

#btn-space img,
#btn-d img {
    height: 100%;
    width: auto;
}

.control-btn.pressed {
    opacity: 1;
    transform: scale(0.95);
}

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

@media (max-height: 600px) {
    .mobile-controls {
        bottom: 0.5vh;
        padding: 0 var(--space-sm);
    }

    .controls-left,
    .controls-center,
    .controls-right {
        gap: 0.3rem;
    }

    .control-btn {
        padding: 5px;
        height: clamp(45px, 7vh, 55px);
        width: clamp(45px, 7vh, 55px);
    }
}

/* Show mobile controls only on touch devices. */
@media (hover: none) and (pointer: coarse) {
    .mobile-controls { display: flex; }
}

@media (hover: hover) and (pointer: fine) {
    .mobile-controls { display: none; }
}
