/* Section-specific corrections and pixel-game polish. */
.create-panel { animation-name: panelReveal; }
@keyframes panelReveal {
  from { opacity: 0; transform: scale(.92); filter: blur(7px); }
  to { opacity: 1; transform: scale(1); filter: none; }
}
#world { image-rendering: pixelated; image-rendering: crisp-edges; }
.weaponbar{position:absolute;right:max(18px,env(safe-area-inset-right));top:50%;transform:translateY(-50%);display:grid;gap:7px;pointer-events:auto}.weaponbar button{width:60px;height:60px;color:#b9b9aa;background:#080d0ce8;border:2px solid #554b36;box-shadow:0 3px 8px #000}.weaponbar button b,.weaponbar button small{display:block}.weaponbar button b{font-size:22px}.weaponbar button small{font-size:7px;margin-top:3px}.weaponbar button.active{color:#ffe7a0;border-color:#d0a457;background:#17211d;box-shadow:0 0 14px #c58a3955}.weaponbar button:active{transform:scale(.95)}
@media(max-width:600px){.weaponbar{right:10px}.weaponbar button{width:52px;height:52px}}
.quickbar [data-slot="attack"]{width:72px;height:72px;color:#fff0b2;border-color:#d2a653;background:#251a10ed;font-size:30px}
.skillbar{position:absolute;right:max(18px,env(safe-area-inset-right));bottom:max(102px,calc(env(safe-area-inset-bottom) + 88px));display:flex;gap:7px;pointer-events:auto}.skillbar button{position:relative;width:58px;height:58px;padding:3px;color:#f0dca0;background:#131b18ed;border:2px solid #8b7040;box-shadow:0 3px 8px #000;touch-action:manipulation}.skillbar button b,.skillbar button small,.skillbar button em{display:block}.skillbar button b{font-size:20px}.skillbar button small{font:700 7px Arial}.skillbar button em{position:absolute;inset:0;display:grid;place-items:center;color:#e9d9af;background:#050807db;font:700 9px Arial;font-style:normal}.skillbar button.ready em{display:none}.skillbar button.cooldown{color:#8d958d;border-color:#445049}.skillbar button.guard-active{color:#bff7ff;border-color:#77dbe8;box-shadow:0 0 14px #60d9e866}.skillbar.hidden{display:none}
.skillbar button.cyclone-active{color:#d9fbff;border-color:#82eaf4;box-shadow:0 0 16px #60d9e899,inset 0 0 12px #60d9e855;animation:cyclone-pulse .35s ease-in-out infinite alternate}@keyframes cyclone-pulse{to{filter:brightness(1.35)}}
.skillbar button.skill-unlearned{display:none}
#gold-count{color:#d8ad55!important;margin-top:2px}.dialog .items button.equipped{border-color:#e0bb68;color:#fff0b0;background:#27352c}.dialog .items button small{min-height:10px}
.meter.xp i{width:0;background:#d4a83f;transition:width .25s}
.stats-grid{display:grid;grid-template-columns:max-content 1fr;gap:8px 18px;margin:14px 0;text-align:left}.stats-grid b{color:#a9b8aa;font-size:11px;text-transform:uppercase}.stats-grid span{color:#f0dfb0;font-size:12px;text-align:right;overflow-wrap:anywhere}
.floor-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:5px;max-height:255px;overflow-y:auto;padding:3px}.floor-grid button{min-height:48px;padding:5px}.floor-grid button b{font-size:13px}.floor-grid button small{font-size:8px}.floor-grid button:disabled{opacity:.35;color:#788079;border-color:#303833;cursor:not-allowed}
.dialog.map-dialog{width:min(680px,92vw)}#map-canvas{display:block;width:100%;height:auto;max-height:52vh;background:#101715;border:1px solid #6e664f;image-rendering:pixelated}.map-legend{display:flex;justify-content:center;gap:14px;flex-wrap:wrap;margin-top:8px;color:#cdbd91;font-size:9px}.map-legend span:nth-child(1){color:#fff3a5}.map-legend span:nth-child(2){color:#e0b851}.map-legend span:nth-child(3){color:#e05145}.map-legend span:nth-child(4){color:#78e4dc}
.save-providers{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:10px 0}.save-providers button{min-height:58px}.save-providers button.equipped{border-color:#e0bb68;color:#fff0b0;background:#27352c}.dialog label{display:block;margin:9px 0 4px;color:#b9a26b;font:700 8px Arial;letter-spacing:.12em;text-align:left}.dialog input{box-sizing:border-box;width:100%;min-height:42px;padding:9px 11px;color:#f2e2b4;background:#050908;border:1px solid #506159;border-radius:0;font:16px Arial;outline:none}.dialog input:focus{border-color:#d4ae5e;box-shadow:0 0 0 2px #d4ae5e22}.dialog [data-account-error]{min-height:16px;color:#d98272}
.path-choice{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:20px 0 4px;padding:0;border:0}.path-choice legend{width:100%;margin-bottom:8px;text-align:left;color:#9f8657;font-size:9px;letter-spacing:.2em}.path-choice button{min-width:0;padding:12px 5px;color:#aaa994;border:1px solid #46534d;background:#080d0c;cursor:pointer;touch-action:manipulation}.path-choice button b,.path-choice button span,.path-choice button small{display:block}.path-choice button b{font-size:23px}.path-choice button span{margin:5px 0 3px;color:#ddd0a8;font:700 10px Cinzel,serif;letter-spacing:.08em}.path-choice button small{font:9px sans-serif;color:#76877f}.path-choice button.selected{border-color:#d0a457;color:#ffe7a0;background:#1b2822;box-shadow:0 0 14px #c58a3944}.path-choice button.selected small{color:#b8c7bf}
.dialog h4{margin:13px 0 6px;color:#9f8657;font-size:9px;letter-spacing:.18em;text-align:left}.equipment-slots{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}.equipment-slots button{min-width:0;min-height:82px;padding:7px 3px;color:#7f9188;border:1px solid #35433d;background:#080d0c}.equipment-slots button b,.equipment-slots button span,.equipment-slots button small,.equipment-slots button em{display:block}.equipment-slots button b{font-size:20px}.equipment-slots button span{margin:3px 0;color:#b7aa82;font:700 8px Cinzel,serif;text-transform:uppercase}.equipment-slots button small{color:#65766e;font:8px sans-serif;overflow-wrap:anywhere}.equipment-slots button em{margin-top:4px;color:#d2ad62;font:6px sans-serif;font-style:normal}.equipment-slots button.filled{border-color:#8b7140;background:#17211d}.equipment-slots button:disabled{opacity:.75;cursor:default}.inventory-items{max-height:180px;overflow-y:auto}.empty-inventory{grid-column:1/-1;margin:8px;color:#74827b;font-size:11px}

/* Phone-first HUD: portrait uses two thumb docks; landscape keeps combat on the right. */
@media(max-width:700px) and (orientation:portrait){
  .status{top:max(8px,env(safe-area-inset-top));left:max(8px,env(safe-area-inset-left));min-width:174px;padding:5px 8px 6px 5px}.avatar{width:38px;height:38px}.meter{width:112px}
  .zone{top:max(72px,calc(env(safe-area-inset-top) + 64px));min-width:190px;padding:5px 10px}.zone b{font-size:10px}.zone small{font-size:7px}
  #hint{display:none}#toast{top:max(124px,calc(env(safe-area-inset-top) + 112px));max-width:88vw;text-align:center}
  .weaponbar{left:max(10px,env(safe-area-inset-left));right:auto;top:auto;bottom:max(12px,env(safe-area-inset-bottom));transform:none;display:grid;grid-template-columns:repeat(3,48px);gap:7px}.weaponbar button{width:48px;height:48px;padding:2px}.weaponbar button b{font-size:18px}.weaponbar button small{font-size:6px}
  .quickbar{right:max(10px,env(safe-area-inset-right));bottom:max(12px,env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(3,48px);gap:7px}.quickbar button,.quickbar [data-slot="attack"]{width:48px;height:48px;font-size:21px}.quickbar [data-slot="attack"]{color:#fff0b2;border-color:#d2a653;background:#251a10ed;font-size:25px}
  .skillbar{right:max(10px,env(safe-area-inset-right));bottom:max(122px,calc(env(safe-area-inset-bottom) + 110px));gap:6px}.skillbar button{width:48px;height:48px}.skillbar button b{font-size:17px}.skillbar button small{font-size:6px}
  .dialog,.dialog.map-dialog{bottom:max(124px,calc(env(safe-area-inset-bottom) + 112px));width:94vw;max-height:calc(100dvh - 210px);overflow:auto;padding:13px}.dialog .items{grid-template-columns:repeat(2,1fr)}.equipment-slots{grid-template-columns:repeat(5,minmax(50px,1fr));overflow-x:auto}.equipment-slots button{min-height:75px}#map-canvas{max-height:42dvh}
}
@media(max-height:520px) and (orientation:landscape){
  .status{top:max(6px,env(safe-area-inset-top));left:max(6px,env(safe-area-inset-left));transform:scale(.9);transform-origin:top left}.zone{top:max(6px,env(safe-area-inset-top));padding:5px 12px}
  .weaponbar{right:max(8px,env(safe-area-inset-right));gap:5px}.weaponbar button{width:46px;height:46px}.quickbar{right:max(62px,calc(env(safe-area-inset-right) + 54px));bottom:max(7px,env(safe-area-inset-bottom));gap:6px}.quickbar button,.quickbar [data-slot="attack"]{width:48px;height:48px;font-size:21px}.skillbar{right:max(64px,calc(env(safe-area-inset-right) + 56px));bottom:max(62px,calc(env(safe-area-inset-bottom) + 54px))}.skillbar button{width:46px;height:46px}
  #hint{display:none}.dialog,.dialog.map-dialog{bottom:max(64px,calc(env(safe-area-inset-bottom) + 56px));max-height:calc(100dvh - 82px);overflow:auto}#map-canvas{max-height:38dvh}
}
@media(max-width:370px) and (orientation:portrait){.weaponbar{grid-template-columns:repeat(3,43px)}.weaponbar button{width:43px;height:43px}.quickbar{grid-template-columns:repeat(3,43px)}.quickbar button,.quickbar [data-slot="attack"]{width:43px;height:43px}.dialog{bottom:max(112px,calc(env(safe-area-inset-bottom) + 100px))}}
@media(max-width:520px){.save-providers{grid-template-columns:1fr}.save-providers button{min-height:48px}}
