:root {
    --cyan: #40f2ff;
    --amber: #ff7326;
    --ink: #060a16;
    --muted: #7b88a3;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    background: var(--ink);
    color: #c9d4e8;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-user-select: none;
    user-select: none;
}

#scene { position: fixed; inset: 0; }

#scene canvas { display: block; }

/* Écran d'attente, le temps que les shaders compilent. */
#boot {
    position: fixed;
    inset: 0;
    display: grid;
    place-content: center;
    text-align: center;
    background: radial-gradient(circle at 50% 45%, #1a1030 0%, var(--ink) 70%);
    z-index: 20;
    transition: opacity 0.6s ease;
}

#boot.hidden { opacity: 0; pointer-events: none; }

#boot h1 {
    margin: 0;
    font-size: clamp(2rem, 8vw, 4.5rem);
    font-weight: 300;
    letter-spacing: 0.35em;
    color: var(--cyan);
    text-shadow: 0 0 28px rgba(64, 242, 255, 0.55);
}

#boot p {
    margin: 1rem 0 0;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: var(--muted);
}

/* HUD plat, uniquement pour le mode bureau — dans le casque tout passe en 3D. */
#overlay {
    position: fixed;
    inset: 0;
    z-index: 10;
    pointer-events: none;
}

#hud {
    position: absolute;
    left: 1rem;
    bottom: 1rem;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    align-items: flex-start;
}

.hud-title {
    font-size: 0.8rem;
    letter-spacing: 0.3em;
    color: var(--cyan);
    text-shadow: 0 0 16px rgba(64, 242, 255, 0.5);
}

.hud-hint {
    font-size: 0.72rem;
    line-height: 1.7;
    color: var(--muted);
    background: rgba(6, 10, 22, 0.72);
    border-left: 2px solid var(--cyan);
    padding: 0.5rem 0.8rem;
    border-radius: 0 4px 4px 0;
    max-width: 34rem;
}

.key {
    display: inline-block;
    min-width: 4.2rem;
    color: #c9d4e8;
    font-weight: 600;
}

#xr-slot { pointer-events: auto; }

/* Le bouton de VRButton est injecté par Three : on le ramène dans notre charte. */
#xr-slot button {
    position: static !important;
    left: auto !important;
    bottom: auto !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0.7rem 1.6rem !important;
    background: rgba(64, 242, 255, 0.1) !important;
    border: 1px solid var(--cyan) !important;
    border-radius: 4px !important;
    color: var(--cyan) !important;
    font: inherit !important;
    font-size: 0.78rem !important;
    letter-spacing: 0.2em !important;
    opacity: 1 !important;
    cursor: pointer;
    transition: background 0.2s ease;
}

#xr-slot button:hover { background: rgba(64, 242, 255, 0.22) !important; }

/* Menu de depart, version bureau : taper une graine au clavier vaut mieux que de
   l'epeler au controleur. Dans le casque, c'est le panneau 3D qui prend le relais. */
#desktop-menu {
    position: absolute;
    left: 50%;
    bottom: 12%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 0.9rem;
    background: rgba(6, 10, 22, 0.88);
    border: 1px solid var(--line, rgba(64, 242, 255, 0.28));
    border-radius: 8px;
    pointer-events: auto;
}

#desktop-menu.hidden { display: none; }

#desktop-menu label {
    font-size: 0.68rem;
    letter-spacing: 0.22em;
    color: var(--muted);
}

#desktop-menu input {
    width: 11rem;
    padding: 0.45rem 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(64, 242, 255, 0.35);
    border-radius: 4px;
    color: #c9d4e8;
    font: 600 0.9rem ui-monospace, monospace;
    letter-spacing: 0.08em;
}

#desktop-menu input:focus { outline: 1px solid var(--cyan); }

#desktop-menu button {
    padding: 0.5rem 0.9rem;
    background: rgba(64, 242, 255, 0.08);
    border: 1px solid var(--cyan);
    border-radius: 4px;
    color: var(--cyan);
    font: 0.78rem system-ui, sans-serif;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: background 0.2s ease;
}

#desktop-menu button:hover { background: rgba(64, 242, 255, 0.22); }
#desktop-menu button.primary { font-weight: 600; letter-spacing: 0.14em; }
