html, body { margin: 0; height: 100%; overflow: hidden; background: lightskyblue; user-select: none; }
canvas { display: block; }
#viseur { position: fixed; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px; pointer-events: none; }
#viseur::before, #viseur::after { content: ""; position: absolute; background: white; mix-blend-mode: difference; }
#viseur::before { left: 8px; width: 2px; height: 18px; }
#viseur::after { top: 8px; height: 2px; width: 18px; }
#aide { position: fixed; top: 12px; left: 12px; right: 12px; color: white; font: 600 13px system-ui, sans-serif; text-shadow: 0 1px 3px black; pointer-events: none; }
#info { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); color: white; font: 700 18px system-ui, sans-serif; text-shadow: 0 2px 4px black; pointer-events: none; }
#barre { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 4px; padding: 5px; border-radius: 10px; backdrop-filter: brightness(0.6); }
#barre button { width: 46px; height: 46px; padding: 0; border: 3px solid transparent; border-radius: 6px; background-size: cover; image-rendering: pixelated; cursor: pointer; }
#barre button.choisi { border-color: white; }
#accueil { position: fixed; inset: 0; display: grid; place-items: center; color: white; font-family: system-ui, sans-serif; text-align: center; text-shadow: 0 3px 8px black; pointer-events: none; }
#accueil h1 { margin: 0; font-size: 48px; }
#accueil p { margin: 8px 0 0; font-size: 20px; }
#accueil[hidden] { display: none; }
#barre button, #inventaire .case { position: relative; }
#barre button span, #inventaire .case span { position: absolute; right: 2px; bottom: 0; color: white; font: 700 13px system-ui, sans-serif; text-shadow: 0 1px 3px black, 0 0 3px black; }
#barre button.vide, #inventaire .case.vide { filter: grayscale(1) brightness(0.5); }
#inventaire { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none; padding: 14px; background: #c6c6c6; border: 4px solid; border-color: #fff #555 #555 #fff; box-shadow: 0 0 0 3px #000, 0 10px 30px rgba(0,0,0,0.5); font-family: system-ui, sans-serif; }
#inventaire.ouvert { display: block; }
#inventaire h3 { margin: 0 0 8px; color: #404040; font-size: 16px; }
#inventaire .grille { display: grid; grid-template-columns: repeat(9, 50px); gap: 0; }
#inventaire .rangee { margin-top: 14px; }
#inventaire .case { width: 50px; height: 50px; padding: 0; border: 3px solid; border-color: #373737 #fff #fff #373737; background-color: #8b8b8b; background-size: 36px; background-position: center; background-repeat: no-repeat; image-rendering: pixelated; cursor: pointer; }
#inventaire .case:hover { background-color: #b5b5b5; }
#inventaire .case.choisi { outline: 3px solid #fff; outline-offset: -3px; }
#inventaire .case.vide { filter: grayscale(1) brightness(0.6); }
#craft, #four, #coffre { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none; flex-direction: column; gap: 6px; padding: 12px; border-radius: 12px; background: rgba(20, 20, 30, 0.85); }
#craft.ouvert, #four.ouvert, #coffre.ouvert { display: flex; }
#craft button { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 2px solid #889; border-radius: 8px; background: rgba(255, 255, 255, 0.1); color: white; font: 700 18px system-ui, sans-serif; cursor: pointer; }
#craft button:hover:not(:disabled) { border-color: gold; }
#craft button:disabled { opacity: 0.35; cursor: not-allowed; }
#craft .puce { width: 40px; height: 40px; border-radius: 5px; background-size: cover; image-rendering: pixelated; display: flex; align-items: flex-end; justify-content: flex-end; padding: 0 3px; box-sizing: border-box; font-size: 14px; text-shadow: 0 1px 3px black, 0 0 3px black; }
#vie { position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%); width: 260px; height: 16px; border: 2px solid #222; border-radius: 8px; background: rgba(0, 0, 0, 0.55); overflow: hidden; pointer-events: none; }
#vie-jauge { height: 100%; background: linear-gradient(#ff5a5a, #c01818); transition: width 0.15s; }
#vie-texte { position: absolute; inset: 0; text-align: center; color: white; font: 700 12px/16px system-ui, sans-serif; text-shadow: 0 1px 2px black; }
body.touche canvas { filter: saturate(1.5) sepia(0.6) hue-rotate(-40deg); }
#info { bottom: 100px !important; }
#faim { position: fixed; left: 50%; bottom: 98px; transform: translateX(-50%); width: 260px; height: 16px; border: 2px solid #222; border-radius: 8px; background: rgba(0, 0, 0, 0.55); overflow: hidden; pointer-events: none; }
#faim-jauge { height: 100%; background: linear-gradient(#f0b050, #b86a18); }
#faim-texte { position: absolute; inset: 0; text-align: center; color: white; font: 700 12px/16px system-ui, sans-serif; text-shadow: 0 1px 2px black; }
#inventaire .case em { font: 600 11px system-ui, sans-serif; font-style: normal; color: #202020; word-break: break-word; }
#barre button { background-color: rgba(60, 60, 70, 0.7); }
#barre button em { position: absolute; inset: 2px; font: 600 10px system-ui, sans-serif; font-style: normal; color: white; text-shadow: 0 1px 2px black; word-break: break-word; }
#four { color: white; font-family: system-ui, sans-serif; align-items: center; min-width: 240px; }
#four h3 { margin: 0; }
#four button { padding: 8px 14px; border-radius: 8px; border: 2px solid #889; background: rgba(60,60,80,0.9); color: white; font: 600 14px system-ui, sans-serif; cursor: pointer; }
#four button:disabled { opacity: 0.4; cursor: default; }
#four .cuisson { width: 200px; height: 12px; background: #333; border-radius: 6px; overflow: hidden; }
#four .cuisson i { display: block; height: 100%; background: #f89628; }
#four { background: #c6c6c6; border: 3px solid #fff; border-right-color: #555; border-bottom-color: #555; color: #333; padding: 14px; gap: 10px; }
#four small { max-width: 260px; text-align: center; font-size: 12px; }
#four .ligne-four { display: flex; align-items: center; gap: 14px; }
#four .colonne { display: flex; flex-direction: column; align-items: center; gap: 6px; }
#four .case { width: 56px; height: 56px; background: #8b8b8b; border: 2px solid #373737; border-right-color: #fff; border-bottom-color: #fff; padding: 2px; display: flex; flex-direction: column; justify-content: space-between; align-items: center; color: #fff; font-size: 10px; cursor: pointer; }
#four .case:hover { background: #a0a0a0; }
#four .case small { color: #ddd; margin: auto; max-width: none; }
#four .case em { font-style: normal; font-size: 10px; text-shadow: 1px 1px #000; }
#four .case span { align-self: flex-end; font: 700 14px system-ui, sans-serif; text-shadow: 1px 1px #000; }
#four .sortie { width: 64px; height: 64px; }
#four .flamme { width: 20px; height: 24px; background: #555; clip-path: polygon(50% 0, 100% 70%, 75% 100%, 25% 100%, 0 70%); }
#four .flamme.allumee { background: linear-gradient(#ffd24a, #f06a10); }
#four .cuisson { width: 70px; height: 16px; background: #555; border-radius: 0; border: 2px solid #373737; }

#coffre { color: #333; font-family: system-ui, sans-serif; align-items: center; min-width: 280px; max-width: 420px; background: #c6c6c6; border: 3px solid #fff; border-right-color: #555; border-bottom-color: #555; padding: 14px; gap: 8px; }
#coffre h3 { margin: 0; }
#coffre small { font-size: 12px; text-align: center; }
#coffre .grille-coffre { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; min-height: 40px; }
#coffre button { padding: 6px 10px; border-radius: 8px; border: 2px solid #889; background: rgba(60,60,80,0.9); color: white; font: 600 13px system-ui, sans-serif; cursor: pointer; display: flex; gap: 6px; }
