/* Netflix-like custom player (lightweight) */
:root{
  --nf-bg: rgba(0,0,0,.55);
  --nf-bg2: rgba(0,0,0,.35);
  --nf-fg: #fff;
  --nf-muted: rgba(255,255,255,.75);
  --nf-accent: #e50914;
}

.nf-player{
  position:fixed;
  inset:0;
  z-index:9999;
  display:none;
  background:#000;
}

.nf-player.is-open{ display:block; }

/* Center the video area */
.nf-host{
  position:absolute;
  inset:0;
  display:block;
  overflow:hidden;
}

/* ===== Edge long-press seek zones (mobile Netflix style) =====
   We keep them away from top/bottom bars so buttons/seekbar still work. */
.nf-holdzone{
  position:absolute;
  top:64px;              /* below top bar */
  bottom:118px;          /* above bottom bar */
  width:26%;
  /* Must stay UNDER player UI so it never blocks buttons (ads/rail/close/etc) */
  z-index:1;
  pointer-events:auto;
  background:transparent;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.nf-hold-left{ left:0; }
.nf-hold-right{ right:0; }

.nf-player video{
  width:100%;
  height:100%;
  object-fit:contain;
  background:#000;
}

/* Stretch/fit toggle */
.nf-player.is-stretch video{ object-fit:cover; }

/* Fit button is shown only in fullscreen */
.nf-fit{ display:none; }
.nf-player:fullscreen .nf-fit{ display:inline-flex; }
.nf-player:-webkit-full-screen .nf-fit{ display:inline-flex; }
.nf-player:-moz-full-screen .nf-fit{ display:inline-flex; }
.nf-player:-ms-fullscreen .nf-fit{ display:inline-flex; }

/* Content/ad layering */
.nf-contentvideo{ position:absolute; inset:0; z-index:0; }
.nf-advideo{ position:absolute; inset:0; z-index:2; display:none; }

.nf-controls{
  position:absolute;
  inset:0;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  /* Keep UI above hold-zones */
  z-index:3;
  pointer-events:none;
  opacity:1;
  transition:opacity .18s ease;
}

.nf-controls.is-hidden{ opacity:0; }

.nf-topbar{
  pointer-events:auto;
  position:absolute;
  top:0;
  left:0;
  right:0;
  padding:14px 14px 22px;
  background:linear-gradient(to bottom, rgba(0,0,0,.75), rgba(0,0,0,0));
  display:flex;
  align-items:center;
  gap:12px;
}

/* --- Watch Together: party mini list (near fullscreen) --- */
.nf-partywrap{ position:relative; display:flex; align-items:center; }
.nf-partybtn{ white-space:nowrap; }
.nf-partylist{
  position:absolute;
  right:0;
  top:44px;
  min-width:180px;
  max-width:260px;
  max-height:240px;
  overflow:auto;
  padding:10px;
  border-radius:14px;
  background:rgba(0,0,0,.72);
  backdrop-filter: blur(10px);
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 10px 30px rgba(0,0,0,.45);
  display:none;
}
.nf-partylist.open{ display:block; }
.nf-partyrow{ display:flex; align-items:center; gap:8px; padding:6px 4px; }
.nf-partyrow .nm{ font-size:13px; font-weight:700; opacity:.95; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.nf-partyrow .dot{ width:8px; height:8px; border-radius:999px; display:inline-block; }
.nf-partyrow .dot.on{ background:#2ee67a; }
.nf-partyrow .dot.off{ background:rgba(255,255,255,.28); }

/* --- Ads bar (Skip only, no background overlay) --- */
.nf-ad{
  pointer-events:auto;
  position:absolute;
  top:72px;
  right:16px;
  left:auto;
  display:none;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  padding:0;
  border:none;
  background:transparent;
  backdrop-filter:none;
}
.nf-ad.is-show{display:flex}

.nf-adlabel{font-weight:900;font-size:12px;letter-spacing:.08em;text-transform:uppercase;opacity:.9}
.nf-adtitle{font-weight:800;font-size:13px;opacity:.9;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nf-ad .nf-adskip{
  padding:7px 10px;          /* smaller button */
  border-radius:12px;
  font-size:13px;
  line-height:1.1;
  min-width:0;
  white-space:nowrap;
}
.nf-ad .nf-adskip .t{display:block;max-width:160px;overflow:hidden;text-overflow:ellipsis;}
.nf-player.is-ad .nf-adskip{cursor:not-allowed; opacity:.95;}

/* During ads: disable any jump/seek interactions visually */
.nf-player.is-ad .nf-holdzone{pointer-events:none;}
.nf-player.is-ad .nf-progress{pointer-events:none;}
.nf-player.is-ad .nf-back,
.nf-player.is-ad .nf-fwd,
.nf-player.is-ad .nf-jump{
  pointer-events:none;
  opacity:.45;
}
.nf-player.is-ad .nf-progresswrap{opacity:.35;pointer-events:none}
.nf-player.is-ad .nf-holdzone{pointer-events:none} /* block ±10 hold seek during ads */

.nf-title{
  color:var(--nf-fg);
  font-weight:700;
  font-size:15px;
  letter-spacing:.2px;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}

.nf-spacer{ flex:1; }

.nf-btn{
  pointer-events:auto;
  border:0;
  background:var(--nf-bg2);
  color:var(--nf-fg);
  padding:10px 12px;
  border-radius:12px;
  font-weight:700;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:8px;
  backdrop-filter: blur(10px);
}

.nf-btn:hover{ background:var(--nf-bg); }

.nf-center{
  pointer-events:none;
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:120px;
}

.nf-jump{
  pointer-events:auto;
  width:76px;
  height:76px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(0,0,0,.35);
  color:#fff;
  font-weight:800;
  cursor:pointer;
  backdrop-filter: blur(10px);
  display:flex;
  align-items:center;
  justify-content:center;
}

.nf-jump:active{ transform:scale(.97); }

.nf-bottombar{
  pointer-events:auto;
  padding:10px 14px 14px;
  background:linear-gradient(to top, rgba(0,0,0,.75), rgba(0,0,0,0));
}

.nf-progress{
  width:100%;
  appearance:none;
  height:5px;
  border-radius:999px;
  background:rgba(255,255,255,.22);
  outline:none;
  cursor:pointer;
}

.nf-progress::-webkit-slider-thumb{
  appearance:none;
  width:14px;
  height:14px;
  border-radius:50%;
  background:var(--nf-accent);
  border:0;
}

.nf-progress::-moz-range-thumb{
  width:14px;
  height:14px;
  border-radius:50%;
  background:var(--nf-accent);
  border:0;
}

.nf-row{
  margin-top:10px;
  display:flex;
  align-items:center;
  gap:10px;
}

.nf-time{
  color:var(--nf-muted);
  font-size:13px;
  font-weight:700;
  min-width:92px;
}

.nf-grow{ flex:1; }

.nf-voice{
  font-size:12px;
  font-weight:800;
  color:rgba(255,255,255,.78);
  padding:6px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.10);
  user-select:none;
}

.nf-volume{
  width:110px;
  appearance:none;
  height:4px;
  border-radius:999px;
  background:rgba(255,255,255,.22);
  outline:none;
}

.nf-volume::-webkit-slider-thumb{
  appearance:none;
  width:12px;
  height:12px;
  border-radius:50%;
  background:#fff;
}

.nf-volume::-moz-range-thumb{
  width:12px;
  height:12px;
  border-radius:50%;
  background:#fff;
  border:0;
}

.nf-toast{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  padding:10px 12px;
  background:rgba(0,0,0,.55);
  border:1px solid rgba(255,255,255,.18);
  border-radius:14px;
  color:#fff;
  font-weight:800;
  font-size:14px;
  opacity:0;
  transition:opacity .15s ease;
  pointer-events:none;
}

.nf-toast.is-show{ opacity:1; }

@media (max-width: 520px){
  .nf-volume{ display:none; }
  .nf-time{ min-width:82px; }
  .nf-title{ font-size:14px; }
}

/* ===== Timeline hover tooltip (time preview) ===== */
.nf-progresswrap{ position:relative; }
.nf-tooltip{
  position:absolute;
  bottom:18px;
  left:0;
  transform:translateX(-50%);
  padding:6px 8px;
  border-radius:10px;
  font-size:12px;
  font-weight:800;
  color:#fff;
  background:rgba(0,0,0,.65);
  border:1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(10px);
  opacity:0;
  pointer-events:none;
  transition:opacity .12s ease;
  white-space:nowrap;
}
.nf-tooltip.is-show{ opacity:1; }

/* ===== Skip intro ===== */
.nf-skip{
  position:absolute;
  right:16px;
  bottom:120px;
  z-index:5;
  display:none;
}
.nf-skip.is-show{ display:block; }
.nf-btn.nf-skipbtn{ background:rgba(255,255,255,.12); }

/* ===== Next episode overlay ===== */
.nf-nextup{
  position:absolute;
  right:16px;
  bottom:120px;
  z-index:6;
  width:min(360px, calc(100% - 32px));
  display:none;
  border-radius:18px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.55);
  backdrop-filter: blur(12px);
}
.nf-nextup.is-show{ display:block; }
.nf-nextup .row{ display:flex; align-items:center; gap:12px; padding:12px; }
.nf-nextup .thumb{ width:92px; height:52px; border-radius:12px; object-fit:cover; background:rgba(255,255,255,.08); flex:0 0 auto; }
.nf-nextup .meta{ flex:1; min-width:0; }
.nf-nextup .t{ font-weight:900; font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.nf-nextup .s{ font-weight:800; font-size:12px; color:rgba(255,255,255,.78); margin-top:2px; }
.nf-nextup .actions{ display:flex; gap:8px; padding:0 12px 12px; }
.nf-nextup .actions .nf-btn{ flex:1; justify-content:center; }

/* ===== Data saver overlay ===== */
.nf-datasaver{
  position:absolute;
  inset:0;
  z-index:7;
  display:none;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,.55);
  backdrop-filter: blur(10px);
}
.nf-datasaver.is-show{ display:flex; }
.nf-datasaver .card{
  width:min(520px, calc(100% - 32px));
  border-radius:22px;
  padding:18px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.55);
}
.nf-datasaver .card h3{ margin:0; font-size:16px; }
.nf-datasaver .card p{ margin:8px 0 12px; color:rgba(255,255,255,.78); line-height:1.5; font-size:13px; }
.nf-datasaver .card .nf-btn{ width:100%; justify-content:center; }

/* ===== Episode rail (below player controls) ===== */
.nf-rail{ pointer-events:auto; padding:10px 14px 16px; display:none; }
.nf-rail.is-show{ display:block; }
.nf-railhead{ display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.nf-railhead .label{ font-weight:900; font-size:13px; color:rgba(255,255,255,.9); }
.nf-railhead select{ background:rgba(255,255,255,.10); border:1px solid rgba(255,255,255,.14); color:#fff; border-radius:12px; padding:8px 10px; }
.nf-railitems{ display:flex; gap:10px; overflow:auto; padding-bottom:4px; }
.nf-ep{
  flex:0 0 auto;
  width:168px;
  border-radius:16px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  overflow:hidden;
  cursor:pointer;
}
.nf-ep.active{ border-color:rgba(229,9,20,.55); box-shadow:0 0 0 2px rgba(229,9,20,.25) inset; }
.nf-ep .img{ width:100%; height:94px; object-fit:cover; display:block; background:rgba(255,255,255,.08); }
.nf-ep .body{ padding:10px 10px 12px; }
.nf-ep .name{ font-weight:900; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.nf-ep .bar{ margin-top:8px; height:4px; border-radius:999px; background:rgba(255,255,255,.14); overflow:hidden; }
.nf-ep .bar > i{ display:block; height:100%; width:0%; background:var(--nf-accent); }

/* ===== Timeline hover tooltip ===== */
.nf-progresswrap{ position:relative; }
.nf-tooltip{
  position:absolute;
  bottom:18px;
  left:0;
  transform:translateX(-50%);
  padding:6px 8px;
  border-radius:10px;
  font-size:12px;
  font-weight:800;
  color:#fff;
  background:rgba(0,0,0,.68);
  border:1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(10px);
  opacity:0;
  pointer-events:none;
  transition: opacity .12s ease;
  white-space:nowrap;
}
.nf-tooltip.is-show{ opacity:1; }

/* ===== Skip intro ===== */
.nf-skip{
  pointer-events:auto;
  position:absolute;
  right:18px;
  bottom:120px;
  display:none;
  padding:10px 14px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(0,0,0,.55);
  color:#fff;
  font-weight:900;
  cursor:pointer;
}
.nf-skip.is-show{ display:inline-flex; align-items:center; gap:8px; }

/* ===== Next up overlay ===== */
.nf-nextup{
  pointer-events:auto;
  position:absolute;
  right:18px;
  bottom:70px;
  width:min(340px, calc(100vw - 36px));
  background:rgba(0,0,0,.62);
  border:1px solid rgba(255,255,255,.16);
  border-radius:18px;
  padding:12px;
  display:none;
  backdrop-filter: blur(10px);
}
.nf-nextup.is-show{ display:block; }
.nf-nextup .t{ font-weight:900; font-size:14px; }
.nf-nextup .s{ opacity:.78; font-size:12px; margin-top:4px; }
.nf-nextup .row{ display:flex; gap:10px; margin-top:10px; }
.nf-nextup .row button{ flex:1; }

/* ===== Data saver overlay ===== */
.nf-datasaver{
  pointer-events:auto;
  position:absolute;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:22px;
}
.nf-datasaver.is-show{ display:flex; }
.nf-datasaver .card{
  max-width:520px;
  width:100%;
  background:rgba(0,0,0,.55);
  border:1px solid rgba(255,255,255,.16);
  border-radius:22px;
  padding:18px;
}
.nf-datasaver .card h3{ margin:0 0 8px; font-size:18px; }
.nf-datasaver .card p{ margin:0 0 14px; opacity:.78; line-height:1.45; }
.nf-datasaver .card .nf-btn{ width:100%; justify-content:center; }

/* ===== Episode rail (bottom) ===== */
.nf-rail{
  margin-top:10px;
  display:none;
}
.nf-rail.is-show{ display:block; }
.nf-rail-head{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:10px;
}
.nf-rail-head .lbl{ color:var(--nf-muted); font-size:12px; font-weight:900; }
.nf-rail-list{
  margin-top:10px;
  display:flex;
  gap:10px;
  overflow-x:auto;
  padding-bottom:6px;
}
.nf-ep{
  flex:0 0 auto;
  width:160px;
  border-radius:14px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  overflow:hidden;
  cursor:pointer;
}
.nf-ep img{ width:100%; height:90px; object-fit:cover; display:block; }
.nf-ep .b{ padding:8px 8px 10px; }
.nf-ep .n{ font-weight:900; font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.nf-ep .p{ height:4px; border-radius:999px; background:rgba(255,255,255,.18); margin-top:8px; overflow:hidden; }
.nf-ep .p > i{ display:block; height:100%; width:0%; background:var(--nf-accent); }
.nf-ep.is-active{ outline:2px solid rgba(229,9,20,.65); }

/* ===== Menus: quality / settings ===== */
.nf-menu{
  position:absolute;
  right:14px;
  bottom:86px;
  width:min(360px, calc(100vw - 28px));
  background:rgba(16,16,16,.94);
  border:1px solid rgba(255,255,255,.12);
  border-radius:18px;
  box-shadow:0 18px 60px rgba(0,0,0,.55);
  overflow:hidden;
  display:none;
}
.nf-menu.is-show{ display:block; }
.nf-menu .sec{ padding:10px; border-top:1px solid rgba(255,255,255,.10); }
.nf-menu .sec:first-child{ border-top:0; }
.nf-menu .h{ font-size:12px; font-weight:900; opacity:.78; margin:2px 2px 8px; text-transform:uppercase; letter-spacing:.4px; }
.nf-menu button.item{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border:0;
  background:rgba(255,255,255,.06);
  color:#fff;
  padding:10px 12px;
  border-radius:14px;
  cursor:pointer;
  font-weight:800;
}
.nf-menu button.item:hover{ background:rgba(255,255,255,.10); }
.nf-menu button.item.is-active{ outline:2px solid rgba(229,9,20,.6); }
.nf-badge{
  font-size:11px;
  font-weight:900;
  padding:3px 8px;
  border-radius:999px;
  background:rgba(229,9,20,.18);
  border:1px solid rgba(229,9,20,.35);
}
.nf-badge.premium{ background:rgba(255,215,0,.16); border-color:rgba(255,215,0,.35); }
.nf-badge.lock{ background:rgba(255,255,255,.10); border-color:rgba(255,255,255,.18); opacity:.9; }



/* === ADS UX LOCKDOWN === */
/* Hide any ad label/title; keep only Skip button */
.nf-adlabel,
.nf-adtitle{ display:none !important; }

/* During ads: disable all controls except Close, Fullscreen, Skip */
.nf-player.is-ad .nf-controls{ pointer-events:none; }
.nf-player.is-ad video{ pointer-events:none; }

.nf-player.is-ad .nf-topbar .nf-close,
.nf-player.is-ad .nf-topbar .nf-fs,
.nf-player.is-ad .nf-adskip{
  pointer-events:auto;
  opacity:1 !important;
}

/* Optional: fade disabled UI a bit */
.nf-player.is-ad .nf-bottombar,
.nf-player.is-ad .nf-skip,
.nf-player.is-ad .nf-nextup{
  opacity:0.35;
}



/* Watch Together modal */
.nf-btn.nf-together{font-size:18px}
.nf-wt{position:absolute;inset:0;display:none;align-items:flex-end;justify-content:center;padding:16px;background:rgba(0,0,0,.45);backdrop-filter:blur(6px);z-index:12}
.nf-wt.is-open{display:flex}
.nf-wt{pointer-events:auto}
.nf-player.wt-open video{pointer-events:none}
.nf-player.wt-open .nf-controls{pointer-events:none}
.nf-player.wt-open .nf-holdzone{pointer-events:none}
.nf-player.wt-open .nf-progress{pointer-events:none}
.nf-player.wt-open .nf-rail{pointer-events:none}
.nf-player.wt-open .nf-wt{pointer-events:auto}

.nf-wt .card{width:100%;max-width:520px;border-radius:18px;background:rgba(18,20,28,.96);border:1px solid rgba(255,255,255,.10);box-shadow:0 18px 45px rgba(0,0,0,.55);overflow:hidden}
.nf-wt .head{display:flex;align-items:center;gap:10px;padding:12px 14px;border-bottom:1px solid rgba(255,255,255,.08)}
.nf-wt .ttl{font-weight:900}
.nf-wt .sp{flex:1}
.nf-wt .body{padding:14px}
.nf-wt .row{display:flex;gap:10px;align-items:center}
.nf-wt .row.join input{flex:1;padding:12px 12px;border-radius:14px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.10);color:#fff;outline:none}
.nf-wt .sep{height:10px}
.nf-wt .out{display:flex;gap:8px;align-items:flex-start;margin-top:10px}
.nf-wt .out .lbl{min-width:58px;color:rgba(255,255,255,.65);font-size:13px}
.nf-wt .out .val{font-weight:700;font-size:13px;word-break:break-all}
.nf-wt .hint{margin-top:10px;font-size:13px;color:rgba(255,255,255,.75)}
.nf-wt .hint.ok{color:rgba(120,255,160,.95)}
.nf-wt .hint.err{color:rgba(255,120,120,.95)}


/* Voice badge */
.nf-voice{ padding:4px 10px; border-radius:999px; font-size:12px; line-height:16px; margin-left:10px; user-select:none; border:1px solid rgba(255,255,255,.18); }
.nf-voice.on{ background: rgba(0,180,90,.22); border-color: rgba(0,200,110,.45); }
.nf-voice.off{ background: rgba(180,180,180,.18); border-color: rgba(180,180,180,.35); opacity:.9; }
/* Party list speaking */
.nf-partylist .nf-partyrow.speaking{ outline:1px solid rgba(0,200,110,.55); box-shadow: 0 0 0 2px rgba(0,200,110,.15) inset; }
.nf-partylist .nf-partyrow .spk{ display:none; margin-left:auto; font-size:12px; opacity:.9; }
.nf-partylist .nf-partyrow.speaking .spk{ display:inline-block; }

