body {
    margin: 0;
    min-height: 100vh;
    background-image: url('Images/dhoro.png');
    background-repeat: no-repeat;
    background-position: center top;
    background-size: 100% auto;
    background-attachment: scroll;
}

#bg-menu-toggle {
    padding: 9px 22px;
    border-radius: 8px;
    border: 2px solid #fff;
    background: #222c;
    color: #fff;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px #0007;
    transition: background 0.2s, border-color 0.2s;
    user-select: none;
}

#bg-menu {
    display: none;
    position: absolute;
    top: 100%; /* placé juste en dessous du bouton */
    left: 0;
    margin-top: 5px;
    background: #fff;
    border: 2px solid #222c;
    border-radius: 10px;
    padding: 8px 12px;
    z-index: 30;
    box-shadow: 0 2px 16px #0009;
    min-width: 120px;
    gap: 10px;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.bg-btn {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    border: 2px solid #fff;
    background: #222c;
    box-shadow: 0 2px 8px #0007;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, border-color 0.2s;
}

.bg-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}


#canvacontrol {
    position: absolute;
    top: 0;
    left: 0;
    height: auto;
    width: 100vw;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    z-index: 10;
    /* fond transparent pour ne pas gêner le menu déroulant */
    padding-top: 25px;
    pointer-events: none; /* sauf pour enfants */
}
#buttons,
#rotationSpeedControl {
    pointer-events: auto;
}

#buttons {
    position: relative;
    display: flex;
    gap: 16px;
    margin-left: 30px;
    z-index: 10;
    flex-shrink: 0;
    align-items: flex-start;
    top: 5px;
    /* pas de margin-right ici, flex s'en occupe */
}

.menu-wrapper {
    position: relative;
    display: inline-block; /* pour que le menu se place par rapport au bouton */
}


/* Bouton déroulant et menu */
#model-menu-toggle {
    padding: 9px 22px;
    border-radius: 8px;
    border: 2px solid #fff;
    background: #222c;
    color: #fff;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px #0007;
    transition: background 0.2s, border-color 0.2s;
    user-select: none;
}

#model-menu {
    display: none;
    position: absolute;
    left: 0;
    top: 52px;
    background: #fff;
    border: 2px solid #222c;
    border-radius: 10px;
    padding: 8px 12px;
    z-index: 30;
    box-shadow: 0 2px 16px #0009;
    min-width: 120px;
    gap: 10px;
    flex-direction: row;
    flex-wrap: nowrap;
    white-space: nowrap;
}
#model-menu .model-btn {
    margin: 0 7px 0 0;
}

.model-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #222c;
    box-shadow: 0 2px 8px #0007;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, border-color 0.2s;
    outline: none;
}

.model-btn.active,
.model-btn:hover {
    background: #444e;
    border-color: #ffcc00;
}

.model-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    pointer-events: none;
    user-select: none;
}

#mute-btn {
    position: relative;
    z-index: 20;
    margin-left: auto;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: #222c;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 8px #0007;
    transition: background 0.2s;
}

#mute-btn:hover {
    background: #444e;
}

#rotationSpeedControl {
    /* Met à droite, verticalement aligné avec boutons */
    margin-right: 30px;
    margin-left: 0;
    color: white;
    font-size: 16px;
    user-select: none;
    background: rgba(0,0,0,0.23);
    border-radius: 8px;
    padding: 8px 15px 6px 16px;
    align-self: flex-start;
    min-width: 210px;
    box-shadow: 0 2px 8px #0004;
}

#rotationSpeedControl input[type=range] {
    vertical-align: middle;
    margin-left: 8px;
    width: 120px;
    cursor: pointer;
}

#loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
    text-shadow: 0 0 5px black;
    z-index: 20;
    user-select: none;
}

#credits-section {
    position: absolute;
    top: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 5rem;
    opacity: 1;
    z-index: 5;
    background-color: black;
    padding-top: 10rem;
    padding-bottom: 10rem;
}

#credits-content {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.credits-img {
    width: 350px;
    height: 350px;
    object-fit: cover;
    background: #555;
    border: 3px solid #fff;
    user-select: none;
}

#credits-img {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 50px;
}

#credits-content p {
    color: #fff;
    font-size: 1.5em;
    margin: 0;
    text-shadow: 0 0 8px #000a;
    user-select: none;
}

#credits-name{
    font-weight: bold;
}

.legal-section p {
    text-align: center;
    color: #ccc;
    font-size: 0.95em;
    margin: 10px;
}

/* --- Responsive pour mobile/tablette --- */
@media (max-width: 750px) {
    #canvacontrol {
        flex-direction: column;
        align-items: stretch;
        padding-top: 20px;
        gap: 12px;
    }
    #buttons {
        margin-left: 10px;
        margin-right: 10px;
        justify-content: flex-start;
    }
    #rotationSpeedControl {
        margin: 18px auto 0 auto;
        min-width: 0;
        width: 92vw;
        font-size: 15px;
        padding: 5px 7px 6px 10px;
    }
    #model-menu {
    display: none;
    position: absolute;
    left: 0;
    top: 52px;
    background: #fff;
    border: 2px solid #222c;
    border-radius: 10px;
    padding: 8px 12px;
    z-index: 30;
    box-shadow: 0 2px 16px #0009;
    min-width: 120px;
    gap: 10px;
    flex-direction: row;
    flex-wrap: nowrap;
    white-space: nowrap;

    /* ✅ Ajout pour scroll */
    max-height: 180px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ✅ Scrollbar personnalisée (facultatif, style moderne) */
#model-menu::-webkit-scrollbar {
    width: 6px;
}
#model-menu::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}
#model-menu::-webkit-scrollbar-track {
    background-color: #f5f5f5;
}

}
