.nv2d-page {
    height: calc(100vh - 175px);
    min-height: 620px;
    margin: -15px;
}

.nv2d-stage {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 620px;
    overflow: hidden;
    padding: 0;
    background: #101711;
    border-radius: var(--radius-lg);
    touch-action: none;
}

#moteur2dCanvas {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 620px;
    background: #151f19;
    border: 0;
    border-radius: var(--radius-lg);
}

.nv2d-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}

.nv2d-actions button {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.92rem;
    line-height: 1;
    background: rgba(24, 24, 24, 0.62);
    color: var(--gold);
    border: 1px solid rgba(245, 211, 122, 0.28);
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(4px);
}

.nv2d-actions button:hover,
.nv2d-actions button:focus-visible {
    background: rgba(124, 98, 54, 0.88);
}

.nv2d-actions button.is-muted {
    opacity: 0.48;
    filter: grayscale(0.6);
}

.nv2d-settings {
    position: absolute;
    top: 52px;
    right: 10px;
    z-index: 7;
    display: grid;
    gap: 8px;
    min-width: 210px;
    padding: 12px;
    color: var(--text);
    background: rgba(0, 0, 0, 0.72);
    border: 1px solid rgba(245, 211, 122, 0.32);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
}

.nv2d-settings h3 {
    margin: 0 0 4px;
    font-size: 1rem;
}

.nv2d-settings label {
    display: flex;
    gap: 8px;
    align-items: center;
    cursor: pointer;
}

.nv2d-mobile-controls {
    position: absolute;
    left: 50%;
    bottom: 18px;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(-50%);
    pointer-events: none;
}

.nv2d-joystick {
    position: relative;
    width: 128px;
    height: 128px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.38);
    border: 1px solid rgba(245, 211, 122, 0.28);
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.4);
    touch-action: none;
    pointer-events: auto;
}

.nv2d-joystick-knob {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 52px;
    height: 52px;
    margin-left: -26px;
    margin-top: -26px;
    border-radius: 50%;
    background: rgba(245, 211, 122, 0.9);
    border: 2px solid rgba(0, 0, 0, 0.65);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
    transition: transform 0.08s ease-out;
}

.hidden {
    display: none !important;
}

@media (max-width: 900px) {
    .nv2d-page {
        height: calc(100vh - 110px);
        min-height: 560px;
    }

    .nv2d-stage,
    #moteur2dCanvas {
        min-height: 560px;
    }

    .nv2d-settings {
        top: 50px;
    }
}

@media (max-width: 560px) {
    .nv2d-page {
        margin: -15px;
        height: calc(100vh - 86px);
        min-height: 520px;
    }

    .nv2d-stage,
    #moteur2dCanvas {
        min-height: 520px;
    }

    .nv2d-actions {
        top: 8px;
        right: 8px;
        gap: 4px;
    }

    .nv2d-actions button {
        width: 30px;
        height: 30px;
        min-width: 30px;
        font-size: 0.84rem;
        border-radius: 9px;
    }

    .nv2d-mobile-controls {
        bottom: 12px;
    }

    .nv2d-joystick {
        width: 116px;
        height: 116px;
    }

    .nv2d-joystick-knob {
        width: 46px;
        height: 46px;
        margin-left: -23px;
        margin-top: -23px;
    }
}