/* Original PW version02 artwork; presentation only, scoped to mobile mode.
   Inventory/character/map/player retain their existing native layouts. */
body.pw-mobile29 {
 --pwpc-frame: url('./assets/pc-ui/window-frame.png');
 --pwpc-inner: url('./assets/pc-ui/window-inner.png');
 --pwpc-title: url('./assets/pc-ui/window-title.png');
 --pwpc-button: url('./assets/pc-ui/button-normal.png');
 --pwpc-button-hover: url('./assets/pc-ui/button-hover.png');
 --pwpc-button-down: url('./assets/pc-ui/button-pressed.png');
 --pwpc-close: url('./assets/pc-ui/close-normal.png');
 --pwpc-close-hover: url('./assets/pc-ui/close-hover.png');
 --pwpc-close-down: url('./assets/pc-ui/close-pressed.png');
 --pwpc-ink: #fceacc;
 --pwpc-muted: #d0c1a0;
}
body.pw-mobile29 :is(#pw-m29-book,#pw-m33-targets,#pw-m38-hub,.pwf-win,.pww-win,#ps2-win,#ps2-modal,#pw-social-panel:not([data-pw-tab='inventory']):not([data-pw-tab='character']):not([data-pw-tab='map']):not([data-pw-tab='player'])) {
 color: var(--pwpc-ink) !important;
 font-family: Tahoma,Arial,sans-serif;
 background: #3b2d1b !important;
 border: 2px solid transparent !important;
 border-image-source: var(--pwpc-frame) !important;
 border-image-slice: 32 fill !important;
 border-image-width: 22px !important;
 border-image-repeat: stretch !important;
 border-radius: 0 !important;
 box-shadow: 0 7px 24px #0009 !important;
 padding: 14px !important;
 box-sizing: border-box;
}
body.pw-mobile29 :is(#pw-m29-book,#pw-m33-targets,#pw-m38-hub,.pwf-win,.pww-win,#ps2-win,#ps2-modal) > header,
body.pw-mobile29 #pw-social-panel:not([data-pw-tab='inventory']):not([data-pw-tab='character']):not([data-pw-tab='map']):not([data-pw-tab='player']) > header,
body.pw-mobile29 #ps2-hd {
 display: flex; align-items: center; gap: 4px;
 min-height: 52px !important;
 padding: 0 7px !important;
 margin: -10px -10px 8px !important;
 background: var(--pwpc-title) center / 100% 100% no-repeat !important;
 border: 0 !important; border-radius: 0 !important;
 color: var(--pwpc-ink) !important;
}
body.pw-mobile29 :is(#pw-m29-book,#pw-m33-targets,#pw-m38-hub,.pwf-win,.pww-win,#ps2-win,#ps2-modal) > header > :is(strong,b),
body.pw-mobile29 #pw-social-panel:not([data-pw-tab='inventory']) > header > strong {
 flex: 1; min-width: 0; text-align: center;
 color: var(--pwpc-ink) !important; font: bold 15px/1.3 Tahoma,Arial,sans-serif;
 text-shadow: 0 1px 2px #000,1px 0 1px #17211b;
}
/* Text action buttons have a 44px hit area around the original 24px artwork. */
body.pw-mobile29 :is(#pw-m38-hub,.pwf-win,.pww-win,#ps2-win,#ps2-modal) button:not(:has(img)):not([aria-label='Đóng']),
body.pw-mobile29 #pw-social-panel[data-pw-tab='system'] #pw-social-content button,
body.pw-mobile29 #pw-m29-book :is(.m30-use-slot,.m31-clear-center),
body.pw-mobile29 .m33-recenter {
 min-height: 44px !important;
 background-color: transparent !important;
 background-image: var(--pwpc-button) !important;
 background-position: center !important;
 background-size: 100% 30px !important;
 background-repeat: no-repeat !important;
 border: 0 !important; border-radius: 0 !important;
 padding: 8px 14px !important;
 color: var(--pwpc-ink) !important;
 font: 14px/1.3 Tahoma,Arial,sans-serif;
 text-shadow: 0 1px 1px #102219;
 touch-action: manipulation;
}
body.pw-mobile29 :is(#pw-m38-hub,.pwf-win,.pww-win,#ps2-win,#ps2-modal) button:not(:has(img)):not([aria-label='Đóng']):hover:not(:disabled),
body.pw-mobile29 #pw-social-panel[data-pw-tab='system'] #pw-social-content button:hover:not(:disabled),
body.pw-mobile29 #pw-m29-book :is(.m30-use-slot,.m31-clear-center):hover:not(:disabled),
body.pw-mobile29 .m33-recenter:hover { background-image: var(--pwpc-button-hover) !important; }
body.pw-mobile29 :is(#pw-m38-hub,.pwf-win,.pww-win,#ps2-win,#ps2-modal) button:not(:has(img)):not([aria-label='Đóng']):active:not(:disabled),
body.pw-mobile29 #pw-social-panel[data-pw-tab='system'] #pw-social-content button:active:not(:disabled),
body.pw-mobile29 #pw-m29-book :is(.m30-use-slot,.m31-clear-center):active:not(:disabled),
body.pw-mobile29 .m33-recenter:active { background-image: var(--pwpc-button-down) !important; }
body.pw-mobile29 :is(#pw-m29-book,#pw-m33-targets,#pw-m38-hub) > header > button[aria-label='Đóng'],
body.pw-mobile29 #pw-social-panel:not([data-pw-tab='inventory']) #pw-social-close {
 flex: 0 0 44px; width: 44px !important; min-width: 44px !important;
 height: 44px !important; min-height: 44px !important;
 background: var(--pwpc-close) center / 32px 32px no-repeat !important;
 border: 0 !important; padding: 0 !important; border-radius: 0 !important;
 font-size: 0 !important; color: transparent !important;
 touch-action: manipulation;
}
body.pw-mobile29 :is(#pw-m29-book,#pw-m33-targets,#pw-m38-hub) > header > button[aria-label='Đóng']:hover,
body.pw-mobile29 #pw-social-panel:not([data-pw-tab='inventory']) #pw-social-close:hover { background-image: var(--pwpc-close-hover) !important; }
body.pw-mobile29 :is(#pw-m29-book,#pw-m33-targets,#pw-m38-hub) > header > button[aria-label='Đóng']:active,
body.pw-mobile29 #pw-social-panel:not([data-pw-tab='inventory']) #pw-social-close:active { background-image: var(--pwpc-close-down) !important; }
body.pw-mobile29 :is(#pw-m33-targets .m33-target-list button,#pw-m29-book .m29-select-slot button) {
 min-height: 44px; border: 1px solid #9a885c !important;
 border-radius: 0 !important; color: var(--pwpc-ink) !important;
 background-color: #292316 !important;
}
body.pw-mobile29 #pw-m33-targets .m33-target-list button { padding: 10px 12px; text-align: left; }
body.pw-mobile29 :is(#pw-m33-targets .m33-target-list button,#pw-m29-book .m29-select-slot button):hover:not(:disabled) { border-color: #dacb8e !important; background-color: #414329 !important; }
body.pw-mobile29 #pw-m29-book .m29-select-slot button.on { box-shadow: inset 0 0 0 1px #e1cd88; }
body.pw-mobile29 :is(#pw-m29-book,#pw-m38-hub,.pwf-win,.pww-win,#ps2-win,#ps2-modal) :is(p,small,label,td,th) { color: var(--pwpc-muted); }
body.pw-mobile29 :is(#pw-m29-book,#pw-m33-targets,#pw-m38-hub,.pwf-win,.pww-win,#ps2-win,#ps2-modal) button:focus-visible,
body.pw-mobile29 #pw-social-close:focus-visible { outline: 2px solid #f3d68b !important; outline-offset: 2px; }
body.pw-mobile29 #pw-mobile29 .m29-target {
 background: url('./assets/pc-ui/target-frame.png') center / 100% 100% no-repeat !important;
 border: 0 !important; border-radius: 0 !important;
 width: 222px; min-height: 59px; box-sizing: border-box;
 padding: 9px 26px 14px !important; color: var(--pwpc-ink) !important;
}
body.pw-mobile29 #pw-mobile29 .m29-target strong { color: var(--pwpc-ink); font: bold 13px/1.3 Tahoma,Arial,sans-serif; text-shadow: 0 1px 2px #000; }
body.pw-mobile29 #pw-mobile29 .m29-target progress { height: 9px; border: 0; border-radius: 0; background: #1e100e; }
body.pw-mobile29 #pw-mobile29 .m29-target progress::-webkit-progress-bar { background: #1e100e; }
body.pw-mobile29 #pw-mobile29 .m29-target progress::-webkit-progress-value { background: url('./assets/pc-ui/target-hp.png') center / 100% 100% no-repeat; }
body.pw-mobile29 #pw-mobile29 .m29-target progress::-moz-progress-bar { background: url('./assets/pc-ui/target-hp.png') center / 100% 100% no-repeat; }
@media (max-width:480px) {
 body.pw-mobile29 #pw-mobile29 .m29-target { width: min(222px,calc(100vw - 146px)); padding-inline: 20px !important; }
 body.pw-mobile29 :is(#pw-m29-book,#pw-m33-targets,#pw-m38-hub,.pwf-win,.pww-win,#ps2-win,#ps2-modal) { padding: 12px !important; }
}

/* Native panel proportions also cap the existing viewport fitter. */
body.pw-mobile29 :is(#pw-m29-book,#pw-social-panel[data-pw-tab='system'],.pwf-win,.pww-win,#ps2-win,#ps2-modal) { --pw-native-panel-width:420px; }
body.pw-mobile29 #pw-m33-targets { --pw-native-panel-width:360px; }
body.pw-mobile29 #pw-m38-hub { width:min(420px,calc(100vw - 16px)) !important; }
body.pw-mobile29 #pw-m29-book .m30-use-slot { width:min(220px,100%) !important; display:block; margin:8px auto !important; }

/* Keep all skill-page choices reachable without a desktop-style horizontal scrollbar. */
body.pw-mobile29 #pw-m29-book .m29-select-slot { display:flex !important; flex-wrap:wrap !important; gap:4px !important; overflow:visible !important; }
body.pw-mobile29 #pw-m29-book .m29-select-slot button { flex:0 0 44px !important; width:44px !important; min-width:44px !important; padding-inline:3px !important; }
body.pw-mobile29 #pw-m29-book .m29-select-slot button:last-child { flex-basis:52px !important; width:52px !important; }
body.pw-mobile29 #pw-mobile29 .m29-toast:empty { display:none !important; }
body.pw-mobile29 #pw-mobile29 .m29-toast:not(:empty) { width:max-content !important; max-width:min(360px,calc(100vw - 24px)) !important; white-space:normal !important; overflow-wrap:anywhere; background:#2d2518 !important; border:1px solid #9a885c; border-radius:0 !important; color:var(--pwpc-ink); }

/* Keep target information clear of the native minimap in both orientations. */
body.pw-mobile29 #pw-mobile29 .m29-target { left:50% !important; right:auto !important; top:9px !important; transform:translateX(-50%) !important; width:222px !important; }
@media (max-width:480px) { body.pw-mobile29 #pw-mobile29 .m29-target { left:auto !important; right:8px !important; top:116px !important; transform:none !important; width:min(222px,calc(100vw - 16px)) !important; } }

/* PC version02 secondary windows and paging buttons (friendlist.xml). */
body.pw-mobile29 { --pwpc-tab:url('./assets/pc-ui/tab-normal.png'); --pwpc-tab-down:url('./assets/pc-ui/tab-pressed.png'); --pwpc-tab-selected:url('./assets/pc-ui/tab-selected.png'); --pwpc-list:url('./assets/pc-ui/list-inner.png'); }
body.pw-mobile29 #pw-m37-overlay .m37-sheet { color:var(--pwpc-ink)!important;font-family:Tahoma,Arial,sans-serif!important;background:#3b2d1b!important;border:2px solid transparent!important;border-image:var(--pwpc-frame) 32 fill / 22px / 0 stretch!important;border-radius:0!important;padding:14px!important;box-shadow:0 7px 24px #0009!important;width:380px; }
body.pw-mobile29 #pw-m37-overlay .m37-sheet > header { min-height:52px!important;padding:0 7px!important;margin:-10px -10px 8px!important;top:-14px!important;background:var(--pwpc-title) center / 100% 100% no-repeat!important;border:0!important;gap:4px!important; }
body.pw-mobile29 #pw-m37-overlay .m37-sheet > header strong { color:var(--pwpc-ink)!important;font:bold 15px/1.3 Tahoma,Arial,sans-serif!important;text-shadow:0 1px 2px #000;overflow-wrap:anywhere;text-align:center; }
body.pw-mobile29 :is(#pw-m37-overlay .m37-sheet > header > button,.pwf-win > header > button:not(.m33-recenter),.pww-win > header > button:not(.m33-recenter),#ps2-x) { flex:0 0 44px!important; width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important;padding:0!important;border:0!important;border-radius:0!important;background:var(--pwpc-close) center / 32px 32px no-repeat!important;font-size:0!important;color:transparent!important;touch-action:manipulation; }
body.pw-mobile29 :is(#pw-m37-overlay .m37-sheet > header > button,.pwf-win > header > button:not(.m33-recenter),.pww-win > header > button:not(.m33-recenter),#ps2-x):hover {background-image:var(--pwpc-close-hover)!important;}
body.pw-mobile29 :is(#pw-m37-overlay .m37-sheet > header > button,.pwf-win > header > button:not(.m33-recenter),.pww-win > header > button:not(.m33-recenter),#ps2-x):active {background-image:var(--pwpc-close-down)!important;}
body.pw-mobile29 #pw-m37-overlay .m37-content button { min-height:44px!important;border:0!important;border-radius:0!important;padding:8px 14px!important;color:var(--pwpc-ink)!important;font:14px/1.3 Tahoma,Arial,sans-serif!important;text-shadow:0 1px 1px #102219;background:var(--pwpc-button) center / 100% 30px no-repeat!important; }
body.pw-mobile29 #pw-m37-overlay .m37-content button:hover:not(:disabled) {background-image:var(--pwpc-button-hover)!important;}
body.pw-mobile29 #pw-m37-overlay .m37-content button:active:not(:disabled) {background-image:var(--pwpc-button-down)!important;}
body.pw-mobile29 #pw-m37-overlay :is(.m37-description,input),body.pw-mobile29 #pw-m38-hub .m38-member { border:1px solid transparent!important;border-image:var(--pwpc-list) 8 fill / 8px / 0 stretch!important;border-radius:0!important;background:#242117!important;color:var(--pwpc-ink)!important; }
body.pw-mobile29 #pw-m37-overlay .m37-description {padding:10px!important;}
body.pw-mobile29 #pw-m37-overlay :is(.m37-status,.m37-item-summary small) {color:var(--pwpc-muted)!important;}
body.pw-mobile29 :is(#ps2-tabs button,.ps2-tab) { min-height:44px!important;padding:8px 12px!important; border:0!important;border-radius:0!important; background:var(--pwpc-tab) center / 100% 28px no-repeat!important;color:var(--pwpc-ink)!important;font-family:Tahoma,Arial,sans-serif!important;text-shadow:0 1px 1px #102219; }
body.pw-mobile29 :is(.pc-tab.active,.pc-tab:hover,#ps2-tabs button.on,.ps2-tab.on,.ps2-tab:hover) {background-image:var(--pwpc-tab-selected)!important;}
body.pw-mobile29 :is(.pc-tab:active,#ps2-tabs button:active,.ps2-tab:active) {background-image:var(--pwpc-tab-down)!important;}
body.pw-mobile29 :is(#pw-m29-book,#pw-m33-targets,.pwf-win,.pww-win,#pw-social-panel) > header > button.m33-recenter {background:var(--pwpc-button) center / 100% 30px no-repeat!important;color:var(--pwpc-ink)!important;border:0!important;border-radius:0!important;}
body.pw-mobile29 :is(#pw-m37-overlay .m37-sheet button,.pc-tab,#ps2-x):focus-visible {outline:2px solid #f3d68b!important;outline-offset:2px;}

/* Inventory is positioned from native XML: preserve tab geometry above equipment slots. */
body.pw-mobile29 .pc-tab {background:var(--pwpc-tab) center / 100% 100% no-repeat!important;border:0!important;border-radius:0!important;color:var(--pwpc-ink)!important;font-family:Tahoma,Arial,sans-serif!important;}
body.pw-mobile29 .pc-tab.active,body.pw-mobile29 .pc-tab:hover {background-image:var(--pwpc-tab-selected)!important;}
body.pw-mobile29 .pc-tab:active {background-image:var(--pwpc-tab-down)!important;}

/* Native frame replaces the remaining blue mobile function drawer. */
body.pw-mobile29.pw-revolution38 #pw-social-toolbar {background:#3b2d1b!important;border:2px solid transparent!important;border-image:var(--pwpc-frame) 32 fill / 18px / 0 stretch!important;border-radius:0!important;padding:10px!important;color:var(--pwpc-ink)!important;}
body.pw-mobile29 #pw-social-toolbar :is(button,[role=checkbox]) {background-color:#292819!important;border:1px solid #9a885c!important;border-radius:0!important;color:var(--pwpc-ink)!important;font-family:Tahoma,Arial,sans-serif!important;}
body.pw-mobile29 #pw-social-toolbar :is(button,[role=checkbox]):hover:not(:disabled) {background-color:#42412b!important;border-color:#dacb8e!important;}
body.pw-mobile29 #pw-social-toolbar :is(button,[role=checkbox]):focus-visible {outline:2px solid #f3d68b!important;outline-offset:1px;}
