/* Smartphone Radio: full-viewport landscape presentation.
   Portrait devices are rotated visually so the receiver is immediately horizontal
   without depending on Screen Orientation API permissions/fullscreen support. */
@media (max-width: 991.98px) and (hover: none) and (pointer: coarse) {
    body:has(.mm-radio-page) {
        width: 100% !important;
        min-width: 0 !important;
        height: 100dvh !important;
        min-height: 100dvh !important;
        margin: 0 !important;
        overflow: hidden !important;
        overscroll-behavior: none;
    }

    body:has(.mm-radio-page) > .mm-public-header,
    body:has(.mm-radio-page) > .mm-legal-footer,
    body:has(.mm-radio-page) > footer,
    body:has(.mm-radio-page) #global-audio-player-root,
    body:has(.mm-radio-page) .mm-ai-dock {
        display: none !important;
    }

    body.mm-app-body:has(.mm-radio-page),
    body.mm-app-body:has(.mm-radio-page) .mm-app-main,
    body.mm-app-body:has(.mm-radio-page) .mm-main-content,
    body.mm-app-body:has(.mm-radio-page) .mm-page-host,
    body:has(.mm-radio-page) .mm-public-content {
        box-sizing: border-box !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 100dvh !important;
        min-height: 100dvh !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    body:has(.mm-radio-page) .mm-radio-page {
        position: fixed !important;
        inset: 0;
        z-index: 1040;
        box-sizing: border-box;
        display: block !important;
        width: 100dvw !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 100dvh !important;
        min-height: 0 !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        background: var(--mm-bg, #090704);
    }

    body:has(.mm-radio-page) .mm-radio-page > .mm-page-header,
    body:has(.mm-radio-page) .mm-radio-page > .mm-radio-queue,
    body:has(.mm-radio-page) .mm-radio-page > .mm-radio-library {
        display: none !important;
    }

    body:has(.mm-radio-page) .mm-radio-console.mm-vintage-radio {
        box-sizing: border-box !important;
        display: grid !important;
        grid-template-rows: auto auto minmax(0, 1fr) auto !important;
        align-content: stretch !important;
        gap: clamp(.35rem, 1.4vh, .7rem) !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 100% !important;
        min-height: 100% !important;
        max-height: 100% !important;
        margin: 0 !important;
        padding:
            max(.55rem, env(safe-area-inset-top))
            max(.7rem, env(safe-area-inset-right))
            max(.55rem, env(safe-area-inset-bottom))
            max(.7rem, env(safe-area-inset-left)) !important;
        overflow: hidden !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    body:has(.mm-radio-page) .mm-radio-console.mm-vintage-radio::before {
        inset: max(.35rem, env(safe-area-inset-top))
               max(.45rem, env(safe-area-inset-right))
               max(.35rem, env(safe-area-inset-bottom))
               max(.45rem, env(safe-area-inset-left)) !important;
        border-radius: .75rem !important;
    }

    body:has(.mm-radio-page) .mm-vintage-radio .mm-radio-console__signal {
        margin: 0 auto !important;
    }

    body:has(.mm-radio-page) .mm-vintage-tuner {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        margin: 0 !important;
    }

    body:has(.mm-radio-page) .mm-vintage-radio .mm-radio-console__content {
        align-self: stretch !important;
        display: grid !important;
        grid-template-columns: minmax(6rem, 28%) minmax(0, 1fr) !important;
        align-items: center !important;
        gap: clamp(.7rem, 2.2vw, 1.4rem) !important;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 clamp(.15rem, 1vw, .6rem) !important;
        overflow: hidden !important;
    }

    body:has(.mm-radio-page) .mm-vintage-radio .mm-radio-artwork {
        width: min(30vh, 10.5rem) !important;
        min-width: min(30vh, 10.5rem) !important;
        max-width: min(30vh, 10.5rem) !important;
        margin: 0 auto !important;
    }

    body:has(.mm-radio-page) .mm-vintage-radio .mm-radio-now-playing {
        align-self: center !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        padding: clamp(.6rem, 2vh, 1rem) clamp(.7rem, 2vw, 1.1rem) !important;
    }

    body:has(.mm-radio-page) .mm-vintage-radio .mm-radio-now-playing h2 {
        font-size: clamp(1rem, 3.2vw, 1.7rem) !important;
    }

    body:has(.mm-radio-page) .mm-vintage-radio .mm-radio-controls {
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: clamp(.35rem, 1vh, .6rem) 0 0 !important;
    }
}

@media (max-width: 991.98px) and (hover: none) and (pointer: coarse) and (orientation: landscape) {
    body:has(.mm-radio-page) .mm-radio-page {
        top: 0 !important;
        left: 0 !important;
        width: 100dvw !important;
        height: 100dvh !important;
        transform: none !important;
        transform-origin: center center;
    }
}

@media (max-width: 991.98px) and (hover: none) and (pointer: coarse) and (orientation: portrait) {
    body:has(.mm-radio-page) .mm-radio-page {
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        width: 100dvh !important;
        height: 100dvw !important;
        transform: translate(-50%, -50%) rotate(90deg) !important;
        transform-origin: center center !important;
    }

    body:has(.mm-radio-page) .mm-vintage-radio .mm-radio-artwork {
        width: min(30vw, 10.5rem) !important;
        min-width: min(30vw, 10.5rem) !important;
        max-width: min(30vw, 10.5rem) !important;
    }
}
