/* Atlas 36.2 — Owner-reviewed Leonida phone map clarity and footer flow.
 * Scoped to GTA VI; preserve Story/Online and actual licensing attribution. */

/* Layout: on narrow screens the map sits above a fully flowing sidebar.
 * The universal sharing footer must come AFTER the complete explorer,
 * never across filters because the parent had a fixed viewport height. */
@media(max-width:820px){
 body[data-start-world="6"] .shell{
  display:flex!important;flex-direction:column!important;
  height:auto!important;min-height:0!important;overflow:visible!important;
  max-height:none!important;align-items:stretch!important;
 }
 body[data-start-world="6"] .sidebar:not(.mobile-collapsed){
  order:2!important;position:relative!important;
  height:auto!important;min-height:0!important;max-height:none!important;
  overflow:visible!important;flex:0 0 auto!important;
 }
 body[data-start-world="6"] .map-wrap{
  order:1!important;flex:0 0 auto!important;
  height:77dvh!important;min-height:530px!important;
 }
 body[data-start-world="6"] .j133-universal-footer{
  position:relative!important;clear:both!important;
  height:auto!important;min-height:0!important;
  margin:26px 0 0!important;z-index:1;
 }
}

/* Keep GTADB legal credit visible and direct readers to the source register.
 * The small strip avoids a fourth overlapping widget inside the map. */
body[data-start-world="6"] .credits-line{
 left:0!important;right:0!important;bottom:0!important;
 max-width:100%!important;min-height:28px!important;
 display:flex;align-items:center;justify-content:center;gap:.35em;
 flex-wrap:wrap;padding:6px 8px!important;z-index:12;
 text-align:center;font:10px/1.35 system-ui,-apple-system,sans-serif!important;
 background:#160d27ec!important;color:#efdde8!important;
}
body[data-start-world="6"] .credits-line a{color:#f5d39d!important;text-decoration:underline}

/* No empty WebGL canvas if there are no real terrain samples. This perspective
 * is intentionally and explicitly labelled a 2D preview, not 3D relief. */
body[data-start-world="6"].jura-in-3d.jura-perspective-fallback #atlasCanvas{
 visibility:visible!important;pointer-events:auto!important;opacity:1!important;
 transform:perspective(1150px) rotateX(13deg) scale(1.045)!important;
 transform-origin:50% 53%!important;
 filter:saturate(1.12) contrast(1.02)!important;
}
body[data-start-world="6"].jura-in-3d.jura-perspective-fallback #jura3dCanvas,
body[data-start-world="6"].jura-in-3d.jura-perspective-fallback #jura3dMarkerOverlay{
 display:none!important;visibility:hidden!important;
}
body[data-start-world="6"] .j362-terrain-notice{
 position:absolute;left:50%;bottom:clamp(182px,25%,260px);
 transform:translateX(-50%);z-index:48;
 box-sizing:border-box;width:min(390px,calc(100% - 24px));
 border:1px solid #f7c582;border-radius:15px;padding:12px 13px;
 background:linear-gradient(145deg,#29163deF,#142b38f3);
 box-shadow:0 13px 30px #0009;
 color:#fff1d4;font:12px/1.42 system-ui,-apple-system,sans-serif;
}
body[data-start-world="6"] .j362-terrain-notice[hidden]{display:none!important}
body[data-start-world="6"] .j362-terrain-notice strong{
 display:block;color:#ffe2a8;font-size:14px;letter-spacing:.025em;
}
body[data-start-world="6"] .j362-terrain-notice p{margin:6px 0 9px;color:#e7ddeb}
body[data-start-world="6"] .j362-terrain-actions{display:flex;flex-wrap:wrap;gap:7px}
body[data-start-world="6"] .j362-terrain-actions button{
 flex:1;min-height:42px;min-width:110px;padding:8px;
 border-radius:9px;background:#422650;border:1px solid #dbafc7;
 color:#ffe6c2;font:800 12px system-ui,-apple-system,sans-serif;
}
body[data-start-world="6"] .j362-terrain-actions button:first-child{
 background:linear-gradient(130deg,#ffe0a0,#eda464);
 color:#2d153d;border-color:#ffe1b2;
}
body[data-start-world="6"] .j362-terrain-actions button:focus-visible{
 outline:3px solid #fff;outline-offset:2px;
}

/* Reserve distinct bands for actual map tools rather than allowing four
 * absolute panels to collide at one Y coordinate on iPhone. */
@media(max-width:700px){
 body[data-start-world="6"] .map-actions{
  position:absolute!important;left:8px!important;right:8px!important;
  bottom:40px!important;transform:none!important;
  box-sizing:border-box!important;display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  max-width:none!important;width:auto!important;
  gap:5px!important;padding:0!important;
 }
 body[data-start-world="6"] .map-actions button{
  min-width:0!important;min-height:42px!important;
  display:flex!important;align-items:center;justify-content:center;
  white-space:normal!important;padding:7px 5px!important;
  font:750 10px/1.2 system-ui,-apple-system,sans-serif!important;
  text-align:center;overflow-wrap:anywhere;
 }
 body[data-start-world="6"] #j171-map-tools{
  position:absolute!important;top:auto!important;
  bottom:97px!important;left:8px!important;right:auto!important;
  box-sizing:border-box!important;width:max-content!important;
  max-width:calc(100% - 16px)!important;gap:5px!important;padding:3px!important;
  display:flex!important;flex-wrap:nowrap!important;
 }
 body[data-start-world="6"] #j171-map-tools button{
  font:750 10px/1.2 system-ui!important;
  min-height:37px!important;padding:6px 8px!important;
 }
 body[data-start-world="6"] .map-status{
  position:absolute!important;top:auto!important;left:8px!important;
  bottom:150px!important;transform:none!important;
  max-width:55%!important;
  font-size:10px!important;padding:5px 9px!important;
  overflow-wrap:anywhere;
 }
 body[data-start-world="6"] #tileHealth{
  position:absolute!important;top:auto!important;left:auto!important;
  right:8px!important;bottom:146px!important;
  max-width:40%!important;font:9px/1.2 system-ui!important;
 }
 body[data-start-world="6"] #jura3dTools{
  display:none!important; /* 2D/3D bar and +/− are the single control owners */
 }
 body[data-start-world="6"] .j362-terrain-notice{
  bottom:204px;width:calc(100% - 24px);padding:11px 12px;
 }
 body[data-start-world="6"] .jura-nav-bar button{min-height:42px}
 body[data-start-world="6"] .jura-nav-panel{
  z-index:55;max-height:calc(100% - 205px);
 }
}
/* Selected cards own foreground: suppress secondary floating map controls. */
@media(max-width:700px){
 body[data-start-world="6"]:has(#selectedCard:not(.hidden)) #j171-map-tools,
 body[data-start-world="6"]:has(#selectedCard:not(.hidden)) .j362-terrain-notice{
  display:none!important;
 }
}

/* The preview banner is the foreground explanation; avoid a duplicate 2D status
 * tooltip covering it. The aria-live text stays in the accessibility tree. */
@media(max-width:700px){
 body[data-start-world="6"].jura-perspective-fallback .map-status{
  clip-path:inset(50%)!important;width:1px!important;height:1px!important;
  overflow:hidden!important;padding:0!important;border:0!important;
 }
}
