* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #111;
    color: white;
}

/* Conteneur principal : prend la taille de la page ou de l'iframe.
   Dans WordPress (plugin), remplacer height par une valeur fixe, ex. 650px */
#quiz3d-app {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 500px;
    overflow: hidden;
    background: #202020;
}

#canvas-container {
    position: absolute;
    inset: 0;
}

#canvas-container canvas {
    display: block;
}

/* Écran de chargement */
#loading {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    font-size: 20px;
    pointer-events: none;
}

/* Interface du quiz */
#quiz-ui {
    position: absolute;
    z-index: 10;
    top: 20px;
    left: 20px;
    width: 360px;
    max-width: calc(100% - 40px);
    padding: 20px;
    background: rgba(0, 0, 0, 0.75);
    border-radius: 15px;
}

#progression {
    font-size: 14px;
    opacity: 0.8;
}

#question {
    font-size: 22px;
    margin: 15px 0;
}

#answers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

#answers button,
#next-button,
#restart-button {
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    background: #f0f0f0;
    color: #111;
}

#answers button:hover:not(:disabled),
#next-button:hover,
#restart-button:hover {
    opacity: 0.8;
}

#answers button:disabled {
    cursor: default;
    opacity: 0.6;
}

#answers button.correct {
    background: #2e9e4f;
    color: white;
    opacity: 1;
}

#answers button.wrong {
    background: #c0392b;
    color: white;
    opacity: 1;
}

#next-button,
#restart-button {
    display: none;
    width: 100%;
    margin-top: 15px;
}

#result {
    margin-top: 15px;
    min-height: 20px;
}

#score {
    margin-top: 15px;
    font-weight: bold;
}

@media (max-width: 600px) {
    #quiz-ui {
        top: 10px;
        left: 10px;
        padding: 14px;
    }

    #question {
        font-size: 18px;
    }
}
