:root{font-family:Inter,ui-rounded,system-ui,-apple-system,sans-serif;color:#edfaff;background:#08182d}*{box-sizing:border-box}body{margin:0;overflow:hidden}main,#world-canvas{display:block;width:100vw;height:100vh}header{position:fixed;z-index:3;inset:0 0 auto;height:76px;display:flex;align-items:center;gap:22px;padding:18px 30px;background:linear-gradient(#07172de8,transparent);pointer-events:none}.brand{pointer-events:auto;text-decoration:none;color:white;font-size:1.3rem;font-weight:900;letter-spacing:-.06em}.brand b{color:#42e0c8}header strong{border-left:1px solid #a8d7e05b;padding-left:20px;font-size:.82rem;letter-spacing:.02em}header button{pointer-events:auto;margin-left:auto;background:#0b2947d9;color:#dffcff;border:1px solid #73d9d081;border-radius:8px;padding:8px 10px;font-weight:900;cursor:pointer}#loading{position:fixed;z-index:10;inset:0;display:grid;place-items:center;background:#07172d;color:#dffcff;font-weight:800;transition:opacity .3s}#hud{position:fixed;z-index:2;left:28px;bottom:26px;display:flex;align-items:center;gap:11px;background:#0a2039df;border:1px solid #9cd1df48;border-radius:12px;padding:10px 13px;box-shadow:0 12px 32px #00101b77;backdrop-filter:blur(10px)}#instruction{margin:0;color:#c6dfec;font-size:.78rem}#reset{border:1px solid #78cdd17a;border-radius:7px;background:#123651;color:#dffcff;font-size:.72rem;font-weight:800;padding:7px 8px;cursor:pointer}#near-card{position:fixed;z-index:3;top:104px;left:30px;width:310px;padding:21px;border:1px solid #a5dbe18c;border-radius:18px;background:#0b223de8;box-shadow:0 18px 48px #00101c8a;backdrop-filter:blur(12px)}#near-card p{margin:0 0 8px;color:#54e1ca;font-size:.66rem;letter-spacing:.14em;font-weight:900;text-transform:uppercase}#near-card h1{margin:0 0 7px;font-size:1.5rem;letter-spacing:-.04em}#near-card span{font-size:.85rem;line-height:1.45;color:#c6deea;display:block}#near-card b{display:block;margin-top:15px;color:#5ce7d0;font-size:.8rem}kbd{padding:4px 6px;border-radius:5px;background:#ecfbff;color:#08263c;font:900 .75rem inherit}#far-prompt{position:fixed;z-index:2;top:105px;left:30px;padding:13px 15px;max-width:290px;border:1px solid #9cd1df47;border-radius:11px;background:#0a2039cc;color:#c4dfeb;font-size:.78rem;line-height:1.4}footer{position:fixed;z-index:2;right:29px;bottom:27px;display:flex;gap:14px;align-items:center;color:#c5dfe9;font-size:.74rem}footer i{display:inline-block;width:8px;height:8px;border-radius:50%;background:#42e0c8}footer i.gold{background:#ffcf58}#mobile-interact{display:none;background:#42e0c8;color:#05243a;border:0;border-radius:9px;padding:12px 15px;font-weight:900}@media(max-width:680px){header{height:60px;padding:14px 17px}header strong{display:none}#hud{left:14px;bottom:14px;right:14px;justify-content:space-between}#instruction{font-size:.7rem}#near-card{top:auto;bottom:84px;left:14px;right:14px;width:auto;padding:16px}#near-card h1{font-size:1.25rem}#far-prompt{top:76px;left:14px;max-width:230px}footer{right:15px;bottom:84px}footer span{display:none}#mobile-interact{display:block}}

/* Touch controls are additive: desktop keyboard/mouse controls keep their existing layout. */
main,#world-canvas{height:100dvh}#world-canvas{touch-action:none}
@media(any-pointer:coarse){header{padding-left:max(17px,env(safe-area-inset-left));padding-right:max(17px,env(safe-area-inset-right))}header button{min-width:44px;min-height:44px}#mobile-interact{display:none!important}#hud{left:max(14px,env(safe-area-inset-left));bottom:calc(190px + env(safe-area-inset-bottom))}footer{right:max(14px,env(safe-area-inset-right));bottom:calc(190px + env(safe-area-inset-bottom))}}
@media(any-pointer:coarse) and (max-width:680px){#near-card{bottom:calc(190px + env(safe-area-inset-bottom))}}
@media(any-pointer:coarse) and (max-width:680px) and (max-height:440px){#hud{bottom:calc(143px + env(safe-area-inset-bottom))}#near-card{bottom:calc(143px + env(safe-area-inset-bottom))}footer{bottom:calc(143px + env(safe-area-inset-bottom))}}

footer i.travel{background:#78bfff;box-shadow:0 0 0 2px #dffcff66}

/* Reusable top-down location map shell. The renderer supplies the map pixels later. */
header #map-button{margin-left:auto}
header #rpg-button,header #language{margin-left:0}
#map-dialog{width:min(700px,calc(100vw - 24px));max-height:calc(100dvh - 20px);margin:auto;padding:0;overflow:auto;border:1px solid #91ece0b8;border-radius:24px;background:linear-gradient(145deg,#173f61 0%,#0b2645 48%,#06172d 100%);color:#effaff;box-shadow:0 30px 90px #000c;-webkit-overflow-scrolling:touch}
#map-dialog::backdrop{background:#031021b8;backdrop-filter:blur(6px)}
.location-map{position:relative;display:grid;gap:14px;padding:clamp(18px,4vw,28px)}
.map-dialog-heading{padding-right:44px}.map-dialog-heading p{margin:0 0 5px;color:#65ebd3;font-size:.68rem;font-weight:900;letter-spacing:.16em}.map-dialog-heading h2{margin:0;color:#fff;font-size:clamp(1.45rem,4vw,2rem);letter-spacing:-.05em}
#map-close{position:absolute;top:16px;right:16px;display:grid;place-items:center;width:38px;height:38px;padding:0;border:1px solid #9befe28f;border-radius:50%;background:#0b2947e8;color:#efffff;font-size:1.65rem;line-height:1;cursor:pointer}
#map-close:hover,#map-close:focus-visible{background:#174c68;border-color:#d2fffa;outline:none}
#map-canvas{display:block;width:100%;height:auto;max-height:min(48dvh,360px);aspect-ratio:8/5;border:1px solid #91dce077;border-radius:16px;background:radial-gradient(circle at 50% 40%,#194a67,#0b213c 70%);box-shadow:inset 0 0 0 1px #e3ffff18}
#map-legend{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center;color:#c8e7ee;font-size:.72rem;font-weight:800}#map-legend span{display:inline-flex;align-items:center;gap:6px}#map-legend i{display:inline-block;flex:0 0 auto}.map-legend-player{width:9px;height:9px;border-radius:50%;background:#ffffff;box-shadow:0 0 0 3px #42e0c866}.map-legend-path{width:17px;height:3px;border-radius:9px;background:#7bc7db}.map-legend-pin{width:9px;height:9px;border-radius:3px;background:#ffcf58;transform:rotate(45deg)}
@media(max-width:680px){header #map-button{margin-left:auto}#map-dialog{width:calc(100vw - 16px);max-height:calc(100dvh - 12px);border-radius:19px}.location-map{gap:11px;padding:17px}#map-canvas{max-height:42dvh;border-radius:13px}}
@media(max-height:440px){#map-dialog{max-height:calc(100dvh - 8px)}.location-map{gap:8px;padding:14px}.map-dialog-heading p{margin-bottom:2px}#map-canvas{max-height:36dvh}#map-legend{gap:5px 10px}}
