:root{
    --bg:#0b1020; --fg:#dbe3ff; --accent:#7aa2ff; --good:#6fe2a6; --bad:#ff6b6b;
}
*{box-sizing:border-box}
html,body{height:100%;margin:0;background:var(--bg);color:var(--fg);
    font-family:system-ui,-apple-system,Segoe UI,Roboto,Inter,Ubuntu,Helvetica,Arial,sans-serif}
a{color:inherit;text-decoration:none}

#wrap{position:fixed;inset:0;display:flex;flex-direction:column}
canvas{width:100%;height:100%;display:block}

/* HUD */
header{position:absolute;inset:0 0 auto 0;display:flex;justify-content:space-between;gap:.75rem;
    padding:.75rem 1rem;pointer-events:none}
#hud{display:flex;gap:.5rem;align-items:center}
#btns{display:flex;gap:.5rem;pointer-events:auto}
.pill{background:rgba(255,255,255,.06);backdrop-filter:saturate(1.2) blur(6px);
    border:1px solid rgba(255,255,255,.08);border-radius:12px;padding:.45rem .7rem;font-size:.9rem}
button{cursor:pointer;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.1);
    color:var(--fg);border-radius:12px;padding:.6rem .9rem;font-weight:600}
button:hover{background:rgba(255,255,255,.12)}

/* Overlays */
.overlay{position:absolute;inset:0;display:grid;place-items:center}
.card{background:rgba(8,10,20,.85);border:1px solid rgba(255,255,255,.14);
    padding:1.2rem 1.4rem;border-radius:16px;max-width:min(640px,92vw);
    box-shadow:0 10px 30px rgba(0,0,0,.35)}
h1{margin:.2rem 0 .6rem;font-size:1.5rem}
p{margin:.4rem 0;line-height:1.35}
kbd{background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.18);border-bottom-color:rgba(0,0,0,.3);
    padding:.1rem .35rem;border-radius:6px;font-weight:600}
.row{display:flex;gap:.5rem;flex-wrap:wrap}
.muted{opacity:.8}
.accent{color:var(--accent)}
.good{color:var(--good)}
.bad{color:var(--bad)}

/* Contrôles tactiles — cachés par défaut */
#touchControls{display:none}

@media (pointer: coarse) {
    #touchControls{
        position:fixed;
        right:16px; bottom:16px;
        display:flex; flex-direction:column; gap:12px;
        z-index:30;
    }
    #touchControls .ctrl-btn{
        width:80px; height:80px; border-radius:18px;
        font-size:28px; font-weight:900; line-height:1;
        background:rgba(255,255,255,.08);
        color:#dbe3ff; border:1px solid rgba(255,255,255,.18);
        backdrop-filter:saturate(1.2) blur(6px);
        box-shadow:0 8px 20px rgba(0,0,0,.35);
    }
    #touchControls .ctrl-btn:active{ transform:scale(.98) }
}

/* Par défaut, on montre desktop et on cache mobile */
.only-desktop{display:block}
.only-mobile{display:none}

/* Sur écrans tactiles (mobile), on inverse */
@media (pointer: coarse){
    .only-desktop{display:none}
    .only-mobile{display:block}
}
