/* PHOENYX cinematic visual refresh — only presentation; existing PHP APIs untouched. */
:root {
  --px-surface:#111824; --px-surface2:#161f2e; --px-stroke:rgba(209,221,247,.11);
  --px-secondary:#a7b5c9; --px-accent:#f6c65b; --px-violet:#8058f4;
}
html { scroll-padding-top:100px; }
body {
  background:radial-gradient(ellipse 60% 35% at 75% -8%,rgba(107,67,210,.19),transparent 70%),radial-gradient(ellipse 48% 26% at 0 0,rgba(244,185,72,.06),transparent),#090d16;
  color:#f5f6fa;
}
button, a, input { -webkit-tap-highlight-color:transparent; }
:focus-visible { outline:2px solid var(--gold)!important; outline-offset:3px; }
.px-sr-only { position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap; }
.container{--max-width:1380px}
.site-header{background:rgba(9,13,21,.95);border-bottom:1px solid var(--px-stroke);box-shadow:0 12px 40px rgba(0,0,0,.12);}
.site-header .navbar{min-height:76px;gap:15px;max-width:1600px}
.site-header .brand img{width:148px;max-height:54px;object-fit:contain}
.site-header .nav-links{gap:3px;margin-left:12px}
.site-header .nav-link{font-weight:600;font-size:13px;padding:10px 11px;border-radius:12px}
.site-header .nav-link:hover,.site-header .nav-link.active{background:rgba(255,255,255,.09);color:var(--gold)}
.site-header .btn{min-height:37px;padding:0 12px;font-size:12px;border-radius:10px;white-space:nowrap}
.site-header .icon-btn{min-height:37px;height:37px;width:37px;font-size:18px;border-radius:10px}
.site-header .nav-actions{gap:7px}
.px-header-search{margin-left:auto;display:flex;align-items:center;min-width:170px;width:min(25vw,360px);height:39px;background:#161d29;border:1px solid var(--px-stroke);border-radius:999px;padding:0 14px;gap:10px}
.px-header-search svg{width:18px;fill:none;stroke:#b4bbcb;stroke-width:2;flex-shrink:0}
.px-header-search input{border:0;background:none;color:inherit;outline:0;min-width:0;width:100%;font-size:13px}
.px-header-search input::placeholder{color:#8490a4}
.px-theme-switch{background:#171f2c;border:1px solid var(--px-stroke);width:38px;height:38px;border-radius:12px;color:var(--gold);font-size:17px;flex-shrink:0;display:grid;place-items:center}
.px-theme-switch:hover{border-color:var(--gold)}
.px-sidebar{position:fixed;top:76px;bottom:0;left:0;width:220px;z-index:80;overflow:auto;background:#0d131f;border-right:1px solid var(--px-stroke);padding:23px 14px 30px;display:flex;flex-direction:column;gap:7px}
.px-sidebar-label{font-size:10px;font-weight:900;letter-spacing:.19em;color:#798aa2;padding:14px 13px 7px}
.px-side-link{display:flex;gap:13px;align-items:center;padding:12px 13px;border-radius:12px;color:#bac7d9;font-size:13px;font-weight:650;transition:background .2s}
.px-side-link svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8}
.px-side-link:hover,.px-side-link.active{background:#1c2635;color:#fff}
.px-side-link.active:before{content:'';width:3px;background:var(--gold);border-radius:4px;position:absolute;left:14px;height:26px}
.px-side-feature{margin-top:20px;background:linear-gradient(145deg,rgba(123,84,236,.22),rgba(249,188,82,.08));padding:18px 15px;border:1px solid var(--px-stroke);border-radius:15px}
.px-side-feature b{color:#ffe4a9;display:block;font-size:13px}
.px-side-feature p{font-size:12px;line-height:1.55;color:#a9b5c6}
.px-side-feature a{font-size:12px;color:var(--gold);font-weight:750}
body.px-sidebar-visible .page-main{margin-left:220px}
body.px-sidebar-visible .page-main>.container{max-width:1380px}
.px-bottom-nav{display:none}
/* Homepage */
.px-home-wrap{padding-top:24px;padding-bottom:50px}
.px-chips{display:flex;gap:10px;overflow-x:auto;scrollbar-width:none;padding:0 0 4px;white-space:nowrap}
.px-chips::-webkit-scrollbar{display:none}
.px-chip{display:inline-flex;align-items:center;justify-content:center;padding:9px 18px;border:1px solid rgba(255,255,255,.065);background:#1a2230;border-radius:10px;color:#e4e9f4;font-size:12px;font-weight:750;transition:.2s}
.px-chip:hover{background:#2b3547}
.px-chip-active{background:#f2f4f7;color:#151823;border-color:transparent}
.px-feature{min-height:352px;margin-top:22px;margin-bottom:48px;display:grid;grid-template-columns:1.3fr .85fr;align-items:center;gap:30px;position:relative;isolation:isolate;border-radius:27px;border:1px solid rgba(174,154,235,.17);overflow:hidden;background:radial-gradient(ellipse at 77% 40%,rgba(126,82,246,.29),transparent 37%),linear-gradient(125deg,#171c31 10%,#171629 55%,#211d37 100%);padding:48px clamp(24px,5vw,68px)}
.px-feature:after{content:'';position:absolute;bottom:-140px;right:7%;width:330px;height:330px;border:1px solid rgba(240,183,99,.1);border-radius:50%;z-index:-1;box-shadow:0 0 0 65px rgba(239,197,91,.018),0 0 0 128px rgba(255,255,255,.012)}
.px-eyebrow,.px-overline{font-size:10px;letter-spacing:.19em;color:var(--gold);font-weight:900;line-height:1.5}
.px-live-dot{width:7px;height:7px;display:inline-block;border-radius:50%;background:#e5b451;margin-right:9px;box-shadow:0 0 15px rgba(255,201,103,.6)}
.px-feature h1{max-width:700px;letter-spacing:-.055em;line-height:1.04;font-size:clamp(36px,4.8vw,72px);margin:16px 0 16px}
.px-feature h1 em{font-style:normal;color:var(--gold)}
.px-feature p{max-width:530px;color:#bec5d5;font-size:15px}
.px-hero-search{margin:25px 0 18px;max-width:520px;display:flex;border:1px solid rgba(255,255,255,.15);border-radius:14px;background:#111522;padding:5px;gap:6px}
.px-hero-search input{background:transparent;border:0;outline:0;color:#fff;flex:1;min-width:0;padding:12px;font-size:14px}
.px-hero-search button,.px-main-cta{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:10px;padding:13px 20px;background:linear-gradient(125deg,#fbd271,#e8b34f);color:#141414;font-weight:850;font-size:13px;white-space:nowrap}
.px-hero-search button span{margin-left:12px}
.px-feature-actions{display:flex;gap:22px;align-items:center;flex-wrap:wrap}
.px-feature-actions .px-main-cta{background:#8058f4;color:#fff}
.px-sub-cta,.px-view-all{font-size:13px;color:#d4d7eb;font-weight:760}
.px-trust{display:flex;gap:16px;flex-wrap:wrap;margin-top:24px;font-size:11px;color:#a7b4c8}
.px-feature-art{min-width:0;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:10px;position:relative}
.px-feature-art img{position:relative;width:100%;max-width:400px;filter:drop-shadow(0 14px 35px rgba(0,0,0,.3));}
.px-art-glow{position:absolute;inset:0;background:radial-gradient(circle,rgba(234,182,87,.18),transparent 62%);filter:blur(20px)}
.px-art-note{color:#a7a5c1;font-size:10px;letter-spacing:.2em}
.px-heading-row{display:flex;justify-content:space-between;align-items:flex-end;gap:20px;margin:33px 0 19px;scroll-margin-top:110px}
.px-heading-row h2{font-size:clamp(24px,2.6vw,34px);letter-spacing:-.04em;margin:5px 0 0}
.px-heading-row h2 span{color:#a7b2c7}
.px-view-all{color:var(--gold);white-space:nowrap}
.px-video-card{border-radius:15px;background:transparent;border:1px solid transparent;box-shadow:none;overflow:visible;min-width:0}
.px-video-card:hover{border-color:transparent;transform:none;box-shadow:none}
.px-thumb{display:block;overflow:hidden;aspect-ratio:16/9;background:#202a3b;border-radius:15px;position:relative}
.px-thumb img{width:100%;height:100%;object-fit:cover}
.px-thumb-play{position:absolute;top:50%;left:50%;width:48px;height:48px;display:grid;place-items:center;transform:translate(-50%,-50%) scale(.8);border-radius:50%;background:rgba(9,10,14,.65);color:white;font-size:19px;opacity:0;transition:.2s}
.px-video-card:hover .px-thumb-play,.px-thumb:focus-visible .px-thumb-play{opacity:1;transform:translate(-50%,-50%) scale(1)}
.px-video-card .card-body{padding:13px 4px 5px}
.px-card-top{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:7px}
.px-video-card .card-category{margin:0;text-transform:uppercase;letter-spacing:.1em;color:#c1a1fa;font-size:10px;max-width:75%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.px-access{padding:4px 8px;border-radius:6px;font-size:10px;color:#b7d4d5;background:rgba(56,186,185,.12)}
.px-access-premium{color:var(--gold);background:rgba(246,198,91,.12)}
.px-video-card .card-title{font-size:15px;line-height:1.4;letter-spacing:-.02em;min-height:42px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.px-video-card .card-description{display:none}
.px-video-card .card-meta{font-size:11px;color:#96a7bb;gap:14px;margin:9px 0 12px}
.px-watch{border:1px solid #363e52;background:#1c2535;color:#f0f2fb;font-weight:750;border-radius:9px;display:flex;align-items:center;justify-content:center;gap:9px;padding:10px 14px;font-size:12px;transition:.18s}
.px-watch:hover{background:linear-gradient(130deg,#7753eb,#945cf6);border-color:transparent;color:#fff}
.px-watch span{font-size:10px}
.px-feed-ad{grid-column:1/-1;min-height:90px;align-items:center;justify-content:center;margin:10px 0;border-radius:12px}
.px-explore-strip{display:flex;justify-content:space-between;align-items:center;gap:24px;position:relative;overflow:hidden;background:linear-gradient(120deg,#1c2640 0,#1c1b35 100%);border:1px solid #373651;border-radius:19px;padding:24px 32px;margin:35px 0 40px}
.px-explore-strip:before{content:'✦';position:absolute;right:23%;font-size:120px;opacity:.07;color:#f7c34b}
.px-explore-strip h2{font-size:25px;letter-spacing:-.04em;margin:2px 0}
.px-explore-strip p:not(.px-overline){margin:4px 0;color:#aeb8ca;font-size:13px}
.px-feed-pagination .page-btn{min-width:41px;height:41px;font-size:13px;border-radius:9px}
.px-feed-pagination .page-btn:disabled{opacity:.35;cursor:not-allowed}
/* Generic pages, consistent with existing form IDs and public JS */
.px-all .page-hero{padding:42px 0 23px}
.px-all .page-title{font-size:clamp(34px,4vw,52px)}
.px-title-accent{color:var(--gold)}
.page-main .toolbar .field,.page-main .toolbar .select,.page-main .search-box{background:#161e2b;border-color:var(--px-stroke)}
.page-main .field:focus,.page-main .select:focus{border-color:var(--gold)}
.page-main .page-hero,.page-main .categories-header{scroll-margin-top:100px}
/* Light mode: variables and legacy static backgrounds both updated. */
html[data-px-theme="light"]{--bg:#f5f7fb;--bg-soft:#e9edf6;--panel:#fff;--panel-2:#f7f9fc;--text:#151d2a;--muted:#66778e;--line:rgba(36,52,76,.14);--px-stroke:rgba(36,52,76,.14)}
html[data-px-theme="light"] body{background:#f3f6fb;color:#172237}
html[data-px-theme="light"] .site-header{background:rgba(255,255,255,.95);color:#182238}
html[data-px-theme="light"] .site-header .nav-link{color:#4c5c73}
html[data-px-theme="light"] .site-header .nav-link.active{background:#eef0f9;color:#6c4adb}
html[data-px-theme="light"] .px-sidebar{background:#fff;color:#1d2a3e}
html[data-px-theme="light"] .px-side-link{color:#45546b}
html[data-px-theme="light"] .px-side-link:hover,html[data-px-theme="light"] .px-side-link.active{background:#f0f1fa;color:#3c2a80}
html[data-px-theme="light"] .px-side-feature{background:#f2ecff}
html[data-px-theme="light"] .px-side-feature b{color:#47328f}
html[data-px-theme="light"] .px-side-feature p{color:#6b6183}
html[data-px-theme="light"] .px-header-search,html[data-px-theme="light"] .px-theme-switch{background:#f4f6fa;color:#273148}
html[data-px-theme="light"] .px-chip{background:#e8ebf2;color:#263449}
html[data-px-theme="light"] .px-chip-active{background:#20263a;color:#fff}
html[data-px-theme="light"] .px-heading-row h2 span{color:#64718c}
html[data-px-theme="light"] .px-video-card .card-title{color:#182238}
html[data-px-theme="light"] .px-video-card .card-meta{color:#6c7890}
html[data-px-theme="light"] .px-video-card .card-category{color:#6340b9}
html[data-px-theme="light"] .px-watch{background:#fff;border-color:#d8dfea;color:#242b45}
html[data-px-theme="light"] .px-watch:hover{color:#fff;background:#7452f5}
html[data-px-theme="light"] .px-main-cta{color:#1c1d22}
html[data-px-theme="light"] .page-main .page-description,html[data-px-theme="light"] .collection-copy{color:#68778d}
html[data-px-theme="light"] .page-main .field,html[data-px-theme="light"] .page-main .select,html[data-px-theme="light"] .page-main .textarea{background:#fff;color:#243047;border-color:#d7dfea}
html[data-px-theme="light"] .page-main .notice,html[data-px-theme="light"] .page-main .collection-card,html[data-px-theme="light"] .center-card,html[data-px-theme="light"] .premium-card{background:#fff;color:#243047;border-color:#dce2ec}
html[data-px-theme="light"] .link-arrow,html[data-px-theme="light"] .px-sub-cta{color:#4f4097}
html[data-px-theme="light"] .site-footer{background:#e9edf5;color:#233047}
html[data-px-theme="light"] .site-footer a,html[data-px-theme="light"] .site-footer p{color:#55647a}
html[data-px-theme="light"] .page-btn{background:#fff;color:#1b2840;border-color:#d7deea}
/* HOME PAGE ONLY: enforce complete 3-column rows on laptop/desktop.
   Legacy style.css defaults the shared .video-grid to 5 columns at common
   laptop widths, leaving the 6th trending card alone on its own row.
   Scope this fix to Home so All Videos/Categories keep their old layouts. */
@media (min-width:781px){
  body.px-home #trendingGrid,
  body.px-home #homeFeedGrid {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:clamp(16px,1.8vw,26px);
    width:100%;
  }
}
@media (max-width:780px){
  body.px-home #trendingGrid,
  body.px-home #homeFeedGrid {
    grid-template-columns:minmax(0,1fr);
    width:100%;
  }
}
/* Informational messages/active ads must never leave a short partial row. */
body.px-home #trendingGrid > .notice,
body.px-home #homeFeedGrid > .notice,
body.px-home #homeFeedGrid > .px-feed-ad {
  grid-column:1/-1;
}

@media (max-width:1190px){.px-header-search{max-width:215px}.site-header .nav-links{gap:0}.site-header .nav-link{padding:10px 7px}.site-header .btn{padding:0 8px}}
@media (max-width:1080px) and (min-width:781px){.px-sidebar{width:185px}body.px-sidebar-visible .page-main{margin-left:185px}.px-header-search{display:none}.site-header .navbar{gap:10px}.site-header .brand img{width:135px}.px-feature{padding:30px;min-height:310px}}
@media (max-width:780px){
  html{scroll-padding-top:75px}
  .site-header .navbar{min-height:64px;gap:9px}
  .site-header .brand img{width:139px;max-height:44px}
  .site-header .nav-links{margin:0}
  .site-header .nav-actions{margin-left:auto}
  .site-header .nav-actions>.btn{display:none}
  .site-header .nav-actions .icon-btn{display:none}
  .site-header .mobile-menu-btn{height:36px;width:36px;min-height:36px;font-size:17px}
  .px-header-search{width:100%;min-width:0;max-width:none;flex:1;margin-left:4px;padding:0 11px;height:36px}
  .px-header-search input{font-size:12px}
  .px-theme-switch{width:36px;height:36px}
  .px-sidebar{display:none}
  body.px-sidebar-visible .page-main{margin-left:0}
  .px-bottom-nav{display:flex;position:fixed;bottom:0;left:0;right:0;z-index:200;background:rgba(12,16,27,.97);border-top:1px solid rgba(255,255,255,.12);padding:8px 6px max(9px,env(safe-area-inset-bottom));justify-content:space-around;backdrop-filter:blur(12px)}
  .px-bottom-nav a{min-width:58px;min-height:48px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:3px;color:#a9b5c9;font-size:10px;text-align:center}
  .px-bottom-nav a.active{color:var(--gold)}
  .px-bottom-nav svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8}
  html[data-px-theme="light"] .px-bottom-nav{background:rgba(255,255,255,.97);border-color:#d7dfea}
  html[data-px-theme="light"] .px-bottom-nav a{color:#52627b}
  html[data-px-theme="light"] .px-bottom-nav a.active{color:#744be1}
  body{padding-bottom:67px}
  .page-main{min-height:75vh}
  .px-home-wrap{padding-top:14px}
  .px-chips{margin-bottom:16px;gap:8px}
  .px-chip{padding:7px 13px;font-size:12px}
  .px-feature{display:none} /* YouTube-inspired mobile: videos first */
  .px-heading-row{margin:18px 0 12px}
  .px-heading-row h2{font-size:21px}
  .px-overline{font-size:9px}
  .px-trending-grid,.px-feed,.video-grid{grid-template-columns:1fr;gap:22px}
  .px-video-card{width:100%}
  .px-thumb{border-radius:12px}
  .px-video-card .card-body{padding:11px 2px 0}
  .px-video-card .card-title{font-size:16px;min-height:auto}
  .px-watch{padding:12px;font-size:13px}
  .px-explore-strip{padding:19px;gap:12px;flex-direction:column;align-items:flex-start;margin:24px 0}
  .px-explore-strip h2{font-size:21px}
  .px-all .page-hero{padding:26px 0 12px}
  .px-all .page-title{font-size:29px}
  .px-all .page-description{font-size:13px}
  .toolbar{flex-direction:column}
  .toolbar .select{width:100%!important}
  .section{padding:25px 0}
}
@media (max-width:470px){
 .container{width:calc(100% - 28px)}
 .px-home-wrap{width:100%;padding-inline:0}
 .px-home-wrap>.px-chips,.px-home-wrap>.px-heading-row,.px-home-wrap>.px-explore-strip,.px-home-wrap>.px-feed-pagination{margin-left:14px;margin-right:14px}
 .px-home-wrap>.video-grid{gap:18px}
 .px-home-wrap>.video-grid>.px-video-card{border-radius:0}
 .px-home-wrap>.video-grid .px-thumb{border-radius:0;width:100%}
 .px-home-wrap>.video-grid .card-body{padding:10px 14px 3px}
 .px-home-wrap>.video-grid>.notice{margin:0 14px}
 .px-header-search{display:none} /* phone top search opens searchable all-videos page */
 .px-theme-switch{margin-left:auto}
 .site-header .nav-actions .icon-btn{display:flex}
 .site-header .brand img{width:143px}
 .px-heading-row h2{font-size:22px}
 .px-explore-strip{margin-top:25px}
 .px-watch{padding:11px}
}
@media (prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
/* The mobile home screen should lead directly with full-width feed cards. */
@media (max-width:780px){.px-home #trending,.px-home .px-trending-grid,.px-home .px-explore-strip{display:none}.px-home #new-videos{margin-top:6px}}
/* Correct legacy mobile header wrapping: keep logo, search/action and menu on one row. */
@media(max-width:780px){
 .site-header .navbar{flex-wrap:nowrap!important;position:relative}
 .site-header .brand{margin-right:auto;flex-shrink:0;order:0}
 .site-header .px-header-search{order:1;flex:1}
 .site-header .px-theme-switch{order:2;margin-left:0;flex-shrink:0}
 .site-header .nav-actions{order:3!important;width:auto!important;margin:0!important;justify-content:flex-end!important;flex-shrink:0}
 .site-header .mobile-menu-btn{order:4!important;margin:0!important;flex-shrink:0}
 .site-header .nav-links{order:5!important;position:absolute!important;top:calc(100% - 1px);left:14px;right:14px;width:auto!important;z-index:120}
 .site-header .nav-links.open{position:absolute!important;display:grid!important;margin-top:0}
}
.video-stage video,.video-stage iframe{max-width:100%;max-height:80vh;object-fit:contain}

/* Header UX fix: never show duplicate searches at the same desktop width.
   Keep the full search box on desktop, retaining the clickable search icon
   for compact/tablet/mobile widths where that box is hidden. */
@media (min-width:1081px) {
  .site-header .nav-actions > a.icon-btn[aria-label="Search"] {
    display:none;
  }
}

/* Ensure cinematic hero headline stays legible even when the surrounding site uses light mode. */
html[data-px-theme="light"] .px-feature h1{color:#fff}
