/* Phone-landscape home and Island Radio (844x390, 812x375, 932x430, 740x360).
   Load after home-art-v1.css and radio-art-v1.css. Desktop is unchanged:
   every rule is inside this gate. Team stays left, modes stay right. */

@media (orientation: landscape) and (max-height: 520px) and (max-width: 1100px) {
  /* home-art sets shell padding with !important. At 740x360 the 300px main
     min-height plus the 55px bar is taller than the dvh and clips the footer. */
  body.arcade-home.home-art-active .app-shell {
    padding-top: env(safe-area-inset-top) !important;
    padding-right: max(12px, env(safe-area-inset-right)) !important;
    padding-bottom: max(8px, env(safe-area-inset-bottom)) !important;
    padding-left: max(12px, env(safe-area-inset-left)) !important;
  }
  body.arcade-home.home-art-active #main-screen.home-screen {
    height: calc(100dvh - 55px - env(safe-area-inset-top) - max(8px, env(safe-area-inset-bottom)));
    min-height: 0;
  }

  body.arcade-home.home-art-active .topbar .icon-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
  body.arcade-home.home-art-active .topbar > .topbar-profile {
    min-height: 44px;
  }
  body.arcade-home.home-art-active .topbar-profile .home-profile-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  body.arcade-home.home-art-active .topbar-profile strong,
  body.arcade-home.home-art-active .topbar-profile small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.arcade-home.home-art-active .topbar-profile small {
    font-size: 11px;
    line-height: 1.05;
    letter-spacing: 0;
  }

  /* Title was 10px at <=740px, and Next was display:none. Volume stays in the dialog. */
  body.arcade-home.home-art-active .topbar #music-bar .radio-home-trigger {
    min-height: 44px;
    font-size: 11px;
    line-height: 1.15;
  }
  body.arcade-home.home-art-active .topbar #music-bar > [data-music="next"] {
    display: block;
  }

  /* Chest and Splash Pass leave the top-right and stack on the left waterfall
     edge beside the plinth. Seats shift right so the hero, name, and invite stay
     clear. Same buttons, handlers, and chest animation. */
  body.arcade-home.home-art-active #main-screen .home-quick {
    left: 2px;
    right: auto;
    top: 60px;
    bottom: 70px;
    width: 78px;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    --hq-art: 44px;
    z-index: 4;
    overflow: visible;
    pointer-events: none;
  }
  body.arcade-home.home-art-active #main-screen .home-quick-art {
    width: 44px;
    height: 44px;
    max-height: 44px;
  }
  body.arcade-home.home-art-active #main-screen .home-pass-art {
    width: 44px;
    height: 44px;
  }
  body.arcade-home.home-art-active #main-screen .home-quick-item,
  body.arcade-home.home-art-active #main-screen .home-quick[data-fit="compact"] .home-quick-item {
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    width: 74px;
    height: auto;
    min-height: 64px;
    min-width: 0;
    margin: 0;
    padding: 2px 2px 4px;
    gap: 1px;
    overflow: visible;
    pointer-events: auto;
  }
  body.arcade-home.home-art-active #main-screen .home-quick-label,
  body.arcade-home.home-art-active #main-screen .home-quick[data-fit="compact"] .home-quick-label {
    width: 100%;
    font-size: 13px;
    line-height: 1.1;
    padding: 1px 2px;
  }
  body.arcade-home.home-art-active #main-screen .home-chest-count,
  body.arcade-home.home-art-active #main-screen .home-quick .pass-ready-count {
    top: 0;
    right: 0;
    font-size: 11px;
  }

  /* Format pills were 32px. Hero column starts after the icon rail. */
  body.arcade-home.home-art-active #main-screen .home-party-bar {
    left: 0;
    right: calc(48% + 4px);
    top: 2px;
    padding: 2px 4px;
  }
  body.arcade-home.home-art-active #main-screen .home-party-formats button {
    min-height: 44px;
    padding: 0 2px;
    font-size: 14px;
  }
  body.arcade-home.home-art-active #main-screen .home-party-seats {
    left: 84px;
    right: calc(48% + 4px);
    top: 58px;
    bottom: 76px;
  }
  body.arcade-home.home-art-active #main-screen .home-party-invite > span {
    width: 44px;
    height: 44px;
    font-size: 30px;
    margin-bottom: 2px;
  }
  body.arcade-home.home-art-active #main-screen .home-party-invite strong {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    line-height: 1.1;
    padding: 3px 6px;
  }

  /* Name stays on the shifted portrait. Do not grow the plate down over the face. */
  body.arcade-home.home-art-active #main-screen .avatar-label small {
    font-size: 11px;
    line-height: 1.1;
    margin-top: 1px;
    letter-spacing: 0;
  }

  /* Right column takes the height Chest/Pass used to occupy, plus a wider share.
     Practice / The Journey were a 40px row; they now share that freed height. */
  body.arcade-home.home-art-active #main-screen .home-modes {
    left: auto;
    right: 0;
    top: 4px;
    bottom: 66px;
    width: calc(52% - 2px);
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(84px, 0.92fr);
  }
  body.arcade-home.home-art-active #main-screen .mode-ribbon {
    top: 4px;
    max-width: calc(100% - 12px);
    padding: 2px 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px;
    line-height: 1.1;
    letter-spacing: 0;
  }
  body.arcade-home.home-art-active #main-screen .mode-title small,
  body.arcade-home.home-art-active #main-screen .mode-card > span > small {
    display: block;
    font-size: 11px;
    line-height: 1.15;
    margin: 0 0 2px;
  }
  body.arcade-home.home-art-active #main-screen .practice-card,
  body.arcade-home.home-art-active #main-screen .story-card {
    display: flex;
    align-items: center;
    min-height: 84px;
    min-width: 0;
  }
  body.arcade-home.home-art-active #main-screen .practice-card strong,
  body.arcade-home.home-art-active #main-screen .story-card strong {
    font-size: 18px;
    line-height: 1.05;
  }

  /* Footer was 44px with 27px icons and 7–9px labels. 22px icons leave 11px type. */
  body.arcade-home.home-art-active #main-screen .home-bottom {
    height: auto;
    min-height: 44px;
    align-items: stretch;
  }
  body.arcade-home.home-art-active #main-screen #home-chat {
    flex: 0 1 220px;
    max-width: 34%;
    height: auto;
    min-height: 44px;
    min-width: 0;
  }
  body.arcade-home.home-art-active #main-screen #home-chat .chat-channel {
    flex-direction: row;
    font-size: 11px;
    line-height: 1;
  }
  body.arcade-home.home-art-active #main-screen #home-chat .lobby-preview-empty,
  body.arcade-home.home-art-active #main-screen #home-chat .lobby-preview-line {
    font-size: 12px;
    line-height: 1.2;
  }
  body.arcade-home.home-art-active #main-screen .home-nav {
    height: auto;
    min-height: 44px;
    min-width: 0;
    align-items: stretch;
  }
  body.arcade-home.home-art-active #main-screen .home-nav button {
    height: auto;
    min-height: 44px;
    padding: 2px;
    gap: 0;
  }
  body.arcade-home.home-art-active #main-screen .home-nav button > i,
  body.arcade-home.home-art-active #main-screen .home-nav .daily-button-icon {
    width: 22px;
    height: 22px;
  }
  body.arcade-home.home-art-active #main-screen .home-nav button > span:not(.progression-balance):not(.daily-button-icon) {
    max-width: 100%;
    overflow: hidden;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.05;
    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  body.arcade-home.home-art-active #main-screen .home-daily-missions > span:not(.progression-balance):not(.daily-button-icon),
  body.arcade-home.home-art-active #main-screen .home-daily-missions strong {
    font-size: 11px;
    line-height: 1.05;
    white-space: normal;
    text-overflow: clip;
  }
  body.arcade-home.home-art-active #main-screen .home-daily-missions .progression-balance {
    top: 2px;
    right: 2px;
    max-width: calc(100% - 4px);
    padding: 1px 2px;
    gap: 1px;
    font-size: 11px;
    line-height: 1.1;
  }
  body.arcade-home.home-art-active #main-screen .home-daily-missions .progression-balance b {
    font-size: 11px;
    letter-spacing: -.5px;
    white-space: nowrap;
  }
  body.arcade-home.home-art-active #main-screen .home-daily-missions .progression-balance .coin-icon,
  body.arcade-home.home-art-active #main-screen .home-daily-missions .progression-balance .coin-icon svg {
    width: 11px;
    height: 11px;
    flex: 0 0 11px;
  }

  /* Kickers were 8–10px. A 230px playlist can scroll Close off a 360px screen. */
  body.arcade-home.home-art-active .radio-art-panel[open] {
    width: min(680px, calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right) - 16px));
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 12px);
  }
  body.arcade-home.home-art-active .radio-art-heading {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #efffee;
  }
  body.arcade-home.home-art-active .radio-art-heading small,
  body.arcade-home.home-art-active .radio-now-copy small,
  body.arcade-home.home-art-active .radio-tracks-title,
  body.arcade-home.home-art-active .radio-art-status {
    font-size: 11px;
    letter-spacing: 0.4px;
    line-height: 1.25;
  }
  body.arcade-home.home-art-active .radio-art-volume {
    font-size: 13px;
  }
  body.arcade-home.home-art-active .radio-art-close {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
  }
  body.arcade-home.home-art-active .radio-track-list {
    max-height: min(220px, calc(100dvh - 168px));
    min-height: 0;
  }
  body.arcade-home.home-art-active .radio-track {
    min-height: 44px;
    font-size: 13px;
  }
}

/* Grounded screenshot corrections. */
@media (orientation:landscape) and (max-height:520px) and (max-width:1100px){
 body.arcade-home.home-art-active #main-screen .home-party-bar{right:calc(52% + 10px)}
 body.arcade-home.home-art-active #main-screen .home-party-seats{right:calc(52% + 10px);bottom:108px}
 body.arcade-home.home-art-active #main-screen .home-party-invite strong{font-size:11px;padding:3px}
 body.arcade-home.home-art-active #main-screen .avatar-label small{font-size:9px;white-space:nowrap}
 body.arcade-home.home-art-active #main-screen .home-party-self{min-width:0}
}
@media (orientation:landscape) and (max-height:520px) and (max-width:1100px){
 body.arcade-home.home-art-active #main-screen .home-modes{grid-template-rows:minmax(0,1fr) 68px}
 body.arcade-home.home-art-active #main-screen .practice-card,body.arcade-home.home-art-active #main-screen .story-card{min-height:68px}
 body.arcade-home.home-art-active #main-screen .practice-card strong,body.arcade-home.home-art-active #main-screen .story-card strong{font-size:16px}
 body.arcade-home.home-art-active #main-screen .mode-card>span>small{font-size:9px}
}
