#home{display:none!important}main:not([data-journey="combat"])>.arena,main:not([data-journey="combat"])>.hud,main:not([data-journey="combat"])>.route-row,main:not([data-journey="combat"])>.speed-control,main:not([data-journey="combat"])>#inspect{visibility:hidden}#journeyUI{position:absolute;inset:0;z-index:20}#journeyUI[hidden]{display:none}.j-world{height:100%;position:relative;overflow:auto;background:linear-gradient(0deg,#0c201dcf,transparent 70%),url('assets/valley.webp') center/cover;color:#fff0cd}.j-world button:where(:not(.ui-btn,.ui-chip,.ui-tile)){box-shadow:0 3px 0 #0e211d,0 6px 15px #0003}.j-world h1{font-size:clamp(26px,3.5vw,48px);margin:5px 0 14px;text-shadow:0 2px 0 #352a1c}.j-world h2{margin:6px 0;font-size:23px}.j-world p{line-height:1.7}.j-world small{color:#dcc797;line-height:1.6}.j-parchment{padding:30px}.j-centered{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:min(530px,90%);text-align:center}.j-centered .j-primary{width:100%;margin-top:20px}.j-notice{font-size:12px;line-height:1.8;background:var(--paper-row);border:2px solid #c9ab6a;border-radius:var(--r-md);padding:14px;color:var(--ink-2)}.j-link{display:block;margin:10px auto 0}.j-title{position:absolute;top:24%;left:12%;width:55%;z-index:2}.j-title h1{font-size:clamp(58px,8vw,112px);color:#ffe5a4;margin:0;line-height:1.2}.j-title h2{font-size:clamp(25px,3vw,42px);margin:16px 0}.j-title small{letter-spacing:3px}.j-title .j-primary{margin-top:18px}.j-caption{position:absolute;bottom:25px;width:100%;text-align:center;font-size:12px}.j-hero{width:190px;height:216px;background:url('assets/hero-sheet.webp') 0 0/400% 200% no-repeat;filter:drop-shadow(0 12px 8px #0005)}.j-hero.moon{filter:hue-rotate(58deg) drop-shadow(0 12px 8px #0005)}.j-hero.ember{filter:hue-rotate(280deg) drop-shadow(0 12px 8px #0005)}.j-landing-hero{position:absolute;left:65%;top:53%;transform:scale(1.6);transform-origin:center bottom}.j-create-preview{position:absolute;top:40%;left:15%;transform:scale(1.6)}.j-create-form{left:65%;text-align:left}.j-create-form label{display:block;margin-top:18px}.j-create-form input{display:block;width:100%;color:var(--ink);background:var(--paper-0);border:2px solid #8a5410;border-radius:var(--r-sm);padding:12px;margin-top:8px}.j-colors{display:flex;gap:8px}.j-colors button{flex:1;padding:8px;font-size:12px}.j-coins{padding:9px 18px;border:2px solid #ae955e;background:#20372f;border-radius:5px;white-space:nowrap;color:#f4d389}.j-top{height:100px;padding:22px 30px;display:flex;align-items:center;gap:20px;background:linear-gradient(#0e231fe8,#0e231f85,transparent);position:relative;z-index:2}.j-top h1{font-size:25px;margin:0}.j-top small{font-size:11px}.j-top .j-coins{margin-left:auto}.j-back{min-width:120px}.j-map{position:absolute;left:2%;top:16%;bottom:10%;width:62%;background:linear-gradient(150deg,#365d4355,#d8c48c25);border:2px solid #d2ba7780;border-radius:45% 20% 35% 22%;box-shadow:inset 0 0 70px #132f27aa}.j-map svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}.j-map path{fill:none;stroke:#ffe0a4;stroke-width:.7;stroke-dasharray:2 2}.j-marker{position:absolute;left:var(--x);top:var(--y);transform:translate(-50%,-50%);width:155px;background:#1a342cf2;border-color:#b9a272;border-radius:8px;text-align:center;padding:12px}.j-marker span{display:block;font-size:26px;color:#f4cb77}.j-marker b,.j-marker small{display:block}.j-marker small{font-size:10px}.j-marker.selected{outline:3px solid #f6dd98;outline-offset:4px;background:#385347}.j-route{position:absolute;right:4%;top:20%;width:30%;max-height:75%;overflow:auto}.j-route .j-primary{width:100%;margin:18px 0 10px}.j-route>small:last-child{display:block;font-size:11px}.j-route-info{display:grid;font-size:12px;gap:8px;margin:20px 0}.j-showcase{display:flex;align-items:center;gap:8px;font-size:12px}.j-showcase input{width:20px;height:20px}.j-gear-body{display:grid;grid-template-columns:1fr 360px;gap:20px;padding:0 30px 25px;max-width:1150px;margin:auto}.j-paperdoll{height:360px;position:relative;display:flex;align-items:center;justify-content:center;background:radial-gradient(ellipse,#e8d5a250,transparent 65%)}.j-paperdoll>.j-hero{transform:scale(1.45);margin-top:20px}.j-slots{position:absolute;left:0;right:0;bottom:0;display:flex;justify-content:center;gap:8px}.j-slot{width:145px;text-align:center;background:#17342bf5;border-color:var(--tier,#b6975b)}.j-slot>span{font-size:23px;display:block;color:#f3d99e}.j-slot>small,.j-slot>b{display:block;font-size:11px}.j-item-detail{grid-column:2;grid-row:1/3;padding:25px;align-self:start}.j-item-detail h2{font-size:23px}.j-item-detail h3{font-size:14px;margin-bottom:8px}.j-item-detail p{font-size:13px}.j-item-detail>.j-primary{width:100%;margin-top:18px}.j-item-glyph{display:block;font-size:48px;color:var(--tier);margin-bottom:8px}.j-item-stats,.j-comparison{display:grid;gap:7px;font-size:12px}.j-item-stats>span,.j-comparison>span{display:flex;justify-content:space-between}.j-item-stats b{color:#bfe2b7}.j-bag h3{margin:8px 0;font-size:16px}.j-bag h3 small{font-size:12px}.j-bag-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px;max-height:250px;overflow:auto;padding:5px}.j-bag-item{text-align:center;min-height:110px;background:#17362ded;border-color:var(--tier)}.j-bag-item span{display:block;font-size:28px;color:var(--tier)}.j-bag-item b,.j-bag-item small{display:block;font-size:11px}.j-bag-item.selected{outline:2px solid #ffe9ac;outline-offset:2px}.j-journal{width:min(750px,92%);margin:15px auto 30px}.j-journal article{border-bottom:1px solid #a991574d;padding:15px 0}.j-journal article p{margin:7px 0;font-size:13px}.j-result{position:relative;width:min(620px,90%);margin:7vh auto;text-align:center}.j-result h1{color:#ffe3a0}.j-result h2{font-size:19px}.j-rewards{display:flex;gap:12px;justify-content:center;background:#132c23;padding:20px;margin:20px 0}.j-rewards b{font-size:26px;color:#f8d584}.j-result-loot{font-size:13px}.j-result-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;margin-top:20px}.j-save-warning{position:fixed;z-index:100;bottom:0;left:0;right:0;background:#753922;color:#fff2d5;padding:10px;text-align:center;font-size:12px}
@media(max-width:650px){.j-title{top:15%;left:8%;width:84%;text-align:center}.j-title h1{font-size:68px}.j-title h2{font-size:28px}.j-title p{font-size:12px}.j-title small{font-size:10px;letter-spacing:2px}.j-landing-hero{left:calc(50% - 95px);top:auto;bottom:14%;transform:scale(1.2)}.j-caption{bottom:3%;padding:0 25px;font-size:11px}.j-parchment{padding:22px}.j-create-preview{left:calc(50% - 95px);top:4%;transform:scale(.85)}.j-create-form{top:auto;bottom:5%;left:50%;transform:translateX(-50%)}.j-create-form h1{font-size:24px}.j-create-form p{font-size:12px}.j-create-form label{margin-top:8px}.j-top{padding:12px;height:88px;gap:10px}.j-top h1{font-size:18px}.j-top small{font-size:9px}.j-back{min-width:44px;width:82px;font-size:11px;padding:6px}.j-top .j-coins{padding:7px;font-size:11px}.map{min-height:680px}.j-map{position:relative;top:auto;bottom:auto;left:4%;width:92%;height:340px;margin-top:4px}.j-marker{width:117px;padding:9px 4px}.j-marker b{font-size:12px}.j-marker small{font-size:9px}.j-marker span{font-size:22px}.j-route{position:relative;top:auto;right:auto;width:92%;margin:24px auto;max-height:none;padding:20px}.j-route h2{font-size:23px}.j-route p{font-size:12px;margin:8px 0}.j-route-info{margin:14px 0;gap:5px}.j-gear-body{grid-template-columns:1fr;gap:12px;padding:0 12px 25px}.j-paperdoll{height:285px}.j-paperdoll>.j-hero{transform:scale(1);margin-top:-50px}.j-slot{width:30%;padding:7px 4px}.j-slot b{font-size:10px}.j-item-detail{grid-column:1;grid-row:auto;padding:20px}.j-item-glyph{float:left;margin-right:18px;font-size:40px}.j-item-detail h2{font-size:20px}.j-item-stats{clear:both}.j-bag{grid-row:2}.j-bag-grid{grid-template-columns:repeat(3,1fr);max-height:220px}.j-bag-item{padding:7px 4px;min-height:96px}.j-result{margin:4vh auto;width:94%}.j-result h1{font-size:28px}.j-result-actions button{width:100%}.j-rewards{padding:15px;gap:10px;font-size:12px}}
@media(max-height:600px) and (min-width:651px){.j-title{top:12%}.j-title h1{font-size:70px}.j-landing-hero{top:40%;transform:scale(1.1)}.j-route{top:100px;max-height:calc(100% - 115px);padding:20px}.j-map{top:105px;bottom:5%}.j-create-preview{transform:scale(1)}.j-top{height:85px}.j-result{margin:20px auto}.j-paperdoll{height:270px}.j-paperdoll>.j-hero{transform:scale(1.05)}}
/* Keep sprite cells square and both Home actors on one world ground. */
.j-hero{height:190px}.j-world.home{--home-ground:34%}.j-top>div{min-width:0}.j-route>small:first-child:after{content:' · หนึ่งเส้นทางต่อพื้นที่'}.j-world.guest{display:flex;align-items:center;padding:30px 0;min-height:100%}.guest .j-centered{position:relative;top:auto;left:auto;transform:none;margin:auto}.j-world.create{display:flex;align-items:center;justify-content:space-evenly;gap:20px;padding:30px}.j-create-preview{position:relative;top:auto;left:auto;transform:scale(1.4);flex:0 0 190px}.j-create-form{position:relative;top:auto;left:auto;bottom:auto;transform:none;width:min(530px,55%)}
@media(max-width:650px){.j-world.home{--home-ground:38%;min-height:680px}.j-world.create{flex-direction:column;justify-content:flex-start;gap:5px;padding:15px 0 30px}.j-create-preview{flex:0 0 190px;transform:scale(.9)}.j-create-form{width:92%}.j-top{gap:8px}.j-top h1{font-size:16px;white-space:normal}.j-top small{display:none}.j-top .j-coins{font-size:10px;padding:6px}.j-back{width:70px;min-width:70px;font-size:10px}.j-centered h1{font-size:25px}}

/* V9: fixed game screens. Long collections are paged by journey-ui.js. */
#journeyUI{overflow:hidden}
.j-hero,.j-hero.moon,.j-hero.ember{background:none;filter:drop-shadow(0 10px 7px #0006)}
.j-equipped-hero{display:block;width:100%;height:100%;object-fit:contain}
.j-world{height:100%;min-height:0;overflow:hidden}
.j-world *{min-width:0}
.j-world button:where(:not(.ui-btn,.ui-chip,.ui-tile)){min-height:44px}


.j-parchment{min-height:0}
.j-top{height:72px;padding:10px 22px}
.j-top h1{font-size:22px}
.j-route{top:88px;bottom:16px;max-height:none;overflow:hidden;padding:18px;display:flex;flex-direction:column;gap:5px}
.j-route h2,.j-route p{margin:0}
.j-route p{font-size:14px;line-height:1.55}
.j-route-info{margin:9px 0;gap:5px;font-size:13px}
.j-route>small:last-child{font-size:12px}
.j-route .j-primary{margin:auto 0 4px;flex:none}
.j-map{top:90px;bottom:18px}
.j-gear-body{height:calc(100% - 72px);max-width:1240px;padding:0 20px 16px;grid-template-columns:minmax(0,1fr) minmax(330px,39%);gap:18px;align-items:stretch}
.j-paperdoll{height:100%;min-height:0}
.j-paperdoll>.j-hero{transform:scale(1.5);margin-top:-25px}
.j-slots{bottom:12px}
.j-slot{width:min(30%,150px);padding:6px 5px}
.j-slot b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.j-bag{min-height:0;display:flex;flex-direction:column;background:#17352dd9;border:2px solid #b6975b;border-radius:8px;padding:10px}
.j-bag h3{flex:none;margin:0 0 7px}
.j-bag-grid{flex:1;min-height:0;max-height:none;overflow:hidden;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(4,minmax(0,1fr));align-content:stretch;gap:6px;padding:3px}
.j-bag-item{height:100%;min-height:44px;padding:4px;display:flex;flex-direction:column;align-items:center;justify-content:center}
.j-bag-item span{font-size:clamp(18px,2vw,27px);line-height:1.1}
.j-bag-item b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.j-pagination{flex:none;min-height:44px;display:flex;align-items:center;justify-content:center;gap:8px;margin-top:6px}
.j-pagination button{min-width:44px;min-height:44px;padding:5px 10px}
.j-pagination span{font-size:12px;white-space:nowrap;text-align:center}
.j-modal-overlay{position:fixed;inset:0;z-index:60;display:grid;place-items:center;background:#071611c9;padding:calc(12px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left))}
.j-modal-overlay[hidden]{display:none}
.j-item-dialog{position:relative;width:min(490px,100%);max-height:100%;overflow:hidden;display:flex;flex-direction:column;gap:7px;padding:18px 20px 16px;text-align:left}
.j-item-dialog h2{margin:0;padding-right:43px;font-size:22px;line-height:1.25}
.j-item-dialog>small{padding-right:43px}
.j-item-dialog>.j-item-glyph{height:45px;margin:0;font-size:40px;line-height:1}
.j-modal-close{position:absolute;right:12px;top:12px;width:44px;height:44px;padding:4px;z-index:1}
.j-detail-tabs{display:flex;gap:7px;flex:none}
.j-detail-tabs button{flex:1;padding:5px 8px}
.j-detail-tabs [aria-selected=true],.j-detail-tabs [aria-pressed=true]{background:#d8bb82;color:#34291e}
.j-modal-content{flex:1;min-height:0;overflow:hidden;font-size:14px;line-height:1.45}
.j-modal-content p{font-size:14px;line-height:1.5;margin:5px 0}
.j-item-dialog>.j-primary{width:100%;flex:none;margin:2px 0 0}
.j-item-stats,.j-comparison{gap:4px;font-size:13px}
.j-journal{height:calc(100% - 92px);width:min(850px,94%);margin:10px auto;overflow:hidden;display:flex;flex-direction:column;padding:14px 20px}
.j-journal article{flex:1;min-height:0;padding:6px 0;overflow:hidden}
.j-journal article p{margin:3px 0;line-height:1.4}
.j-journal .j-pagination{margin-top:auto}
.j-result{height:calc(100% - 32px);max-height:700px;width:min(680px,94%);margin:16px auto;overflow:hidden;display:flex;flex-direction:column;gap:5px;padding:20px}
.j-result h1,.j-result h2,.j-result p{margin:0}
.j-result h1{font-size:clamp(24px,3vw,36px)}
.j-result h2{font-size:17px}
.j-rewards{margin:4px 0;padding:10px;flex:none}
.j-result-loot{min-height:0;flex:1;display:flex;flex-direction:column;justify-content:center}
.j-result-loot p{margin:3px 0}
.j-result .j-pagination{margin:0}
.j-result .j-notice{padding:7px 10px;font-size:11px;line-height:1.5;flex:none}
.j-result-actions{margin:4px 0 0;gap:6px;flex:none}
.j-result-actions button{flex:1;min-width:0}
.j-world.guest{height:100%;min-height:0;padding:12px}
.guest .j-centered{max-height:100%;overflow:hidden;padding:18px}
.j-world.create{height:100%;padding:12px 24px}
.j-create-preview{transform:scale(1.15)}
.j-create-form{max-height:100%;overflow:hidden;padding:18px 22px}
.j-create-form h1{margin:0;font-size:30px}
.j-create-form label{margin-top:8px}
.j-create-form input{min-height:44px;margin-top:4px}
.j-create-form p{margin:6px 0}
.j-centered.j-create-form .j-primary{margin-top:9px}
.j-colors button{padding:5px}
.j-create-form .j-link{margin:4px auto 0}

/* Tall portrait: an illustrated upper stage and a fixed lower command sheet. */
@media (max-width:650px) and (orientation:portrait){
  .j-top{height:48px;padding:4px 10px;gap:8px}
  .j-top h1{font-size:16px}
  .j-back{width:70px;min-width:70px;padding:4px;font-size:10px}
  .j-top .j-coins{padding:6px;font-size:10px}
  .j-world.home{min-height:0;--home-ground:38%}
  .j-world.map{display:grid;grid-template-rows:48px minmax(0,1fr) minmax(0,0.95fr);min-height:0}
  .j-map{position:relative;inset:auto;width:calc(100% - 20px);height:auto;min-height:0;margin:4px 10px 0}
  .j-marker{width:clamp(82px,28vw,108px);padding:5px 3px}
  .j-marker span{font-size:18px}
  .j-marker b{font-size:11px}
  .j-marker small{font-size:9px;line-height:1.1}
  .j-route{position:relative;inset:auto;width:calc(100% - 20px);height:calc(100% - 12px);max-height:none;margin:8px 10px 4px;padding:10px 13px;gap:3px}
  .j-route h2{font-size:19px}
  .j-route p{font-size:11px;line-height:1.4}
  .j-route-info{margin:5px 0;gap:2px;font-size:10px}
  .j-route .j-primary{margin:auto 0 2px}
  .j-route>small:last-child{font-size:10px;line-height:1.3}
  .j-showcase{font-size:11px;min-height:30px}
  .j-gear-body{height:calc(100% - 48px);padding:0 10px 8px;grid-template-columns:1fr;grid-template-rows:minmax(0,46%) minmax(0,54%);gap:5px}
  .j-paperdoll{height:100%}
  .j-paperdoll>.j-hero{transform:scale(1.05);margin-top:-30px}
  .j-slots{bottom:3px;gap:5px}
  .j-slot{width:31%;min-height:58px;padding:3px}
  .j-slot>span{font-size:17px;line-height:1}
  .j-slot>small,.j-slot>b{font-size:10px;line-height:1.2}
  .j-bag{padding:7px}
  .j-bag-grid{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:5px}
  .j-bag-item{min-height:44px}
  .j-bag-item span{font-size:22px}
  .j-journal{height:calc(100% - 58px);margin:5px auto;padding:8px 12px}
  .j-journal article{padding:4px 0}
  .j-journal article p{font-size:11px}
  .j-journal article small{font-size:10px}
  .j-result{height:calc(100% - 16px);margin:8px auto;padding:12px;width:calc(100% - 16px);gap:3px}
  .j-result h1{font-size:25px}
  .j-result h2{font-size:16px}
  .j-result>p{font-size:11px}
  .j-rewards{padding:7px;margin:2px 0}
  .j-rewards b{font-size:20px}
  .j-result-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
  .j-result-actions .j-primary{grid-column:1/-1}
  .j-result-actions button:not(.ui-btn){width:100%;font-size:11px}
  .j-world.create{flex-direction:column;justify-content:flex-start;gap:4px;padding:8px}
  .j-create-preview{flex:0 0 min(29%,215px);width:190px;transform:scale(.95)}
  .j-create-form{width:100%;flex:1;padding:12px 16px}
  .j-create-form h1{font-size:24px}
  .j-create-form .j-primary{font-size:14px}
  .j-world.guest{padding:8px}
  .guest .j-centered{width:100%;padding:14px}
}

/* Short portrait: four bag items and reduced scene; never shrink the controls. */
@media (max-width:360px) and (max-height:620px) and (orientation:portrait){
  .j-title{top:12%}
  .j-title .j-primary{position:fixed;left:calc(50vw - 106px);bottom:calc(54px + env(safe-area-inset-bottom));width:212px;margin:0;z-index:3}
  .j-landing-hero{bottom:20%;transform:scale(.82)}
  .j-top{height:40px;padding:2px 6px}
  .j-top h1{font-size:14px}
  .j-top .j-coins{font-size:9px}
  .j-world.home{--home-ground:42%}
  .j-world.map{grid-template-rows:40px 190px minmax(0,1fr)}
  .j-map{margin-top:2px}
  .j-marker{width:79px;padding:3px 2px}
  .j-marker span{font-size:16px}
  .j-marker b{font-size:10px}
  .j-marker small{display:none}
  .j-route{padding:8px 11px;gap:2px}
  .j-route h2{font-size:16px}
  .j-route p{font-size:10px}
  .j-route-info{font-size:11px;margin:2px 0}
  .j-route>small:last-child{font-size:11px}
  .j-gear-body{height:calc(100% - 40px);grid-template-rows:190px minmax(0,1fr);padding:0 6px 6px}
  .j-paperdoll>.j-hero{transform:scale(.72);margin-top:-34px}
  .j-slot{min-height:53px}
  .j-slot>span{font-size:15px}
  .j-slot>small,.j-slot>b{font-size:11px}
  .j-bag-grid{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr))}
  .j-bag-item span{font-size:19px}
  .j-bag-item b,.j-bag-item small{font-size:10px}
  .j-result{padding:8px 10px;gap:2px}
  .j-result h1{font-size:21px}
  .j-result h2{font-size:14px}
  .j-result .j-notice{font-size:11px;padding:5px;line-height:1.35}
  .j-rewards{padding:4px}
  .j-rewards b{font-size:17px}
  .j-result-loot{font-size:10px}
  .j-result-actions button:not(.ui-btn){font-size:10px;padding:4px}
  .j-create-preview{flex-basis:130px;transform:translateY(14px) scale(.7)}
  .j-create-form{padding:8px 10px}
  .j-create-form h1{font-size:21px}
  .j-create-form label{margin-top:3px;font-size:11px}
  .j-create-form input{padding:5px;margin-top:2px}
  .j-create-form p{font-size:11px;line-height:1.3;margin:4px 0}
  .j-colors{gap:4px}
  .j-colors button{font-size:11px;padding:3px}
  .j-centered.j-create-form .j-primary{margin-top:5px;font-size:12px}
  .j-create-form .j-link{margin:0 auto;font-size:11px}
  .j-journal{height:calc(100% - 48px)}
}

/* Landscape phones use a scene and a control rail instead of a vertical stack. */
@media (orientation:landscape) and (max-height:600px){
  .j-top{height:40px;padding:3px 10px}
  .j-top h1{font-size:16px}
  .j-top small{display:none}
  .j-back{min-width:80px;padding:4px;font-size:11px}
  .j-top .j-coins{padding:5px 9px;font-size:11px}
  .j-title{top:13%;left:7%;width:52%}
  .j-title h1{font-size:clamp(42px,8vw,70px)}
  .j-title h2{font-size:24px;margin:4px 0}
  .j-title p{margin:4px 0}
  .j-landing-hero{left:68%;top:30%;transform:scale(.95)}
  .j-caption{bottom:8px}
  .j-world.guest{padding:6px}
  .guest .j-centered{width:min(600px,96%);padding:8px 14px}
  .guest .j-centered h1{font-size:21px;margin:2px}
  .guest .j-centered p{margin:2px}
  .guest .j-notice{padding:5px;line-height:1.35}
  .guest .j-centered .j-primary{margin-top:5px}
  .j-world.create{padding:6px 14px;gap:8px}
  .j-create-preview{flex-basis:36%;transform:scale(.9)}
  .j-create-form{width:60%;padding:8px 12px}
  .j-create-form h1{font-size:21px}
  .j-create-form label{margin-top:2px;font-size:11px}
  .j-create-form input{padding:4px}
  .j-create-form p{font-size:10px;line-height:1.25;margin:2px 0}
  .j-centered.j-create-form .j-primary{margin-top:4px}
  .j-create-form .j-link{margin:0 auto}
  .j-map{top:45px;left:1%;width:56%;bottom:5px}
  .j-route{top:45px;right:1%;width:41%;bottom:5px;padding:7px 10px;gap:2px}
  .j-route h2{font-size:17px}
  .j-route p{font-size:10px;line-height:1.25}
  .j-route-info{margin:2px 0;gap:1px;font-size:11px}
  .j-route>small:last-child{font-size:11px;line-height:1.2}
  .j-route .j-primary{font-size:12px;padding:4px;min-height:44px}
  .j-marker{width:100px;padding:4px}
  .j-marker span{font-size:18px}
  .j-marker b{font-size:10px}
  .j-marker small{display:none}
  .j-gear-body{height:calc(100% - 40px);grid-template-columns:minmax(0,56%) minmax(0,44%);padding:0 6px 5px;gap:6px}
  .j-paperdoll>.j-hero{transform:scale(1.1);margin-top:-20px}
  .j-slots{bottom:2px;gap:4px}
  .j-slot{width:31%;min-height:53px;padding:3px}
  .j-slot>span{font-size:17px}
  .j-slot>small,.j-slot>b{font-size:11px;line-height:1.15}
  .j-bag{padding:5px}
  .j-bag h3{font-size:13px;margin:0 0 3px}
  .j-bag-grid{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:4px}
  .j-bag-item span{font-size:20px}
  .j-bag-item b,.j-bag-item small{font-size:10px}
  .j-journal{height:calc(100% - 48px);margin:4px auto;padding:5px 10px}
  .j-journal article{padding:2px 0}
  .j-journal article p,.j-journal article small{font-size:10px;line-height:1.2}
  .j-result{height:calc(100% - 12px);width:min(730px,98%);margin:6px auto;padding:7px 12px;gap:1px}
  .j-result h1{font-size:19px}
  .j-result h2{font-size:13px}
  .j-result>p{font-size:10px}
  .j-rewards{padding:4px;margin:0;font-size:11px}
  .j-rewards b{font-size:16px}
  .j-result-loot{font-size:10px}
  .j-result .j-notice{padding:3px 5px;font-size:11px;line-height:1.2}
  .j-result-actions{margin:0;gap:4px}
  .j-result-actions button:not(.ui-btn){font-size:10px;padding:4px;min-height:44px}
  .j-result .j-pagination{min-height:44px;margin:0}
  .j-item-dialog{width:min(520px,92vw);padding:8px 12px;gap:3px}
  .j-item-dialog>.j-item-glyph{height:29px;font-size:28px}
  .j-item-dialog h2{font-size:17px}
  .j-modal-close{top:6px;right:6px}
  .j-modal-content,.j-modal-content p{font-size:10px;line-height:1.25}
  .j-detail-tabs button{min-height:44px;font-size:11px}
}

@media (max-width:360px) and (max-height:620px) and (orientation:portrait){
  .j-item-dialog{padding:8px 10px;gap:3px}
  .j-item-dialog>.j-item-glyph{height:30px;font-size:28px}
  .j-item-dialog h2{font-size:18px}
  .j-modal-content,.j-modal-content p{font-size:10px;line-height:1.3}
  .j-detail-tabs button{font-size:10px}
}

/* The visual viewport contracts when the on-screen keyboard opens. */
@media (max-width:650px){
  .j-world.create:focus-within .j-create-preview{display:none}
  .j-world.create:focus-within{justify-content:center}
  .j-world.create:focus-within .j-create-form{flex:none;width:min(100%,530px)}
}
/* Journal entries keep a readable density even when the page is nearly empty. */
.j-journal article{flex:none;padding:12px 0}
@media(max-width:650px){.j-journal article{padding:8px 0}}
@media(max-height:600px) and (orientation:landscape){.j-journal article{padding:5px 0}}
.j-equipped-hero{animation:j-breathe 3s ease-in-out infinite;transform-origin:50% 90%}
@keyframes j-breathe{50%{transform:translateY(-1px) scaleY(1.008)}}
@media(prefers-reduced-motion:reduce){.j-equipped-hero{animation:none}}.j-item-dialog h2{overflow-wrap:anywhere}
/* V12 nine slots and immediate signed comparison. */
.j-slots{inset:15% 4% 10%;display:grid;grid-template-columns:68px 1fr 68px;grid-template-rows:repeat(5,minmax(44px,1fr));gap:5px;pointer-events:none}
.j-slot{width:100%;height:100%;min-height:44px;padding:3px;pointer-events:auto;display:flex;flex-direction:column;justify-content:center;align-items:center}
.j-slot:nth-child(-n+5){grid-column:1}.j-slot:nth-child(n+6){grid-column:3}.j-slot:nth-child(6){grid-row:1}.j-slot:nth-child(7){grid-row:2}.j-slot:nth-child(8){grid-row:3}.j-slot:nth-child(9){grid-row:4}
.j-slot>span{font-size:24px;line-height:1}.j-slot>small{font-size:10px;line-height:1.2}.j-slot-tabs{position:absolute;bottom:110px;left:0;right:0;display:flex;justify-content:center;gap:5px}.j-slot-tabs button{font-size:10px;padding:4px}
.j-compare-title{font-size:13px;margin:8px 0 3px;line-height:1.4}.j-comparison{display:grid;gap:3px;margin:4px 0}.j-compare-row{display:grid;grid-template-columns:1.1fr 1fr .7fr;align-items:center;font-size:12px;padding:4px 6px;border-bottom:1px solid #405443}.j-compare-row b{text-align:center}.j-compare-row strong{text-align:right}
.j-gain{color:#8ce3ad}.j-loss{color:#ff9e8e}.j-same{color:#a9b7a6}.j-targets{display:flex;gap:6px;margin:5px 0}.j-targets button{flex:1;font-size:12px;padding:5px}.j-targets [aria-pressed=true]{background:#183f36;color:#fff0c3;outline:2px solid #d7b578}
.j-item-dialog .j-item-stats{margin:4px 0}
.j-catalog{height:calc(100% - 92px);margin:6px 18px;display:flex;flex-direction:column;gap:6px;padding:12px;overflow:hidden}.j-catalog nav{display:flex;gap:6px}.j-catalog nav button{flex:1}.j-catalog [aria-pressed=true]{background:#163c31;color:#fff0bd}.j-catalog-note{margin:2px 0;font-size:12px}.j-catalog-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));gap:8px;min-height:0;flex:1}.j-catalog article{display:flex;gap:9px;border:1px solid #a68f56;padding:9px;min-height:0;overflow:hidden}.j-catalog-icon{width:46px;flex:none;font-size:30px}.j-catalog h3{font-size:15px;margin:3px 0}.j-catalog p{font-size:12px;line-height:1.4;margin:3px 0}.j-catalog small{font-size:10px}
@media(max-width:650px) and (orientation:portrait){
.j-slots{inset:auto 5% 3px;height:150px;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);gap:4px;pointer-events:auto}.j-slot:nth-child(n){grid-column:auto;grid-row:auto}.j-slot>span{font-size:19px}.j-paperdoll>.j-hero{height:calc(100% - 150px);min-height:70px;margin:0 auto;transform:none;width:180px}.j-gear-body{grid-template-rows:minmax(0,53%) minmax(0,47%)}
.j-catalog{height:calc(100% - 58px);margin:4px 8px;padding:8px}.j-catalog-grid{grid-template-columns:1fr;grid-template-rows:repeat(3,minmax(0,1fr))}.j-catalog p{font-size:11px}.j-catalog-icon{width:36px}
}
@media(max-width:360px) and (max-height:650px) and (orientation:portrait){
.j-gear-body{height:calc(100% - 40px);grid-template-rows:245px minmax(0,1fr)}.j-slots{height:104px;grid-template-rows:repeat(2,1fr)}.j-paperdoll>.j-hero{height:97px;min-height:0;width:150px}.j-slot-tabs{bottom:110px}.j-catalog{height:calc(100% - 50px)}.j-catalog-grid{grid-template-rows:repeat(2,minmax(0,1fr))}.j-item-dialog{gap:3px;padding:10px}.j-compare-row{font-size:10px;padding:3px}.j-item-dialog .j-compare-title{font-size:11px}
}
@media(orientation:landscape) and (max-height:600px){
.j-slots{inset:auto 2% 0;height:148px;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr)}.j-slot:nth-child(n){grid-column:auto;grid-row:auto}.j-slot>span{font-size:17px}.j-slot>small{font-size:10px}.j-paperdoll>.j-hero{height:calc(100% - 148px);width:170px;transform:none;margin:0 auto}.j-gear-body{grid-template-columns:45% 55%}.j-catalog{height:calc(100% - 49px);margin:3px 9px;padding:6px}.j-catalog-grid{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:1fr}.j-catalog p{font-size:11px}.j-item-dialog{width:min(560px,95vw)}.j-item-dialog .j-modal-content p,.j-item-dialog .j-modal-content small{font-size:10px;line-height:1.2}.j-item-dialog .j-item-stats{font-size:10px;margin:1px 0}.j-compare-row{font-size:10px;padding:2px}.j-compare-title{font-size:11px;margin:3px 0}.j-targets{margin:1px 0}.j-targets button{min-height:44px}
}
@media(max-width:650px) and (orientation:portrait){.j-paperdoll>.j-hero{position:absolute;top:0;left:50%;transform:translateX(-50%);margin:0}}
@media(orientation:landscape) and (max-height:600px){.j-paperdoll>.j-hero{position:absolute;top:0;left:50%;transform:translateX(-50%);margin:0}}

canvas.j-equipped-hero{animation:none}

@media(orientation:landscape) and (max-height:600px){.j-catalog-grid{grid-template-rows:repeat(2,minmax(0,1fr))}.j-catalog article{padding:5px;gap:6px}.j-catalog h3{font-size:13px;margin:1px 0}.j-catalog p{font-size:10px;line-height:1.25;margin:2px 0}.j-catalog small{font-size:9px}.j-catalog-icon{width:32px}.j-catalog-note{font-size:10px}}
@media(orientation:landscape) and (max-height:600px){.j-catalog article>div{line-height:1.1}.j-catalog article small{display:block;line-height:1.1}.j-catalog article h3{line-height:1.15;margin:1px 0}.j-catalog article p{line-height:1.15;margin:1px 0;font-size:10px}}
