
/* ============================================================ shelf
   A file index, set like a catalogue. Paper, ink, one accent.
   ============================================================ */

:root {
  --paper: #000000;
  --paper-2: #0a0a0a;
  --paper-3: #141414;
  --ink: #ffffff;
  --ink-2: #cccccc;
  --muted: #888888;
  --rule: #202020;
  --rule-strong: #333333;
  --accent: #e50914;
  --accent-soft: rgba(229, 9, 20, 0.14);
  --danger: #e50914;
  --dark: #000000;
  --display: "Instrument Serif", "Iowan Old Style", Palatino, Georgia, serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "Space Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --wrap: 1180px;
}

[data-theme="light"] {
  --paper: #f2efe7;
  --paper-2: #e9e5d9;
  --paper-3: #ded9ca;
  --ink: #14120f;
  --ink-2: #35322b;
  --muted: #6d675c;
  --rule: #cdc6b6;
  --rule-strong: #a29b8c;
  --accent: #2334de;
  --accent-soft: rgba(35, 52, 222, 0.09);
  --danger: #a3231c;
  --dark: #14120f;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-var.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("/fonts/space-mono-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.52;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.28;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.42'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  display: none;
}

[data-theme="light"] body::before {
  display: block;
}

a { color: inherit; }
img { max-width: 100%; }

::selection { background: var(--accent); color: var(--paper); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 28px;
  position: relative;
  z-index: 2;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  z-index: 50;
  font-family: var(--mono);
  font-size: 0.7rem;
}
.skip:focus { left: 12px; top: 12px; }

/* ---------------------------------------------------------------- header */

.top {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.top-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  height: 58px;
}

.top-nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--paper-2);
  border: 1px solid var(--rule-strong);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 140ms ease;
  flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.theme-toggle .theme-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  box-shadow: 0 0 6px var(--accent);
}
[data-theme="light"] .theme-toggle .theme-dot {
  box-shadow: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  white-space: nowrap;
}

.cinebox-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: #000000;
  border: 1px solid rgba(229, 9, 20, 0.45);
  box-shadow: 0 0 10px rgba(229, 9, 20, 0.35);
  overflow: hidden;
  flex-shrink: 0;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.brand:hover .cinebox-badge {
  transform: scale(1.08);
  border-color: #e50914;
  box-shadow: 0 0 18px rgba(229, 9, 20, 0.7);
}
[data-theme="light"] .cinebox-badge {
  background: #000000;
  border: 1.5px solid rgba(229, 9, 20, 0.65);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25), 0 0 8px rgba(229, 9, 20, 0.2);
}
[data-theme="light"] .brand:hover .cinebox-badge {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3), 0 0 14px rgba(229, 9, 20, 0.4);
}

.cinebox-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-text-group {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  gap: 1px;
}

.brand-main {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  transition: color 140ms ease;
}
.brand:hover .brand-main {
  color: var(--accent);
}

.brand-sub {
  font-family: var(--mono);
  font-size: 0.52rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.top-context {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.top-context strong {
  color: var(--ink);
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.top-context .dot { color: var(--rule-strong); }

.search {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--ink);
  min-width: 0;
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 8px 2px;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; }
.search input:focus-visible { outline: none; }
.search:focus-within { border-bottom-color: var(--accent); }
.search button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0 0 0 12px;
}
.search button:hover { color: var(--ink); }

/* ---------------------------------------------------------------- shell */

main { min-height: 60vh; }

.band {
  padding-block: 40px 26px;
  border-bottom: 2px solid var(--ink);
}

.channel {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 26px;
  align-items: start;
}

.avatar {
  width: 76px;
  height: 76px;
  border: 1px solid var(--ink);
  background: var(--paper-2);
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.channel h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
}

.channel-handle {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.channel-about {
  margin: 12px 0 0;
  max-width: 62ch;
  color: var(--ink-2);
  font-size: 0.98rem;
}

.register {
  text-align: right;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.8;
  min-width: 170px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.register > span { display: block; }

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(229, 9, 20, 0.09);
  border: 1px solid rgba(229, 9, 20, 0.3);
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 3px;
  transition: all 180ms ease;
  user-select: none;
}
.live-pill:hover {
  background: rgba(229, 9, 20, 0.18);
  border-color: rgba(229, 9, 20, 0.55);
}

.live-pill-sticky {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom, 16px));
  right: max(16px, env(safe-area-inset-right, 16px));
  z-index: 85;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(229, 9, 20, 0.4);
  border-radius: 999px;
  padding: 6px 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.65), 0 0 10px rgba(229, 9, 20, 0.15);
  user-select: none;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
  cursor: default;
}
.live-pill-sticky:hover {
  transform: translateY(-2px);
  background: rgba(18, 18, 18, 0.96);
  border-color: rgba(229, 9, 20, 0.65);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.75), 0 0 14px rgba(229, 9, 20, 0.3);
}
[data-theme="light"] .live-pill-sticky {
  background: rgba(245, 243, 237, 0.92);
  border-color: rgba(35, 52, 222, 0.32);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1), 0 0 8px rgba(35, 52, 222, 0.15);
}
[data-theme="light"] .live-pill-sticky:hover {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(35, 52, 222, 0.55);
}

:fullscreen ~ .live-pill-sticky,
.nf-player:fullscreen ~ .live-pill-sticky,
body:has(:fullscreen) .live-pill-sticky {
  display: none !important;
}

.live-radar {
  position: relative;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px var(--accent);
}
.live-radar::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  animation: radar-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes radar-ping {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(2.6); opacity: 0; }
}

.live-text {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}
.live-text b {
  display: inline;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.74rem;
  color: var(--accent);
  margin-right: 2px;
  transition: transform 250ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.live-text b.pulse {
  transform: scale(1.35);
}

.register .live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
}
.register .live i {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
}

/* ---------------------------------------------------------------- controls */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-block: 14px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.toolbar .count { color: var(--ink); }
.toolbar nav { display: flex; gap: 14px; align-items: center; }
.toolbar .demo { color: var(--accent); letter-spacing: 0.16em; }
.toolbar a { text-decoration: none; color: var(--muted); }
.toolbar a:hover { color: var(--accent); }

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 22px;
  padding-block: 12px;
  border-bottom: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.filters .lbl { color: var(--muted); }
.filters a {
  text-decoration: none;
  color: var(--muted);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.filters a:hover { color: var(--ink); border-bottom-color: var(--rule-strong); }
.filters a[aria-current] { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------------------------------------------------------------- index */

.results { margin-top: 0; }

.results-head {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 82px 108px 126px 26px;
  gap: 16px;
  align-items: center;
  padding: 9px 6px 9px 0;
  border-bottom: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.results-head span:nth-child(3),
.results-head span:nth-child(4),
.results-head span:nth-child(5) { text-align: right; }

.row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 82px 108px 126px 26px;
  gap: 16px;
  align-items: center;
  padding: 12px 6px 12px 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  position: relative;
  transition: background-color 120ms linear;
}
.row::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transition: transform 120ms ease-out;
}
.row:hover { background: var(--paper-2); }
.row:hover::before { transform: scaleY(1); }
.row:hover .row-go { transform: translateX(3px); color: var(--accent); }
.row:hover .row-name-text { color: var(--accent); }

.row-thumb {
  width: 64px;
  height: 64px;
  border: 1px solid var(--rule);
  background: var(--paper-2);
  overflow: hidden;
  position: relative;
}
.row-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.row-thumb .fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.52rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.row-main { min-width: 0; }

.row-name-text {
  display: block;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 120ms linear;
}

.row-caption {
  display: block;
  margin-top: 3px;
  font-size: 0.86rem;
  line-height: 1.35;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-kind {
  justify-self: end;
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  border: 1px solid var(--rule-strong);
  padding: 2px 6px;
  white-space: nowrap;
}

.row-size, .row-date {
  justify-self: end;
  font-family: var(--mono);
  font-size: 0.64rem;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.row-go {
  justify-self: end;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--rule-strong);
  transition: transform 120ms ease-out, color 120ms linear;
}

.row-meta { display: none; }

.preview video {
  display: block;
  width: 100%;
  max-height: 62vh;
  background: #000;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 26px 8px;
  border-top: 1px solid var(--ink);
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.pager a { text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--rule-strong); padding-bottom: 2px; }
.pager a:hover { color: var(--accent); border-color: var(--accent); }
.pager .page-no { color: var(--muted); }
.pager .page-no b { color: var(--ink); font-weight: 400; }
.pager .spacer { flex: 1; }

.empty {
  padding: 72px 0 88px;
  text-align: center;
  border-bottom: 1px solid var(--rule);
}
.empty h2 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 2rem;
}
.empty p { margin: 0; color: var(--muted); font-size: 0.98rem; }
.empty code {
  font-family: var(--mono);
  font-size: 0.78rem;
  background: var(--paper-3);
  padding: 2px 6px;
}

/* ---------------------------------------------------------------- detail */

.crumbs {
  padding-block: 18px 0;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.crumbs a { text-decoration: none; color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { color: var(--rule-strong); margin-inline: 8px; }

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  grid-template-areas:
    "media side"
    "head side"
    "body side";
  column-gap: 52px;
  padding-block: 26px 60px;
  align-items: start;
}

.detail-media { grid-area: media; min-width: 0; }
.detail-head { grid-area: head; min-width: 0; }
.detail-body { grid-area: body; min-width: 0; }

.preview {
  border: 1px solid var(--ink);
  background: var(--dark);
  display: grid;
  place-items: center;
  min-height: 260px;
  overflow: hidden;
}
.preview img { display: block; width: 100%; height: auto; max-height: 62vh; object-fit: contain; }
.preview .poster { height: 52vh; max-height: 420px; width: auto; max-width: 100%; object-fit: contain; }
.preview .type-only {
  padding: 56px 24px;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper);
  opacity: 0.62;
}
.preview.blank {
  min-height: 190px;
  background: var(--paper-2);
  border-color: var(--rule-strong);
}
.preview.blank .type-only { color: var(--ink-2); opacity: 1; }

.audio-bar { width: 100%; margin-top: 16px; }

.detail h1 {
  margin: 22px 0 0;
  font-family: var(--mono);
  font-size: 1.02rem;
  font-weight: 400;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.caption {
  margin: 16px 0 0;
  color: var(--ink-2);
  font-size: 1.06rem;
  line-height: 1.62;
  max-width: 68ch;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.caption.none { color: var(--muted); font-style: italic; }

.side {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 84px;
}
.detail .side { grid-area: side; }

.dl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--accent);
  color: var(--paper);
  text-decoration: none;
  padding: 15px 16px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 100ms ease-out, box-shadow 100ms ease-out;
}
.dl:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.dl .sz { opacity: 0.72; letter-spacing: 0.06em; }

.hint {
  margin: 14px 0 0;
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.06em;
  line-height: 1.8;
  color: var(--muted);
}

.specs {
  margin: 30px 0 0;
  border-top: 1px solid var(--ink);
}
.specs div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
}
.specs dt { color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; }
.specs dd { margin: 0; color: var(--ink); text-align: right; overflow-wrap: anywhere; }

.note {
  margin-top: 24px;
  padding: 14px 16px;
  border: 1px solid var(--rule-strong);
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 0.58rem;
  line-height: 1.8;
  letter-spacing: 0.05em;
  color: var(--ink-2);
}
.note b { display: block; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink); margin-bottom: 4px; }

/* ---------------------------------------------------------------- states */

.panel {
  max-width: 640px;
  margin: 72px auto;
  border: 1px solid var(--ink);
  background: var(--paper);
  box-shadow: 6px 6px 0 var(--ink);
  padding: 30px 32px;
}
.panel h1 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 2rem;
}
.panel p { margin: 0 0 10px; color: var(--ink-2); }
.panel code {
  font-family: var(--mono);
  font-size: 0.72rem;
  background: var(--paper-3);
  padding: 2px 6px;
  overflow-wrap: anywhere;
}
.panel .tag {
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

/* ------------------------------------------------------------ directory */

.directory { list-style: none; margin: 0; padding: 8px 0 60px; }
.directory li { border-bottom: 1px solid var(--rule); }
.directory a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-block: 22px;
  text-decoration: none;
  color: var(--ink);
}
.directory li:first-child a { border-top: 1px solid var(--rule); }
.directory a:hover .dir-title { color: var(--accent); }
.dir-title {
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  line-height: 1.1;
}
.dir-meta {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.dir-go { color: var(--ink); }

/* ---------------------------------------------------------------- about */
.about-head {
  padding-block: 40px 24px;
  border-bottom: 1px solid var(--rule);
}
.about-head h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 4.4vw, 3rem);
  line-height: 1;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 52px;
  padding-block: 26px 60px;
  align-items: start;
}
.about-grid .caption { margin-top: 0; }
.about-grid .caption + .caption { margin-top: 16px; }
.about-grid .side { position: static; }
.about-h {
  margin: 34px 0 12px;
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------------------------------------------------------------- setup */

.setup-head {
  padding-block: 40px 22px;
  border-bottom: 2px solid var(--ink);
}
.setup-head .kicker {
  display: inline-block;
  margin-bottom: 12px;
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.setup-head h1 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  line-height: 1.02;
}
.setup-head p {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.setup-head a { color: var(--muted); text-decoration: none; }
.setup-head a:hover { color: var(--accent); }
.setup-head .head-action { margin: 0; }
.setup-head .link-btn { color: var(--muted); font-size: 0.6rem; letter-spacing: 0.1em; }
.setup-head .link-btn:hover { color: var(--accent); border-bottom-color: var(--accent); }

.stack { display: flex; flex-direction: column; gap: 34px; padding-block: 28px 56px; }
.gate { padding-block: 30px 56px; max-width: 560px; }

.pane {
  border: 1px solid var(--ink);
  background: var(--paper-2, transparent);
  padding: 24px 26px 26px;
}
.pane header { margin-bottom: 18px; }
.pane header h2 {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}
.pane header p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 62ch;
}

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.field > span {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input {
  font-family: var(--serif);
  font-size: 1rem;
  padding: 11px 12px;
  border: 1px solid var(--rule-strong);
  background: transparent;
  color: var(--ink);
  border-radius: 0;
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.field small { font-size: 0.78rem; color: var(--muted); }
.field.grow { flex: 1 1 240px; margin-bottom: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }
.btn.ghost.danger { border-color: var(--danger, #a3231c); color: var(--danger, #a3231c); }
.btn.ghost.danger:hover { background: var(--danger, #a3231c); border-color: var(--danger, #a3231c); color: var(--paper); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.actions form { margin: 0; }

.inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin-top: 6px; }

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 1px solid transparent;
}
.link-btn:hover { color: var(--accent); border-bottom-color: var(--accent); }

.facts { margin: 0 0 22px; display: grid; gap: 10px; }
.facts > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; align-items: baseline; }
.facts dt {
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.facts dd { margin: 0; font-size: 0.95rem; }
.dim { color: var(--muted); font-size: 0.86rem; }

.pill {
  display: inline-block;
  padding: 2px 7px;
  font-family: var(--mono);
  font-size: 0.52rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}
.pill.on { color: var(--accent); }
.pill.off { color: var(--muted); }

.channels { list-style: none; margin: 0 0 22px; padding: 0; }
.channels li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding-block: 12px;
  border-bottom: 1px solid var(--rule);
}
.channels li > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.channels a { color: var(--ink); text-decoration: none; font-size: 1rem; }
.channels a:hover { color: var(--accent); }
.channels .dim { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.06em; }
.channels .channel-actions { flex-direction: row; gap: 16px; flex: none; align-items: baseline; }
.channels form { margin: 0; }
.channels.picker li { align-items: center; }
.channels.picker li > div > span:first-child { font-size: 1rem; }

.empty-line { color: var(--muted); font-size: 0.92rem; margin: 0 0 22px; }

.banner {
  margin: 22px 0 0;
  padding: 12px 16px;
  font-size: 0.92rem;
  border: 1px solid currentColor;
  border-left-width: 3px;
}
.banner.bad { color: var(--danger, #a3231c); }
.banner.good { color: var(--accent); }

.fineprint {
  margin: 16px 0 0;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--muted);
}
.fineprint code {
  font-family: var(--mono);
  font-size: 0.74rem;
  background: rgba(20, 18, 15, 0.06);
  padding: 1px 4px;
}
.after { margin-top: 16px; }
.back { margin-top: 26px; font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; }
.back a { color: var(--muted); text-decoration: none; }
.back a:hover { color: var(--accent); }

/* ---------------------------------------------------------------- footer */

footer {
  border-top: 2px solid var(--ink);
  margin-top: 40px;
  padding-block: 26px 40px;
}
.foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 32px;
  align-items: start;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  line-height: 1.9;
  color: var(--muted);
}
.foot b { color: var(--ink); font-weight: 400; letter-spacing: 0.16em; text-transform: uppercase; }
.foot > .col:first-child span { max-width: 46ch; }
.foot a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--rule); }
.foot a:hover { color: var(--accent); border-color: var(--accent); }
.foot .col { display: flex; flex-direction: column; }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1040px) {
  .detail {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "media"
      "head"
      "action"
      "body"
      "facts";
    column-gap: 0;
  }
  .detail .side { display: contents; }
  .detail .action { grid-area: action; margin-top: 22px; }
  .detail .facts { grid-area: facts; }
  .preview { min-height: 0; }
  .preview video, .preview img { max-height: 46vh; }
  .preview .poster { height: 42vh; }
  .about-grid { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .about-grid .side { display: block; }
  .register { display: none; }
}

@media (max-width: 860px) {
  .wrap {
    padding-inline: max(16px, env(safe-area-inset-left));
  }
  .top-inner {
    grid-template-columns: auto auto;
    justify-content: space-between;
    gap: 12px;
    height: auto;
    padding-block: 10px;
  }
  .brand-main { font-size: 1.15rem; }
  .brand-sub { font-size: 0.46rem; }
  .cinebox-badge { width: 32px; height: 32px; border-radius: 8px; }
  .top-context { display: none; }
  .top-nav-right {
    grid-column: 1 / -1;
    width: 100%;
    gap: 12px;
  }
  .top-nav-right .search {
    flex: 1;
    min-width: 0;
  }
  .search input {
    font-size: 16px; /* Prevents auto-zoom on iOS Safari */
    padding: 8px 4px;
  }
  .search button {
    min-height: 38px;
    font-size: 0.68rem;
    padding: 0 4px 0 12px;
  }
  .theme-toggle {
    min-height: 38px;
    padding: 6px 14px;
    font-size: 0.62rem;
  }
  .channel {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 16px;
  }
  .avatar {
    width: 56px;
    height: 56px;
  }
  .channel h1 {
    font-size: clamp(1.6rem, 5.5vw, 2.3rem);
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .filters {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 8px;
    padding-block: 10px;
    border-bottom: 1px solid var(--rule);
  }
  .filters::-webkit-scrollbar { display: none; }
  .filters .lbl { display: none; }
  .filters a {
    white-space: nowrap;
    padding: 7px 14px;
    border: 1px solid var(--rule);
    border-radius: 999px;
    background: var(--paper-2);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
  }
  .filters a[aria-current] {
    background: var(--accent);
    color: var(--paper);
    border-color: var(--accent);
  }
  .results-head { display: none; }
  .row, .results { border-top-width: 1px; }
  .row {
    grid-template-columns: 52px minmax(0, 1fr) 20px;
    grid-template-areas: "thumb main go" ". meta go";
    gap: 4px 12px;
    padding-block: 12px;
    touch-action: manipulation;
  }
  .row-thumb {
    grid-area: thumb;
    width: 52px;
    height: 52px;
    border-radius: 3px;
  }
  .row-main { grid-area: main; }
  .row-name-text {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
    font-size: 0.76rem;
    line-height: 1.35;
  }
  .row-caption {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.78rem;
  }
  .row-go {
    grid-area: go;
    align-self: center;
    font-size: 1rem;
  }
  .row-kind, .row-size, .row-date { display: none; }
  .row-meta {
    grid-area: meta;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-family: var(--mono);
    font-size: 0.56rem;
    letter-spacing: 0.06em;
    color: var(--muted);
    text-transform: uppercase;
  }
  .detail {
    padding-block: 16px 40px;
  }
  .detail-head h1 {
    font-size: clamp(1.1rem, 4.5vw, 1.45rem);
    word-break: break-word;
    overflow-wrap: anywhere;
    margin-top: 14px;
  }
  .detail .action {
    margin-top: 18px;
  }
  .dl {
    width: 100%;
    justify-content: center;
    padding: 16px 20px;
    font-size: 0.8rem;
    border-radius: 4px;
    min-height: 52px;
    touch-action: manipulation;
  }
  .specs {
    margin-top: 24px;
  }
  .specs div {
    padding: 11px 0;
    font-size: 0.64rem;
    gap: 10px;
  }
  .specs dd {
    word-break: break-word;
  }
  .crumbs {
    padding-block: 14px 0;
    font-size: 0.64rem;
    word-break: break-word;
  }
  .live-pill-sticky {
    bottom: max(12px, env(safe-area-inset-bottom, 12px));
    right: max(12px, env(safe-area-inset-right, 12px));
    padding: 5px 12px;
    font-size: 0.56rem;
    gap: 6px;
  }
  .foot {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-bottom: 76px;
  }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .channel h1 { font-size: 1.85rem; }
  .channel-about {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .toolbar { flex-wrap: wrap; gap: 8px 12px; font-size: 0.58rem; }
  .pager {
    font-size: 0.58rem;
    padding-block: 20px 10px;
  }
  .pager a {
    padding: 8px 12px;
    border: 1px solid var(--rule);
    border-radius: 4px;
    background: var(--paper-2);
  }
  .panel { padding: 18px; box-shadow: 3px 3px 0 var(--ink); }
  .pane { padding: 16px; }
  .facts > div { grid-template-columns: 1fr; gap: 3px; }
  .channels li { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}


/* ============================================================
   NETFLIX-STYLE CINEMATIC VIDEO PLAYER (CINEBOX)
   ============================================================ */

.nf-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 80vh;
  background: #000000;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #ffffff;
  outline: none;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65);
}

.nf-player:fullscreen {
  max-height: 100vh;
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  border-radius: 0;
}
.nf-player:-webkit-full-screen {
  max-height: 100vh;
  width: 100vw;
  height: 100vh;
  border-radius: 0;
}

/* Fullscreen Backdrop & Flyouts */
.nf-player:fullscreen .nf-flyout-backdrop,
.nf-player:-webkit-full-screen .nf-flyout-backdrop {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 99990 !important;
  pointer-events: auto !important;
}

.nf-player:fullscreen .nf-flyout,
.nf-player:-webkit-full-screen .nf-flyout {
  z-index: 100000 !important;
  pointer-events: auto !important;
}

.nf-player:fullscreen .nf-flyout-audio-subs,
.nf-player:-webkit-full-screen .nf-flyout-audio-subs {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  bottom: auto !important;
  right: auto !important;
  transform: translate(-50%, -50%) !important;
  width: min(580px, 92vw) !important;
  max-height: 88vh !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  border-radius: 14px !important;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.95) !important;
  background: #141414 !important;
}

.nf-player:fullscreen .nf-flyout-menu,
.nf-player:-webkit-full-screen .nf-flyout-menu {
  position: absolute !important;
  bottom: 80px !important;
  right: 28px !important;
  max-height: calc(100vh - 100px) !important;
  overflow-y: auto !important;
  z-index: 100000 !important;
  background: #141414 !important;
}

/* Video Element */
.nf-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
  transition: transform 180ms ease-out;
}
.nf-video.nf-aspect-fill {
  object-fit: cover;
}
.nf-video.nf-aspect-stretch {
  object-fit: fill;
}

/* Subtitles Layer */
.nf-subtitles {
  position: absolute;
  bottom: 84px;
  left: 5%;
  right: 5%;
  pointer-events: none;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: clamp(1.1rem, 2.5vw, 1.85rem);
  font-weight: 600;
  line-height: 1.35;
  color: #ffffff;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.95), 0 2px 4px #000000, 0 0 2px #000000;
  transition: bottom 220ms ease;
  z-index: 15;
}
.nf-player.nf-idle .nf-subtitles {
  bottom: 34px;
}
.nf-sub-cue {
  display: inline-block;
  background: rgba(0, 0, 0, 0.65);
  padding: 4px 14px;
  border-radius: 4px;
}

/* Center Feedback Burst Icon (play, pause, skip ripple) */
.nf-center-burst {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.65);
  width: 84px;
  height: 84px;
  background: rgba(20, 20, 20, 0.78);
  border-radius: 50%;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transition: transform 260ms cubic-bezier(0.18, 0.89, 0.32, 1.28), opacity 260ms ease;
  z-index: 20;
}
.nf-center-burst.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.nf-burst-icon svg {
  width: 44px;
  height: 44px;
  fill: #ffffff;
}

/* Loading Spinner */
.nf-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  z-index: 18;
  pointer-events: none;
}
.nf-spinner.show {
  display: block;
}
.nf-spin-ring {
  width: 54px;
  height: 54px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #e50914;
  border-radius: 50%;
  animation: nf-spin 0.75s linear infinite;
}
@keyframes nf-spin {
  to { transform: rotate(360deg); }
}

/* Touch Gesture Zones */
.nf-touch-zones {
  position: absolute;
  inset: 0;
  display: flex;
  pointer-events: none;
  z-index: 12;
}
.nf-touch-zone {
  flex: 1;
  display: grid;
  place-items: center;
  pointer-events: auto;
}
.nf-tap-ripple {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 180ms ease, transform 180ms ease;
}
.nf-touch-zone.active .nf-tap-ripple {
  opacity: 1;
  transform: scale(1.1);
}
.nf-tap-ripple svg {
  width: 38px;
  height: 38px;
}

/* Resume Toast */
.nf-resume-toast {
  position: absolute;
  bottom: 88px;
  left: 28px;
  background: rgba(20, 20, 20, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  z-index: 25;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  animation: nf-fade-in 200ms ease;
}
.nf-resume-toast button {
  background: #e50914;
  color: #fff;
  border: none;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
}
@keyframes nf-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Top Header Overlay */
.nf-overlay-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 20px 28px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 30;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
}
.nf-overlay-top > * {
  pointer-events: auto;
}
.nf-top-back {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #ffffff;
  transition: background 160ms ease, transform 160ms ease;
}
.nf-top-back:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.08);
}
.nf-top-back svg {
  width: 22px;
  height: 22px;
}
.nf-top-titles {
  flex: 1;
  min-width: 0;
}
.nf-top-channel {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e50914;
  margin-bottom: 2px;
}
.nf-top-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #ffffff;
}
.nf-top-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nf-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 3px;
  color: #ffffff;
}

/* Bottom Controls Overlay */
.nf-overlay-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 28px 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.5) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 30;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
}
.nf-overlay-bottom > * {
  pointer-events: auto;
}

/* Idle State: hide top & bottom chrome when active */
.nf-player.nf-idle .nf-overlay-top {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}
.nf-player.nf-idle .nf-overlay-bottom {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}
.nf-player.nf-idle {
  cursor: none;
}

/* Scrub Bar / Timeline */
.nf-timeline-wrap {
  position: relative;
  width: 100%;
  height: 18px;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.nf-scrub-track {
  position: relative;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  transition: height 120ms ease;
}
.nf-timeline-wrap:hover .nf-scrub-track {
  height: 8px;
}
.nf-scrub-buffer {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 2px;
  pointer-events: none;
}
.nf-scrub-hover {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 2px;
  pointer-events: none;
}
.nf-scrub-played {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  background: #e50914;
  border-radius: 2px;
  pointer-events: none;
}
.nf-scrub-thumb {
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  width: 14px;
  height: 14px;
  background: #e50914;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
  transition: transform 120ms ease;
}
.nf-timeline-wrap:hover .nf-scrub-thumb {
  transform: translateY(-50%) scale(1);
}
.nf-time-bubble {
  position: absolute;
  bottom: 22px;
  left: 0;
  transform: translateX(-50%);
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 0.75rem;
  font-family: monospace;
  padding: 3px 8px;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease;
}
.nf-timeline-wrap:hover .nf-time-bubble {
  opacity: 1;
}

/* Controls Row */
.nf-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}
.nf-ctrls-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}
.nf-ctrls-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin-left: auto;
}
.nf-btn-fs {
  flex-shrink: 0 !important;
  margin-left: 2px;
}

/* Buttons */
.nf-btn {
  background: none;
  border: none;
  color: #ffffff;
  padding: 6px;
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 50%;
  transition: transform 140ms ease, color 140ms ease, background 140ms ease;
  outline: none;
}
.nf-btn:hover {
  transform: scale(1.12);
  color: #e50914;
}
.nf-btn:active {
  transform: scale(0.96);
}
.nf-btn svg {
  width: 24px;
  height: 24px;
}

.nf-btn-play {
  padding: 4px;
}
.nf-btn-play svg {
  width: 32px;
  height: 32px;
}

.nf-btn-skip {
  position: relative;
}
.nf-skip-num {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.58rem;
  font-weight: 800;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #ffffff;
  pointer-events: none;
}

/* Volume Group */
.nf-volume-group {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nf-vol-slider-wrap {
  width: 0;
  overflow: hidden;
  transition: width 180ms ease;
  display: flex;
  align-items: center;
}
.nf-volume-group:hover .nf-vol-slider-wrap,
.nf-volume-group:focus-within .nf-vol-slider-wrap {
  width: 76px;
}
.nf-vol-slider {
  width: 68px;
  height: 4px;
  accent-color: #e50914;
  cursor: pointer;
}

/* Time Readout */
.nf-time-display {
  font-family: monospace;
  font-size: 0.8rem;
  color: #b3b3b3;
  margin-left: 6px;
  white-space: nowrap;
}
.nf-time-sep {
  margin: 0 4px;
  opacity: 0.6;
}

/* Text / Dialog Buttons (Speed, Quality, Audio) */
.nf-btn-text {
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.28);
  transition: border-color 150ms ease, background 150ms ease;
}
.nf-btn-text:hover {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  transform: none;
}
.nf-btn-dialog {
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.28);
}
.nf-btn-dialog:hover {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  transform: none;
}
.nf-btn-dialog svg {
  width: 18px;
  height: 18px;
}

/* Flyout Menus / Modals */
.nf-flyout {
  position: absolute;
  background: #141414;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85);
  z-index: 100000 !important;
  pointer-events: auto !important;
  animation: nf-flyout-in 160ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes nf-flyout-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.nf-flyout-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 99990;
  pointer-events: auto;
}

.nf-flyout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.nf-flyout-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
}
.nf-flyout-close {
  background: none;
  border: none;
  color: #b3b3b3;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.nf-flyout-close:hover {
  color: #fff;
}

/* Audio & Subs Two-Column Modal */
.nf-flyout-audio-subs {
  bottom: 80px;
  right: 28px;
  width: min(560px, 92vw);
}
.nf-flyout-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 16px 18px;
}
.nf-flyout-col h4 {
  margin: 0 0 10px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #999;
}

/* Options Lists */
.nf-options-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
}
.nf-options-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 0.84rem;
  color: #cccccc;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.nf-options-list li:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
.nf-options-list li.active {
  color: #ffffff;
  font-weight: 600;
}
.nf-options-list li.active .nf-opt-check {
  color: #e50914;
}
.nf-opt-check {
  width: 14px;
  font-size: 0.9rem;
  font-weight: 700;
  color: transparent;
}
.nf-opt-name {
  flex: 1;
  color: inherit;
  font-size: 0.84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nf-opt-tag {
  font-size: 0.62rem;
  background: rgba(229, 9, 20, 0.22);
  color: #ff5e67;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.nf-opt-section {
  padding: 8px 10px 4px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #888888;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  pointer-events: none;
}

/* Audio Boost Control - Web Audio API 600% */
.nf-audio-boost {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.nf-boost-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.nf-boost-head label {
  font-size: 0.74rem;
  color: #b3b3b3;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 4px;
}
.nf-boost-icon {
  color: #e50914;
}
.nf-boost-badge {
  font-size: 0.72rem;
  font-family: monospace;
  font-weight: 700;
  color: #e50914;
  background: rgba(229, 9, 20, 0.14);
  padding: 2px 6px;
  border-radius: 3px;
}
.nf-boost-row {
  margin-bottom: 8px;
}
.nf-boost-row input {
  width: 100%;
  accent-color: #e50914;
  height: 4px;
  cursor: pointer;
}
.nf-boost-presets {
  display: flex;
  gap: 5px;
  margin-bottom: 6px;
}
.nf-preset-btn {
  flex: 1;
  padding: 4px 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #bbb;
  font-size: 0.72rem;
  font-family: monospace;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.nf-preset-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.nf-preset-btn.active {
  background: #e50914;
  border-color: #e50914;
  color: #fff;
}
.nf-boost-hint {
  display: block;
  font-size: 0.65rem;
  color: #888;
  line-height: 1.35;
}

/* Dual Audio Channel Routing */
.nf-channel-routing {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.nf-routing-head {
  font-size: 0.74rem;
  color: #b3b3b3;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.nf-routing-presets {
  display: flex;
  gap: 5px;
}
.nf-route-btn {
  flex: 1;
  padding: 4px 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #bbb;
  font-size: 0.72rem;
  font-family: monospace;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.nf-route-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.nf-route-btn.active {
  background: #e50914;
  border-color: #e50914;
  color: #fff;
}

/* Upload Custom Subtitle Button */
.nf-sub-upload {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.nf-upload-btn {
  display: inline-block;
  padding: 6px 10px;
  border: 1px dashed rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  font-size: 0.78rem;
  color: #ffffff;
  cursor: pointer;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 150ms ease, background 150ms ease;
}
.nf-upload-btn:hover {
  border-color: #e50914;
  background: rgba(229, 9, 20, 0.08);
}
.nf-sub-upload small {
  display: block;
  margin-top: 6px;
  font-size: 0.68rem;
  color: #888;
}

/* Single-Column Menus (Speed, Quality) */
.nf-flyout-menu {
  bottom: 80px;
  right: 28px;
  min-width: 250px;
  width: max-content;
  max-width: 340px;
  padding-bottom: 6px;
}
.nf-flyout-menu .nf-options-list {
  padding: 6px 10px;
}

/* More / Hamburger Flyout Menu */
.nf-flyout-more {
  bottom: 80px;
  right: 28px;
  min-width: 290px;
  width: max-content;
  max-width: 340px;
  padding-bottom: 6px;
}
.nf-more-list {
  padding: 6px 8px;
  max-height: 380px;
  overflow-y: auto;
}
.nf-more-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  color: #d8d8d8;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
  user-select: none;
}
.nf-more-row:hover,
.nf-more-row:active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}
.nf-more-icon {
  font-size: 1.15rem;
  width: 24px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.nf-more-row .nf-opt-name {
  flex: 1;
  font-weight: 500;
  font-size: 0.86rem;
}
.nf-more-arrow {
  font-size: 1.2rem;
  line-height: 1;
  color: #777777;
  margin-left: 4px;
}
.nf-opt-action {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(229, 9, 20, 0.18);
  color: #ff5e67;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .nf-hide-mobile {
    display: none !important;
  }
  .nf-overlay-top,
  .nf-overlay-bottom {
    padding: 12px 14px;
  }
  .nf-controls-row {
    gap: 6px;
  }
  .nf-ctrls-left {
    gap: 6px;
  }
  .nf-ctrls-right {
    gap: 6px;
  }
  .nf-top-name {
    font-size: 0.95rem;
  }
  .nf-btn {
    padding: 5px;
  }
  .nf-btn-fs {
    padding: 5px;
    flex-shrink: 0 !important;
  }
  .nf-btn svg {
    width: 22px;
    height: 22px;
  }
  .nf-btn-play svg {
    width: 26px;
    height: 26px;
  }
  .nf-btn-dialog span {
    display: none;
  }
  .nf-vol-slider-wrap {
    display: none !important;
  }
  .nf-time-display {
    font-size: 0.72rem;
    margin-left: 2px;
  }

  /* Mobile Bottom Sheet Flyouts */
  .nf-player:not(:fullscreen):not(:-webkit-full-screen) .nf-flyout,
  :not(:fullscreen):not(:-webkit-full-screen) > .nf-flyout {
    position: fixed !important;
    inset: auto 0 0 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    border-radius: 20px 20px 0 0 !important;
    background: #141414 !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    border-bottom: none !important;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.95) !important;
    z-index: 100000 !important;
    max-height: 82vh !important;
    overflow-y: auto !important;
    padding-bottom: max(24px, env(safe-area-inset-bottom, 24px)) !important;
    animation: sheet-up 240ms cubic-bezier(0.16, 1, 0.3, 1) !important;
  }
  @keyframes sheet-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
  .nf-flyout-header {
    position: sticky;
    top: 0;
    background: #141414;
    z-index: 3;
    padding: 16px 20px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .nf-flyout-header h3 {
    font-size: 1.05rem;
  }
  .nf-player:not(:fullscreen):not(:-webkit-full-screen) .nf-flyout-columns {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    padding: 18px 20px !important;
  }
}

@media (max-width: 480px) {
  .nf-overlay-bottom {
    padding: 10px 10px 8px;
  }
  .nf-controls-row {
    gap: 4px;
  }
  .nf-ctrls-left {
    gap: 4px;
  }
  .nf-ctrls-right {
    gap: 4px;
  }
  .nf-btn-skip {
    display: none !important;
  }
  .nf-time-display {
    font-size: 0.68rem;
    margin-left: 0;
  }
  .nf-btn svg {
    width: 20px;
    height: 20px;
  }
  .nf-btn-play svg {
    width: 24px;
    height: 24px;
  }
  .nf-btn-text {
    padding: 2px 6px;
    font-size: 0.72rem;
  }
}

/* ============================================================
   PLAYIT-STYLE GESTURE & CONTROL ADDITIONS
   ============================================================ */

/* Touch Gesture Feedback Indicators (Brightness, Volume, Seek) */
.nf-gesture-indicator {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 14px;
  background: rgba(0, 0, 0, 0.78);
  border-radius: 14px;
  color: #ffffff;
  z-index: 55;
  pointer-events: none;
  animation: nf-fade-in 120ms ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}
.nf-gesture-indicator svg {
  width: 30px;
  height: 30px;
}
.nf-gesture-left {
  left: 14%;
}
.nf-gesture-right {
  right: 14%;
}
.nf-gesture-center {
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 14px 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.nf-gesture-bar {
  width: 5px;
  height: 110px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}
.nf-gesture-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: #e50914;
  border-radius: 3px;
  transition: height 40ms linear;
}
.nf-gesture-indicator span {
  font-size: 0.82rem;
  font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", monospace;
  letter-spacing: 0.02em;
}

/* Seek Gesture Indicator */
.nf-seek-delta {
  font-size: 1.5rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em !important;
  color: #e50914 !important;
}
.nf-seek-preview {
  font-size: 0.82rem !important;
  color: #cccccc !important;
  font-weight: 500 !important;
}

/* Long Press 2x Speed Indicator */
.nf-longpress-speed {
  position: absolute;
  top: 11%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 18px;
  background: rgba(0, 0, 0, 0.85);
  border: 1.5px solid rgba(229, 9, 20, 0.65);
  border-radius: 22px;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  z-index: 56;
  pointer-events: none;
  animation: nf-longpress-pulse 600ms ease-in-out infinite alternate;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}
@keyframes nf-longpress-pulse {
  from { border-color: rgba(229, 9, 20, 0.4); box-shadow: 0 0 12px rgba(229, 9, 20, 0.2); }
  to   { border-color: rgba(229, 9, 20, 0.9); box-shadow: 0 0 24px rgba(229, 9, 20, 0.45); }
}

/* Lock Screen Overlay */
.nf-lock-overlay {
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 90px;
}
.nf-btn-unlock {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 24px;
  background: rgba(18, 18, 18, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 28px;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.nf-btn-unlock:hover {
  background: rgba(35, 35, 35, 0.95);
  transform: scale(1.04);
}
.nf-btn-unlock:active {
  transform: scale(0.97);
}
.nf-btn-unlock svg {
  width: 18px;
  height: 18px;
  opacity: 0.85;
}

/* Lock active state - hide all controls & overlays */
.nf-player.nf-locked .nf-overlay-top,
.nf-player.nf-locked .nf-overlay-bottom,
.nf-player.nf-locked .nf-touch-zones,
.nf-player.nf-locked .nf-resume-toast,
.nf-player.nf-locked .nf-gesture-indicator {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.nf-player.nf-locked {
  cursor: default !important;
}

/* Shutter screenshot flash */
@keyframes nf-screenshot-flash {
  0% { opacity: 0; }
  20% { opacity: 0.95; }
  100% { opacity: 0; }
}
.nf-screenshot-flash {
  position: absolute;
  inset: 0;
  background: #ffffff;
  z-index: 120;
  pointer-events: none;
  animation: nf-screenshot-flash 350ms ease forwards;
}

/* Rotated landscape styling */
.nf-player.nf-rotated-90 .nf-video {
  transform: rotate(90deg) scale(1.35);
}
.nf-player.nf-rotated-180 .nf-video {
  transform: rotate(180deg);
}
.nf-player.nf-rotated-270 .nf-video {
  transform: rotate(270deg) scale(1.35);
}

/* Mobile Gesture Adjustments */
@media (max-width: 768px) {
  .nf-gesture-indicator {
    padding: 12px 10px;
  }
  .nf-gesture-indicator svg {
    width: 24px;
    height: 24px;
  }
  .nf-gesture-bar {
    height: 80px;
  }
  .nf-gesture-left {
    left: 8%;
  }
  .nf-gesture-right {
    right: 8%;
  }
  .nf-lock-overlay {
    padding-bottom: 60px;
  }
  .nf-longpress-speed {
    top: 8%;
    font-size: 0.78rem;
    padding: 5px 14px;
  }
}
