/* Every local coordinate and frame size comes from the Ui3 PAK INI and SPR. */
.game-shell .native-toolbar{position:absolute;right:0;bottom:2px;width:762px;max-width:100%;height:55px;padding:0;border:0;background:none;box-shadow:none;z-index:5}
.game-shell .native-toolbar-viewport{width:100%;height:55px;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;overscroll-behavior-x:contain;touch-action:pan-x;outline-offset:-2px}
.game-shell .native-toolbar-viewport::-webkit-scrollbar{display:none}
.game-shell .native-toolbar-scene{position:relative;width:762px;height:55px;min-width:762px;background:none;isolation:isolate}
.game-shell .native-toolbar-art{position:absolute;left:0;top:0;max-width:none;pointer-events:none}
.game-shell .native-toolbar-buttons{position:absolute;inset:0}
.game-shell .native-toolbar-button{position:absolute;display:block;margin:0;padding:0;min-width:0;min-height:0;overflow:hidden;border:0;border-radius:0;box-shadow:none;background:none;touch-action:pan-x}
.game-shell .native-toolbar-button-art{position:absolute;left:0;top:0;max-width:none;pointer-events:none}
@media(hover:hover){.game-shell .native-toolbar-button:hover .native-toolbar-button-art{left:calc(-1 * var(--native-frame-width) * var(--native-hover-frame))}}
.game-shell .native-toolbar-button:active .native-toolbar-button-art{left:calc(-1 * var(--native-frame-width) * var(--native-down-frame))}
.game-shell .native-toolbar-button:focus-visible{outline:1px solid #e7ce85;outline-offset:-5px}
.game-shell .native-toolbar-scene{overflow:hidden}
.game-shell .native-skill-cell{position:absolute;top:15px;display:block;width:32px;height:32px;min-height:0;padding:0;border:0;border-radius:0;background:none;box-shadow:none;overflow:visible;touch-action:pan-x}
.game-shell .native-skill-socket{position:absolute;inset:0;width:32px;height:32px;pointer-events:none}
.game-shell .native-skill-label{position:absolute;left:0;top:22px;width:auto;height:10px;max-width:none;pointer-events:none}
/* User correction: remove unused positions; pack original visible pixels only. */
.game-shell .native-toolbar{width:max-content;max-width:100%;height:60px}
.game-shell .native-toolbar-viewport{height:60px}
.game-shell .native-toolbar-scene{width:max-content;min-width:0;height:60px;overflow:hidden;padding:0 4px}
.game-shell .native-toolbar-buttons{position:relative;inset:auto;display:flex;align-items:center;gap:3px;height:52px;width:max-content}
.game-shell .native-toolbar-art{width:100%;height:55px;top:5px;object-fit:fill}
.game-shell .native-toolbar-button{position:relative;left:auto;top:auto;flex:none}
.game-shell .native-skill-cell{position:relative;left:auto;top:auto;width:55px;height:52px;flex:none;overflow:hidden}
.game-shell .native-skill-socket{width:55px;height:52px}
.game-shell .native-skill-label{left:5px;top:auto;bottom:4px;height:10px;width:auto}
@media(hover:hover){.game-shell .native-toolbar-button:hover .native-toolbar-button-art{left:calc(-1 * var(--native-crop-x) - var(--native-frame-width) * var(--native-hover-frame))!important}}
.game-shell .native-toolbar-button:active .native-toolbar-button-art{left:calc(-1 * var(--native-crop-x) - var(--native-frame-width) * var(--native-down-frame))!important}
/* Remove crossed-out ornament and close the remaining bottom HUD gaps. */
.game-shell .native-toolbar,.game-shell .native-toolbar-viewport,.game-shell .native-toolbar-scene{height:56px}
.game-shell .native-toolbar-scene{padding:0 3px;background:none}
.game-shell .native-toolbar-art{display:none}
/* Center the packed 482x56 toolbar; JS-provided ratios fit every browser cleanly. */
.game-shell{--bottom-bar-height:56px;--toolbar-scale:1;--toolbar-width:482px}
.game-shell .native-toolbar{left:50%;right:auto;transform:translateX(-50%);width:var(--toolbar-width,min(482px,calc(100% - 8px)));max-width:calc(100% - 8px);height:var(--bottom-bar-height,56px);bottom:max(2px,env(safe-area-inset-bottom))}
.game-shell .native-toolbar-viewport{width:100%;height:100%;overflow:hidden}
.game-shell .native-toolbar-scene{width:482px;min-width:482px;height:56px;padding:0 4px;box-sizing:border-box;transform:scale(var(--toolbar-scale,1));transform-origin:top left}
.game-shell .native-toolbar-buttons{gap:4px}
.game-shell .player{--hud-scale:var(--game-hud-scale,1);transform:scale(var(--game-hud-scale,1));transform-origin:top left}
@media(orientation:portrait) and (max-width:480px){
 .game-shell .map-hud{gap:2px}
 .game-shell .minimap{width:122px;box-sizing:border-box;padding:4px}
 .game-shell .mini-wrap{height:70px}
 .game-shell .map-buttons button{height:23px;min-height:23px;font-size:10px}
 .game-shell .extras{width:28px;gap:2px}
 .game-shell .extras :is(button,button:first-child){width:28px;height:26px;min-height:26px}
 .game-shell .extras button:nth-child(n) .source-mini{width:22px!important;height:22px!important}
 .game-shell .extras button:nth-child(n) .mini-welfare{width:20px!important;height:20px!important}
}
.game-shell .chat-group{bottom:calc(var(--bottom-bar-height) + max(6px,env(safe-area-inset-bottom)))}
.game-shell .chat-actions{display:flex;justify-content:flex-end;align-items:center;gap:6px;height:36px;margin:0 0 3px}
.game-shell .chat-actions .native-toolbar-button{position:relative;flex:none;min-height:0;padding:0;border:0;background:none;box-shadow:none;overflow:hidden}
.game-shell .chat-actions .native-toolbar-button:focus-visible{outline:1px solid #efd17b;outline-offset:0}
.game-shell .chat[hidden]{display:none!important}
.game-shell #chatForm,.game-shell .chat.collapsed #chatForm{height:22px;min-height:22px;align-items:center}
.game-shell #chatInput,.game-shell #chatChannel,.game-shell #chatForm button{height:20px;min-height:20px;line-height:18px;padding-top:0;padding-bottom:0;box-sizing:border-box}
.game-shell #chatInput{padding-left:4px;padding-right:4px}
.game-shell .chat-content{position:relative;padding:4px 5px;font:10px/1.45 TGPC,serif}
.game-shell .chat-message{display:block;margin:0;padding:2px 0;min-width:0;overflow-wrap:anywhere}
.game-shell .chat-sender,.game-shell .chat-text{display:inline;padding:0;white-space:pre-wrap;overflow-wrap:anywhere}
.game-shell .chat-sender{color:#f4d766}
.game-shell .chat-text{color:#eee8d6}
.game-shell #chatForm{background:#14180fed;border-color:#766638aa}
.game-shell #chatInput{background:#10150eee;color:#fff2cf}
.game-shell #chatInput::placeholder{color:#adad8e;opacity:1}
.game-shell #chatChannel,.game-shell #chatForm button{background:#202414ed}
.game-shell .extras .outfit-shortcut{position:relative;flex:none;min-height:0!important;min-width:0;padding:0;overflow:hidden;margin:3px 0 0}
@media(orientation:portrait){
 .game-shell .chat-content{height:clamp(72px,15vh,128px)}
}
.game-shell .uniform-round:hover{filter:brightness(1.12)}
.game-shell .uniform-round:active{filter:brightness(.85)}
@media(orientation:landscape){.game-shell .chat-content{height:clamp(44px,16vh,80px)}}
@media(orientation:portrait) and (max-width:420px){
 .game-shell .mission-panel{width:var(--left-hud-width,min(174px,calc(100vw - 180px)))}
}
/* Share the existing minimap palette across the three HUD panels. */
.game-shell{--hud-panel-background:linear-gradient(130deg,#23190fef,#090b09e8);--hud-panel-edge:#b98b40;--hud-panel-inset:#372718}
.game-shell .minimap,.game-shell .mission-panel,.game-shell .chat{background:var(--hud-panel-background);border:1px solid var(--hud-panel-edge);border-radius:2px;box-shadow:inset 0 0 0 2px var(--hud-panel-inset),0 3px 15px #0007}
.game-shell #missionToggle{background:#332718b0}
.game-shell .chat-content{background:transparent;border:0}
.game-shell #chatForm{background:#0b0d09f5;border:0;border-top:1px solid #b98b4099}
.game-shell #chatInput{background:#080b07f5}
.game-shell #chatChannel,.game-shell #chatForm button{background:#21190ff0}
/* Overlay areas retain the minimap hue with a much lighter opacity. */
.game-shell .mission-panel,.game-shell .chat{background:linear-gradient(130deg,#23190f45,#090b093d);border-color:#b98b4088;box-shadow:inset 0 0 0 1px #37271855}
.game-shell #missionToggle{background:#33271833}
@font-face{font-family:TG Vietnamese Serif;src:url(assets/fonts/NotoSerif-400.ttf) format('truetype');font-style:normal;font-weight:400;font-display:swap}
@font-face{font-family:TG Vietnamese Serif;src:url(assets/fonts/NotoSerif-600.ttf) format('truetype');font-style:normal;font-weight:600;font-display:swap}
@font-face{font-family:TG Vietnamese Serif;src:url(assets/fonts/NotoSerif-700.ttf) format('truetype');font-style:normal;font-weight:700;font-display:swap}
body:not(.ingame),body:not(.ingame) button,body:not(.ingame) input,body:not(.ingame) select,body.selection h1,body.selection h2,body.selection strong,body.selection span,body.selection label{font-family:TG Vietnamese Serif,Georgia,serif!important}
.game-shell .mission-panel,.game-shell .mission-panel button,.game-shell .chat,.game-shell .chat input,.game-shell .chat select,.game-shell .chat button,.game-shell .chat-content,.game-shell .map-title,.game-shell .map-coordinates,.game-shell .map-buttons button{font-family:TG Vietnamese Serif,Georgia,serif!important}
/* Seven compact source-effect icons; mission drawer slides into the left edge. */
.game-shell{--left-hud-width:210px;--effect-top:94px;--mission-top:142px;--mission-height:128px}
.game-shell .effect-bar{position:absolute;left:max(8px,env(safe-area-inset-left));top:var(--effect-top);width:min(144px,var(--left-hud-width));height:18px;display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px;align-items:start;z-index:4;pointer-events:none}
.game-shell .effect-icon{display:block;width:100%;height:auto;aspect-ratio:1;max-width:18px;image-rendering:auto;filter:drop-shadow(0 1px 1px #0008)}
.game-shell .mission-panel{top:var(--mission-top);width:var(--left-hud-width);height:var(--mission-height);box-sizing:border-box;transition:transform 160ms ease;z-index:4}
.game-shell #missionToggle{position:relative;min-height:24px;height:24px}
.game-shell .mission-body{height:calc(100% - 24px);min-height:0;overflow-y:auto;scrollbar-width:thin}
.game-shell .mission-panel.collapsed{transform:translateX(calc(-100% + 16px))}
.game-shell .mission-panel.collapsed .mission-body{display:block;visibility:hidden;pointer-events:none}
.game-shell .mission-panel.collapsed #missionToggle{position:absolute;right:0;top:0;width:24px;height:100%;min-height:0;padding:5px 2px;display:flex;flex-direction:column;justify-content:center;gap:8px}
.game-shell .mission-panel.collapsed #missionToggle>span:first-child{writing-mode:vertical-rl;white-space:nowrap}
.game-shell .mission-chevron{font:18px/1 Georgia,serif}
.game-shell .preview-badge{top:calc(var(--mission-top) + var(--mission-height) + 8px);left:max(8px,env(safe-area-inset-left))}
@media(orientation:portrait){.game-shell{--left-hud-width:174px;--mission-height:clamp(96px,15vh,128px)}}
@media(orientation:portrait) and (max-width:420px){.game-shell{--left-hud-width:min(174px,calc(100vw - 190px))}}
@media(orientation:landscape) and (max-height:550px){.game-shell{--left-hud-width:180px;--effect-top:76px;--mission-top:108px;--mission-height:clamp(64px,calc(100dvh - 292px),100px)}}
@media(prefers-reduced-motion:reduce){.game-shell .mission-panel{transition:none}}
/* Matched scrollable overlays, raised together below the player HUD. */
/* Geometric direction marks cannot fall back to iPhone colour emoji. */
.game-shell .joystick>span{width:0;height:0;font-size:0;line-height:0;border:6px solid transparent;pointer-events:none}
.game-shell .joystick .joy-up{border-top:0;border-bottom:10px solid currentColor}
.game-shell .joystick .joy-down{border-bottom:0;border-top:10px solid currentColor}
.game-shell .joystick .joy-left{border-left:0;border-right:10px solid currentColor}
.game-shell .joystick .joy-right{border-right:0;border-left:10px solid currentColor}
.game-shell{--effect-top:86px;--mission-top:116px;--overlay-width:210px;--overlay-height:200px;--left-hud-width:var(--overlay-width);--mission-height:var(--overlay-height)}
.game-shell .mission-panel,.game-shell .chat{width:var(--overlay-width);height:var(--overlay-height);box-sizing:border-box}
.game-shell .chat-group{width:var(--overlay-width);max-width:none}
.game-shell .mission-body{height:calc(100% - 24px);box-sizing:border-box}
.game-shell .mission-body{direction:rtl;text-align:left}
.game-shell .mission-body>*{direction:ltr}
.game-shell .chat-content{height:calc(100% - 22px);box-sizing:border-box}
.game-shell .mission-body,.game-shell .chat-content{overflow-y:scroll;overflow-x:hidden;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:#b9944c #36281840}
.game-shell .mission-body::-webkit-scrollbar,.game-shell .chat-content::-webkit-scrollbar{width:5px}
.game-shell .mission-body::-webkit-scrollbar-track,.game-shell .chat-content::-webkit-scrollbar-track{background:#36281840;border-left:1px solid #b98b4044}
.game-shell .mission-body::-webkit-scrollbar-thumb,.game-shell .chat-content::-webkit-scrollbar-thumb{background:#b9944c;border-radius:2px}
.game-shell .map-title{position:relative;padding-right:18px;min-height:18px}
.game-shell #minimapToggle{position:absolute;right:0;top:0;width:18px;height:18px;min-height:0;padding:0;border:0;background:transparent;box-shadow:none;color:#e8c574;font:18px/18px Georgia,serif;cursor:pointer}
.game-shell #minimapToggle:focus-visible{outline:1px solid #e8c574}
.game-shell .map-hud.map-collapsed .mini-wrap,.game-shell .map-hud.map-collapsed .extras{display:none}
@media(orientation:portrait){.game-shell{--effect-top:clamp(54px,calc((100vw - 190px) * 80 / 242 + 10px),86px);--mission-top:calc(var(--effect-top) + 40px);--overlay-width:min(210px,calc(100vw - 190px));--overlay-height:clamp(128px,23dvh,200px)}}
@media(orientation:landscape) and (max-height:550px){.game-shell{--effect-top:74px;--mission-top:100px;--overlay-width:180px;--overlay-height:clamp(72px,22dvh,100px)}}

/* Fold vertically; the party ResizeObserver follows the actual bottom edge. */
.game-shell .mission-panel.collapsed{height:24px;transform:none}
.game-shell .mission-panel.collapsed .mission-body{display:none}
.game-shell .mission-panel.collapsed #missionToggle{position:relative;inset:auto;width:100%;height:24px;min-height:24px;padding:0 6px;flex-direction:row;justify-content:space-between}
.game-shell .mission-panel.collapsed #missionToggle>span:first-child{writing-mode:horizontal-tb}

.skill-training-boost{position:relative}.skill-training-boost time{position:absolute;top:100%;left:50%;transform:translateX(-50%);font:9px/12px TGPC,sans-serif;color:#80ff80;white-space:nowrap;text-shadow:1px 1px #000,-1px -1px #000,1px -1px #000,-1px 1px #000}

.service-navigation .newcomer-items article{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.service-navigation .newcomer-items article>canvas{width:32px;height:32px}.service-navigation .newcomer-items article>span{flex:1;min-width:100px}.service-navigation .newcomer-items small{display:block}.service-navigation input[data-npc-qty]{width:44px;text-align:center}

.game-shell .skill-training-boost{grid-column:span 2;width:38px;height:18px;display:flex;justify-content:center}.game-shell .skill-training-boost canvas{width:18px;height:18px}.game-shell .skill-training-boost time{font-size:7px;line-height:10px;top:18px}.game-shell .skill-training-boost small{font-family:TGPC,sans-serif;right:2px;bottom:0}

.game-shell:has(.skill-training-boost,.offline-entrust-buff) .mission-panel{top:calc(var(--mission-top) + 20px)}
.game-shell .mission-panel,.game-shell .mission-panel button{font-family:'Phong Than PC v1.1',serif!important}
.game-shell .skill-training-boost time{font-size:10px;line-height:12px}

.game-shell .offline-entrust-buff{position:relative;display:block;width:18px;height:18px}.game-shell .offline-entrust-buff canvas{width:18px;height:18px}.game-shell .offline-entrust-buff time{position:absolute;top:18px;left:50%;transform:translateX(-50%);font:10px/12px TGPC,serif;white-space:nowrap;color:#80ff80;text-shadow:1px 1px #000,-1px -1px #000,1px -1px #000,-1px 1px #000}

.game-shell .skill-training-boost{grid-column:auto;width:18px;justify-content:center}.game-shell .skill-training-boost time,.game-shell .offline-entrust-buff time{font-size:9px;line-height:10px}

/* One compact item row: original icon, name/price, quantity, buy. */
body.ingame .service-navigation .npc-sale-list article{display:grid;grid-template-columns:28px minmax(0,1fr) 42px 40px;align-items:center;gap:5px;padding:3px 0;min-width:0}
body.ingame .service-navigation .npc-sale-list article>span{min-width:0;text-align:left;overflow-wrap:anywhere;font-size:12px;line-height:15px}
body.ingame .service-navigation .npc-sale-list article>canvas{width:28px;height:28px}
body.ingame .service-navigation .npc-sale-list label{display:block;margin:0;min-width:0}
body.ingame .service-navigation .npc-sale-list input[data-npc-qty]{box-sizing:border-box;width:42px;min-width:0;padding:2px;font:inherit}
body.ingame .service-navigation .npc-sale-list button{min-width:0;width:40px;min-height:30px;padding:2px;font:inherit}

.game-shell .auto-next-train-row{position:relative;min-width:0}.game-shell .auto-next-train-row>button{width:100%;padding-right:22px!important}.game-shell .auto-next-train-row>label{position:absolute;right:5px;top:0;bottom:0;display:flex;align-items:center}.game-shell .auto-next-train-row input{width:13px;height:13px;margin:0;accent-color:#e4bf61}

/* Classic Phong Than HUD Icon & Toolbar Polish */
.game-shell .native-toolbar-buttons{z-index:1}
.game-shell .native-toolbar-button{cursor:pointer;filter:drop-shadow(0 2px 3px rgba(0,0,0,.78));transition:filter 100ms ease,transform 80ms ease}
@media(hover:hover){
 .game-shell .native-toolbar-button:hover{filter:brightness(1.14) drop-shadow(0 0 5px rgba(255,216,102,.55)) drop-shadow(0 2px 3px rgba(0,0,0,.85))}
}
.game-shell .native-toolbar-button:active{filter:brightness(.92) drop-shadow(0 1px 2px rgba(0,0,0,.9));transform:translateY(1px)}
.game-shell .native-toolbar-button[aria-pressed="true"]{filter:brightness(1.18) drop-shadow(0 0 6px rgba(255,215,0,.82))}
.game-shell .native-toolbar-button[data-native-key="PK"]::after{content:"";position:absolute;right:5px;bottom:5px;width:8px;height:8px;border-radius:50%;background:var(--pk-color,#4cc663);border:1px solid #141008;box-shadow:0 0 4px var(--pk-color,#4cc663);pointer-events:none}
.game-shell .native-skill-cell{cursor:pointer;filter:drop-shadow(0 2px 3px rgba(0,0,0,.82));transition:filter 100ms ease,transform 80ms ease}
@media(hover:hover){
 .game-shell .native-skill-cell:hover{filter:brightness(1.12) drop-shadow(0 0 5px rgba(255,215,100,.5))}
}
.game-shell .native-skill-cell.skill-pressed,.game-shell .native-skill-cell:active{transform:scale(.95);filter:brightness(1.22) drop-shadow(0 0 6px rgba(255,220,110,.8))}
.game-shell .extras button{border:1px solid #967534cc!important;border-radius:4px!important;background:radial-gradient(circle at 35% 28%,#3b2e19ee,#12140dee 72%)!important;box-shadow:inset 0 0 0 1px #523e1f88,0 2px 4px rgba(0,0,0,.75)!important;cursor:pointer;transition:filter 100ms ease,border-color 100ms ease,transform 80ms ease}
@media(hover:hover){
 .game-shell .extras button:hover{border-color:#f3cf72!important;filter:brightness(1.16) drop-shadow(0 0 4px rgba(243,207,114,.45))}
 .game-shell .extras button:hover .source-mini{background-position:center center!important}
 .game-shell .extras button:hover .mini-welfare{background-position:right center!important}
}
.game-shell .extras button:active{transform:translateY(1px);filter:brightness(.92)}
.game-shell .extras button:active .source-mini{background-position:right center!important}
.game-shell .chat-actions .native-toolbar-button:not(.fsweb-atlas-btn){border-radius:50%;filter:drop-shadow(0 1px 3px rgba(0,0,0,.85))}
.game-shell .chat-actions .native-toolbar-button[aria-pressed="true"]{box-shadow:0 0 0 1px #ffd86b,0 0 8px rgba(255,215,0,.75)}
