*{box-sizing:border-box}body{margin:0;background:#101b29;color:#f5f0dd;font:16px Tahoma,sans-serif}button,input{font:inherit}button{cursor:pointer;min-height:44px;border:1px solid #cfb775;border-radius:10px;background:linear-gradient(#435d68,#233d4c);color:#fff1d2;padding:9px 14px;touch-action:manipulation}button:hover{filter:brightness(1.2)}button:disabled{opacity:.4;cursor:default}.gold{background:linear-gradient(#ce9951,#8e5b2f)}.danger{background:#793e4a}#app{max-width:1440px;margin:auto;min-height:100dvh}header{padding:10px 18px;background:#233746;border-bottom:2px solid #b49d64;display:flex;gap:14px;align-items:center;flex-wrap:wrap}header b{color:#ffe1a0}#body{padding:14px}.layout{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:14px}.panel{background:#243949;border:1px solid #69818a;border-radius:14px;padding:14px;box-shadow:0 8px 24px #0003}h1,h2,h3,p{margin:0 0 10px}h1{font-size:25px;color:#ffe0a0}h2{font-size:21px}.muted{color:#a9c2c8;font-size:13px}.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px}.card{background:#334d59;border:1px solid #72898b;border-radius:11px;padding:12px}.card.selected{border:2px solid #ffd483}.card .icon{font-size:44px}.stats{font-size:14px;line-height:1.7}.scene{position:relative;background:#183b35;border-radius:12px;overflow:hidden;border:2px solid #6e8975}canvas{width:100%;height:auto;display:block;touch-action:none}#toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);background:#172c3ef2;border:1px solid #d6bd7e;padding:12px 20px;border-radius:12px;z-index:20;display:none;max-width:90%}.scroll{max-height:58vh;overflow:auto}.skill{width:100%;text-align:left;margin-bottom:6px}.slots{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}.slot{min-height:70px}.battle{background:radial-gradient(ellipse at center,#4b665b,#233b39);height:clamp(220px,42vh,390px);position:relative;overflow:hidden}.unit{position:absolute;width:130px;text-align:center;transition:.2s}.avatar{font-size:58px;filter:drop-shadow(0 7px 2px #0005)}.unit.hit{transform:translateX(12px);filter:brightness(1.8)}.hp{height:8px;background:#18262c;border-radius:6px;overflow:hidden;margin:5px 8px}.hp i{display:block;height:100%;background:#8bd59c}.intent{display:flex;gap:3px;justify-content:center}.intent span{background:#f4ead2;color:#31424b;border-radius:5px;padding:5px 3px;font-size:10px;min-width:38px}.intent .active{background:#f9bb63;outline:2px solid white}.float{position:absolute;color:#ffccae;font-weight:bold;font-size:25px;animation:pop .85s forwards;pointer-events:none;z-index:5}@keyframes pop{to{transform:translateY(-55px);opacity:0}}.log{height:95px;overflow:auto;background:#172b37;padding:9px;font-size:13px;line-height:1.6}.speed{display:flex;gap:7px;padding:8px;background:#192e39;flex-wrap:wrap;font-size:13px}.badge{border-radius:15px;background:#42616b;padding:4px 9px}.target{outline:2px solid #ffd27a;border-radius:12px}.overlay{position:fixed;inset:0;background:#081321b8;z-index:10;display:grid;place-items:center;padding:15px}.modal{max-width:850px;width:100%;max-height:90dvh;overflow:auto}.keys{display:grid;grid-template-columns:repeat(3,50px);gap:5px;justify-content:center}.keys button{padding:8px}input{padding:12px;border-radius:9px;background:#162e3d;color:white;border:1px solid #80999c;width:100%}.hero-title{padding:22px 0}.notice{padding:10px;background:#162f3a;border-radius:8px;margin:10px 0}.maplist button{width:100%;margin:5px 0;text-align:left}footer{font-size:12px;color:#9eb5bc;padding:8px;text-align:center}@media(max-width:800px){#body{padding:7px}.layout{grid-template-columns:minmax(0,1fr) 235px;gap:7px}.panel{padding:9px}header{padding:7px;font-size:13px;gap:8px}.battle{height:240px}.unit{width:100px}.avatar{font-size:43px}.intent span{font-size:9px;min-width:30px}.grid{grid-template-columns:repeat(auto-fit,minmax(145px,1fr))}.scroll{max-height:48vh}button{padding:8px;font-size:14px}}@media(orientation:portrait){.layout{grid-template-columns:1fr}.scroll{max-height:35vh}body:before{content:'↻ แนะนำให้หมุนจอแนวนอน';display:block;background:#8b6634;padding:7px;text-align:center;font-size:13px}}

.sprite-frame{display:inline-block;position:relative;overflow:hidden;vertical-align:middle;flex-shrink:0}.sprite-frame img{image-rendering:pixelated;position:absolute;max-width:none;pointer-events:none}.avatar .sprite-frame{display:block;margin:-9px auto -13px}.battle{background:radial-gradient(ellipse at center,#c4c1a4,#657977);background-size:cover}.unit{color:#243740;font-weight:bold}.unit .muted{color:#253d46;text-shadow:0 1px #fff9}.intent span{box-shadow:0 2px 4px #0004}.panel{background:linear-gradient(135deg,#334d61,#203346);border-color:#b3a486}button{border-radius:7px}.scene{border:3px solid #b7a27f}.unit.target{background:#fff1c02b}.card .icon .sprite-frame{width:100px;height:100px}#arena:before{content:'';position:absolute;inset:0;background:repeating-linear-gradient(28deg,transparent 0 45px,#efe2bf12 46px 47px);pointer-events:none}
canvas{image-rendering:pixelated}.sprite-frame{image-rendering:pixelated}
/* ฉากต่อสู้มุมด้านข้าง — เน้นพื้นที่ฉากและแอนิเมชัน */
.combat-screen{display:flex;flex-direction:column;gap:8px}.combat-screen .battle{height:clamp(270px,49vh,510px);min-height:270px;background-size:100% 200%;background-repeat:no-repeat;isolation:isolate}.combat-screen .speed{border-radius:8px;font-size:12px}.combat-screen .unit{width:150px;transform:translate(-50%,-50%);cursor:pointer;color:#e7ffff;text-shadow:1px 1px 2px #16271c}.combat-screen .unit .muted{color:#f5fff0;text-shadow:1px 1px 2px #16271c}.combat-screen .unit.target{outline:0;background:none}.combat-screen .unit.target:after{content:'';position:absolute;bottom:20px;left:28px;right:28px;height:16px;border:2px solid #ffdf7f;border-radius:50%;z-index:-1;background:#ffe98024}.combat-screen .avatar .sprite-frame{margin:0 auto -14px}.combat-screen .hp{height:6px;margin:4px 22px;border:1px solid #233744}.combat-screen .intent{margin-bottom:2px}.combat-screen .intent span{font-size:10px;min-width:43px;background:#eff5e1ef}.combat-screen .battle:before{display:none!important}.combat-hud{position:absolute;left:12px;top:10px;padding:9px 12px;background:#122330c9;border:1px solid #cebf8c;border-radius:9px;z-index:4;min-width:180px}.combat-hud h3{font-size:15px;margin:0 0 3px}.combat-hud p{font-size:12px;margin:3px 0}.combat-deck{display:grid;grid-template-columns:310px minmax(0,1fr);gap:10px}.combat-deck .scroll{max-height:190px}.combat-skills{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:6px}.combat-skills .skill{margin:0;min-height:65px;padding:7px}.combat-screen .log{height:58px;border-radius:8px}.combat-screen .unit.casting.player-cast{animation:heroLunge .54s ease-in-out}.combat-screen .unit.casting.monster-cast{animation:monsterLunge .54s ease-in-out}@keyframes heroLunge{50%{transform:translate(calc(-50% - 48px),-50%)}}@keyframes monsterLunge{50%{transform:translate(calc(-50% + 42px),-50%)}}.battle-effect{position:absolute;left:48%;top:30%;font-size:38px;pointer-events:none;z-index:7;animation:skillBurst .55s forwards;filter:drop-shadow(0 0 7px #fff6bc)}@keyframes skillBurst{0%{transform:scale(.2);opacity:0}40%{transform:scale(1.4);opacity:1}100%{transform:scale(1.7);opacity:0}}.combat-screen .float{font-size:30px;color:#ffd071;text-shadow:2px 2px #6f2822,-1px -1px #fff2ad}.combat-help{position:absolute;right:12px;top:12px;background:#192b37aa;border-radius:8px;padding:7px 10px;font-size:12px;color:#fff0bc}
@media(max-width:800px){.combat-deck{grid-template-columns:255px minmax(0,1fr);gap:6px}.combat-screen .battle{min-height:230px;height:45vh}.combat-screen .unit{width:120px}.combat-screen .intent span{font-size:9px;min-width:34px}.combat-hud{min-width:140px;font-size:12px;padding:6px}.combat-hud h3{font-size:13px}.combat-skills{grid-template-columns:repeat(auto-fit,minmax(125px,1fr))}.combat-deck .scroll{max-height:170px}}@media(orientation:portrait){.combat-deck{grid-template-columns:1fr}.combat-help{max-width:140px}.combat-hud{max-width:150px}}

body[data-scene="town"] #header,body[data-scene="farm"] #header,body[data-scene="tower"] #header{display:none}body[data-scene="town"] footer,body[data-scene="farm"] footer,body[data-scene="tower"] footer{display:none}body[data-scene="town"] #body,body[data-scene="farm"] #body,body[data-scene="tower"] #body{padding:0}.map-shell{position:relative;height:100dvh;min-height:390px;overflow:hidden}.world-scene{height:100%;border:0;border-radius:0}.world-scene canvas{height:100%;width:100%}.world-hud{position:absolute;left:12px;top:12px;display:flex;gap:10px;align-items:center;background:linear-gradient(135deg,#23394bdb,#182a379d);border:2px solid #e3cb8b;border-radius:42px 15px 15px 42px;padding:8px 13px 8px 2px;pointer-events:none;box-shadow:0 4px 12px #0005;font-size:14px;color:#fff0b8}.world-portrait{width:78px;height:78px;border-radius:50%;overflow:hidden;background:#87b7b9;border:3px double #ead692}.world-bar{position:relative;height:17px;width:165px;border:1px solid #d0c6a4;background:#182837;border-radius:7px;overflow:hidden;margin:4px 0}.world-bar i{display:block;height:100%}.world-bar span{position:absolute;inset:0;text-align:center;font-size:11px;color:white;text-shadow:1px 1px #23323c}.world-hud small{font-size:11px}.world-title{position:absolute;top:17px;left:50%;transform:translateX(-50%);border:2px double #dac58a;background:#1b3446c9;border-radius:12px;padding:9px 15px;color:#ffe2a1;font-size:15px;max-width:35%;text-align:center;pointer-events:none}.world-menu{position:absolute;right:10px;top:10px;display:flex;gap:4px}.world-menu button{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:47px;font-size:22px;border-radius:50%;background:linear-gradient(#597985,#1a3448);border:2px solid #cfba86;padding:5px}.world-menu small{font-size:10px}.world-minimap{position:absolute;right:12px;top:83px;width:164px;background:#142b39d9;border:3px double #ddc58b;border-radius:8px;padding:4px;pointer-events:none}.world-minimap canvas{width:100%;height:auto}.world-minimap small{font-size:10px;text-align:center;display:block}.world-bottom{position:absolute;bottom:12px;left:12px;right:12px;display:flex;gap:12px;align-items:center;background:#162d3bd9;border:2px double #d6c18b;border-radius:8px;padding:10px;font-size:12px;color:#deebdf;pointer-events:none}.world-bottom button{pointer-events:auto;margin-left:auto}.world-bottom b{color:#ffe0a0}.world-directions{position:absolute;right:12px;bottom:73px;background:#193340c9;border:1px solid #dac58a;border-radius:9px;padding:7px;max-width:180px;font-size:11px}.dialogue-layer{position:fixed;inset:0;z-index:14;background:#0b182317}.dialogue-portrait{position:absolute;left:3%;bottom:0;width:min(30vw,350px);height:min(68vh,490px);overflow:hidden;pointer-events:none;z-index:2;filter:drop-shadow(0 0 6px #16313c)}.dialogue-portrait img{position:absolute;width:200%;height:100%;object-fit:fill;max-width:none}.dialogue-box{position:absolute;bottom:4%;left:10%;right:4%;min-height:190px;padding:20px 24px 20px clamp(160px,24vw,300px);background:linear-gradient(135deg,#537591ef,#294661f2);border:4px double #e6d28f;border-radius:16px;box-shadow:0 0 0 3px #203c51,0 8px 30px #0007}.dialogue-box h2{font-size:20px;color:#ffe29b}.dialogue-box p{font-size:18px;line-height:1.65;color:#fff5cf;min-height:60px}.dialogue-box .row{justify-content:flex-end}.dialogue-box button{min-height:44px}@media(max-width:800px){.world-hud{left:5px;top:5px;font-size:12px;padding:5px 8px 5px 1px;gap:4px}.world-portrait{width:56px;height:56px}.world-portrait .sprite-frame{transform:scale(.72);transform-origin:top left}.world-bar{width:135px;height:14px;margin:3px 0}.world-title{top:72px;left:8px;transform:none;max-width:55%;font-size:12px;padding:5px 9px}.world-menu{right:5px;top:5px;gap:2px}.world-menu button{min-width:43px;font-size:19px;padding:3px}.world-minimap{width:130px;top:66px;right:5px}.world-bottom{font-size:11px;bottom:5px;left:5px;right:5px;padding:6px}.world-directions{right:5px;bottom:48px;padding:3px}.world-directions .keys{grid-template-columns:repeat(3,44px);gap:2px}.dialogue-portrait{left:0;width:29vw;height:65vh}.dialogue-box{left:4%;right:3%;bottom:3%;padding:12px 12px 12px 25vw;min-height:175px}.dialogue-box h2{font-size:17px}.dialogue-box p{font-size:15px;min-height:50px;line-height:1.5}.dialogue-box .row{gap:5px}.dialogue-box button{font-size:12px;padding:6px}}

/* แมพ: ขนาดจอจริง ไม่ยืดภาพ; HUD ไม่รับการคลิกแทนพื้น */
.mmo-mini-panel{position:absolute;right:12px;top:82px;width:230px;padding:4px;border:3px double #ddc58b;border-radius:10px;background:#132333b8;min-height:0;z-index:3}.mmo-mini-panel canvas{width:220px;height:160px;max-width:100%;touch-action:manipulation}.mmo-mini-panel small{display:block;font-size:11px;color:#e5d6ab}.mmo-fade{position:absolute;inset:0;background:#000;opacity:0;transition:opacity 400ms;pointer-events:none;z-index:8}.mmo-large-map canvas{width:100%;max-height:68dvh;object-fit:contain;background:#0b1520;border:1px solid #70818b;touch-action:none}.mmo-large-map{max-width:1000px;margin:auto}.world-scene canvas{display:block;width:100%;height:100%;touch-action:none;image-rendering:pixelated}.world-directions,.keys{display:none!important}.map-shell{min-height:0}.world-title{pointer-events:none}.world-bottom{pointer-events:none}.world-menu{z-index:4}.world-hud{z-index:3}.world-minimap{display:none}@media(max-width:850px){.mmo-mini-panel{width:190px;right:5px;top:63px;padding:2px}.mmo-mini-panel canvas{width:180px;height:131px}.mmo-mini-panel small{font-size:10px}.world-hud{max-width:250px}.world-bottom span{font-size:10px}}

.rt-screen{display:flex;flex-direction:column;gap:9px}.rt-top{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}.rt-top h2{margin:0 0 4px}.rt-arena{border:2px solid #c3aa7a}.rt-arena canvas{width:100%;max-height:49vh;aspect-ratio:16/7;object-fit:fill;touch-action:manipulation}.rt-bottom{display:grid;grid-template-columns:310px minmax(0,1fr);gap:10px}.rt-team{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}.rt-member{display:flex;flex-direction:column;text-align:left;gap:2px;min-height:58px;padding:6px;font-size:12px;background:#334f60}.rt-member.selected{outline:2px solid #ffe2a1}.rt-member .muted{font-size:10px}.rt-member .hp{width:100%;margin:1px 0;height:5px}.rt-card-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px;margin:8px 0}.rt-card{display:flex;flex-direction:column;gap:7px;background:linear-gradient(#4c6670,#2a4453);border:2px solid #bea570;border-radius:10px;padding:10px 7px;min-height:140px;text-align:center}.rt-card b{font-size:22px;color:#ffe5a0}.rt-card strong{font-size:14px;min-height:32px}.rt-card small{font-size:11px;color:#d0e4df}.rt-card span{font-size:12px;color:#ffe2a1}.rt-card.casting{border-color:#fff3bb;box-shadow:0 0 10px #ffd878}.rt-cd{height:7px;background:#142c3b;border-radius:5px;overflow:hidden}.rt-cd i{display:block;background:#87bbd9;height:100%;transition:width .1s linear}.rt-edit-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(165px,1fr));gap:9px;margin-top:10px}.rt-screen .log{height:64px}.rt-top .row button{min-height:44px}@media(max-width:850px){.rt-bottom{grid-template-columns:220px minmax(0,1fr);gap:6px}.rt-card-grid{gap:4px}.rt-card{padding:7px 4px;min-height:122px}.rt-card strong{font-size:12px}.rt-card small{font-size:9px}.rt-card b{font-size:19px}.rt-member{padding:4px;font-size:10px}.rt-top h2{font-size:17px}.rt-top .muted{font-size:11px}.rt-top .row{gap:4px}.rt-top button{font-size:12px}.rt-arena canvas{max-height:46vh}.rt-screen .panel{padding:8px}.rt-screen h3{font-size:14px}.rt-screen .log{height:45px}}@media(orientation:portrait){.rt-bottom{grid-template-columns:1fr}.rt-arena canvas{max-height:none}.rt-card-grid{grid-template-columns:repeat(5,minmax(0,1fr))}}

/* สนามต่อสู้รักษาสัดส่วน 960:420 เสมอ ไม่มีการบีบแกนใดแกนหนึ่ง */
.rt-screen{gap:12px;padding:4px;background:radial-gradient(ellipse at top,#34495b44,transparent 65%)}
.rt-top{padding:12px 16px;background:linear-gradient(120deg,#24384e,#162737);border:1px solid #b69a61;border-radius:12px;box-shadow:0 4px 16px #0003}
.rt-top h2{color:#ffe0a1;letter-spacing:.3px}
.rt-arena.scene{height:auto;min-height:0;display:flex;justify-content:center;align-items:center;background:#0f1e2b;border-radius:14px;box-shadow:0 12px 30px #0005;overflow:hidden;border:1px solid #c6a876}
.rt-arena canvas{display:block;width:min(100%,112vh);height:auto;max-height:none;aspect-ratio:16/7;object-fit:contain;flex:none}
.rt-bottom{grid-template-columns:280px minmax(0,1fr)}
.rt-bottom .panel{border:1px solid #71808d;border-radius:12px;background:linear-gradient(145deg,#2d4054,#192b3c);box-shadow:0 4px 15px #0003}
.rt-card{min-height:126px;background:linear-gradient(155deg,#38566b,#182e43);border:1px solid #aa9062;box-shadow:inset 0 1px #e7d7b333,0 4px 8px #0003;gap:6px}
.rt-card b{font-size:28px}.rt-card strong{color:#fff0c9}.rt-card.casting{background:linear-gradient(155deg,#6b6343,#314455);border-color:#ffe6a6;box-shadow:0 0 15px #ffda7166}
.rt-member{background:linear-gradient(120deg,#334b60,#263b4d);border-color:#586f82;border-radius:8px}.rt-member.selected{outline:1px solid #ffdc90;background:#44586b}
.rt-screen .log{border-radius:10px;color:#b9ccd8;border:1px solid #3b5264;height:52px}
@media(max-width:850px){.rt-top{padding:8px 10px}.rt-top .muted{display:none}.rt-bottom{grid-template-columns:210px minmax(0,1fr)}.rt-card{min-height:106px}.rt-arena canvas{width:min(100%,112vh);max-height:none}.rt-card b{font-size:22px}.rt-card strong{min-height:24px}.rt-screen{gap:7px}}
@media(orientation:portrait){.rt-bottom{grid-template-columns:1fr}.rt-arena canvas{width:100%}}
.party-heading{display:flex;justify-content:space-between;align-items:center;gap:12px}.party-room{display:flex;gap:8px;flex-wrap:wrap;padding:12px;background:#142b3c;border-radius:12px;margin:12px 0}.party-room input{width:180px}.party-layout{display:grid;grid-template-columns:180px 1fr;gap:14px}.party-roster{display:flex;flex-direction:column;gap:6px}.party-roster button{text-align:left;display:flex;flex-direction:column;gap:5px}.party-roster small{font-size:11px;color:#c3d2d7}.party-deck{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}.party-deck article{display:flex;flex-direction:column;gap:10px}.party-deck .muted{flex:1}.party-skill-icon{font-size:35px;text-align:center}.auto-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.auto-grid input[type=checkbox]{width:auto}.auto-grid input[type=number]{width:80px}.auto-rule{display:flex;justify-content:space-between;gap:12px;padding:10px;border-bottom:1px solid #69818a}.auto-rule select{min-height:44px;background:#163447;color:white;border-radius:7px}.rt-top #rt-speed{background:linear-gradient(#927047,#574529);border-color:#f2ce82}@media(max-width:850px){.party-layout{grid-template-columns:140px 1fr}.party-deck{grid-template-columns:repeat(3,1fr)}}@media(max-width:600px){.party-layout{grid-template-columns:1fr}.party-roster{display:grid;grid-template-columns:repeat(2,1fr)}.party-deck{grid-template-columns:repeat(2,1fr)}.auto-grid{grid-template-columns:1fr}}
.loot-panel{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:min(520px,88%);padding:20px;background:linear-gradient(145deg,#25364cf0,#101e30f2);border:2px solid #e2be75;border-radius:15px;text-align:center;box-shadow:0 10px 40px #0008;pointer-events:none;animation:loot-pop .25s ease-out}.loot-panel h3{color:#ffdf92;font-size:23px}.loot-items{display:flex;justify-content:center;gap:15px;flex-wrap:wrap;margin:14px 0}.loot-items div{display:flex;flex-direction:column;gap:5px;max-width:170px}.loot-items b{font-size:36px}.loot-items span{font-size:14px}.rpg-summary{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin:16px 0}.rpg-summary div{display:flex;flex-direction:column;padding:12px;text-align:center;background:#183044;border-radius:8px}.rpg-summary b{font-size:26px;color:#ffdda0}.rpg-stat-row{display:flex;justify-content:space-between;align-items:center;padding:10px;border-bottom:1px solid #647687}.rpg-stat-row div{display:flex;flex-direction:column;gap:4px}.rpg-stat-row small{color:#a8c7cf}@keyframes loot-pop{from{opacity:0;transform:translate(-50%,-45%) scale(.9)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}@media(max-width:650px){.loot-panel{padding:12px}.loot-items b{font-size:26px}.rpg-summary{grid-template-columns:repeat(3,1fr)}}
.realm-notice{position:fixed;top:8px;left:50%;transform:translateX(-50%);z-index:20;background:#122840ed;color:#ffe19b;border:1px solid #dbb47a;border-radius:10px;padding:12px 20px;max-width:90vw;pointer-events:none;box-shadow:0 4px 25px #0006}

/* หน้าต่อสู้มีขนาดหนึ่งหน้าจอ; เฉพาะประวัติด้านขวาเลื่อนภายในได้ */
body[data-scene="battle"]{height:100dvh;overflow:hidden}body[data-scene="battle"] #header,body[data-scene="battle"] footer{display:none}body[data-scene="battle"] #app{height:100dvh;min-height:0;max-width:none}body[data-scene="battle"] #body{height:100%;padding:8px}
.rt-screen{height:100%;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) 250px;grid-template-rows:54px minmax(0,1fr) 140px;gap:8px;overflow:hidden}.rt-top{grid-column:1/3;grid-row:1;flex-wrap:nowrap;padding:6px 12px}.rt-top h2{font-size:18px}.rt-top .muted{display:none}.rt-top button{min-height:44px;font-size:13px;padding:6px 10px}.rt-arena.scene{grid-column:1;grid-row:2;min-width:0;min-height:0;height:100%}.rt-arena canvas{height:100%;width:100%;max-height:none;object-fit:contain;aspect-ratio:auto}.rt-bottom{display:contents}.rt-bottom>section:first-child{grid-column:2;grid-row:3;min-height:0;padding:7px;overflow:hidden}.rt-bottom>section:last-child{grid-column:1;grid-row:3;padding:7px;overflow:hidden}.rt-bottom h3{font-size:13px;margin-bottom:4px}.rt-bottom>section:last-child>p{display:none}.rt-team{grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}.rt-member{min-height:44px;padding:3px;font-size:9px;gap:2px;overflow:hidden}.rt-member .muted{font-size:8px}.rt-card-grid{height:108px;margin:4px 0;gap:6px}.rt-card{min-height:0;padding:6px;gap:3px;justify-content:space-between}.rt-card b{font-size:22px}.rt-card strong{font-size:12px;min-height:0}.rt-card small,.rt-card span{font-size:10px}.rt-cd{height:5px}.rt-report{grid-column:2;grid-row:2;display:flex;flex-direction:column;min-height:0;border:1px solid #6e8294;border-radius:12px;padding:10px;background:#14283b}.rt-report h3{font-size:15px}.rt-screen .rt-report .log{flex:1;min-height:0;height:auto;overflow-y:auto;padding:0;border:0;background:transparent}.rt-report article{border-bottom:1px solid #425869;padding:10px 2px;font-size:12px}.rt-report article small{display:block;color:#ffe4a0;margin:4px 0}.rt-report article p{font-size:11px;line-height:1.5;margin:3px 0;color:#cde6ee}.loot-panel{top:auto;bottom:12px;transform:translateX(-50%);width:auto;max-width:85%;padding:7px 12px;border-width:1px;border-radius:9px;animation:none}.loot-panel h3{font-size:12px;margin:0}.loot-panel .loot-items{gap:8px;margin:5px 0}.loot-panel .loot-items div{flex-direction:row;align-items:center;gap:4px;max-width:none}.loot-panel .loot-items b{font-size:17px}.loot-panel .loot-items span,.loot-panel .loot-items strong{font-size:10px}.loot-panel small{font-size:10px}.loot-panel>p{font-size:10px;margin:3px 0}.balloon-screen{position:fixed;inset:0;background:#101e31;display:grid;place-items:center;z-index:40}.balloon-screen canvas{width:100%;height:100%;object-fit:cover}.balloon-caption{position:absolute;bottom:10%;left:50%;transform:translateX(-50%);padding:12px 24px;background:#152b40c9;color:#ffe0a1;border-radius:12px;font-size:22px;white-space:nowrap}
@media(max-width:850px){.rt-screen{grid-template-columns:minmax(0,1fr) 180px;grid-template-rows:48px minmax(0,1fr) 116px;gap:5px}.rt-top{padding:3px 7px}.rt-top h2{font-size:14px}.rt-top button{font-size:11px;padding:5px;min-height:40px}.rt-card-grid{height:88px}.rt-card b{font-size:18px}.rt-card strong{font-size:10px}.rt-card small{display:none}.rt-team{grid-template-columns:repeat(4,minmax(0,1fr))}.rt-member{min-height:38px;font-size:8px}.rt-member .muted{font-size:7px}.rt-report{padding:6px}.rt-report h3{font-size:12px}.rt-report article,.rt-report article p{font-size:10px}.rt-arena canvas{width:100%;height:100%;max-height:none}}
body[data-scene="battle"] #header{display:block;height:0;min-height:0;padding:0;border:0}body[data-scene="battle"] #header>*:not(.realm-notice){display:none}
.mastery-level{font-size:13px;color:#ffe09a}.mastery-bar{height:8px;background:#13283c;border-radius:9px;overflow:hidden}.mastery-bar i{display:block;height:100%;background:linear-gradient(90deg,#7a99df,#dfb2ff)}
.rpg-window-overlay{padding:12px;background:#07121bbb}.rpg-window{position:relative;max-height:94dvh;overflow:auto;color:#efe2b7;background:linear-gradient(125deg,#293e49,#162b38);border:5px double #a69570;box-shadow:0 0 0 2px #131b20,0 18px 65px #0009;border-radius:4px;width:min(100%,1000px);font-size:14px}.rpg-window:before,.rpg-window:after{content:'❖';position:absolute;top:1px;color:#cbbb90;font-size:23px;z-index:1}.rpg-window:before{left:3px}.rpg-window:after{right:3px}.rpg-window-title{height:52px;position:relative;display:flex;justify-content:center;align-items:center;background:linear-gradient(#243945,#152a36);border-bottom:3px double #aa9971;padding:0 44px}.rpg-window-title>b{padding:8px 24px;border:2px solid #ad9c71;background:#243743;border-radius:5px;font-size:21px;text-shadow:0 2px #000}.rpg-window .rpg-x{position:absolute;right:9px;top:8px;min-height:29px;height:29px;width:29px;padding:0;background:linear-gradient(#bc6651,#79362e);border:2px solid #d1b773;color:#ffe3af;border-radius:4px;font-size:21px}.reference-stat-window{max-width:800px}.reference-stat-layout{display:grid;grid-template-columns:250px minmax(0,1fr);gap:9px;padding:9px}.reference-portrait,.reference-equipped,.reference-bag,.reference-stat-main{border:3px double #9e9273;background:linear-gradient(135deg,#324953,#203641);border-radius:5px;padding:12px}.reference-portrait{text-align:left;display:flex;flex-direction:column;min-height:0}.reference-portrait>b{text-align:center;font-size:14px}.reference-avatar{flex:1;min-height:185px;display:flex;align-items:center;justify-content:center}.reference-ghost-slots{display:flex;justify-content:center;gap:5px;margin:8px 0 20px}.reference-ghost-slots span{font-size:24px;opacity:.22;border:2px solid #97a6a3;border-radius:6px;padding:4px}.reference-values p{font-weight:bold;margin:8px 0}.reference-exp>div:first-child{display:flex;justify-content:space-between;margin:8px 0 4px}.reference-exp-track{height:19px;background:#172b34;border:1px solid #766c4d;position:relative;overflow:hidden;border-radius:5px}.reference-exp-track i{height:100%;display:block;background:linear-gradient(#ffe484,#d9b951)}.reference-exp-track b{position:absolute;inset:0;text-align:center;font-size:12px;color:#342f24}.reference-vitals{margin:12px 0;background:#1b303c;border-radius:6px;padding:8px}.reference-vitals p{margin:3px 0}.reference-vitals span,.reference-delta.positive{color:#a9db90}.reference-points{padding:9px 6px;border:1px solid #baa46c;background:#20343d;border-radius:4px;font-size:13px}.reference-stat-main{padding:9px}.reference-stat{display:grid;grid-template-columns:minmax(0,1fr) 33px 38px 34px 34px;gap:7px;align-items:center;padding:11px 9px;margin-bottom:7px;background:linear-gradient(90deg,#1a303e,#233b47);border:1px solid #405767;border-radius:6px}.reference-stat>div{display:flex;flex-direction:column;gap:3px}.reference-stat b{font-size:14px}.reference-stat small{font-size:10px;color:#a6bcc1}.reference-stat strong{text-align:right;font-size:17px}.reference-delta{color:#8299ad;text-align:center;border-bottom:3px solid #c0a057;padding-bottom:6px}.rpg-window button.reference-plus,.rpg-window button.reference-minus{min-height:31px;height:31px;padding:0;font-size:24px;border:2px solid #b0a271;border-radius:5px;background:linear-gradient(#7a744e,#4c4c35);color:#ffe28f}.rpg-window button.reference-minus{border-color:#a87b74;background:linear-gradient(#486273,#304352);color:#e39c89}.reference-actions{display:flex;gap:10px;justify-content:center;margin:12px 0 3px}.reference-actions button{flex:1;max-width:170px}.rpg-window .reference-confirm{background:linear-gradient(#a3b460,#647941);border:2px solid #e4d78a;box-shadow:0 0 10px #e0dc8160;color:#fff3c3}.rpg-window .reference-reset{background:linear-gradient(#a5573e,#743527);border:1px solid #c49c6a;color:#ffe5bf}.reference-preview{text-align:center;color:#c9decf;font-size:12px;padding:5px}.reference-links{display:flex;gap:5px;justify-content:center;flex-wrap:wrap;margin:12px 0 0}.reference-links button{font-size:10px;min-height:30px;padding:5px}.reference-equipment-layout{display:grid;grid-template-columns:230px 245px minmax(0,1fr);gap:8px;padding:8px}.reference-equipped{padding:7px}.reference-slot{display:flex;align-items:center;gap:8px;width:100%;min-height:57px;text-align:left;background:linear-gradient(#203640,#172e37);border:1px solid #415b64;border-radius:5px;padding:5px;margin-bottom:5px}.reference-slot>span{width:43px;height:43px;display:flex;align-items:center;justify-content:center;font-size:29px;background:#243f4b;border:2px solid #718793;border-radius:5px;opacity:.4}.reference-slot.filled>span{opacity:1}.reference-slot>div{display:flex;flex-direction:column;min-width:0;gap:1px}.reference-slot small{font-size:11px;color:#e1d499}.reference-slot b{font-size:12px;color:#ede2bf}.reference-slot em{font-size:9px;color:#d1c49b;font-style:normal}.reference-bag{padding:9px;position:relative;display:flex;flex-direction:column}.reference-bag h3{text-align:center;font-size:15px;margin:0 0 7px}.reference-tabs{display:flex;margin:0 0 7px;gap:3px}.reference-tabs button{flex:1;padding:4px;min-height:28px;font-size:11px;border-color:#4b6871;background:#243a47}.reference-tabs button.active{background:#625d3d;border-color:#c8b778}.reference-item-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:5px;max-height:290px;overflow:auto;align-content:start;flex:1}.reference-item{aspect-ratio:1;min-height:0;display:flex;align-items:center;justify-content:center;position:relative;background:linear-gradient(#203943,#182a33);border:2px solid #456271;border-radius:5px;font-size:32px;padding:0}.reference-item:not(.empty){border-color:var(--rarity)}.reference-item.selected{border-color:#f6d078;box-shadow:inset 0 0 8px #ffe9a663}.reference-item small{position:absolute;right:2px;bottom:1px;font-size:12px;color:#baec91}.reference-bag-buttons{display:flex;gap:8px;justify-content:center;margin-top:9px}.reference-bag-buttons button{flex:1;min-height:35px;font-size:12px;padding:5px}.reference-item-detail{position:absolute;bottom:50px;right:8px;left:8px;background:linear-gradient(135deg,#304b5a,#172d39);padding:12px;border:3px double #b29e73;border-radius:6px;box-shadow:0 6px 25px #0008;z-index:2}.reference-item-detail h3{text-align:left;font-size:16px}.reference-item-detail small{color:#b6d2e2}.reference-item-detail p{font-size:12px;margin:10px 0}.reference-item-detail .reference-actions button{min-height:36px;font-size:13px;padding:6px}
@media(max-width:850px){.reference-equipment-layout{grid-template-columns:170px 190px minmax(0,1fr)}.reference-stat-layout{grid-template-columns:200px minmax(0,1fr)}.reference-avatar{min-height:130px}.reference-slot{min-height:47px;gap:5px;margin-bottom:3px}.reference-slot>span{width:33px;height:33px;font-size:24px}.reference-slot b{font-size:11px}.reference-portrait,.reference-bag{padding:7px}.reference-item{font-size:26px}.reference-stat{padding:7px 6px;margin-bottom:5px}.reference-stat-main{padding:6px}.rpg-window-title{height:44px}.rpg-window-title>b{font-size:17px;padding:6px 16px}.reference-values p{font-size:12px}.reference-portrait>b{font-size:12px}.reference-item-grid{max-height:230px}}@media(max-width:580px){.reference-equipment-layout{grid-template-columns:1fr 1fr}.reference-equipment-layout .reference-portrait{grid-column:1/3;display:none}.reference-stat-layout{grid-template-columns:140px 1fr}.reference-avatar .sprite-frame{transform:scale(.75);margin:-20px}.reference-stat{grid-template-columns:1fr 23px 26px 28px 28px;gap:3px}.reference-stat b{font-size:11px}.reference-stat small{display:none}.reference-portrait{padding:6px}.reference-points{font-size:11px}.reference-item-grid{max-height:240px}}

.reference-skill-window{max-width:1040px}.reference-skill-layout{display:grid;grid-template-columns:250px 270px minmax(0,1fr);gap:8px;padding:8px;min-height:480px}.reference-skill-deck,.reference-skill-list,.reference-skill-details{background:linear-gradient(135deg,#304651,#213640);border:3px double #9e9273;border-radius:5px;padding:9px;min-width:0}.skill-owner{display:flex;gap:7px;align-items:center;margin:0 0 10px}.skill-owner>div{display:flex;flex-direction:column;gap:6px}.skill-owner b{font-size:12px}.skill-owner small{font-size:11px;color:#e2d5a7}.reference-skill-deck h3,.reference-skill-list h3{font-size:13px;margin:8px 0;color:#e9d8a4}.owned-skill-row{display:flex;align-items:center;gap:8px;min-height:60px;width:100%;padding:5px;background:#1d333f;border:1px solid #476170;text-align:left;border-radius:5px;margin:6px 0}.owned-skill-row>div{display:flex;flex-direction:column;gap:4px;min-width:0}.owned-skill-row b{font-size:13px;color:#eee0b4}.owned-skill-row small{font-size:11px;color:#dbcda6}.owned-skill-row.selected,.owned-skill-entry.selected{border:2px solid #e1c56c;background:linear-gradient(#635f3d,#3c482f);box-shadow:0 0 8px #d7d77b44}.skill-icon{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:43px;height:43px;font-size:30px;border-radius:5px;border:2px solid #898f71;background:radial-gradient(#ddc67755,#14282d);box-shadow:inset 0 0 6px #ffffff30}.skill-icon.fire{background:radial-gradient(#d79b48,#792e31)}.skill-icon.heal{background:radial-gradient(#b9e57d,#275f46)}.skill-icon.guard{background:radial-gradient(#8dc6e8,#214e79)}.skill-icon.poison{background:radial-gradient(#aaca79,#384b37)}.skill-icon.large{width:50px;height:50px;font-size:35px}.owned-skill-entry{display:flex;gap:2px;align-items:center;background:#1d333f;border:1px solid #476170;border-radius:5px;margin-bottom:6px}.owned-skill-entry .owned-skill-row{flex:1;margin:0;border:0;background:transparent}.skill-install-plus{flex:none;width:28px;min-height:44px;padding:0;border:0;background:transparent;color:#ffe09a;font-size:21px}.owned-skill-scroll{max-height:440px;overflow-y:auto}.skill-book-link{width:100%;font-size:12px;margin-top:10px}.skill-detail-heading{display:flex;align-items:center;gap:9px;padding:2px 0 10px;border-bottom:1px solid #8b8264}.skill-detail-heading h3{font-size:17px;margin:0 0 4px}.skill-detail-heading small{font-size:12px;color:#e1d5ac}.skill-category{font-size:12px;color:#e5d5a2;background:#192d38;padding:8px;border-radius:4px;margin:9px 0}.skill-facts{padding:0 8px 8px;border-bottom:1px solid #677b81}.skill-facts p{font-size:13px;margin:4px 0}.reference-skill-details h4{font-size:13px;color:#f4dc9b;margin:12px 0 5px}.skill-effect-current,.skill-effect-next{font-size:13px;color:#e1d6b7;line-height:1.5;margin:3px 0}.skill-effect-next{color:#b4d897}.skill-training-progress{margin:10px 0}.skill-training-progress small{display:block;font-size:11px;color:#c2cce0;margin-bottom:4px}.skill-training-note{font-size:10px;color:#a7bbc1;line-height:1.5;margin:10px 0}.skill-slot-pick{padding:8px;background:#142b3c;border-radius:7px}.skill-slot-pick>b{font-size:12px}.skill-slot-pick>div{display:flex;gap:4px;margin-top:6px}.skill-slot-pick button{flex:1;padding:4px;display:flex;flex-direction:column;gap:2px}.reference-skill-details .reference-actions button{font-size:12px;padding:7px;min-height:38px}
@media(max-width:850px){.reference-skill-layout{grid-template-columns:190px 210px minmax(0,1fr);min-height:340px;gap:5px;padding:5px}.reference-skill-deck,.reference-skill-list,.reference-skill-details{padding:6px}.owned-skill-row{min-height:48px;gap:5px;margin:4px 0}.skill-icon{width:34px;height:34px;font-size:25px}.owned-skill-row b{font-size:11px}.owned-skill-row small{font-size:10px}.skill-detail-heading h3{font-size:14px}.skill-facts p,.skill-effect-current,.skill-effect-next{font-size:11px}.skill-owner b{font-size:10px}.skill-owner small{font-size:9px}.reference-skill-details h4{font-size:11px}.owned-skill-scroll{max-height:340px}.reference-skill-details .reference-actions{gap:4px}.reference-skill-details .reference-actions button{font-size:10px;padding:5px}}@media(max-width:600px){.reference-skill-layout{grid-template-columns:1fr 1fr}.reference-skill-deck{display:none}.reference-skill-list{grid-column:1}.reference-skill-details{grid-column:2}.skill-facts{padding:2px}.reference-skill-details .reference-actions{flex-direction:column}.reference-skill-details .reference-actions button{max-width:none}.skill-detail-heading{gap:4px}.skill-icon.large{width:34px;height:34px;font-size:26px}.skill-detail-heading h3{font-size:12px}}

.reference-farm-window{max-width:1040px;background:linear-gradient(#4f4b37,#2d342f)}.reference-farm-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px;padding:12px}.reference-farm-card{border:4px double #9f8d62;border-radius:7px;background:linear-gradient(135deg,#494b3b,#343a31);padding:9px;box-shadow:inset 0 0 15px #0004;cursor:pointer;min-width:0}.reference-farm-card.selected{border-color:#f0d184;box-shadow:0 0 9px #f4d67966,inset 0 0 14px #afc99025;background:linear-gradient(135deg,#535f40,#303f33)}.reference-farm-upper{display:grid;grid-template-columns:125px minmax(0,1fr);gap:12px}.reference-farm-thumb{position:relative;aspect-ratio:1;overflow:hidden;border:4px double #8d9b81;border-radius:5px;background:#172831;box-shadow:inset 0 0 15px #0006}.reference-farm-thumb img{position:absolute;width:355.56%;height:200%;max-width:none;image-rendering:pixelated}.reference-farm-thumb>span{position:absolute;top:3px;right:3px;text-shadow:0 2px 4px #000;font-size:21px}.reference-farm-description h3{font-size:18px;line-height:1.3;color:#f4e1aa;margin:0 0 5px;text-shadow:0 1px #000}.reference-farm-description p{color:#ddd8bb;font-size:13px;line-height:1.45;margin:3px 0}.reference-farm-description .farm-reward-line{margin-top:9px;color:#e6d5a0}.reference-farm-description small{display:block;color:#bfcbb3;font-size:10px;margin-top:7px}.reference-farm-lower{display:flex;justify-content:space-between;align-items:center;gap:9px;margin-top:9px}.reference-farm-drops{display:flex;gap:5px}.reference-farm-drops span{width:33px;height:33px;display:flex;align-items:center;justify-content:center;font-size:23px;border:2px solid #667f89;border-radius:4px;background:linear-gradient(#314b59,#172f3b)}.reference-farm-lower button{min-height:36px;padding:5px 15px;font-size:13px;white-space:nowrap}.reference-farm-footer{display:flex;align-items:center;justify-content:center;gap:17px;padding:9px 12px;margin:0;border-top:3px double #a18b5e;background:#243a40;color:#e9ddae;font-size:13px}.reference-farm-footer button{min-height:34px;padding:5px 10px;font-size:12px}
@media(max-width:850px){.reference-farm-grid{gap:7px;padding:8px}.reference-farm-card{padding:6px}.reference-farm-upper{grid-template-columns:92px minmax(0,1fr);gap:8px}.reference-farm-description h3{font-size:14px}.reference-farm-description p{font-size:11px}.reference-farm-description small{font-size:9px;margin-top:4px}.reference-farm-description .farm-reward-line{margin-top:4px}.reference-farm-drops span{width:27px;height:27px;font-size:18px}.reference-farm-lower button{min-height:34px;font-size:11px;padding:5px 9px}.reference-farm-footer{font-size:11px;gap:8px}.reference-farm-footer button{font-size:11px}}@media(max-width:580px){.reference-farm-grid{grid-template-columns:1fr}.reference-farm-upper{grid-template-columns:90px 1fr}.reference-farm-footer{flex-wrap:wrap}.reference-farm-description h3{font-size:16px}}

.reference-book-window{max-width:900px}.reference-book-head{display:flex;justify-content:space-between;padding:9px 12px 5px;font-size:12px;color:#dfcfa0}.reference-book-toolbar{display:flex;align-items:center;justify-content:space-between;padding:0 10px;gap:10px}.reference-book-toolbar .reference-tabs{margin:0;gap:5px;min-width:280px}.reference-book-toolbar .reference-tabs button{padding:4px 10px}.reference-book-toolbar label{font-size:11px;white-space:nowrap;color:#cdbb90}.reference-book-toolbar select{min-height:30px;margin-left:4px;border:1px solid #9b9170;border-radius:4px;background:#2d4650;color:#e9dfbe;padding:3px 6px;font:inherit}.reference-book-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:10px;max-height:65dvh;overflow:auto}.reference-book-entry{display:flex;align-items:center;gap:9px;text-align:left;min-height:100px;padding:7px;background:linear-gradient(115deg,#36474c,#22343f);border:3px double #8c8970;border-radius:4px;color:#e9d4a3}.reference-book-entry.maxed{border-color:#f3dc80;box-shadow:0 0 8px #f8da5666,inset 0 0 13px #e0bb412b;background:linear-gradient(115deg,#5a5633,#343d30)}.reference-book-entry.remembered{opacity:.75}.book-skill-art{width:94px;height:72px;flex:none;display:flex;align-items:center;justify-content:center;font-size:48px;border:3px double #9aa589;border-radius:4px;background:radial-gradient(ellipse,#e6d19366,#1e3640 75%);box-shadow:inset 0 0 16px #020b1e66;text-shadow:0 0 12px #fff8}.book-skill-art.heal{background:radial-gradient(#79d568,#164c42);border-color:#b1d791}.book-skill-art.guard{background:radial-gradient(#8bd9ff,#245077);border-color:#92a8bb}.book-skill-art.fire{background:radial-gradient(#efc367,#763e32);border-color:#c9a775}.book-skill-art.poison{background:radial-gradient(#abcb7d,#304b37)}.book-skill-art.light,.book-skill-art.spark{background:radial-gradient(#ffebb0,#6c6340)}.book-skill-info{min-width:0;flex:1;line-height:1.25}.book-skill-info>b{display:block;font-size:14px;margin-bottom:5px}.book-skill-info>b span{font-size:11px;font-weight:normal}.book-skill-info p{font-size:11px;margin:5px 0 2px;color:#e0d7b9}.book-skill-info>small{font-size:10px;color:#d1c6a8;line-height:1.35;display:block}.book-level-track{position:relative;height:12px;border-radius:3px;overflow:hidden;background:#142932;border:1px solid #6c6b53}.book-level-track i{display:block;height:100%;background:linear-gradient(#96c7df,#567e9e)}.book-level-track small{position:absolute;inset:0;text-align:center;font-size:9px;line-height:10px;color:#f0e7c7;text-shadow:0 1px #000}.maxed .book-level-track i{background:linear-gradient(#fce89e,#c2a344)}.reference-book-foot{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:8px 12px;border-top:3px double #8c8970;font-size:11px;color:#c5d0c4}.reference-book-foot button{min-height:31px;padding:5px 10px;font-size:11px}.reference-book-record{max-width:620px}.book-record{padding:15px}.book-record>.skill-detail-heading{margin-bottom:14px}.book-record h3{font-size:19px}.book-record .skill-detail-heading p{font-size:11px;margin:5px 0}.book-record>p{margin:12px 0}.book-training-counts{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin:14px 0}.book-training-counts>div{display:flex;flex-direction:column;text-align:center;gap:4px;padding:9px;background:#1a313f;border:1px solid #657777;border-radius:5px;font-size:12px}.book-training-counts b{font-size:24px;color:#ffe1a2}
@media(max-width:850px){.reference-book-entry{min-height:90px;padding:5px;gap:6px}.book-skill-art{width:76px;height:62px;font-size:40px}.book-skill-info>b{font-size:12px}.book-skill-info>b span{font-size:9px}.book-skill-info p{font-size:10px}.book-skill-info>small{font-size:9px}.reference-book-grid{gap:6px;padding:7px;max-height:62dvh}.reference-book-toolbar .reference-tabs{min-width:230px}}@media(max-width:580px){.reference-book-toolbar{flex-wrap:wrap}.reference-book-toolbar .reference-tabs{min-width:0;flex:1}.reference-book-grid{grid-template-columns:1fr}.reference-book-head{font-size:10px}.reference-book-toolbar label{margin-left:auto}.reference-book-foot{flex-wrap:wrap}.reference-book-entry{min-height:90px}}

.reference-inventory-window{max-width:880px}.reference-bag-top{display:flex;justify-content:space-between;padding:9px 12px 6px;font-size:12px;color:#dccc9e}.reference-bag-tabs{display:flex;gap:5px;padding:0 10px 8px}.reference-bag-tabs button{flex:1;min-height:30px;padding:4px 7px;font-size:12px;background:linear-gradient(#3d5355,#233b45);border-color:#7c816c}.reference-bag-tabs button.active{background:linear-gradient(#7a7551,#4f563d);border-color:#dfca85;color:#ffebbd}.reference-inventory-layout{display:grid;grid-template-columns:minmax(0,1fr) 270px;gap:10px;padding:0 10px 10px}.reference-inventory-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;align-content:start;max-height:56dvh;overflow:auto;padding:5px;background:#142a34;border:3px double #9c8e70;border-radius:5px}.reference-inventory-cell{position:relative;display:flex;align-items:center;justify-content:center;aspect-ratio:1;min-height:0;padding:0;background:radial-gradient(#41515b,#1d333e);border:3px double var(--rarity,#797962);border-radius:5px;color:#e5dbba}.reference-inventory-cell.selected{border-color:#ffe28d;box-shadow:0 0 8px #ffe28d66,inset 0 0 15px #ecd59455}.reference-inventory-cell>b{font-size:40px}.reference-inventory-cell>small{position:absolute;right:3px;bottom:2px;font-size:11px;text-shadow:0 1px 3px #000;color:#fff4d0}.reference-inventory-cell>em{position:absolute;left:3px;bottom:2px;font-size:12px;color:#a6e78e;font-style:normal}.reference-inventory-cell>span{position:absolute;right:3px;top:1px;font-size:14px;color:#ffe085}.reference-inventory-cell.empty{background:#1b303a;border-color:#4a616c}.reference-inventory-detail{display:flex;flex-direction:column;border:3px double #9c8e70;border-radius:5px;background:linear-gradient(145deg,#344b55,#1d3340);padding:11px;min-height:310px}.inventory-detail-title{display:flex;gap:8px;align-items:center;border-bottom:1px solid #82907c;padding-bottom:10px}.inventory-detail-title>span{font-size:36px}.inventory-detail-title>div{display:flex;flex-direction:column;gap:5px}.inventory-detail-title b{font-size:14px;color:#edda9f}.inventory-detail-title small{font-size:11px;color:#cbd3bb}.reference-inventory-detail>p{font-size:13px;line-height:1.55;margin:14px 0}.reference-inventory-detail .inventory-hint{font-size:11px;color:#a7bfbd;margin-top:auto}.inventory-equipped-note{color:#abd884}.inventory-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:8px}.inventory-actions button{min-height:37px;font-size:12px;padding:5px}.reference-inventory-footer{display:flex;justify-content:flex-end;gap:7px;padding:7px 10px;border-top:3px double #9c8e70}.reference-inventory-footer button{min-height:31px;font-size:11px;padding:5px 10px}
@media(max-width:850px){.reference-inventory-layout{grid-template-columns:minmax(0,1fr) 220px;gap:7px;padding:0 7px 7px}.reference-inventory-cell>b{font-size:31px}.reference-inventory-grid{gap:4px;max-height:54dvh}.reference-inventory-detail{padding:7px;min-height:240px}.reference-inventory-detail>p{font-size:11px;margin:9px 0}.inventory-detail-title b{font-size:12px}.inventory-actions button{min-height:32px;font-size:11px}.reference-bag-tabs{padding:0 7px 6px;gap:3px}.reference-bag-tabs button{font-size:10px;padding:3px}.reference-bag-top{font-size:11px}}@media(max-width:580px){.reference-inventory-layout{grid-template-columns:minmax(0,1fr) 165px}.reference-inventory-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.reference-inventory-cell>b{font-size:25px}.reference-inventory-cell>small{font-size:9px}.inventory-detail-title{gap:4px}.inventory-detail-title>span{font-size:25px}.inventory-detail-title b{font-size:11px}.reference-bag-top{font-size:9px}.reference-inventory-footer{flex-wrap:wrap;justify-content:center}.reference-inventory-detail{padding:5px}.inventory-actions{gap:4px}}

.party-reference-window{max-width:1030px}.party-reference-room-heading{display:flex;align-items:center;justify-content:flex-end;gap:15px;padding:5px 10px;color:#c6c7aa;font-size:11px}.party-reference-room-heading>span{margin-right:auto}.party-reference-room-heading button{min-height:28px;font-size:11px;padding:4px 7px}.party-reference-room-controls{display:flex;align-items:center;gap:6px;padding:0 10px 8px}.party-reference-room-controls input{width:160px;min-height:33px;padding:6px 10px;border-radius:4px;font-size:12px;background:#172e3b;border-color:#8b8466}.party-reference-room-controls button{min-height:33px;font-size:12px;padding:5px 11px}.party-reference-layout{display:grid;grid-template-columns:240px 270px minmax(0,1fr);gap:8px;padding:0 9px 9px}.party-reference-members,.party-reference-inspect,.party-reference-own{min-width:0;border:3px double #8e886a;border-radius:5px;padding:7px;background:linear-gradient(130deg,#304650,#20343e)}.party-reference-member{display:flex;align-items:center;gap:5px;width:100%;padding:3px 5px;min-height:53px;background:#1d333f;border:1px solid #4c6771;border-radius:5px;text-align:left;margin-bottom:5px}.party-reference-member.selected{border:2px solid #e4c978;background:linear-gradient(#726747,#414b32);box-shadow:0 0 7px #efdc7755}.party-reference-member>div{display:flex;flex-direction:column;gap:2px}.party-reference-member b{font-size:13px;color:#f4dfb0}.party-reference-member small{font-size:10px;color:#bacbc8}.party-reference-empty{height:44px;display:flex;align-items:center;justify-content:center;border:1px dashed #556b72;color:#7e979a;font-size:12px;margin-bottom:5px;border-radius:4px}.party-reference-members>p{font-size:10px;line-height:1.6;color:#a9bdc1;margin:8px 0 0}.party-reference-inspect h3,.party-reference-own h3{font-size:15px;text-align:center;color:#f0d5a0;margin:3px 0 7px}.party-reference-own>p{font-size:11px;color:#c9c6a4;margin:0 0 7px;text-align:center}.party-reference-scroll{max-height:460px;overflow-y:auto;padding-right:2px}.party-reference-skill{display:flex;gap:8px;align-items:flex-start;padding:8px 6px;background:#1b303c;border:1px solid #50616a;border-radius:5px;margin-bottom:6px}.party-reference-skill>.skill-icon{width:42px;height:42px;font-size:29px}.party-reference-skill>div{min-width:0;flex:1}.party-reference-skill b{font-size:13px;color:#eedba9}.party-reference-skill p{font-size:11px;line-height:1.35;color:#d2dac8;margin:4px 0}.party-reference-skill small{font-size:10px;color:#daca9c}.party-reference-edit{display:flex;gap:4px;margin-top:6px}.party-reference-edit button{min-height:28px;font-size:11px;padding:3px 7px}.party-reference-edit button:last-child{flex:1}.party-inspect-note{display:block;font-size:10px;color:#a8bbba;margin:6px 0 1px}.party-reference-footer{padding:7px 10px;border-top:3px double #8e886a;text-align:center;font-size:10px;color:#a5bcba}
@media(max-width:850px){.party-reference-layout{grid-template-columns:180px 210px minmax(0,1fr);gap:5px;padding:0 6px 6px}.party-reference-member{min-height:41px;margin-bottom:3px;padding:2px 3px}.party-reference-member .sprite-frame{transform:scale(.85);margin:-3px}.party-reference-member b{font-size:11px}.party-reference-member small{font-size:9px}.party-reference-skill{padding:5px;gap:5px;margin-bottom:4px}.party-reference-skill>.skill-icon{width:33px;height:33px;font-size:25px}.party-reference-skill b{font-size:11px}.party-reference-skill p{font-size:10px}.party-reference-skill small{font-size:9px}.party-reference-edit button{font-size:10px;padding:3px 5px;min-height:26px}.party-reference-scroll{max-height:320px}.party-reference-inspect h3,.party-reference-own h3{font-size:13px}.party-reference-room-controls button{font-size:10px;min-height:30px}.party-reference-room-controls input{font-size:11px;min-height:30px}.party-reference-room-heading{font-size:10px}}@media(max-width:600px){.party-reference-layout{grid-template-columns:130px minmax(0,1fr)}.party-reference-inspect{display:none}.party-reference-room-controls{flex-wrap:wrap}.party-reference-room-controls input{width:135px}.party-reference-own>p{font-size:9px}.party-reference-member b{font-size:10px}.party-reference-member small{font-size:8px}.party-reference-scroll{max-height:56dvh}}

.reference-auto-window{max-width:800px}.reference-auto-content{padding:14px;background:linear-gradient(135deg,#223747,#182c3c)}.reference-auto-note{font-size:12px;color:#b1c5cc;margin:0 0 12px}.reference-auto-potion-row{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:center;margin-bottom:12px}.reference-auto-potion-row label,.reference-auto-support-row label{display:flex;align-items:center;gap:7px;font-size:14px;color:#e6e1ce;white-space:nowrap}.reference-auto-content input[type=checkbox]{width:17px;height:17px;accent-color:#7ab9e6;cursor:pointer;margin:0 2px 0 0}.reference-auto-content input[type=number]{width:61px;min-height:35px;padding:5px 7px;text-align:center;font-size:14px;border:1px solid #8197a4;border-radius:4px;background:#152a3c;color:#e7eeef}.reference-auto-support-row{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:15px 0 12px}.reference-auto-support-row label{font-size:12px;gap:5px}.reference-auto-content h3{font-size:17px;color:#ebd69a;margin:8px 0 5px}.reference-auto-rules{border:1px solid #4d667c;border-radius:4px;overflow:hidden;background:#122737}.reference-auto-rule{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 12px;border-bottom:1px solid #465b69;min-height:48px}.reference-auto-rule:last-child{border-bottom:0}.reference-auto-rule>b{font-size:13px;color:#e6e6d9}.reference-auto-rule>b span{font-size:18px;margin:0 5px}.reference-auto-rule select{min-width:210px;min-height:32px;padding:4px 8px;background:linear-gradient(#24495a,#163b4c);color:#f1eacb;border:1px solid #8b9478;border-radius:5px;font:inherit;font-size:12px}.reference-auto-warning{font-size:11px;color:#d8c384;margin:9px 0 12px;line-height:1.5}.reference-auto-actions{display:flex;justify-content:flex-end;gap:9px}.reference-auto-actions button{min-height:36px;font-size:13px;padding:6px 16px}.reference-auto-actions .auto-close{margin-right:auto}
@media(max-width:850px){.reference-auto-content{padding:10px}.reference-auto-note{font-size:10px;margin-bottom:8px}.reference-auto-potion-row{margin-bottom:8px}.reference-auto-potion-row label{font-size:12px}.reference-auto-support-row{margin:10px 0 8px;gap:8px}.reference-auto-support-row label{font-size:10px}.reference-auto-content input[type=number]{width:52px;min-height:30px;font-size:12px}.reference-auto-content h3{font-size:14px}.reference-auto-rule{min-height:39px;padding:5px 8px}.reference-auto-rule>b{font-size:11px}.reference-auto-rule select{min-width:180px;min-height:28px;font-size:11px}.reference-auto-rule>b span{font-size:15px}.reference-auto-warning{font-size:10px;margin:7px 0}.reference-auto-actions button{min-height:31px;padding:5px 12px;font-size:11px}}@media(max-width:580px){.reference-auto-potion-row{grid-template-columns:1fr 1fr;gap:5px}.reference-auto-potion-row label{font-size:10px;gap:4px}.reference-auto-support-row{flex-direction:column}.reference-auto-content input[type=number]{width:44px;padding:4px}.reference-auto-rule select{min-width:0;width:145px;font-size:10px}.reference-auto-rule>b{font-size:10px}.reference-auto-rule>b span{margin:0 2px}.reference-auto-actions{gap:5px}}

.reference-pillar-window{max-width:800px}.reference-pillar-content{padding:12px;background:linear-gradient(135deg,#294351,#182f40)}.reference-pillar-note{font-size:12px;color:#d9d4b7;margin:0 0 12px;line-height:1.5}.reference-city-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;max-height:55dvh;overflow:auto;padding:2px}.reference-city-card{display:grid;grid-template-columns:100px minmax(0,1fr);gap:10px;padding:8px;border:1px solid #8e9a7e;border-radius:8px;background:linear-gradient(130deg,#354e57,#223d47);box-shadow:inset 0 0 10px #0002}.reference-city-card.current{border-color:#decc8c;background:linear-gradient(130deg,#425344,#263f38)}.reference-city-card.locked{opacity:.62}.reference-city-art{position:relative;min-height:142px;height:100%;overflow:hidden;border:3px double #bccbb4;border-radius:6px;background:#183d49}.reference-city-art img{position:absolute;width:200%;height:100%;max-width:none;image-rendering:pixelated;object-fit:fill}.reference-city-art>span{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);font-size:28px;text-shadow:0 2px 10px #000}.reference-city-info{display:flex;flex-direction:column;min-width:0}.reference-city-info h3{font-size:17px;color:#f4dd99;margin:3px 0 7px;line-height:1.3}.reference-city-info p{font-size:13px;line-height:1.45;margin:0 0 9px;color:#eee2b9}.reference-city-info small{font-size:11px;line-height:1.5;color:#b6d6d4;display:block;margin-bottom:8px}.reference-city-info button{margin-top:auto;min-height:34px;padding:5px 9px;border-radius:5px;background:linear-gradient(#426f57,#2c5142);box-shadow:none;font-size:14px;border-color:#a9ae7b}.reference-city-announcement-title{font-size:16px;color:#e9c985;margin:14px 0 5px}.reference-city-announcements{max-height:130px;overflow:auto;color:#bccdc7;font-size:12px;line-height:1.6}.reference-city-announcements p{margin:5px 0}.reference-pillar-footer{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:12px}.reference-pillar-footer button{min-height:33px;padding:5px 12px;font-size:12px}.reference-pillar-footer span{font-size:10px;color:#9fb9bd;text-align:right}
@media(max-width:850px){.reference-pillar-content{padding:9px}.reference-city-grid{gap:8px}.reference-city-card{grid-template-columns:76px minmax(0,1fr);gap:7px;padding:6px}.reference-city-art{min-height:115px}.reference-city-info h3{font-size:14px;margin:1px 0 6px}.reference-city-info p{font-size:11px;margin-bottom:6px}.reference-city-info small{font-size:10px;margin-bottom:5px}.reference-city-info button{min-height:30px;font-size:11px}.reference-pillar-note{font-size:11px;margin-bottom:8px}.reference-city-announcement-title{font-size:14px;margin-top:10px}.reference-city-announcements{font-size:11px;max-height:80px}}@media(max-width:540px){.reference-city-grid{grid-template-columns:1fr}.reference-city-card{grid-template-columns:83px minmax(0,1fr)}.reference-city-art{min-height:120px}.reference-city-info h3{font-size:16px}.reference-city-info p{font-size:12px}.reference-pillar-footer span{max-width:220px}}

.reference-smith-window{max-width:790px}.reference-smith-note{padding:9px 12px 4px;font-size:12px;color:#dbd7b5}.reference-smith-layout{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:9px}.reference-smith-preview,.reference-smith-cost{border:1px solid #8c967c;border-radius:7px;background:linear-gradient(135deg,#334e55,#203942);padding:11px;min-width:0}.reference-smith-layout h3{font-size:15px;color:#f0d8a0;margin:0 0 9px}.reference-smith-preview{text-align:center}.reference-smith-art{margin:5px auto 8px;width:85px;height:85px;display:flex;align-items:center;justify-content:center;font-size:58px;border:4px double #ebd68e;border-radius:7px;background:radial-gradient(#b8a461,#4a452d);box-shadow:0 0 16px #e3cc7266}.reference-smith-preview>p{font-size:13px;color:#e8bb74;margin:7px 0}.reference-smith-stats p{font-size:12px;margin:9px 0;color:#e1dbc4}.reference-smith-stats b{color:#ffe1a2}.reference-smith-stats span{color:#b8e494}.reference-smith-success{padding:8px 7px;border:1px solid #8a9f74;background:linear-gradient(#42674b,#294938);border-radius:5px;font-size:12px;color:#e9dfb2;margin-top:13px}.reference-smith-success span{margin-left:10px;color:#abd795}.smith-money{display:flex;align-items:center;gap:10px;padding:11px 7px;border-bottom:1px solid #698180}.smith-money>span{font-size:34px}.smith-money>div{display:flex;flex-direction:column;gap:6px}.smith-money b{font-size:17px;color:#f2d484}.smith-money small{font-size:11px;color:#c6d9c5}.smith-safety-note{font-size:11px;color:#a9dba8;line-height:1.7;margin:9px 0}.reference-smith-cost h4{font-size:12px;color:#d2ceaa;margin:9px 0 5px}.smith-item-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:5px;max-height:133px;overflow:auto}.smith-item-grid button{aspect-ratio:1;min-height:0;padding:2px;position:relative;font-size:25px;background:#253e4c;border:2px solid #7f8c84}.smith-item-grid button.selected{border-color:#f0d889;background:#5e633d;box-shadow:0 0 7px #e5d07844}.smith-item-grid small{position:absolute;right:2px;bottom:1px;font-size:9px;color:#fff0be}.reference-smith-cost .reference-actions button{font-size:12px;padding:6px;min-height:36px}.reference-smith-cost .reference-confirm{background:linear-gradient(#c59652,#946238)}.reference-smith-footer{display:flex;justify-content:flex-end;gap:7px;padding:6px 9px 9px}.reference-smith-footer button{font-size:11px;min-height:30px;padding:4px 9px}@media(max-width:850px){.reference-smith-layout{gap:7px;padding:7px}.reference-smith-preview,.reference-smith-cost{padding:8px}.reference-smith-layout h3{font-size:13px}.reference-smith-art{width:70px;height:70px;font-size:48px}.reference-smith-stats p{font-size:11px;margin:7px 0}.reference-smith-success{font-size:10px;padding:6px}.smith-money{padding:7px 4px}.smith-money b{font-size:14px}.reference-smith-note{font-size:10px}.smith-item-grid button{font-size:21px}.smith-item-grid{max-height:110px}.reference-smith-cost .reference-actions button{font-size:11px;min-height:31px}}@media(max-width:520px){.reference-smith-layout{grid-template-columns:1fr}.reference-smith-preview>h3:first-child{display:none}.reference-smith-art{width:60px;height:60px;float:left;margin:3px 10px}.reference-smith-success{clear:both}.smith-item-grid{grid-template-columns:repeat(6,1fr)}}

.reference-shop-window{max-width:850px}.reference-shop-layout{display:grid;grid-template-columns:270px minmax(0,1fr);gap:10px;padding:10px;background:linear-gradient(145deg,#294451,#183044)}.reference-shop-merchant h3{font-size:19px;color:#e7c692;margin:1px 0 5px}.reference-shop-merchant>p{font-size:11px;color:#e6dec4;margin-bottom:10px}.reference-shop-scene{position:relative;height:190px;overflow:hidden;border:3px double #bcad81;background:linear-gradient(#50656c,#92795b);border-radius:5px}.shop-shelves{position:absolute;left:0;right:0;top:9px;display:grid;grid-template-columns:repeat(3,1fr);gap:8px;padding:9px 18px;background:linear-gradient(#795d44,#553f30);border-top:5px solid #aa875d;border-bottom:6px solid #aa875d}.shop-shelves span{font-size:24px;text-align:center}.shop-merchant-sprite{position:absolute;bottom:1px;left:50%;transform:translateX(-50%);width:150px;height:150px;overflow:hidden;z-index:2}.shop-merchant-sprite img{position:absolute;width:1200px;height:450px;max-width:none;image-rendering:pixelated}.shop-wood-counter{position:absolute;bottom:0;left:0;right:0;height:30px;background:repeating-linear-gradient(0deg,#856044 0 8px,#a37d52 9px 11px);z-index:3;border-top:7px solid #b79566}.reference-shop-dialogue{border:3px double #a39a76;border-radius:5px;background:#d2c5a1;color:#3b3a2d;padding:9px;margin-top:6px}.reference-shop-dialogue>b{display:block;text-align:center;font-size:14px;border-bottom:1px solid #9d9471;padding-bottom:6px}.reference-shop-dialogue p{font-size:12px;line-height:1.5;margin:7px 0 0}.reference-shop-wallet{margin-top:11px;padding:7px 8px;border:1px solid #8b9275;background:#293e46;color:#efdab0;border-radius:5px;font-size:12px}.reference-shop-catalog{position:relative;min-width:0}.reference-shop-tabs{display:flex;gap:7px;margin-bottom:7px}.reference-shop-tabs button{flex:1;min-height:35px;font-size:14px;background:#1c3445;border:2px solid #788677;border-radius:4px}.reference-shop-tabs button.active{border-color:#dfcd88;background:linear-gradient(#3d5a69,#213e53);color:#f3deaa}.reference-shop-products{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;max-height:320px;overflow:auto;border:1px solid #657e7c;padding:5px;border-radius:5px}.reference-shop-product{display:flex;gap:7px;align-items:center;padding:7px;background:#2b4149;border:1px solid #5e7c76;border-radius:5px;min-height:78px}.reference-shop-product.selected{border-color:#e7d088;background:#475644}.reference-shop-product>span{font-size:29px;display:flex;align-items:center;justify-content:center;width:40px;height:45px;flex:none;background:#1c3036;border:2px solid #7a917f;border-radius:5px}.reference-shop-product>div{flex:1;min-width:0}.reference-shop-product b{font-size:12px;display:block;color:#efdeb3}.reference-shop-product small{font-size:11px;display:block;color:#f1d489;margin:3px 0}.reference-shop-product button{min-height:25px;padding:2px 8px;font-size:11px;float:right;border-radius:4px;background:#315060}.reference-shop-quantity{margin-top:8px;border:3px double #c1a578;border-radius:6px;background:linear-gradient(135deg,#365469,#1b3548);padding:9px;box-shadow:0 4px 12px #0005}.reference-shop-quantity h3{font-size:14px;color:#f2dda7;margin:0 0 5px}.reference-shop-quantity p{font-size:11px;line-height:1.45;margin:4px 0}.reference-shop-quantity>small{font-size:10px;color:#b5d1d5}.shop-quantity-controls{display:flex;align-items:center;justify-content:center;gap:9px;margin:7px 0}.shop-quantity-controls button{width:31px;min-height:29px;padding:0;font-size:20px}.shop-quantity-controls input{width:58px;min-height:29px;padding:4px;text-align:center;font-size:13px;background:#18354a}.reference-shop-quantity .shop-total-price{color:#ffe1a0;text-align:center;font-size:13px}.reference-shop-quantity>button{min-height:30px;padding:4px 10px;font-size:11px;margin-top:5px}.reference-shop-help{font-size:11px;color:#b1c7c8;padding:12px 5px}.reference-shop-footer{display:flex;justify-content:flex-end;margin-top:8px}.reference-shop-footer button{min-height:33px;padding:4px 15px;background:linear-gradient(#a45e46,#733b30);font-size:12px}
@media(max-width:850px){.reference-shop-layout{grid-template-columns:210px minmax(0,1fr);gap:7px;padding:7px}.reference-shop-merchant h3{font-size:16px}.reference-shop-scene{height:165px}.reference-shop-products{max-height:245px}.reference-shop-product{padding:5px;gap:5px;min-height:66px}.reference-shop-product>span{font-size:24px;width:32px;height:38px}.reference-shop-product b{font-size:10px}.reference-shop-product small{font-size:10px}.reference-shop-merchant>p{font-size:10px}.reference-shop-dialogue p{font-size:11px}.reference-shop-quantity{padding:6px}.reference-shop-tabs button{min-height:31px;font-size:12px}}@media(max-width:560px){.reference-shop-layout{grid-template-columns:150px minmax(0,1fr)}.reference-shop-products{grid-template-columns:1fr}.reference-shop-merchant h3{font-size:13px}.reference-shop-scene{height:145px}.reference-shop-dialogue>b{font-size:11px}.reference-shop-dialogue{padding:5px}.reference-shop-dialogue p{font-size:10px}.reference-shop-wallet{font-size:10px;padding:6px}.reference-shop-product b{font-size:11px}.reference-shop-quantity h3{font-size:12px}}


/* ตั๊บ 2026-10-13: ฉากสู้ — ซ่อนปุ่มขวาบน (หยุด/ความเร็ว/จัดการ์ด/กลับเมือง) · canvas คงสัดส่วน วางกลางกรอบ (ขนาดตั้งใน display.js) */
.rt-top>.row{display:none!important}
.rt-arena.scene{display:flex!important;align-items:center;justify-content:center}
.rt-arena canvas{flex:none!important;max-width:100%;max-height:100%;object-fit:fill!important;aspect-ratio:auto!important}

/* ตั๊บ 2026-10-13: ฉากสู้บนจอเตี้ย (มือถือแนวนอน) — ซ่อนประวัติรางวัล ให้ฉากกว้างเต็มแถว ลดแถบบน/แผงการ์ด */
@media (max-height:500px){
.rt-screen{grid-template-rows:30px minmax(0,1fr) 100px!important;gap:4px!important}
.rt-report{display:none!important}
.rt-arena.scene{grid-column:1/3!important}
.rt-top{padding:2px 8px!important}.rt-top h2{font-size:13px!important}
.rt-card-grid{height:70px!important}
.loot-panel{transform:scale(.72);transform-origin:center bottom}
}

/* ตั๊บ: ปุ่มกลับเมืองเฉพาะด่านฟาม (ใส่จาก display.js) */
.rt-top .rt-exit{min-height:40px;padding:6px 14px;white-space:nowrap;flex:none}
@media (max-height:500px){.rt-top .rt-exit{min-height:26px;padding:2px 10px;font-size:12px}}

/* ตั๊บ 2026-10-14: กระเป๋าเป็นช่องสี่เหลี่ยมขนาดคงที่แบบเกม MMO
   เดิมช่องใช้ aspect-ratio ตามความกว้างคอลัมน์ พอของเยอะจนต้องเลื่อน เบราว์เซอร์บีบทุกแถวให้พอดีกล่อง ช่องแบนซ้อนกัน
   ตอนนี้: ช่องกว้าง×สูงคงที่ (--slot) เรียงเต็มแถวตามความกว้างกล่อง แถวสูงเท่าช่องเสมอ เลื่อนลงดูได้ */
.rpg-window .reference-inventory-grid{--slot:60px;grid-template-columns:repeat(auto-fill,var(--slot));grid-auto-rows:var(--slot);justify-content:start;gap:5px}
.rpg-window .reference-inventory-cell{width:var(--slot);height:var(--slot);aspect-ratio:auto}
.rpg-window .reference-inventory-cell>b{font-size:30px;line-height:1}
.rpg-window .reference-inventory-cell>small{font-size:11px}
@media (max-width:760px),(max-height:500px){.rpg-window .reference-inventory-grid{--slot:48px;gap:4px}.rpg-window .reference-inventory-cell>b{font-size:24px}.rpg-window .reference-inventory-cell>small{font-size:9px}}
/* ลายประดับ ❖ มุมขวาบนทับปุ่มปิด → เอาออก (เหลือมุมซ้าย) · ปุ่มปิดอยู่บนสุดเสมอ */
.rpg-window:after{display:none}
.rpg-window .rpg-x{z-index:3}
/* ปุ่มลอยมุมซ้ายล่าง (🔊 เสียง, 🛠 ผู้พัฒนา) ซ่อนตอนเปิดหน้าต่าง ไม่ให้ทับเนื้อหา (จอมือถือ) */
#overlay:not(:empty) ~ #sndBtn,#overlay:not(:empty) ~ #sndPanel,#overlay:not(:empty) ~ #edBtn{display:none}
/* มือถือแนวนอน (จอเตี้ย): HUD เล็กลง ไม่บังฉาก ไม่ทับกัน · ชื่ออาณาจักรอยู่ที่แถบล่างแล้ว จึงซ่อนป้ายกลางบน */
@media (max-height:560px){
.world-hud{top:5px;left:5px;padding:3px 9px 3px 1px;gap:6px;font-size:11px;border-radius:30px 10px 10px 30px}
.world-hud .sprite-frame{width:50px!important;height:50px!important}.world-hud .sprite-frame img{width:50px!important;height:50px!important}
.world-hud small{font-size:9px}
.world-title{display:none}
.world-menu{top:5px;right:5px;gap:2px}
.world-menu button{min-width:36px;width:36px;height:36px;min-height:0;font-size:16px;padding:0}
.world-menu small{font-size:8px;line-height:1}
.mmo-mini-panel{top:48px;right:5px;width:150px;padding:2px}
.mmo-mini-panel canvas{width:144px;height:104px}
.mmo-mini-panel small{font-size:9px}
.world-bottom{bottom:4px;left:4px;right:4px;padding:4px 8px;font-size:10px}
#sndBtn,#edBtn{width:34px!important;height:34px!important;font-size:15px!important}
#sndBtn{bottom:84px!important}#edBtn{bottom:44px!important}
}

/* ตั๊บ 2026-10-15: ฉากสู้เต็มจอแบบ POP (พี่ส่งภาพตัวอย่าง) — ฉากคลุมทั้งจอ ซ่อนแผงล่าง/แถบบน · ปุ่มลอยบนฉาก (ย้ายจาก turn-battle.js)
   z-index 9 ต่ำกว่าหน้าต่าง .overlay (10) ผลการต่อสู้/จัดทีมจึงขึ้นทับฉากได้ */
.rt-screen.pop .rt-arena.scene{position:fixed!important;inset:0;z-index:9;border:0;border-radius:0;background:#0b1620;box-shadow:none}
.rt-screen.pop .rt-top,.rt-screen.pop .rt-bottom,.rt-screen.pop .rt-report{visibility:hidden}
.rt-arena .tb-title{position:absolute;top:10px;left:14px;margin:0;font-size:15px;color:#ffe9b0;text-shadow:0 2px 3px #000,0 0 6px #000;z-index:2;pointer-events:none}
.rt-arena .tb-hud{position:absolute;top:8px;right:10px;display:flex!important;gap:6px;z-index:2}
.rt-arena .tb-hud button{min-height:32px;padding:4px 10px;font-size:12px;border-radius:9px;background:#1d2c3bd9;border:1px solid #c6a876;color:#ffe9b0}
.rt-arena .tb-skip{position:absolute;right:16px;bottom:14px;z-index:2;min-height:38px;padding:6px 16px;border-radius:10px;font-weight:bold;color:#fff3cf;background:linear-gradient(#3d6a7d,#24475a);border:2px solid #9fd8e8;box-shadow:0 3px 8px #0008}
@media (max-height:500px){.rt-arena .tb-hud button{min-height:26px;padding:2px 7px;font-size:11px}.rt-arena .tb-skip{min-height:30px;padding:3px 10px;font-size:12px;bottom:8px}.rt-arena .tb-title{font-size:12px;top:6px}}
/* กล่องสั้น (พี่ 2026-10-22: ข้อความน้อยไม่ควรเป็นแถบยาว) */ .modal.modal-compact{width:auto!important;min-width:0!important;max-width:min(360px,92vw)!important;padding:14px 18px!important;text-align:center}.modal-compact h2{margin:0 0 4px;font-size:20px}.modal-compact p{margin:0 0 8px;opacity:.85}.modal-compact .row{justify-content:center;gap:8px;margin-top:8px!important}
