/* Approved compact MP tree, mobile only. PC layout is deliberately untouched. */
@media(max-width:700px){
 .mpt-shell{font-family:"DotGothic16","PixelMplus12","Noto Sans JP",sans-serif;padding:10px 5px 6px!important;color:#f6e9df;min-width:0;}
 .mpt-shell button{font-family:inherit;touch-action:manipulation;border-radius:0;box-shadow:none;}
 .mpt-branch-header{position:relative;display:flex;justify-content:space-between;align-items:end;gap:8px;margin:0 1px 6px;}
 .mpt-branch-header>div{display:grid;gap:2px;min-width:0;}
 .mpt-branch-header small{font:10px monospace;letter-spacing:.13em;color:#a992b0;}
 .mpt-branch-header strong{font-size:21px;color:#efcc92;line-height:1.35;font-weight:900;}
 .mpt-catalog{position:relative;flex:none;z-index:5;}
 .mpt-catalog>summary{display:grid;place-items:center;list-style:none;border:2px solid #cea568;background:#44314c;padding:6px 10px;min-height:44px;font-size:12px;color:#f2d49f;cursor:pointer;}
 .mpt-catalog>summary::-webkit-details-marker{display:none}
 .mpt-catalog-list{position:absolute;right:0;top:calc(100% + 4px);width:210px;max-height:60dvh;overflow:auto;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;padding:8px;background:#22172f;border:2px solid #c49a64;box-shadow:4px 4px #0c0810;}
 .mpt-catalog-list button{min-height:44px;background:#3a2948;border:1px solid #8a6684;color:#f3d8ac;font-size:12px;}
 .mpt-chips{display:flex;gap:5px;min-width:0;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;scrollbar-color:#82658c #281b35;padding:6px 0 5px;scroll-snap-type:x proximity;overscroll-behavior-x:contain;}
 .mpt-chip{flex:0 0 auto;display:flex;align-items:center;justify-content:center;gap:4px;min-width:44px;height:44px;padding:5px 7px;background:#2c2038;border:1px solid #786285;color:#e4d4e9;font-size:12px;font-weight:800;white-space:nowrap;scroll-snap-align:start;}
 .mpt-chip .pixel-branch-icon{width:15px;height:15px;min-width:15px;object-fit:contain;image-rendering:pixelated;}
 .mpt-chip.selected{border-color:#e9bf7a;background:#58405f;color:#ffdfa7;box-shadow:inset 0 -3px #ac8358;}
 .mpt-branch-desc{display:flex;justify-content:space-between;align-items:start;gap:7px;border-bottom:1px solid #70577d;padding:4px 0 9px;color:#cbb7d2;font-size:11px;}
 .mpt-branch-desc span:first-child{flex:1;}
 .mpt-branch-desc span:last-child{flex:none;padding:2px 5px;border:1px solid #745a7c;font-variant-numeric:tabular-nums;}
 .mpt-tree-picker{margin-top:7px;}
 .mpt-tree-picker-label{display:flex;justify-content:space-between;gap:8px;font-size:10px;color:#cdb8d7;}
 .mpt-tree-picker-label span:last-child{color:#e8c58d;}
 .mpt-tree-tabs{display:flex;gap:4px;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;padding:5px 0 2px;}
 .mpt-tree-tab{flex:0 0 auto;display:flex;flex-direction:column;justify-content:center;align-items:center;min-height:44px;min-width:44px;gap:0;padding:3px 6px;border:1px solid #7b6385;background:#2c2139;color:#ead8ee;font-size:12px;}
 .mpt-tree-tab small{font-size:11px;color:#cab2d5;}
 .mpt-tree-tab.selected{border:2px solid #e6bc7b;background:#584160;color:#ffe0b2;}
 .mpt-caption{font-size:10px;text-align:right;color:#d0b3db;margin:8px 2px 6px;}
 .mpt-tree-panel{border:1px solid #654b70;background:linear-gradient(#2c2238,#21182b);padding:0 5px 4px;}
 .mpt-tree-panel-head{display:flex;justify-content:space-between;align-items:center;min-height:28px;border-bottom:1px solid #5a4863;padding:5px 6px 3px;margin-bottom:3px;}
 .mpt-tree-panel-head strong{font-size:11px;color:#ebcf9b;}
 .mpt-tree-panel-head small{font-size:9px;color:#b7a0c3;}
 .mpt-graph-viewport{max-width:100%;width:100%;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;overscroll-behavior-x:contain;}
 .mpt-graph-canvas{position:relative;margin:0 auto;width:264px;min-width:264px;isolation:isolate;}
 .mpt-wires{position:absolute;left:0;top:0;width:264px;z-index:0;pointer-events:none;overflow:visible;}
 .mpt-wires path{fill:none;stroke:#75657f;stroke-width:3;stroke-linejoin:bevel;shape-rendering:crispEdges;}
 .mpt-wires path.lit{stroke:#d3ad6e;}
 .mpt-wires path.complete{stroke:#83b8a0;}
 .mpt-node{position:absolute;z-index:1;width:124px;height:48px;display:flex;flex-direction:column;justify-content:center;gap:2px;padding:2px 5px;border:2px solid #786580;background:#32243e;color:#f2e7ed;text-align:left;overflow:hidden;box-shadow:inset 0 0 0 2px #20182d,2px 2px 0 #120e1c!important;}
 .mpt-node:after{content:"";position:absolute;right:4px;top:4px;width:5px;height:5px;transform:rotate(45deg);background:#796786;}
 .mpt-node.state-owned{border-color:#7bb392;background:#273a39;}
 .mpt-node.state-owned:after{background:#a8e0b9;}
 .mpt-node.state-ready{border-color:#e0b575;background:#423044;}
 .mpt-node.state-ready:after{background:#f2cc87;}
 .mpt-node.state-locked{opacity:1;background:#32243e;}
 .mpt-node.state-insufficient{border-color:#95798c;background:#33263e;}
 .mpt-node.selected{outline:2px solid #f4cf93;outline-offset:2px;}
 .mpt-node.foreign:before{content:"↗";position:absolute;top:14px;right:5px;font-size:10px;color:#cdb0d7;}
 .mpt-node-name{font-size:11px;line-height:1.16;font-weight:900;min-height:0;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere;}
 .mpt-node-price{display:block;text-align:right;color:#e9c58c;font-size:10px;font-weight:800;line-height:1.1;white-space:nowrap;}
 .mpt-detail-layer{position:fixed;inset:0;z-index:200;display:block;}
 .mpt-detail-backdrop{position:fixed;inset:0;width:100%;height:100%;border:0!important;background:rgba(8,4,17,.78);z-index:0;}
 .mpt-detail-sheet.pixel-mobile-expanded{position:fixed;z-index:1;left:50%;bottom:0;transform:translateX(-50%);width:min(calc(100vw - 10px),470px);max-height:82dvh;overflow-y:auto;overscroll-behavior:contain;margin:0!important;padding:12px 14px calc(14px + env(safe-area-inset-bottom));border:3px solid #d0a168;border-bottom:0;background:#281c34;box-shadow:0 -10px 0 #0e0914,0 -22px 40px #05030c;display:flex;flex-direction:column;gap:9px;}
 .mpt-detail-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-bottom:8px;border-bottom:1px solid #72597b;color:#c9ab84;font-size:10px;letter-spacing:.13em;}
 .mpt-detail-close{width:44px;height:44px;border:1px solid #9e7a65!important;background:#453148;color:#f0d9ae;font-size:26px;line-height:1;}
 .mpt-detail-sheet .pixel-detail-seal{display:block;min-height:0;padding:0 0 5px;text-align:left;}
 .mpt-detail-sheet .pixel-detail-emblem,.mpt-detail-sheet .pixel-detail-caption{display:none;}
 .mpt-detail-sheet .pixel-detail-seal h3{font-size:19px;margin:0 0 6px;}
 .mpt-detail-sheet .pixel-detail-text{min-height:0;font-size:14px;}
 .mpt-detail-sheet .pixel-detail-bottom{margin:0;padding:0;}
 .mpt-detail-sheet .pixel-purchase{min-height:49px;}
 .mpt-shell :is(.mpt-node,.mpt-chip,.mpt-tree-tab,.mpt-detail-close,.mpt-catalog-list button):focus-visible{outline:3px solid #ffe4a1;outline-offset:2px;}
}
@media(min-width:701px){.mpt-shell{display:none!important;}}

/* MP tree localization: allow the real scroll owner to keep its position
   when a node is re-rendered, and let longer English labels wrap. */
html:has(.pixel-mp-page),#overlayRoot .pixel-gameover-modal:has(.pixel-tree-root){overflow-anchor:none}
.pixel-tree-root[data-tree-locale="en"] :is(.pixel-tree-title,.pixel-map-heading,.pixel-map-heading>div,.pixel-tree-dialogue>div,.pixel-node-copy){min-width:0;overflow-wrap:anywhere}
.pixel-tree-root[data-tree-locale="en"] .pixel-small-label{white-space:normal;overflow-wrap:anywhere}
.pixel-tree-root[data-tree-locale="en"] .pixel-branch span{min-width:0;white-space:normal;overflow-wrap:anywhere;line-height:1.2}
.pixel-tree-root[data-tree-locale="en"] .pixel-map-head{height:auto;min-height:65px;flex-wrap:wrap}
.pixel-tree-root[data-tree-locale="en"] .pixel-map-heading{flex:1 1 130px}
.pixel-tree-root[data-tree-locale="en"] .pixel-map-count{flex:0 0 auto;max-width:100%;white-space:normal}
.pixel-tree-root[data-tree-locale="en"] .pixel-map-legend{height:auto;min-height:42px;gap:5px 10px}
.pixel-tree-root[data-tree-locale="en"] .pixel-map-legend span{white-space:normal}
.pixel-tree-root[data-tree-locale="en"] .pixel-node{padding:5px;gap:5px}
.pixel-tree-root[data-tree-locale="en"] .pixel-node-jewel{width:27px;height:30px;font-size:19px}
.pixel-tree-root[data-tree-locale="en"] .pixel-node-copy strong{font-size:12px;line-height:1.1}
.pixel-tree-root[data-tree-locale="en"] .pixel-node-copy small{font-size:10px;line-height:1.1;margin-top:2px;overflow-wrap:anywhere}
.pixel-tree-root[data-tree-locale="en"] .pixel-cross-branch{font-size:9px;line-height:1.05;overflow-wrap:anywhere}
.pixel-tree-root[data-tree-locale="en"] :is(.pixel-detail-text,.pixel-detail-seal h3,.pixel-before,.pixel-after,.pixel-purchase,.pixel-req,.pixel-route-step,.pixel-hint){white-space:normal;overflow-wrap:anywhere}
@media(max-width:700px){
 .pixel-tree-root[data-tree-locale="en"] :is(.mpt-branch-header strong,.mpt-catalog-list button,.mpt-branch-desc span:first-child,.mpt-tree-panel-head strong){min-width:0;overflow-wrap:anywhere}
 .pixel-tree-root[data-tree-locale="en"] .mpt-catalog-list{max-width:calc(100vw - 36px)}
 .pixel-tree-root[data-tree-locale="en"] .mpt-tree-panel-head{gap:6px}
 .pixel-tree-root[data-tree-locale="en"] .mpt-node{height:66px}
 .pixel-tree-root[data-tree-locale="en"] .mpt-node-name{font-size:11px;line-height:1.15;padding-right:8px;display:block;overflow:visible;-webkit-line-clamp:unset;overflow-wrap:anywhere}
 .pixel-tree-root[data-tree-locale="en"] .mpt-node-price{flex-shrink:0}
}
