/* Part 150: the ride screen on a phone held sideways (and any window under 500 px tall). Loaded just before
   legible50.css. Looks only. */

/* The course strip stays in the top row between speed and score; on a narrow phone it had dropped to a second row,
   where it covered the left/right split guide and ran into the tricks round POP. */
@media (orientation:landscape) and (max-height:500px){
  body.playing:is([data-sport=ski],[data-sport=snowboard]) .hud-top-center{top:max(12px,env(safe-area-inset-top))}
  /* The split guide hangs just under the strip, never on it. */
  body.playing #hud:has(#courseMeter:not(.hidden)) .line-guide{top:calc(max(12px,env(safe-area-inset-top)) + 78px)}
  /* With the touch buttons stepped aside (a key or a controller was used), the trail map hangs under the score
     instead of standing up from the bottom over the score's stars. */
  body.playing:not(.ride-touch-active):is([data-sport=ski],[data-sport=snowboard]) .minimap-wrap{bottom:auto;top:calc(max(10px,env(safe-area-inset-top)) + 92px)}
  body.playing:not(.ride-touch-active):is([data-sport=ski],[data-sport=snowboard]) .minimap-wrap.trail #minimap{height:clamp(80px,calc(100vh - 120px),176px)!important}
}
@media (orientation:landscape) and (max-height:500px) and (max-width:760px){
  body.playing #hud:has(#courseMeter:not(.hidden)) .line-guide{top:calc(max(12px,env(safe-area-inset-top)) + 56px)}
  /* The hint under the speed stops short of the guide (the guide is 285 px wide, centred). */
  body.playing:is(.touch-enabled,.ride-touch-active):is([data-sport=ski],[data-sport=snowboard]) .status{max-width:calc(50vw - 162px)}
}

/* The split guide speaks like the rest of the ride screen: capitals. */
.line-guide small{font:800 10px/1.1 var(--s26-text,Barlow,system-ui,sans-serif);letter-spacing:.12em;text-transform:uppercase}
.line-guide b{text-transform:uppercase;letter-spacing:.02em}

/* Part 151, Results on a phone held sideways: while the best trick plays, its window ends above the RIDE AGAIN bar,
   so the bar no longer sits on SLOW MOTION, FULL SCREEN and SKIP REPLAY (it covered them by 26 px at 844x390 and
   41 px at 667x375). The bar is 78 px with its margin, plus room to breathe. */
@media (orientation:landscape) and (max-height:500px){
  body.results-reel .result-stage .result-ride-window{min-height:clamp(150px,calc(100dvh - 196px),480px)}
}

/* Part 152, an upright phone: the course strip sat on the speed's ride data (longest air, top, ridden) and the
   left/right split guide sat on the strip (strip 78..125, guide 96..151 at 390x844). With the touch buttons on, the
   strip now starts under the ride data and the guide hangs under the strip. */
@media (orientation:portrait) and (max-width:760px){
  body.playing.ride-touch-active:is([data-sport=ski],[data-sport=snowboard]) .hud-top-center{top:calc(max(9px,env(safe-area-inset-top)) + 82px)}
  body.playing.ride-touch-active #hud:has(#courseMeter:not(.hidden)) .line-guide{top:calc(max(9px,env(safe-area-inset-top)) + 136px)}
  body.playing:not(.ride-touch-active) #hud:has(#courseMeter:not(.hidden)) .line-guide{top:132px}
  /* The "turn your phone sideways" tip waits under the guide instead of over the strip. */
  body.playing .ride-touch-rotate{top:calc(max(10px,env(safe-area-inset-top)) + 200px)}
}

/* Part 156, LEARN TO RIDE on a phone. The lesson card speaks for the ride, so the general hint under the speed steps
   aside while it shows. Upright, the card sat on the split guide and the "turn your phone sideways" tip covered its
   words (card 150..296, guide 145..186, tip 210..272 at 390x844): it now hangs under the guide and the tip waits for
   a ride without a lesson. On its side the card is smaller and stays left of the guide, above the stick. */
@media (orientation:portrait) and (max-width:760px){
  body.playing .lesson{top:calc(max(9px,env(safe-area-inset-top)) + 192px)}
  body.playing:has(>.lesson:not(.hidden)) .ride-touch-rotate{display:none!important}
  body.playing:has(>.lesson:not(.hidden)):is([data-sport=ski],[data-sport=snowboard]) .status{display:none}
}
@media (orientation:landscape) and (max-height:500px){
  body.playing .lesson{top:calc(max(10px,env(safe-area-inset-top)) + 62px);left:max(16px,env(safe-area-inset-left));width:256px;padding:8px 10px;gap:4px;transform:none}
  body.playing .lesson .lesson-title{font-size:22px}
  body.playing .lesson p{font-size:12.5px;line-height:1.35}
  body.playing:has(>.lesson:not(.hidden)):is([data-sport=ski],[data-sport=snowboard]) .status{display:none}
}
/* A small phone on its side has no room left of the guide: the guide steps aside for the lesson. */
@media (orientation:landscape) and (max-height:500px) and (max-width:760px){
  body.playing:has(>.lesson:not(.hidden)) #hud .line-guide{display:none}
}

/* Part 158, an upright phone: the name of the part of the mountain you ride into (SUMMIT GATE, RAIL SETUP) was written
   over your longest air and top speed (tag 73..92, ride data 62..84 at 390x844). It is centred under the split guide
   instead, and waits while the "turn your phone sideways" tip or a lesson card is in that place. */
@media (orientation:portrait) and (max-width:760px){
  body.playing.ride-touch-active:is([data-sport=ski],[data-sport=snowboard]) #zone.zone-tag{top:calc(max(9px,env(safe-area-inset-top)) + 192px);left:0;right:0;width:max-content;max-width:calc(100vw - 32px);margin-inline:auto;text-align:center}
  body.playing.ride-touch-active:is([data-sport=ski],[data-sport=snowboard]) #zone.zone-tag strong{font-size:18px}
  body.playing:is(:has(.ride-touch-rotate:not([hidden])),:has(>.lesson:not(.hidden))) #zone.zone-tag{visibility:hidden}
  /* A party round: your place (and the duo line) sat on the strip's track since part 152 moved the strip down
     (place 128..172, strip 91..138). It hangs under the strip, where the split guide would be (a race has none). */
  body.playing.ride-touch-active:has(#courseMeter:not(.hidden)) #multiplayerHud.mp-hud{top:calc(max(9px,env(safe-area-inset-top)) + 136px)}
}
/* Part 167: a trick name and the split guide shared one place under the course strip: a centre lane's sign sat under
   STRAIGHT AIR, and a long name ran over the LEFT and RIGHT signs too. While a trick is called the guide steps back,
   and it comes back as the name goes (a second or two). */
#hud .line-guide{transition:opacity .15s}
body.playing:has(>#trick:not(.hidden)) #hud .line-guide{opacity:0}
