* { box-sizing: border-box; }
body { margin: 0; background: #0b1410; color: #e8f0e0; font-family: system-ui, sans-serif; min-height: 100vh; display: flex; justify-content: center; }
#app { width: 100%; max-width: 680px; padding: 12px; }
h1 { color: #9be37a; text-align: center; margin: 8px 0; }
p.story { background: #15241b; padding: 12px; border-radius: 10px; line-height: 1.5; }
button { background: #3f8f3f; color: #fff; border: 0; padding: 10px 16px; border-radius: 8px; font-size: 16px; cursor: pointer; }
button:disabled { background: #333; color: #777; cursor: not-allowed; }
button:hover:not(:disabled) { background: #52b052; }
.levels { display: grid; gap: 8px; margin: 12px 0; }
.lvl { display: flex; justify-content: space-between; align-items: center; background: #1b2e22; padding: 10px 14px; border-radius: 10px; }
.lvl.done { border-left: 5px solid #9be37a; }
.lvl small { color: #9ab; display: block; }
.map { display: grid; grid-template-columns: 1fr 1fr; width: 200px; height: 200px; margin: 8px auto; gap: 3px; background: #000; padding: 3px; border-radius: 8px; }
.piece { background: #222; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #555; border-radius: 4px; }
.piece.got { color: #fff; }
.center { text-align: center; }
#hud { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; }
#hud button { padding: 4px 10px; font-size: 13px; background: #8a3030; }
#stage { position: relative; }
canvas { width: 100%; background: #000; border-radius: 8px; display: block; touch-action: none; }
#dom:empty { display: none; }
#dom { position: absolute; inset: 40px 0 0 0; background: #15241bf2; border-radius: 8px; padding: 14px; overflow: auto; }
#dom .obj { display: inline-block; margin: 4px; }
#dom input { padding: 8px; font-size: 18px; width: 90px; text-align: center; border-radius: 6px; border: 0; }
.swatch { width: 54px; height: 54px; border-radius: 10px; border: 3px solid #fff3; display: inline-block; margin: 4px; cursor: pointer; }
.msg { min-height: 24px; color: #ffd36b; }
body.manor #dom { background: linear-gradient(#2b1a2e, #1a0f1c); border: 4px solid #5a3a2a; }
[hidden] { display: none !important; }

/* --- Look jeu vidéo : cartes blocs, dégradés, boutons 3D --- */
body { background: radial-gradient(circle at 50% 0%, #1d3a5f 0%, #0d1a2e 60%, #070d18 100%) fixed; font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif; }
#app { max-width: 720px; }
h1 { color: #ffe066; text-shadow: 0 4px 0 #b3541e, 0 8px 18px #0008; letter-spacing: 1px; font-size: 34px; }
p.story { background: linear-gradient(#22406b, #1a3156); border: 2px solid #4f7fc0; border-radius: 14px; box-shadow: 0 6px 0 #0d1a2e; }
button { background: linear-gradient(#5fd35f, #35a335); border-bottom: 4px solid #1f6b1f; font-weight: 700; border-radius: 10px; text-shadow: 0 1px 0 #0006; transition: transform .1s; }
button:hover:not(:disabled) { background: linear-gradient(#78e878, #43b943); transform: translateY(-2px); }
button:active:not(:disabled) { transform: translateY(2px); border-bottom-width: 1px; }
button:disabled { background: #3a4252; border-bottom-color: #232833; }
.lvl { background: linear-gradient(#27456f, #1d3558); border: 2px solid #3d6aa8; border-radius: 14px; box-shadow: 0 5px 0 #0d1a2e; padding: 12px 16px; font-size: 17px; }
.lvl:nth-child(1) { border-color: #5fd35f; } .lvl:nth-child(2) { border-color: #b06cff; } .lvl:nth-child(3) { border-color: #8fd8ff; }
.lvl:nth-child(4) { border-color: #ff8a4c; } .lvl:nth-child(5) { border-color: #ffd23f; }
.lvl.done { border-left: 8px solid #ffe066; }
.map { background: #5a3a1c; border: 4px solid #8a5a2c; box-shadow: 0 6px 0 #2a1a0c; }
.piece { background: #3a2a1c; color: #8a7a6a; border-radius: 3px; }
.piece.got { background: linear-gradient(135deg, #5fd35f, #2f8f3a) !important; text-shadow: 0 1px 2px #000a; }
#hud { background: linear-gradient(#27456f, #1d3558); border: 2px solid #3d6aa8; border-radius: 12px; padding: 6px 12px; margin-bottom: 8px; font-weight: 700; }
#hud-info { color: #ffe066; font-size: 17px; }
#hud button { background: linear-gradient(#e05a5a, #b33030); border-bottom: 3px solid #6b1a1a; }
canvas { border: 4px solid #3d6aa8; border-radius: 12px; box-shadow: 0 8px 24px #0009; }
#dom { inset: 56px 0 0 0; }
body.manor #dom { background: radial-gradient(circle at 50% 20%, #4a2a66, #1a0f2c 70%); border: 4px solid #7a5aa8; box-shadow: inset 0 0 60px #000a, 0 0 30px #7a3aff55; }
.swatch { border-radius: 6px; box-shadow: 0 4px 0 #0006; }
