/* Flixy 2.5 responsive experience layer */
:root{
  --flixy-page-max:1560px;
  --flixy-ui-radius:14px;
  --flixy-card-gap:12px;
  --flixy-backdrop-blur:14px;
  --flixy-motion-scale:1;
  --flixy-mobile-columns:3;
  --flixy-mobile-touch:44px;
  --flixy-mobile-poster-width:31vw;
  --flixy-terminal-opacity:.98;
  --flixy-vh:1vh;
}
html{max-width:100%;overflow-x:clip}
body{max-width:100%;overflow-x:clip}
:where(button,a,input,select,textarea,[role="button"]){-webkit-tap-highlight-color:transparent}
:where(button,a,[role="button"]){touch-action:manipulation}
:where(.max-w-7xl,.max-w-6xl,.max-w-5xl,.settings-overhaul-shell,.library-shell,.connections-shell){max-width:var(--flixy-page-max)!important}
:where(.card,.panel,.modal,.settings-card,.settings-custom-section,.settings-open-section,.movie-finder-panel,.flixy-terminal-window){border-radius:var(--flixy-ui-radius)}
:where(.backdrop-blur,.backdrop-blur-xl,.backdrop-blur-2xl){backdrop-filter:blur(var(--flixy-backdrop-blur))!important}
.flixy-terminal-window{opacity:var(--flixy-terminal-opacity)}

@media(max-width:820px){
  :root{--flixy-mobile-inline:clamp(.85rem,4vw,1.15rem)}
  html{-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-padding-top:5rem}
  body{min-height:calc(var(--flixy-vh)*100);padding-bottom:env(safe-area-inset-bottom)}
  :where(input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),select,textarea){font-size:16px!important}
  :where(button,[role="button"],input[type="button"],input[type="submit"]){min-height:var(--flixy-mobile-touch)}
  :where(main):not(.ai-workspace-main):not(.settings-overhaul-shell){max-width:100%;overflow-x:clip}
  :where(main.px-6,main.px-8,.px-6,.px-8){padding-left:var(--flixy-mobile-inline)!important;padding-right:var(--flixy-mobile-inline)!important}
  :where(.gap-8,.gap-10,.gap-12){gap:clamp(.9rem,3vw,1.35rem)!important}
  :where(.space-y-12)>:not([hidden])~:not([hidden]){margin-top:2rem!important}

  html[data-flixy-mobile-hero="off"] #hero{display:none!important}
  #hero{
    min-height:min(82svh,720px)!important;
    padding:5.25rem var(--flixy-mobile-inline) 3.25rem!important;
    align-items:flex-end!important;
  }
  #heroContent{gap:1rem!important}
  #heroContent h1{max-width:18ch;font-size:clamp(2rem,9vw,3.3rem)!important}
  #heroContent p{font-size:.86rem!important;line-height:1.55!important}
  #heroDots{bottom:1rem!important}

  a[data-media-card="1"],
  [data-media-card="1"]{
    width:var(--flixy-mobile-poster-width)!important;
    min-width:var(--flixy-mobile-poster-width)!important;
    flex:0 0 var(--flixy-mobile-poster-width)!important;
  }
  html[data-flixy-mobile-posters="compact"]{--flixy-mobile-poster-width:27vw}
  html[data-flixy-mobile-posters="standard"]{--flixy-mobile-poster-width:31vw}
  html[data-flixy-mobile-posters="large"]{--flixy-mobile-poster-width:40vw}
  :where([data-poster-grid],.media-grid,.movie-grid,.poster-grid,.library-grid){grid-template-columns:repeat(var(--flixy-mobile-columns),minmax(0,1fr))!important;gap:var(--flixy-card-gap)!important}

  .movie-finder-panel{
    position:fixed!important;inset:auto .5rem calc(.5rem + env(safe-area-inset-bottom)) .5rem!important;
    width:auto!important;max-width:none!important;max-height:min(88dvh,760px)!important;border-radius:20px!important;
  }
  html[data-flixy-mobile-sheets="full"] .movie-finder-panel{inset:0!important;max-height:none!important;border-radius:0!important;padding-top:env(safe-area-inset-top)}
  .movie-chat-form{grid-template-columns:minmax(0,1fr) auto auto!important;gap:.45rem!important}
  .movie-chat-form textarea{min-width:0!important}
  .movie-chat-mic,.movie-chat-send{width:var(--flixy-mobile-touch)!important;height:var(--flixy-mobile-touch)!important;min-height:var(--flixy-mobile-touch)!important}

  .flixy-terminal-backdrop{align-items:flex-end!important;padding:0!important}
  .flixy-terminal-window{
    width:100%!important;height:min(88dvh,780px)!important;max-height:calc(var(--flixy-vh)*100 - env(safe-area-inset-top))!important;
    border-radius:20px 20px 0 0!important;border-bottom:0!important;
  }
  .flixy-terminal-titlebar{min-height:3.25rem!important;gap:.55rem!important;padding:.5rem .65rem!important}
  .flixy-terminal-statusbar{overflow-x:auto;flex-wrap:nowrap!important;scrollbar-width:none}
  .flixy-terminal-statusbar::-webkit-scrollbar{display:none}
  .flixy-terminal-output{padding:.8rem!important}
  .flixy-terminal-line{font-size:.75rem!important}
  .flixy-terminal-input-row{padding:.65rem!important}
  .flixy-terminal-input-row>span{display:none}
  .flixy-terminal-window footer{display:none!important}
  html[data-flixy-mobile-toolbar="compact"] .flixy-terminal-statusbar>span:nth-child(n+3){display:none}

  :where(dialog,.modal,.modal-panel,[role="dialog"]):not(.movie-finder-panel):not(.flixy-terminal-window){max-width:calc(100vw - 1rem)!important;max-height:calc(100dvh - 1rem)!important}
  :where(.modal-backdrop,.fixed.inset-0){overscroll-behavior:contain}

  .settings-overhaul-shell{width:100%!important;max-width:none!important;padding-left:var(--flixy-mobile-inline)!important;padding-right:var(--flixy-mobile-inline)!important}
  .settings-account-strip{width:100%}
  .settings-tabbar{margin-inline:calc(var(--flixy-mobile-inline)*-1)!important;padding-inline:var(--flixy-mobile-inline)!important;scroll-snap-type:x proximity}
  .settings-tab{scroll-snap-align:start}
  .settings-row{min-width:0}
  .settings-row-copy{min-width:0}
  .settings-control{max-width:52%!important}

  :where(.og-header,.sg-header,.game-header,.arcade-header){padding-left:.7rem!important;padding-right:.7rem!important}
  :where(.og-header nav,.sg-header nav,.game-header nav){gap:.35rem!important}
  :where(.og-shell,.sg-shell,.game-shell,.arcade-shell){max-width:100%!important;padding-left:var(--flixy-mobile-inline)!important;padding-right:var(--flixy-mobile-inline)!important}
  canvas{max-width:100%;touch-action:none}

  html[data-flixy-mobile-touch="compact"]{--flixy-mobile-touch:40px}
  html[data-flixy-mobile-touch="comfortable"]{--flixy-mobile-touch:44px}
  html[data-flixy-mobile-touch="large"]{--flixy-mobile-touch:50px}
}

@media(max-width:480px){
  :root{--flixy-mobile-inline:.85rem}
  #hero{min-height:76svh!important}
  #heroContent h1{font-size:clamp(1.9rem,10vw,2.75rem)!important}
  :where(.settings-panel>.settings-card,.settings-panel>.settings-open-section,.settings-panel>.settings-custom-section){padding:.95rem!important}
  .settings-row{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:.75rem!important}
  .settings-control{max-width:48vw!important}
  .settings-range-wrap{max-width:46vw!important}
  .settings-range-wrap input[type="range"]{width:100%!important}
}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
}

/* v522: catalog hero artwork keeps its true centered, undimmed composition on phones. */
@media(max-width:900px){
  body.immersive-header #hero #heroBg.hero-backdrop-fill{background-size:cover!important;background-position:center center!important;filter:none!important;opacity:1}
  body.immersive-header #hero .hero-soft-fade,body.immersive-header #hero .hero-side-fade{display:block!important;background:none!important;opacity:0!important}
}
