:root{
  --bg:#0b0d10;
  --surface:#13161b;
  --surface-2:#191d23;
  --surface-3:#20252d;
  --border:#2a3039;
  --border-soft:#222831;
  --text:#f4f6f8;
  --muted:#929aa6;
  --accent:#7c9cff;
  --accent-2:#9b87f5;
  --danger:#ef5b70;
  --good:#6fd08c;
  --radius:14px;
  --shadow:0 14px 36px rgba(0,0,0,.28);
}

*{box-sizing:border-box}
html{background:var(--bg)}
body.videos-page,body.video-upload-page,body.video-login-page{
  margin:0;min-height:100vh;overflow-x:hidden;color:var(--text);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:var(--bg);
}
button,a,input,textarea{font:inherit}
button,a{-webkit-tap-highlight-color:transparent}
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

/* ===== GALLERY ===== */
body.videos-page>.wrap{width:min(1100px,calc(100vw - 40px));margin:0 auto;padding:24px 0 44px}
.videos-page .top{
  display:grid;grid-template-columns:1fr auto;grid-template-areas:"title actions" "center center";
  gap:14px 20px;align-items:center;margin-bottom:18px;padding:16px 18px;
  border:1px solid var(--border);border-radius:16px;background:var(--surface);box-shadow:0 8px 24px rgba(0,0,0,.18)
}
.videos-page .title{grid-area:title}
.videos-page .title h1{margin:0;font-size:25px;line-height:1.05;letter-spacing:-.035em}
.videos-page .title p{margin:6px 0 0;color:var(--muted);font-size:12px}
.videos-page #clipCount{color:var(--text);font-weight:800}
.videos-page .topCenter{grid-area:center;display:flex;gap:8px;justify-content:flex-start;flex-wrap:wrap;padding-top:12px;border-top:1px solid var(--border-soft)}
.videos-page .actions{grid-area:actions;display:flex;gap:8px;align-items:center;justify-content:flex-end;flex-wrap:wrap}
.videos-page .status{flex-basis:100%;min-height:0;text-align:right;color:var(--muted);font-size:11px}

.videos-page .randomBtn,.videos-page .logout,.videos-page .upload,.videos-page .like,
.video-upload-page button,.video-upload-page .btn,.video-login-page button,.video-login-page .login button{
  min-height:36px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:8px 11px;
  border:1px solid var(--border);border-radius:9px;background:var(--surface-2);color:var(--text);
  text-decoration:none;font-size:12px;font-weight:750;cursor:pointer;transition:background .15s ease,border-color .15s ease,transform .15s ease
}
.videos-page .randomBtn:hover,.videos-page .logout:hover,.videos-page .like:hover,.video-upload-page .btn:hover{background:var(--surface-3);border-color:#3b4450}
.videos-page .upload{background:var(--accent);border-color:var(--accent);color:#0a1020}
.videos-page .upload:hover{filter:brightness(1.08)}
.videos-page .randomBtn.active{background:#283453;border-color:#526cae;color:#fff}

/* Exactly 3 compact previews per row on normal desktop */
.videos-page .grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;align-items:start}
.videos-page .lazySentinel{height:1px}
.videos-page .card{position:relative;min-width:0;overflow:hidden;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);box-shadow:0 7px 20px rgba(0,0,0,.18);transition:border-color .15s ease,transform .15s ease}
.videos-page .thumb{position:relative;overflow:hidden;display:block;cursor:pointer;background:#050607;isolation:isolate;line-height:0}
.videos-page .thumb:after{content:none}
.videos-page .thumb img{width:100%;height:auto;display:block;background:#050607;object-fit:contain}
.videos-page .thumb video{width:100%;height:100%;object-fit:contain;display:block;background:#050607}
.videos-page .thumb video.hoverPreview{position:absolute;inset:0;z-index:1;opacity:0;pointer-events:none;background:#000}
.videos-page .thumb.previewing video.hoverPreview{opacity:1}
.videos-page .thumb.previewing img{visibility:hidden}
.videos-page .thumb .play,.videos-page .thumb .deleteBtn{z-index:4}
.videos-page .noThumb{aspect-ratio:9/16;display:grid;place-items:center;padding:18px;color:var(--muted);font-size:12px;font-weight:700;text-align:center;line-height:1.35}
.videos-page .play{position:absolute;right:10px;bottom:10px;width:38px;height:38px;display:grid;place-items:center;border:1px solid rgba(255,255,255,.2);border-radius:50%;background:rgba(10,12,15,.78);color:#fff;font-size:15px;backdrop-filter:blur(7px)}
.videos-page .deleteBtn{position:absolute;top:9px;right:9px;width:31px;height:31px;display:grid;place-items:center;border:1px solid rgba(255,255,255,.18);border-radius:50%;background:rgba(10,12,15,.78);color:#fff;font-size:13px;font-weight:900;cursor:pointer;backdrop-filter:blur(7px)}
.videos-page .deleteBtn:hover{background:var(--danger)}
.videos-page .meta{padding:10px 11px 11px}
.videos-page .name{margin-bottom:6px;overflow:hidden;color:var(--text);font-size:12px;font-weight:800;white-space:nowrap;text-overflow:ellipsis}
.videos-page .sub{display:flex;justify-content:space-between;gap:8px;margin-bottom:8px;color:var(--muted);font-size:10.5px}
.videos-page .like{width:100%;min-height:32px;padding:6px 9px;background:var(--surface-2);font-size:11px}
.videos-page .like.liked{background:#34232c;border-color:#70404d;color:#ffd9df}
.videos-page .empty{padding:28px;border:1px dashed var(--border);border-radius:14px;background:var(--surface);color:var(--muted);text-align:center}

/* ===== VIEWER ===== */
.videos-page.viewerOpen{overflow:hidden}
.videos-page .viewer{position:fixed;inset:0;z-index:50;display:none;align-items:center;justify-content:center;padding:18px;background:rgba(0,0,0,.9);backdrop-filter:blur(10px)}
.videos-page .viewer.open{display:flex}
.videos-page .viewer .box{position:relative;width:min(430px,92vw);max-height:94vh}
.videos-page .playerDeck{position:relative;width:100%;max-height:94vh;aspect-ratio:9/16;overflow:hidden;border:1px solid #343b45;border-radius:16px;background:#000;box-shadow:0 24px 70px rgba(0,0,0,.58)}
.videos-page .playerDeck video{position:absolute;inset:0;z-index:1;width:100%;height:100%;object-fit:contain;background:#000;opacity:.001;pointer-events:none;contain:paint}
.videos-page .playerDeck video.activePlayer{z-index:5;opacity:1;pointer-events:auto}
.videos-page .frameCover{position:absolute;inset:0;z-index:8;width:100%;height:100%;object-fit:contain;background:#000;opacity:0;visibility:hidden;pointer-events:none}
.videos-page .frameCover.show{opacity:1;visibility:visible}
.videos-page .close{position:absolute;top:-11px;right:-11px;z-index:10;width:38px;height:38px;border:1px solid #dfe4ea;border-radius:50%;background:#fff;color:#111;font-size:21px;font-weight:900;cursor:pointer;box-shadow:0 8px 22px rgba(0,0,0,.35)}
.videos-page .viewerRail{position:absolute;left:calc(100% + 12px);top:50%;z-index:3;display:flex;flex-direction:column;gap:8px;transform:translateY(-50%)}
.videos-page .navBtn,.videos-page .viewerLike{width:40px;height:40px;display:grid;place-items:center;padding:0;border:1px solid #39414c;border-radius:50%;background:#171b20;color:#fff;font-size:16px;font-weight:900;cursor:pointer}
.videos-page .navBtn:hover,.videos-page .viewerLike:hover{background:#252b33}
.videos-page .box.randomMode .navBtn:after{content:"🎲";position:absolute;right:-5px;top:-5px;font-size:10px}

/* ===== DUPLICATES ===== */
.videos-page .dupeModal{position:fixed;inset:0;z-index:70;display:none;align-items:center;justify-content:center;padding:18px;background:rgba(0,0,0,.82);backdrop-filter:blur(8px)}
.videos-page .dupeModal.open{display:flex}
.videos-page .dupeBox{width:min(720px,96vw);max-height:88vh;overflow:auto;padding:18px;border:1px solid var(--border);border-radius:16px;background:var(--surface);box-shadow:var(--shadow)}
.videos-page .dupeHead{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:12px}
.videos-page .dupeHead h2{margin:0;font-size:20px}
.videos-page .dupeClose{width:34px;height:34px;border:1px solid var(--border);border-radius:50%;background:var(--surface-2);color:var(--text);font-size:20px;cursor:pointer}
.videos-page .dupeGroup{margin:10px 0;padding:10px;border:1px solid var(--border-soft);border-radius:10px;background:#101318}
.videos-page .dupeGroupTitle{margin-bottom:7px;color:var(--muted);font-size:11px;font-weight:750}
.videos-page .dupeRow{display:grid;grid-template-columns:auto 1fr auto;gap:9px;align-items:center;padding:7px;border-radius:8px;font-size:12px}
.videos-page .dupeRow:hover{background:var(--surface-2)}
.videos-page .dupeKeep{color:var(--good);font-size:10px;font-weight:900}
.videos-page .dupeActions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;margin-top:12px}

/* ===== LOGIN ===== */
.video-login-page{display:grid;place-items:center;padding:22px}
.video-login-page .login,.video-login-page form.box{width:min(400px,calc(100vw - 32px));padding:24px;border:1px solid var(--border);border-radius:16px;background:var(--surface);box-shadow:var(--shadow)}
.video-login-page h1{margin:0 0 18px;font-size:26px}
.video-login-page label{display:block;margin:13px 0 6px;color:var(--muted);font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.06em}
.video-login-page input{width:100%;min-height:44px;padding:0 12px;border:1px solid var(--border);border-radius:9px;background:#0e1115;color:var(--text);outline:none}
.video-login-page input:focus{border-color:var(--accent)}
.video-login-page button{width:100%;min-height:44px;margin-top:18px;background:var(--accent);border-color:var(--accent);color:#0b1020}
.err{padding:10px 11px;border:1px solid #663440;border-radius:9px;background:#2b171d;color:#ffd9df}

/* ===== UPLOAD ===== */
.video-upload-page .wrap{width:min(850px,calc(100vw - 36px));margin:0 auto;padding:24px 0 42px}
.video-upload-page .top{display:grid;grid-template-columns:1fr auto;gap:14px;align-items:center;margin-bottom:16px;padding:15px 17px;border:1px solid var(--border);border-radius:16px;background:var(--surface)}
.video-upload-page .title h1{margin:0;font-size:25px}
.video-upload-page .title p{margin:5px 0 0;color:var(--muted);font-size:12px}
.video-upload-page .actions{display:flex;gap:8px;align-items:center;justify-content:flex-end;flex-wrap:wrap}
.video-upload-page .card,.video-upload-page .msgs{border:1px solid var(--border);border-radius:16px;background:var(--surface)}
.video-upload-page .card{padding:18px}
.video-upload-page label{display:block;margin:14px 0 7px;color:#dce1e7;font-size:12px;font-weight:800}
.video-upload-page input[type=file],.video-upload-page textarea{width:100%;padding:11px;border:1px solid var(--border);border-radius:9px;background:#0e1115;color:var(--text);outline:none}
.video-upload-page textarea{min-height:135px;resize:vertical}
.video-upload-page input[type=file]:focus,.video-upload-page textarea:focus{border-color:var(--accent)}
.video-upload-page button{background:var(--accent);border-color:var(--accent);color:#0b1020}
.video-upload-page .btn,.video-upload-page .btn2{background:var(--surface-2);color:var(--text)}
.video-upload-page .hint{margin-top:6px;color:var(--muted);font-size:11px;line-height:1.45}
.video-upload-page .row{display:flex;gap:8px;flex-wrap:wrap;margin-top:16px}
.video-upload-page .msgs{margin-top:15px;padding:12px 14px}
.video-upload-page .msgs div{padding:7px 0;border-bottom:1px solid var(--border-soft);font-size:12px}.video-upload-page .msgs div:last-child{border-bottom:0}

/* ===== POLISHED FILE UPLOAD AREA ===== */
.video-upload-page .upload-file-area{
  margin-top:4px;
  padding:16px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#0e1115;
  transition:border-color .18s ease,background .18s ease,box-shadow .18s ease;
}
.video-upload-page .upload-file-area:focus-within{
  border-color:var(--accent);
  background:#10151b;
  box-shadow:0 0 0 3px rgba(115,144,255,.10);
}
.video-upload-page .upload-file-heading{
  display:flex;
  align-items:center;
  gap:11px;
  margin-bottom:12px;
}
.video-upload-page .upload-file-icon{
  width:34px;
  height:34px;
  flex:0 0 34px;
  display:grid;
  place-items:center;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--surface-2);
  color:var(--text);
  font-size:18px;
  font-weight:900;
  line-height:1;
}
.video-upload-page .upload-file-area label{
  margin:0;
  color:var(--text);
  font-size:13px;
  font-weight:850;
}
.video-upload-page .upload-file-subtitle{
  margin-top:3px;
  color:var(--muted);
  font-size:11px;
  line-height:1.35;
}
.video-upload-page .upload-file-area input[type=file]{
  width:100%;
  min-height:46px;
  padding:5px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#090c10;
  color:var(--muted);
  font-size:12px;
  cursor:pointer;
}
.video-upload-page .upload-file-area input[type=file]::file-selector-button{
  min-height:34px;
  margin-right:10px;
  padding:0 14px;
  border:1px solid #3c4652;
  border-radius:8px;
  background:var(--surface-2);
  color:var(--text);
  font:inherit;
  font-weight:800;
  cursor:pointer;
  transition:background .15s ease,border-color .15s ease;
}
.video-upload-page .upload-file-area input[type=file]::file-selector-button:hover{
  background:#2a313a;
  border-color:#566170;
}
.video-upload-page .upload-file-area .hint{
  margin-top:8px;
  padding:0 2px;
  color:var(--muted);
  font-size:10.5px;
}

@media (max-width:820px){
  body.videos-page>.wrap{width:min(720px,calc(100vw - 28px))}
  .videos-page .grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .videos-page .top{grid-template-columns:1fr;grid-template-areas:"title" "actions" "center"}
  .videos-page .actions,.videos-page .topCenter{justify-content:flex-start}.videos-page .status{text-align:left}
  .video-upload-page .top{grid-template-columns:1fr}.video-upload-page .actions{justify-content:flex-start}
}
@media (max-width:560px){
  body.videos-page>.wrap{width:100%;padding:10px 9px 26px}
  .videos-page .top{gap:10px;margin-bottom:10px;padding:12px;border-radius:12px}
  .videos-page .title h1{font-size:22px}
  .videos-page .actions{display:grid;grid-template-columns:1fr 1fr;width:100%}.videos-page .status{grid-column:1/-1}
  .videos-page .topCenter{display:grid;grid-template-columns:1fr 1fr;width:100%}
  .videos-page .grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .videos-page .card{border-radius:10px}.videos-page .thumb{aspect-ratio:9/14}
  .videos-page .meta{padding:8px}.videos-page .name{font-size:11px}.videos-page .sub{font-size:9px;margin-bottom:6px}.videos-page .like{min-height:29px;font-size:10px}
  .videos-page .play{width:33px;height:33px;right:7px;bottom:7px}.videos-page .deleteBtn{width:28px;height:28px;top:6px;right:6px}
  .videos-page .viewer{padding:0;align-items:stretch}.videos-page .viewer .box{width:100vw;height:100dvh;max-height:100dvh;display:flex;align-items:center;justify-content:center}
  .videos-page .playerDeck{width:100vw;height:100dvh;max-height:100dvh;border:0;border-radius:0}.videos-page .playerDeck video{width:100vw;height:100dvh}
  .videos-page .viewerRail{left:50%;top:auto;bottom:calc(16px + env(safe-area-inset-bottom));flex-direction:row;padding:6px;border:1px solid #333a44;border-radius:999px;background:rgba(10,12,15,.78);transform:translateX(-50%)}
  .videos-page .close{top:calc(10px + env(safe-area-inset-top));right:10px}
  .video-upload-page .wrap{width:100%;padding:10px 9px 26px}.video-upload-page .top{padding:12px;border-radius:12px}.video-upload-page .card{padding:13px;border-radius:12px}
}
@media (max-width:360px){.videos-page .grid{grid-template-columns:1fr}.videos-page .topCenter,.videos-page .actions{grid-template-columns:1fr}}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition-duration:.01ms!important}}

@media (max-width:560px){
  .video-upload-page .upload-file-area{padding:13px;border-radius:11px}
  .video-upload-page .upload-file-heading{margin-bottom:10px}
  .video-upload-page .upload-file-icon{width:31px;height:31px;flex-basis:31px;font-size:16px}
  .video-upload-page .upload-file-area input[type=file]::file-selector-button{padding:0 11px;margin-right:7px}
}

/* ===== MOBILE RANDOM FULL-SCREEN FEED ===== */
@media (max-width:560px){
  body.videos-page.viewerOpen{overflow:hidden;overscroll-behavior:none}
  .videos-page .viewer{touch-action:pan-y;background:#000}
  .videos-page .viewer .box,.videos-page .playerDeck,.videos-page .playerDeck video{
    width:100vw;
    height:100dvh;
    max-width:none;
    max-height:none;
    border-radius:0;
  }
  .videos-page .playerDeck video{object-fit:contain;background:#000}
  .videos-page .viewerRail{bottom:calc(18px + env(safe-area-inset-bottom))}
}

/* ========================================================================== 
   2026-08-23 — TikTok-style visual refresh
   ========================================================================== */
:root{
  --bg:#07080b;
  --surface:#101217;
  --surface-2:#171a20;
  --surface-3:#20242c;
  --border:#272c35;
  --border-soft:#1e232b;
  --text:#f8f9fb;
  --muted:#9ca3ae;
  --accent:#ff3b67;
  --accent-2:#24e5dc;
  --danger:#ff4d6d;
  --good:#5fdb8f;
}

body.videos-page,
body.video-upload-page,
body.video-login-page{
  background:
    radial-gradient(circle at 12% -10%,rgba(36,229,220,.08),transparent 32rem),
    radial-gradient(circle at 88% -15%,rgba(255,59,103,.10),transparent 34rem),
    var(--bg);
}

body.videos-page>.wrap{width:min(1180px,calc(100vw - 44px));padding:20px 0 56px}
.videos-page .top{
  position:relative;
  grid-template-columns:1fr auto;
  grid-template-areas:"title actions" "center center";
  padding:15px 16px 14px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:18px;
  background:rgba(16,18,23,.78);
  box-shadow:0 20px 50px rgba(0,0,0,.25);
  backdrop-filter:blur(18px);
}
.videos-page .brandTitle{display:flex;align-items:center;gap:12px}
.videos-page .brandMark{
  position:relative;width:42px;height:42px;flex:0 0 42px;display:grid;place-items:center;
  border-radius:14px;background:#fff;color:#090a0d;font-size:15px;font-weight:950;
  box-shadow:-4px -3px 0 rgba(36,229,220,.9),4px 3px 0 rgba(255,59,103,.92)
}
.videos-page .brandMark span{transform:translateX(1px)}
.videos-page .title h1{font-size:27px;letter-spacing:-.055em}
.videos-page .title p{font-size:11.5px}
.videos-page .topCenter{padding-top:11px;border-top:1px solid rgba(255,255,255,.07)}
.videos-page .actions{gap:7px}
.videos-page .status{color:#b7bdc7}
.videos-page .randomBtn,.videos-page .logout,.videos-page .upload{
  min-height:38px;padding:8px 12px;border-color:rgba(255,255,255,.10);border-radius:11px;
  background:#191c22;color:#f8f9fb;font-weight:820;letter-spacing:-.01em
}
.videos-page .randomBtn:hover,.videos-page .logout:hover{background:#222630;border-color:rgba(255,255,255,.16);transform:translateY(-1px)}
.videos-page .primaryDiscovery{background:#f5f6f8!important;color:#090a0d!important;border-color:#f5f6f8!important}
.videos-page .upload{background:linear-gradient(135deg,#ff315f,#ff4f75);border-color:#ff4f75;color:#fff;box-shadow:0 9px 24px rgba(255,59,103,.20)}
.videos-page .upload:hover{filter:none;transform:translateY(-1px);box-shadow:0 12px 28px rgba(255,59,103,.26)}
.videos-page .utilityBtn{color:#b4bbc5}
.videos-page .btnIcon{font-size:15px;line-height:1}

.videos-page .feedToolbar{
  position:sticky;top:10px;z-index:20;display:flex;align-items:center;justify-content:space-between;gap:14px;
  margin:0 0 14px;padding:8px;border:1px solid rgba(255,255,255,.08);border-radius:15px;
  background:rgba(10,12,16,.82);box-shadow:0 14px 34px rgba(0,0,0,.20);backdrop-filter:blur(18px)
}
.videos-page .feedTabs{display:flex;align-items:center;gap:4px}
.videos-page .feedTab{
  min-height:38px;padding:0 15px;border:0;border-radius:10px;background:transparent;color:#8f97a2;
  font-size:12px;font-weight:850;cursor:pointer;transition:background .15s ease,color .15s ease,transform .15s ease
}
.videos-page .feedTab:hover{color:#fff;background:rgba(255,255,255,.05)}
.videos-page .feedTab.active{background:#f6f7f9;color:#0b0c0f;box-shadow:0 6px 18px rgba(0,0,0,.24)}
.videos-page .feedSearch{
  width:min(290px,38vw);height:38px;display:flex;align-items:center;gap:8px;padding:0 11px;
  border:1px solid rgba(255,255,255,.09);border-radius:10px;background:#11141a;color:#858e9a
}
.videos-page .feedSearch:focus-within{border-color:rgba(36,229,220,.6);box-shadow:0 0 0 3px rgba(36,229,220,.08)}
.videos-page .feedSearch input{min-width:0;flex:1;border:0;outline:0;background:transparent;color:#fff;font-size:12px}
.videos-page .feedSearch input::placeholder{color:#6f7782}

.videos-page .grid{gap:12px}
.videos-page .card{
  position:relative;aspect-ratio:9/16;overflow:hidden;border:1px solid rgba(255,255,255,.07);border-radius:17px;
  background:#050608;box-shadow:0 12px 30px rgba(0,0,0,.22);transform:translateZ(0);
  transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease
}
.videos-page .card:hover{transform:translateY(-3px);border-color:rgba(255,255,255,.16);box-shadow:0 20px 44px rgba(0,0,0,.34)}
.videos-page .thumb{position:absolute;inset:0;width:100%;height:100%;aspect-ratio:auto;background:#050608}
.videos-page .thumb img,.videos-page .thumb video{width:100%;height:100%;object-fit:cover}
.videos-page .thumb:before{
  content:"";position:absolute;inset:42% 0 0;z-index:2;pointer-events:none;
  background:linear-gradient(to bottom,transparent,rgba(0,0,0,.12) 25%,rgba(0,0,0,.82) 100%)
}
.videos-page .noThumb{height:100%;aspect-ratio:auto;background:linear-gradient(145deg,#11141a,#090a0d)}
.videos-page .meta{
  position:absolute;left:0;right:0;bottom:0;z-index:5;padding:42px 12px 11px;background:transparent;pointer-events:none
}
.videos-page .name{margin:0 44px 5px 0;color:#fff;font-size:12px;font-weight:900;text-shadow:0 2px 10px rgba(0,0,0,.5)}
.videos-page .sub{margin:0 44px 0 0;justify-content:flex-start;gap:10px;color:#d5d9df;font-size:10px;font-weight:750;text-shadow:0 1px 8px rgba(0,0,0,.45)}
.videos-page .like{
  position:absolute;right:10px;bottom:10px;width:35px;min-height:35px;height:35px;padding:0;display:grid;place-items:center;
  border:1px solid rgba(255,255,255,.18);border-radius:50%;background:rgba(13,15,19,.72);color:#fff;font-size:18px;
  backdrop-filter:blur(10px);pointer-events:auto
}
.videos-page .like.liked{background:#ff3b67;border-color:#ff6686;color:#fff;box-shadow:0 6px 18px rgba(255,59,103,.24)}
.videos-page .deleteBtn{top:9px;right:9px;width:31px;height:31px;border-color:rgba(255,255,255,.13);background:rgba(10,11,14,.58);opacity:.56;transition:opacity .15s ease,background .15s ease,transform .15s ease}
.videos-page .card:hover .deleteBtn{opacity:1}
.videos-page .deleteBtn:hover{transform:scale(1.05)}
.videos-page .play{
  left:50%;right:auto;bottom:auto;top:50%;width:47px;height:47px;transform:translate(-50%,-50%) scale(.92);
  border-color:rgba(255,255,255,.28);background:rgba(8,9,12,.52);font-size:17px;opacity:0;transition:opacity .16s ease,transform .16s ease
}
.videos-page .card:hover .play{opacity:1;transform:translate(-50%,-50%) scale(1)}
.videos-page .filterEmpty{padding:38px 18px;border:1px dashed #2b3038;border-radius:16px;color:#8e96a1;text-align:center}

/* Full-screen viewer */
.videos-page .viewer{padding:14px;background:rgba(0,0,0,.94);backdrop-filter:blur(18px)}
.videos-page .viewer.open{display:flex;animation:viewerFade .16s ease both}
.videos-page .viewer .box{width:min(455px,calc(100vw - 130px));max-height:calc(100dvh - 28px)}
.videos-page .playerDeck{
  width:100%;max-height:calc(100dvh - 28px);border:1px solid rgba(255,255,255,.12);border-radius:22px;
  box-shadow:0 30px 90px rgba(0,0,0,.72);background:#000
}
.videos-page .playerDeck video,.videos-page .frameCover{object-fit:contain}
.videos-page .viewerTopbar{
  position:absolute;left:10px;right:10px;top:10px;z-index:20;display:grid;grid-template-columns:42px 1fr 42px;align-items:center;gap:10px;pointer-events:none
}
.videos-page .viewerTopbar>*{pointer-events:auto}
.videos-page .viewerChannel{justify-self:center;display:flex;align-items:center;gap:7px;padding:8px 12px;border-radius:999px;background:rgba(9,10,12,.44);color:#fff;font-size:11px;backdrop-filter:blur(12px);text-shadow:0 1px 6px rgba(0,0,0,.6)}
.videos-page .liveDot{width:7px;height:7px;border-radius:50%;background:#24e5dc;box-shadow:0 0 0 4px rgba(36,229,220,.13)}
.videos-page .close,.videos-page .soundBtn{
  position:static;width:40px;height:40px;display:grid;place-items:center;border:1px solid rgba(255,255,255,.16);border-radius:50%;
  background:rgba(9,10,12,.54);color:#fff;box-shadow:none;backdrop-filter:blur(12px);cursor:pointer
}
.videos-page .close{font-size:24px;font-weight:500}
.videos-page .soundBtn{justify-self:end;font-size:16px}
.videos-page .close:hover,.videos-page .soundBtn:hover{background:rgba(28,31,37,.86)}
.videos-page .viewerMeta{
  position:absolute;left:0;right:0;bottom:0;z-index:13;padding:100px 76px 22px 18px;border-radius:0 0 22px 22px;
  background:linear-gradient(to bottom,transparent,rgba(0,0,0,.10) 25%,rgba(0,0,0,.82) 100%);pointer-events:none
}
.videos-page .viewerEyebrow{margin-bottom:5px;color:#24e5dc;font-size:9px;font-weight:950;letter-spacing:.14em}
.videos-page .viewerTitle{overflow:hidden;color:#fff;font-size:16px;font-weight:950;line-height:1.15;text-overflow:ellipsis;white-space:nowrap;text-shadow:0 2px 10px rgba(0,0,0,.5)}
.videos-page .viewerSub{margin-top:5px;color:#d3d7dc;font-size:10px;line-height:1.35;text-shadow:0 1px 8px rgba(0,0,0,.55)}
.videos-page .viewerRail{
  left:calc(100% + 13px);top:auto;bottom:20px;z-index:18;display:flex;flex-direction:column;gap:13px;transform:none
}
.videos-page .viewerAction,.videos-page .navBtn,.videos-page .viewerLike{
  width:54px;height:auto;display:flex;flex-direction:column;align-items:center;gap:4px;padding:0;border:0;border-radius:0;background:transparent;color:#fff;box-shadow:none
}
.videos-page .actionBubble{
  width:47px;height:47px;display:grid;place-items:center;border:1px solid rgba(255,255,255,.14);border-radius:50%;
  background:rgba(19,21,26,.88);font-size:21px;font-weight:900;box-shadow:0 9px 22px rgba(0,0,0,.28);backdrop-filter:blur(12px)
}
.videos-page .viewerAction:hover{background:transparent}
.videos-page .viewerAction:hover .actionBubble{background:#2a2e36;transform:scale(1.04)}
.videos-page .viewerAction.liked .actionBubble{background:#ff3b67;border-color:#ff6686;color:#fff;box-shadow:0 10px 25px rgba(255,59,103,.30)}
.videos-page .actionLabel{min-height:12px;color:#e9ebee;font-size:9px;font-weight:850;text-shadow:0 1px 5px rgba(0,0,0,.55)}
.videos-page .box.randomMode .navBtn:after{display:none}
.videos-page .swipeHint{
  position:absolute;left:50%;bottom:72px;z-index:30;padding:8px 12px;border:1px solid rgba(255,255,255,.13);border-radius:999px;
  background:rgba(8,9,11,.70);color:#fff;font-size:10px;font-weight:800;opacity:0;transform:translate(-50%,8px);pointer-events:none;backdrop-filter:blur(10px);transition:opacity .22s ease,transform .22s ease
}
.videos-page .swipeHint.show{opacity:1;transform:translate(-50%,0)}
.videos-page .heartBurst{
  position:absolute;left:50%;top:48%;z-index:40;color:#ff3b67;font-size:96px;line-height:1;opacity:0;transform:translate(-50%,-50%) scale(.35) rotate(-10deg);pointer-events:none;text-shadow:0 18px 35px rgba(0,0,0,.4)
}
.videos-page .heartBurst.pop{animation:heartPop .58s cubic-bezier(.2,.9,.25,1) both}
.videos-page .viewerToast{
  position:absolute;left:50%;top:50%;z-index:42;padding:9px 13px;border-radius:999px;background:rgba(0,0,0,.62);color:#fff;font-size:11px;font-weight:850;
  opacity:0;transform:translate(-50%,-50%) scale(.94);pointer-events:none;backdrop-filter:blur(10px);transition:opacity .16s ease,transform .16s ease
}
.videos-page .viewerToast.show{opacity:1;transform:translate(-50%,-50%) scale(1)}

/* Upload/login matching the clip app */
.video-login-page .login,.video-login-page form.box,
.video-upload-page .top,.video-upload-page .card,.video-upload-page .msgs{
  border-color:rgba(255,255,255,.08);background:rgba(16,18,23,.88);box-shadow:0 20px 55px rgba(0,0,0,.28);backdrop-filter:blur(16px)
}
.video-login-page button,.video-upload-page button{background:linear-gradient(135deg,#ff315f,#ff4f75);border-color:#ff4f75;color:#fff}
.video-upload-page .upload-file-area{border-color:rgba(255,255,255,.08);background:#0b0d11}
.video-upload-page .upload-file-icon{background:#f5f6f8;color:#0a0b0e;border-color:#f5f6f8;box-shadow:-3px -2px 0 rgba(36,229,220,.75),3px 2px 0 rgba(255,59,103,.78)}

@keyframes heartPop{
  0%{opacity:0;transform:translate(-50%,-50%) scale(.25) rotate(-12deg)}
  28%{opacity:1;transform:translate(-50%,-50%) scale(1.18) rotate(7deg)}
  62%{opacity:1;transform:translate(-50%,-50%) scale(.96) rotate(0)}
  100%{opacity:0;transform:translate(-50%,-58%) scale(1.06)}
}
@keyframes viewerFade{from{opacity:0}to{opacity:1}}

@media (max-width:820px){
  body.videos-page>.wrap{width:min(760px,calc(100vw - 26px))}
  .videos-page .top{grid-template-columns:1fr;grid-template-areas:"title" "center" "actions"}
  .videos-page .topCenter{justify-content:flex-start}
  .videos-page .actions{justify-content:flex-start}
  .videos-page .feedToolbar{top:6px}
}

@media (max-width:560px){
  body.videos-page>.wrap{padding:9px 8px 24px}
  .videos-page .top{padding:11px;border-radius:15px}
  .videos-page .brandMark{width:38px;height:38px;flex-basis:38px;border-radius:12px}
  .videos-page .title h1{font-size:23px}
  .videos-page .title p{font-size:10.5px}
  .videos-page .topCenter,.videos-page .actions{display:flex;grid-template-columns:none;overflow-x:auto;flex-wrap:nowrap;padding-bottom:1px;scrollbar-width:none}
  .videos-page .topCenter::-webkit-scrollbar,.videos-page .actions::-webkit-scrollbar{display:none}
  .videos-page .topCenter>* , .videos-page .actions>a,.videos-page .actions>button{flex:0 0 auto}
  .videos-page .status{display:none}
  .videos-page .feedToolbar{position:relative;top:auto;display:grid;gap:7px;margin-bottom:9px;padding:6px;border-radius:13px}
  .videos-page .feedTabs{width:100%;display:grid;grid-template-columns:repeat(3,1fr)}
  .videos-page .feedTab{padding:0 8px}
  .videos-page .feedSearch{width:100%}
  .videos-page .grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  .videos-page .card{border-radius:13px}
  .videos-page .card:hover{transform:none}
  .videos-page .meta{padding:36px 9px 8px}
  .videos-page .name{margin-right:34px;font-size:10.5px}
  .videos-page .sub{margin-right:34px;font-size:8.8px}
  .videos-page .like{right:7px;bottom:7px;width:30px;height:30px;min-height:30px;font-size:16px}
  .videos-page .deleteBtn{top:6px;right:6px;opacity:.74}
  .videos-page .play{display:none}

  .videos-page .viewer{padding:0;background:#000;touch-action:pan-y}
  .videos-page .viewer .box,.videos-page .playerDeck,.videos-page .playerDeck video{
    width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0
  }
  .videos-page .viewer .box{display:block}
  .videos-page .playerDeck{border:0;box-shadow:none}
  .videos-page .viewerTopbar{left:10px;right:10px;top:calc(8px + env(safe-area-inset-top))}
  .videos-page .viewerChannel{background:rgba(0,0,0,.28)}
  .videos-page .close,.videos-page .soundBtn{width:39px;height:39px;background:rgba(0,0,0,.34)}
  .videos-page .viewerMeta{left:0;right:0;bottom:0;padding:120px 88px calc(26px + env(safe-area-inset-bottom)) 14px;border-radius:0}
  .videos-page .viewerTitle{font-size:15px}
  .videos-page .viewerSub{font-size:9.5px;max-width:270px}
  .videos-page .viewerRail{
    left:auto;right:10px;top:auto;bottom:calc(28px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:14px;padding:0;border:0;border-radius:0;background:transparent;transform:none
  }
  .videos-page .viewerAction,.videos-page .navBtn,.videos-page .viewerLike{width:52px;height:auto}
  .videos-page .actionBubble{width:45px;height:45px;background:rgba(10,11,14,.54)}
  .videos-page .actionLabel{font-size:9px}
  .videos-page .swipeHint{bottom:calc(104px + env(safe-area-inset-bottom))}
  .videos-page .heartBurst{font-size:88px}
}

@media (max-width:360px){
  .videos-page .grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .videos-page .feedTab{font-size:11px}
}

/* ========================================================================== 
   2026-08-27 — stability + performance polish
   ========================================================================== */
.videos-page .brandEyebrow{
  display:flex;align-items:center;gap:6px;margin:0 0 4px;color:#9098a4;font-size:8.5px;font-weight:950;letter-spacing:.14em
}
.videos-page .healthDot{
  width:6px;height:6px;border-radius:50%;background:#24e5dc;box-shadow:0 0 0 3px rgba(36,229,220,.12),0 0 13px rgba(36,229,220,.45)
}
.videos-page .metaDot{padding:0 4px;color:#4c535d}
.videos-page .status:empty{display:none}
.videos-page .status:not(:empty){
  flex-basis:auto;max-width:320px;padding:6px 9px;border:1px solid rgba(255,255,255,.07);border-radius:999px;
  background:#0d1015;color:#aeb5bf;white-space:nowrap;overflow:hidden;text-overflow:ellipsis
}

/* Let the browser skip painting off-screen cards on big libraries. */
.videos-page .card{
  content-visibility:auto;
  contain-intrinsic-size:280px 498px;
}
.videos-page .clipBadge{
  position:absolute;left:9px;top:9px;z-index:4;display:inline-flex;align-items:center;min-height:24px;padding:0 8px;
  border:1px solid rgba(255,255,255,.12);border-radius:999px;background:rgba(8,10,13,.58);color:rgba(255,255,255,.86);
  font-size:8px;font-weight:950;letter-spacing:.12em;line-height:1;pointer-events:none;backdrop-filter:blur(8px)
}
.videos-page .filterEmpty{
  margin:20px 0;padding:34px 18px;border:1px dashed rgba(255,255,255,.10);border-radius:17px;background:#0e1015;
  color:#8f97a3;text-align:center;font-size:13px;font-weight:750
}
.videos-page .lazySentinel{height:6px;margin-top:6px}

/* Friendly recovery state if a single media file/network request fails. */
.videos-page .viewerError{
  position:absolute;left:50%;top:50%;z-index:35;width:min(280px,76%);padding:18px;border:1px solid rgba(255,255,255,.14);
  border-radius:18px;background:rgba(12,14,18,.92);box-shadow:0 22px 60px rgba(0,0,0,.48);color:#fff;text-align:center;
  transform:translate(-50%,-50%);backdrop-filter:blur(16px)
}
.videos-page .viewerError[hidden]{display:none!important}
.videos-page .viewerErrorIcon{
  width:36px;height:36px;margin:0 auto 10px;display:grid;place-items:center;border-radius:50%;background:#ff3b67;color:#fff;font-size:18px;font-weight:950
}
.videos-page .viewerError strong{display:block;font-size:14px}
.videos-page .viewerError>span{display:block;margin:5px 0 13px;overflow:hidden;color:#aab1bc;font-size:10px;text-overflow:ellipsis;white-space:nowrap}
.videos-page .viewerErrorActions{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.videos-page .viewerErrorActions button{
  min-height:36px;border:1px solid rgba(255,255,255,.12);border-radius:10px;background:#20242b;color:#fff;font-size:11px;font-weight:850;cursor:pointer
}
.videos-page .viewerErrorActions #videoRetryBtn{background:#f7f8fa;border-color:#f7f8fa;color:#0a0b0e}
.videos-page .viewerErrorActions button:hover{filter:brightness(1.08)}

/* Avoid expensive blur/compositing while finger-scrolling on touch hardware. */
@media (hover:none),(pointer:coarse){
  .videos-page .top,.videos-page .feedToolbar{backdrop-filter:none;-webkit-backdrop-filter:none;background:#101217}
  .videos-page .card:hover{transform:none;box-shadow:0 12px 30px rgba(0,0,0,.22)}
  .videos-page .clipBadge{backdrop-filter:none;-webkit-backdrop-filter:none;background:rgba(8,10,13,.78)}
}

@media (max-width:560px){
  body.videos-page{background:#07080b}
  .videos-page .brandEyebrow{font-size:7.8px}
  .videos-page .metaDot{display:none}
  .videos-page .title p{white-space:nowrap}
  .videos-page .clipBadge{left:6px;top:6px;min-height:21px;padding:0 6px;font-size:7px}
  .videos-page .viewerError{width:min(300px,82vw);padding:17px}
  .videos-page .viewerErrorActions button{min-height:40px}
}
