/* Dedicated phone layout. Desktop rules and game mechanics remain unchanged. */
.victor-mobile-nav,.victor-mobile-points,.mobile-restart,.mobile-clue-button,.mobile-care-button,.oil-value strong .mobile-light-max,#mobileSceneLevel,#mobileSceneXP{display:none}
@media (max-width:800px), (max-width:950px) and (max-height:500px) and (pointer:coarse){
 html:has(body.location-trial),html:fullscreen:has(body.location-trial){height:auto;min-height:100%;overflow-x:hidden;overflow-y:auto}
 body.location-trial{height:auto;min-height:100dvh;overflow:visible;display:block}
 body.location-trial>header{height:auto;min-height:44px;padding:4px 8px;gap:4px;flex-wrap:wrap;justify-content:space-between}
 body.location-trial>header .brand{font-size:0;letter-spacing:0;margin:0}
 body.location-trial>header .brand span{font-size:18px;margin:0 3px}
 body.location-trial>header .edition{display:none}
 body.location-trial>header button{min-width:36px;min-height:38px;padding:6px 7px;font-size:12px;line-height:1.15;flex-shrink:0}
 body.location-trial>header :is(.lab-help,#fullscreenButton,.monster-sound-toggle){font-size:0}
 body.location-trial>header .lab-help:after{content:'?';font-size:18px}
 body.location-trial>header #fullscreenButton:after{content:'⛶';font-size:17px}
 body.location-trial>header .character-button{display:block}
 body.location-trial.mobile-hud-ready>header .character-button{display:none}
 body.location-trial.mobile-hud-ready>header .mobile-restart{display:block;white-space:nowrap}
 body.location-trial .victor-clock{font-size:11px;padding:4px 12px}
 body.location-trial>main{display:block;max-width:720px;width:100%;height:auto;min-height:0;overflow:visible;padding:8px 10px max(16px,env(safe-area-inset-bottom));margin:auto!important}
 body.location-trial>main>aside{display:none}
 body.location-trial .play{display:flex;flex-direction:column;gap:8px;height:auto;min-height:0;overflow:visible}
 body.location-trial #routeProgress{height:auto;min-height:26px;gap:5px;margin:0;scrollbar-width:none;overflow-x:auto;overflow-y:hidden}
 body.location-trial #routeProgress>span{flex:0 0 auto;min-width:82px;max-width:132px;padding:3px 4px;font-size:11px;white-space:normal;line-height:1.2}
 body.location-trial .game-hud{display:grid;grid-template-columns:1fr;gap:5px}
 body.location-trial #stats.lab-clues-ready{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:3px}
 body.location-trial #stats .stat{padding:5px 2px;min-height:0;border-radius:6px;text-align:center}
 body.location-trial #stats .stat small{font-size:0;line-height:1;letter-spacing:0;margin:0 0 3px}
 body.location-trial #stats .stat small::after{font-size:.625rem;content:var(--mobile-stat-label) / ""}
 body.location-trial #stats .stat:nth-child(1){--mobile-stat-label:'♥ PF'}
 body.location-trial #stats .stat:nth-child(2){--mobile-stat-label:'ϟ EN'}
 body.location-trial #stats .stat:nth-child(3){--mobile-stat-label:'◈ PAU'}
 body.location-trial #stats .lab-poison-stat{--mobile-stat-label:'● VEL'}
 body.location-trial #stats .lab-rations-stat{--mobile-stat-label:'♨ RAZ'}
 body.location-trial #stats .lab-clue-stat{--mobile-stat-label:'⌕ IND';position:relative;min-height:44px;border-color:#cba664;background:#34301e}
 body.location-trial #stats .lab-clue-stat.lab-bronze-return-ready{border-color:#f1d39b;background:#ddb777;color:#251b0c}
 body.location-trial #stats .lab-bronze-return-ready :is(small,strong,strong span){color:inherit}
 body.location-trial #stats .mobile-clue-button{display:block;position:absolute;inset:0;width:100%;height:100%;min-height:0;padding:0;border:0;border-radius:inherit;background:transparent;touch-action:manipulation}
 body.location-trial #stats .mobile-clue-button:focus-visible{outline:2px solid #f6d69d;outline-offset:1px}
 body.location-trial #stats .mobile-care-stat{position:relative;min-height:44px;border-color:#a28b544f;background:#282c20}
 body.location-trial #stats .mobile-care-button{display:block;position:absolute;inset:0;width:100%;height:100%;min-height:0;padding:0;border:0;border-radius:inherit;background:transparent;touch-action:manipulation}
 body.location-trial #stats .mobile-care-button:focus-visible{outline:2px solid #f6d69d;outline-offset:1px}
 .mobile-care-panel{display:grid;gap:.625rem}
 .mobile-care-panel h2,.mobile-care-panel p{margin:0}
 .mobile-care-action{display:grid;grid-template-columns:44px minmax(0,1fr);align-items:start;gap:.5rem}
 .mobile-care-action>div{display:grid;gap:.25rem;min-width:0}
 .mobile-care-action .lab-loot-thumb,.mobile-care-symbol{box-sizing:border-box;width:44px;height:44px;border:1px solid #aa8f595e;border-radius:6px;object-fit:cover}
 .mobile-care-symbol{display:grid;place-items:center;background:#302a1c;color:#e5c181;font-size:1.5rem}
 .mobile-care-panel button{min-height:44px;padding:.5rem .75rem}
 .mobile-care-panel small{color:#cec7b6;font-size:.8125rem;line-height:1.35}
 body.location-trial #stats .stat strong{display:flex;align-items:baseline;justify-content:center;gap:1px;font-size:1.125rem;line-height:1;white-space:nowrap;font-variant-numeric:tabular-nums}
 body.location-trial #stats .stat strong span{font-size:.625rem}
 body.location-trial #stats .lab-mummy-curse{grid-column:1/-1;display:flex;justify-content:center;align-items:center;gap:6px}
 body.location-trial #stats .lab-mummy-curse small{font-size:.625rem;margin:0}
 body.location-trial #stats .lab-mummy-curse strong{font-size:.875rem}
 body.location-trial.mobile-hud-ready .game-hud #lantern{display:none}
 .victor-mobile-nav{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px}
 .victor-mobile-nav button{min-width:0;min-height:44px;padding:4px 2px;font-size:.6875rem;line-height:1.15;overflow-wrap:anywhere;color:#e8d5ae;border-color:#baa36b55;background:#25281e}
 .victor-mobile-nav :is(.mobile-nav-counter,.mobile-light-button){display:grid;place-content:center;gap:2px;text-align:center}
 .mobile-nav-counter strong{font-size:.8125rem;font-variant-numeric:tabular-nums}
 .mobile-bottle-status{padding:4px 2px;border:1px solid #baa36b55;border-radius:6px;color:#e8d5ae;background:#25281e;font-size:.6875rem;line-height:1.15;overflow-wrap:anywhere}
 .victor-mobile-nav .mobile-light-button{color:#ffdea3;background:#302819;border-color:#d6aa686b}
 .mobile-light-button strong{font-size:.875rem;line-height:1.1;font-variant-numeric:tabular-nums}
 .victor-mobile-nav .mobile-light-out{color:#e9dfc8;background:#27251f;border-color:#9e9072}
 body.location-trial .game-stage{flex:none;min-height:0;height:auto;max-height:none;overflow:visible;gap:8px}
 body.location-trial:not(.battle-focused):not(.puzzle-open) .scene-space{display:block;flex:none;width:100%;height:auto;min-height:0!important;overflow:hidden}
 body.location-trial:not(.battle-focused):not(.puzzle-open) #scene{width:100%!important;height:auto!important;max-width:100%;flex:none}
 body.location-trial.mobile-points-ready:not(.battle-focused):not(.puzzle-open) #scene:has(#sceneMotionButton[hidden]){aspect-ratio:auto!important}
 body.location-trial.mobile-points-ready #scene:has(#sceneMotionButton[hidden])>img#art{display:block;position:relative;inset:auto;width:100%;height:auto}
 body.location-trial #locationCaption h2{font-size:23px;margin:2px 0 4px}
 body.location-trial #locationCaption p{display:block;font-size:13px;line-height:1.45;margin:3px 0}
 body.location-trial .scene-top:has(#mobileSceneLevel:not(:empty)) :is(#depth,#stateTag){display:none}
 body.location-trial .scene-top :is(#mobileSceneLevel,#mobileSceneXP):not(:empty){display:inline-block;font-size:10px}
 body.location-trial .scene-top #mobileSceneXP{background:#151b13ed;color:#f8dfaf;font-weight:700;font-variant-numeric:tabular-nums}
 /* Compact touch targets in their original positions; labels appear only after selection. */
 body.location-trial.mobile-points-ready #hotspots button.scene-label:not(.lab-merchant-spot){
  display:grid!important;place-items:center;min-width:44px!important;width:44px!important;max-width:44px!important;min-height:44px!important;height:44px!important;
  padding:0!important;border:0!important;border-radius:50%;background:transparent!important;box-shadow:none!important;font-size:0!important;line-height:0;
  transform:translate(-50%,-50%)!important;touch-action:manipulation;z-index:4;
 }
 body.location-trial.mobile-points-ready #hotspots button.scene-label:not(.lab-merchant-spot)>span{display:none!important}
 body.location-trial.mobile-points-ready #hotspots button.scene-label:not(.lab-merchant-spot)::before{
  content:'';display:block;width:34px;height:34px;border-radius:50%;background:url('assets/ui/search-lens.svg') center/contain no-repeat;
  filter:drop-shadow(0 0 5px #edba6470);pointer-events:none;
 }
 body.location-trial.mobile-points-ready #hotspots button.scene-label:not(.lab-merchant-spot).mobile-lens-selected::before{
  outline:2px solid #ffe3a2;outline-offset:2px;filter:drop-shadow(0 0 8px #f4c77c);
 }
 body.location-trial.mobile-points-ready #hotspots button.scene-label:not(.lab-merchant-spot):disabled::before{
  content:'✓';background:#20281ee8;border:1px solid #a2b09288;color:#a8bb98;display:grid;place-items:center;font-size:20px;filter:none;opacity:.72;
 }
 .victor-mobile-points:not([hidden]){display:grid;grid-template-columns:minmax(0,1fr) auto 40px;align-items:center;gap:6px;padding:8px;border:1px solid #dcb57380;border-radius:8px;background:#22281e}
 .victor-mobile-points strong{font-size:13px;line-height:1.35;color:#f4dfb3;overflow-wrap:anywhere}
 .victor-mobile-points button{min-height:44px;min-width:0;padding:8px;font-size:13px;line-height:1.25}
 .victor-mobile-points button:disabled{opacity:.55}
 body.location-trial .console,body.location-trial.battle-focused .console,body.location-trial.puzzle-open .console{flex:none;min-height:0;height:auto;max-height:none;overflow:visible;width:100%;padding:10px;border-radius:10px}
 body.location-trial.battle-focused #combatData,body.location-trial.puzzle-open #combatData{flex:none;min-height:0;height:auto;max-height:none;overflow:visible;display:flex;flex-direction:column;gap:5px}
 body.location-trial #message{max-height:none;overflow:visible;min-height:0;font-size:13px;line-height:1.45;overflow-wrap:anywhere}
 body.location-trial.battle-focused .battle-title h2{font-size:22px;line-height:1.2;margin:3px 0 7px}
 body.location-trial.battle-focused .battle-opponents{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto auto;gap:6px 10px;align-items:start;margin:0 auto 6px}
 body.location-trial.battle-focused .hero-combatant{grid-column:1;grid-row:1/3;min-width:0;align-self:start;padding:8px 4px;border:1px solid #bca16a45;border-radius:8px;background:#141a13b8}
 body.location-trial.battle-focused .enemy-portrait{grid-column:2;grid-row:1;justify-self:center;align-self:center;margin:0;width:74px;height:74px;max-width:100%}
 body.location-trial.battle-focused .enemy-portrait:is(.lab-group,.mill-group){width:100%;min-height:0;height:auto;max-width:128px}
 body.location-trial.battle-focused .battle-opponents>.lab-loot-combat,body.location-trial.battle-focused .battle-opponents>.lab-loot-cleared{grid-column:2;grid-row:1;justify-self:center;align-self:center}
 body.location-trial.battle-focused .enemy-combatant{grid-column:2;grid-row:2;min-width:0;padding:0 3px 4px}
 body.location-trial.battle-focused .combatant-name{font-size:20px;line-height:1.15;overflow-wrap:anywhere}
 body.location-trial.battle-focused .battle-attributes{display:block;font-size:12px;line-height:1.25;margin:4px 0}
 body.location-trial.battle-focused .combatant-life{font-size:23px;line-height:1.1;margin:4px 0}
 body.location-trial.battle-focused .combatant-life small{font-size:10px}
 body.location-trial.battle-focused .battle-health{margin:5px auto;width:90%}
 body.location-trial.battle-focused .battle-gear{width:100%;max-width:100%;gap:5px;margin:5px 0 0;justify-content:center}
 body.location-trial.battle-focused .gear-slot{width:38px}
 body.location-trial.battle-focused .gear-picture{height:38px}
 body.location-trial.battle-focused .gear-values>strong{font-size:12px}
 body.location-trial.battle-focused .battle-rolls{width:100%;grid-template-columns:minmax(0,1fr) 34px minmax(0,1fr);gap:4px;margin:4px auto}
 body.location-trial.battle-focused .roll-equation{font-size:13px;line-height:1.5;overflow-wrap:anywhere}
 body.location-trial.battle-focused .roll-equation small{font-size:10px}
 body.location-trial.battle-focused .roll-equation b{font-size:23px}
 body.location-trial.battle-focused .roll-winner .roll-equation b{font-size:28px}
 body.location-trial.battle-focused .poly-die{width:52px;height:62px}
 body.location-trial.battle-focused .poly-die svg{width:52px;height:52px}
 body.location-trial.battle-focused .battle-outcome{margin:6px 0;padding:8px 5px}
 body.location-trial.battle-focused .battle-outcome strong{font-size:20px}
 body.location-trial.battle-focused #battleRecap .battle-outcome span{font-size:13px;line-height:1.45}
 body.location-trial .actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;max-width:100%;width:100%;margin:8px 0 0}
 body.location-trial .actions button{min-width:0;min-height:48px;max-width:100%;padding:10px 7px;font-size:14px;line-height:1.25;white-space:normal;overflow-wrap:anywhere}
 body.location-trial .actions button.primary{grid-column:1/-1}
 body.location-trial .actions small{font-size:11px;line-height:1.35}
 body.location-trial .actions> :not(button){grid-column:1/-1;min-width:0;max-width:100%}
 body.location-trial .trail{display:none}
 body.location-trial dialog{max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);padding:16px;overflow:auto;overscroll-behavior:contain}
}

@media (max-width:800px), (max-width:950px) and (max-height:500px) and (pointer:coarse){
 #combatData .mobile-monster-rule{display:none!important}
 body.location-trial #message.mobile-initial-notice{display:none!important}
 #combatData.mobile-monster-compact .lab-monster-powers:not(:has(.lab-regen-result)){display:none}
 #combatData.mobile-monster-compact .lab-monster-powers>.eyebrow,
 #combatData.mobile-monster-compact .lab-monster-powers>.lab-power-icons{display:none}
 #combatData .mobile-monster-target{position:relative;cursor:pointer;touch-action:manipulation;outline:1px solid #dcb57380;outline-offset:2px}
 #combatData .mobile-monster-target::after{content:'i';position:absolute;right:0;bottom:0;display:grid;place-items:center;width:22px;height:22px;border:1px solid #e0b875;border-radius:50%;background:#272c20;color:#f5d69c;font:bold 15px Georgia,serif;text-shadow:0 1px 2px #000;pointer-events:none}
 body.location-trial .mobile-monster-dialog{width:min(440px,calc(100vw - 20px));max-height:calc(100dvh - 24px);padding:16px;background:#22281e;border:1px solid #c39e626f;border-radius:12px;color:#eeeadd;overflow:auto}
 .mobile-monster-dialog::backdrop{background:#070a06c8}
 .mobile-monster-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
 .mobile-monster-heading h2{font:26px Georgia,serif;margin:0;color:#eac991}
 .mobile-monster-heading button{min-width:44px;min-height:44px;padding:8px}
 .mobile-monster-section{padding:10px 0;border-top:1px solid #bca16b45}
 .mobile-monster-section h3{margin:0 0 7px;font:18px Georgia,serif;color:#e9c88c}
 .mobile-monster-section p{font-size:14px;line-height:1.45;margin:4px 0}
 .mobile-monster-section .mobile-monster-critical{font-size:20px;font-weight:bold;color:#f0c77c}
 .mobile-monster-power{display:flex;gap:10px;align-items:flex-start;margin:9px 0}
 .mobile-monster-power img{width:48px;height:48px;object-fit:cover;flex-shrink:0}
 .mobile-monster-power small{color:#c6c3b1}
 .mobile-monster-dialog>button{width:100%;margin-top:8px;min-height:44px}
}
