*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;color:#e6dfcd;background:#0b1219;font-family:'Microsoft JhengHei',sans-serif;color-scheme:dark}[hidden]{display:none!important}button{cursor:pointer;font:inherit}#app-shell{position:fixed;inset:0;background:radial-gradient(ellipse at 50% 35%,#283a47,#101c27 58%,#060b12);display:flex;align-items:center;justify-content:center;padding-bottom:0}#phone-frame{position:relative;width:min(100vw,calc(100dvh*1.8790322580645162));aspect-ratio:1864/992;overflow:hidden;box-shadow:0 0 0 1px #52616c55,0 15px 80px #000d;background:#15232a}#game{position:absolute;inset:0;overflow:hidden}#world{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none;outline:none}#world-labels,#floaters{position:absolute;inset:0;pointer-events:none;overflow:hidden}#world-labels{z-index:5}.world-label{position:absolute;transform:translate(-50%,-100%);white-space:nowrap;font-size:clamp(9px,1vw,14px);color:#80c3ed;text-shadow:1px 1px 1px #000,-1px -1px 2px #000}.world-label.monster{color:#eee0ba}.world-label.npc{cursor:pointer}.world-label.crowd{font-size:clamp(8px,.8vw,12px)}#floaters{z-index:15}.floater{position:absolute;color:#f9e8b3;font-size:24px;font-weight:bold;text-shadow:1px 2px 2px #000;transform:translate(-50%,-100%);animation:float-up 1s ease-out forwards}@keyframes float-up{to{margin-top:-45px;opacity:0}}#zone-announcement{position:absolute;left:50%;top:22%;transform:translate(-50%,-50%);font-size:clamp(18px,2vw,32px);letter-spacing:8px;opacity:0;transition:opacity .6s;text-shadow:0 2px 8px #000;pointer-events:none;z-index:10}#zone-announcement.show{opacity:1}#toast{position:absolute;left:50%;bottom:23%;transform:translateX(-50%);max-width:75%;padding:10px 18px;background:#0b151ddd;border:1px solid #a0926b55;color:#eee4cc;font-size:clamp(10px,1vw,14px);text-align:center;opacity:0;transition:opacity .2s;z-index:70;pointer-events:none}#toast.show{opacity:1}#loading,#error{position:absolute;inset:0;z-index:90;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#0d1922ee;text-align:center;padding:32px}#loading h1{font-size:38px;letter-spacing:12px;font-weight:400;margin:16px 0}#loading p{font-size:14px;color:#b2c1c7}.loading-mark{width:40px;height:40px;border:1px solid #b7a47355;border-top-color:#d7c99a;border-radius:50%;animation:spin 1.4s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}#error button{padding:10px 20px;border:1px solid #9b8a60;background:#263542;color:#eee3c6}#area-loading{position:absolute;bottom:17%;left:50%;transform:translateX(-50%);background:#0a1722b8;color:#ddd7c7;font-size:12px;padding:6px 12px;z-index:20;pointer-events:none}.native-portrait{overflow:visible!important;box-shadow:none!important;background:transparent!important}.native-portrait canvas{border-radius:50%;background:url('./assets/mobile-ui/UserPortrait_SlotBG_common.webp') center/100% 100%}.native-joystick{user-select:none;-webkit-user-select:none}

/* The game keeps a fixed landscape aspect ratio, with background around it. */
#app-shell{padding:0;inset:auto;left:var(--visible-viewport-left,0px);top:var(--visible-viewport-top,0px);width:var(--visible-viewport-width,100vw);height:var(--game-viewport-height,var(--visible-viewport-height,100dvh));padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px)}
#phone-frame{flex:none;width:min(100%,calc((var(--game-viewport-height,var(--visible-viewport-height,100dvh)) - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))*1.8790322580645162));max-height:100%;aspect-ratio:1864/992}
/* Native document pan lets Safari collapse its own toolbar. The same scroll
   surface is retained after expansion; JS guards root drags without body:fixed. */
html[data-mobile-viewport=true]{height:auto;min-height:100%;overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:none}
html[data-mobile-viewport=true] body{position:relative;inset:auto;height:auto;min-height:var(--mobile-document-height,calc(200lvh + 320px));overflow:visible;touch-action:auto;overscroll-behavior-y:none}
html[data-mobile-viewport=true][data-mobile-display-mode=standalone],html[data-mobile-viewport=true][data-mobile-display-mode=fullscreen]{height:100%;overflow:hidden}
html[data-mobile-viewport=true][data-mobile-display-mode=standalone] body,html[data-mobile-viewport=true][data-mobile-display-mode=fullscreen] body{height:100%;min-height:100%;overflow:hidden}
html[data-mobile-viewport=true][data-mobile-scroll-locked=false] #world{touch-action:pan-y}
html[data-mobile-viewport=true][data-mobile-scroll-locked=true] #world{touch-action:none}
.mobile-viewport-probes{position:fixed;top:0;left:-10px;width:1px;height:0;visibility:hidden;pointer-events:none;contain:strict}
.mobile-viewport-probes i{position:absolute;display:block;width:1px}
.mobile-small-viewport{height:100svh}.mobile-large-viewport{height:100lvh}
.mobile-swipe-entry,.mobile-display-status{position:fixed;z-index:120;left:50%;top:48%;transform:translate(-50%,-50%);max-width:80%;padding:12px 20px;border:1px solid #a3926266;background:#0a141de0;color:#e9dfc5;font:16px/1.6 'Microsoft JhengHei',sans-serif;text-align:center;pointer-events:none;text-shadow:0 1px 2px #000}
.mobile-display-status{z-index:125;font-size:14px}
.mobile-rotate-hint{position:fixed;z-index:1000;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;padding:36px;background:#09141bf5;color:#e9dfc5;text-align:center;font:16px/1.8 'Microsoft JhengHei',sans-serif;touch-action:pan-y}
.mobile-rotate-hint strong{font-size:23px;font-weight:400}.mobile-rotate-symbol{font-size:58px;line-height:1;color:#c9b67a}.mobile-rotate-description{max-width:310px;color:#a9bbc5}

/* Keep a native upward document pan available on the menu backdrop after Safari
   reveals browser chrome; scrolling lists and map controls keep their own rules. */
html[data-mobile-viewport=true][data-mobile-scroll-locked=false] .native-panel-layer,html[data-mobile-viewport=true][data-mobile-scroll-locked=false] .source-menu-host-v26,html[data-mobile-viewport=true][data-mobile-scroll-locked=false] .menu26,html[data-mobile-viewport=true][data-mobile-scroll-locked=false] .menu26 button{touch-action:pan-y}

.mobile-swipe-recovery{position:fixed;inset:0;z-index:2000;display:flex;align-items:center;justify-content:center;touch-action:pan-y;pointer-events:auto}.mobile-swipe-recovery span{pointer-events:none;background:#09141be8;border:1px solid #a5926266;padding:14px 22px;color:#e9dfc5;font:16px/1.6 sans-serif}

.mobile-dynamic-viewport{height:100dvh}
