/* ELIE v5.1.92 — mobile planet dossier and world navigation precision.
   Phone landscape only. Desktop composition is intentionally untouched. */
@media (orientation:landscape) and (pointer:coarse) and (max-height:520px){
  /* Planet dossier close: use the same MYRA Close-Off / Close-On control as
     every other modal and force it above the vector frame on Mobile Safari. */
  html.phone-landscape .planet-detail-overlay .planet-detail-close,
  html.phone-landscape .planet-detail-overlay.is-open .planet-detail-close{
    position:absolute!important;
    right:max(8px,var(--safe-right,0px))!important;
    left:auto!important;
    top:max(7px,var(--safe-top,0px))!important;
    width:40px!important;
    height:40px!important;
    min-width:40px!important;
    min-height:40px!important;
    display:block!important;
    opacity:1!important;
    visibility:visible!important;
    pointer-events:auto!important;
    scale:1!important;
    rotate:0deg!important;
    transform:none!important;
    z-index:30000!important;
    background-color:transparent!important;
    background-image:url('../assets/images/Close-Off.png')!important;
    background-position:center!important;
    background-repeat:no-repeat!important;
    background-size:contain!important;
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important;
    touch-action:manipulation!important;
    -webkit-tap-highlight-color:transparent!important;
  }
  html.phone-landscape .planet-detail-overlay .planet-detail-close:is(:hover,:focus-visible,:active){
    background-image:url('../assets/images/Close-On.png')!important;
  }
  html.phone-landscape .planet-detail-overlay .planet-detail-close>*{
    opacity:0!important;
    visibility:hidden!important;
    pointer-events:none!important;
  }
  html[dir="rtl"].phone-landscape .planet-detail-overlay .planet-detail-close{
    right:auto!important;
    left:max(8px,var(--safe-left,0px))!important;
  }

  /* Ten artwork controls stay inside the centre column as a clean 5 x 2
     matrix. Numbers remain legible on iPhone 11 without covering the planet. */
  html.phone-landscape .v472-planet-detail .planet-artwork-buttons{
    left:50%!important;
    right:auto!important;
    bottom:3px!important;
    width:min(96%,350px)!important;
    max-width:calc(100% - 8px)!important;
    min-width:0!important;
    transform:translateX(-50%)!important;
    display:grid!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    grid-template-rows:repeat(2,28px)!important;
    gap:4px!important;
    padding:4px!important;
    box-sizing:border-box!important;
    overflow:visible!important;
    z-index:200!important;
    pointer-events:auto!important;
  }
  html.phone-landscape .v472-planet-detail .planet-artwork-button{
    width:100%!important;
    min-width:0!important;
    height:28px!important;
    min-height:28px!important;
    padding:0!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    border-radius:999px!important;
    font-family:"Duplet",Arial,sans-serif!important;
    font-size:14px!important;
    font-weight:800!important;
    line-height:1!important;
    letter-spacing:0!important;
    text-align:center!important;
    box-shadow:none!important;
    transform:none!important;
  }
  html.phone-landscape .v472-planet-detail .planet-artwork-button.locked{
    opacity:.46!important;
  }
  html.phone-landscape .v472-planet-detail .planet-artwork-button.unlocked:is(:active,:focus-visible){
    background:#2ef13a!important;
    color:#001704!important;
  }

  /* START GAME planet selection: arrows sit at the exact vertical centre of
     the viewport. Planet bodies rise toward their logos instead of hanging at
     the bottom of the cards. */
  html.phone-landscape .v477-worlds-screen .v3-world-carousel{
    left:0!important;
    right:0!important;
    top:12%!important;
    bottom:20%!important;
    width:auto!important;
    height:auto!important;
  }
  html.phone-landscape .v477-worlds-screen .v3-planet-viewport{
    left:7.5%!important;
    right:7.5%!important;
    top:0!important;
    height:100%!important;
  }
  html.phone-landscape .v477-worlds-screen .v3-planet-track{
    top:0!important;
    height:100%!important;
    align-items:flex-start!important;
  }
  html.phone-landscape .v477-worlds-screen .v3-planet-logo-shell{
    top:0!important;
    height:clamp(31px,8.2vh,43px)!important;
  }
  html.phone-landscape .v477-worlds-screen .v474-frame-free{
    top:clamp(29px,7.7vh,41px)!important;
    height:calc(100% - clamp(29px,7.7vh,41px))!important;
  }
  html.phone-landscape .v477-worlds-screen :is(.v3-planet-orbit,.v3-planet-lock){
    top:43%!important;
  }
  html.phone-landscape .v477-worlds-screen .v3-carousel-arrow{
    position:fixed!important;
    top:50dvh!important;
    bottom:auto!important;
    width:clamp(42px,6.4vw,54px)!important;
    height:auto!important;
    transform:translateY(-50%)!important;
    z-index:22000!important;
    opacity:1!important;
    pointer-events:auto!important;
  }
  html.phone-landscape .v477-worlds-screen .v3-carousel-arrow.prev{
    left:max(5px,var(--safe-left,0px))!important;
    right:auto!important;
  }
  html.phone-landscape .v477-worlds-screen .v3-carousel-arrow.next{
    right:max(5px,var(--safe-right,0px))!important;
    left:auto!important;
  }
  html.phone-landscape .v477-worlds-screen .v3-carousel-arrow:disabled{
    opacity:.25!important;
  }
}

@media (orientation:landscape) and (pointer:coarse) and (max-height:390px){
  html.phone-landscape .v472-planet-detail .planet-artwork-buttons{
    grid-template-rows:repeat(2,24px)!important;
    gap:3px!important;
    padding:3px!important;
  }
  html.phone-landscape .v472-planet-detail .planet-artwork-button{
    height:24px!important;
    min-height:24px!important;
    font-size:12px!important;
  }
}
