.sp i{background:linear-gradient(#91e9ff,#3189cf)}.actions{width:250px;height:190px}.actions .skill{width:72px;height:72px}.actions .skill1{left:73px;top:0}.actions .skill2{left:0;top:38px}.actions .dash{width:59px;height:59px;left:61px;bottom:0}.actions .interact{width:55px;height:55px}.skill b,.dash b{font-size:8px;font-weight:400}#cooldown,#cooldown2,#dashCooldown{position:absolute;inset:0;border-radius:50%;display:none;align-items:center;justify-content:center;background:#09172ddd;font-size:21px;color:#fff;font-style:normal}.dialog{max-height:82vh;overflow:auto}#detailBody .grid{display:grid;grid-template-columns:repeat(2,1fr);gap:7px;text-align:left}#detailBody button{width:100%;margin:3px 0}#detailBody .card{border:1px solid #567087;padding:8px;background:#102039}#detailBody strong{color:#f2d68c}@media(max-width:650px){.menubar button{min-width:34px;font-size:0}.menubar button span{width:32px;height:32px}.quest{display:none}.gamelog{width:48vw}.playerhud{width:310px}}
.actions .autoToggle{position:absolute;right:0;bottom:104px;width:99px;height:34px;border-radius:6px;background:linear-gradient(#355c78,#162b47);border:2px solid #d8b869;font-size:10px;display:flex;flex-direction:row;gap:5px}.actions .autoToggle span{font-size:16px}.actions .autoToggle.active{background:linear-gradient(#6a884f,#294b3d);color:#fff2ad}
.respawnButton{position:absolute;top:32%;left:50%;transform:translateX(-50%);z-index:6;background:linear-gradient(#e8cc85,#ab894a);color:#182c3b;border:2px solid #f5dfa0;border-radius:6px;padding:10px 30px;font-weight:700;box-shadow:0 4px 15px #0008}
.deathPanel{position:absolute;inset:0;z-index:8;display:grid;place-items:center;background:#070e18aa}.deathCard{width:310px;text-align:center;padding:28px;background:linear-gradient(#203957,#101c33);border:2px solid #b29a58;box-shadow:0 0 0 3px #102238,0 8px 30px #000b;border-radius:8px}.deathIcon{font-size:46px;color:#e87979}.deathCard h2{color:#f0d18b;margin:8px}.deathCard p{color:#c7d4da;font-size:12px}.deathCard button{margin-top:10px;padding:10px 30px;background:#b38c4a;border:1px solid #f2d58b;color:#172739;border-radius:4px;font-weight:700}.deathCard button:disabled{opacity:.45;cursor:not-allowed}
.deathPanel[hidden]{display:none!important}
.equipHero{display:flex;align-items:center;gap:14px;padding:10px;background:linear-gradient(90deg,#172d48,#243e56);border:1px solid #987d43;text-align:left}.equipPortrait{width:62px;height:74px;display:grid;place-items:center;font-size:48px;color:#e2bd70;background:radial-gradient(#81643c,#172238 70%);border:1px solid #c7a95f}.equipHero p{margin:5px 0 0;color:#a9c1c9;font-size:10px}.equipSlots{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin:10px 0}.equipSlot{display:flex;align-items:center;gap:6px;min-height:57px;padding:6px;background:#182b40;border:1px solid #64798a;text-align:left}.equipIcon{font-size:22px;color:#d6b765}.equipSlot small,.equipItem small{display:block;color:#8fa8b7;font-size:9px}.equipSlot strong{display:block;color:#f0d48d;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:95px}.equipSlot em{display:block;color:#8fdda5;font-size:9px;font-style:normal}.equipHeading{border-bottom:1px solid #8b7546;padding-bottom:5px;text-align:left;color:#e8cc87}.equipInventory{display:grid;grid-template-columns:repeat(2,1fr);gap:6px;text-align:left}.equipItem{padding:7px;background:#102238;border:1px solid #405b70}.equipItem>span{display:block;color:#d8e7eb;font-size:10px}.equipItem button{margin-top:5px;padding:3px 9px;border:1px solid #aa8b4d;background:#29445a;border-radius:3px;font-size:9px}.equipItem button:disabled{opacity:.4}@media(max-width:600px){.equipSlots{grid-template-columns:1fr}.equipInventory{grid-template-columns:1fr}}
.autoToggle{width:72px!important;height:72px!important;border-radius:50%!important;right:88px!important;bottom:86px!important;font-size:9px!important}.autoToggle span{font-size:22px!important}.autoToggle small{display:none}
#respawnButton{display:none!important;visibility:hidden!important}
.actions .autoToggle{right:8px!important;bottom:108px!important;z-index:4;width:72px!important;height:72px!important;border-radius:50%!important}
.actions .autoToggle{pointer-events:auto!important;z-index:20!important}
.actions .autoToggle{right:8px!important;bottom:182px!important;width:78px!important;height:78px!important}.actions .autoToggle small{display:block!important;top:4px!important;position:absolute!important}
.actions .autoToggle{cursor:pointer!important;user-select:none!important}
.nameInput{display:block;width:100%;margin:16px 0 8px;padding:10px;border:1px solid #b29a58;background:#101f32;color:#f7e8bd;border-radius:4px;text-align:center}.nameInput::placeholder{color:#8fa2ad}

.playerGif{position:absolute;display:none;pointer-events:none;width:108px;height:108px;object-fit:contain;image-rendering:pixelated;z-index:2;transform:translate(-50%,-83%)}
.equipSlots{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.equipSlot{width:100%;margin:0!important;color:inherit}.equipSlot:last-child{grid-column:1/-1}.equipSlot:disabled{opacity:.72;cursor:default}.equipSlot.filled{border-color:#c5a65c;background:linear-gradient(135deg,#203a52,#17283c)}.equipSlot>span:last-child{min-width:0}.equipSlot em{white-space:normal}.statCompare{margin:10px 0;padding:9px;border:1px solid #745f35;background:#0c1a2b}.statCompare h3{margin:0 0 7px;color:#ead18e;text-align:left}.statCompare>div{display:grid;grid-template-columns:45px 1fr 20px 1fr;align-items:center;padding:4px 7px;border-top:1px solid #34485a;text-align:center}.statCompare small{text-align:left;color:#93a9b6}.statCompare b{color:#d9e3e8}.statCompare span{color:#8da0ab}.statCompare strong{color:#d9e3e8}.statCompare .statUp{color:#7fe39a}.statCompare .statDown{color:#ef8b8b}.equipItem.selected{border-color:#e2bf68;box-shadow:inset 0 0 0 1px #806a38}.equipItemActions{display:grid;grid-template-columns:1fr 1fr;gap:5px}.equipItemActions button{width:100%;margin-top:6px!important}.equipItem small{min-height:30px}.equipInventory{max-height:245px;overflow:auto;padding-right:3px}
.equipmentMode{background:#050505d9}.equipmentMode .dialog{width:min(780px,94vw);max-width:780px;padding:30px 34px;background:#1a181b;border:22px solid transparent;border-image:url('assets/ui/equipment-frame.png') 28 fill stretch;box-shadow:0 15px 55px #000,0 0 0 2px #8f7b53;color:#d9d1bd}.equipmentMode #detailTitle{min-height:34px;margin:-12px auto 14px;padding:6px 50px;background:url('assets/ui/equipment-title-bar.png') center/100% 100% no-repeat;color:#e7dbc0;text-shadow:0 2px #000;font-size:19px}.equipmentMode .close{right:25px;top:20px;color:#d9c493;z-index:2}.equipmentMode .equipHero{background:#181619;border:1px solid #76694e;box-shadow:inset 0 0 18px #000}.equipmentMode .equipPortrait{width:72px;height:72px;border:0;border-radius:50%;background:#211f21 url('assets/ui/equipment-portrait-ring.png') center/100% 100% no-repeat;color:#d8c59c}.equipmentMode .equipSlots{grid-template-columns:repeat(5,minmax(0,1fr));gap:7px}.equipmentMode .equipSlot:last-child{grid-column:auto}.equipmentMode .equipSlot{min-height:84px;display:flex;flex-direction:column;justify-content:center;background:linear-gradient(#29272a,#171619);border:1px solid #76694e;box-shadow:inset 0 0 0 1px #111}.equipmentMode .equipSlot.filled{background:linear-gradient(#35312c,#1b1919);border-color:#aa9567}.equipmentMode .equipSlot strong{max-width:115px;color:#e2d4b5}.equipmentMode .statCompare,.equipmentMode .equipInventory{background:#171619;border:12px solid transparent;border-image:url('assets/ui/equipment-frame.png') 25 fill stretch}.equipmentMode .statCompare{display:grid;grid-template-columns:repeat(4,1fr);gap:4px}.equipmentMode .statCompare h3{grid-column:1/-1;text-align:center}.equipmentMode .statCompare>div{grid-template-columns:1fr;gap:2px;padding:6px;border:1px solid #514a3b}.equipmentMode .statCompare small{text-align:center}.equipmentMode .statCompare span{display:none}.equipmentMode .equipHeading{color:#d7c49b;border-color:#76694e}.equipmentMode .equipItem{background:#201e20;border-color:#5f5747}.equipmentMode .equipItem.selected{border-color:#c6ad78}.equipmentMode .equipItem button{background:linear-gradient(#4a4338,#25221f);border-color:#8d7b58;color:#e9dec5}.equipmentMode .equipItem button:hover{filter:brightness(1.25)}.equipmentMode #jobdesc{color:#a99d84}@media(max-width:760px){.equipmentMode .dialog{padding:25px 22px;border-width:16px}.equipmentMode .equipSlots{grid-template-columns:repeat(2,1fr)}.equipmentMode .equipSlot:last-child{grid-column:1/-1}.equipmentMode .statCompare{grid-template-columns:repeat(2,1fr)}}
.bagMode .dialog{width:min(650px,92vw);max-width:650px}.bagMode .bagSummary{display:flex;align-items:center;gap:12px;padding:12px;margin-bottom:10px;background:linear-gradient(90deg,#203751,#13243a);border:1px solid #9b824c;text-align:left}.bagMode .bagSummary>span{font-size:36px;color:#e0bf73}.bagMode .bagSummary b,.bagMode .bagSummary small{display:block}.bagMode .bagSummary small{color:#9fb2bc;margin-top:4px}.bagMode .equipInventory{grid-template-columns:repeat(2,minmax(0,1fr));max-height:390px}.bagMode .bagEmpty{grid-column:1/-1;padding:35px;text-align:center;color:#879aa5;border:1px dashed #52697a}.bagMode .statCompare{background:#101f32}.bagMode .equipItem{min-height:105px}.bagMode .equipItem.selected{background:#1d3145}@media(max-width:600px){.bagMode .equipInventory{grid-template-columns:1fr}}
.bagMode{background:#07101faa}.bagMode .dialog{width:min(900px,96vw);max-width:900px;padding:0;overflow:hidden;background:#dce6f3;border:3px solid #203e6b;color:#213651}.bagMode #detailTitle{margin:0;padding:13px 22px;background:linear-gradient(#294c7c,#172f56);color:#fff;text-align:left;font-size:22px}.bagMode .close{top:8px;right:10px;width:36px;height:36px;border:1px solid #8299ba;background:#203d68;color:#fff}.inventoryWindow{display:grid;grid-template-columns:145px 1fr;min-height:520px}.inventoryCategories{display:flex;flex-direction:column;background:linear-gradient(#244773,#18355e);border-right:2px solid #17345b}.inventoryCategories button{width:100%!important;min-height:66px;margin:0!important;padding:9px 12px!important;border:0!important;border-bottom:1px solid #58769d!important;border-radius:0!important;background:transparent!important;color:#eaf3ff!important;text-align:left}.inventoryCategories button span{display:inline-block;width:30px;font-size:20px}.inventoryCategories button.active{background:linear-gradient(90deg,#315f9e,#244b81)!important;box-shadow:inset 4px 0 #f1c85c}.inventoryCategories button:disabled{opacity:.48}.inventoryMain{padding:12px;min-width:0}.inventoryTools{display:grid;grid-template-columns:minmax(150px,1fr) 110px auto auto;gap:8px;align-items:center;margin-bottom:10px}.inventoryTools input,.inventoryTools select{height:36px;border:1px solid #9bb0cb;border-radius:5px;background:#fff;color:#29405e;padding:0 10px}.inventoryTools span,.inventoryTools b{padding:9px 11px;border-radius:5px;background:#17345b;color:#fff;white-space:nowrap}.inventoryTools b{color:#ffd55f}.inventoryGrid{display:grid;grid-template-columns:repeat(8,minmax(48px,1fr));gap:5px;padding:7px;background:#c5d3e5;border:1px solid #9aafca;border-radius:6px}.inventoryCell{position:relative!important;aspect-ratio:1;width:100%!important;margin:0!important;padding:3px!important;display:grid;place-items:center;border:1px solid #afc0d4!important;border-radius:5px!important;background:linear-gradient(#f8fbff,#e7eef7)!important;color:#29476e!important}.inventoryCell>span{font-size:23px}.inventoryCell>b{position:absolute;right:4px;bottom:2px;font-size:10px;color:#fff;background:#244b7a;border-radius:8px;padding:1px 5px}.inventoryCell>small{position:absolute;left:2px;right:2px;bottom:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:7px;color:#354e6d}.inventoryCell:not(.empty)>small{bottom:17px}.inventoryCell.empty{box-shadow:inset 0 0 0 1px #fff}.inventoryCell.selected{outline:3px solid #e4ad35;outline-offset:-3px;background:#fff5d5!important}.bagItemDetail{display:grid;grid-template-columns:54px 1fr 110px;gap:10px;align-items:center;margin-top:10px;padding:9px;background:#eef4fb;border:1px solid #9db2cc;text-align:left}.bagItemIcon{display:grid;place-items:center;width:50px;height:50px;background:#fff;border:1px solid #aabbd0;font-size:27px}.bagItemDetail strong,.bagItemDetail small{display:block}.bagItemDetail strong{color:#24476f}.bagItemDetail small{color:#5c7088;margin-top:4px}.bagItemDetail button{height:38px;background:linear-gradient(#d6ad4e,#9c7026)!important;border:1px solid #75521e!important;color:#fff!important}.emptyDetail{display:block;padding:22px;text-align:center;color:#71839a}.compactCompare{display:grid;grid-template-columns:repeat(4,1fr);margin:7px 0 0;padding:5px;background:#d2deed;border-color:#9cb0c9}.compactCompare h3{grid-column:1/-1;margin:2px;color:#29476d}.compactCompare>div{padding:3px;border-top-color:#aebed1}.compactCompare small{color:#4d6380}.bagMode #jobdesc{margin:0;padding:8px 14px;background:#c4d2e3;color:#405670}@media(max-width:760px){.inventoryWindow{grid-template-columns:92px 1fr}.inventoryCategories button{font-size:9px}.inventoryCategories button span{width:22px}.inventoryTools{grid-template-columns:1fr 90px}.inventoryTools span,.inventoryTools b{font-size:9px}.inventoryGrid{grid-template-columns:repeat(5,1fr)}.bagItemDetail{grid-template-columns:45px 1fr}.bagItemDetail button{grid-column:1/-1}}
.equipmentMode{background:#061326d9}.equipmentMode .dialog{width:min(720px,95vw);max-width:720px;padding:22px 27px;background:linear-gradient(#f7f0da,#d8c9a7);border:7px ridge #c79d36;box-shadow:0 0 0 3px #173d76,0 14px 50px #000b;color:#3d3528}.equipmentMode #detailTitle{margin:-22px -27px 8px;padding:10px 60px;background:linear-gradient(#155ca7,#073976);border-bottom:4px solid #d5aa43;color:#ffe08a;font-size:23px}.equipIdentity{display:flex;justify-content:center;gap:8px;padding:6px;margin-bottom:7px;background:#fff8e8;border:1px solid #bda56e}.equipIdentity b{color:#6b4921}.equipIdentity span{color:#746751}.equipmentLayout{display:grid;grid-template-columns:1fr 170px 1fr;gap:8px;align-items:stretch}.slotColumn{display:flex;flex-direction:column;gap:5px}.equipmentMode .equipSlot{min-height:54px;display:grid;grid-template-columns:43px 1fr;align-items:center;padding:5px!important;margin:0!important;background:linear-gradient(#f4f4f2,#d9dde0)!important;border:1px solid #a8a18e!important;border-radius:5px;color:#4d4a44;text-align:left}.equipmentMode .equipSlot.selected{border:2px solid #4f9aeb!important;background:#e8f3ff!important}.equipmentMode .equipSlot.filled{background:linear-gradient(#fff8db,#e8d9a9)!important}.equipmentMode .equipIcon{display:grid;place-items:center;width:38px;height:38px;border:1px solid #b6b09f;background:#eeeae0;color:#6d6556}.equipmentMode .equipSlot small{color:#9a886c}.equipmentMode .equipSlot strong{max-width:130px;color:#4f4536}.equipmentMode .equipSlot em{color:#658071;font-size:8px}.equipmentAvatar{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:295px;overflow:hidden;border:1px solid #c3ab78;background:radial-gradient(circle,#fffdf4 0,#eee3c7 52%,#d2bf98 100%)}.equipmentAvatar:before{content:'✦';position:absolute;font-size:150px;color:#a9915b20}.equipmentAvatar .avatarGlow{position:absolute;width:120px;height:210px;border-radius:50%;background:#f8e9aa55;filter:blur(10px)}.equipmentAvatar img{position:relative;width:120px;height:120px;object-fit:contain;image-rendering:pixelated;z-index:1}.equipmentAvatar small{position:relative;margin-top:7px;padding:3px 10px;background:#fff7dfaa;color:#604b2c;z-index:1}.selectedEquipment{display:grid;grid-template-columns:58px 1fr 110px 80px;gap:9px;align-items:center;margin-top:8px;padding:8px;background:#fffaf0;border:1px solid #b99c61;text-align:left}.selectedIcon{display:grid;place-items:center;width:54px;height:54px;background:#eee7d8;border:1px solid #b8aa8d;font-size:29px}.selectedEquipment small,.selectedEquipment strong,.selectedEquipment em{display:block}.selectedEquipment small{color:#9a8059}.selectedEquipment strong{color:#3c4864;font-size:14px}.selectedEquipment em{color:#64806b;font-size:9px;font-style:normal}.selectedEquipment button{height:36px;margin:0!important;background:linear-gradient(#3276bb,#164b89)!important;border:1px solid #123d70!important;color:#fff!important}.selectedEquipment #unequipSelected{background:linear-gradient(#ddd4c3,#aaa08e)!important;border-color:#817664!important}.equipmentMode .currentStats{grid-template-columns:repeat(4,1fr);padding:6px;margin:7px 0 0;background:#eee4ce;border:1px solid #b99c61}.equipmentMode .currentStats h3{color:#705a32}.equipmentMode #jobdesc{margin:5px 0 -10px;color:#725f40}@media(max-width:670px){.equipmentLayout{grid-template-columns:1fr 110px 1fr}.equipmentAvatar img{width:90px;height:90px}.equipmentMode .equipSlot{grid-template-columns:32px 1fr}.equipmentMode .equipIcon{width:29px;height:29px}.equipmentMode .equipSlot em{display:none}.selectedEquipment{grid-template-columns:48px 1fr}.selectedEquipment button{grid-column:auto}.equipmentMode #detailTitle{font-size:17px}}
.radialActions{position:absolute!important;right:18px!important;bottom:20px!important;width:300px!important;height:350px!important;transform:none!important;pointer-events:none}.radialActions button,.radialActions .quickSlot{pointer-events:auto}.radialActions .attack{position:absolute!important;right:4px!important;bottom:0!important;width:116px!important;height:116px!important;border-radius:50%!important;background:radial-gradient(circle at 45% 35%,#4f718b,#142b42 68%)!important;border:4px solid #b89948!important;box-shadow:0 0 0 4px #18344c,0 0 0 6px #856d33,0 8px 18px #0009!important;color:#f4e4ad!important}.radialActions .attack span{font-size:48px!important;line-height:1}.radialActions .attack small{position:absolute;top:-8px;left:23px;right:23px;padding:2px;background:#293341;border:1px solid #b89948;border-radius:8px;color:#f3d780;font-size:11px}.radialActions .autoToggle{position:absolute!important;right:16px!important;bottom:215px!important;width:72px!important;height:72px!important;display:grid!important;place-items:center!important;border-radius:50%!important;background:radial-gradient(#486477,#20374a 68%)!important;border:3px solid #b89948!important;box-shadow:0 0 0 3px #19344b,0 5px 12px #0008!important;color:#f4dfa4!important}.radialActions .autoToggle small{display:block!important;position:absolute!important;top:-8px!important;right:10px!important;width:20px;height:20px;border-radius:50%;background:#263444;border:1px solid #d1ac4b;line-height:18px}.radialActions .autoToggle span{font-size:30px!important}.radialActions .autoToggle b{position:absolute;left:4px;right:4px;bottom:-7px;padding:1px;border:1px solid #a88b47;background:#29343d;border-radius:4px;font-size:9px}.quickSlot{position:absolute;display:grid;place-items:center;width:56px;height:56px;border-radius:50%;background:#718b8f55;border:2px solid #a99357;box-shadow:inset 0 0 0 3px #263e4a88,0 3px 9px #0007}.quickSlot:after{content:'';position:absolute;inset:6px;border:1px solid #b9c3b866;border-radius:50%}.quickSlot b{position:absolute;top:-10px;right:17px;width:19px;height:19px;display:grid;place-items:center;border-radius:50%;background:#273846;border:1px solid #c2a453;color:#e6d38d;font-size:11px;z-index:1}.quickSlot.q1{left:83px;bottom:2px}.quickSlot.q2{left:88px;bottom:137px}.quickSlot.q3{right:104px;bottom:190px}.quickSlot.q4{right:16px;bottom:143px}.quickSlot.q5{left:18px;bottom:28px}.quickSlot.q6{left:0;bottom:94px}.quickSlot.q7{left:28px;bottom:160px}.quickSlot.q8{left:82px;bottom:220px}.quickSlot.q9{right:86px;bottom:278px}@media(max-width:700px){.radialActions{transform:scale(.78)!important;transform-origin:bottom right!important;right:8px!important;bottom:8px!important}}

footer #newSave{margin-left:auto;background:#8d5b35;color:#fff3cf;border:1px solid #d9b866;border-radius:6px;padding:4px 10px;cursor:pointer;font-weight:700}footer #newSave:hover{filter:brightness(1.15)}
.onlineLogin{position:fixed;inset:0;z-index:9999;display:grid;place-items:center;background:rgba(5,12,20,.88);backdrop-filter:blur(8px)}.onlineLogin.hidden{display:none}.onlineCard{width:min(400px,88vw);padding:30px;text-align:center;background:#17283b;color:#f9e9be;border:2px solid #d3ad55}.onlineCard input{box-sizing:border-box;width:100%;margin:7px 0;padding:12px;border:1px solid #8fa7bd;border-radius:7px;background:#f6f1e5;color:#182637;font-size:16px}.onlineCard button{margin:12px 5px 0;padding:10px 18px}.onlineCard small{display:block;min-height:22px;margin-top:10px;color:#ff9d91}.onlinePanel{position:fixed;z-index:1200;left:18px;bottom:38px;width:310px;height:220px;display:flex;flex-direction:column;background:rgba(12,28,43,.92);border:2px solid #c9a955;border-radius:10px;color:#fff;box-shadow:0 8px 30px #0008}.onlinePanel.hidden{display:none}.onlinePanel header{display:flex;justify-content:space-between;padding:8px 10px;background:#203f61;color:#ffe6a3}.onlinePanel header button{font-size:11px}.onlinePanel #chatMessages{flex:1;overflow:auto;padding:7px 10px;font-size:13px}.onlinePanel #chatMessages p{margin:3px 0}.onlinePanel #chatMessages b{color:#ffd978}.onlinePanel form{display:flex;padding:7px;gap:5px}.onlinePanel form input{min-width:0;flex:1;padding:7px}.onlinePanel form button{padding:6px 10px}@media(max-width:700px){.onlinePanel{left:8px;bottom:35px;width:270px;height:175px}}
.remotePlayers{position:fixed;inset:0;z-index:18;pointer-events:none}.remotePlayer{position:absolute;transform:translate3d(-50%,-82%,0);will-change:left,top;backface-visibility:hidden;width:105px;height:105px}.remotePlayer img{width:105px;height:105px;image-rendering:pixelated}.remotePlayer span{position:absolute;z-index:2;left:50%;top:-6px;transform:translateX(-50%);white-space:nowrap;padding:2px 6px;border-radius:8px;background:#102033cc;color:#ffe8aa;font:700 12px Tahoma;text-shadow:1px 1px #000}
.storageLayout{display:grid;grid-template-columns:1fr 1fr;gap:14px;min-height:360px}.storageLayout section{background:rgba(8,18,31,.72);border:1px solid #8f7543;padding:12px;overflow:auto}.storageLayout h3{margin:0 0 10px;color:#f0d589;display:flex;justify-content:space-between}.storageLayout h3 small{color:#b8c8d5}.storageItem{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px;margin-bottom:6px;background:rgba(255,255,255,.06);border:1px solid rgba(210,180,105,.35)}.storageItem span{display:flex;flex-direction:column}.storageItem small{color:#aebdcc}.storageItem button{min-width:64px}.storageEmpty{padding:20px;text-align:center;color:#9aa8b3}@media(max-width:760px){.storageLayout{grid-template-columns:1fr;min-height:0}}
.shopHeader{display:flex;justify-content:space-between;align-items:center;padding:10px 14px;margin-bottom:12px;background:rgba(7,21,38,.8);border:1px solid #977b43;color:#d2d9dc}.shopHeader b,.shopPrice{color:#f3d06f}.shopGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.shopItem{display:grid;grid-template-columns:38px minmax(0,1fr) auto;grid-template-rows:auto auto;align-items:center;gap:4px 9px;padding:9px;background:linear-gradient(120deg,rgba(17,39,61,.96),rgba(33,53,70,.94));border:1px solid rgba(201,172,105,.52);border-radius:5px}.shopIcon{grid-row:1/3;width:36px;height:36px;display:grid;place-items:center;font-size:22px;background:#0d1b2b;border:1px solid #8a7449;color:#f0d58f}.shopInfo{min-width:0;display:flex;flex-direction:column}.shopInfo strong{color:#f4dda0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.shopInfo small{color:#bdc9ce;font-size:11px}.shopPrice{font-weight:bold;font-size:13px}.shopItem button{grid-column:2/4;justify-self:end;width:auto!important;min-width:78px;padding:5px 12px}.shopItem button:disabled{opacity:.45}@media(max-width:650px){.shopGrid{grid-template-columns:1fr}}
.remotePlayer i{position:absolute;left:50%;transform:translateX(-50%);display:block;height:4px;width:42px;border:1px solid #0c1720;border-radius:2px;box-shadow:0 1px 2px #0009;z-index:2}.remotePlayer .remoteHp{top:102%;background:linear-gradient(to right,#ef5368 var(--fill),#713441 var(--fill))}.remotePlayer .remoteMp{top:108%;background:linear-gradient(to right,#50c4f2 var(--fill),#244e7a var(--fill))}
.onlinePanel.ornate{height:270px}.onlinePanel.ornate:before,.onlinePanel.ornate:after{display:none}.onlinePanel header{align-items:center;gap:6px;min-height:38px}.onlinePanel header b{font-size:11px;white-space:nowrap}.onlinePanel header b small{color:#b8c8d5;font-size:9px;font-weight:400}.onlinePanel header>div{display:flex;gap:4px}.onlinePanel header button{padding:3px 6px;background:#172b40;border:1px solid #75899a;border-radius:3px;color:#e7edf1;white-space:nowrap}.onlinePanel #chatMessages{display:flex;flex-direction:column;gap:2px}.onlinePanel #chatMessages p{padding:3px 5px;border-left:2px solid transparent;border-radius:2px;line-height:1.45;overflow-wrap:anywhere}.onlinePanel #chatMessages p.systemMessage{border-left-color:#d6b75d;background:#d6b75d12;color:#f0dca3}.onlinePanel #chatMessages p.playerMessage{border-left-color:#63b9df;color:#e1edf7}.onlinePanel #chatMessages p time{color:#8fa5b5;font-size:9px}.onlinePanel.collapsed{height:42px}.onlinePanel.collapsed #chatMessages,.onlinePanel.collapsed #chatForm{display:none}.onlinePanel #chatForm{border-top:1px solid #7890a044}

.onlinePanel.ornate{background:rgba(12,28,43,.78);backdrop-filter:blur(5px);box-shadow:0 8px 24px #0006}.onlinePanel header{background:rgba(32,63,97,.78);cursor:grab;touch-action:none;user-select:none}.onlinePanel header:active{cursor:grabbing}.chatRestore{position:fixed;z-index:1201;left:18px;bottom:38px;padding:8px 14px;border:1px solid #d0b25e;border-radius:18px;background:rgba(20,43,64,.82);color:#ffe6a3;box-shadow:0 3px 12px #0006;backdrop-filter:blur(5px)}.chatRestore:hover{background:rgba(35,67,94,.92)}@media(max-width:700px){.onlinePanel.ornate{width:270px;height:200px}}

#details.statusMode .dialog{width:min(650px,95vw);max-width:650px;padding:22px 24px;background:linear-gradient(145deg,#152f4a,#101d31);border-color:#6f91a5;box-shadow:0 0 0 2px #263c4e,0 0 0 4px #a68e50,inset 0 0 0 2px #38556c}#details.statusMode #detailTitle{margin:0 0 12px;padding:5px 10px;text-align:left;font:700 16px Tahoma,sans-serif;color:#eaf3f8;background:linear-gradient(90deg,#214b6d,#142c46);border:1px solid #738a99}#details.statusMode #detailBody{line-height:1.35}.statusPanel{display:grid;grid-template-columns:1fr 1.1fr;gap:12px;color:#dce8ed;font:12px Tahoma,sans-serif}.statusAttributes,.statusDerived{padding:8px;background:rgba(5,15,26,.52);border:1px solid #556f82}.statusAttribute{display:grid;grid-template-columns:34px 32px minmax(0,1fr) 25px;align-items:center;gap:4px;min-height:27px;border-bottom:1px solid #52677955}.statusAttribute:last-child{border-bottom:0}.statusAttribute>b{color:#d7e5eb}.statusAttribute>span{padding:2px 5px;color:#243442;background:#e6edf0;border:1px solid #95a8b3;min-width:25px;text-align:center}.statusAttribute>small{color:#9fb2bd;font-size:10px;white-space:nowrap}.statusAttribute>button{width:23px!important;height:22px;padding:0!important;margin:0!important;background:linear-gradient(#f0f4f5,#b7c7d0)!important;border:1px solid #718896!important;border-radius:3px;color:#17364c!important;font-size:17px!important;line-height:16px}.statusAttribute>button:disabled{opacity:.35;cursor:default}.statusDerivedTitle{grid-column:1/-1;margin-bottom:5px;padding-bottom:5px;border-bottom:1px solid #8294a0;color:#c3d8e2;font-weight:700}.statusDerived{display:grid;grid-template-columns:1fr 1fr;align-content:start;gap:0 12px}.statusDerivedRow{display:flex;justify-content:space-between;gap:7px;padding:4px 3px;border-bottom:1px solid #52677955}.statusDerivedRow span{color:#a9bdc7}.statusDerivedRow b{color:#f0e4bd;font-weight:600}.statusPoints{grid-column:1/-1;display:flex;align-items:center;gap:12px;padding:8px 10px;background:#10243a;border:1px solid #657f91}.statusPoints span{font-weight:700;color:#e4d18d}.statusPoints b{margin-left:6px;color:#f7f1db}.statusPoints small{margin-left:auto;color:#a9bdc7;font-size:10px}#details.statusMode #jobdesc{margin:9px 0 0;font-size:10px;color:#aebfc8;text-align:left}@media(max-width:560px){#details.statusMode .dialog{padding:16px}.statusPanel{grid-template-columns:1fr;gap:7px}.statusDerived{grid-template-columns:1fr 1fr}.statusAttribute>small{white-space:normal}}

/* Compact play layout for phones. Keeps the middle of the world clear. */
@media (max-width:950px) and (max-height:600px), (max-width:520px), (pointer:coarse){
 body{overscroll-behavior:none;touch-action:none;-webkit-user-select:none;user-select:none}
 .playerhud{top:max(7px,env(safe-area-inset-top));left:max(7px,env(safe-area-inset-left));width:220px;padding:6px;gap:6px;transform:none!important;background:rgba(13,31,48,.82)}
 .portrait{width:43px;height:55px}.portrait span,.hudfoot,.wallet{display:none}.playerstats{min-width:0}.name{font-size:10px;padding-bottom:2px}.classline{margin:2px 0;font-size:8px}.playerstats label{margin:3px 0}.playerstats label>b{width:18px;font-size:7px}.playerstats label>span{font-size:7px}.bar{height:8px}
 .menubar{top:max(7px,env(safe-area-inset-top));left:238px;right:7px;gap:5px;overflow-x:auto;justify-content:flex-end;padding:1px 2px 5px;scrollbar-width:none}.menubar::-webkit-scrollbar{display:none}.menubar button{flex:0 0 32px;min-width:32px!important}.menubar button>span{width:30px!important;height:30px!important;margin:0!important;font-size:17px!important;border-radius:8px}
 .worldtitle,.quest,.minimap,footer{display:none!important}
 .joystick{left:max(14px,env(safe-area-inset-left));bottom:max(14px,env(safe-area-inset-bottom));width:118px;height:118px;transform:none!important;touch-action:none;opacity:.78}.joystick button{display:none}.joycenter{inset:34px;font-size:30px;transition:transform .04s linear}.compass{display:none}
 .radialActions{right:max(8px,env(safe-area-inset-right))!important;bottom:max(6px,env(safe-area-inset-bottom))!important;width:170px!important;height:180px!important;transform:none!important}.radialActions .attack{width:88px!important;height:88px!important;right:0!important}.radialActions .attack span{font-size:34px!important}.radialActions .attack small{display:none}.radialActions .autoToggle{width:54px!important;height:54px!important;right:16px!important;bottom:112px!important}.radialActions .autoToggle span{font-size:22px!important}.radialActions .autoToggle b{font-size:7px}.quickSlot{display:none}
 .onlinePanel.ornate{left:6px!important;right:6px!important;top:auto!important;bottom:6px!important;width:auto!important;height:42vh!important;max-height:250px}.chatRestore{left:50%!important;bottom:max(8px,env(safe-area-inset-bottom))!important;transform:translateX(-50%);padding:6px 12px;font-size:10px}
 .overlay{padding:8px}.dialog{max-height:94dvh;padding:18px}.onlineCard{width:min(360px,94vw);padding:20px}.onlineCard input{font-size:16px}
 #toast{top:18%;max-width:82%;padding:7px 16px;font-size:11px}
}
@media (max-width:520px) and (orientation:portrait){
 .playerhud{width:205px}.menubar{top:104px;left:7px;justify-content:flex-start}.menubar button{flex-basis:31px}.joystick{width:112px;height:112px}.joycenter{inset:32px}.radialActions{width:150px!important}.radialActions .attack{width:82px!important;height:82px!important}
 .equipmentLayout{grid-template-columns:1fr 82px 1fr}.equipmentAvatar{min-height:230px}.equipmentMode .dialog,.bagMode .dialog{width:96vw;max-height:94dvh}.inventoryWindow{grid-template-columns:70px 1fr}.inventoryGrid{grid-template-columns:repeat(4,1fr)}
}

.shopGroup{margin:0 0 15px}.shopGroup>h3{margin:0 0 6px;padding:5px 8px;color:#e9cf8d;border-bottom:1px solid #7f6b43;text-align:left}.shopInfo em,.bagItemDetail em{font-size:10px;font-style:normal;font-weight:700}.rarity-common{--rarity:#dce7ee}.rarity-uncommon{--rarity:#67d58a}.rarity-rare{--rarity:#67a9ff}.shopItem[class*="rarity-"]{border-left:4px solid var(--rarity)}.inventoryCell[class*="rarity-"]{box-shadow:inset 0 0 0 2px var(--rarity)!important}.bagItemDetail[class*="rarity-"]{border-left:5px solid var(--rarity)}

.itemIconImage{display:block;width:100%;height:100%;object-fit:contain;image-rendering:auto}.shopIcon{width:54px;height:54px;padding:2px}.shopItem{grid-template-columns:56px minmax(0,1fr) auto}.inventoryCell .itemIconImage{width:42px;height:42px}.bagItemIcon .itemIconImage{width:48px;height:48px}.equipIcon .itemIconImage{width:38px;height:38px}

.mapLoading{position:fixed;inset:0;z-index:100;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;background:radial-gradient(circle at center,#193b54 0,#081421 58%,#03080e 100%);color:#f4dda0;text-align:center}.mapLoadingRune{font-size:58px;color:#8fdcff;text-shadow:0 0 24px #67cbff;animation:mapLoadingPulse .7s ease-in-out infinite alternate}.mapLoading b{font-size:20px;letter-spacing:1px}.mapLoading small{color:#9fb8c8}@keyframes mapLoadingPulse{from{transform:scale(.82) rotate(-12deg);opacity:.55}to{transform:scale(1.08) rotate(12deg);opacity:1}}
.onlinePanel{left:14px;bottom:32px;width:340px;height:205px;min-width:260px;min-height:145px;max-width:min(560px,92vw);max-height:min(480px,72vh);resize:both;overflow:hidden;border:1px solid #7896ad;border-radius:4px;background:rgba(8,20,30,.84);backdrop-filter:blur(5px);box-shadow:0 6px 22px #0009}.onlinePanel:before,.onlinePanel:after{display:none}.onlinePanel header{min-height:30px;padding:3px 5px;background:linear-gradient(90deg,rgba(40,79,111,.95),rgba(13,31,44,.92));border-bottom:1px solid #7f9daf;cursor:grab}.onlinePanel header b{font-size:11px;color:#edf7ff}.onlinePanel header b small{color:#a7c1d1;font-size:9px}.onlinePanel header>div{display:flex;gap:3px}.onlinePanel header button{height:23px;padding:1px 6px;border:1px solid #66849a;border-radius:3px;background:#1d3549;color:#dcebf4;font-size:10px}.chatTabs{display:flex;flex:0 0 27px;border-bottom:1px solid #577185;background:rgba(10,28,40,.92)}.chatTabs button{padding:3px 11px;border:0;border-right:1px solid #425d70;background:transparent;color:#a9bdca;font-size:10px}.chatTabs button.active{background:#315f8b;color:#fff;font-weight:700}.onlinePanel #chatMessages{padding:5px 7px;font-size:12px;line-height:1.35}.onlinePanel #chatMessages p{margin:2px 0;padding:1px 3px;border:0;background:transparent}.onlinePanel #chatMessages p.systemMessage{color:#f4d66f}.onlinePanel #chatMessages p.playerMessage{color:#dcebf4}.onlinePanel #chatMessages p.playerMessage b{color:#65c9ff}.onlinePanel #chatMessages p time{display:none}.onlinePanel #chatForm{height:34px;padding:3px 5px;gap:5px;align-items:center;border-top:1px solid #587488;background:rgba(6,18,27,.94)}.onlinePanel #chatForm>span{font-size:14px}.onlinePanel #chatForm input{height:25px;padding:3px 7px;border:1px solid #496579;border-radius:12px;background:#102332;color:#e9f3f8;font-size:11px}.onlinePanel #chatForm button{width:31px;height:25px;padding:0;border:1px solid #6b8fa9;border-radius:12px;background:#315f87;color:#fff}.onlinePanel.collapsed{height:31px!important;min-height:31px;resize:none}.onlinePanel.collapsed .chatTabs,.onlinePanel.collapsed #chatMessages,.onlinePanel.collapsed #chatForm{display:none}@media(max-width:700px){.onlinePanel{left:6px!important;right:auto!important;bottom:6px!important;width:min(330px,88vw)!important;height:180px!important;min-width:250px;max-height:45vh;resize:vertical}}

.compactCompare{grid-template-columns:repeat(5,minmax(0,1fr))}.compactCompare>div{grid-template-columns:38px 1fr 15px 1fr;font-size:10px}@media(max-width:620px){.compactCompare{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* ===== Compact action cluster (2026-09-25): small slots in an arc around a mid-size attack button ===== */
body .radialActions{right:max(10px,env(safe-area-inset-right))!important;bottom:max(8px,env(safe-area-inset-bottom))!important;width:196px!important;height:205px!important;transform:none!important}
body .radialActions .quickSlot{width:40px!important;height:40px!important;background:#e8f0e81f!important;border:1.5px solid #d8c88a8c!important;box-shadow:inset 0 0 0 2px #1d2f3a55,0 2px 6px #0005!important;backdrop-filter:blur(1px)}
body .radialActions .quickSlot:after{inset:4px!important;border-color:#ffffff26!important}
body .radialActions .quickSlot b{top:-7px!important;left:50%!important;right:auto!important;transform:translateX(-50%);width:15px!important;height:15px!important;font-size:9px!important;background:#2a3542e6!important;border-color:#bfa55a!important}
body .radialActions .quickSlot.q1{left:auto!important;right:100px!important;bottom:15px!important}
body .radialActions .quickSlot.q2{left:auto!important;right:100px!important;bottom:65px!important}
body .radialActions .quickSlot.q3{left:auto!important;right:55px!important;bottom:95px!important}
body .radialActions .quickSlot.q4{left:auto!important;right:5px!important;bottom:95px!important}
body .radialActions .quickSlot.q5{left:auto!important;right:146px!important;bottom:15px!important}
body .radialActions .quickSlot.q6{left:auto!important;right:146px!important;bottom:62px!important}
body .radialActions .quickSlot.q7{left:auto!important;right:139px!important;bottom:109px!important}
body .radialActions .quickSlot.q8{left:auto!important;right:100px!important;bottom:140px!important}
body .radialActions .quickSlot.q9{left:auto!important;right:55px!important;bottom:147px!important}
body .radialActions .attack{right:6px!important;bottom:12px!important;width:70px!important;height:70px!important;border-width:3px!important;box-shadow:0 0 0 2px #18344c,0 0 0 3px #856d33,0 5px 12px #0009!important}
body .radialActions .attack span{font-size:30px!important}
body .radialActions .attack small{top:-9px!important;left:14px!important;right:14px!important;padding:0 2px!important;font-size:9px!important;border-radius:6px!important}
body .radialActions .autoToggle{right:4px!important;bottom:146px!important;width:44px!important;height:44px!important;border-width:2px!important;box-shadow:0 0 0 2px #19344b,0 3px 8px #0008!important}
body .radialActions .autoToggle span{font-size:18px!important}
body .radialActions .autoToggle small{top:-8px!important;right:12px!important;width:16px!important;height:16px!important;line-height:14px!important;font-size:9px!important}
body .radialActions .autoToggle b{left:2px!important;right:2px!important;bottom:-6px!important;font-size:8px!important;padding:0!important}

/* ===== Gate list (warp at the school) ===== */
.gateList{display:grid;gap:10px}
.gateCard{display:grid;gap:4px}
.gateCard p{margin:2px 0}
.gateRank{display:inline-grid;place-items:center;width:24px;height:24px;margin-right:6px;border-radius:5px;background:#5a6b78;border:1px solid #c9b77a;color:#fff;font-weight:bold}
.gateOpen{color:#7fe29a}
.gateClosed{color:#ff9d8a}

/* Other players' sprites stay below dialogs (they were z-index 18, above the z-index 10 overlays). */
body .remotePlayers{z-index:3!important}

/* ===== Windows don't block play; drag title to move (status / job / equipment / bag) ===== */
#details.overlay{background:transparent!important;backdrop-filter:none!important;pointer-events:none}
#details.overlay .dialog{pointer-events:auto;box-shadow:0 10px 40px #000c}
#details .eyebrow,#details #detailTitle{cursor:move;user-select:none;touch-action:none}
/* ===== Consumables + quick slots ===== */
.inventoryCell.consumableCell{touch-action:none;cursor:grab}
.dragGhost{position:fixed;width:42px;height:42px;transform:translate(-50%,-50%);pointer-events:none;z-index:100;image-rendering:pixelated;filter:drop-shadow(0 3px 5px #000b)}
body.draggingItem .radialActions{z-index:40!important}
body .radialActions .quickSlot{cursor:pointer}
body .radialActions .quickSlot.dropHover{border-color:#ffe27a!important;box-shadow:0 0 0 3px #ffe27a99!important;background:#ffe27a33!important}
.quickSlotIcon{width:26px;height:26px;image-rendering:pixelated;pointer-events:none;position:relative;z-index:1}
.quickCount{position:absolute;right:-3px;bottom:-5px;z-index:2;font:bold 10px Tahoma,sans-serif;font-style:normal;color:#fff;text-shadow:0 1px 2px #000,0 0 3px #000}
.quickCount.empty{color:#ff9b9b}
.itemIconImage[src$=".svg"],.bagItemIcon img[src$=".svg"]{image-rendering:pixelated}

/* Copper coin icon (HUD wallet, bag, shop) */
.coinIcon{width:1.15em;height:1.15em;vertical-align:-.2em;image-rendering:pixelated;display:inline-block}

/* Sprite-sheet player model: frame chosen by the game */
.playerSheet{position:absolute;display:none;pointer-events:none;background-repeat:no-repeat;image-rendering:pixelated;z-index:2}

/* Menu art icons (assets/ui/menu-*.png); job, storage and help buttons are hidden for now */
.menubar button[hidden]{display:none!important}
.menubar button>span.menuArt{width:50px!important;height:50px!important;background:none;border:0;box-shadow:none;border-radius:0;padding:0}
.menubar button>span.menuArt img{width:100%;height:100%;display:block;filter:drop-shadow(0 2px 3px #000a)}
@media(max-width:650px){.menubar button>span.menuArt{width:34px!important;height:34px!important}}

/* ===== Player dossier HUD: steel-blue academy card inspired by the supplied reference ===== */
.playerhud{
 isolation:isolate;
 top:14px;
 left:14px;
 width:370px;
 padding:14px 14px 10px;
 gap:12px;
 overflow:visible;
 border:1px solid #d6bb57;
 border-radius:2px;
 background:
  linear-gradient(90deg,transparent 0 9px,#d4bd5d 9px 10px,transparent 10px calc(100% - 10px),#d4bd5d calc(100% - 10px) calc(100% - 9px),transparent calc(100% - 9px)),
  linear-gradient(180deg,#19334bec,#11293fee);
 box-shadow:
  0 0 0 2px #081a2a,
  0 0 0 4px #244d69,
  0 0 0 5px #6f7444,
  inset 0 0 0 1px #6b8ba0,
  inset 0 -28px 36px #07162566,
  0 8px 22px #0009;
 backdrop-filter:blur(5px);
}
.playerhud:before,.playerhud:after{
 content:"";
 position:absolute;
 z-index:3;
 top:-7px;
 width:10px;
 height:10px;
 border:1px solid #6f611f;
 background:linear-gradient(135deg,#ffe68b,#aa9137);
 box-shadow:0 0 0 2px #122c42,0 1px 4px #000b;
 transform:rotate(45deg);
}
.playerhud:before{left:8px}.playerhud:after{right:8px}
.playerhud .portrait{
 width:70px;
 height:90px;
 flex:0 0 70px;
 border:1px solid #ddc55f;
 border-radius:0;
 background:
  linear-gradient(90deg,#d9bd58 0 1px,transparent 1px calc(100% - 1px),#d9bd58 calc(100% - 1px)),
  linear-gradient(180deg,#1d3b50,#102638);
 box-shadow:inset 0 0 0 4px #11293d,0 0 0 1px #071622;
}
.playerhud .portrait:before,.playerhud .portrait:after{
 content:"";
 position:absolute;
 left:-1px;
 width:12px;
 height:1px;
 background:#f0d66a;
}
.playerhud .portrait:before{top:0}.playerhud .portrait:after{bottom:0}
.playerhud .portrait canvas{filter:drop-shadow(0 3px 1px #07121b)}
.playerhud .portrait span{
 left:50%;
 bottom:-9px;
 transform:translateX(-50%);
 width:max-content;
 padding:1px 7px;
 border:1px solid #846f27;
 border-radius:2px;
 background:#15334b;
 color:#ffdc62;
 font-weight:700;
 letter-spacing:1px;
 text-shadow:0 1px #000;
}
.playerhud .playerstats{min-width:0;padding-top:1px}
.playerhud .name{
 min-height:22px;
 padding:1px 0 5px;
 border-bottom:1px solid #5e7e9366;
 color:#f7fbff;
 font-size:13px;
 font-weight:700;
 line-height:1.35;
 text-shadow:0 1px 2px #000;
}
.playerhud .name b{
 color:#ffe064;
 font-size:11px;
 letter-spacing:.4px;
 text-shadow:0 1px 2px #000,0 0 7px #d8ae3277;
}
.playerhud .classline{
 height:17px;
 margin:3px 0 2px;
 color:#b9d1dd;
 font-size:10px;
 align-items:center;
}
.playerhud .classline:before{content:"◆";margin-right:4px;color:#78cde6;font-size:7px}
.playerhud .classline #job{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.playerhud .classline #rank{
 margin-left:auto;
 max-width:100px;
 padding-left:7px;
 color:#e6cb71;
 font-size:9px;
 text-align:right;
}
.playerhud label{gap:5px;margin:5px 0}
.playerhud label>b{
 width:26px;
 color:#d6e5ec;
 font-size:9px;
 letter-spacing:.5px;
 text-shadow:0 1px #000;
}
.playerhud label>span{
 top:-1px;
 right:5px;
 z-index:2;
 color:#f5fbff;
 font-size:8px;
 font-weight:700;
 line-height:12px;
 text-shadow:0 1px 2px #000,1px 0 #000;
}
.playerhud .bar{
 position:relative;
 height:11px;
 border:1px solid #071522;
 border-radius:6px;
 background:#07121e;
 box-shadow:0 0 0 1px #4c6b7d,0 1px 2px #000,inset 0 1px 2px #000;
}
.playerhud .bar:after{
 content:"";
 position:absolute;
 inset:1px 3px auto;
 z-index:1;
 height:2px;
 border-radius:2px;
 background:#ffffff75;
 pointer-events:none;
}
.playerhud .bar i{border-radius:5px;background:linear-gradient(180deg,#ff8c8f 0,#ee4f64 45%,#a91d39 55%,#d6334c 100%);box-shadow:inset 0 0 5px #fff5,0 0 5px #e84b5b55}
.playerhud .sp i{background:linear-gradient(180deg,#88ecff 0,#3eb7e7 45%,#247ab7 55%,#369ed8 100%);box-shadow:inset 0 0 5px #fff6,0 0 5px #40c5ec55}
.playerhud .xp i{background:linear-gradient(180deg,#b4efb7 0,#69c982 45%,#408f59 55%,#65b976 100%);box-shadow:inset 0 0 5px #fff5,0 0 5px #65c77c44}
.playerhud .wallet{
 margin-top:5px;
 padding-top:5px;
 border-top:1px solid #607c8e55;
 color:#f0ce65;
 font-size:10px;
 line-height:1.2;
}
.playerhud .coinIcon{filter:drop-shadow(0 1px 2px #000)}
.playerhud .killlabel{color:#9eb6c4}.playerhud .killlabel:first-letter{color:#f0a24a}
.playerhud .hudfoot{
 width:calc(100% + 28px);
 margin:1px -14px -10px;
 padding:6px 14px 5px;
 border-top:1px solid #4f7186;
 background:linear-gradient(90deg,#17354d,#10263a 70%,#17344a);
 color:#cfdbe0;
 font-size:8px;
 letter-spacing:1.5px;
}
.playerhud .hudfoot span{color:#91a9b7;font-size:8px;letter-spacing:0}

@media(max-width:650px){
 .playerhud{width:298px;padding:9px 10px 7px;gap:8px}
 .playerhud .portrait{width:57px;height:72px;flex-basis:57px}
 .playerhud .name{min-height:18px;padding-bottom:3px;font-size:10px}
 .playerhud .classline{height:13px;margin:1px 0;font-size:8px}
 .playerhud label{margin:3px 0}.playerhud label>b{width:22px;font-size:7px}.playerhud label>span{font-size:7px;line-height:9px}
 .playerhud .bar{height:9px}.playerhud .wallet{margin-top:3px;padding-top:3px;font-size:8px}
 .playerhud .hudfoot{width:calc(100% + 20px);margin:1px -10px -7px;padding:4px 10px 3px}
}
@media(max-width:520px),(pointer:coarse){
 .playerhud{top:max(7px,env(safe-area-inset-top));left:max(7px,env(safe-area-inset-left));width:220px;padding:6px;gap:6px}
 .playerhud .portrait{width:43px;height:55px;flex-basis:43px}
 .playerhud .portrait span,.playerhud .hudfoot,.playerhud .wallet{display:none}
 .playerhud .name{min-height:0;font-size:10px;padding-bottom:2px}
 .playerhud .classline{margin:2px 0;font-size:8px}
 .playerhud label{margin:3px 0}.playerhud label>b{width:18px;font-size:7px}.playerhud label>span{font-size:7px}.playerhud .bar{height:8px}
}


/* Trees in front of the player (drawn by drawForeground) */
.fgLayer{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:2}

/* ===== Name card (player HUD) ===== */
.namecard{position:absolute;top:12px;left:12px;z-index:5;width:360px;display:grid;grid-template-columns:92px 1fr;grid-template-rows:auto auto;gap:10px 12px;padding:12px 12px 8px;color:#eaf4ff;font-family:'Noto Sans Thai',Tahoma,sans-serif;
 background:radial-gradient(120% 90% at 85% 0%,#243a6b88,transparent 60%),linear-gradient(180deg,#0e1a33f2,#091225f2);border:2px solid #d9b04a;border-radius:6px;
 box-shadow:0 0 0 1px #3a2a08,0 0 0 3px #0a1426,0 0 14px #2f8cff55,inset 0 0 0 1px #3f7cd166,inset 0 0 22px #1b4fb044,0 8px 22px #000a}
.namecard:before,.namecard:after{content:"";position:absolute;width:12px;height:12px;border:2px solid #f3cf62;transform:rotate(45deg);background:#0e1a33;top:-8px}
.namecard:before{left:14px}.namecard:after{right:14px}
.ncPortrait{position:relative;width:92px;height:112px;border:2px solid #e3b84f;border-radius:4px;background:radial-gradient(circle at 50% 40%,#2a6cff,#0b1d4a 70%);box-shadow:inset 0 0 0 2px #0b1633,inset 0 0 14px #4fa3ff99,0 0 8px #2f8cff88;overflow:visible}
.ncArt{position:absolute;inset:2px;overflow:hidden;background:url("assets/novice/idle8/south.png?v=1") no-repeat;background-size:1549px 194px;background-position:-55px -20px;image-rendering:pixelated}
.ncPortrait>span{position:absolute;left:50%;bottom:-11px;transform:translateX(-50%);padding:1px 9px;border:2px solid #e3b84f;border-radius:10px 10px 14px 14px;background:linear-gradient(#18284f,#0a1430);color:#ffd764;font-weight:800;font-size:13px;letter-spacing:1px;white-space:nowrap;text-shadow:0 1px 2px #000;box-shadow:0 0 8px #2f8cff88}
.ncMain{min-width:0}
.ncHead{display:flex;align-items:flex-start;justify-content:space-between;gap:6px;margin-bottom:4px;padding-bottom:4px;border-bottom:1px solid #4d7fc444}
.ncName{font-size:19px;font-weight:800;line-height:1.1;color:#fff;text-shadow:0 2px 3px #000;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:170px}
.ncJob{font-size:12px;font-weight:700;color:#d8e6f7;margin-top:2px}
.ncLevel{font-size:22px;font-weight:800;color:#ffd35a;white-space:nowrap;text-shadow:0 2px 3px #000,0 0 8px #d8a33a88;letter-spacing:.5px}
.ncBar{display:grid;grid-template-columns:18px 28px 1fr;align-items:center;gap:4px;margin:4px 0;position:relative}
.ncBar>b{font-size:10px;font-weight:800;color:#e9f1ff;text-shadow:0 1px 2px #000}
.ncIcon{display:grid;place-items:center;width:18px;height:18px;border-radius:50%;font-style:normal;font-size:10px;color:#fff;box-shadow:0 0 0 1px #0008,inset 0 0 4px #fff6}
.ncBar.hp .ncIcon{background:radial-gradient(#ff7a91,#b3163a)}.ncBar.sp .ncIcon{background:radial-gradient(#6fd3ff,#1d5fc7)}.ncBar.xp .ncIcon{background:radial-gradient(#7dffa8,#138a45)}
.ncBar .bar{position:relative;height:13px;border-radius:3px;background:#050a14;border:1px solid #000;box-shadow:0 0 0 1px #3b4f73,inset 0 1px 3px #000;overflow:hidden}
.ncBar .bar i{display:block;height:100%;border-radius:2px;background:linear-gradient(180deg,#ff9aac,#ff3d63 50%,#c4163f);box-shadow:inset 0 1px 0 #fff8}
.ncBar.sp .bar i{background:linear-gradient(180deg,#9fe8ff,#2fb6ff 50%,#1669d9)}
.ncBar.xp .bar i{background:linear-gradient(180deg,#b6ffc9,#35e07a 50%,#169c4c)}
.ncBar>span{position:absolute;right:5px;top:50%;transform:translateY(-50%);font-size:9px;font-weight:800;color:#fff;text-shadow:0 1px 2px #000,1px 0 #000}
.ncWallet{display:flex;align-items:center;gap:5px;margin-top:6px;padding:4px 8px;border:1px solid #4d6f9e88;border-radius:5px;background:#0a1530cc;color:#ffd35a;font-size:12px;font-weight:700}
.ncWallet .coinIcon{width:16px;height:16px}
.ncKills{margin-left:auto;color:#9fd2ff}
.ncFoot{grid-column:1/-1;display:flex;gap:8px;margin-top:4px}
.ncBrand,.ncRank{flex:1;display:flex;align-items:center;justify-content:center;gap:6px;height:26px;border:1px solid #d9b04a;border-radius:4px;background:linear-gradient(90deg,#0c1a3a,#152a58 50%,#0c1a3a);box-shadow:inset 0 0 8px #2f8cff55;font-size:12px;font-weight:800;letter-spacing:1px;color:#f3e3b0;text-shadow:0 1px 2px #000}
.ncRank b{display:inline-grid;place-items:center;min-width:20px;height:20px;border-radius:3px;background:linear-gradient(#ffe07a,#e0a82c);color:#3a2300;font-size:13px}
@media(max-width:650px),(pointer:coarse){
 .namecard{top:max(6px,env(safe-area-inset-top));left:max(6px,env(safe-area-inset-left));width:230px;grid-template-columns:52px 1fr;gap:6px 8px;padding:7px 8px 6px}
 .ncPortrait{width:52px;height:64px}.ncArt{background-size:880px 110px;background-position:-31px -11px}
 .ncPortrait>span{font-size:9px;bottom:-9px;padding:0 5px}
 .ncName{font-size:13px;max-width:110px}.ncJob{font-size:9px}.ncLevel{font-size:14px}
 .ncBar{grid-template-columns:12px 22px 1fr;margin:2px 0;gap:3px}.ncIcon{width:12px;height:12px;font-size:7px}.ncBar>b{font-size:7px}.ncBar .bar{height:9px}.ncBar>span{font-size:7px}
 .ncWallet,.ncFoot{display:none}
}

/* Name card: a bit smaller, can be hidden */
@media(min-width:651px) and (pointer:fine){.namecard{transform:scale(.82);transform-origin:top left}}
.ncToggle{position:absolute;top:4px;right:6px;z-index:2;width:20px;height:20px;padding:0;border:1px solid #d9b04a;border-radius:4px;background:#0c1a3a;color:#ffd35a;font-size:13px;line-height:16px;cursor:pointer}
.ncToggle:hover{filter:brightness(1.3)}
.namecard .ncHead{padding-right:22px}
.namecard.ncHidden{width:auto;padding:0;gap:0;grid-template-columns:auto;background:none;border:0;box-shadow:none}
.namecard.ncHidden:before,.namecard.ncHidden:after,.namecard.ncHidden>:not(.ncToggle){display:none}
.namecard.ncHidden .ncToggle{position:static;width:34px;height:34px;font-size:18px;line-height:30px;box-shadow:0 0 8px #2f8cff88}

/* Chat: smaller by default, starts at the bottom centre (JS sets left on PC) */
@media(min-width:701px){.onlinePanel{width:300px;height:150px;min-width:220px;min-height:110px}.onlinePanel #chatMessages{font-size:11px}}


/* ===== Status window (ACADEMY ARCHIVES style) ===== */
#reset[hidden]{display:none!important}
#details.statusMode .dialog{width:min(720px,96vw);max-width:720px;padding:18px 20px 16px;border:2px solid #d9b04a;border-radius:8px;background:radial-gradient(120% 70% at 50% 0%,#1b3566,transparent 60%),linear-gradient(180deg,#0d1a33,#08112a);box-shadow:0 0 0 1px #3a2a08,0 0 0 3px #0a1426,0 0 18px #2f8cff55,inset 0 0 26px #1b4fb044,0 12px 30px #000c}
#details.statusMode .eyebrow{text-align:center;letter-spacing:5px;color:#e8c865;font-size:12px}
#details.statusMode #detailTitle{position:relative;margin:6px 0 12px;padding:6px 12px 6px 40px;font:800 22px 'Noto Sans Thai',Tahoma,sans-serif;color:#fff;background:linear-gradient(90deg,#16305e,#0b1733);border:1px solid #4d7fc4;border-radius:6px;box-shadow:inset 0 -2px 0 #2f8cff}
#details.statusMode #detailTitle:before{content:"✦";position:absolute;left:12px;top:50%;transform:translateY(-50%);color:#ffd35a;font-size:18px}
#details.statusMode #detailTitle:after{content:"• CHARACTER INFO";position:absolute;right:12px;top:50%;transform:translateY(-50%);font-size:9px;letter-spacing:3px;color:#9fb6d6;font-weight:600}
#details.statusMode .statusPanel{display:grid;grid-template-columns:1fr 1fr;gap:12px}
#details.statusMode .statusAttributes,#details.statusMode .statusDerived{padding:8px 10px;border:1px solid #4d6f9e;border-radius:6px;background:#0a1530cc;box-shadow:inset 0 0 12px #2f8cff22}
#details.statusMode .statusAttribute{display:grid;grid-template-columns:28px 38px 34px 1fr 30px;align-items:center;gap:8px;padding:5px 0;border-bottom:1px solid #2a3f63}
#details.statusMode .statusAttribute:last-child{border-bottom:0}
#details.statusMode .stIcon{display:grid;place-items:center;width:26px;height:26px;border-radius:6px;font-style:normal;font-size:14px;color:#fff;box-shadow:inset 0 0 6px #fff5,0 0 0 1px #0008}
#details.statusMode .st-str .stIcon{background:linear-gradient(#e0475c,#8e1328)}#details.statusMode .st-agi .stIcon{background:linear-gradient(#35c47e,#0f6b3e)}#details.statusMode .st-vit .stIcon{background:linear-gradient(#4a8ff0,#1a4aa3)}
#details.statusMode .st-int .stIcon{background:linear-gradient(#a26ef0,#5a25a8)}#details.statusMode .st-dex .stIcon{background:linear-gradient(#e7b23c,#94620f)}#details.statusMode .st-luk .stIcon{background:linear-gradient(#3ccfd6,#0e7479)}
#details.statusMode .statusAttribute>b{font-size:15px;font-weight:800;color:#fff}
#details.statusMode .statusAttribute>span{display:grid;place-items:center;height:26px;border-radius:4px;background:#23324f;font-size:14px;font-weight:800;color:#fff}
#details.statusMode .statusAttribute>small{font-size:11px;color:#c9d6e8}
#details.statusMode .statusAttribute>button{width:28px;height:26px;padding:0;border:1px solid #6b8fb9;border-radius:5px;background:#12254a;color:#fff;font-size:16px}
#details.statusMode .statusAttribute>button:disabled{opacity:.35}
#details.statusMode .statusDerived{display:grid;grid-template-columns:1fr 1fr;column-gap:16px;align-content:start}
#details.statusMode .statusDerivedTitle{grid-column:1/-1;display:flex;align-items:center;gap:6px;padding:2px 0 8px;margin-bottom:4px;border-bottom:1px solid #3b5a8a;font-size:15px;font-weight:800;color:#fff}
#details.statusMode .statusDerivedTitle small{margin-left:auto;font-size:9px;letter-spacing:3px;color:#9fb6d6;font-weight:600}
#details.statusMode .statusDerivedRow{display:grid;grid-template-columns:20px 1fr auto;align-items:center;gap:6px;padding:6px 0;border-bottom:1px solid #22375a}
#details.statusMode .sdIcon{font-style:normal;color:#7fc4ff;font-size:14px;text-align:center}
#details.statusMode .statusDerivedRow span{font-size:12px;color:#d6e3f5}
#details.statusMode .statusDerivedRow b{font-size:16px;font-weight:800;color:#ffd35a}
#details.statusMode .statusPoints{grid-column:1/-1;display:flex;align-items:center;gap:10px;padding:8px 14px;border:1px solid #4d6f9e;border-radius:6px;background:#0a1530cc}
#details.statusMode .spGem{font-style:normal;font-size:20px;color:#ffd35a;text-shadow:0 0 8px #2f8cff}
#details.statusMode .statusPoints span{font-size:14px;font-weight:800;color:#ffd35a}
#details.statusMode .statusPoints span b{display:inline-block;min-width:30px;margin-left:8px;padding:1px 8px;border-radius:4px;background:#23324f;color:#fff;text-align:center}
#details.statusMode .statusPoints small{margin-left:auto;font-size:11px;color:#dfe8f5}
#details.statusMode #jobdesc{margin:10px 0 0;text-align:center;font-size:11px;color:#9fb6d6}
@media(max-width:700px){#details.statusMode .statusPanel{grid-template-columns:1fr}#details.statusMode .statusAttribute{grid-template-columns:24px 34px 30px 1fr 28px;gap:6px}#details.statusMode #detailTitle:after{display:none}}

/* ===== Equipment window (ACADEMY ARCHIVES, dark blue + gold) ===== */
#details.equipmentMode{background:#030814d9}
#details.equipmentMode .dialog{width:min(820px,96vw);max-width:820px;padding:16px 20px 14px;border:2px solid #d9b04a;border-image:none;border-radius:8px;background:radial-gradient(120% 60% at 50% 0%,#1b3566,transparent 60%),linear-gradient(180deg,#0d1a33,#08112a);box-shadow:0 0 0 1px #3a2a08,0 0 0 3px #0a1426,0 0 18px #2f8cff55,inset 0 0 26px #1b4fb044,0 12px 30px #000c;color:#eaf4ff}
#details.equipmentMode .eyebrow{text-align:center;letter-spacing:5px;color:#e8c865;font-size:11px}
#details.equipmentMode #detailTitle{margin:2px 0 8px;padding:0;background:none;border:0;text-align:center;font:800 26px 'Noto Sans Thai',Tahoma,sans-serif;color:#ffd35a;text-shadow:0 2px 3px #000,0 0 10px #d8a33a66}
#details.equipmentMode .close{color:#fff}
#details.equipmentMode .equipIdentity{width:max-content;min-width:260px;margin:0 auto 10px;padding:4px 30px;border:1px solid #4d7fc4;border-radius:4px;background:linear-gradient(90deg,transparent,#12254a 20%,#12254a 80%,transparent);gap:10px}
#details.equipmentMode .equipIdentity b,#details.equipmentMode .equipIdentity span{color:#eaf4ff;font-size:15px}
#details.equipmentMode .equipmentLayout{grid-template-columns:1fr 200px 1fr;gap:12px}
#details.equipmentMode .slotColumn{gap:7px}
#details.equipmentMode .equipSlot{position:relative;min-height:60px;grid-template-columns:48px 1fr 14px;gap:10px;padding:6px 10px 6px 6px!important;background:linear-gradient(180deg,#12213f,#0b1631)!important;border:1px solid #3b5a8a!important;border-radius:5px;color:#eaf4ff;box-shadow:inset 0 0 10px #2f8cff18}
#details.equipmentMode .equipSlot:after{content:"›";color:#9fc2f0;font-size:20px}
#details.equipmentMode .equipSlot.filled{background:linear-gradient(180deg,#152a52,#0c1936)!important;border-color:#5b7fb4!important}
#details.equipmentMode .equipSlot.selected{border:2px solid #f3cf62!important;background:linear-gradient(180deg,#3a3016,#1a1a1f)!important;box-shadow:0 0 12px #f3cf6288,inset 0 0 12px #f3cf6233}
#details.equipmentMode .equipIcon{width:46px;height:46px;border:1px solid #5b6f8f;border-radius:4px;background:#0a1226;color:#cfd8e6;font-size:20px}
#details.equipmentMode .equipIcon img{width:36px;height:36px;image-rendering:pixelated}
#details.equipmentMode .equipSlot small{color:#dfe8f5;font-size:11px}
#details.equipmentMode .equipSlot strong{max-width:150px;color:#ffc94a;font-size:13px}
#details.equipmentMode .equipSlot em{color:#9fb0c8;font-size:9px}
#details.equipmentMode .equipSlot.filled em{color:#e3ecf8}
#details.equipmentMode .equipmentAvatar{min-height:0;border:1px solid #3b5a8a;border-radius:6px;background:radial-gradient(60% 45% at 50% 55%,#3a3a55,transparent 70%),linear-gradient(180deg,#141d33,#0a1022)}
#details.equipmentMode .equipmentAvatar:before{content:"";position:absolute;left:50%;bottom:34px;width:150px;height:34px;transform:translateX(-50%);border:3px solid #f3cf62;border-radius:50%;box-shadow:0 0 14px #f3cf62,inset 0 0 12px #f3cf6288;font-size:0}
#details.equipmentMode .equipmentAvatar .avatarGlow{background:#f3cf6222}
#details.equipmentMode .equipmentAvatar img{width:170px;height:170px}
#details.equipmentMode .equipmentAvatar small{margin-top:14px;border:1px solid #d9b04a;border-radius:3px;background:#0c1a3a;color:#fff;font-weight:700}
#details.equipmentMode .selectedEquipment{grid-template-columns:70px 1fr 170px 130px;gap:14px;margin-top:10px;padding:10px 14px;border:2px solid #d9b04a;border-radius:6px;background:linear-gradient(180deg,#0f1c3a,#0a1329);color:#eaf4ff}
#details.equipmentMode .selectedIcon{display:grid;place-items:center;width:64px;height:64px;border:2px solid #f3cf62;border-radius:4px;background:#0a1226;font-size:26px}
#details.equipmentMode .selectedIcon img{width:52px;height:52px;image-rendering:pixelated}
#details.equipmentMode .selectedEquipment small{color:#dfe8f5;font-size:12px}
#details.equipmentMode .selectedEquipment strong{color:#ffc94a;font-size:20px}
#details.equipmentMode .selectedEquipment em{color:#e3ecf8;font-size:12px;font-style:normal}
#details.equipmentMode #chooseEquipment{height:42px;border:2px solid #6fb2ff;border-radius:5px;background:linear-gradient(180deg,#1e6ae0,#0c3f99);color:#fff;font-weight:800;font-size:14px}
#details.equipmentMode #unequipSelected{height:42px;border:2px solid #f3cf62;border-radius:5px;background:linear-gradient(180deg,#b5913c,#7a5c1c);color:#fff;font-weight:800;font-size:14px}
#details.equipmentMode #unequipSelected:disabled{opacity:.45}
#details.equipmentMode .statCompare{display:none}
#details.equipmentMode #jobdesc{text-align:center;color:#9fb6d6;font-size:11px}
@media(max-width:760px){#details.equipmentMode .equipmentLayout{grid-template-columns:1fr 1fr}#details.equipmentMode .equipmentAvatar{display:none}#details.equipmentMode .selectedEquipment{grid-template-columns:54px 1fr;}#details.equipmentMode #chooseEquipment,#details.equipmentMode #unequipSelected{grid-column:span 1}}
#details.equipmentMode .equipmentAvatar:before{bottom:auto;top:calc(50% + 24px)}
#details.equipmentMode #unequipSelected{background:linear-gradient(180deg,#c9a24a,#80601c)!important;border-color:#f3cf62!important;color:#fff!important}
#details.equipmentMode #chooseEquipment{background:linear-gradient(180deg,#1e6ae0,#0c3f99)!important;color:#fff!important}


/* Chat reopen button sits under the name card (higher up when the card is hidden) */
.chatRestore{left:12px!important;top:176px;bottom:auto!important;transform:none!important}
body.ncHiddenBody .chatRestore{top:54px}
@media(max-width:650px),(pointer:coarse){.chatRestore{top:112px}body.ncHiddenBody .chatRestore{top:50px}}


/* Hidden for now: big area title at the top and the quest note */
.worldtitle,.quest{display:none!important}


/* Death: keep the character (death pose) visible - card sits low, lighter dim */
.deathPanel{place-items:end center!important;padding-bottom:9vh;background:#070e1855!important}


/* ===== Mobile / touch layout (2026-09-27) ===== */
.useBtn{display:none}
@media (pointer:coarse),(max-height:500px){
 /* name card: compact */
 body .namecard{width:190px;grid-template-columns:40px 1fr;gap:4px 6px;padding:5px 6px 4px;transform:none}
 body .ncPortrait{width:40px;height:50px}body .ncArt{background-size:686px 86px;background-position:-23px -8px}
 body .ncPortrait>span{font-size:8px;bottom:-8px;padding:0 4px}
 body .ncName{font-size:11px;max-width:95px}body .ncJob{font-size:8px}body .ncLevel{font-size:12px}body .ncHead{margin-bottom:1px;padding-bottom:1px;padding-right:18px}
 body .ncBar{grid-template-columns:10px 18px 1fr;margin:1px 0;gap:2px}body .ncIcon{width:10px;height:10px;font-size:6px}body .ncBar>b{font-size:6px}body .ncBar .bar{height:7px}body .ncBar>span{font-size:6px}
 body .ncToggle{width:16px;height:16px;font-size:11px;line-height:12px;top:3px;right:4px}
 body .chatRestore{top:78px}body.ncHiddenBody .chatRestore{top:44px}
 /* top-right menu: icons only */
 body .menubar{gap:4px;transform:none;top:max(6px,env(safe-area-inset-top));right:max(6px,env(safe-area-inset-right));left:auto}
 body .menubar button{font-size:0!important;min-width:0!important;flex:0 0 auto}
 body .menubar button>span,body .menubar button>span.menuArt{width:34px!important;height:34px!important;margin:0!important;font-size:16px!important}
 /* action cluster: attack + 4 potion slots + AUTO + use */
 body .radialActions{width:200px!important;height:170px!important}
 body .radialActions .attack{width:80px!important;height:80px!important;right:0!important;bottom:0!important}
 body .radialActions .quickSlot{display:block!important;width:42px!important;height:42px!important}
 body .radialActions .quickSlot.q1{right:88px!important;bottom:4px!important}
 body .radialActions .quickSlot.q2{right:88px!important;bottom:54px!important}
 body .radialActions .quickSlot.q3{right:46px!important;bottom:90px!important}
 body .radialActions .quickSlot.q4{right:0!important;bottom:92px!important}
 body .radialActions .quickSlot.q5,body .radialActions .quickSlot.q6,body .radialActions .quickSlot.q7,body .radialActions .quickSlot.q8,body .radialActions .quickSlot.q9{display:none!important}
 body .radialActions .autoToggle{width:42px!important;height:42px!important;right:92px!important;bottom:104px!important}
 body .radialActions .autoToggle small{display:none}
 body .useBtn{display:grid;place-items:center;position:absolute;right:140px;bottom:30px;width:48px;height:48px;padding:0;border:2px solid #d9b04a;border-radius:50%;background:radial-gradient(#2a4f7a,#0c1a3a);color:#fff;box-shadow:0 0 8px #2f8cff88;touch-action:manipulation}
 body .useBtn span{font-size:18px;line-height:1}body .useBtn b{font-size:8px;margin-top:-6px}
 /* windows: fit the screen, scroll inside, above every HUD button */
 body .overlay:not(.hidden){z-index:1400}
 body .overlay .dialog{max-height:calc(100dvh - 12px);overflow:auto;-webkit-overflow-scrolling:touch}
 body #details.statusMode .dialog,body #details.equipmentMode .dialog{padding:10px 12px}
}

/* Phones held upright: the game is drawn landscape (1500x975), so ask to rotate instead of squashing it */
@media (pointer:coarse) and (orientation:portrait){body:after{content:'⟳  หมุนมือถือเป็นแนวนอนเพื่อเล่น';position:fixed;inset:0;z-index:99999;display:grid;place-items:center;padding:30px;text-align:center;background:radial-gradient(circle,#1b3566,#060d1e);color:#ffd35a;font:800 20px 'Noto Sans Thai',Tahoma,sans-serif;white-space:pre-line}}


/* Login on short (landscape phone) screens: compact and scrollable so the buttons are reachable */
.onlineLogin{overflow:auto;padding:8px}
@media(max-height:520px){.onlineLogin{place-items:start center}.onlineCard{padding:10px 18px!important;margin:4px auto}.onlineCard h2{font-size:16px;margin:2px 0 4px}.onlineCard>p{display:none}.onlineCard input{height:34px;padding:4px 10px;margin:3px 0}.onlineCard button{height:34px;padding:4px 14px}}


/* Login buttons readable */
.onlineCard button{border:2px solid #d9b04a!important;border-radius:6px!important;background:linear-gradient(180deg,#1e6ae0,#0c3f99)!important;color:#fff!important;font-weight:800;opacity:1!important;padding:6px 16px}
.onlineCard button.primary{background:linear-gradient(180deg,#e7c05a,#a47a22)!important;color:#1d1300!important}


/* Other players scale with the map (--ps is set every frame by spriteScale) */
.remotePlayer{width:calc(105px*var(--ps,1))!important;height:calc(105px*var(--ps,1))!important}
.remotePlayer img{width:100%!important;height:100%!important}


/* Wide screens (phones in landscape): keep the game's 1500:975 shape instead of stretching it; side bars hold the HUD */
@media (pointer:coarse) and (min-aspect-ratio:8/5){
 #viewport{background:#060d1e}
 #game,.fgLayer{position:absolute!important;left:50%!important;top:50%!important;right:auto!important;bottom:auto!important;width:calc(100dvh*1500/975)!important;height:100dvh!important;transform:translate(-50%,-50%)}
}


/* Other players: sprite-sheet body (same poses as the local player) */
.remotePlayer .rSprite{position:absolute;background-repeat:no-repeat;image-rendering:pixelated;pointer-events:none}

/* use button: touch screens only (beats the generic .radialActions button rules) */
body .radialActions .useBtn{display:none!important}
@media (pointer:coarse),(max-height:500px){body .radialActions .useBtn{display:grid!important}}


/* Quick-slot picker in the bag (works without dragging, for touch screens) */
.slotPick{display:flex;flex-wrap:wrap;align-items:center;gap:4px;margin-top:6px;font-size:11px;color:#dfe8f5}
.slotPick button{width:30px;height:30px;padding:0;border:1px solid #6b8fb9;border-radius:6px;background:#12254a;color:#fff;font-weight:800}
.slotPick button.on{background:linear-gradient(#e7c05a,#a47a22);border-color:#f3cf62;color:#1d1300}
@media (pointer:coarse),(max-height:500px){.slotPick button{width:38px;height:38px;font-size:15px}.slotPick .pcOnly{display:none}}

/* Bag on touch screens: smaller cells, selected-item bar pinned to the bottom of the window */
@media (pointer:coarse),(max-height:500px){
 body #details.bagMode .inventoryGrid{grid-template-columns:repeat(auto-fill,minmax(64px,1fr))!important;gap:5px!important}
 body #details.bagMode .inventoryCell{min-height:64px!important;height:64px!important}
 body #details.bagMode .bagItemDetail{position:sticky;bottom:0;z-index:5;box-shadow:0 -6px 14px #000a}
}


#details .bagItemDetail .slotPick{display:flex!important;flex-direction:row!important;flex-wrap:wrap}
#details .bagItemDetail .slotPick button{flex:0 0 auto!important;width:32px!important;min-width:0!important;height:30px!important;margin:0!important;padding:0!important;border:1px solid #6b8fb9!important;border-radius:6px!important;background:#12254a!important;color:#fff!important;font-size:13px!important;box-shadow:none!important}
#details .bagItemDetail .slotPick button.on{background:linear-gradient(#e7c05a,#a47a22)!important;border-color:#f3cf62!important;color:#1d1300!important}
@media (pointer:coarse),(max-height:500px){#details .bagItemDetail .slotPick button{width:40px!important;height:36px!important;font-size:15px!important}#details .bagItemDetail .slotPick .pcOnly{display:none!important}}


/* Bag item bar: no 'use' button on PC; compact bar on phones */
@media (pointer:fine) and (min-height:501px){#details .bagItemDetail [data-use]{display:none!important}}
@media (pointer:coarse),(max-height:500px){
 #details.bagMode .bagItemDetail{display:flex!important;align-items:center!important;gap:8px!important;padding:5px 8px!important;min-height:0!important}
 #details.bagMode .bagItemDetail .bagItemIcon{width:34px!important;height:34px!important;flex:0 0 34px}
 #details.bagMode .bagItemDetail .bagItemIcon img{width:28px!important;height:28px!important}
 #details.bagMode .bagItemDetail>div{flex:1;min-width:0}
 #details.bagMode .bagItemDetail strong{font-size:12px!important}
 #details.bagMode .bagItemDetail:has(.slotPick) em,#details.bagMode .bagItemDetail:has(.slotPick) small{display:none!important}
 #details.bagMode .bagItemDetail .slotPick{margin-top:3px!important;font-size:0!important}
 #details .bagItemDetail .slotPick button{width:32px!important;height:28px!important;font-size:13px!important}
 #details.bagMode .bagItemDetail [data-use]{flex:0 0 auto!important;width:auto!important;height:32px!important;padding:0 14px!important;margin:0!important;font-size:13px!important}
}


/* ===== Bag window (ACADEMY ARCHIVES, dark blue + gold) ===== */
#details.bagMode .dialog{width:min(900px,96vw);max-width:900px;padding:14px 18px 16px;border:2px solid #d9b04a!important;border-image:none!important;border-radius:8px;background:radial-gradient(120% 60% at 50% 0%,#172d58,transparent 60%),linear-gradient(180deg,#0c1831,#070f24)!important;box-shadow:0 0 0 1px #3a2a08,0 0 0 3px #0a1426,0 0 18px #2f8cff44,inset 0 0 26px #1b4fb033,0 12px 30px #000c!important;color:#eaf4ff}
#details.bagMode .eyebrow{text-align:center;letter-spacing:5px;color:#e8c865;font-size:11px}
#details.bagMode #detailTitle{margin:0 0 8px!important;padding:0 0 0 4px!important;background:none!important;border:0!important;text-align:left;font:800 24px 'Noto Sans Thai',Tahoma,sans-serif!important;color:#fff!important;box-shadow:none!important}
#details.bagMode #detailTitle:after{content:"INVENTORY";display:block;font-size:10px;letter-spacing:4px;color:#9fb6d6;font-weight:600}
#details.bagMode .close{color:#fff!important;border:1px solid #d9b04a!important;background:#0c1a3a!important;border-radius:6px}
#details.bagMode .inventoryWindow{display:grid!important;grid-template-columns:170px 1fr!important;gap:12px!important;background:none!important;border:0!important}
#details.bagMode .inventoryCategories{display:flex!important;flex-direction:column!important;gap:6px!important;padding:0!important;background:none!important;border:0!important}
#details.bagMode .inventoryCategories button{display:flex!important;align-items:center;gap:10px;height:48px!important;padding:0 12px!important;border:1px solid #2f4a74!important;border-radius:5px!important;background:linear-gradient(180deg,#12213f,#0b1631)!important;color:#dfe8f5!important;font-size:14px!important;text-align:left;box-shadow:none!important}
#details.bagMode .inventoryCategories button span{font-size:18px;color:#9fc2f0;width:22px;text-align:center}
#details.bagMode .inventoryCategories button.active{border:2px solid #f3cf62!important;background:linear-gradient(180deg,#5a4516,#2a2210)!important;color:#fff!important;box-shadow:0 0 12px #f3cf6266!important}
#details.bagMode .inventoryCategories button.active span{color:#ffd35a}
#details.bagMode .inventoryCategories button:disabled{opacity:.55}
#details.bagMode .inventoryMain{padding:10px!important;border:1px solid #b58f3a!important;border-radius:6px!important;background:#08122a!important;box-shadow:inset 0 0 16px #2f8cff22!important}
#details.bagMode .inventoryTools{display:grid!important;grid-template-columns:1fr 140px auto auto!important;gap:8px!important;margin-bottom:10px!important;background:none!important}
#details.bagMode .inventoryTools input,#details.bagMode .inventoryTools select,#details.bagMode .inventoryTools span,#details.bagMode .inventoryTools b{height:36px!important;padding:0 12px!important;border:1px solid #2f4a74!important;border-radius:5px!important;background:#0c1831!important;color:#dfe8f5!important;font-size:13px!important;display:flex;align-items:center;gap:6px}
#details.bagMode .inventoryTools input::placeholder{color:#7f93b3}
#details.bagMode .inventoryTools b{color:#ffd35a!important}
#details.bagMode .inventoryGrid{display:grid!important;grid-template-columns:repeat(auto-fill,minmax(74px,1fr))!important;gap:8px!important;padding:0!important;background:none!important;border:0!important}
#details.bagMode .inventoryCell{position:relative;height:74px!important;min-height:74px!important;border:1px solid #2f4a74!important;border-radius:4px!important;background:linear-gradient(180deg,#0f1e3d,#0a1530)!important;box-shadow:inset 0 0 0 1px #0006!important;color:#eaf4ff!important}
#details.bagMode .inventoryCell.empty:after{content:"";position:absolute;left:50%;top:50%;width:22px;height:22px;border:1px solid #2a4068;transform:translate(-50%,-50%) rotate(45deg)}
#details.bagMode .inventoryCell:not(.empty):hover{border-color:#6f9ad6!important}
#details.bagMode .inventoryCell.selected{border:2px solid #f3cf62!important;background:linear-gradient(180deg,#3a3016,#161a28)!important;box-shadow:0 0 10px #f3cf6277!important}
#details.bagMode .inventoryCell small{color:#c9d6e8!important}
#details.bagMode .inventoryCell b{background:#12254a!important;color:#fff!important;border:1px solid #6b8fb9}
#details.bagMode .bagItemDetail{margin-top:10px!important;padding:10px 14px!important;border:1px solid #b58f3a!important;border-radius:6px!important;background:linear-gradient(180deg,#0f1c3a,#0a1329)!important;color:#eaf4ff!important}
#details.bagMode .bagItemDetail strong{color:#ffc94a!important}
#details.bagMode .bagItemDetail small{color:#c9d6e8!important}
#details.bagMode .bagItemDetail .bagItemIcon{border:2px solid #f3cf62!important;background:#0a1226!important}
#details.bagMode .bagItemDetail.emptyDetail{display:grid!important;place-items:center;min-height:70px;color:#9fb6d6!important;font-size:13px}
#details.bagMode .bagItemDetail.emptyDetail:before{content:"!";display:grid;place-items:center;width:28px;height:28px;margin-bottom:4px;border:1px solid #6f9ad6;transform:rotate(45deg);color:#ffd35a;font-weight:800}
#details.bagMode .bagItemDetail [data-equip]{border:2px solid #f3cf62!important;border-radius:5px!important;background:linear-gradient(180deg,#c9a24a,#80601c)!important;color:#fff!important;font-weight:800}
#details.bagMode .bagItemDetail [data-equip]:disabled{opacity:.45}
#details.bagMode .statCompare{border:1px solid #2f4a74!important;background:#0a1530!important;color:#dfe8f5!important}
#details.bagMode #jobdesc{text-align:center;color:#9fb6d6}
@media (pointer:coarse),(max-height:500px){#details.bagMode .inventoryWindow{grid-template-columns:62px 1fr!important;gap:6px!important}#details.bagMode .inventoryCategories button{height:44px!important;padding:0!important;justify-content:center;font-size:0!important}#details.bagMode .inventoryCategories button span{font-size:18px}#details.bagMode .inventoryTools{grid-template-columns:1fr auto!important}#details.bagMode .inventoryTools select,#details.bagMode .inventoryTools span{display:none!important}#details.bagMode .inventoryCell{height:60px!important;min-height:60px!important}#details.bagMode .inventoryGrid{grid-template-columns:repeat(auto-fill,minmax(60px,1fr))!important;gap:5px!important}#details.bagMode #detailTitle{font-size:18px!important}}
#details.bagMode #jobdesc{background:none!important;border:0!important;color:#7f93b3!important;margin:8px 0 0!important;padding:0!important;font-size:11px}


/* Bottom status bar (RE:AWAKEN / saved / new save / prototype) hidden */
footer{display:none!important}


/* Shop buy / sell tabs */
.shopTabs{display:flex;gap:6px;margin:8px 0}
.shopTabs button{flex:1;height:36px;border:1px solid #2f4a74;border-radius:5px;background:linear-gradient(180deg,#12213f,#0b1631);color:#dfe8f5;font-weight:800;font-size:14px}
.shopTabs button.active{border:2px solid #f3cf62;background:linear-gradient(180deg,#5a4516,#2a2210);color:#fff}
.sellBtns{display:flex;flex-direction:column;gap:4px}
.sellBtns button{height:28px;padding:0 10px;border:1px solid #f3cf62;border-radius:5px;background:linear-gradient(180deg,#c9a24a,#80601c);color:#fff;font-weight:800;font-size:12px}
.shopEmpty{color:#9fb6d6;text-align:center;padding:14px}

#details.shopMode #detailTitle:after{content:'SHOP'}
.sellBtns{flex-direction:row!important;justify-content:flex-end}
.sellBtns button{width:auto!important;flex:0 0 auto!important}
/* open windows sit above the chat window */
.overlay:not(.hidden){z-index:1300}


/* ===== Login screen: artwork background (assets/ui/login-bg.webp, 1672x941); real inputs/buttons sit on the drawn ones ===== */
.onlineLogin{background:#050b1a!important;backdrop-filter:none!important;padding:0!important;overflow:hidden!important;display:block!important}
.onlineLogin.hidden{display:none!important}
.loginArt{position:absolute;left:50%;top:50%;width:max(100vw,100dvh*1672/941);height:max(100dvh,100vw*941/1672);transform:translate(-50%,-50%);background:url("assets/ui/login-bg.webp") center/100% 100% no-repeat}
.loginArt .onlineCard{position:absolute!important;inset:0!important;width:auto!important;max-width:none!important;margin:0!important;padding:0!important;background:none!important;border:0!important;box-shadow:none!important}
.loginArt .onlineCard:before,.loginArt .onlineCard:after,.loginArt .onlineCard .eyebrow,.loginArt .onlineCard h2,.loginArt .onlineCard>p{display:none!important}
.loginArt .onlineCard input{position:absolute!important;left:40.2%!important;width:20.6%!important;height:5.6%!important;margin:0!important;padding:0 .6em!important;border:0!important;border-radius:6px!important;background:#0b1428!important;color:#eaf4ff!important;font-size:clamp(12px,1.25vw,20px)!important;box-shadow:none!important;outline:none}
.loginArt .onlineCard input::placeholder{color:#8fa3c4}
.loginArt #accountName{top:48.6%!important}
.loginArt #accountPassword{top:58.9%!important}
.loginArt .onlineCard>div{position:static!important}
.loginArt .onlineCard>div button{position:absolute!important;top:69.4%!important;height:7.2%!important;width:13.6%!important;margin:0!important;padding:0!important;border:0!important;border-radius:10px!important;background:transparent!important;color:transparent!important;font-size:0!important;box-shadow:none!important;cursor:pointer}
.loginArt #loginAccount{left:35.7%!important}
.loginArt #registerAccount{left:50.8%!important}
.loginArt .onlineCard>div button:hover{box-shadow:0 0 18px #7fc4ff99!important}
.loginArt .onlineCard>div button:active{transform:scale(.97)}
.loginArt #onlineError{position:absolute;left:33%;width:34%;top:79%;text-align:center;color:#ffb4b4;font-weight:700;font-size:clamp(11px,1.1vw,16px);text-shadow:0 1px 3px #000}

/* iOS Safari zooms into inputs with text under 16px and stays zoomed (HUD cut off at the edges) - keep inputs at 16px on touch screens */
@media (pointer:coarse){input,select,textarea{font-size:16px!important}.onlinePanel #chatForm input{height:30px!important}}


/* ===== Click/tap to move: no joystick; quick slots 1-9 in a bar at the bottom centre; attack cluster moved in ===== */
body .joystick{display:none!important}
body .radialActions .quickSlot{position:fixed!important;display:block!important;right:auto!important;top:auto!important;bottom:max(10px,env(safe-area-inset-bottom))!important;width:46px!important;height:46px!important;pointer-events:auto}
body .radialActions .quickSlot.q1{left:calc(50% + -208px - 23px)!important;bottom:max(10px,env(safe-area-inset-bottom))!important}
body .radialActions .quickSlot.q2{left:calc(50% + -156px - 23px)!important;bottom:max(10px,env(safe-area-inset-bottom))!important}
body .radialActions .quickSlot.q3{left:calc(50% + -104px - 23px)!important;bottom:max(10px,env(safe-area-inset-bottom))!important}
body .radialActions .quickSlot.q4{left:calc(50% + -52px - 23px)!important;bottom:max(10px,env(safe-area-inset-bottom))!important}
body .radialActions .quickSlot.q5{left:calc(50% + 0px - 23px)!important;bottom:max(10px,env(safe-area-inset-bottom))!important}
body .radialActions .quickSlot.q6{left:calc(50% + 52px - 23px)!important;bottom:max(10px,env(safe-area-inset-bottom))!important}
body .radialActions .quickSlot.q7{left:calc(50% + 104px - 23px)!important;bottom:max(10px,env(safe-area-inset-bottom))!important}
body .radialActions .quickSlot.q8{left:calc(50% + 156px - 23px)!important;bottom:max(10px,env(safe-area-inset-bottom))!important}
body .radialActions .quickSlot.q9{left:calc(50% + 208px - 23px)!important;bottom:max(10px,env(safe-area-inset-bottom))!important}
body .radialActions{right:70px!important;bottom:18px!important}
@media (pointer:coarse),(max-height:500px){
 body .radialActions .quickSlot{width:38px!important;height:38px!important;bottom:max(6px,env(safe-area-inset-bottom))!important}
 body .radialActions .quickSlot.q1{left:calc(50% + -168px - 19px)!important;bottom:max(6px,env(safe-area-inset-bottom))!important}
 body .radialActions .quickSlot.q2{left:calc(50% + -126px - 19px)!important;bottom:max(6px,env(safe-area-inset-bottom))!important}
 body .radialActions .quickSlot.q3{left:calc(50% + -84px - 19px)!important;bottom:max(6px,env(safe-area-inset-bottom))!important}
 body .radialActions .quickSlot.q4{left:calc(50% + -42px - 19px)!important;bottom:max(6px,env(safe-area-inset-bottom))!important}
 body .radialActions .quickSlot.q5{left:calc(50% + 0px - 19px)!important;bottom:max(6px,env(safe-area-inset-bottom))!important}
 body .radialActions .quickSlot.q6{left:calc(50% + 42px - 19px)!important;bottom:max(6px,env(safe-area-inset-bottom))!important}
 body .radialActions .quickSlot.q7{left:calc(50% + 84px - 19px)!important;bottom:max(6px,env(safe-area-inset-bottom))!important}
 body .radialActions .quickSlot.q8{left:calc(50% + 126px - 19px)!important;bottom:max(6px,env(safe-area-inset-bottom))!important}
 body .radialActions .quickSlot.q9{left:calc(50% + 168px - 19px)!important;bottom:max(6px,env(safe-area-inset-bottom))!important}
 body .radialActions .quickSlot.q5,body .radialActions .quickSlot.q6,body .radialActions .quickSlot.q7,body .radialActions .quickSlot.q8,body .radialActions .quickSlot.q9{display:block!important}
 body .radialActions{right:calc(env(safe-area-inset-right) + 34px)!important;bottom:calc(env(safe-area-inset-bottom) + 10px)!important}
}
@media (pointer:coarse),(max-height:500px){body .radialActions .useBtn{right:4px!important;bottom:92px!important}body .radialActions .autoToggle{right:62px!important;bottom:104px!important}}


/* ===== Quick-slot bar (1-9): one translucent strip, rounded slots, number badge top-left, count bottom-right, gold rim when filled ===== */
body .radialActions:before{content:"";position:fixed;left:50%;bottom:max(6px,env(safe-area-inset-bottom));transform:translateX(-50%);width:572px;height:72px;border-radius:12px;background:rgba(20,40,20,.38);box-shadow:inset 0 0 0 1px rgba(255,255,255,.08),0 4px 14px rgba(0,0,0,.25);pointer-events:none;z-index:0}
body .radialActions .quickSlot{width:56px!important;height:56px!important;border-radius:10px!important;border:2px solid rgba(225,232,215,.45)!important;background:rgba(40,70,40,.35)!important;box-shadow:inset 0 2px 6px rgba(0,0,0,.25)!important;backdrop-filter:none!important;overflow:visible}
body .radialActions .quickSlot:after{display:none!important}
body .radialActions .quickSlot:has(.quickSlotIcon){border-color:#d8b35a!important;background:radial-gradient(circle at 50% 45%,rgba(140,110,50,.55),rgba(60,55,30,.55))!important}
body .radialActions .quickSlot b{position:absolute!important;top:3px!important;left:3px!important;right:auto!important;transform:none!important;width:18px!important;height:18px!important;display:grid;place-items:center;border-radius:5px!important;border:0!important;background:rgba(40,40,45,.85)!important;color:#fff!important;font-size:12px!important;font-weight:800}
body .radialActions .quickSlot .quickSlotIcon{width:34px!important;height:34px!important;position:absolute;left:50%;top:52%;transform:translate(-50%,-50%);image-rendering:pixelated}
body .radialActions .quickSlot .quickCount{position:absolute!important;right:3px!important;bottom:1px!important;left:auto!important;top:auto!important;background:none!important;border:0!important;color:#fff!important;font-size:13px!important;font-weight:800;font-style:normal;text-shadow:0 1px 2px #000,1px 0 #000}
body .radialActions .quickSlot.q1{left:calc(50% + -248px - 28px)!important;bottom:calc(max(6px,env(safe-area-inset-bottom)) + 8px)!important}
body .radialActions .quickSlot.q2{left:calc(50% + -186px - 28px)!important;bottom:calc(max(6px,env(safe-area-inset-bottom)) + 8px)!important}
body .radialActions .quickSlot.q3{left:calc(50% + -124px - 28px)!important;bottom:calc(max(6px,env(safe-area-inset-bottom)) + 8px)!important}
body .radialActions .quickSlot.q4{left:calc(50% + -62px - 28px)!important;bottom:calc(max(6px,env(safe-area-inset-bottom)) + 8px)!important}
body .radialActions .quickSlot.q5{left:calc(50% + 0px - 28px)!important;bottom:calc(max(6px,env(safe-area-inset-bottom)) + 8px)!important}
body .radialActions .quickSlot.q6{left:calc(50% + 62px - 28px)!important;bottom:calc(max(6px,env(safe-area-inset-bottom)) + 8px)!important}
body .radialActions .quickSlot.q7{left:calc(50% + 124px - 28px)!important;bottom:calc(max(6px,env(safe-area-inset-bottom)) + 8px)!important}
body .radialActions .quickSlot.q8{left:calc(50% + 186px - 28px)!important;bottom:calc(max(6px,env(safe-area-inset-bottom)) + 8px)!important}
body .radialActions .quickSlot.q9{left:calc(50% + 248px - 28px)!important;bottom:calc(max(6px,env(safe-area-inset-bottom)) + 8px)!important}
@media (pointer:coarse),(max-height:500px){
 body .radialActions:before{width:404px;height:50px;border-radius:9px}
 body .radialActions .quickSlot{width:40px!important;height:40px!important;border-radius:8px!important}
 body .radialActions .quickSlot b{width:14px!important;height:14px!important;font-size:9px!important;border-radius:4px!important}
 body .radialActions .quickSlot .quickSlotIcon{width:24px!important;height:24px!important}
 body .radialActions .quickSlot .quickCount{font-size:10px!important}
 body .radialActions .quickSlot.q1{left:calc(50% + -176px - 20px)!important;bottom:calc(max(4px,env(safe-area-inset-bottom)) + 5px)!important}
 body .radialActions .quickSlot.q2{left:calc(50% + -132px - 20px)!important;bottom:calc(max(4px,env(safe-area-inset-bottom)) + 5px)!important}
 body .radialActions .quickSlot.q3{left:calc(50% + -88px - 20px)!important;bottom:calc(max(4px,env(safe-area-inset-bottom)) + 5px)!important}
 body .radialActions .quickSlot.q4{left:calc(50% + -44px - 20px)!important;bottom:calc(max(4px,env(safe-area-inset-bottom)) + 5px)!important}
 body .radialActions .quickSlot.q5{left:calc(50% + 0px - 20px)!important;bottom:calc(max(4px,env(safe-area-inset-bottom)) + 5px)!important}
 body .radialActions .quickSlot.q6{left:calc(50% + 44px - 20px)!important;bottom:calc(max(4px,env(safe-area-inset-bottom)) + 5px)!important}
 body .radialActions .quickSlot.q7{left:calc(50% + 88px - 20px)!important;bottom:calc(max(4px,env(safe-area-inset-bottom)) + 5px)!important}
 body .radialActions .quickSlot.q8{left:calc(50% + 132px - 20px)!important;bottom:calc(max(4px,env(safe-area-inset-bottom)) + 5px)!important}
 body .radialActions .quickSlot.q9{left:calc(50% + 176px - 20px)!important;bottom:calc(max(4px,env(safe-area-inset-bottom)) + 5px)!important}
}

/* Phones: shrink the whole window (status / equipment / bag / shop) proportionally so it fits the screen */
@media (pointer:coarse),(max-height:500px){
 body #details .dialog{zoom:.62;width:calc(96vw / .62)!important;max-width:calc(96vw / .62)!important;max-height:calc((100dvh - 10px) / .62)!important;overflow:auto!important}
}
@media (pointer:coarse) and (min-height:501px),(min-width:1000px) and (pointer:coarse){
 body #details .dialog{zoom:.8;width:calc(94vw / .8)!important;max-width:calc(94vw / .8)!important;max-height:calc((100dvh - 16px) / .8)!important}
}
@media (pointer:coarse),(max-height:500px){body #details.equipmentMode .equipSlot{min-height:44px!important;padding:3px 8px 3px 4px!important;gap:8px!important;grid-template-columns:38px 1fr 12px!important}body #details.equipmentMode .equipIcon{width:36px!important;height:36px!important}body #details.equipmentMode .equipSlot em{display:none!important}body #details.equipmentMode .slotColumn{gap:4px!important}body #details.equipmentMode .equipIdentity{margin-bottom:6px!important}body #details.equipmentMode #detailTitle{font-size:20px!important;margin:0 0 4px!important}body #details.equipmentMode .selectedEquipment{margin-top:6px!important;padding:6px 10px!important}body #details.equipmentMode #jobdesc{display:none}}

@media (pointer:coarse),(max-height:500px){body #details.equipmentMode .selectedEquipment{grid-template-columns:44px 1fr auto auto!important;gap:10px!important;align-items:center!important}body #details.equipmentMode .selectedIcon{width:42px!important;height:42px!important}body #details.equipmentMode .selectedIcon img{width:34px!important;height:34px!important}body #details.equipmentMode .selectedEquipment strong{font-size:15px!important}body #details.equipmentMode .selectedEquipment small,body #details.equipmentMode .selectedEquipment em{font-size:11px!important}body #details.equipmentMode #chooseEquipment,body #details.equipmentMode #unequipSelected{height:36px!important;padding:0 16px!important;grid-column:auto!important}}


/* Phones: windows even smaller */
@media (pointer:coarse),(max-height:500px){body #details .dialog{zoom:.5;width:calc(90vw / .5)!important;max-width:calc(90vw / .5)!important;max-height:calc((100dvh - 16px) / .5)!important}}
@media (pointer:coarse) and (min-height:501px){body #details .dialog{zoom:.68;width:calc(90vw / .68)!important;max-width:calc(90vw / .68)!important;max-height:calc((100dvh - 16px) / .68)!important}}


/* Phones: windows keep their own (PC) width at 50% scale and sit in the middle of the screen */
@media (pointer:coarse),(max-height:500px){body #details:not(.hidden){display:grid!important;place-items:center!important}body #details .dialog{width:820px!important;max-width:calc(96vw / .5)!important;margin:auto!important}}
@media (pointer:coarse) and (min-height:501px){body #details .dialog{max-width:calc(96vw / .68)!important}}


/* PC: long windows (shop) scroll inside instead of running off the screen */
#details .dialog{max-height:calc(100dvh - 40px);overflow-y:auto}


/* Potion cooldown on quick slots */
body .radialActions .quickSlot.onCd:before{content:attr(data-cd);position:absolute;inset:0;z-index:3;display:grid;place-items:center;border-radius:inherit;background:conic-gradient(rgba(0,0,0,.62) var(--cd),rgba(0,0,0,.15) 0);color:#fff;font-weight:800;font-size:18px;text-shadow:0 1px 2px #000;pointer-events:none}
@media (pointer:coarse),(max-height:500px){body .radialActions .quickSlot.onCd:before{font-size:13px}}

/* Level-up panel above the player's head */
.levelFx{position:absolute;z-index:6;pointer-events:none;background:url("assets/fx/levelup.png?v=3") no-repeat;transform:translate(-50%,-210%);mix-blend-mode:screen}

/* Mobile perf: backdrop blur re-renders every frame while the map scrolls; drop it on touch screens */
@media (pointer:coarse){*,*:before,*:after{-webkit-backdrop-filter:none!important;backdrop-filter:none!important}}

/* Other players: level-up panel above their head; no HP/SP bars under their feet */
.remotePlayer .rLevelFx{transform:translate(-50%,-115%)}
.remotePlayer .remoteHp,.remotePlayer .remoteMp{display:none!important}

/* Login / register modes */
.onlineCard .authSwitch{display:block;margin:8px auto 0;background:none!important;border:0!important;box-shadow:none!important;color:#f3d27a;text-decoration:underline;font-size:14px;cursor:pointer;padding:4px}
.onlineCard .registerHint{display:block;color:#b9c7e6;font-size:12px;margin:2px 0 6px}
.onlineCard .registerHint[hidden],.onlineCard input[hidden],.onlineCard button[hidden]{display:none!important}
@media (pointer:coarse){.onlineCard input#accountPassword2{font-size:16px}}

/* Register mode: the painted login frame is swapped for a plain themed card with its own fields */
.loginArt .onlineCard.registerMode{inset:auto!important;left:50%!important;top:61.5%!important;transform:translate(-50%,-50%);width:40%!important;min-width:280px;min-height:46%;justify-content:center;padding:18px 22px!important;background:linear-gradient(180deg,#14223d,#0b1428)!important;border:2px solid #d9b04a!important;border-radius:12px!important;box-shadow:0 0 0 4px #0b1428,0 10px 40px #000a!important;display:flex;flex-direction:column;gap:6px;text-align:center}
.loginArt .onlineCard.registerMode h2{display:block!important;margin:0 0 4px;color:#f3d27a;font-size:20px}
.loginArt .onlineCard.registerMode input{position:static!important;width:100%!important;height:40px!important;border:1px solid #4d6a9a!important;left:auto!important;top:auto!important}
.loginArt .onlineCard.registerMode>div button{position:static!important;width:100%!important;height:42px!important;background:linear-gradient(180deg,#2aa56c,#15724a)!important;color:#fff!important;font-size:16px!important;border:2px solid #d9b04a!important}
.loginArt .onlineCard.registerMode #onlineError{position:static;width:auto}
.loginArt .onlineCard.registerMode .registerHint{text-align:left}
@media (max-height:520px){.loginArt .onlineCard.registerMode{top:50%!important;padding:10px 16px!important;gap:3px}.loginArt .onlineCard.registerMode input{height:32px!important}.loginArt .onlineCard.registerMode>div button{height:34px!important}.loginArt .onlineCard.registerMode h2{font-size:16px}}

/* Attack button art (assets/ui/attack-btn.webp): the ring is cropped by position/size, the round border-radius clips the rest */
body .radialActions .attack{background:url("assets/ui/attack-btn.webp") 50% 49.6%/170.4% auto no-repeat!important;border:0!important;border-radius:50%!important;box-shadow:0 5px 14px #000a!important}
body .radialActions .attack span{display:none!important}
body .radialActions .attack small{top:-3%!important;left:4%!important;right:auto!important;width:56%;text-align:center;padding:2px 0!important;background:linear-gradient(180deg,#1b2338,#0b1020)!important;border:1.5px solid #e2b957!important;border-radius:9px!important;color:#f3d27a!important;font-family:Georgia,serif!important;font-weight:700!important;letter-spacing:.5px;box-shadow:0 2px 5px #0008!important}
body .radialActions .attack:active{transform:scale(.95)}

/* SPACE tag: the art's own tag, cut from the same image and placed where it sits on the ring */
body .radialActions .attack small{display:none!important}
body .radialActions .attack:before{content:"";position:absolute;left:-6.4%;top:-7.7%;width:57.1%;height:20.7%;background:url("assets/ui/attack-btn.webp") 25.4% 18.1%/298.6% auto no-repeat;border-radius:18.1%/50%;pointer-events:none;z-index:2}

/* AUTO button art (assets/ui/auto-btn.webp, white background masked away): badge drawn in :before over the round button */
body .radialActions .autoToggle{background:none!important;border:0!important;box-shadow:none!important;overflow:visible!important}
body .radialActions .autoToggle>*{display:none!important}
body .radialActions .autoToggle:before{content:"";position:absolute;left:0;top:-7.1%;width:100%;height:114%;background:url("assets/ui/auto-btn.webp") 50% 39.3%/144.1% auto no-repeat;pointer-events:none;
 -webkit-mask:radial-gradient(ellipse 50% 43.85% at 50% 50.1%,#000 98%,transparent 100%),radial-gradient(ellipse 15.5% 13.6% at 50% 13.6%,#000 98%,transparent 100%),radial-gradient(ellipse 12.8% 11.2% at 24.6% 88.8%,#000 98%,transparent 100%),radial-gradient(ellipse 12.8% 11.2% at 74.9% 88.8%,#000 98%,transparent 100%),linear-gradient(#000,#000) 49.5% 100%/50.3% 22.4% no-repeat;
 mask:radial-gradient(ellipse 50% 43.85% at 50% 50.1%,#000 98%,transparent 100%),radial-gradient(ellipse 15.5% 13.6% at 50% 13.6%,#000 98%,transparent 100%),radial-gradient(ellipse 12.8% 11.2% at 24.6% 88.8%,#000 98%,transparent 100%),radial-gradient(ellipse 12.8% 11.2% at 74.9% 88.8%,#000 98%,transparent 100%),linear-gradient(#000,#000) 49.5% 100%/50.3% 22.4% no-repeat;
 filter:drop-shadow(0 3px 5px #000a) grayscale(.35) brightness(.8)}
body .radialActions .autoToggle.active:before{filter:drop-shadow(0 0 8px #7fd0ff) brightness(1.1)}
body .radialActions .autoToggle:active{transform:scale(.95)}

/* ===== Bag window v2 (Academy Archives mockup) ===== */
#details.bagMode:not(.shopMode) .inventoryCategories button{position:relative;display:flex!important;align-items:center;gap:14px;min-height:52px;padding:0 14px!important;font-size:15px!important;color:#cfd8ea!important;background:linear-gradient(90deg,#16233d,#0f1a2e)!important;border:1px solid #2c3f63!important;border-radius:4px!important}
#details.bagMode:not(.shopMode) .inventoryCategories button span{display:grid;place-items:center;width:28px;height:28px;font-size:0}
#details.bagMode:not(.shopMode) .inventoryCategories button svg{width:26px;height:26px;fill:#aebfe0}
#details.bagMode:not(.shopMode) .inventoryCategories button.active{color:#fff4d2!important;background:linear-gradient(90deg,#6b4a18,#3a2a12 70%,#2a2010)!important;border:1.5px solid #e6b94f!important;box-shadow:0 0 14px #e6b94f66,inset 0 0 18px #ffcf6a33!important}
#details.bagMode:not(.shopMode) .inventoryCategories button.active svg{fill:#ffd978}
#details.bagMode:not(.shopMode) .inventoryCategories button.active:after{content:"›";position:absolute;right:12px;top:50%;transform:translateY(-52%);font-size:24px;color:#ffd978}
#details.bagMode:not(.shopMode) .inventoryCategories button:disabled{opacity:.55}
#details.bagMode:not(.shopMode) .inventoryCategories{position:relative}
#details.bagMode:not(.shopMode) .inventoryCategories:after{content:"";position:absolute;left:10%;right:10%;bottom:6px;height:120px;opacity:.13;pointer-events:none;background:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill="%23e6b94f" d="M50 0l6 44 44 6-44 6-6 44-6-44L0 50l44-6z"/><circle cx="50" cy="50" r="30" fill="none" stroke="%23e6b94f" stroke-width="1.5"/></svg>') center/contain no-repeat}
#details.bagMode:not(.shopMode) .bagSearchBox{position:relative;flex:1;display:block;min-width:0}
#details.bagMode:not(.shopMode) .bagSearchBox:before{content:"";position:absolute;left:10px;top:50%;width:16px;height:16px;transform:translateY(-50%);pointer-events:none;background:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><circle cx="10" cy="10" r="6.5" fill="none" stroke="%239fb2d4" stroke-width="2.2"/><path d="M15 15l6 6" stroke="%239fb2d4" stroke-width="2.4" stroke-linecap="round"/></svg>') center/contain no-repeat}
#details.bagMode:not(.shopMode) .bagSearchBox input{width:100%!important;padding-left:34px!important}
#details.bagMode:not(.shopMode) .inventoryTools select{cursor:pointer;opacity:1!important}
#details.bagMode:not(.shopMode) .bagCount b{color:#ffd978}
#details.bagMode:not(.shopMode) .inventoryGrid{grid-template-columns:repeat(9,1fr)!important;max-height:calc((100% - 0px));overflow-y:auto}
#details.bagMode:not(.shopMode) .inventoryCell{aspect-ratio:1;border:1px solid #3d5070!important;border-radius:3px!important;background:linear-gradient(160deg,#16223a,#0d1628)!important;box-shadow:inset 0 0 0 1px #0a1120,inset 6px 6px 0 -5px #c9a14a88}
#details.bagMode:not(.shopMode) .inventoryCell.empty:before{content:"";position:absolute;left:50%;top:50%;width:30%;height:30%;transform:translate(-50%,-50%) rotate(45deg);border:1px solid #33476a}
#details.bagMode:not(.shopMode) .inventoryCell.locked{opacity:.35}
#details.bagMode:not(.shopMode) .inventoryCell.locked:before{border-style:dashed}
#details.bagMode:not(.shopMode) .emptyDetail{display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:10px;min-height:110px;color:#c9d3e6}
#details.bagMode:not(.shopMode) .emptyDetail:before{display:none!important}
#details.bagMode:not(.shopMode) .emptyMark{display:grid;place-items:center;width:30px;height:30px;transform:rotate(45deg);border:1.5px solid #6d86b5;background:#0f1a30;font-style:normal}
#details.bagMode:not(.shopMode) .emptyMark{font-size:0}
#details.bagMode:not(.shopMode) .emptyMark:after{content:"!";transform:rotate(-45deg);font-size:18px;font-weight:800;color:#dfe8ff}
#details.bagMode:not(.shopMode) .inventoryGrid{grid-template-columns:repeat(9,minmax(0,1fr))!important;overflow-x:hidden!important;grid-auto-rows:auto!important}
#details.bagMode:not(.shopMode) .inventoryCell{width:auto!important;min-width:0!important;height:auto!important;position:relative}
#details.bagMode:not(.shopMode) .inventoryGrid{gap:7px!important;padding:4px!important}
@media (pointer:coarse),(max-height:520px){
 #details.bagMode:not(.shopMode) .inventoryCategories button{min-height:44px;padding:0!important;justify-content:center;gap:0;font-size:0!important}
 #details.bagMode:not(.shopMode) .inventoryCategories button.active:after,#details.bagMode:not(.shopMode) .inventoryCategories:after{display:none}
 #details.bagMode:not(.shopMode) .inventoryCell small{display:none!important}
 #details.bagMode:not(.shopMode) .inventoryCell>span{position:absolute;inset:12%;display:grid;place-items:center}
 #details.bagMode:not(.shopMode) .inventoryCell>span img{width:100%!important;height:100%!important;object-fit:contain}
}

/* ===== Bag window v3: the Academy Archives art (assets/ui/bag-bg.webp, 1536x1024) is the window; live controls sit on its boxes (positions in % of the art) ===== */
body #details.bagMode:not(.shopMode) .dialog{position:relative!important;width:min(94vw,141vh)!important;max-width:none!important;height:auto!important;max-height:none!important;aspect-ratio:3/2;padding:0!important;overflow:hidden!important;background:url("assets/ui/bag-bg.webp") center/100% 100% no-repeat!important;border:0!important;border-radius:0!important;box-shadow:0 20px 60px #000c!important}
body #details.bagMode:not(.shopMode) .dialog:before,body #details.bagMode:not(.shopMode) .dialog:after,body #details.bagMode:not(.shopMode) .eyebrow,body #details.bagMode:not(.shopMode) #detailTitle,body #details.bagMode:not(.shopMode) #jobdesc{display:none!important}
body #details.bagMode:not(.shopMode) #detailBody{position:static!important;padding:0!important;margin:0!important;overflow:visible!important;max-height:none!important}
body #details.bagMode:not(.shopMode) .inventoryWindow,body #details.bagMode:not(.shopMode) .inventoryMain,body #details.bagMode:not(.shopMode) .inventoryTools{position:static!important;display:block!important;padding:0!important;margin:0!important;background:none!important;border:0!important;box-shadow:none!important}
body #details.bagMode:not(.shopMode) .inventoryWindow>*,body #details.bagMode:not(.shopMode) .inventoryMain>*,body #details.bagMode:not(.shopMode) .inventoryTools>*{position:absolute!important;margin:0!important;box-sizing:border-box}
body #details.bagMode:not(.shopMode) .inventoryMain,body #details.bagMode:not(.shopMode) .inventoryTools{position:static!important}
/* close = the art's diamond X */
body #details.bagMode:not(.shopMode) #closeDetails{position:absolute!important;left:93.6%!important;top:1.2%!important;right:auto!important;width:5.4%!important;height:7.6%!important;background:transparent!important;border:0!important;box-shadow:none!important;color:transparent!important;font-size:0!important;z-index:5;cursor:pointer}
/* category tabs on the art's tabs: the art's own tab is used as-is; only the active one gets the gold glow, the painted "all" glow is dimmed when another tab is active */
body #details.bagMode:not(.shopMode) .inventoryCategories{left:1%!important;top:13%!important;width:18.9%!important;height:47.5%!important;display:block!important;background:none!important;border:0!important;padding:0!important}
body #details.bagMode:not(.shopMode) .inventoryCategories:after{display:none!important}
body #details.bagMode:not(.shopMode) .inventoryCategories button{position:absolute!important;left:0!important;width:100%!important;height:19.2%!important;min-height:0!important;margin:0!important;padding:0!important;background:transparent!important;border:0!important;box-shadow:none!important;color:transparent!important;font-size:0!important;border-radius:3px!important}
body #details.bagMode:not(.shopMode) .inventoryCategories button>span{display:none!important}
body #details.bagMode:not(.shopMode) .inventoryCategories button:nth-child(1){top:0!important}
body #details.bagMode:not(.shopMode) .inventoryCategories button:nth-child(2){top:20.6%!important}
body #details.bagMode:not(.shopMode) .inventoryCategories button:nth-child(3){top:41.2%!important}
body #details.bagMode:not(.shopMode) .inventoryCategories button:nth-child(4){top:61.8%!important}
body #details.bagMode:not(.shopMode) .inventoryCategories button:nth-child(5){top:82.4%!important}
body #details.bagMode:not(.shopMode) .inventoryCategories button.active:after{display:none!important}
body #details.bagMode:not(.shopMode) .inventoryCategories button.active:not(:first-child){box-shadow:inset 0 0 0 2px #e6b94f,0 0 16px #e6b94f88,inset 0 0 30px #ffcf6a44!important;background:linear-gradient(90deg,#e6b94f33,#e6b94f11)!important}
body #details.bagMode:not(.shopMode) .inventoryCategories:has(button.active:not(:first-child)) button:first-child{background:#0e1a2fcc!important;box-shadow:inset 0 0 0 1px #2c3f63!important}
body #details.bagMode:not(.shopMode) .inventoryCategories:has(button.active:not(:first-child)) button:first-child:before{content:"ทั้งหมด";position:absolute;left:35%;top:50%;transform:translateY(-50%);font-size:clamp(9px,1.3vw,17px);color:#cfd8ea}
body #details.bagMode:not(.shopMode) .inventoryCategories button:not(:disabled):hover{box-shadow:inset 0 0 0 1px #e6b94f99!important}
/* top bar: search / rarity / slots / coins placed on the painted boxes (opaque so the painted placeholder text is covered) */
body #details.bagMode:not(.shopMode) .bagSearchBox{left:22.9%!important;top:12.3%!important;width:37.3%!important;height:5.3%!important;flex:none!important}
body #details.bagMode:not(.shopMode) .bagSearchBox:before{left:4%!important;width:5%!important;height:55%!important}
body #details.bagMode:not(.shopMode) .bagSearchBox input{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;margin:0!important;padding:0 0 0 11%!important;background:#0b1428!important;border:1px solid #2f4468!important;border-radius:4px!important;color:#eaf2ff!important;font-size:clamp(10px,1.2vw,18px)!important}
body #details.bagMode:not(.shopMode) #bagRarity{left:61.6%!important;top:12.3%!important;width:14.1%!important;height:5.3%!important;padding:0 3%!important;background:#0e1830!important;border:1px solid #3a5582!important;border-radius:4px!important;color:#eaf2ff!important;font-size:clamp(10px,1.2vw,18px)!important;display:block!important}
body #details.bagMode:not(.shopMode) .bagCount{left:77.2%!important;top:12.3%!important;width:9.5%!important;height:5.3%!important;display:grid!important;place-items:center;background:#0b1428!important;border:1px solid #2f4468;border-radius:4px;color:#dfe7f5;font-size:clamp(10px,1.15vw,17px)!important;white-space:nowrap}
body #details.bagMode:not(.shopMode) .inventoryTools>b{left:88.1%!important;top:12.3%!important;width:8.5%!important;height:5.3%!important;display:flex!important;align-items:center;justify-content:center;gap:8%;background:#0b1428!important;border:1px solid #2f4468;border-radius:4px;color:#ffd978!important;font-size:clamp(10px,1.2vw,18px)!important}
body #details.bagMode:not(.shopMode) .inventoryTools>b img{width:1.3em;height:1.3em}
/* grid = the painted 9x4 slots; transparent cells, scroll one painted row at a time for slots 37-40 */
body #details.bagMode:not(.shopMode) .inventoryGrid{left:22.6%!important;top:20.2%!important;width:74.2%!important;height:49%!important;display:grid!important;grid-template-columns:repeat(9,1fr)!important;grid-auto-rows:25%!important;gap:0!important;padding:0!important;overflow-y:auto!important;overflow-x:hidden!important;scroll-snap-type:y mandatory;scrollbar-width:none;background:none!important;border:0!important;max-height:none!important}
body #details.bagMode:not(.shopMode) .inventoryGrid::-webkit-scrollbar{display:none}
body #details.bagMode:not(.shopMode) .inventoryCell{scroll-snap-align:start;aspect-ratio:auto!important;width:auto!important;height:auto!important;margin:0!important;background:transparent!important;border:0!important;box-shadow:none!important;border-radius:0!important;position:relative!important}
body #details.bagMode:not(.shopMode) .inventoryCell.empty:before{display:none!important}
body #details.bagMode:not(.shopMode) .inventoryCell.locked{display:none!important}
body #details.bagMode:not(.shopMode) .inventoryCell>span{position:absolute!important;inset:18%!important;display:grid!important;place-items:center}
body #details.bagMode:not(.shopMode) .inventoryCell>span img{width:100%!important;height:100%!important;object-fit:contain}
body #details.bagMode:not(.shopMode) .inventoryCell small{display:none!important}
body #details.bagMode:not(.shopMode) .inventoryCell b{position:absolute!important;right:14%!important;bottom:12%!important;font-size:clamp(8px,.9vw,13px)!important}
body #details.bagMode:not(.shopMode) .inventoryCell.selected{box-shadow:inset 0 0 0 2px #ffd978,inset 0 0 14px #ffd97866!important}
body #details.bagMode:not(.shopMode) .inventoryCell:not(.empty):hover{box-shadow:inset 0 0 0 1px #ffd97899!important}
/* detail box: the painted "select an item" text shows when nothing is selected */
body #details.bagMode:not(.shopMode) .bagItemDetail{left:21.9%!important;top:74.6%!important;width:75.6%!important;height:16%!important;background:#0b1428!important;border:0!important;border-radius:4px;display:flex!important;align-items:center;gap:2%;padding:0 2%!important}
body #details.bagMode:not(.shopMode) .bagItemDetail.emptyDetail{opacity:0!important;pointer-events:none}
body #details.bagMode:not(.shopMode) .statCompare{left:60%!important;top:74.6%!important;width:37.5%!important;height:16%!important;overflow:auto;background:#0b1428!important;border:0!important;border-left:1px solid #2f4468!important;padding:.5% 1%!important;font-size:clamp(8px,.85vw,12px)!important}
body #details.bagMode:not(.shopMode) .inventoryMain:has(.statCompare) .bagItemDetail{width:38%!important}
body #details.bagMode:not(.shopMode) .inventoryCategories button.active{background:transparent!important;box-shadow:none!important;border:0!important;color:transparent!important}
body #details.bagMode:not(.shopMode) .inventoryCategories button.active:not(:first-child){box-shadow:inset 0 0 0 2px #e6b94f,0 0 16px #e6b94f88,inset 0 0 30px #ffcf6a44!important;background:linear-gradient(90deg,#e6b94f33,#e6b94f11)!important}
body #details.bagMode:not(.shopMode) .bagCount{display:flex!important;align-items:center;justify-content:center;gap:6%}
/* the bag art scales itself: skip the 50% window zoom used on phones */
body #details.bagMode:not(.shopMode) .dialog{zoom:1!important;width:min(96vw,142vh)!important}
@media (pointer:coarse),(max-height:520px){body #details.bagMode:not(.shopMode) .inventoryCell b{font-size:8px!important;padding:0 2px!important;min-width:0!important;right:10%!important;bottom:8%!important}body #details.bagMode:not(.shopMode) #bagRarity,body #details.bagMode:not(.shopMode) .bagCount,body #details.bagMode:not(.shopMode) .bagSearchBox input,body #details.bagMode:not(.shopMode) .inventoryTools>b{font-size:10px!important;display:flex!important}body #details.bagMode:not(.shopMode) #bagRarity{display:block!important;padding:0 2%!important}body #details.bagMode:not(.shopMode) .bagCount b{background:none!important;border:0!important;padding:0!important}}
body #details.bagMode:not(.shopMode) .inventoryGrid .inventoryCell{min-height:0!important;max-height:none!important;padding:0!important}
/* bag window: smaller on PC, and the empty strip under the painted frame is clipped off */
body #details.bagMode:not(.shopMode) .dialog{width:min(72vw,100vh)!important;clip-path:inset(0 0 4.9% 0);margin-bottom:-3.3%!important}
@media (pointer:coarse),(max-height:520px){body #details.bagMode:not(.shopMode) .dialog{width:min(92vw,125vh)!important}}
body #details.bagMode:not(.shopMode) .dialog{container-type:inline-size}
body #details.bagMode:not(.shopMode) #bagRarity,body #details.bagMode:not(.shopMode) .bagCount,body #details.bagMode:not(.shopMode) .bagSearchBox input,body #details.bagMode:not(.shopMode) .inventoryTools>b{font-size:1.35cqw!important}
body #details.bagMode:not(.shopMode) #bagRarity{padding:0 1.2cqw!important}
body #details.bagMode:not(.shopMode) .bagCount b{background:none!important;border:0!important;padding:0!important;font-size:inherit!important}
body #details.bagMode:not(.shopMode) .inventoryGrid .inventoryCell b{font-size:.95cqw!important;padding:0 .3cqw!important;min-width:0!important}
body #details.bagMode:not(.shopMode) .bagItemDetail,body #details.bagMode:not(.shopMode) .statCompare{font-size:1.1cqw!important}
@media (pointer:coarse),(max-height:520px){body #details.bagMode:not(.shopMode){display:grid!important;place-items:center!important;align-items:center!important;padding:0!important}body #details.bagMode:not(.shopMode) .dialog{margin:0!important;width:min(92vw,120vh)!important}}
/* bag: drag the window by its frame; drag potions out of the grid without the grid scrolling (touch) */
body #details.bagMode:not(.shopMode) .dialog{touch-action:none;cursor:grab}
body #details.bagMode:not(.shopMode) .inventoryCell.consumableCell{touch-action:none}

/* ===== Status window: the Academy Archives status art (assets/ui/status-bg.webp, 1591x988) is the window; live values sit on its boxes. The painted "start new save" button is clipped off (removed earlier on request). ===== */
body #details.statusMode .dialog{position:relative!important;zoom:1!important;width:min(70vw,105vh)!important;max-width:none!important;height:auto!important;max-height:none!important;aspect-ratio:1591/988;padding:0!important;overflow:hidden!important;container-type:inline-size;background:url("assets/ui/status-bg.webp") center/100% 100% no-repeat!important;border:0!important;border-radius:0!important;box-shadow:none!important;clip-path:inset(0 0 15.4% 0 round 0 0 1.2cqw 1.2cqw);margin-bottom:-10%!important;touch-action:none;cursor:grab}
body #details.statusMode .dialog:before,body #details.statusMode .dialog:after,body #details.statusMode .eyebrow,body #details.statusMode #detailTitle,body #details.statusMode #jobdesc,body #details.statusMode #reset,body #details.statusMode #newSave{display:none!important}
body #details.statusMode #detailBody{position:static!important;padding:0!important;margin:0!important;overflow:visible!important;max-height:none!important}
body #details.statusMode .statusPanel,body #details.statusMode .statusAttributes,body #details.statusMode .statusDerived{position:static!important;display:block!important;padding:0!important;margin:0!important;background:none!important;border:0!important;box-shadow:none!important}
body #details.statusMode #closeDetails{position:absolute!important;left:94.6%!important;top:2.4%!important;right:auto!important;width:4.2%!important;height:6.4%!important;background:transparent!important;border:0!important;box-shadow:none!important;color:transparent!important;font-size:0!important;z-index:5;cursor:pointer}
/* six attribute rows: value on the grey box, the ">" button on the painted arrow */
body #details.statusMode .statusAttribute{position:absolute!important;left:0!important;width:100%!important;height:5.3%!important;margin:0!important;padding:0!important;background:none!important;border:0!important;box-shadow:none!important;pointer-events:none}
body #details.statusMode .statusAttribute:nth-child(1){top:21.55%!important}
body #details.statusMode .statusAttribute:nth-child(2){top:29.05%!important}
body #details.statusMode .statusAttribute:nth-child(3){top:36.55%!important}
body #details.statusMode .statusAttribute:nth-child(4){top:44.05%!important}
body #details.statusMode .statusAttribute:nth-child(5){top:51.45%!important}
body #details.statusMode .statusAttribute:nth-child(6){top:59.15%!important}
body #details.statusMode .statusAttribute>i,body #details.statusMode .statusAttribute>b,body #details.statusMode .statusAttribute>small{display:none!important}
body #details.statusMode .statusAttribute>span{position:absolute!important;left:15.7%!important;width:5.1%!important;height:100%!important;display:grid!important;place-items:center;background:#2c3b55!important;border-radius:.3cqw;color:#fff!important;font-weight:700;font-size:1.9cqw!important;margin:0!important;padding:0!important}
body #details.statusMode .statusAttribute>button{position:absolute!important;left:44.45%!important;width:3.6%!important;height:100%!important;margin:0!important;padding:0!important;min-width:0!important;background:transparent!important;border:0!important;box-shadow:none!important;color:transparent!important;font-size:0!important;border-radius:.4cqw!important;pointer-events:auto;cursor:pointer}
body #details.statusMode .statusAttribute>button:not(:disabled){box-shadow:0 0 0 .15cqw #ffd978,0 0 1cqw #ffd978aa!important}
body #details.statusMode .statusAttribute>button:not(:disabled):hover{background:#ffd97833!important}
body #details.statusMode .statusAttribute>button:disabled{cursor:default}
/* battle status values (ATK, MATK, DEF, MDEF, HIT, Critical, Flee, Aspd, Guild) over the painted numbers */
body #details.statusMode .statusDerivedTitle{display:none!important}
body #details.statusMode .statusDerivedRow{position:absolute!important;height:5%!important;width:7.4%!important;margin:0!important;padding:0!important;background:#0c1a33!important;border:0!important;box-shadow:none!important;display:flex!important;align-items:center;justify-content:flex-end;pointer-events:none}
body #details.statusMode .statusDerivedRow>i,body #details.statusMode .statusDerivedRow>span{display:none!important}
body #details.statusMode .statusDerivedRow>b{color:#ffd978!important;font-weight:800;font-size:2cqw!important;margin:0!important;padding:0!important}
body #details.statusMode .statusDerivedRow:nth-of-type(odd){left:65%!important}
body #details.statusMode .statusDerivedRow:nth-of-type(even){left:88.2%!important}
body #details.statusMode .statusDerivedRow:nth-of-type(1),body #details.statusMode .statusDerivedRow:nth-of-type(2){top:29.9%!important}
body #details.statusMode .statusDerivedRow:nth-of-type(3),body #details.statusMode .statusDerivedRow:nth-of-type(4){top:36.8%!important}
body #details.statusMode .statusDerivedRow:nth-of-type(5),body #details.statusMode .statusDerivedRow:nth-of-type(6){top:43.7%!important}
body #details.statusMode .statusDerivedRow:nth-of-type(7),body #details.statusMode .statusDerivedRow:nth-of-type(8){top:50.5%!important}
body #details.statusMode .statusDerivedRow:nth-of-type(9){top:57.6%!important}
/* status point value + cost hint */
body #details.statusMode .statusPoints{position:static!important;background:none!important;border:0!important;padding:0!important;margin:0!important}
body #details.statusMode .statusPoints>i{display:none!important}
body #details.statusMode .statusPoints>span{position:absolute!important;left:23.7%!important;top:71.6%!important;width:4.1%!important;height:4.8%!important;font-size:0!important;background:#1c2a44!important;border-radius:.3cqw;display:grid!important;place-items:center;margin:0!important;padding:0!important}
body #details.statusMode .statusPoints>span b{font-size:2cqw!important;color:#ffd978!important;font-weight:800}
body #details.statusMode .statusPoints>small{position:absolute!important;left:76.8%!important;top:71.6%!important;width:18.8%!important;height:4.8%!important;display:flex!important;align-items:center;justify-content:flex-end;background:#0c1a33!important;color:#e6eefc!important;font-size:1.45cqw!important;margin:0!important;padding:0!important}
@media (pointer:coarse),(max-height:520px){body #details.statusMode{display:grid!important;place-items:center!important;padding:0!important}body #details.statusMode .dialog{width:min(92vw,140vh)!important;margin:0 0 -12% 0!important}}
body #details.statusMode .statusDerivedRow:nth-child(n){left:65%!important}
body #details.statusMode .statusDerivedRow:nth-child(odd){left:88.2%!important}
body #details.statusMode .statusDerivedRow:nth-child(2),body #details.statusMode .statusDerivedRow:nth-child(3){top:29.9%!important}
body #details.statusMode .statusDerivedRow:nth-child(4),body #details.statusMode .statusDerivedRow:nth-child(5){top:36.8%!important}
body #details.statusMode .statusDerivedRow:nth-child(6),body #details.statusMode .statusDerivedRow:nth-child(7){top:43.7%!important}
body #details.statusMode .statusDerivedRow:nth-child(8),body #details.statusMode .statusDerivedRow:nth-child(9){top:50.5%!important}
body #details.statusMode .statusDerivedRow:nth-child(10){top:57.6%!important;left:65%!important}
body #details.statusMode .statusAttribute,body #details.statusMode .statusAttribute>span,body #details.statusMode .statusAttribute>button,body #details.statusMode .statusDerivedRow,body #details.statusMode .statusPoints>span,body #details.statusMode .statusPoints>small{min-height:0!important;max-height:none!important;line-height:1!important}
/* PC: bigger attack + AUTO buttons (touch screens keep their own sizes) */
@media (pointer:fine) and (min-height:521px){body .radialActions .attack{width:100px!important;height:100px!important;right:10px!important;bottom:14px!important}body .radialActions .autoToggle{width:66px!important;height:66px!important;right:26px!important;bottom:140px!important}}

/* Boss banner: red/gold frame art with the boss name and HP bar in its dark panel */
.bossBanner{position:fixed;left:50%;top:6px;z-index:40;width:min(46vw,620px);aspect-ratio:2000/667;transform:translateX(-50%) translateY(-120%);opacity:0;pointer-events:none;transition:transform .35s ease,opacity .35s ease;background:url("assets/ui/boss-banner.webp") center/100% 100% no-repeat;container-type:inline-size;filter:drop-shadow(0 4px 10px #000a)}
.bossBanner.on{transform:translateX(-50%) translateY(0);opacity:1}
.bossBanner b{position:absolute;left:20%;right:20%;top:39%;text-align:center;font-size:4.2cqw;font-weight:800;color:#ffe2b0;letter-spacing:.05em;text-shadow:0 0 .8cqw #ff2a1a,0 .2cqw .4cqw #000;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.1}
.bossBanner i{position:absolute;left:24%;right:24%;top:56%;height:3.2%;min-height:5px;background:#2a0a0a;border:1px solid #8a5a2a;border-radius:2px;overflow:hidden}
.bossBanner s{display:block;height:100%;width:100%;background:linear-gradient(180deg,#ff5a4a,#b3140e);box-shadow:0 0 .8cqw #ff3a2a;transition:width .2s}
.bossBanner small{position:absolute;left:0;right:0;top:61.5%;text-align:center;font-size:2.1cqw;color:#f3c9a0;text-shadow:0 1px 2px #000}
@media (pointer:coarse),(max-height:520px){.bossBanner{width:min(52vw,420px);top:2px}}

/* Side menu (☰ on the right, same look as the name-card toggle) + party panel */
#sound{display:none!important}
.sideMenuBtn{position:fixed;right:12px;top:150px;z-index:30;width:34px;height:34px;border-radius:6px;border:1.5px solid #d9b04a;background:linear-gradient(180deg,#1b2a4a,#0c1628);color:#f3d27a;font-size:18px;line-height:30px;box-shadow:0 0 8px #2f8cff88;cursor:pointer;padding:0}
.sideMenu{position:fixed;right:12px;top:190px;z-index:31;min-width:160px;display:flex;flex-direction:column;gap:4px;padding:6px;border:1.5px solid #d9b04a;border-radius:6px;background:linear-gradient(180deg,#14223d,#0b1428);box-shadow:0 6px 18px #000a}
.sideMenu[hidden]{display:none}
.sideMenu button{text-align:left;padding:8px 10px;border:1px solid #2f4468;border-radius:4px;background:#0f1b33;color:#e6eefc;font-size:13px;cursor:pointer}
.sideMenu button:hover{border-color:#e6b94f;color:#ffe9b0}
.partyPanel{position:fixed;right:56px;top:150px;z-index:32;width:300px;max-width:calc(100vw - 70px);border:1.5px solid #d9b04a;border-radius:8px;background:linear-gradient(180deg,#14223d,#0b1428);color:#e6eefc;box-shadow:0 10px 30px #000c;font-size:12px}
.partyPanel[hidden]{display:none}
.partyPanel header{display:flex;align-items:baseline;gap:8px;padding:8px 10px;border-bottom:1px solid #2f4468}
.partyPanel header b{color:#f3d27a;font-size:15px}.partyPanel header small{color:#8fa3c4;letter-spacing:.08em;font-size:9px;flex:1}
.partyPanel .ppClose{background:none;border:0;color:#c9d3e6;font-size:14px;cursor:pointer}
.ppInvite{display:flex;gap:6px;padding:8px 10px}.ppInvite input{flex:1;min-width:0;padding:6px 8px;background:#0b1428;border:1px solid #2f4468;border-radius:4px;color:#eaf2ff}.ppInvite button,.ppLeave{padding:6px 10px;border:1px solid #d9b04a;border-radius:4px;background:linear-gradient(180deg,#2a6fd6,#123f8c);color:#fff;font-weight:700;cursor:pointer}
.ppList{padding:0 10px;display:flex;flex-direction:column;gap:6px;max-height:260px;overflow:auto}
.ppEmpty{color:#8fa3c4;text-align:center;margin:10px 0}
.ppMember{position:relative;display:grid;grid-template-columns:1fr auto;gap:3px 8px;padding:6px 8px;border:1px solid #2f4468;border-radius:5px;background:#0f1b33}
.ppMember.off{opacity:.55}.ppMember.dead .ppName{color:#ff8a7a}
.ppName{font-weight:700;color:#fff}.ppName i{color:#f3d27a;font-style:normal;font-weight:400}.ppMap{color:#8fa3c4;font-size:10px;text-align:right}
.ppBar{grid-column:1/-1;position:relative;height:9px;background:#1c2a44;border-radius:2px;overflow:hidden}.ppBar s{display:block;height:100%}.ppBar.hp s{background:linear-gradient(90deg,#c9303a,#ff6b5e)}.ppBar.sp s{background:linear-gradient(90deg,#2a6fd6,#5cc4ff)}.ppBar em{position:absolute;inset:0;font-style:normal;font-size:8px;line-height:9px;text-align:center;color:#fff;text-shadow:0 1px 1px #000}
.ppMember button[data-kick]{position:absolute;right:4px;top:4px;background:none;border:0;color:#ff8a7a;cursor:pointer;font-size:11px}
.partyPanel footer{display:flex;align-items:center;gap:8px;padding:8px 10px}.partyPanel footer small{flex:1;color:#8fa3c4;font-size:9px}.ppLeave{background:linear-gradient(180deg,#a8322a,#6a1510)!important;font-size:11px}
.ppLeave[hidden]{display:none}
.partyInvite{position:fixed;left:50%;top:120px;transform:translateX(-50%);z-index:60;padding:12px 16px;border:1.5px solid #d9b04a;border-radius:8px;background:linear-gradient(180deg,#14223d,#0b1428);color:#e6eefc;box-shadow:0 10px 30px #000c;text-align:center;font-size:13px}
.partyInvite b{color:#f3d27a}.partyInvite div{display:flex;gap:8px;justify-content:center;margin-top:8px}.partyInvite button{padding:6px 16px;border:1px solid #d9b04a;border-radius:4px;background:linear-gradient(180deg,#2aa56c,#15724a);color:#fff;font-weight:700;cursor:pointer}.partyInvite button[data-a="0"]{background:linear-gradient(180deg,#56607a,#2c3346)}
.playerMenu{position:fixed;z-index:61;transform:translate(8px,-50%);display:flex;flex-direction:column;gap:4px;padding:8px;border:1.5px solid #d9b04a;border-radius:6px;background:linear-gradient(180deg,#14223d,#0b1428);color:#e6eefc;font-size:12px;box-shadow:0 6px 18px #000a}
.playerMenu b{color:#f3d27a}.playerMenu small{color:#8fa3c4}.playerMenu button{padding:6px 10px;border:1px solid #2f4468;border-radius:4px;background:#0f1b33;color:#e6eefc;cursor:pointer;text-align:left}.playerMenu button:hover{border-color:#e6b94f}
.partyMessage b{color:#5cff8a!important}
.chatTabs button[data-chat-tab="party"].active{color:#5cff8a}
@media (pointer:coarse),(max-height:520px){.sideMenuBtn{top:auto;bottom:210px;right:8px;width:30px;height:30px;font-size:16px;line-height:26px}.sideMenu{top:auto;bottom:246px;right:8px}.partyPanel{top:8px;right:48px;width:260px;font-size:11px}}

/* ☰ inside the top menu bar (after แผนที่): same size as the bar icons, dropdown placed under it by JS */
.menubar .sideMenuBtn.inBar{position:static!important;align-self:flex-start;width:34px!important;height:34px!important;margin:4px 0 0 2px;flex:0 0 auto}
.partyPanel{top:96px}
@media (pointer:coarse),(max-height:520px){.menubar .sideMenuBtn.inBar{width:28px!important;height:28px!important;font-size:15px;line-height:24px;margin-top:2px}.sideMenu{top:auto}}
body .menubar button.sideMenuBtn.inBar{width:50px!important;height:50px!important;min-width:50px!important;margin:0 0 0 4px!important;padding:0!important;display:grid!important;place-items:center;font-size:26px!important;line-height:1!important;color:#f3d27a!important;background:linear-gradient(180deg,#1b2a4a,#0c1628)!important;border:2px solid #d9b04a!important;border-radius:8px!important;box-shadow:0 0 8px #2f8cff66,inset 0 0 0 1px #0a1224!important;opacity:1!important}
@media (pointer:coarse),(max-height:520px){body .menubar button.sideMenuBtn.inBar{width:var(--mbIcon,32px)!important;height:var(--mbIcon,32px)!important;min-width:0!important;font-size:18px!important}}

.ppGap{grid-column:1/-1;color:#ffb35c;font-size:10px}

/* Daily quests / titles panel + login gift (reuses the party panel look) */
.progressPanel{width:340px;top:96px}
.pgTabs{display:flex;gap:4px;padding:6px 10px 0}.pgTabs button{flex:1;padding:6px;border:1px solid #2f4468;border-radius:4px 4px 0 0;background:#0f1b33;color:#aebfe0;font-size:11px;cursor:pointer}.pgTabs button.active{border-color:#d9b04a;color:#ffe9b0;background:#1b2a4a}
.pgBody{padding:8px 10px 10px;display:flex;flex-direction:column;gap:6px;max-height:min(60vh,420px);overflow:auto}
.pgRow{display:grid;grid-template-columns:1fr auto;gap:3px 8px;padding:7px 8px;border:1px solid #2f4468;border-radius:5px;background:#0f1b33}
.pgRow b{color:#fff}.pgRow small{grid-column:1/-1;color:#8fa3c4;font-size:10px}.pgRow i{font-style:normal;color:#f3d27a;font-size:10px;align-self:center}
.pgRow .pgBar{grid-column:1/-1;height:11px}.pgBar s{background:linear-gradient(90deg,#b98a2a,#ffd978)}.pgBar em{line-height:11px!important;font-size:9px!important}
.pgRow button{padding:4px 10px;border:1px solid #d9b04a;border-radius:4px;background:linear-gradient(180deg,#2aa56c,#15724a);color:#fff;font-weight:700;font-size:11px;cursor:pointer}.pgRow button:disabled{background:#2c3346;border-color:#3d4a66;color:#8fa3c4;cursor:default}
.pgRow.claimed,.pgRow.locked{opacity:.6}.pgRow.worn{border-color:#d9b04a;box-shadow:0 0 8px #d9b04a55}.pgRow.bonus{border-style:dashed}
.loginReward{width:min(560px,92vw)}.loginReward small{display:block;color:#8fa3c4;margin:4px 0 8px}
.lrDays{display:grid!important;grid-template-columns:repeat(7,1fr);gap:4px!important}.lrDays span{display:flex;flex-direction:column;gap:2px;padding:6px 3px;border:1px solid #2f4468;border-radius:4px;background:#0f1b33;font-size:10px;color:#e6eefc}.lrDays em{font-style:normal;color:#8fa3c4}.lrDays span.got{opacity:.45}.lrDays span.today{border-color:#d9b04a;box-shadow:0 0 8px #d9b04a88;opacity:1}
.loginReward button:disabled{opacity:.5;cursor:default}
@media (pointer:coarse),(max-height:520px){.progressPanel{top:8px;width:300px}.pgBody{max-height:70vh}.lrDays span{font-size:8px}}

/* other players: title line above the name */
.remotePlayer>span .rTitle{display:block;font-style:normal;color:#ffd978;font-size:.9em;line-height:1.2;text-align:center}
.remotePlayer>span:has(.rTitle){transform:translate(-50%,-45%)}
.remotePlayer>span{text-align:center}

/* Ranking panel */
.rankPanel{width:330px}
.rkRow{display:grid;grid-template-columns:34px 1fr auto;align-items:center;gap:8px;padding:6px 8px;border:1px solid #2f4468;border-radius:5px;background:#0f1b33}
.rkRow.me{border-color:#5cc4ff;box-shadow:0 0 6px #5cc4ff66}.rkRow.top1{border-color:#ffd24a}.rkRow.top2{border-color:#cfd8ea}.rkRow.top3{border-color:#d08a4a}
.rkNo{text-align:center;font-weight:800;color:#f3d27a;font-size:14px}.rkName{color:#fff;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rkName em{display:block;font-style:normal;color:#ffd978;font-size:9px;font-weight:400}.rkRow b{color:#ffd978}
.rkMe{padding:6px 10px 10px;border-top:1px solid #2f4468}.rkMe small{display:block;color:#8fa3c4;font-size:10px;margin-bottom:4px}

/* Fixes: an old rule hides every <footer>; our panels need theirs (party leave button, my ranking row).
   Popups/panels sit above the chat window (z 1200). On phones the side panels open centred so they don't cover the attack buttons. */
body .partyPanel footer{display:flex!important;position:static!important}
body .rankPanel .rkMe{display:block!important;position:static!important}
.partyPanel,.sideMenu{z-index:1300!important}
.partyInvite,.playerMenu{z-index:1400!important}
@media (pointer:coarse),(max-height:520px){
 body .partyPanel{left:50%!important;right:auto!important;top:6px!important;transform:translateX(-50%);max-height:calc(100vh - 12px);display:flex;flex-direction:column}
 body .partyPanel[hidden]{display:none!important}
 body .partyPanel .pgBody,body .partyPanel .ppList{max-height:none!important;flex:1 1 auto;min-height:0;overflow:auto}
 .partyInvite{top:8px!important}
 .loginReward .lrDays span{padding:4px 2px}
}
/* smaller name/title labels above other players (phones even smaller) */
body .remotePlayer>span{font-size:10px!important;padding:1px 5px!important;border-radius:6px!important}
body .remotePlayer>span .rTitle{font-size:.85em}
@media (pointer:coarse),(max-height:520px){body .remotePlayer>span{font-size:8px!important;padding:0 4px!important;top:-2px!important}}

/* Guild panel + labels */
.guildPanel{width:350px}
.guildPanel .gdActs{grid-column:1/-1;display:flex;gap:4px;flex-wrap:wrap}.gdActs button,.gdItem button{padding:2px 7px;border:1px solid #2f4468;border-radius:4px;background:#14223d;color:#cfd8ea;font-size:10px;cursor:pointer}.gdActs button:hover,.gdItem button:hover{border-color:#e6b94f}
.gdNote{display:block;color:#8fa3c4;font-size:10px;padding:0 2px 4px}
.gdDeposit select{flex:1;min-width:0;padding:5px;background:#0b1428;border:1px solid #2f4468;border-radius:4px;color:#eaf2ff}.gdDeposit input{width:52px;flex:none}
.gdItem{align-items:center}.gdItem .ppName img{width:20px;height:20px;vertical-align:middle}
.gdLog{font-size:11px;color:#cfd8ea;padding:3px 2px;border-bottom:1px solid #1c2a44}.gdLog time{color:#8fa3c4;font-size:9px}
.gdFoot{display:flex!important;justify-content:flex-end;padding:6px 10px 10px}
.guildMessage b{color:#7fb6ff!important}.chatTabs button[data-chat-tab="guild"].active{color:#7fb6ff}
.remotePlayer>span .rGuild{font-style:normal;color:#7fb6ff}
.guildPanel .gdActs button[data-kick]{position:static!important;color:#ff8a7a!important;font-size:10px!important;border:1px solid #6a2a2a!important;background:#2a1414!important}

/* Trade window */
.tradePanel{width:420px;left:50%!important;right:auto!important;top:90px!important;transform:translateX(-50%)}
.trCols{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:8px 10px}
.trSide{display:flex;flex-direction:column;gap:4px;padding:6px;border:1px solid #2f4468;border-radius:5px;background:#0f1b33;min-height:120px}.trSide.locked{border-color:#d9b04a;box-shadow:0 0 8px #d9b04a55}.trSide>b{color:#f3d27a;font-size:12px}
.trItem{display:flex;align-items:center;gap:5px;font-size:11px;color:#e6eefc}.trItem img{width:20px;height:20px}.trItem span{flex:1}.trItem button{background:none;border:0;color:#ff8a7a;cursor:pointer}
.trCoins{margin-top:auto;color:#ffd978;font-size:11px}
.trAdd{padding:0 10px}.trAdd select{flex:1;min-width:0;padding:5px;background:#0b1428;border:1px solid #2f4468;border-radius:4px;color:#eaf2ff}.trAdd .trN{width:48px;flex:none}.trAdd .trC{flex:1}
.trFoot{display:flex!important;gap:6px;justify-content:flex-end;padding:8px 10px 10px}.trFoot button{padding:6px 12px;border:1px solid #d9b04a;border-radius:4px;background:linear-gradient(180deg,#2a6fd6,#123f8c);color:#fff;font-weight:700;cursor:pointer}.trFoot .trOk{background:linear-gradient(180deg,#2aa56c,#15724a)}.trFoot button:disabled{opacity:.45;cursor:default}
@media (pointer:coarse),(max-height:520px){body .tradePanel{top:6px!important;width:min(420px,96vw)}.trSide{min-height:70px}}

/* guild line under the name: (rank) guild */
.remotePlayer>span .rGuildLine{display:block;font-style:normal;color:#7fb6ff;font-size:.85em;line-height:1.2;text-align:center}
.remotePlayer>span:has(.rGuildLine){transform:translate(-50%,-45%)}

/* ===== Guild window on the art (1672x941). Positions are % of the art; the painted sample data is covered by opaque boxes. ===== */
.guildArt{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);z-index:1300;width:min(86vw,145vh);aspect-ratio:1672/941;background:url("assets/ui/guild-bg.webp") center/100% 100% no-repeat;container-type:inline-size;color:#e6eefc;filter:drop-shadow(0 12px 30px #000c)}
.guildArt[hidden]{display:none}
.guildArt>*,.guildArt .gaRight>*{position:absolute;box-sizing:border-box}
.guildArt .gaRight{position:static}
.gaClose{left:94.4%;top:2.2%;width:4.4%;height:7.9%;background:none;border:0;cursor:pointer}
.gaName{left:13.8%;top:4.6%;width:42%;height:8%;background:linear-gradient(90deg,#0b1428 85%,transparent);font:800 3.6cqw Georgia,serif;color:#f3d27a;letter-spacing:.04em;display:flex;align-items:center;padding-left:.3cqw;text-shadow:0 .2cqw .4cqw #000}
.gaSub{left:13.8%;top:12.2%;width:25%;height:4.4%;background:linear-gradient(90deg,#0b1428 88%,transparent);font-size:1.25cqw;color:#dfe7f5;display:flex;align-items:center;padding-left:.3cqw}
.gaSub:before{content:"👑 ";margin-right:.3cqw}
.gaTab{top:18.1%;height:7.2%;background:none;border:0;cursor:pointer;border-radius:.4cqw}
.gaTab[data-gt=members]{left:13.9%;width:23.2%}.gaTab[data-gt=storage]{left:38.2%;width:23.7%}
.gaTab[data-gt=log]{left:62.8%;width:23.4%}
.guildArt:not([data-tab=members]) .gaTab[data-gt=members]{background:#0e1a2fcc;box-shadow:inset 0 0 0 1px #2c3f63}
.guildArt:not([data-tab=members]) .gaTab[data-gt=members]:before{content:"👥  สมาชิก";position:absolute;inset:0;display:grid;place-items:center;font-size:1.4cqw;color:#cfd8ea}
.guildArt[data-tab=storage] .gaTab[data-gt=storage],.guildArt[data-tab=log] .gaTab[data-gt=log]{box-shadow:inset 0 0 0 .15cqw #e6b94f,0 0 1.2cqw #e6b94f88;background:#e6b94f22}
.gaInfo{left:14.3%;top:36.6%;width:11.2%;height:30%}
.gaInfo span{position:absolute;left:0;width:100%;height:3.9cqw;display:flex;align-items:center;background:#0b1428;font-size:1.3cqw;color:#f3d27a;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gaInfo span:nth-child(1){top:0}.gaInfo span:nth-child(2){top:16.7%;color:#fff}.gaInfo span:nth-child(3){top:33.4%;color:#fff}.gaInfo span:nth-child(4){top:50.2%;color:#fff}.gaInfo span:nth-child(5){top:67.9%;color:#fff}.gaInfo span:nth-child(6){top:86.8%;color:#fff}
.gaInfo span{transform:translateY(-50%)}.gaInfo span:nth-child(1){top:.6cqw}
.gaNotice{left:3.6%;top:77%;width:20.6%;height:14.6%;background:#0b1428;border-radius:.4cqw;padding:.8cqw;font-size:1.05cqw;color:#dfe7f5;overflow:auto}.gaNotice i{color:#8fa3c4;display:grid;place-items:center;height:100%;font-style:normal}
.gaEdit{left:22.4%;top:71.9%;width:2.2%;height:3.9%;background:none;border:0;cursor:pointer}.gaEdit[hidden]{display:none}
.gaSearch{left:55.3%;top:30.3%;width:19.3%;height:5.3%}.gaSearch input{position:absolute;inset:0;width:100%;height:100%;padding:0 0 0 13%;background:#0b1428;border:1px solid #2f4468;border-radius:.4cqw;color:#eaf2ff;font-size:1.15cqw}
.gaSearch:before{content:"🔍";position:absolute;left:4%;top:50%;transform:translateY(-50%);font-size:1.1cqw;z-index:1}
.gaFilter{left:76%;top:30.3%;width:11.2%;height:5.3%;background:#0e1830;border:1px solid #3a5582;border-radius:.4cqw;color:#eaf2ff;font-size:1.15cqw;padding:0 .8cqw}
.gaCount{left:88.6%;top:30.6%;width:9.4%;height:4.8%;background:#0b1428;display:grid;place-items:center;font-size:1.2cqw;color:#cfd8ea}
.gaRows{left:28.1%;top:43.4%;width:69.1%;height:42.6%;background:#0a1224;border-radius:.3cqw;overflow:hidden}
.gaRow{position:relative;height:18.6%;margin-bottom:1.4%;border:1px solid #2f4468;border-radius:.4cqw;background:linear-gradient(90deg,#132440,#0f1b33);font-size:1.15cqw}.gaRow.off{opacity:.7}
.gaRow>*{position:absolute;top:50%;transform:translate(-50%,-50%);text-align:center;white-space:nowrap}
.gaRow .c0{left:2.3%;color:#cfd8ea}.gaRow .c1{left:8.6%;width:5.4cqw;height:5.4cqw;border-radius:50%;border:.15cqw solid #3d5070;background:#1a2a44 url("assets/novice/idle8/south.png?v=1") 0 10%/800% auto no-repeat}
.gaRow .c2{left:13.2%;transform:translateY(-50%);text-align:left}.gaRow .c2 b{display:block;color:#f3d27a;font-size:1.3cqw}.gaRow .c2 small{color:#aebfe0;font-size:1.05cqw}
.gaRow .c3{left:33.7%;padding:.4cqw .8cqw;border-radius:.3cqw;font-size:1.05cqw;border:1px solid #2f4468;background:#0f1b33}.gaRow .rk-leader{border-color:#e6b94f;color:#ffd978;background:#3a2a12}.gaRow .rk-officer{border-color:#5cc4ff;color:#9fdcff}
.gaRow .c4{left:46.7%}.gaRow .c5{left:59.3%}.gaRow .c6{left:72%}.gaRow .c7{left:86%;font-size:1cqw;line-height:1.35;color:#cfd8ea}
.gaRow .dot{display:inline-block;width:.8cqw;height:.8cqw;border-radius:50%;background:#56607a;margin-right:.3cqw}.gaRow .dot.on{background:#39e06a;box-shadow:0 0 .6cqw #39e06a}
.gaRow .c8{left:96.2%;width:3.4cqw;height:3.4cqw;border:1px solid #3d5070;border-radius:.4cqw;background:#0f1b33;color:#e6eefc;cursor:pointer;font-size:1.1cqw}
.gaFoot{left:28.1%;top:88.3%;width:25%;height:4.4%;background:#0b1428;display:flex;align-items:center;font-size:1.15cqw;color:#cfd8ea;padding-left:.5cqw}
.gaPrev,.gaNext{top:88%;width:2.7%;height:5%;background:none;border:0;cursor:pointer}.gaPrev{left:85.4%}.gaNext{left:93.5%}.gaPrev:disabled,.gaNext:disabled{cursor:default;opacity:.3;background:#0b142888}
.gaPage{left:89.5%;top:88.2%;width:2.6%;height:4.8%;display:grid;place-items:center;background:#0b1428;color:#ffd978;font-size:1.3cqw;font-weight:700}
.gaInvite{left:55.5%;top:87.8%;width:21%;height:5.2%;display:flex;gap:.4cqw}.gaInvite input{flex:1;min-width:0;background:#0b1428;border:1px solid #2f4468;border-radius:.4cqw;color:#eaf2ff;font-size:1.05cqw;padding:0 .6cqw}.gaInvite button,.gaLeave{border:1px solid #d9b04a;border-radius:.4cqw;background:linear-gradient(180deg,#2a6fd6,#123f8c);color:#fff;font-weight:700;font-size:1.05cqw;cursor:pointer;padding:0 1cqw}
.gaLeave{left:77.5%;top:88%;width:7.4%;height:5%;background:linear-gradient(180deg,#a8322a,#6a1510)!important;font-size:.95cqw!important;padding:0!important}
.guildArt:not([data-tab=members]) .gaLeave{left:89%;top:92%}
.gaPanel{left:28%;top:28.5%;width:69.6%;height:61.5%;background:#0a1224;border:1px solid #2f4468;border-radius:.4cqw;padding:1.2cqw;overflow:auto;font-size:1.15cqw}
.gaPanel h3{margin:0 0 .8cqw;color:#f3d27a;font-size:1.5cqw}.gaPanel h3 small{color:#8fa3c4;font-size:.9cqw;font-weight:400;margin-left:.6cqw}
.gaDeposit{display:flex;gap:.5cqw;margin-bottom:1cqw}.gaDeposit select{flex:1;background:#0b1428;border:1px solid #2f4468;border-radius:.4cqw;color:#eaf2ff;padding:.4cqw;font-size:1.1cqw}.gaDeposit input{width:5cqw;background:#0b1428;border:1px solid #2f4468;color:#eaf2ff;border-radius:.4cqw;font-size:1.1cqw}.gaDeposit button,.gaSlot button{border:1px solid #d9b04a;border-radius:.4cqw;background:linear-gradient(180deg,#2aa56c,#15724a);color:#fff;font-weight:700;cursor:pointer;font-size:1cqw;padding:.3cqw .9cqw}
.gaGrid{display:grid;grid-template-columns:repeat(4,1fr);gap:.6cqw}.gaSlot{display:flex;align-items:center;gap:.5cqw;padding:.5cqw;border:1px solid #2f4468;border-radius:.4cqw;background:#0f1b33;font-size:1cqw}.gaSlot img{width:2.6cqw;height:2.6cqw}.gaSlot span{flex:1}
.gaLog div{padding:.4cqw 0;border-bottom:1px solid #1c2a44;font-size:1.05cqw}.gaLog time{color:#8fa3c4;font-size:.9cqw;margin-right:.5cqw}
@media (pointer:coarse),(max-height:520px){.guildArt{width:min(96vw,168vh)}}
.gaInfo{top:0!important;height:100%!important}
.gaInfo span:nth-child(1){top:38.9%!important}.gaInfo span:nth-child(2){top:43.9%!important}.gaInfo span:nth-child(3){top:48.9%!important}.gaInfo span:nth-child(4){top:54%!important}.gaInfo span:nth-child(5){top:59.3%!important}.gaInfo span:nth-child(6){top:65%!important}
.gaInfo span{height:3.4cqw!important}
.gaRow span.c8{border:0;background:none}
.gaPanel{height:65.2%!important}
.guildArt:not([data-tab=members]) .gaTab[data-gt=members]{background:#0e1a2f!important}
.guildArt:not([data-tab=members]) .gaLeave{left:88.5%!important;top:86.8%!important;z-index:2}

/* phones: bigger hit area for the art windows' X (the painted X stays where it is) */
@media (pointer:coarse),(max-height:520px){body #details.bagMode:not(.shopMode) #closeDetails,body #details.statusMode #closeDetails{min-width:44px!important;min-height:44px!important;transform:translate(-25%,-20%);z-index:20!important}.gaClose{min-width:44px;min-height:44px;z-index:5}}
/* phones with a notch/Dynamic Island: keep the art windows (and their X) inside the safe area */
@media (pointer:coarse),(max-height:520px){body #details.bagMode:not(.shopMode) .dialog{width:min(calc(100vw - 2*max(env(safe-area-inset-left),env(safe-area-inset-right),8px) - 8px),120vh)!important}body #details.statusMode .dialog{width:min(calc(100vw - 2*max(env(safe-area-inset-left),env(safe-area-inset-right),8px) - 8px),140vh)!important}.guildArt{width:min(calc(100vw - 2*max(env(safe-area-inset-left),env(safe-area-inset-right),8px) - 8px),168vh)!important}}

/* Phones: pinned close button for the art windows; no drag cursor/touch lock on the windows */
.artClose{display:none}
@media (pointer:coarse),(max-height:520px){
 .artClose:not([hidden]){display:grid;place-items:center;position:fixed;z-index:6000;top:max(8px,env(safe-area-inset-top));right:calc(max(8px,env(safe-area-inset-right)) + 4px);width:46px;height:46px;border-radius:50%;border:2px solid #e6b94f;background:radial-gradient(circle at 40% 35%,#2a3f66,#0b1428);color:#ffe9b0;font-size:22px;font-weight:800;box-shadow:0 0 12px #000c,0 0 8px #e6b94f66;padding:0;touch-action:manipulation}
 body #details.bagMode:not(.shopMode) .dialog,body #details.statusMode .dialog{touch-action:auto!important;cursor:default!important}
}

.sideMenu .smVer{display:block;text-align:center;color:#8fa3c4;font-size:10px;padding-top:2px}
/* iPhone: Safari snapped taps on a window's X to the menu icons right above it (tap-debug log). While a window is open on a phone the menu bar ignores taps. */
@media (pointer:coarse),(max-height:520px){body:has(#details:not(.hidden)) .menubar,body:has(#details:not(.hidden)) .menubar *{pointer-events:none!important}body:has(#details:not(.hidden)) .menubar{opacity:.55}}

/* Bag/status X: a real visible button like the equipment window's X (the transparent one over the drawn X was unreliable on iPhone) */
body #details.bagMode:not(.shopMode) #closeDetails,body #details.statusMode #closeDetails{color:#fff!important;font-size:20px!important;line-height:1!important;background:#0c1a3a!important;border:1px solid #d9b04a!important;border-radius:6px!important;box-shadow:0 0 6px #000a!important;display:grid!important;place-items:center!important;padding:0!important;touch-action:manipulation}

/* Bag & Status windows (game.js: rwWin / openBagWin / openStatusWin). Built from HTML/CSS, no background art.
   Every size is in cqw (1% of the window width), so the whole window scales as one piece on PC and phones. */
.rwOverlay{position:fixed;inset:0;z-index:1250;display:grid;place-items:center;background:#040a16a8;padding:max(6px,env(safe-area-inset-top)) max(6px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left));box-sizing:border-box}
.rwOverlay[hidden]{display:none!important}
.dragGhost{z-index:1400!important}
.rwWin{--gold:#d9b04a;--gold2:#ffd978;--line:#2a3f64;--ink:#e3eaf7;--mute:#8fa3c6;--panel:#0a1429;container-type:inline-size;position:relative;box-sizing:border-box;color:var(--ink);text-align:left;
 background:radial-gradient(120% 70% at 50% -10%,#1b3159 0%,#0d1932 50%,#070f1f 100%);border:1px solid var(--gold);border-radius:1cqw;
 box-shadow:0 0 0 .4cqw #0a1222,0 0 0 calc(.4cqw + 1px) #7d6329,0 2cqw 6cqw #000d,inset 0 0 4cqw #0009;padding:1.2cqw 1.8cqw 1.8cqw}
.rwWin *{box-sizing:border-box}
.rwWin:before{content:"";position:absolute;inset:.55cqw;border:1px solid #d9b04a38;border-radius:.6cqw;pointer-events:none}
.rwC{position:absolute;width:1.3cqw;height:1.3cqw;background:var(--gold);transform:rotate(45deg);box-shadow:0 0 .8cqw #e6b94f99;pointer-events:none}
.rwC.tl{left:-.65cqw;top:-.65cqw}.rwC.tr{right:-.65cqw;top:-.65cqw}.rwC.bl{left:-.65cqw;bottom:-.65cqw}.rwC.br{right:-.65cqw;bottom:-.65cqw}
.rwBag{width:min(900px,96vw,calc((100dvh - 16px)*1.6))}
.rwStatus{width:min(840px,96vw,calc((100dvh - 16px)*1.66))}

/* header */
.rwHead{position:relative;display:flex;align-items:center;gap:1.1cqw;height:5.4cqw;margin-bottom:1.2cqw;padding-bottom:.6cqw;border-bottom:1px solid var(--line);user-select:none}
@media (pointer:fine){.rwHead{cursor:grab}.rwHead:active{cursor:grabbing}}
.rwHead:after{content:"";position:absolute;left:0;bottom:-1px;width:24cqw;height:1px;background:linear-gradient(90deg,var(--gold),transparent)}
.rwEmblem{flex:none;display:grid;place-items:center;width:4.4cqw;height:4.4cqw;border-radius:50%;border:1px solid var(--gold);background:radial-gradient(circle,#223a66,#0a1428 70%);box-shadow:0 0 1.2cqw #e6b94f44}
.rwEmblem svg{width:62%;height:62%;fill:var(--gold2)}
.rwTitle{display:flex;flex-direction:column;line-height:1.05}
.rwTitle b{font-size:max(15px,2.6cqw);font-weight:800;background:linear-gradient(#fff4cf,#e2b451);-webkit-background-clip:text;background-clip:text;color:transparent;text-shadow:none}
.rwTitle small{font-size:max(7px,.95cqw);letter-spacing:.35em;color:var(--mute)}
.rwEyebrow{position:absolute;left:50%;top:40%;transform:translate(-50%,-50%);display:flex;align-items:center;gap:1cqw;font-size:max(7px,1cqw);letter-spacing:.4em;color:#c8b07a;white-space:nowrap;pointer-events:none}
.rwEyebrow:before,.rwEyebrow:after{content:"";width:6cqw;height:1px;background:linear-gradient(90deg,transparent,#c8b07a)}.rwEyebrow:after{transform:scaleX(-1)}
.rwWho{margin-left:auto;font-size:max(10px,1.35cqw);color:var(--mute);white-space:nowrap}.rwWho b{color:var(--ink);margin-right:.4em}
.rwBag .rwWho{display:none}
.rwClose{flex:none;margin-left:auto;display:grid;place-items:center;width:4cqw;height:4cqw;min-width:34px;min-height:34px;padding:0;border:1px solid var(--gold);border-radius:.6cqw;background:linear-gradient(#18305a,#0a1530);color:#fff;font-size:max(14px,1.9cqw);font-weight:700;line-height:1;cursor:pointer;touch-action:manipulation;box-shadow:0 0 .8cqw #000a}
.rwStatus .rwClose{margin-left:1.2cqw}
.rwClose:hover{background:linear-gradient(#244379,#10204a);box-shadow:0 0 1cqw #e6b94f77}

/* shared bits */
.rwWin button{font-family:inherit}
.rwWin h4{display:flex;align-items:baseline;gap:.8cqw;margin:0 0 .8cqw;font-size:max(11px,1.55cqw);color:var(--gold2);font-weight:700}
.rwWin h4 small{font-size:max(7px,.9cqw);letter-spacing:.3em;color:var(--mute);font-weight:400}
.rwChip{display:flex;align-items:center;justify-content:center;gap:.5cqw;padding:0 1cqw;height:100%;border:1px solid var(--line);border-radius:.5cqw;background:var(--panel);font-size:max(10px,1.3cqw);color:var(--ink);white-space:nowrap}
.rwChip b{color:var(--gold2)}.rwChip .coinIcon{width:1.6cqw;height:1.6cqw;min-width:12px;min-height:12px}
.rwAct{flex:none;align-self:center;min-width:8cqw;height:4cqw;min-height:30px;padding:0 1.4cqw;border:1px solid var(--gold);border-radius:.5cqw;background:linear-gradient(#2d6fd3,#123d88);color:#fff;font-weight:700;font-size:max(11px,1.4cqw);cursor:pointer;touch-action:manipulation}
.rwAct:disabled{opacity:.45;cursor:default;filter:grayscale(.5)}
.rwAct:not(:disabled):hover{box-shadow:0 0 1cqw #e6b94f88}

/* ---------- bag ---------- */
.rwBagBody{display:grid;grid-template-columns:17cqw 1fr;gap:1.4cqw}
.rwCats{position:relative;display:flex;flex-direction:column;gap:.7cqw;padding:.8cqw;border:1px solid var(--line);border-radius:.6cqw;background:linear-gradient(#0c1730,#08112a);overflow:hidden}
.rwCats button{position:relative;z-index:1;display:flex;align-items:center;gap:1cqw;height:5cqw;min-height:26px;padding:0 1cqw;border:1px solid transparent;border-radius:.5cqw;background:#0f1c38aa;color:#c9d3e6;font-size:max(10px,1.45cqw);cursor:pointer;text-align:left}
.rwCats button span{display:grid;place-items:center;width:2.4cqw;height:2.4cqw;min-width:13px;min-height:13px}
.rwCats button svg{width:100%;height:100%;fill:currentColor}
.rwCats button em{font-style:normal;flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rwCats button:hover{border-color:#d9b04a66}
.rwCats button.on{border-color:var(--gold);background:linear-gradient(90deg,#e6b94f45,#e6b94f10);color:#fff;box-shadow:0 0 1.2cqw #e6b94f44,inset 0 0 1.5cqw #ffcf6a22}
.rwCats button.on span{color:var(--gold2)}
.rwCats button.on:after{content:"›";font-size:max(12px,1.8cqw);color:var(--gold2)}
.rwCats button[data-quests]{margin-top:auto}
.rwMark{position:absolute;left:50%;bottom:8cqw;width:10cqw;height:10cqw;transform:translateX(-50%);opacity:.12;pointer-events:none}.rwMark svg{width:100%;height:100%;fill:#9fb6e0}
.rwMain{display:flex;flex-direction:column;gap:1cqw;min-width:0}
.rwTools{display:flex;gap:.8cqw;height:3.6cqw;min-height:24px}
.rwSearch{position:relative;flex:1;min-width:0}
.rwSearch svg{position:absolute;left:1cqw;top:50%;width:1.7cqw;height:1.7cqw;min-width:11px;min-height:11px;transform:translateY(-50%);fill:var(--mute);pointer-events:none}
.rwSearch input,.rwRarity{width:100%;height:100%;margin:0;padding:0 1cqw 0 3.4cqw;border:1px solid var(--line);border-radius:.5cqw;background:var(--panel);color:var(--ink);font:inherit;font-size:max(12px,1.3cqw);outline:none;-webkit-appearance:none;appearance:none}
.rwSearch input:focus,.rwRarity:focus{border-color:#d9b04a99}
.rwRarity{width:13cqw;flex:none;padding:0 2.6cqw 0 1cqw;cursor:pointer;background:var(--panel) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 6"><path d="M0 0h10L5 6z" fill="%23d9b04a"/></svg>') no-repeat right 1cqw center/1cqw auto}
.rwSlotF{cursor:pointer;border-color:var(--gold);color:var(--gold2)}.rwSlotF[hidden]{display:none}
.rwGrid{--cell:8.2cqw;display:grid;grid-template-columns:repeat(9,var(--cell));grid-auto-rows:var(--cell);gap:.7cqw;height:calc(4*var(--cell) + 2.3cqw);padding:.1cqw .4cqw .1cqw .1cqw;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#d9b04a66 transparent;align-content:start}
.rwCell{position:relative;padding:0;border:1px solid #33496f;border-radius:.4cqw;background:linear-gradient(155deg,#172540,#0c1528);box-shadow:inset 0 0 0 1px #070d1a,inset .5cqw .5cqw 0 -.4cqw #c9a14a55;cursor:pointer;touch-action:manipulation}
.rwCell img{position:absolute;inset:13%;width:74%;height:74%;object-fit:contain;image-rendering:pixelated;pointer-events:none}
.rwCell b{position:absolute;right:6%;bottom:5%;min-width:1.7cqw;padding:0 .3cqw;border-radius:.3cqw;background:#050b18d9;border:1px solid #3d5a8a;font-size:max(8px,1cqw);line-height:1.35;color:#fff;text-align:center;pointer-events:none}
.rwCell.cons{touch-action:none}
.rwCell.empty,.rwCell.locked{cursor:default}
.rwCell.empty:before,.rwCell.locked:before{content:"";position:absolute;left:50%;top:50%;width:30%;height:30%;transform:translate(-50%,-50%) rotate(45deg);border:1px solid #2f4468}
.rwCell.locked{opacity:.4}.rwCell.locked:before{border-style:dashed}
.rwCell.q-uncommon{border-color:#3f9d5a}.rwCell.q-rare{border-color:#4d86e8}
.rwCell:not(.empty):not(.locked):hover{border-color:#e6b94faa}
.rwCell.sel{border-color:var(--gold2);box-shadow:0 0 0 1px var(--gold2),0 0 1.2cqw #ffd97877,inset 0 0 1.4cqw #ffd97844}
.rwDetail{display:flex;align-items:center;gap:1.2cqw;height:10.5cqw;min-height:54px;padding:.8cqw 1.2cqw;border:1px solid var(--line);border-radius:.6cqw;background:linear-gradient(90deg,#0c1731,#091226);overflow:hidden}
.rwHint{display:flex;align-items:center;justify-content:center;gap:1.2cqw;width:100%;color:var(--mute);font-size:max(10px,1.3cqw)}
.rwHint i{display:grid;place-items:center;width:2.6cqw;height:2.6cqw;min-width:18px;min-height:18px;transform:rotate(45deg);border:1px solid #6d86b5;background:#0f1a30;font-style:normal}
.rwHint i:before{content:"!";transform:rotate(-45deg);font-weight:800;color:#dfe8ff;font-size:max(10px,1.3cqw)}
.rwHint i{font-size:0}
.rwDIcon{flex:none;position:relative;width:8cqw;height:8cqw;border:1px solid #33496f;border-radius:.5cqw;background:linear-gradient(155deg,#1a2a48,#0c1528)}
.rwDIcon.q-uncommon{border-color:#3f9d5a}.rwDIcon.q-rare{border-color:#4d86e8}
.rwDIcon img{position:absolute;inset:12%;width:76%;height:76%;object-fit:contain;image-rendering:pixelated}
.rwDInfo{flex:1;min-width:0;display:flex;flex-direction:column;gap:.25cqw;line-height:1.25}
.rwDInfo strong{font-size:max(12px,1.65cqw);color:#fff}
.rwDInfo em{font-style:normal;font-size:max(10px,1.2cqw);color:var(--gold2)}
.rwDInfo small{font-size:max(9px,1.1cqw);color:var(--mute);overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.rwDetail.gear .rwDInfo{flex:0 1 24cqw}
.rwCmp{flex:1;display:grid;grid-template-columns:repeat(5,1fr);gap:.3cqw .6cqw;padding-left:1cqw;border-left:1px solid var(--line);min-width:0}
.rwCmp div{display:flex;align-items:baseline;gap:.4cqw;font-size:max(8px,1.05cqw);white-space:nowrap}
.rwCmp small{color:var(--mute);min-width:3.2cqw}.rwCmp b{color:#fff}.rwCmp b.up,.rwCmp i.up{color:#66e08a}.rwCmp b.down,.rwCmp i.down{color:#ff7d7d}.rwCmp i{font-style:normal;font-size:.9em}
.rwPick{flex:none;display:grid;grid-template-columns:repeat(9,auto);align-items:center;gap:.4cqw;font-size:max(9px,1.05cqw);color:var(--mute)}
.rwPick span{grid-column:1/-1}
.rwPick button{width:2.6cqw;height:2.6cqw;min-width:20px;min-height:20px;padding:0;border:1px solid var(--line);border-radius:.4cqw;background:#0f1c38;color:var(--ink);font-size:max(9px,1.05cqw);cursor:pointer}
.rwPick button.on{border-color:var(--gold2);background:#e6b94f33;color:var(--gold2)}
@media (pointer:coarse){.rwPick .rwPc{display:none}}

/* ---------- status ---------- */
.rwStatBody{display:grid;grid-template-columns:1.3fr 1fr;gap:1.2cqw 1.4cqw}
.rwAttrs,.rwBattle{padding:1cqw 1.1cqw 1.1cqw;border:1px solid var(--line);border-radius:.6cqw;background:linear-gradient(#0c1731,#08112a)}
.rwAttrs{display:flex;flex-direction:column;gap:.65cqw}
.rwAttrs h4{margin-bottom:.2cqw}
.rwAttr{display:grid;grid-template-columns:4cqw 1fr 5.4cqw 3.8cqw;align-items:center;gap:1cqw;height:5.1cqw;min-height:28px;padding:0 .7cqw;border:1px solid #22375b;border-radius:.5cqw;background:linear-gradient(90deg,#14254a,#0d182f)}
.rwAIcon{display:grid;place-items:center;width:3.6cqw;height:3.6cqw;min-width:20px;min-height:20px;border-radius:50%;font-style:normal;font-size:max(11px,1.8cqw);color:#fff;background:var(--c);box-shadow:0 0 1cqw var(--c),inset 0 -.4cqw .6cqw #0006;border:1px solid #fff3}
.st-str{--c:#d9573f}.st-agi{--c:#3fae66}.st-vit{--c:#d88b2c}.st-int{--c:#8a63e6}.st-dex{--c:#2fa9cf}.st-luk{--c:#a9b83a}
.rwAName{display:flex;flex-direction:column;min-width:0;line-height:1.2}
.rwAName b{font-size:max(12px,1.75cqw);color:var(--gold2);letter-spacing:.05em}
.rwAName small{font-size:max(9px,1.1cqw);color:var(--mute);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rwAVal{display:grid;place-items:center;height:3.6cqw;min-height:22px;border-radius:.4cqw;background:#22324f;border:1px solid #33496f;font-size:max(12px,1.8cqw);font-weight:800;color:#fff}
.rwAttr button{width:3.6cqw;height:3.6cqw;min-width:26px;min-height:26px;padding:0;border:1px solid var(--gold);border-radius:.5cqw;background:linear-gradient(#2d6fd3,#123d88);color:#fff;font-size:max(14px,2cqw);font-weight:800;line-height:1;cursor:pointer;touch-action:manipulation;box-shadow:0 0 .9cqw #ffd97899}
.rwAttr button:disabled{border-color:#3a4c6d;background:#141f36;color:#51607e;box-shadow:none;cursor:default}
.rwAttr button:not(:disabled):hover{background:linear-gradient(#3b82ea,#1a4ea6)}
.rwBattle{display:flex;flex-direction:column}
.rwBGrid{flex:1;display:grid;grid-template-columns:1fr 1fr;grid-auto-rows:1fr;gap:.65cqw}
.rwStatBox{display:flex;align-items:center;gap:.8cqw;min-height:26px;padding:0 1cqw;border:1px solid #22375b;border-radius:.5cqw;background:#0e1a33}
.rwStatBox i{font-style:normal;color:var(--gold);font-size:max(11px,1.6cqw);width:2cqw;text-align:center}
.rwStatBox span{font-size:max(9px,1.2cqw);color:var(--mute);white-space:nowrap}
.rwStatBox b{margin-left:auto;font-size:max(11px,1.65cqw);color:var(--gold2);font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:60%}
.rwStatFoot{grid-column:1/-1;display:flex;align-items:center;gap:1.1cqw;height:4.8cqw;min-height:30px;padding:0 1.4cqw;border:1px solid var(--line);border-radius:.6cqw;background:linear-gradient(90deg,#14254a,#0a1429)}
.rwGem{width:1.8cqw;height:1.8cqw;min-width:10px;min-height:10px;transform:rotate(45deg);background:linear-gradient(135deg,#fff1b8,#d9a93c);box-shadow:0 0 1cqw #ffd978aa}
.rwStatFoot span{font-size:max(11px,1.5cqw);font-weight:700}
.rwPts{min-width:4.4cqw;padding:.2cqw 1cqw;border-radius:.4cqw;background:#22324f;border:1px solid var(--gold);text-align:center;font-size:max(12px,1.7cqw);color:var(--gold2)}
.rwStatFoot small{margin-left:auto;font-size:max(9px,1.15cqw);color:var(--mute)}
.rwNote{grid-column:1/-1;margin:0;font-size:max(8px,1.05cqw);color:#7086ad;text-align:center}

/* phones: the menu icons stay out of the way while one of these windows is open */
@media (pointer:coarse),(max-height:520px){body:has(.rwOverlay:not([hidden])) .menubar,body:has(.rwOverlay:not([hidden])) .menubar *{pointer-events:none!important}}

/* Player name labels: no dark box behind the text, outlined text instead so it stays readable on grass and roads */
.remotePlayer>span{background:none!important;box-shadow:none!important;text-shadow:-1px -1px 0 #000,1px -1px 0 #000,-1px 1px 0 #000,1px 1px 0 #000,0 0 3px #000!important}

/* Skill window (rwWin) + skill quick slots */
.rwSkill{width:min(780px,96vw,calc((100dvh - 16px)*1.75))}
.rwSkBody{display:grid;grid-template-columns:1.2fr 1fr;gap:1.4cqw}
.rwSkMain,.rwSkList{display:flex;flex-direction:column;gap:1cqw;padding:1.2cqw;border:1px solid var(--line);border-radius:.6cqw;background:linear-gradient(#0c1731,#08112a)}
.rwSkCard{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:.8cqw 1.4cqw;padding:1.2cqw;border:1px solid #22375b;border-radius:.6cqw;background:linear-gradient(90deg,#14254a,#0d182f)}
.rwSkCard.mine{border-color:var(--gold);box-shadow:0 0 1.4cqw #e6b94f33,inset 0 0 2cqw #ffcf6a14}
.rwSkIcon{width:9cqw;height:9cqw;min-width:44px;min-height:44px;border-radius:1cqw;box-shadow:0 0 1.2cqw #000a}
.rwSkCard.other{padding:.8cqw 1cqw;opacity:.8}.rwSkCard.other .rwSkIcon{width:5.5cqw;height:5.5cqw;min-width:30px;min-height:30px;filter:saturate(.7)}
.rwSkHead{display:flex;flex-direction:column;line-height:1.2}.rwSkHead b{font-size:max(13px,2.1cqw);color:var(--gold2)}.rwSkCard.other .rwSkHead b{font-size:max(11px,1.6cqw);color:var(--ink)}
.rwSkHead small{font-size:max(9px,1.15cqw);color:var(--mute)}
.rwSkDesc{grid-column:1/-1;margin:0;font-size:max(10px,1.35cqw);color:var(--ink);line-height:1.45}
.rwSkStats{grid-column:1/-1;display:grid;grid-template-columns:repeat(4,1fr);gap:.6cqw}
.rwSkStats span{display:flex;flex-direction:column;align-items:center;gap:.2cqw;padding:.6cqw .4cqw;border:1px solid #22375b;border-radius:.5cqw;background:#0e1a33;text-align:center}
.rwSkStats small{font-size:max(8px,1.05cqw);color:var(--mute)}.rwSkStats b{font-size:max(10px,1.35cqw);color:var(--gold2);white-space:nowrap}
.rwSkSlot{display:flex;flex-wrap:wrap;align-items:center;gap:.5cqw;font-size:max(10px,1.25cqw);color:var(--mute)}
.rwSkSlot span{margin-right:.4cqw}
.rwSkSlot button:not(.rwAct){width:3.2cqw;height:3.2cqw;min-width:26px;min-height:26px;padding:0;border:1px solid var(--line);border-radius:.4cqw;background:#0f1c38;color:var(--ink);font-size:max(10px,1.2cqw);cursor:pointer;touch-action:manipulation}
.rwSkSlot button.on{border-color:var(--gold2);background:#e6b94f33;color:var(--gold2)}
.rwSkSlot .rwAct{margin-left:auto}
.rwSkNone{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.8cqw;flex:1;padding:2cqw;text-align:center;color:var(--mute);font-size:max(10px,1.35cqw)}
.rwSkNone i{font-style:normal;font-size:max(22px,4cqw);color:var(--gold)}.rwSkNone b{font-size:max(13px,2cqw);color:var(--ink)}
.rwSkList .rwNote{margin-top:auto;text-align:left}
@media (pointer:coarse){.rwSkSlot .rwPc{display:none}}
.quickSlot{position:relative}
.quickSlot .qsSkill.off{filter:grayscale(1) brightness(.6)}
.quickSlot .qsCd{position:absolute;left:0;right:0;bottom:0;height:0;background:#050b18b8;border-radius:inherit;pointer-events:none}
.quickSlot .qsCdT{position:absolute;inset:0;display:grid;place-items:center;font-style:normal;font-weight:800;font-size:15px;color:#fff;text-shadow:0 0 3px #000,0 0 3px #000;pointer-events:none}
.quickSlot.noSp .qsSkill{filter:saturate(.3) brightness(.7)}
.rwSkill .rwEyebrow{display:none}

/* Skill window shows only the player's own skill: single narrow column */
.rwSkill{width:min(520px,96vw,calc((100dvh - 16px)*1.3))}.rwSkBody{grid-template-columns:1fr}

/* GM window + announcement banner */
.rwGm{width:min(640px,96vw)}
.rwGm .rwEyebrow{display:none}
.gmTabs{display:flex;gap:.6cqw;margin-bottom:1cqw}
.gmTabs button{flex:1;height:5cqw;min-height:30px;border:1px solid var(--line);border-radius:.5cqw;background:#0f1c38;color:var(--ink);font-size:max(11px,1.8cqw);cursor:pointer}
.gmTabs button.on{border-color:var(--gold);background:linear-gradient(90deg,#e6b94f45,#e6b94f10);color:#fff}
.gmPane{display:flex;flex-direction:column;gap:1cqw;max-height:min(60dvh,420px);overflow:auto;padding:1cqw;border:1px solid var(--line);border-radius:.6cqw;background:linear-gradient(#0c1731,#08112a)}
.gmRow{display:flex;gap:1cqw;align-items:flex-end}.gmRow>*{flex:1}
.gmPane input,.gmPane select,.gmPane textarea{width:100%;margin-top:.4cqw;padding:.8cqw 1cqw;border:1px solid var(--line);border-radius:.5cqw;background:var(--panel);color:var(--ink);font:inherit;font-size:max(13px,1.9cqw);box-sizing:border-box}
.gmForm{display:flex;flex-direction:column;gap:1.2cqw}.gmForm label{display:block;font-size:max(11px,1.7cqw);color:var(--mute)}.gmForm .rwAct{align-self:flex-end}
.gmSearch .rwAct{flex:none}
.gmNote{color:var(--mute);font-size:max(10px,1.5cqw)}
.gmList{display:flex;flex-direction:column;gap:.6cqw}
.gmPlayer{display:flex;align-items:center;gap:1cqw;padding:.8cqw 1cqw;border:1px solid #22375b;border-radius:.5cqw;background:#0e1a33}
.gmPlayer>div{flex:1;min-width:0;display:flex;flex-direction:column;font-size:max(11px,1.7cqw)}.gmPlayer b{color:var(--gold2)}.gmPlayer small,.gmPlayer em{color:var(--mute);font-style:normal;font-size:max(10px,1.45cqw)}
.gmPlayer.banned{border-color:#8a3a3a;background:#2a1216}
.gmPlayer span{display:flex;gap:.5cqw;flex-wrap:wrap;justify-content:flex-end}
.gmPlayer button{padding:.5cqw 1cqw;min-height:28px;border:1px solid var(--gold);border-radius:.4cqw;background:linear-gradient(#2d6fd3,#123d88);color:#fff;font-size:max(10px,1.5cqw);cursor:pointer}.gmPlayer button.danger{border-color:#e06a6a;background:linear-gradient(#c84040,#7c1f1f)}
.gmLog div{font-size:max(10px,1.5cqw);color:var(--ink);padding:.4cqw 0;border-bottom:1px solid #1c2c4a}.gmLog time{color:var(--mute)}.gmLog b{color:var(--gold2)}
.gmEmpty{color:var(--mute);text-align:center;margin:1cqw 0}
.gmBanner{position:fixed;left:50%;top:max(56px,calc(env(safe-area-inset-top) + 50px));transform:translateX(-50%);z-index:1500;max-width:min(92vw,640px);padding:10px 22px;border:1px solid #e6b94f;border-radius:10px;background:linear-gradient(90deg,#3a1d0acc,#6b3a10ee,#3a1d0acc);color:#fff4cf;font-weight:700;font-size:16px;text-align:center;text-shadow:0 1px 2px #000;box-shadow:0 0 18px #e6b94f66;pointer-events:none;animation:gmIn .35s ease-out;transition:opacity .6s}
.gmBanner.gift{background:linear-gradient(90deg,#0a2a1acc,#12603aee,#0a2a1acc);border-color:#7fe0a0}
.gmBanner.out{opacity:0}
@keyframes gmIn{from{opacity:0;transform:translate(-50%,-12px)}to{opacity:1;transform:translate(-50%,0)}}

/* Skill icons fill the whole quick slot (potions keep their small centred icon) */
.quickSlot:has(.qsSkill){overflow:hidden;padding:0!important}
body .radialActions .quickSlot .quickSlotIcon.qsSkill{position:absolute!important;inset:0!important;left:0!important;top:0!important;width:100%!important;height:100%!important;transform:none!important;object-fit:cover;border-radius:inherit;image-rendering:auto!important;z-index:0!important}
.quickSlot:has(.qsSkill) b{z-index:3!important}
.quickSlot .qsCd{z-index:1}.quickSlot .qsCdT{z-index:2}

/* Refine window (ลุงนักตีบวก) */
.rwRefine{width:min(760px,96vw,calc((100dvh - 16px)*1.55))}
.rwRefine .rwEyebrow{display:none}
.rfBody{display:grid;grid-template-columns:34cqw 1fr;gap:1.4cqw}
.rfList{display:flex;flex-direction:column;gap:.7cqw;max-height:min(52dvh,46cqw);overflow:auto;padding:1cqw;border:1px solid var(--line);border-radius:.6cqw;background:linear-gradient(#0c1731,#08112a)}
.rfItem{display:flex;align-items:center;gap:1cqw;padding:.7cqw 1cqw;min-height:38px;border:1px solid #22375b;border-radius:.5cqw;background:#0e1a33;color:var(--ink);text-align:left;cursor:pointer}
.rfItem.on{border-color:var(--gold);background:linear-gradient(90deg,#e6b94f40,#e6b94f10);box-shadow:0 0 1cqw #e6b94f44}
.rfIcon{position:relative;flex:none;width:5.4cqw;height:5.4cqw;min-width:30px;min-height:30px}.rfIcon img{width:100%;height:100%;object-fit:contain;image-rendering:pixelated}
.rfIcon i,.rfBig i{position:absolute;right:-4px;bottom:-4px;padding:0 .4em;border-radius:.4em;background:#e6b94f;color:#231400;font-style:normal;font-weight:800;font-size:max(9px,1.3cqw)}
.rfName{display:flex;flex-direction:column;min-width:0}.rfName b{font-size:max(11px,1.7cqw);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.rfName small{color:var(--mute);font-size:max(9px,1.3cqw)}
.rfDetail{display:flex;flex-direction:column;gap:1.2cqw;padding:1.4cqw;border:1px solid var(--line);border-radius:.6cqw;background:radial-gradient(120% 90% at 50% 0%,#1b2f55,#0a1429)}
.rfHero{display:flex;align-items:center;gap:1.6cqw}.rfHero b{font-size:max(14px,2.5cqw);color:var(--gold2)}
.rfBig{position:relative;flex:none;display:grid;place-items:center;width:11cqw;height:11cqw;min-width:56px;min-height:56px;border:1px solid var(--gold);border-radius:.8cqw;background:radial-gradient(circle,#2a3f66,#0b1428 75%);box-shadow:0 0 1.6cqw #e6b94f44}.rfBig img{width:72%;height:72%;object-fit:contain;image-rendering:pixelated}.rfBig i{font-size:max(11px,1.8cqw)}
.rfPips{display:flex;gap:.6cqw;margin-top:.8cqw}.rfPips i{width:2cqw;height:2cqw;min-width:11px;min-height:11px;transform:rotate(45deg);border:1px solid #6b7fa6;background:#0e1a33}.rfPips i.on{border-color:var(--gold2);background:linear-gradient(135deg,#fff1b8,#d9a93c);box-shadow:0 0 .8cqw #ffd978aa}
.rfStat{display:flex;align-items:center;gap:1cqw;padding:1cqw 1.2cqw;border:1px solid #22375b;border-radius:.5cqw;background:#0e1a33;font-size:max(11px,1.6cqw)}.rfStat span{flex:1;color:var(--mute)}.rfStat b{color:#fff;font-size:max(13px,2cqw)}.rfStat b.up{color:#66e08a}.rfStat em{font-style:normal;color:var(--mute)}
.rfCost{display:grid;grid-template-columns:repeat(3,1fr);gap:.8cqw}.rfCost span{display:flex;flex-direction:column;align-items:center;gap:.3cqw;padding:.8cqw;border:1px solid #22375b;border-radius:.5cqw;background:#0e1a33}.rfCost small{color:var(--mute);font-size:max(9px,1.3cqw)}.rfCost b{display:flex;align-items:center;gap:.4cqw;color:var(--gold2);font-size:max(11px,1.7cqw)}.rfCost b img{width:1.9cqw;height:1.9cqw;min-width:14px;min-height:14px}.rfCost b.rate{color:#9fe6ff;font-size:max(14px,2.3cqw)}.rfCost span.lack{border-color:#8a3a3a}.rfCost span.lack b{color:#ff8a7a}
.rfResult{text-align:center;font-weight:800;font-size:max(14px,2.4cqw);padding:.8cqw;border-radius:.5cqw;animation:rfPop .45s ease-out}.rfResult.ok{color:#fff4cf;background:linear-gradient(90deg,transparent,#e6b94f55,transparent);text-shadow:0 0 10px #ffd978}.rfResult.fail{color:#ffb3a8;background:linear-gradient(90deg,transparent,#8a2a2a66,transparent)}
@keyframes rfPop{0%{transform:scale(.6);opacity:0}70%{transform:scale(1.12)}100%{transform:scale(1);opacity:1}}
.rfGo{align-self:stretch;height:5.4cqw;min-height:36px;font-size:max(13px,2cqw)!important}
.rfMax{text-align:center;color:var(--gold2);font-weight:700;margin:0}.rfEmpty{color:var(--mute);text-align:center;margin:2cqw 0}
@media (max-width:560px){.rfBody{grid-template-columns:1fr}}

/* +N refine badge on equipment slots and bag cells */
.equipIcon{position:relative}
.rfTag{position:absolute;top:-3px;left:-3px;z-index:3;padding:0 4px;border-radius:4px;background:linear-gradient(#ffe58a,#e0a21b);color:#2a1500;font:900 11px/15px Bungee,Kanit,Tahoma,sans-serif;font-style:normal;box-shadow:0 1px 3px #000a;pointer-events:none}
.rwCell .rfTag{top:4%;left:5%;font-size:max(8px,1cqw);line-height:1.4}

/* Warp gate window */
.rwGateWin{width:min(920px,96vw,calc((100dvh - 16px)*1.3))}
.gwBody{display:grid;grid-template-columns:36cqw 1fr;gap:1.4cqw}
.gwArt{position:relative;border:1px solid var(--gold);border-radius:.8cqw;overflow:hidden;box-shadow:0 0 1.6cqw #3a7bff55,inset 0 0 0 1px #0008;min-height:0}
.gwArt img{display:block;width:100%;height:100%;object-fit:cover}
.gwArt i{position:absolute;inset:0;background:radial-gradient(circle at 50% 55%,#6ab4ff33,transparent 60%);animation:gwPulse 3s ease-in-out infinite;pointer-events:none}
@keyframes gwPulse{50%{opacity:.35}}
.gwList{display:flex;flex-direction:column;gap:1.2cqw;max-height:min(62dvh,60cqw);overflow-y:auto;padding-right:.3cqw}
.gwCard{position:relative;display:flex;flex-direction:column;gap:.8cqw;padding:1.4cqw 1.6cqw;border:1px solid #c9a14a;border-radius:.7cqw;background:linear-gradient(90deg,#0a1429 0%,#0a1429f2 48%,#0a142988 72%,#0a142933),var(--thumb) right center/auto 100% no-repeat,#0a1429;box-shadow:inset 0 0 0 1px #0008,0 .4cqw 1.2cqw #0008}
.gwCard:before{content:"";position:absolute;inset:.35cqw;border:1px solid #d9b04a33;border-radius:.5cqw;pointer-events:none}
.gwCard header{display:flex;align-items:center;gap:1.2cqw}
.gwRank{flex:none;display:grid;place-items:center;width:5cqw;height:5cqw;min-width:30px;min-height:30px;border:1px solid var(--gold);border-radius:.5cqw;background:linear-gradient(#2c3346,#141a28);color:#fff;font:900 max(14px,2.4cqw)/1 Bungee,Kanit,sans-serif;box-shadow:inset 0 0 0 2px #0006}
.gwRank.r-D{color:#ffb36a}.gwRank.r-C{color:#9fe06a}.gwRank.r-B{color:#6fb0ff}.gwRank.r-A{color:#d58bff}.gwRank.r-S,.gwRank.r-SSS{color:#ffd978}
.gwCard h4{margin:0;font-size:max(14px,2.3cqw);color:var(--gold2);font-weight:800}
.gwCard small{font-size:max(11px,1.5cqw);color:#c5d0e6}
.gwCard p{margin:0;padding-top:.8cqw;border-top:1px solid #d9b04a33;font-size:max(11px,1.5cqw);color:#dfe7f5;line-height:1.5;max-width:70%}
.gwFoot{display:flex;flex-direction:column;gap:.7cqw}
.gwStatus{font-size:max(10px,1.35cqw);font-weight:700}.gwStatus.open{color:#7fe08a}.gwStatus.closed{color:#ff9a8a}
.gwEnter{display:flex;align-items:center;justify-content:center;gap:1cqw;height:5cqw;min-height:36px;border:1px solid var(--gold);border-radius:.6cqw;background:linear-gradient(#2e6fe0,#123a8c);color:#fff;font-family:inherit;font-size:max(13px,1.9cqw);font-weight:800;cursor:pointer;box-shadow:inset 0 1px 0 #ffffff55,0 0 1.2cqw #2e6fe055;touch-action:manipulation}
.gwEnter svg{width:2.4cqw;height:2.4cqw;min-width:16px;min-height:16px;fill:#cfe6ff}
.gwEnter em{font-style:normal}
.gwEnter:not(:disabled):hover{background:linear-gradient(#3b82f0,#1a4aa8);box-shadow:inset 0 1px 0 #ffffff66,0 0 1.6cqw #6ab4ff88}
.gwEnter:disabled{filter:grayscale(.8);opacity:.6;cursor:default}
.gwNote{grid-column:1/-1;display:flex;align-items:center;gap:1.4cqw;padding:1cqw 1.6cqw;border:1px solid var(--line);border-radius:.6cqw;background:linear-gradient(90deg,#0c1731,#08112a)}
.gwNote>svg{flex:none;width:4cqw;height:4cqw;min-width:24px;min-height:24px;color:var(--gold)}
.gwNote div{display:flex;flex-direction:column;gap:.3cqw;font-size:max(10px,1.4cqw);color:#dfe7f5}
@media (max-width:640px){.gwBody{grid-template-columns:1fr}.gwArt{display:none}.gwCard p{max-width:none}}

.gwMsg{display:block;padding:.6cqw 1cqw;border:1px solid #c0503a;border-radius:.4cqw;background:#3a1210cc;color:#ffcfc4;font-size:max(11px,1.4cqw)}.gwMsg[hidden]{display:none}

/* Party window */
.rwPartyWin{width:min(640px,96vw)}
.pwInvite{display:flex;gap:1.6cqw;margin-bottom:2cqw}
.pwInvite label{flex:1;display:flex;align-items:center;gap:1.4cqw;padding:0 2cqw;border:1px solid var(--line);border-radius:1cqw;background:#081226}
.pwInvite label svg{width:max(20px,4cqw);height:max(20px,4cqw);fill:#6d7c99;flex:none}
.pwInvite input{flex:1;min-width:0;height:max(40px,8cqw);border:0;background:none;color:#fff;font:inherit;font-size:max(14px,2.8cqw);outline:none}
.pwInvite button{display:flex;align-items:center;gap:1.2cqw;padding:0 3.4cqw;border:1px solid var(--gold);border-radius:1cqw;background:linear-gradient(#2e6fe0,#123a8c);color:#fff;font:inherit;font-size:max(14px,2.9cqw);font-weight:800;cursor:pointer;box-shadow:inset 0 1px 0 #ffffff55,0 0 1.4cqw #2e6fe055;touch-action:manipulation}
.pwInvite button svg{width:max(18px,3.6cqw);height:max(18px,3.6cqw);fill:#e6f0ff;stroke:#e6f0ff}
.pwList{display:flex;flex-direction:column;gap:1.6cqw;max-height:min(52dvh,80cqw);overflow-y:auto}
.pwEmpty{margin:0;padding:4cqw;text-align:center;color:#9fb0cc;border:1px dashed var(--line);border-radius:1cqw}
.pwMember{display:flex;gap:2cqw;align-items:center;padding:1.6cqw;border:1px solid #3a5176;border-radius:1cqw;background:linear-gradient(90deg,#0c1833,#0a1429)}
.pwMember.off{opacity:.55}.pwMember.dead .pwPic img{filter:grayscale(1)}
.pwPic{flex:none;width:max(64px,17cqw);aspect-ratio:1;border:2px solid var(--gold);border-radius:.8cqw;overflow:hidden;background:radial-gradient(circle at 50% 35%,#34466e,#101a30);box-shadow:inset 0 0 0 2px #0008}
.pwPic img{width:100%;height:100%;object-fit:cover;object-position:top;image-rendering:pixelated}
.pwInfo{flex:1;min-width:0;display:flex;flex-direction:column;gap:.8cqw}
.pwTop{display:flex;align-items:center;gap:1.2cqw;font-size:max(14px,3.2cqw)}
.pwTop b{color:#fff;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pwTop i{font-style:normal;color:var(--gold2)}
.pwCrown{font-size:.9em}
.pwMap{margin-left:auto;display:flex;align-items:center;gap:.6cqw;color:#c5d0e6;font-size:max(11px,2.3cqw);white-space:nowrap}
.pwMap svg{width:max(14px,2.6cqw);height:max(14px,2.6cqw);fill:#5c9dff}
.pwKick{flex:none;border:1px solid #a33;border-radius:.6cqw;background:#3a0d12;color:#ffb0a8;cursor:pointer;padding:.2cqw 1.2cqw}
.pwGap{color:#f0b84a;font-size:max(11px,2.3cqw)}
.pwBar{position:relative;height:max(16px,3.2cqw);border-radius:.5cqw;background:#050a16;overflow:hidden;box-shadow:inset 0 0 0 1px #0009}
.pwBar s{position:absolute;inset:0 auto 0 0;transition:width .3s}
.pwBar.hp s{background:linear-gradient(90deg,#b8202e,#f06a50)}.pwBar.sp s{background:linear-gradient(90deg,#1e6ee8,#44c8f0)}
.pwBar em{position:relative;display:block;text-align:center;font-style:normal;font-weight:800;color:#fff;font-size:max(11px,2.2cqw);line-height:max(16px,3.2cqw);text-shadow:0 1px 2px #000}
.pwFoot{display:flex;align-items:center;gap:2cqw;margin-top:2cqw}
.pwFoot p{flex:1;margin:0;display:flex;align-items:center;gap:1.4cqw;color:#c5d0e6;font-size:max(11px,2.2cqw);line-height:1.5}
.pwFoot p svg{flex:none;width:max(20px,4cqw);height:max(20px,4cqw);color:var(--gold)}
.pwLeave{flex:none;display:flex;align-items:center;gap:1.2cqw;padding:1.6cqw 3cqw;border:1px solid #ff8a6a;border-radius:1cqw;background:linear-gradient(#d6322c,#861217);color:#fff;font:inherit;font-size:max(13px,2.7cqw);font-weight:800;cursor:pointer;box-shadow:inset 0 1px 0 #ffffff44,0 0 1.4cqw #d6322c55;touch-action:manipulation}
.pwLeave svg{width:max(18px,3.4cqw);height:max(18px,3.4cqw);fill:#fff}
.pwLeave[hidden]{display:none}
@media (max-width:520px){.pwFoot{flex-direction:column;align-items:stretch}.pwLeave{justify-content:center}}

/* Party HUD under the name card */
.partyHud{position:fixed;z-index:6;display:flex;flex-direction:column;gap:4px;cursor:pointer;pointer-events:auto}
.partyHud[hidden]{display:none}
.phMate{display:flex;gap:6px;align-items:center;padding:4px 6px;border:1px solid #c9a14a88;border-radius:6px;background:#0a1429d9;box-shadow:0 2px 6px #0008}
.phMate.off{opacity:.5}.phMate.dead img{filter:grayscale(1)}
.phMate img{flex:none;width:30px;height:30px;border:1px solid #c9a14a;border-radius:4px;object-fit:cover;object-position:top;image-rendering:pixelated;background:#16213a}
.phMate>div{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.phMate b{font-size:11px;color:#fff;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.phMate b i{font-style:normal;color:#f3cf6a}.phMate b small{margin-left:4px;color:#9fb0cc;font-weight:400}
.phBar{position:relative;display:block;height:5px;border-radius:3px;background:#050a16;overflow:hidden}
.phBar s{position:absolute;inset:0 auto 0 0;transition:width .3s}
.phBar.hp s{background:linear-gradient(90deg,#b8202e,#f06a50)}.phBar.sp s{background:linear-gradient(90deg,#1e6ee8,#44c8f0)}

/* Party on short screens (phone landscape) */
.partyHud.side .phMate{padding:3px 5px}.partyHud.side .phMate img{width:24px;height:24px}.partyHud.side .phMate b{font-size:10px}
@media (max-height:520px){
 .rwPartyWin{width:min(560px,94vw)}
 .pwInvite{margin-bottom:6px;gap:6px}.pwInvite input{height:34px;font-size:13px}.pwInvite button{font-size:13px;padding:0 14px}
 .pwList{gap:6px;max-height:calc(100dvh - 190px)}
 .pwMember{padding:6px;gap:8px}.pwPic{width:52px}
 .pwTop{font-size:13px}.pwMap{font-size:11px}.pwInfo{gap:3px}
 .pwBar{height:14px}.pwBar em{font-size:10px;line-height:14px}
 .pwFoot{margin-top:6px}.pwFoot p{font-size:10px;line-height:1.35}.pwLeave{padding:7px 12px;font-size:12px}
}

/* Inspect player window */
.rwInspectWin{width:min(520px,94vw)}
.insTop{display:flex;gap:12px;align-items:center;margin-bottom:10px}
.insPic{flex:none;width:76px;aspect-ratio:1;border:2px solid var(--gold);border-radius:8px;overflow:hidden;background:radial-gradient(circle at 50% 35%,#34466e,#101a30)}
.insPic img{width:100%;height:100%;object-fit:cover;object-position:top;image-rendering:pixelated}
.insHead h3{margin:0;color:#fff;font-size:18px}.insHead p{margin:2px 0;color:#dfe7f5;display:flex;align-items:center;gap:6px}.insHead p i{font-style:normal;color:var(--gold2);font-weight:800}
.insHead .gwRank{width:24px;height:24px;min-width:24px;min-height:24px;font-size:12px;font-style:normal}
.insHead small{color:#9fb0cc}
.insStats{display:grid;grid-template-columns:repeat(5,1fr);gap:6px;margin-bottom:10px}
.insStats div{display:flex;flex-direction:column;align-items:center;padding:5px 2px;border:1px solid var(--line);border-radius:6px;background:#0a1429}
.insStats span{font-size:10px;color:#9fb0cc}.insStats b{font-size:14px;color:#fff}
.insSub{margin:4px 0 6px;color:var(--gold2);font-size:13px}
.insGear{display:grid;grid-template-columns:repeat(auto-fill,minmax(80px,1fr));gap:6px}
.insItem{position:relative;display:flex;flex-direction:column;align-items:center;gap:3px;padding:6px 4px;border:1px solid #3a5176;border-radius:6px;background:#0c1833}
.insItem img{width:40px;height:40px;object-fit:contain}
.insItem em{position:absolute;top:3px;right:5px;font-style:normal;font-weight:800;color:#ffd978;font-size:11px;text-shadow:0 1px 2px #000}
.insItem span{font-size:10px;color:#dfe7f5;text-align:center;line-height:1.2}
.insEmpty{grid-column:1/-1;margin:0;color:#9fb0cc;text-align:center}
@media (max-height:520px){.insPic{width:56px}.insStats{gap:4px}.insStats b{font-size:12px}.insItem img{width:30px;height:30px}}

/* Own name tag (same as other players, no sprite/bars) */
.remotePlayer.selfTag{pointer-events:none}.remotePlayer.selfTag[hidden]{display:none}

/* Touch controls: joystick bottom-left (chat collapsed out of its way), skill button next to attack */
html body.touchUI .joystick{display:block!important;z-index:7}
body.touchUI .chatRestore{left:max(14px,env(safe-area-inset-left))!important;bottom:calc(max(14px,env(safe-area-inset-bottom)) + 124px)!important;top:auto!important;right:auto!important}
.touchSkill{position:fixed;z-index:8;padding:0;border:2px solid var(--gold,#d9b04a);border-radius:50%;background:#0a1429;overflow:hidden;box-shadow:0 0 10px #0009,inset 0 0 0 2px #0008;touch-action:none;-webkit-tap-highlight-color:transparent}
.touchSkill[hidden]{display:none}
.touchSkill img{width:100%;height:100%;object-fit:cover;display:block;pointer-events:none}
.touchSkill i{position:absolute;inset:0;background:conic-gradient(#000a var(--cd,0deg),transparent 0);pointer-events:none}
.touchSkill b{position:absolute;inset:0;display:grid;place-items:center;color:#fff;font:800 18px/1 Bungee,Kanit,sans-serif;text-shadow:0 1px 3px #000;pointer-events:none}
.touchSkill.noSp img{filter:grayscale(.8) brightness(.7)}
.touchSkill:active{transform:scale(.94)}

/* Scrollable lists inside windows: buttons are touch-action:none game-wide, which blocked finger scrolling here */
.rwBody .rfList,.rwBody .rfList *,.rwBody .gwList,.rwBody .gwList *,.rwBody .pwList,.rwBody .pwList *,.rwBody .insGear,.rwBody .insGear *{touch-action:pan-y}
.rwBody .rfList,.rwBody .gwList,.rwBody .pwList{-webkit-overflow-scrolling:touch;overscroll-behavior:contain}

