/* One complementary navigation breakpoint: no width can hide both navigations.
   TV-wide keeps its existing top navigation and overscan margins. */
.desktop-nav{display:flex}
.mobile-nav{display:none;position:fixed;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));bottom:max(8px,env(safe-area-inset-bottom));z-index:80;border:1px solid rgba(255,255,255,.12);border-radius:18px;background:rgba(12,9,13,.96);backdrop-filter:blur(24px) saturate(1.2);box-shadow:0 16px 48px #000;padding:5px}
.mnav{min-width:0;min-height:44px;border:0;background:transparent;color:#c2b2a5;padding:7px 2px;border-radius:12px;cursor:pointer;font-size:.75rem;line-height:1.3;overflow-wrap:anywhere}
.mnav span{display:block;font-size:1.13rem;margin-bottom:2px}
.mnav.active{color:#1a0d08;background:linear-gradient(135deg,#f4c56d,#d77636)}
.mnav:focus-visible{outline-offset:0}
.dossier-intro,.dossier-decisions{min-width:0}
.trailer-modal{display:flex;flex-direction:column}
.trailer-frame{order:0;flex:none}
.trailer-bar{order:1}

@media(max-width:1050px), (max-height:600px) and (orientation:landscape) and (pointer:coarse){
  body:not(.tv-wide){--section-nav-space:calc(6rem + env(safe-area-inset-bottom));--header-space:calc(var(--navh) + env(safe-area-inset-top))}
  body:not(.tv-wide) .desktop-nav{display:none}
  body:not(.tv-wide) .mobile-nav{display:grid}
  body:not(.tv-wide) .app{padding-top:var(--header-space)}
  body:not(.tv-wide) .topbar{height:var(--header-space);padding-top:env(safe-area-inset-top);padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right))}
  body:not(.tv-wide):not(.tv-mode) .topbar .iconbtn{width:44px;height:44px}
  body:not(.tv-wide) .view{padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right));padding-bottom:var(--section-nav-space)}
  body:not(.tv-wide) :is(button,a,summary,input,select,textarea){scroll-margin-top:calc(var(--header-space) + 12px);scroll-margin-bottom:var(--section-nav-space)}
  body:not(.tv-wide) .toast,body:not(.tv-wide) .party-notice{bottom:var(--section-nav-space)}
}

/* A short landscape is a two-column work area, not a wide portrait page.
   svh keeps wheel dimensions stable as browser bars expand and collapse.
   Controls flow down the page instead of creating another scrolling rail. */
@media(min-width:600px) and (max-width:1050px) and (max-height:600px) and (orientation:landscape), (min-width:600px) and (max-height:600px) and (orientation:landscape) and (pointer:coarse){
  body:not(.tv-mode){--navh:48px;--section-nav-space:calc(max(64px,4rem) + env(safe-area-inset-bottom))}
  body:not(.tv-mode) .brand .brand-sigil{width:38px;height:38px}
  body:not(.tv-mode) .brand .brand-wordmark{width:130px}
  body:not(.tv-mode) .iconbtn{width:44px;height:44px}
  body:not(.tv-mode) .mobile-nav{border-radius:14px;padding:3px}
  body:not(.tv-mode) .mnav{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:2px 6px;font-size:.8rem;padding:5px;overflow-wrap:normal}
  body:not(.tv-mode) .mnav span{flex:none;margin:0;font-size:1rem}
  body:not(.tv-mode) .view{padding-top:14px}
  body:not(.tv-mode) .ritual-head{grid-template-columns:minmax(0,1fr) minmax(110px,auto);gap:12px;align-items:center;margin-bottom:14px}
  body:not(.tv-mode) .display{font-size:1.9rem;line-height:1.08;margin:5px 0}
  body:not(.tv-mode) .display br{display:none}
  body:not(.tv-mode) .lede{font-size:.9rem;line-height:1.4}
  body:not(.tv-mode) .ritual-meta{max-width:190px;justify-content:flex-end;justify-self:end;gap:5px}
  body:not(.tv-mode) .pill{padding:5px 8px;line-height:1.35}
  body:not(.tv-mode) .ritual-grid{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:20px;align-items:start}
  body:not(.tv-mode) .wheel-stage{padding-top:8px}
  body:not(.tv-mode) .wheel-shell{width:min(100%,340px,calc(100svh - 128px));max-width:100%;margin:0 auto;transform:none;contain:layout paint}
  body:not(.tv-mode) .pointer{transform:translateX(-50%) scale(.7);transform-origin:top center}
  body:not(.tv-mode) .runering:before,body:not(.tv-mode) .runering:after{font-size:.7rem;letter-spacing:1em}
  body:not(.tv-mode) .wheel-key{margin:8px auto 0}
  body:not(.tv-mode) .wheel-key summary{padding:10px 4px}
  body:not(.tv-mode) .tap-hint{line-height:1.4;margin-top:5px}
  body:not(.tv-mode) .ritual-rail{gap:12px}
  body:not(.tv-mode) .fate-panel{width:100%;padding:12px;border-radius:18px}
  body:not(.tv-mode) .fate-panel .module-heading{margin-bottom:0}
  body:not(.tv-mode) .fate-title{font-size:1.2rem}
  body:not(.tv-mode) .fate-copy{margin:2px 0 8px}
  body:not(.tv-mode) .result-window{min-height:0;padding:10px;border-radius:12px}
  body:not(.tv-mode) .result-category{font-size:1.3rem;line-height:1.25}
  body:not(.tv-mode) .result-meta:empty{display:none}
  body:not(.tv-mode) .draw-options{margin:4px 0}
  body:not(.tv-mode) .fate-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  body:not(.tv-mode) .fate-actions>.two{grid-column:1/-1;grid-template-columns:repeat(2,minmax(0,1fr))}
  body:not(.tv-mode) #spinBtn{grid-column:1/-1}
  body:not(.tv-mode) .fate-actions .btn{min-height:44px;padding:10px;font-size:.875rem;line-height:1.35;white-space:normal;overflow-wrap:anywhere}
  body:not(.tv-mode) #homeSecondary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:16px}
  body:not(.tv-mode) #homeSecondary .home-profile{margin:0;padding:14px;display:flex;flex-wrap:wrap;gap:10px;align-content:start}
  body:not(.tv-mode) #homeSecondary .home-profile>div{min-width:0}
  body:not(.tv-mode) #homeSecondary .tour-offer{grid-column:1/-1}
  body:not(.tv-mode) #homeFeatureSlot .feature-inner,body:not(.tv-mode) #homeFeatureSlot .party-film-layout{grid-template-columns:100px minmax(0,1fr);padding:14px;gap:14px}
  body:not(.tv-mode) #homeFeatureSlot .feature-poster{width:100px;min-height:150px;align-self:start}
  body:not(.tv-mode) #homeFeatureSlot h3{font-size:1.5rem;line-height:1.2}
  body:not(.tv-mode) #homeFeatureSlot .party-film-body{grid-column:1/-1}
  body:not(.tv-mode) .section-title{font-size:1.9rem}
  body:not(.tv-mode) .poster-grid,body:not(.tv-mode) .discover-grid{grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}
  body:not(.tv-mode) .poster-art{max-height:230px}
  body:not(.tv-mode) .poster-art img{object-fit:contain}
  body:not(.tv-mode) .movie-poster-card:hover .poster-art img.loaded{transform:none}
  body:not(.tv-mode) .poster-card-copy b{font-size:1rem;overflow-wrap:anywhere}
  body:not(.tv-mode) .poster-card-copy small{white-space:normal;line-height:1.4}
  body:not(.tv-mode) .discover-actions .btn{min-height:44px;white-space:normal}
  body:not(.tv-mode) .movie-dossier{width:min(960px,100%);max-height:100%;border-radius:18px;scroll-padding:60px 12px 16px}
  body:not(.tv-mode) .dossier-body{grid-template-columns:clamp(100px,18vw,150px) minmax(0,1fr);gap:16px;padding:58px 18px 18px;align-items:start}
  body:not(.tv-mode) .dossier-copy{display:contents}
  body:not(.tv-mode) .dossier-poster{width:100%;margin:0}
  body:not(.tv-mode) .dossier-title{font-size:clamp(1.8rem,3.8vw,2.6rem);line-height:1.1;overflow-wrap:anywhere}
  body:not(.tv-mode) .dossier-intro .module-heading{margin-bottom:8px}
  body:not(.tv-mode) .dossier-overview{margin-bottom:0}
  body:not(.tv-mode) .dossier-decisions,body:not(.tv-mode) .watch-box,body:not(.tv-mode) .related-box{grid-column:1/-1;min-width:0;margin-top:0}
  body:not(.tv-mode) .dossier-actions{grid-template-columns:repeat(3,minmax(0,1fr));margin-top:0}
  body:not(.tv-mode) .dossier-actions .primary{grid-column:auto}
  body:not(.tv-mode) .dossier-actions .btn{min-height:44px;font-size:.9rem;line-height:1.4}
  body:not(.tv-mode) .dossier-close{width:44px;height:44px;top:8px;margin:8px 10px -52px 0}
  body:not(.tv-mode) .dossier-fallback{padding:8px}
  body:not(.tv-mode) .dossier-fallback span{font-size:2rem}
  body:not(.tv-mode) .dossier-fallback b{font-size:1rem;margin-top:8px;overflow-wrap:anywhere}
  body:not(.tv-mode) .watch-title{display:flex;flex-wrap:wrap}
  body:not(.tv-mode) .provider-row{grid-template-columns:70px minmax(0,1fr)}
  body:not(.tv-mode) .related-grid{grid-template-columns:repeat(auto-fit,minmax(125px,1fr))}
}

/* Bound all short-screen overlays, including the category reveal and trailer.
   The trailer bar comes first visually and in tab order, so Close is reachable
   even when captions, browser chrome or a keyboard reduce the available height. */
@media(max-height:600px){
  body:not(.tv-mode) .overlay{--overlay-room:calc(100dvh - max(8px,env(safe-area-inset-top)) - max(8px,env(safe-area-inset-bottom)));padding:max(8px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));place-items:safe center}
  body:not(.tv-mode) .movie-dossier{max-height:var(--overlay-room)}
  body:not(.tv-mode) .omen{max-height:var(--overlay-room);overflow:auto;padding:24px 8px 8px}
  body:not(.tv-mode) .omen-ring{width:72px;height:72px;margin-bottom:14px}
  body:not(.tv-mode) .omen-icon .fright-art{width:70px;height:70px}
  body:not(.tv-mode) .omen h2{font-size:2rem;line-height:1.15}
  body:not(.tv-mode) .omen p{margin:10px auto;font-size:.95rem}
  body:not(.tv-mode) .omen-actions .btn{min-height:44px}
  body:not(.tv-mode) .trailer-modal{width:min(960px,100%);max-height:var(--overlay-room);overflow:auto;display:flex;flex-direction:column}
  body:not(.tv-mode) .trailer-bar{order:-1;position:sticky;top:0;z-index:1;display:flex;flex-wrap:wrap;gap:8px;padding:8px 12px;background:#100b12}
  body:not(.tv-mode) .trailer-bar b{flex:1;min-width:120px;overflow-wrap:anywhere}
  body:not(.tv-mode) .trailer-bar .inline{flex-wrap:wrap;margin:0}
  body:not(.tv-mode) .trailer-bar .btn{min-height:44px;white-space:normal}
  body:not(.tv-mode) .trailer-frame{flex:none;width:100%;max-height:calc(100svh - 90px)}
}
