body { margin: 0; overflow: hidden; font-family: sans-serif; background: #13202a; }
canvas { display: block; }
#cross { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); color: white; font-size: 28px; text-shadow: 0 0 3px black; pointer-events: none; }
#hud { position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
#hud div, #inventaire .grille div { width: 44px; height: 44px; border: 3px solid #333; display: flex; align-items: flex-end; justify-content: flex-end; padding: 2px 4px; box-sizing: border-box; color: white; font-weight: bold; text-shadow: 0 0 3px black; background-repeat: no-repeat; position: relative; }
#hud div.on, #inventaire .grille div.on { border-color: white; }
#help { position: fixed; top: 8px; left: 8px; right: 8px; color: white; text-shadow: 0 0 3px black; font-size: 14px; pointer-events: none; }
#health { position: fixed; bottom: 70px; left: 50%; transform: translateX(-50%); color: #ff3b3b; font-size: 24px; text-shadow: 0 0 3px black; letter-spacing: 2px; }
#flash { position: fixed; inset: 0; background: red; opacity: 0; pointer-events: none; transition: opacity 0.4s; }
#msg { position: fixed; top: 40%; width: 100%; text-align: center; color: white; font-size: 28px; text-shadow: 0 0 6px black; pointer-events: none; }
#craft { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(20, 20, 30, 0.92); color: white; padding: 20px 28px; border-radius: 10px; display: flex; flex-direction: column; gap: 10px; min-width: 320px; }
#craft[hidden] { display: none; }
#craft h2, #craft p { margin: 0; }
#craft button { padding: 10px; font-size: 16px; cursor: pointer; }
#inventaire { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(20, 20, 30, 0.92); color: white; padding: 20px 28px; border-radius: 10px; display: flex; flex-direction: column; gap: 10px; min-width: 320px; }
#inventaire[hidden] { display: none; }
#inventaire h2, #inventaire p { margin: 0; }
#inventaire .grille { display: grid; grid-template-columns: repeat(9, 48px); gap: 4px; }
#inventaire .grille div { width: 48px; height: 48px; cursor: pointer; background-color: rgba(255, 255, 255, 0.08); }
#inventaire h3 { margin: 0; font-size: 14px; }
#inventaire p { font-size: 13px; max-width: 480px; }
#inventaire .bas { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
#inventaire button { padding: 6px 10px; cursor: pointer; }
#hud div { background-color: rgba(0, 0, 0, 0.4); }
#tenu { position: fixed; width: 44px; height: 44px; pointer-events: none; background-size: 1000% 100%; background-repeat: no-repeat; color: white; font-weight: bold; text-shadow: 0 0 3px black; display: flex; align-items: flex-end; justify-content: flex-end; padding: 2px 4px; box-sizing: border-box; z-index: 5; }
#tenu[hidden] { display: none; }
#inventaire .recettes { display: grid; grid-template-columns: 1fr; gap: 6px; }
#inventaire .recettes button { display: flex; align-items: center; gap: 8px; text-align: left; padding: 6px; background: #2c3140; color: white; border: 2px solid #556; border-radius: 6px; }
#inventaire .recettes button:not(:disabled):hover { border-color: #8f8; }
#inventaire .mats { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
#inventaire .mats > div { display: flex; gap: 4px; }
#inventaire .ico { width: 32px; height: 32px; flex: none; background-color: rgba(255,255,255,0.1); border-radius: 4px; display: flex; align-items: flex-end; justify-content: flex-end; font-size: 11px; font-weight: bold; text-shadow: 0 0 3px black; }
#inventaire .mats .ico { width: 30px; height: 30px; }
#inventaire .ico .manque { color: #ff7777; }
#inventaire .onglets { display: flex; gap: 4px; }
#inventaire .onglets button.on { background: #8f8; color: black; font-weight: bold; }
#inventaire .recettes button:disabled { opacity: 0.4; cursor: default; }
/* Vignette sombre sur les bords, comme dans un vieux film */
body::after { content: ""; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.75) 100%); }
#glue { position: fixed; right: 8px; bottom: 70px; color: #ccc; background: rgba(0,0,0,0.55); padding: 6px 8px; font-size: 13px; border-radius: 6px; pointer-events: none; }
#glue span { opacity: 0.45; margin-right: 4px; }
#glue span.on { opacity: 1; color: #8f8; font-weight: bold; }
#stamina { position: fixed; bottom: 52px; left: 50%; transform: translateX(-50%); width: 200px; height: 8px; background: rgba(0,0,0,0.6); border-radius: 4px; overflow: hidden; }
#staminaBar { height: 100%; width: 100%; }

#inventaire { left: 40%; }
#inventaire .cote { position: absolute; left: 100%; top: 0; margin-left: 12px; width: 240px; max-height: 100%; overflow-y: auto; box-sizing: border-box; background: rgba(20, 20, 30, 0.92); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
#inventaire .onglets { flex-wrap: wrap; }
#inventaire .poubelle { width: 90px; height: 48px; border: 3px dashed #c55; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 13px; cursor: pointer; background: rgba(255, 80, 80, 0.15); }
#inventaire .poubelle:hover { background: rgba(255, 80, 80, 0.4); }
