*{box-sizing:border-box}body{margin:0;background:#111016;color:#e6dfed;font:14px system-ui,sans-serif}header{max-width:1180px;margin:auto;height:70px;display:flex;align-items:center;justify-content:space-between;padding:0 22px}header b{font-size:25px;letter-spacing:5px}header span{margin:0 18px;color:#b9afc2}small{color:#8f849b;border:1px solid #3e3549;padding:4px 8px;border-radius:4px}button{background:#292330;color:#e9dff3;border:1px solid #51465f;border-radius:6px;padding:10px 16px;cursor:pointer}button:hover{background:#40344e}main{max-width:1180px;margin:auto;padding:0 20px}#game{position:relative;background:#09080d;border:1px solid #39303f;border-radius:8px;overflow:hidden;max-width:1080px;margin:auto}canvas{display:block;width:100%;max-height:calc(100dvh - 160px);object-fit:contain;image-rendering:pixelated;outline:none}#top{position:absolute;top:18px;left:20px;right:20px;display:flex;justify-content:space-between;pointer-events:none}#top span{background:#15101cdd;border:1px solid #54475d;padding:8px 14px;border-radius:4px}#inventory{color:#d3addf}#message,#prompt{position:absolute;bottom:64px;left:50%;transform:translateX(-50%);background:#17101feF;padding:10px 18px;border:1px solid #786385;border-radius:5px;text-align:center;pointer-events:none;max-width:90%;width:max-content}#message:empty,#prompt:empty{display:none}#prompt{bottom:18px;color:#e6cfaa}#loading,#end{position:absolute;inset:0;background:#100d17eF;display:grid;place-content:center;text-align:center}#loading[hidden],#end[hidden]{display:none}#end h1{font-size:32px}#end p{line-height:1.9;color:#c0afcb}footer{max-width:1080px;margin:14px auto;display:flex;gap:12px;justify-content:space-between;color:#a69baf;font-size:12px}kbd{border:1px solid #4c4155;border-radius:3px;padding:2px 5px}#mobile{display:none;justify-content:space-between;align-items:center;touch-action:none}.pad{text-align:center}.pad button{width:52px;height:45px;padding:0;margin:3px}#action{width:75px;height:75px;border-radius:50%}@media(pointer:coarse){#mobile{display:flex}canvas{max-height:calc(100dvh - 250px)}footer span:last-child{display:none}}@media(max-width:600px){header{height:58px;padding:0 12px}main{padding:0 8px}header span{margin:0 9px}small{font-size:10px}#top{top:10px;left:10px;right:10px}#top span{font-size:11px;padding:6px 9px}}

#dialogue{max-width:1080px;margin:10px auto 0;min-height:112px;padding:14px 22px 18px;background:linear-gradient(110deg,#211a2b,#141119);border:2px solid #82718f;box-shadow:inset 0 0 0 3px #17121e;position:relative}.speaker{font-size:16px;font-weight:700;color:#e4c6ef;letter-spacing:2px}#dialogue-text{font-size:18px;line-height:1.65;margin:8px 0 0;color:#f1eaf5}canvas{max-height:calc(100dvh - 300px)}footer{font-size:14px;flex-wrap:wrap}@media(pointer:coarse){canvas{max-height:calc(100dvh - 380px)}}@media(max-width:600px){#dialogue{padding:12px 16px;min-height:108px}#dialogue-text{font-size:16px}footer{font-size:12px}}

#top #inventory{display:flex;align-items:center;gap:6px;padding:5px 8px}#top #inventory .lives{padding:0 5px;border:0;background:none;white-space:nowrap}#top #inventory .item-slot{display:block;position:relative;width:48px;height:48px;padding:0;border:1px solid #82718f;background:#231c2d;border-radius:3px}.item-art{display:block;width:100%;height:100%;background-image:url('assets/items.png');background-size:400% 100%;background-repeat:no-repeat;image-rendering:pixelated}.item-count{position:absolute;bottom:0;right:3px;color:#fff;font-size:14px;text-shadow:1px 1px #000}@media(max-width:600px){#top #inventory{gap:3px;padding:3px}#top #inventory .item-slot{width:34px;height:38px}#top #inventory .lives{font-size:12px;padding:0 2px}#top{gap:6px}#top #location{align-self:flex-start;white-space:nowrap}}

/* Muted institutional RPG windows: hard edges, inset frames, no rounded chrome. */
body{background:#0b0e0d;color:#d0d0b9;font-family:'Courier New','Gulim','굴림',monospace}
header{height:54px}header b{font-size:21px;letter-spacing:4px;color:#bcbda8}header span,small{color:#868e81}small,button,kbd,#game,#top span,#prompt,#end button{border-radius:0}
button{background:#202923;border:2px solid #758071;box-shadow:inset 2px 2px #414d41,inset -2px -2px #0b100c;color:#d0d0b9;font-family:inherit}button:hover{background:#303d32}
#game{border:3px solid #515d51;box-shadow:0 0 0 2px #0b100c}
#top span,#prompt{background:#101a14f2;border:2px solid #758071;box-shadow:inset 2px 2px #354637,inset -2px -2px #050b07;color:#c7cbb4}
#dialogue{background:#111b15;border:3px solid #87917d;box-shadow:inset 0 0 0 2px #090f0b,inset 0 0 0 4px #394b3b,0 0 0 2px #080b08;margin-top:8px;min-height:126px;padding:18px 24px;color:#d7d7bf}
.speaker{display:inline-block;color:#d6d5b6;font-size:17px;letter-spacing:3px;border-bottom:2px solid #5b6b54;padding-bottom:4px;font-weight:normal}
#dialogue-text{color:#d6d7c2;font-family:'Gulim','굴림','Courier New',monospace;font-size:18px;line-height:1.7;text-shadow:1px 2px #020603;margin-top:10px}
#top #inventory{background:#101a14f2}#top #inventory .item-slot{border-radius:0;background:#19251b;border:2px solid #68765f;box-shadow:inset 1px 1px #090e0a}#top #inventory .lives{color:#b69284}footer{color:#8b9582}kbd{border-color:#56644f}#prompt{color:#d1c49b}#end{background:#0c150ff5}#end p{color:#a9b59c}
@media(max-width:600px){#dialogue{padding:15px 18px;min-height:116px}#dialogue-text{font-size:16px}.speaker{font-size:16px}}

#wheel-status{position:absolute;top:80px;right:20px;padding:6px 12px;background:#101a14ee;border:2px solid #87917d;color:#d9d2a9;font-size:16px}#wheel-status[hidden]{display:none}@media(max-width:600px){#wheel-status{top:62px;right:10px;font-size:14px}}

/* Status belongs to its own row above the map. */
#top{position:relative;inset:auto;max-width:1080px;margin:0 auto 8px;min-height:58px;display:flex;align-items:center;justify-content:flex-start;gap:10px;flex-wrap:wrap;pointer-events:auto;background:#101a14;border:2px solid #758071;padding:6px 10px;box-shadow:inset 2px 2px #354637,inset -2px -2px #050b07}
#top #location{border:0;box-shadow:none;background:none;padding:6px 8px;font-size:16px;white-space:nowrap}
#top #inventory{margin-left:auto;border:0;box-shadow:none;background:none;padding:0;flex-wrap:wrap}
#top #wheel-status{position:static;inset:auto;font-size:14px;padding:6px 8px;border:1px solid #68765f;box-shadow:none;white-space:nowrap}
canvas{max-height:calc(100dvh - 360px)}
@media(pointer:coarse){canvas{max-height:calc(100dvh - 440px)}}
@media(max-width:600px){#top{gap:5px;padding:5px 6px;min-height:48px}#top #location{font-size:14px;align-self:center;padding:4px}#top #inventory{margin-left:auto}#top #wheel-status{font-size:14px}}

#gameover{position:absolute;inset:0;display:grid;place-content:center;text-align:center;background:#101510ed;z-index:5}#gameover[hidden]{display:none}#gameover h1{color:#c59585}#repel{font-size:14px;padding:8px}#top #inventory .lives{color:#c18480}

#repel{position:absolute;right:12px;bottom:12px;min-width:88px;min-height:48px;touch-action:manipulation;background:#18251ef2}#repel:disabled{opacity:.45;cursor:default}

.dialogue-head{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:32px}#dialogue #repel{position:static;min-height:44px;padding:8px 12px;font-family:inherit}#repel[hidden]{display:none}

.header-actions{display:flex;gap:8px}@media(max-width:600px){.header-actions{gap:4px}.header-actions button{padding:8px;font-size:12px}}
