/* PLI Mobile Portrait. Desktop selectors and camera remain in the original files. */
#mobile-lower[hidden],#mobile-pause-tools,#mobile-look-label{display:none}
body[data-presentation=desktop] #orientation-guide{display:none!important}
body.mobile-portrait{--mobile-deck:112px;--mobile-hud-gap:12px;-webkit-tap-highlight-color:transparent}
body.mobile-portrait header{height:calc(54px + var(--safe-top) + var(--mobile-hud-gap));padding:calc(var(--safe-top) + var(--mobile-hud-gap)) calc(20px + var(--safe-right)) 0 calc(20px + var(--safe-left));gap:8px}
body.mobile-portrait .brand{font-size:22px;letter-spacing:.08em;flex:none}
body.mobile-portrait .brand::before{width:15px;height:20px;margin-right:8px}
body.mobile-portrait .brand i,body.mobile-portrait #chapter-count,body.mobile-portrait #sound{display:none}
body.mobile-portrait .header-right{gap:5px;margin-left:auto}
body.mobile-portrait .header-right #wallet{font-size:12px;margin-right:6px}
body.mobile-portrait .header-right #help,body.mobile-portrait .header-right #map-back{min-height:44px;min-width:44px;height:44px;padding:8px;font-size:11px}
body.mobile-portrait .chapter{top:calc(61px + var(--safe-top) + var(--mobile-hud-gap));left:calc(20px + var(--safe-left));right:calc(20px + var(--safe-right));max-width:none;width:auto}
body.mobile-portrait .chapter .eyebrow{font-size:9px;letter-spacing:.09em;line-height:1.5;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.mobile-portrait .chapter h2{font-size:18px;line-height:1.25;margin:3px 0 0;max-width:calc(100% - 86px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.mobile-portrait #fragments{position:absolute;right:0;bottom:3px;gap:6px;margin:0;max-width:82px;flex-wrap:wrap;justify-content:flex-end}
body.mobile-portrait #fragments span{width:7px;height:7px}
body.mobile-portrait .chapter p,body.mobile-portrait .dimension,body.mobile-portrait .chapter-dots{display:none}
body.mobile-portrait #boss-phase{top:var(--chapter-bottom);left:calc(20px + var(--safe-left));right:calc(20px + var(--safe-right));max-width:none;line-height:1.4;font-size:10px;max-height:30px;overflow:hidden}
body.mobile-portrait.on-map #world-travel{top:var(--chapter-bottom);left:calc(20px + var(--safe-left));right:calc(20px + var(--safe-right));max-width:none;width:auto;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
body.mobile-portrait.on-map #world-travel .world-name{display:none}
body.mobile-portrait.on-map #world-travel button{height:44px;font-size:13px;padding:6px;min-width:0}
body.mobile-portrait.on-map #blue-status{top:calc(81px + var(--safe-top) + var(--mobile-hud-gap));right:calc(20px + var(--safe-right));left:auto;bottom:auto;width:80px;font-size:0;text-align:right}
body.mobile-portrait:not(.on-map) #blue-status{display:none}
body.mobile-portrait #mobile-lower{display:flex;position:absolute;left:max(16px,var(--safe-left));right:max(16px,var(--safe-right));bottom:calc(10px + var(--safe-bottom));flex-direction:column;gap:9px;pointer-events:none}
body.mobile-portrait #mobile-caption{min-height:40px;width:100%;display:flex;align-items:flex-end;justify-content:center}
body.mobile-portrait #mobile-caption #message,body.mobile-portrait #mobile-caption #tutorial,body.mobile-portrait #mobile-caption #mechanic-note{position:static;inset:auto;transform:none;max-width:100%;width:100%;margin:0;padding:10px 13px;border:1px solid #bfd6ce22;border-radius:10px;background:#102630eb;line-height:1.5;font-size:12px;letter-spacing:0;white-space:normal;overflow-wrap:anywhere;text-align:left;max-height:76px;overflow:hidden}
body.mobile-portrait #mobile-caption #message:not(.visible){display:none}
body.mobile-portrait.in-prologue #mobile-caption #message,body.mobile-portrait.in-prologue #mobile-caption #mechanic-note{display:none}
body.mobile-portrait #mobile-caption:has(#message.visible) #mechanic-note{display:none}
body.mobile-portrait #mobile-context{display:none;gap:7px;align-items:stretch;justify-content:flex-end;flex-wrap:wrap;pointer-events:auto}
body.mobile-portrait #mobile-context:has(button:not([hidden])){display:flex}
body.mobile-portrait #mobile-context #mechanic-actions{display:contents;position:static;inset:auto;transform:none;width:auto;max-width:none}
body.mobile-portrait #mobile-context #mechanic-actions[hidden]{display:none}
body.mobile-portrait #mobile-context button{position:static!important;inset:auto!important;transform:none!important;min-height:44px;min-width:44px;width:auto;max-width:100%;margin:0;padding:10px 12px;font-size:12px;line-height:1.4;flex:1 1 130px;pointer-events:auto}
body.mobile-portrait #mobile-context kbd,body.mobile-portrait #mobile-context small{display:none}
body.mobile-portrait #mobile-lower>.bottom{position:relative;inset:auto;transform:none;width:100%;height:var(--mobile-deck);display:flex;align-items:flex-end;justify-content:space-between;gap:12px;pointer-events:none}
body.mobile-portrait .bottom .move-tip,body.mobile-portrait .bottom #hint,body.mobile-portrait .bottom #reset-position,body.mobile-portrait .bottom #rotate-left{display:none}
body.mobile-portrait .bottom .mobile-navigation{display:grid;grid-template-columns:repeat(3,48px);grid-template-rows:repeat(2,48px);gap:6px;flex:none;order:0;pointer-events:none}
body.mobile-portrait .mobile-navigation [data-direction=ArrowUp]{grid-column:2;grid-row:1}
body.mobile-portrait .mobile-navigation [data-direction=ArrowLeft]{grid-column:1;grid-row:2}
body.mobile-portrait .mobile-navigation [data-direction=ArrowDown]{grid-column:2;grid-row:2}
body.mobile-portrait .mobile-navigation [data-direction=ArrowRight]{grid-column:3;grid-row:2}
body.mobile-portrait .bottom .mobile-navigation button{height:48px;width:48px;min-width:48px;min-height:48px;font-size:23px;border-radius:12px;background:#102630c9;pointer-events:auto;touch-action:none}
body.mobile-portrait .bottom .controls{position:static;inset:auto;transform:none;display:flex;flex-direction:column;width:130px;gap:8px;border:0;background:none;box-shadow:none;padding:0;order:1;pointer-events:none}
body.mobile-portrait .bottom .controls button,body.mobile-portrait .bottom .controls #fold{width:100%;min-width:44px;min-height:48px;height:48px;margin:0;padding:8px 12px;justify-content:center;border:1px solid #bfd6ce33;border-radius:12px;background:#102630dd;pointer-events:auto;touch-action:none}
body.mobile-portrait .bottom .controls #fold{height:54px;color:var(--gold);border-color:#dfbe8855}
body.mobile-portrait .bottom .controls b{font-size:12px;letter-spacing:.02em}
body.mobile-portrait .bottom .controls kbd{display:none}
body.mobile-portrait #mobile-look-label{display:inline}
body.mobile-portrait .is-held:not(:disabled),body.mobile-portrait button:active:not(:disabled){background:#25434b!important;border-color:#dfbe88aa!important;box-shadow:inset 0 0 14px #dfbe8815;scale:.96}
body.mobile-portrait #mobile-pause-tools{display:flex}
body.mobile-portrait #notification-zone,body.mobile-portrait.on-map #notification-zone{top:var(--mobile-hud-end,120px);right:max(18px,var(--safe-right));left:auto;width:min(280px,calc(100% - 36px));gap:6px}
body.mobile-portrait #notification-zone #achievement-toast{padding:9px 12px}
body.mobile-portrait #notification-zone #achievement-toast strong{font-size:12px;line-height:1.4}
body.mobile-portrait #notification-zone #achievement-toast small{font-size:8px}
body.mobile-portrait:has(#intro:not([hidden])) #notification-zone{top:calc(62px + var(--safe-top) + var(--mobile-hud-gap));left:max(18px,var(--safe-left));right:max(18px,var(--safe-right));width:auto;max-width:none}
body.mobile-portrait #intro{background:linear-gradient(180deg,#0b1b2540,#0b1b25c9 48%,#0b1b25ee)}
body.mobile-portrait #intro .intro-content{inset:calc(82px + var(--safe-top)) max(24px,var(--safe-right)) calc(14px + var(--safe-bottom)) max(24px,var(--safe-left));width:auto;max-width:480px;margin:0 auto;height:auto;max-height:none;transform:none;overflow:hidden;display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:clamp(12px,3vh,30px);padding:0;text-align:center}
body.mobile-portrait #intro .intro-identity,body.mobile-portrait #intro .intro-actions{display:block;align-self:stretch;min-width:0}
body.mobile-portrait #intro .intro-content .eyebrow{font-size:8px;letter-spacing:.1em}
body.mobile-portrait #intro .intro-content h1{font-size:clamp(84px,16vh,150px);line-height:.96;margin:8px 0 10px}
body.mobile-portrait #intro .intro-content .subtitle{font-size:19px;margin:8px 0}
body.mobile-portrait #intro .intro-copy{display:none}
body.mobile-portrait #intro #start,body.mobile-portrait #intro #resume{width:100%;min-height:48px;margin:0 0 8px;padding:12px 18px;font-size:13px;justify-content:space-between}
body.mobile-portrait #intro .intro-actions:has(#resume:not([hidden])){display:flex;flex-direction:column}
body.mobile-portrait #intro #resume{order:-1}
body.mobile-portrait #intro .menu-nav{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin:8px 0 0}
body.mobile-portrait #intro .menu-nav button{grid-column:auto!important;min-height:46px;padding:9px 12px;font-size:11px;gap:8px;justify-content:flex-start}
body.mobile-portrait #intro .meta{display:none}
body.mobile-portrait #intro .pli-version{min-height:44px;align-self:center;margin:0;padding:10px;font-size:10px}
body.mobile-portrait .intro-caption{display:none}
body.mobile-portrait .workshop{padding:calc(70px + var(--safe-top)) max(18px,var(--safe-right)) calc(18px + var(--safe-bottom)) max(18px,var(--safe-left))}
body.mobile-portrait .workshop .workshop-card{width:100%;max-width:560px;max-height:100%;overflow:auto;padding:0 2px 18px}
body.mobile-portrait .workshop #workshop-title{font-size:28px;line-height:1.2;margin:10px 0 18px}
body.mobile-portrait .workshop #close-workshop{top:calc(10px + var(--safe-top));right:max(18px,var(--safe-right));min-height:44px}
body.mobile-portrait #workshop-nav{gap:6px;flex-wrap:wrap}
body.mobile-portrait #workshop-nav button{min-height:44px;padding:8px 10px;font-size:11px}
body.mobile-portrait .option-grid,body.mobile-portrait .character-layout,body.mobile-portrait .world-list,body.mobile-portrait .achievement-list{grid-template-columns:minmax(0,1fr);gap:12px}
body.mobile-portrait .character-list{grid-template-columns:repeat(2,minmax(0,1fr))}
body.mobile-portrait .presence-preview{min-width:0;position:static}
body.mobile-portrait .achievement-filters{flex-wrap:wrap;gap:6px}
body.mobile-portrait .achievement-filters button{min-height:44px}
body.mobile-portrait .help-panel{padding:calc(30px + var(--safe-top)) max(18px,var(--safe-right)) calc(24px + var(--safe-bottom)) max(18px,var(--safe-left));background:#091923a6}
body.mobile-portrait .help-card{width:100%;max-width:480px;max-height:100%;padding:22px 18px;overflow:auto}
body.mobile-portrait .help-card h2{font-size:28px;margin:14px 0}
body.mobile-portrait .help-card button{min-height:44px}
body.mobile-portrait #dev-badge{top:calc(8px + var(--safe-top) + var(--mobile-hud-gap));left:calc(max(16px,var(--safe-left)) + 80px);min-width:44px;min-height:40px;font-size:9px;padding:6px}
body.mobile-portrait #orientation-guide{display:none}
body.mobile-portrait #viewport-readout{bottom:calc(160px + var(--safe-bottom));max-width:calc(100vw - 28px);font-size:9px}
@media(max-height:740px) and (orientation:portrait){
 body.mobile-portrait #intro .intro-content{top:calc(64px + var(--safe-top));gap:8px}
 body.mobile-portrait #intro .intro-content h1{font-size:84px;margin:4px 0}
 body.mobile-portrait #intro .intro-content .subtitle{font-size:16px;margin:5px 0}
 body.mobile-portrait #intro .menu-nav button{min-height:44px;padding:6px 10px}
}
@media(orientation:landscape) and (max-height:560px){
 body.mobile-portrait #orientation-guide{position:fixed;inset:0;z-index:40;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:32px;background:#101e28;text-align:center;font-size:16px}
 body.mobile-portrait #orientation-guide span{font-size:42px;color:var(--gold)}
}
/* Stable puzzle dock. All transient content overlays a permanently reserved band. */
body.mobile-portrait{--mobile-deck:96px}
body.mobile-portrait #mobile-lower{height:var(--mobile-deck);display:block}
body.mobile-portrait #mobile-lower>.bottom{height:100%;align-items:stretch}
body.mobile-portrait #mobile-caption{position:absolute;left:52px;right:0;bottom:104px;height:44px;min-height:0;width:auto;display:grid;grid-template-columns:minmax(0,1fr);justify-content:stretch;align-items:stretch;pointer-events:none}
body.mobile-portrait #mobile-caption #message,body.mobile-portrait #mobile-caption #tutorial,body.mobile-portrait #mobile-caption #mechanic-note{grid-area:1/1;justify-self:end;width:fit-content;min-width:min(112px,100%);max-width:100%;margin:0;height:44px;max-height:44px;min-height:0;padding:6px 12px;box-sizing:border-box;font-size:11px;line-height:15px;background:#102630bf;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
body.mobile-portrait #mobile-caption [hidden],body.mobile-portrait #mobile-caption #message:not(.visible),body.mobile-portrait #mobile-caption:has(#tutorial:not([hidden])) #mechanic-note{display:none}
body.mobile-portrait #mobile-recenter{position:absolute;left:0;bottom:104px;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border:1px solid #bfd6ce22;background:#10263080;border-radius:12px;font-size:24px;color:var(--gold);pointer-events:auto;touch-action:none}
body.mobile-portrait .bottom .mobile-navigation{grid-template-columns:repeat(3,44px);grid-template-rows:repeat(2,44px);gap:6px;align-self:end}
body.mobile-portrait .bottom .mobile-navigation button{width:44px;height:44px;min-width:44px;min-height:44px;font-size:21px}
body.mobile-portrait .bottom .controls{width:148px;height:44px;display:grid;grid-template-columns:1fr 1fr;gap:6px;align-self:start}
body.mobile-portrait .bottom .controls button,body.mobile-portrait .bottom .controls #fold{width:100%;min-width:44px;height:44px;min-height:44px;padding:5px 3px;gap:3px}
body.mobile-portrait .bottom .controls b{font-size:10px;letter-spacing:0}
body.mobile-portrait .bottom .controls span{font-size:16px}
body.mobile-portrait #mobile-context{position:absolute;right:0;bottom:0;width:148px;height:44px;gap:4px;flex-wrap:nowrap;z-index:1}
body.mobile-portrait #mobile-context button{height:44px;min-height:44px;min-width:44px;max-width:100%;flex:0 1 auto;width:max-content;padding:6px 12px;font-size:10px;line-height:14px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal;overflow-wrap:anywhere}

#mobile-message-review{display:none}
body.mobile-portrait #mobile-message-review{display:block}
body.mobile-portrait #mobile-message-review summary{min-height:44px;padding:12px 0;cursor:pointer}
body.mobile-portrait #mobile-message-review p{font-size:12px;line-height:1.65;white-space:normal;overflow-wrap:anywhere}
body.mobile-portrait #mobile-caption{pointer-events:auto;cursor:pointer}
body.mobile-portrait #mobile-caption.is-condensed #message,body.mobile-portrait #mobile-caption.is-condensed #tutorial,body.mobile-portrait #mobile-caption.is-condensed #mechanic-note{-webkit-line-clamp:1;opacity:.7;transition:opacity .2s}

body.mobile-portrait #mobile-caption:not(.has-text){pointer-events:none}
