html, body { margin: 0; height: 100%; overflow: hidden; background: #87c6ff; font-family: system-ui, sans-serif; }
canvas { display: block; }
#hud { position: fixed; inset: 12px 12px auto 12px; display: flex; justify-content: space-between; gap: 12px; color: white; font: 700 18px system-ui, sans-serif; text-shadow: 0 2px 4px black; pointer-events: none; }
#aide { font-size: 13px; opacity: 0.85; text-align: right; }
#cross { position: fixed; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; background: white; border: 1px solid black; border-radius: 50%; pointer-events: none; }
#hotbar { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; pointer-events: none; }
.slot { width: 54px; height: 54px; border: 3px solid #333; border-radius: 6px; background: rgba(0,0,0,.4); color: white; font: 700 13px system-ui; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 2px; box-sizing: border-box; text-shadow: 0 1px 2px black; }
.slot.on { border-color: #ffd400; transform: translateY(-6px); }
.slot i { width: 28px; height: 28px; margin-bottom: 2px; border-radius: 3px; }
#message { position: fixed; inset: 0; display: grid; place-items: center; color: white; font: 700 40px system-ui, sans-serif; text-shadow: 0 3px 8px black; pointer-events: none; text-align: center; }
#hurt { position: fixed; inset: 0; background: rgba(255,0,0,.35); opacity: 0; pointer-events: none; transition: opacity .3s; }
#menu { position: fixed; inset: 0; background: linear-gradient(160deg, #1d2b64, #6a3fb5 60%, #f8a23b); display: grid; place-items: center; color: white; text-align: center; }
#menu[hidden], #message[hidden] { display: none; }
#menu h1 { font-size: 52px; margin: 0 0 6px; text-shadow: 0 4px 0 #0006; }
#menu p { margin: 4px 0 18px; opacity: .9; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 520px; margin: 0 auto; }
.modes button { padding: 16px 12px; font: 700 18px system-ui; border: 0; border-radius: 12px; background: white; color: #222; cursor: pointer; }
.modes button small { display: block; font-weight: 400; font-size: 12px; margin-top: 4px; color: #555; }
.modes button:hover { background: #ffd400; }
.modes button:disabled { opacity: .6; cursor: default; background: #ddd; }
#menu .cmd { font-size: 13px; margin-top: 18px; opacity: .85; }
#openShop, #closeShop { padding: 10px 16px; font: 700 15px system-ui; border: 0; border-radius: 10px; background: #ffd400; color: #222; cursor: pointer; }
#shop { position: fixed; inset: 0; background: #000a; display: grid; place-items: center; color: white; z-index: 5; }
#shop[hidden] { display: none; }
.shopBox { background: #26264a; border-radius: 16px; padding: 18px 22px; max-width: 640px; text-align: center; }
.shopBox h2 { margin: 0 0 10px; }
.shopBody { display: flex; gap: 16px; align-items: center; justify-content: center; }
#shopView { width: 220px; height: 280px; background: linear-gradient(#6a3fb5, #f8a23b); border-radius: 12px; }
#shopList { display: flex; flex-direction: column; gap: 6px; }
.skinRow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 10px; background: #3a3a6a; border-radius: 8px; font-size: 14px; }
.skinRow.on { outline: 2px solid #ffd400; }
.skinRow button { padding: 6px 10px; border: 0; border-radius: 6px; background: #ffd400; font: 700 12px system-ui; cursor: pointer; }
.skinRow button:disabled { background: #888; cursor: default; }
#endScreen{position:fixed;inset:0;z-index:30;display:flex;align-items:center;justify-content:center;text-align:center;color:#fff;background:linear-gradient(160deg,#1d2b64,#6a3fb5 60%,#f8a23b)}
#endScreen[hidden]{display:none}
#endScreen h1{font-size:52px;margin:0 0 12px;text-shadow:0 4px 0 rgba(0,0,0,.35)}
#endScreen h1.win{color:#ffd400}
#endScreen p{font-size:22px;margin:0 0 24px}
#endScreen button{background:#ffd400;color:#222;border:0;border-radius:12px;padding:14px 28px;font-size:20px;font-weight:bold;cursor:pointer}
#pauseScreen{position:fixed;inset:0;z-index:25;display:flex;align-items:center;justify-content:center;text-align:center;color:#fff;background:rgba(29,43,100,.82)}
#pauseScreen[hidden]{display:none}
#pauseScreen h1{font-size:52px;margin:0 0 12px;text-shadow:0 4px 0 rgba(0,0,0,.35)}
#pauseScreen p{font-size:22px;margin:0 0 20px}
#pauseScreen button{display:block;margin:12px auto;width:260px;background:#ffd400;color:#222;border:0;border-radius:12px;padding:14px;font-size:20px;font-weight:bold;cursor:pointer}
#pauseScreen button.quit{background:#e8503a;color:#fff}
#pauseScreen .cmd{margin-top:20px;font-size:14px;opacity:.85}
