/* ELIE v5.1.88 — iPhone 11 Safari professional mobile audit
   Mobile/coarse landscape only. Desktop composition remains untouched. */
@media (orientation:landscape) and (pointer:coarse) and (max-height:520px){
  html.phone-landscape{
    --phone-edge:2px!important;
    --phone-radius:10px!important;
    --phone-header:44px!important;
  }
  html.phone-landscape,
  html.phone-landscape body,
  html.phone-landscape #app{width:100vw!important;height:100dvh!important;max-width:none!important;max-height:none!important;margin:0!important;padding:0!important;overflow:hidden!important}
  html.phone-landscape .screen{position:fixed!important;inset:0!important;left:0!important;top:0!important;width:100vw!important;height:100dvh!important;max-width:none!important;max-height:none!important;padding:0!important;margin:0!important}
  html.phone-landscape :is(.design-stage,.site-shell,.game-wrap,.boss-game-wrap){position:absolute!important;inset:0!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;margin:0!important;border-radius:0!important}
  html.phone-landscape .mobile-fixed-logo{top:3px!important;width:clamp(84px,13vw,112px)!important;height:clamp(44px,13vh,62px)!important}
  html.phone-landscape .mobile-menu-trigger{right:max(3px,var(--safe-right,0px))!important;top:max(3px,var(--safe-top,0px))!important}

  /* Full-bleed dialog system: the background may reach the edges while controls
     retain a small touch-safe inset. */
  html.phone-landscape :is(
    .universe-modal-overlay,.update-center-modal,.upgrade-overlay,.upgrade-detail-overlay,
    .career-modal,.player-stats-modal,.species-detail,.planet-detail-overlay,
    .artwork-gallery-overlay,.mobile-menu-overlay,.pilot-passport-overlay,.myra-overlay,
    .badge-gallery-overlay,.badge-detail-layer,.kadim-stone-modal,.timeline-modal-overlay
  ){inset:0!important;width:100vw!important;height:100dvh!important;max-width:none!important;max-height:none!important;padding:2px!important}
  html.phone-landscape :is(
    .universe-modal,.update-center-window,.evolution-lab.upgrade-window,.upgrade-detail-window,
    .career-window,.player-stats-window,.species-detail-card,.v3-planet-detail-frame,
    .artwork-gallery-stage,.mobile-menu-panel,.pilot-passport-window,.myra-window,
    .badge-gallery-window,.badge-detail-card,.kadim-stone-window
  ){width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;margin:0!important;border-radius:10px!important}

  /* Player statistics */
  html.phone-landscape .player-stats-window{padding:12px 14px 10px!important}
  html.phone-landscape .player-stats-heading{padding-right:46px!important;margin-bottom:8px!important}
  html.phone-landscape .player-stats-heading h2{font-size:clamp(17px,4.6vh,23px)!important}
  html.phone-landscape .player-stats-modal-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:7px!important}
  html.phone-landscape .player-stats-modal-grid article{min-height:76px!important;padding:9px 11px!important}
  html.phone-landscape .player-stats-modal-grid strong{font-size:clamp(16px,4.2vh,22px)!important}
  html.phone-landscape .player-stats-modal-grid span{font-size:clamp(7px,1.8vh,10px)!important}

  /* Evolution lab and detail use the available width instead of tiny islands. */
  html.phone-landscape .evolution-body{left:7px!important;right:7px!important;top:48px!important;bottom:7px!important;grid-template-columns:minmax(138px,23%) minmax(190px,32%) minmax(0,1fr)!important;gap:7px!important}
  html.phone-landscape .evolution-categories button{min-height:32px!important;padding:5px 8px!important}
  html.phone-landscape .evolution-categories button span{font-size:clamp(7px,1.8vh,10px)!important}
  html.phone-landscape .evolution-upgrades{padding-right:2px!important}
  html.phone-landscape .upgrade-detail-window{display:grid!important;grid-template-columns:minmax(225px,36%) minmax(0,1fr)!important;gap:14px!important;padding:48px 18px 16px!important}
  html.phone-landscape .upgrade-detail-visual{position:relative!important;inset:auto!important;width:100%!important;height:100%!important;display:grid!important;place-items:center!important}
  html.phone-landscape .upgrade-detail-visual img{max-width:82%!important;max-height:78%!important;object-fit:contain!important}
  html.phone-landscape .upgrade-detail-copy{position:relative!important;inset:auto!important;width:auto!important;height:100%!important;overflow:auto!important;padding:8px 6px 10px!important}
  html.phone-landscape .upgrade-detail-copy h2{font-size:clamp(21px,5.4vh,31px)!important}
  html.phone-landscape .upgrade-detail-copy p{font-size:clamp(9px,2.25vh,13px)!important;line-height:1.42!important}

  /* Badges and Kadim use the whole viewport and readable archive density. */
  html.phone-landscape .badge-gallery-window>header{left:12px!important;right:50px!important;top:7px!important;height:43px!important}
  html.phone-landscape .badge-scroll-mask{left:8px!important;right:8px!important;top:54px!important;bottom:7px!important}
  html.phone-landscape .badge-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important;padding:7px!important}
  html.phone-landscape .badge-card{min-height:74px!important;grid-template-columns:64px minmax(0,1fr)!important;padding:6px 8px!important}
  html.phone-landscape .badge-card h3{font-size:clamp(9px,2.25vh,12px)!important}
  html.phone-landscape .badge-card p{font-size:clamp(6px,1.5vh,8px)!important;line-height:1.25!important}
  html.phone-landscape .badge-detail-card{display:grid!important;grid-template-columns:minmax(220px,42%) minmax(0,1fr)!important;gap:13px!important;padding:48px 18px 15px!important;overflow:hidden!important}
  html.phone-landscape .badge-detail-card>div{min-width:0!important;min-height:0!important}
  html.phone-landscape .badge-detail-card :is(h2,h3){font-size:clamp(21px,5.2vh,30px)!important}
  html.phone-landscape .badge-detail-card p{font-size:clamp(9px,2.15vh,12px)!important;line-height:1.4!important}
  html.phone-landscape .kadim-stone-window .kadim-stone-header.signal-archive-heading{left:10px!important;right:50px!important;top:6px!important;height:54px!important;grid-template-columns:50px minmax(0,1fr)!important;gap:10px!important}
  html.phone-landscape .kadim-stone-header-icon{width:50px!important;height:50px!important;max-height:50px!important}
  html.phone-landscape .kadim-stone-window .kadim-stone-list-frame{left:8px!important;right:8px!important;top:65px!important;bottom:7px!important}
  html.phone-landscape .kadim-stone-row{min-height:39px!important;padding:7px 10px!important}

  /* Book: one deliberate left station and a large readable right column. */
  html.phone-landscape .book-screen :is(.site-branding,.site-mark,.site-copyright,.site-copyright-new,.mobile-fixed-logo){display:none!important}
  html.phone-landscape .book-screen .book-art{display:block!important;left:3.2%!important;top:15%!important;width:22.5%!important;height:57%!important;max-width:none!important;max-height:none!important;object-fit:contain!important;transform:none!important}
  html.phone-landscape .book-screen .book-download-signal{left:3.1%!important;right:auto!important;top:auto!important;bottom:5.5%!important;width:23%!important;height:48px!important;min-height:48px!important;transform:none!important;border-radius:999px!important}
  html.phone-landscape .book-screen .book-download-signal .home-start-signal-label{position:absolute!important;inset:0!important;display:grid!important;place-items:center!important;color:#001704!important;font-family:"Duplet",Arial,sans-serif!important;font-size:clamp(14px,3.8vh,20px)!important;font-weight:800!important;line-height:1!important;letter-spacing:.035em!important;text-shadow:none!important;filter:none!important;z-index:4!important}
  html.phone-landscape .book-screen .book-copy.book-copy-v5182{left:28.2%!important;right:1.2%!important;top:45px!important;bottom:7px!important;width:auto!important;height:auto!important;max-width:none!important;max-height:none!important;text-align:left!important;overflow:hidden!important}
  html.phone-landscape .book-screen .book-scroll-frame{height:100%!important;padding:8px 15px 28px!important;overflow-y:auto!important;overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch!important;mask-image:linear-gradient(to bottom,transparent 0,#000 14px,#000 calc(100% - 19px),transparent 100%)!important;-webkit-mask-image:linear-gradient(to bottom,transparent 0,#000 14px,#000 calc(100% - 19px),transparent 100%)!important}
  html.phone-landscape .book-screen .book-scroll-frame p{max-width:none!important;text-align:left!important}
  html.phone-landscape .book-screen .book-scroll-frame .lead{font-size:clamp(13px,3.2vh,18px)!important;line-height:1.23!important;margin:0 0 13px!important}
  html.phone-landscape .book-screen .book-body-paragraph{font-size:clamp(8px,1.95vh,11px)!important;line-height:1.38!important;margin:0 0 10px!important}
  html[dir="rtl"].phone-landscape .book-screen .book-scroll-frame p{text-align:right!important}

  /* Story and update pages: readable scrolling document rather than top pile. */
  html.phone-landscape .story-screen .story-copy{top:48px!important;bottom:8px!important;right:2%!important;width:52%!important;max-height:none!important;overflow:auto!important;padding:8px 12px 24px!important}
  html.phone-landscape .story-screen .story-copy p{font-size:clamp(8px,1.9vh,11px)!important;line-height:1.35!important}
  html.phone-landscape .update-center-window{padding:7px!important}
  html.phone-landscape .update-history-scroll{padding:2px 3px 6px!important}

  /* How to Play: no cropped visual, compact header, balanced 2-column cards. */
  html.phone-landscape .how-screen .content{left:2px!important;right:2px!important;top:2px!important;bottom:2px!important;padding:0!important;border-radius:10px!important}
  html.phone-landscape .how-command-frame{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;clip-path:none!important;border-radius:10px!important;overflow:hidden!important}
  html.phone-landscape .how-command-header{min-height:52px!important;height:52px!important;padding:8px 54px 7px 14px!important;grid-template-columns:minmax(0,1fr) auto!important}
  html.phone-landscape .how-command-title>small{font-size:6px!important}
  html.phone-landscape .how-command-title h1{font-size:clamp(18px,4.5vh,25px)!important;margin:2px 0!important;line-height:1!important}
  html.phone-landscape .how-command-title p{font-size:clamp(7px,1.65vh,9px)!important;line-height:1.15!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  html.phone-landscape .how-command-index{display:none!important}
  html.phone-landscape .how-command-scroll{position:absolute!important;left:0!important;right:0!important;top:52px!important;bottom:22px!important;padding:8px 10px 22px!important;overflow-y:auto!important}
  html.phone-landscape .how-command-section{gap:8px!important;margin-bottom:14px!important}
  html.phone-landscape .how-command-section>header{grid-template-columns:28px auto minmax(20px,1fr)!important;gap:7px!important}
  html.phone-landscape .how-command-section>header>b{width:27px!important;height:27px!important;font-size:9px!important}
  html.phone-landscape .how-command-section>header h2{font-size:clamp(13px,3.1vh,18px)!important}
  html.phone-landscape .how-control-deck,.how-laser-manual{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  html.phone-landscape .how-control-card,.how-laser-manual article{grid-template-columns:minmax(126px,38%) minmax(0,1fr)!important;gap:9px!important;min-height:132px!important;padding:9px!important;overflow:hidden!important}
  html.phone-landscape .how-control-symbol,.how-system-visual{height:110px!important;min-height:110px!important;padding:3px 9px 3px 1px!important;gap:7px!important;border-right:1px solid rgba(46,241,58,.2)!important;overflow:hidden!important}
  html.phone-landscape .how-arrow-pad{width:68px!important;height:68px!important}
  html.phone-landscape .how-x-key{width:42px!important;height:42px!important;margin-left:7px!important;font-size:21px!important}
  html.phone-landscape .how-touch-controller{width:72px!important;height:92px!important;max-width:72px!important;max-height:92px!important;object-fit:contain!important}
  html.phone-landscape .how-mobile-action-stack{display:flex!important;align-items:center!important;justify-content:center!important;gap:5px!important;width:104px!important;max-width:104px!important}
  html.phone-landscape .how-laser-mini{width:48px!important;height:48px!important}
  html.phone-landscape .how-bomb-mini{width:39px!important;height:64px!important;object-fit:contain!important}
  html.phone-landscape .how-control-card strong,.how-laser-manual strong,.how-system-card strong,.how-collect-card strong{font-size:clamp(10px,2.4vh,14px)!important;line-height:1.12!important}
  html.phone-landscape .how-control-card p,.how-laser-manual p,.how-system-card p{font-size:clamp(7px,1.75vh,10px)!important;line-height:1.35!important;margin-top:4px!important}
  html.phone-landscape .how-command-status{height:22px!important;min-height:22px!important;padding:0 10px!important}

  /* Timeline, credits and gallery */
  html.phone-landscape .timeline-modal .timeline-rail{left:10px!important;right:10px!important;top:52px!important;bottom:7px!important}
  html.phone-landscape .timeline-card{min-width:calc(50% - 7px)!important}
  html.phone-landscape .credits-screen .content{inset:42px 5px 5px!important;width:auto!important;height:auto!important;overflow:auto!important}
  html.phone-landscape .artwork-gallery-stage{border:0!important;border-radius:0!important}
  html.phone-landscape .artwork-gallery-image{max-width:calc(100% - 96px)!important;max-height:calc(100% - 20px)!important}

  /* Archive carousels use edge space but preserve five-card rhythm. */
  html.phone-landscape :is(.bosses-screen,.species-screen,.objects-screen) .species-viewport{left:32px!important;right:32px!important;top:17%!important;bottom:24px!important}
  html.phone-landscape :is(.bosses-screen,.species-screen,.objects-screen) .species-track{gap:6px!important}
  html.phone-landscape :is(.bosses-screen,.species-screen,.objects-screen) .species-card{flex-basis:calc((100vw - 94px)/5)!important;width:calc((100vw - 94px)/5)!important;height:min(100%,238px)!important}
  html.phone-landscape :is(.bosses-screen,.species-screen,.objects-screen) .species-arrow{width:30px!important;height:30px!important}
  html.phone-landscape :is(.bosses-screen,.species-screen,.objects-screen) .species-arrow.prev{left:1px!important}
  html.phone-landscape :is(.bosses-screen,.species-screen,.objects-screen) .species-arrow.next{right:1px!important}
  html.phone-landscape :is(.bosses-screen,.species-screen,.objects-screen) .lock-cross{max-width:70%!important;max-height:70%!important}
  html.phone-landscape .objects-screen .object-card.unlocked .object-card-img{transform:scale(1.13)!important;filter:none!important}

  /* Detail cards: larger art and readable scroll copy. */
  html.phone-landscape .species-detail-card{grid-template-columns:minmax(260px,40%) minmax(0,1fr)!important;gap:8px!important;padding:8px!important}
  html.phone-landscape .species-detail-card .detail-panel:first-child{padding:4px!important}
  html.phone-landscape .species-detail-card .detail-panel:first-child img{max-width:100%!important;max-height:100%!important;object-fit:contain!important}
  html.phone-landscape .species-detail-copy{padding:42px 10px 12px 12px!important;overflow-y:auto!important}
  html.phone-landscape .species-detail-copy h1,.species-detail-copy h2{font-size:clamp(18px,4.6vh,26px)!important}
  html.phone-landscape .species-detail-copy p{font-size:clamp(8px,1.95vh,11px)!important;line-height:1.4!important}

  /* Scoreboard fills the screen and presents more pilots per viewport. */
  html.phone-landscape .score-screen .content{inset:2px!important;width:auto!important;height:auto!important;padding:42px 7px 6px!important;border-radius:10px!important}
  html.phone-landscape .score-wrap{width:100%!important;height:100%!important;padding:4px!important;overflow:hidden!important}
  html.phone-landscape .score-league-header{min-height:42px!important;padding:2px 4px 6px!important}
  html.phone-landscape .score-league-header h1{font-size:clamp(17px,4.3vh,24px)!important}
  html.phone-landscape .score-league-header p{font-size:clamp(6px,1.5vh,8px)!important}
  html.phone-landscape .score-pair-scroll{height:calc(100% - 44px)!important;max-height:none!important;overflow-y:auto!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:4px 7px!important;align-content:start!important}
  html.phone-landscape .score-row{height:29px!important;min-height:29px!important;margin:0!important;font-size:9px!important}

  /* World and level navigation: use the full width. */
  html.phone-landscape :is(.worlds-screen,.levels-screen) .v3-back-heading{left:5px!important;right:5px!important;top:3px!important;height:34px!important}
  html.phone-landscape .worlds-screen .v3-world-carousel{left:28px!important;right:28px!important;top:38px!important;bottom:7px!important;width:auto!important;height:auto!important}
  html.phone-landscape .levels-screen .v3-level-grid{left:35px!important;right:7px!important;top:42px!important;bottom:8px!important;width:auto!important;height:auto!important;grid-template-columns:repeat(10,minmax(0,1fr))!important;grid-auto-rows:minmax(31px,1fr)!important;gap:5px!important;padding:2px 3px 4px!important;overflow-y:auto!important}
  html.phone-landscape .levels-screen .v3-level-btn{height:auto!important;min-height:31px!important;font-size:clamp(11px,2.75vh,15px)!important;border-radius:9px!important}

  /* Level intro: meaningful scale on the phone. */
  html.phone-landscape .v3-level-intro .v3-intro-elie-logo{top:3%!important;width:clamp(86px,13vw,118px)!important}
  html.phone-landscape .v3-intro-planet-cluster{width:clamp(165px,25vw,230px)!important;height:clamp(165px,46vh,230px)!important}
  html.phone-landscape .v3-intro-level-panel{right:7%!important;transform:scale(1.15)!important;transform-origin:center!important}
  html.phone-landscape .v31-level-dna{bottom:2%!important;width:min(68vw,620px)!important;padding:6px 12px!important}

  /* First-flight tutorial: compact, scroll-safe, no overlapping CTA. */
  html.phone-landscape .game-modal.tutorial-mode{padding:2px!important}
  html.phone-landscape .flight-tutorial-card{position:absolute!important;inset:2px!important;width:auto!important;height:auto!important;max-width:none!important;max-height:none!important;padding:7px 9px 7px!important;display:grid!important;grid-template-rows:auto minmax(0,1fr) auto auto!important;gap:5px!important;overflow:hidden!important;transform:none!important}
  html.phone-landscape .tutorial-heading{padding:0 48px 0 4px!important;text-align:center!important}
  html.phone-landscape .tutorial-heading small{font-size:5.5px!important}
  html.phone-landscape .tutorial-heading h2{font-size:clamp(18px,4.6vh,25px)!important;margin:1px 0!important}
  html.phone-landscape .tutorial-heading p{font-size:clamp(6.5px,1.55vh,8.5px)!important;line-height:1.1!important;margin:0!important}
  html.phone-landscape .tutorial-control-grid{min-height:0!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important;overflow:hidden!important}
  html.phone-landscape .flight-tutorial-card .tutorial-control{min-height:0!important;height:100%!important;grid-template-rows:auto 75px auto auto auto!important;padding:6px 8px!important;overflow-y:auto!important}
  html.phone-landscape .flight-tutorial-card .tutorial-visual{height:75px!important;min-height:75px!important;max-height:75px!important;margin:3px 0 4px!important;padding:2px 4px!important;gap:5px!important;overflow:hidden!important}
  html.phone-landscape .tutorial-arrow-pad{width:54px!important;height:54px!important}
  html.phone-landscape .tutorial-key{width:34px!important;height:34px!important;font-size:18px!important}
  html.phone-landscape .flight-tutorial-card .tutorial-phone{width:42px!important;height:65px!important}
  html.phone-landscape .flight-tutorial-card .tutorial-drag-vector{width:42px!important}
  html.phone-landscape .flight-tutorial-card .tutorial-mobile-actions{width:94px!important;max-width:none!important;gap:4px!important}
  html.phone-landscape .flight-tutorial-card .tutorial-laser-dial{width:43px!important;height:43px!important}
  html.phone-landscape .flight-tutorial-card .tutorial-bomb-drop{width:32px!important;height:58px!important}
  html.phone-landscape .flight-tutorial-card .tutorial-control>p,
  html.phone-landscape .flight-tutorial-card .tutorial-control>strong{font-size:clamp(6.5px,1.55vh,8.5px)!important;line-height:1.22!important;margin:2px 0!important}
  html.phone-landscape .tutorial-targets{min-height:19px!important;height:19px!important;padding:0 6px!important;margin:0!important;overflow:hidden!important}
  html.phone-landscape .tutorial-targets p{font-size:6.5px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  html.phone-landscape .tutorial-confirm{position:relative!important;inset:auto!important;justify-self:center!important;width:min(38%,270px)!important;height:31px!important;min-height:31px!important;margin:0!important;font-size:clamp(8px,2vh,11px)!important;transform:none!important}

  /* Gameplay is true full bleed. Touch controls are deliberately larger. */
  html.phone-landscape .game-screen,html.phone-landscape .boss-game-screen{inset:0!important;left:0!important;top:0!important;width:100vw!important;height:100dvh!important}
  html.phone-landscape .game-wrap,html.phone-landscape .game-wrap canvas,html.phone-landscape .boss-game-wrap,html.phone-landscape .boss-game-wrap canvas{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;object-fit:fill!important}

  /* Results: fit the summary and actions inside one swipeable document. */
  html.phone-landscape .game-modal:not(.hidden){padding:2px!important}
  html.phone-landscape .result-card.advanced-result{width:calc(100% - 4px)!important;height:calc(100% - 4px)!important;max-width:none!important;max-height:none!important;transform:none!important;padding:8px 12px 10px!important;overflow-y:auto!important}
  html.phone-landscape .advanced-result h2{font-size:clamp(18px,4.6vh,25px)!important}
  html.phone-landscape .advanced-result .result-summary{gap:5px!important}
  html.phone-landscape .advanced-result .result-actions{margin-top:8px!important;gap:6px!important;padding-bottom:2px!important}
  html.phone-landscape .advanced-result .result-actions .action-btn{min-height:34px!important;height:34px!important;font-size:clamp(8px,2vh,11px)!important}
}
