@import url('/assets/pc-polymorph-window.css');
@import url('/assets/pc-social-window.css');
@import url('/assets/pc-party-window.css');
@import url('/assets/pc-clan-window.css');
/* Keep the original PC 640x480 coordinate plane intact. Only the completed
   plane scales to the browser viewport; terrain and HUD share one scale. */
.game.pc-layout{position:absolute;left:50%;top:50%;width:640px;height:480px;display:block;transform:translate(-50%,-50%) scale(var(--pc-stage-scale,1));transform-origin:center center;overflow:visible}
.game.pc-layout #viewport{position:absolute;left:0;top:0;width:640px;height:408px;min-width:0;display:block;overflow:hidden}
.game.pc-layout #world{width:640px;height:408px;max-width:none;max-height:none;object-fit:fill}
/* Mouse/keyboard PC presentation uses click-to-walk; retain the touch pad only
   for devices whose primary pointer is a touchscreen. */
.game.pc-layout .dpad{display:none}
@media(pointer:coarse){.game.pc-layout .dpad{display:grid}}
.pc-hud{position:absolute;left:0;top:355px;bottom:auto;width:640px;height:125px;display:block;padding:0;border:0;box-shadow:none;overflow:visible;background: url('/assets/original-windows/original-hud/406.png') 0 0/640px 125px no-repeat;font:11px 'PMingLiU',serif}
.pc-hud .portrait{display:none}.pc-hud .character{position:absolute;left:0;top:0;width:110px;display:block}.pc-hud .character>strong{position:absolute;top:12px;left:3px;width:102px;text-align:center;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.pc-hud .character>small{position:absolute;top:90px;left:4px;width:101px;font-size:9px;white-space:normal;line-height:12px}
.pc-hud .gauge{position:absolute;left:3px;width:103px;height:10px;border:0;background:#080808;overflow:hidden}.pc-hud .gauge b{font:9px/10px Arial,sans-serif;color:#fff;text-shadow:1px 1px #000}.pc-hud .hp{top:31px}.pc-hud .mp{top:53px;width:101px}.pc-hud .exp{top:74px;left:20px;width:86px}.pc-hud .exp span{background:#a69230}.pc-hud .core-statuses{position:absolute;bottom:4px;left:3px;width:200px}
.pc-hud .quickslots{position:absolute;left:499px;top:29px;width:136px;height:70px;display:grid;grid-template-columns:repeat(4,34px);grid-template-rows:repeat(2,35px);gap:0}
.pc-hud .quickslots button,.pc-hud .pc-menu button{min-height:0;min-width:0;height:auto;width:auto;padding:0;border:0;box-shadow:none;background:transparent;border-radius:0;color:#e9dbb5;font-size:9px;overflow:hidden;white-space:nowrap;text-shadow:1px 1px #000}
.pc-hud .quickslots button:nth-child(n){grid-column:auto;border:0}.pc-hud .quickslots button:hover,.pc-hud .pc-menu button:hover{background:#ffffff20}.pc-hud .quickslots button img{width:28px;height:28px;object-fit:contain;image-rendering:pixelated}.pc-hud .quickslots button:disabled{opacity:1}.pc-hud .quickslots button small{display:block;font-size:8px}
.pc-hud .world-chat{position:absolute;left:115px;top:44px;bottom:auto;width:363px;height:62px;pointer-events:auto;overflow:hidden;text-shadow:1px 1px #000}.pc-hud .world-chat #explanation{font-size:10px}.pc-hud #chat-history{max-height:62px;overflow-y:auto}.pc-hud #chat-history li{font:11px/14px 'PMingLiU',serif;background:none;padding:0}
.pc-hud #chat-form{position:absolute;left:114px;bottom:1px;width:366px;height:15px;gap:2px;padding:0;border:0;background:transparent}.pc-hud #chat-form input,.pc-hud #chat-form select,.pc-hud #chat-form button{padding:0;min-height:0;height:15px;border:0;background:#1118;color:white;font:10px/15px 'PMingLiU',serif}.pc-hud #chat-channel{width:43px}.pc-hud #chat-recipient{width:60px}.pc-hud #chat-form button{width:25px}
.pc-hud .pc-menu{position:absolute;left:518px;top:104px;display:flex;height:20px;width:116px}.pc-hud .pc-menu button{flex:1;background:#15130fcc}.pc-options{position:absolute;left:497px;top:104px;width:20px;height:20px}.pc-options>summary{list-style:none;cursor:pointer;font-size:9px;line-height:20px;background:#15130fcc}.pc-options[open]{z-index:20}.pc-options .combat,.pc-options .menu{display:none}.pc-options[open] .combat,.pc-options[open] .menu{position:absolute;right:0;width:260px;padding:8px;display:flex;flex-wrap:wrap;gap:4px;background:#111e;border:1px solid #88734f;max-height:180px;overflow:auto}.pc-options[open] .combat{bottom:185px}.pc-options[open] .menu{bottom:25px;height:160px}.pc-options button{font-size:11px;min-height:30px;padding:3px 7px}.pc-options .combat small{width:100%}
.pc-hud #quick-page{position:absolute;left:481px;top:69px;width:15px;height:32px;min-height:0;padding:0;border:0;background:#10101088;font-size:9px;writing-mode:vertical-rl}
@media(max-width:600px){.game.pc-layout{grid-template-rows:minmax(0,1fr) var(--pc-hud-height,125px)}}
.pc-options .topbar{display:none}
.pc-options[open] .topbar{position:absolute;right:0;bottom:245px;width:300px;max-width:min(300px,calc(100vw - 12px));max-height:130px;display:flex;flex-wrap:wrap;align-items:center;gap:5px;padding:7px;background:#111e;border:1px solid #88734f;box-shadow:0 6px 20px #000c;overflow:auto}
.pc-options .topbar .crest{display:none}
.pc-options .topbar .server{width:100%}
.pc-options .topbar .online{margin-left:0}
.pc-options .topbar #mode{margin-left:0}
.pc-options .topbar button{min-height:26px}
.pc-options .topbar #sound-volume{flex:1;min-width:65px}
.pc-options .maptools{position:static;display:flex;gap:3px;align-items:center;width:100%}
.pc-options .telemetry{position:static;display:block;pointer-events:auto;opacity:1;width:100%}
.pc-options .telemetry dl{justify-content:space-between;padding:2px 0;background:none;border:0}
/* Sprite 406: keep the left medallions and the gold track borders exposed.
   The top long recess is the name field, not the HP track. */
.pc-hud .character>strong{top:30px;line-height:12px}
.pc-hud .character>small{top:52px;left:20px;width:23px;height:12px;line-height:12px;text-align:center;white-space:nowrap;overflow:hidden}
.pc-hud .gauge{left:20px;width:86px;height:8px;background:transparent}
.pc-hud .gauge b{font:8px/8px Arial,sans-serif}
.pc-hud .hp{top:74px}
.pc-hud .mp{top:94px}
.pc-hud .exp{top:114px}
.pc-hud .gauge span{transition:none}

/* Native466090: absolute y374 relative to the406 frame at y355.
   HP crops the right end of468 over467; MP crops the left of460 over459. */
.pc-hud .hp,.pc-hud .mp{top:19px;height:20px;background-repeat:no-repeat}
.pc-hud .hp{left:140px;width:141px;background-image:url('/assets/original-windows/original-hud/467.png')}
.pc-hud .mp{left:332px;width:136px;background-image:url('/assets/original-windows/original-hud/459.png')}
.pc-hud .hp span{left:auto;right:0;background:url('/assets/original-windows/original-hud/468.png') right top no-repeat}
.pc-hud .mp span{background:url('/assets/original-windows/original-hud/460.png') left top no-repeat}
.pc-hud .hp b,.pc-hud .mp b{font:10px/20px 'PMingLiU',serif}

/* Native467a10: food608024 at19,447; weight608023 at19,428. */
.pc-hud .food,.pc-hud .weight{left:19px;width:88px;height:10px;background:transparent}
.pc-hud .food{top:92px}.pc-hud .weight{top:73px}
.pc-hud .food span,.pc-hud .weight span{background-repeat:no-repeat;background-position:left top}

/* Keep the existing core-gated recovery action outside collapsed HUD menus. */
#viewport>#restart-death{position:absolute;z-index:8;left:50%;bottom:20px;transform:translateX(-50%);min-height:36px;padding:6px 18px;white-space:nowrap}

.pc-hud #chat-history{display:block;overflow-wrap:anywhere;overflow-anchor:none}

/* Native4675c0: icons at (499 + column*34, 384 + row*34).
   The 406 frame starts at y355, so both grid axes advance by34. */
.pc-hud .quickslots{height:68px;grid-template-rows:repeat(2,34px)}
.pc-hud .quickslots button{position:relative}
.pc-hud .quickslots button img{position:absolute;left:0;top:0;width:auto;height:auto;max-width:32px;max-height:32px}

/* Native435e5a /435eab: inventory402 at558,459; magic400 at537,459. */
.pc-hud .pc-menu{left:0;top:0;width:0;height:0;display:block}
.pc-hud .pc-menu button[data-pc-menu]{position:absolute;top:104px;width:19px;height:21px;image-rendering:pixelated;background-repeat:no-repeat}
.pc-hud .pc-menu button[data-pc-menu="inventory"]{left:558px;background-image:url('/assets/original-windows/original-hud/402.png')}
.pc-hud .pc-menu button[data-pc-menu="skills"]{left:537px;background-image:url('/assets/original-windows/original-hud/400.png')}
.pc-hud .pc-menu button[data-pc-menu]:focus-visible{outline:1px solid #e9dbb5;outline-offset:1px}
/* Native411d20 selects base+1 while the button's pressed flag is set. */
.pc-hud .pc-menu button[data-pc-menu="inventory"]:active:not(:disabled){background-image:url('/assets/original-windows/original-hud/403.png')}
.pc-hud .pc-menu button[data-pc-menu="skills"]:active:not(:disabled){background-image:url('/assets/original-windows/original-hud/401.png')}
/* Native435f48 binds equipment wrapper60809c to398 at516,459. */
.pc-hud .pc-menu button[data-pc-menu="equipment"]{left:516px;background-image:url('/assets/original-windows/original-hud/398.png')}
.pc-hud .pc-menu button[data-pc-menu="equipment"]:active:not(:disabled){background-image:url('/assets/original-windows/original-hud/399.png')}
/* The adjacent equipment button begins at516; keep this temporary entry below it. */
.pc-options{width:19px}
/* Native466350 prints signed AC at24,408 (frame y355), left aligned. */
.pc-hud .character>small{left:24px;top:53px;text-align:left}
/* Native467e24: lawful emblem 710/711/712 at49,50 and the signed value centred from x68 on the AC text row. */
.pc-hud .pc-lawful-mark{position:absolute;left:49px;top:50px;width:16px;height:17px;image-rendering:pixelated;pointer-events:none}
.pc-hud .character>small.pc-lawful{width:auto;overflow:visible}
/* Active native4663c0 level/EXP grouping at0,383, text at y385. */
.pc-hud .character>strong{width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.pc-hud .exp{left:0;top:28px;width:109px;height:15px}
.pc-hud .exp span{background:url('/assets/original-windows/original-hud/707.png') left top no-repeat}
.pc-hud .exp b{position:absolute;width:auto;top:2px;font:10px/12px 'PMingLiU',serif}
.pc-hud #exp-level{left:1px;right:auto;text-align:left}
.pc-hud #exp-text{left:auto;right:1px;text-align:right}
/* Native467c33/467cad displays percentages at x55 on pointer entry. */
.pc-hud .food b,.pc-hud .weight b{position:absolute;left:36px;top:0;display:none;font:10px/10px 'PMingLiU',serif;text-align:left}
.pc-hud .food:hover b,.pc-hud .weight:hover b,.pc-hud .food:focus b,.pc-hud .weight:focus b{display:block}
/* Constructor436086: food rect(0,443,109,460), weight(0,424,109,441).
   Expand the hit region while keeping source fills at19,447 and19,428. */
.pc-hud .food,.pc-hud .weight{left:0;width:109px;height:17px}
.pc-hud .food{top:88px}.pc-hud .weight{top:69px}
.pc-hud .food span,.pc-hud .weight span{left:19px;top:4px;height:10px}
.pc-hud .food b,.pc-hud .weight b{left:55px;top:4px}
/* Native467cd9: background0,462; marker21+phase,468; time55,466. */
.pc-hud .pc-time{position:absolute;left:0;top:107px;width:111px;height:17px;background-repeat:no-repeat;image-rendering:pixelated}
.pc-hud .pc-time img{position:absolute;top:6px;width:6px;height:6px}
.pc-hud .pc-time b{position:absolute;left:55px;top:4px;font:10px/12px 'PMingLiU',serif;color:white;text-shadow:1px 1px #000;display:none}
.pc-hud .pc-time:hover b,.pc-hud .pc-time:focus b{display:block}

/* Native466a7c/466cb5: captions begin six pixels below bar origin.
   Native4991f0 format is %s:%d/%d; each resource has its own horizontal anchor. */
.pc-hud .hp b,.pc-hud .mp b{position:absolute;top:6px;right:auto;width:auto;text-align:left;white-space:nowrap;font:12px/12px 'PMingLiU',monospace;font-weight:normal}

/* Native435b97: x125,y466,width354,height12 on the640x480 surface. */
.pc-hud .pc-quantity-prompt{position:absolute;left:125px;top:111px;width:354px;height:12px;display:flex;gap:2px;margin:0;padding:0;border:0;background:#080808;pointer-events:auto}
.pc-hud .pc-quantity-prompt input{height:12px;min-height:0;min-width:0;border:0;border-radius:0;margin:0;padding:0;background:transparent;color:#fff;font:12px/12px 'PMingLiU',serif;flex:1;width:0;appearance:none;outline:none}

/* Native43fb38: status TBTs live on the scene, at original32px size. */
/* Native 45a030 -> 47c0db draws status TBTs with a per-channel screen blend (s + d - s*d/256), so the dark
   square behind each icon falls away over the scene; mix-blend-mode:screen is the same formula. */
.game.pc-layout>.pc-statuses{position:absolute;inset:0;display:block;margin:0;pointer-events:none;z-index:20;mix-blend-mode:screen}
.game.pc-layout>.pc-statuses[hidden]{display:none}
.pc-statuses .core-status{position:absolute;width:32px;height:32px}
.pc-statuses .core-status img{width:32px;height:32px;margin:0}

/* PC has one chat editor. Channel prefixes live in its text, not web widgets. */
.pc-hud #chat-channel,.pc-hud #chat-recipient,.pc-hud #chat-form button{display:none!important}
.pc-hud #chat-form #chat-text{width:100%;flex:1;font:12px/15px 'PMingLiU',serif;background:transparent}

/* Lin.bin 439bed wide chat: frame431 (640x149) at y331, 24px above frame406.
   Fixed controls keep their absolute positions; HP/MP (608000 +20/+28 y374->350),
   chat (48dcdc 402->378, 5->7 lines) and scroll control 3 (y401->377) rise 24. */
.pc-hud .pc-chat-size{position:absolute;left:479px;top:110px;width:14px;height:14px;min-height:0;margin:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;cursor:pointer;z-index:2}
.pc-hud .pc-chat-size:focus-visible{outline:1px solid #e9dbb5;outline-offset:0}
.pc-hud.chat-wide{background-image:none}
.pc-hud.chat-wide::before{content:'';position:absolute;left:0;top:-24px;width:640px;height:149px;background:url('/assets/original-windows/original-hud/431.png') 0 0/640px 149px no-repeat;pointer-events:none}
.pc-hud.chat-wide .hp,.pc-hud.chat-wide .mp{top:-5px}
.pc-hud.chat-wide .world-chat{top:20px;height:86px}
.pc-hud.chat-wide #chat-history{max-height:86px}
.game.mobile-layout .pc-hud .pc-chat-size,.game.mobile-layout .pc-hud.chat-wide::before{display:none}
/* Lin.bin 435c0e-435dbb: native chat scroll controls on the frame's gold track; the browser scrollbar is hidden. */
.pc-hud #chat-history{scrollbar-width:none}
.pc-hud #chat-history::-webkit-scrollbar{display:none;width:0;height:0}
.pc-hud .pc-chat-scroll{position:absolute;left:481px;width:11px;height:11px;min-width:0;min-height:0;margin:0;padding:0;border:0;border-radius:0;background:transparent no-repeat 0 0/11px 11px;box-shadow:none;cursor:pointer;z-index:2;image-rendering:pixelated}
.pc-hud .pc-chat-up{top:46px}.pc-hud .pc-chat-down{top:96px}
.pc-hud.chat-wide .pc-chat-up{top:22px}
.pc-hud .pc-chat-scroll:focus-visible{outline:1px solid #e9dbb5;outline-offset:0}
.pc-hud .pc-chat-track{position:absolute;left:481px;top:60px;width:10px;height:32px;z-index:2;cursor:pointer;touch-action:none}
.pc-hud.chat-wide .pc-chat-track{top:36px;height:56px}
.game.mobile-layout .pc-hud .pc-chat-scroll,.game.mobile-layout .pc-hud .pc-chat-track{display:none}
