/* Mise en page : fond sombre pour évoquer l'ambiance du tableau,
   police serif pour le côté manuscrit, cadre en bois autour de la scène. */

body {
    font-family: "Georgia", "Garamond", serif;
    background: radial-gradient(ellipse at top, #2a1f15 0%, #0d0905 100%);
    color: #e6d8b8;
    margin: 0;
    padding: 30px 20px 60px;
    min-height: 100vh;
}

h1 {
    text-align: center;
    margin: 0 0 8px;
    font-size: 2.1rem;
    letter-spacing: 2px;
    color: #d8b06a;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

h2 {
    text-align: center;
    margin: 0 0 30px;
    font-size: 1.05rem;
    font-weight: normal;
    color: #b89d72;
    font-style: italic;
}

h3 {
    color: #d8b06a;
    margin: 0 0 16px;
    font-size: 1.2rem;
    border-bottom: 1px solid #4a3a22;
    padding-bottom: 6px;
}

.layout {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 40px;
    flex-wrap: wrap;
    max-width: 1400px;
    margin: 0 auto;
}

.scene-block {
    flex: 0 1 920px;
    min-width: 320px;
}

.reference-block {
    flex: 0 1 220px;
    min-width: 180px;
}

/* Cadre en bois doré, deux niveaux pour donner du relief */
.frame-outer {
    background: linear-gradient(135deg, #6b3e1f 0%, #8d5d2a 50%, #6b3e1f 100%);
    padding: 18px;
    border-radius: 4px;
    box-shadow:
        0 0 0 2px #2a1a0a,
        0 8px 30px rgba(0, 0, 0, 0.7),
        inset 0 0 20px rgba(0, 0, 0, 0.4);
}

.frame-inner {
    position: relative;
    background: #0a0805;
    padding: 6px;
    border: 2px solid #c9a35b;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8);
}

/* HUD overlay : pile de boutons en haut-droite du canvas.
   Style médiéval cohérent avec le reste de l'UI. */
.hud-buttons {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}
.hud-buttons button {
    background: rgba(20, 14, 8, 0.78);
    color: #d8b06a;
    border: 1px solid #6b3e1f;
    padding: 6px 12px;
    font-family: "Georgia", "Garamond", serif;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border-radius: 3px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    backdrop-filter: blur(2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.hud-buttons button:hover {
    background: rgba(45, 30, 15, 0.92);
    border-color: #c9a35b;
    color: #f0d090;
}
.hud-buttons button:focus-visible {
    outline: 2px solid #c9a35b;
    outline-offset: 2px;
}
#dust-toggle.dust-toggle-off,
#oil-toggle.oil-toggle-off {
    color: #8a7758;
    border-color: #3a2a18;
    background: rgba(15, 10, 6, 0.78);
}

#webGL {
    display: block;
    line-height: 0;
    background: #000;
}

#webGL canvas {
    display: block;
    width: 100%;
    height: auto;
}

.caption {
    text-align: center;
    font-size: 0.85rem;
    color: #9c8862;
    margin: 12px 0 6px;
    font-style: italic;
}

.reference-img {
    width: 100%;
    border: 6px solid #6b3e1f;
    border-radius: 2px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
    display: block;
}

.explanations {
    max-width: 920px;
    margin: 50px auto 0;
    background: rgba(20, 14, 8, 0.7);
    padding: 24px 32px;
    border: 1px solid #4a3a22;
    border-radius: 4px;
    line-height: 1.6;
}

.explanations p {
    margin: 0 0 14px;
    color: #d8c8a8;
    font-size: 0.95rem;
}

.explanations code {
    background: rgba(255, 200, 120, 0.08);
    border: 1px solid rgba(255, 200, 120, 0.18);
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 0.85em;
    color: #f0d090;
    font-family: "Consolas", monospace;
}

.explanations strong { color: #d8b06a; }

/* Conteneur GUI : coin haut-droit du bloc scene */
#gui-container {
    position: relative;
    margin-top: 10px;
}
#gui-container .lil-gui {
    --background-color: rgba(20, 14, 8, 0.92);
    --text-color: #d8c8a8;
    --title-background-color: #4a3a22;
    --title-text-color: #d8b06a;
    --widget-color: #2a1f15;
    --hover-color: #6b3e1f;
    --focus-color: #8d5d2a;
    margin: 0 auto;
    border: 1px solid #4a3a22;
}
