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

.back { display: none; margin-left: -8px; }
body[data-view="watch"] .back { display: grid; }

.search {
  position: relative;
  flex: 1;
  max-width: 640px;
  margin: 0 auto;
}
.search .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  color: var(--faint);
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 42px;
  padding: 0 42px 0 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}
.search input::-webkit-search-cancel-button { display: none; }
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-clear {
  position: absolute;
  right: 4px;
  top: 50%;
  width: 34px;
  height: 34px;
  margin-top: -17px;
  color: var(--muted);
}
.search-clear .icon { width: 18px; height: 18px; }

@media (max-width: 599px) {
  .brand-name { display: none; }
  body[data-view="watch"] .brand { display: none; }
}

/* ---------- page layout ---------- */

.page {
  max-width: 1680px;
  margin: 0 auto;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) 40px max(var(--gutter), env(safe-area-inset-left));
}

.block { margin-top: 20px; }
.block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 14px;
}
.block-head h2 {
  min-width: 0;
  overflow-wrap: anywhere;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.015em;
}
.block-head h2 .icon { width: 20px; height: 20px; color: var(--accent); }
.count { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }

.seg {
  display: inline-flex;
  margin-left: auto;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-2);
}
.seg button {
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / 22%); }

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 6px 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 650;
  font-size: 14px;
}
.filter-pill .icon { width: 16px; height: 16px; }

/* Horizontal rails bleed to the screen edge on phones. */
.rail, .chips-rail {
  display: grid;
  grid-auto-flow: column;
  gap: 12px;
  margin: 0 calc(-1 * var(--gutter));
  padding: 0 var(--gutter) 4px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  scrollbar-width: none;
}
.rail::-webkit-scrollbar, .chips-rail::-webkit-scrollbar { display: none; }
.rail { grid-auto-columns: clamp(148px, 42vw, 188px); gap: 10px; }
.rail > * { scroll-snap-align: start; }
.chips-rail { grid-auto-columns: max-content; gap: 8px; scroll-snap-type: none; }

/* Compact cards in the Trending / Continue watching rows: many fit on screen. */
.rail .card-body { padding: 7px 1px 0; }
.rail .card-title { font-size: 13.5px; line-height: 1.3; }
.rail .card-sub { margin-top: 2px; font-size: 12px; }
.rail .thumb, .rail .thumb img { border-radius: 10px; }
.rail .thumb .serial { top: 6px; left: 6px; padding: 3px 5px; font-size: 11px; }
.rail .thumb .dur { right: 6px; bottom: 6px; font-size: 11px; }
.rail .thumb .rank { top: 6px; right: 6px; padding: 2px 7px 2px 5px; font-size: 11px; }

@media (min-width: 720px) {
  .rail { grid-auto-columns: 196px; gap: 14px; margin: 0; padding: 0 0 4px; scroll-padding: 0; }
}
@media (min-width: 1200px) {
  .rail { grid-auto-columns: 212px; }
}

/* Arrow buttons to scroll the rows on computers (phones just swipe). */
.rail-nav { display: none; gap: 6px; margin-left: auto; }
@media (hover: hover) and (pointer: fine) { .rail-nav { display: flex; } }
.rail-nav button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  transition: background-color .15s, opacity .15s;
}
.rail-nav button:hover { background: var(--surface-2); }
.rail-nav button:disabled { opacity: .35; pointer-events: none; }
.rail-nav .icon { width: 17px; height: 17px; }

/* ---------- video cards ---------- */

.card { display: block; min-width: 0; border-radius: 12px; }

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background: var(--skeleton);
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.thumb.portrait img { object-fit: contain; background: #000; }
.thumb.noimg { display: grid; place-items: center; background: linear-gradient(135deg, var(--surface-3), var(--surface-2)); color: var(--faint); }
.thumb.noimg .icon { width: 34px; height: 34px; }
.thumb .serial { position: absolute; top: 8px; left: 8px; }
.thumb .dur {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgb(0 0 0 / 78%);
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.thumb .rank {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px 3px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 750;
}
.thumb .rank .icon { width: 13px; height: 13px; }

/* Desktop: sweep the mouse across a thumbnail to flip through its 5 frames. */
.scrub {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 4px;
  display: flex;
  gap: 3px;
  opacity: 0;
  transition: opacity .15s;
}
.scrub i { flex: 1; height: 3px; border-radius: 2px; background: rgb(255 255 255 / 45%); }
.scrub i.on { background: #fff; }
.scrubbing .scrub { opacity: 1; }
.scrubbing .dur { opacity: 0; }

@media (hover: hover) {
  .card:hover .thumb img { transform: scale(1.03); }
  .card:hover .card-title { color: var(--accent); }
}

.card-body { padding: 10px 2px 0; min-width: 0; }
.card-title {
  overflow-wrap: anywhere;
  display: -webkit-box;
  overflow: hidden;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
  word-break: break-word;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  transition: color .15s;
}
.card-sub {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.card-sub .tag { color: var(--faint); overflow-wrap: anywhere; }

.card.match .thumb { outline: 3px solid var(--accent); outline-offset: 2px; }
.match-label {
  display: inline-block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* The main list: rows on phones, a grid from tablets up. */
.grid { display: flex; flex-direction: column; gap: 14px; }
.grid > .card {
  display: grid;
  grid-template-columns: minmax(0, 44%) minmax(0, 1fr);
  gap: 12px;
  content-visibility: auto;
  contain-intrinsic-size: auto 100px;
}
.grid > .card .card-body { padding: 1px 0 0; }
.grid > .card .card-title { font-size: 14.5px; -webkit-line-clamp: 3; }
.grid > .card .card-sub { white-space: normal; }

@media (min-width: 600px) {
  .grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 22px 14px;
  }
  .grid > .card { display: block; contain-intrinsic-size: auto 250px; }
  .grid > .card .card-body { padding: 8px 2px 0; }
  .grid > .card .card-title { font-size: 14.5px; -webkit-line-clamp: 2; }
  .grid > .card .card-sub { white-space: nowrap; }
}

.empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 56px 16px;
  color: var(--muted);
  text-align: center;
}
.empty .icon { width: 40px; height: 40px; color: var(--faint); }
.empty strong { color: var(--text); font-size: 17px; }

.skeleton-card .thumb { background: var(--skeleton); }
.skeleton-line { height: 12px; margin-top: 10px; border-radius: 6px; background: var(--skeleton); }
.skeleton-line.short { width: 55%; }

/* ---------- watch page ---------- */

.watch {
  display: grid;
  gap: 8px 28px;
  max-width: 1680px;
  margin: 0 auto;
  padding-bottom: 40px;
}
.watch-info { padding: 14px var(--gutter) 0; min-width: 0; }
.watch-side { padding: 8px var(--gutter) 0; min-width: 0; }

@media (min-width: 720px) {
  .watch { padding: 20px var(--gutter) 56px; }
  .watch-info, .watch-side { padding-left: 0; padding-right: 0; }
  .watch .vp { border-radius: 16px; }
}
@media (min-width: 1100px) {
  .watch { grid-template-columns: minmax(0, 1fr) 380px; }
  .watch-side { padding-top: 0; }
}

.watch-title {
  overflow-wrap: anywhere;
  font-size: 20px;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -0.015em;
  word-break: break-word;
}
@media (min-width: 720px) { .watch-title { font-size: 23px; } }

.watch-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}
.serial-lg {
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font: 750 14px/1 var(--mono);
  font-variant-numeric: tabular-nums;
}
.watch .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.watch .chips.folded .chip:nth-child(n + 9):not(.more-tags) { display: none; }
.more-tags { color: var(--muted); }

.desc {
  position: relative;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  white-space: pre-line;
  word-break: break-word;
  line-height: 1.55;
}
.desc.clamped .desc-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}
.desc-toggle {
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font-weight: 700;
}

.section-title {
  margin: 26px 0 12px;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.01em;
}
.section-title small { margin-left: 6px; color: var(--muted); font-size: 13px; font-weight: 500; }

/* "Inside this video": the 5 preview photos. Tap one to jump there. */
.frames {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 40%;
  gap: 8px;
  margin: 0 calc(-1 * var(--gutter));
  padding: 0 var(--gutter) 4px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  scrollbar-width: none;
}
.frames::-webkit-scrollbar { display: none; }
@media (min-width: 720px) {
  .frames { grid-auto-flow: row; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; padding: 0; overflow: visible; }
}
.frame {
  position: relative;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--skeleton);
  scroll-snap-align: start;
}
.frame img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .25s; }
.frame.portrait img { object-fit: contain; background: #000; }
.frame span {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgb(0 0 0 / 75%);
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
@media (hover: hover) { .frame:hover img { transform: scale(1.05); } }

.serial-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.serial-nav a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color .15s;
}
.serial-nav a:hover { border-color: var(--faint); }
.serial-nav a.next { text-align: right; }
.serial-nav small { color: var(--muted); font-size: 12px; font-weight: 650; }
.serial-nav strong { overflow: hidden; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.serial-nav .off { visibility: hidden; }

.side-list { display: grid; gap: 12px; }
.side-list .card { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 10px; }
.side-list .card .card-body { padding: 0; }
.side-list .card .card-title { font-size: 14px; }
.side-list .thumb { border-radius: 10px; }
@media (max-width: 420px) { .side-list .card { grid-template-columns: 44% minmax(0, 1fr); } }

.notfound { padding: 48px var(--gutter); text-align: center; }
.notfound .actions-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }

/* =================================================================
   Video player
   ================================================================= */

.vp {
  position: relative;
  width: 100%;
  -webkit-touch-callout: none;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: var(--font);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  outline: none;
}
@media (max-width: 719px) {
  .vp.portrait { aspect-ratio: 4 / 5; max-height: 72vh; max-height: 72svh; }
}
@media (orientation: landscape) and (max-height: 540px) {
  .watch { padding-top: 8px; }
  .watch .vp { max-height: calc(100vh - var(--topbar-h) - 16px); max-height: calc(100svh - var(--topbar-h) - 16px); }
}
.vp:fullscreen { aspect-ratio: auto; width: 100%; height: 100%; max-height: none; border-radius: 0; }
.vp:-webkit-full-screen { aspect-ratio: auto; width: 100%; height: 100%; max-height: none; border-radius: 0; }

.vp video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.vp-surface { position: absolute; inset: 0; }
.vp.idle { cursor: none; }

.vp-center {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin: -34px 0 0 -34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(0 0 0 / 55%);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .15s;
}
.vp-center .icon { width: 30px; height: 30px; }
.vp-center:active { transform: scale(.94); }
.vp.paused .vp-center { opacity: 1; pointer-events: auto; }
.vp.paused:not(.started) .vp-center { background: var(--accent); width: 76px; height: 76px; margin: -38px 0 0 -38px; }
@media (hover: none) {
  .vp:not(.idle) .vp-center { opacity: 1; pointer-events: auto; }
}
.vp.waiting .vp-center, .vp.idle .vp-center, .vp.ended .vp-center { opacity: 0; pointer-events: none; }

.vp-spinner {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border: 4px solid rgb(255 255 255 / 22%);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.vp.waiting .vp-spinner { opacity: 1; animation: vp-spin .8s linear infinite; }
@keyframes vp-spin { to { transform: rotate(360deg); } }

.vp-flash {
  position: absolute;
  top: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 38%;
  background: rgb(255 255 255 / 10%);
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s;
}
.vp-flash.left { left: 0; border-radius: 0 999px 999px 0; }
.vp-flash.right { right: 0; border-radius: 999px 0 0 999px; }
.vp-flash span { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.vp-flash .icon { width: 26px; height: 26px; }
.vp-flash.show { opacity: 1; transition: none; }

.vp-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none; /* the gradient must not block taps on the picture or the play button */
  padding: 36px 8px 2px;
  background: linear-gradient(to top, rgb(0 0 0 / 78%), rgb(0 0 0 / 38%) 55%, transparent);
  transition: opacity .25s;
}
.vp.idle .vp-controls { opacity: 0; pointer-events: none; }

.vp-progress, .vp-bar { pointer-events: auto; }
.vp-progress {
  position: relative;
  display: flex;
  align-items: center;
  height: 24px;
  margin: 0 8px;
  cursor: pointer;
  touch-action: none;
}
.vp-track {
  position: relative;
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 4px;
  background: rgb(255 255 255 / 26%);
  transition: height .12s;
}
.vp-progress:hover .vp-track, .vp.dragging .vp-track { height: 6px; }
.vp-buf, .vp-fill { position: absolute; inset: 0; transform: scaleX(0); transform-origin: left; }
.vp-buf { background: rgb(255 255 255 / 38%); }
.vp-fill { background: var(--accent); }
.vp-knobrail { position: absolute; inset: 0; pointer-events: none; }
.vp-knob {
  position: absolute;
  left: -7px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(0);
  transition: transform .12s;
}
.vp-progress:hover .vp-knob, .vp.dragging .vp-knob { transform: scale(1); }
@media (hover: none) { .vp-knob { transform: scale(.85); } .vp.dragging .vp-knob { transform: scale(1.25); } }
.vp-tip {
  position: absolute;
  bottom: 28px;
  left: 0;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgb(0 0 0 / 85%);
  font-size: 12.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
}
.vp-progress:hover .vp-tip, .vp.dragging .vp-tip { opacity: 1; }

.vp-bar { display: flex; align-items: center; height: 46px; }
.vp-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  transition: background-color .15s;
}
.vp-btn:hover { background: rgb(255 255 255 / 12%); }
.vp-btn .icon { width: 22px; height: 22px; }
.vp-time {
  padding: 0 6px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.vp-time .sep { opacity: .6; margin: 0 3px; }
.vp-spacer { flex: 1; }
.vp-vol { display: flex; align-items: center; }
.vp-volume {
  width: 0;
  height: 4px;
  opacity: 0;
  accent-color: #fff;
  cursor: pointer;
  transition: width .2s, opacity .2s, margin .2s;
}
.vp-vol:hover .vp-volume, .vp-volume:focus-visible { width: 80px; margin: 0 8px 0 2px; opacity: 1; }
@media (hover: none) { .vp-volume { display: none; } }

.vp-speed-label { font-size: 12px; font-weight: 800; }

.vp-menu {
  position: absolute;
  right: 8px;
  bottom: 60px;
  width: 280px;
  max-width: calc(100% - 16px);
  max-height: calc(100% - 70px);
  overflow-y: auto;
  padding: 12px;
  border-radius: 14px;
  background: rgb(20 21 26 / 96%);
  box-shadow: 0 8px 30px rgb(0 0 0 / 50%);
}
.vp-menu h4 {
  margin: 2px 4px 8px;
  color: rgb(255 255 255 / 60%);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.vp-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.vp-opts + h4 { margin-top: 14px; }
.vp-opt {
  min-width: 48px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-size: 13px;
  font-weight: 650;
}
.vp-opt:hover { border-color: rgb(255 255 255 / 45%); }
.vp.compact .vp-menu { top: 8px; left: 8px; right: 8px; bottom: 54px; width: auto; max-width: none; max-height: none; padding: 10px; }
.vp.compact .vp-opts { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.vp.compact .vp-opts::-webkit-scrollbar { display: none; }
.vp.compact .vp-opt { flex: none; }
.vp.compact .vp-opts + h4 { margin-top: 10px; }
.vp-opt[aria-pressed="true"] { border-color: #fff; background: #fff; color: #000; }

.vp-note {
  position: absolute;
  left: 12px;
  bottom: 78px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 24px);
  padding: 8px 8px 8px 12px;
  border-radius: 10px;
  background: rgb(0 0 0 / 82%);
  font-size: 13px;
  font-weight: 550;
}
.vp-note button {
  padding: 5px 10px;
  border: 0;
  border-radius: 7px;
  background: rgb(255 255 255 / 16%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.vp-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgb(0 0 0 / 80%);
  text-align: center;
}
.vp-overlay-inner { display: grid; justify-items: center; gap: 8px; max-width: 420px; min-width: 0; }
.vp-overlay small { color: rgb(255 255 255 / 70%); font-size: 13px; font-weight: 650; }
.vp-overlay strong { max-width: 100%; overflow: hidden; font-size: 16px; white-space: nowrap; text-overflow: ellipsis; }
.vp-overlay img { width: 180px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; }
.vp-overlay .row { display: flex; gap: 8px; margin-top: 4px; }
.vp-overlay .btn { min-height: 38px; border-color: rgb(255 255 255 / 25%); background: rgb(255 255 255 / 12%); color: #fff; }
.vp-overlay .btn.primary { border-color: transparent; background: var(--accent); }
@media (max-height: 260px), (max-width: 420px) { .vp-overlay img { display: none; } }

.vp-hold {
  position: absolute;
  top: 12px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 12px 6px 14px;
  border-radius: 999px;
  background: rgb(0 0 0 / 70%);
  font-size: 13px;
  font-weight: 750;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -6px);
  transition: opacity .15s, transform .15s;
}
.vp-hold .icon { width: 16px; height: 16px; }
.vp.holding .vp-hold { opacity: 1; transform: translate(-50%, 0); }

/* =================================================================
   Accounts, likes, saves, comments
   ================================================================= */

.account-btn { width: 42px; height: 42px; margin-right: -4px; }
.account-btn .avatar { width: 34px; height: 34px; font-size: 14px; }

.menu {
  position: fixed;
  top: calc(var(--topbar-h) + env(safe-area-inset-top) + 6px);
  right: max(12px, env(safe-area-inset-right));
  z-index: 40;
  width: min(280px, calc(100% - 24px));
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: modal-in .16s ease-out;
}
.menu-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-head strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.menu-head small { color: var(--muted); font-size: 12.5px; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  font-size: 15px;
  font-weight: 550;
  text-align: left;
}
.menu-item:hover { background: var(--surface-2); }
.menu-item .icon { width: 19px; height: 19px; color: var(--muted); }

/* sign-in dialog */
.auth-mark { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 16px; border-radius: 14px; background: var(--accent); color: #fff; }
.auth-mark .icon { width: 22px; height: 22px; margin-left: 3px; }
.modal-body h2 { font-size: 22px; letter-spacing: -0.02em; }
.modal-sub { margin-top: 6px; color: var(--muted); font-size: 14.5px; }
.auth-seg { display: flex; margin: 20px 0 2px; }
.auth-seg button { flex: 1; height: 38px; font-size: 14px; }
.modal-body .btn.primary { margin-top: 22px; }
.modal-foot { margin-top: 14px; color: var(--faint); font-size: 13px; text-align: center; }

/* like / save / share */
.actions {
  display: flex;
  gap: 8px;
  margin: 14px calc(-1 * var(--gutter)) 0;
  padding: 0 var(--gutter);
  overflow-x: auto;
  scrollbar-width: none;
}
.actions::-webkit-scrollbar { display: none; }
@media (min-width: 720px) { .actions { margin: 14px 0 0; padding: 0; } }
.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  height: 40px;
  padding: 0 16px 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  transition: background-color .15s, border-color .15s, color .15s, transform .1s;
}
.pill-btn:hover { border-color: var(--faint); }
.pill-btn:active { transform: scale(.96); }
.pill-btn .icon { width: 20px; height: 20px; }
.pill-btn[aria-pressed="true"] { border-color: transparent; background: var(--accent-soft); color: var(--accent); }
.pill-btn[aria-pressed="true"] .icon { fill: currentColor; }
.pill-btn.pop .icon { animation: pop .35s ease-out; }
@keyframes pop { 40% { transform: scale(1.35); } }

/* comments */
.comments { margin-top: 30px; }
.c-form { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.c-field { flex: 1; min-width: 0; }
.c-input, .c-fake {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.45;
  text-align: left;
  resize: none;
  overflow: hidden;
}
.c-fake { color: var(--faint); cursor: text; }
.c-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.c-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.c-actions .btn { min-height: 38px; padding: 0 16px; }
.c-list { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; }
.comment { display: flex; align-items: flex-start; gap: 12px; }
.c-main { flex: 1; min-width: 0; }
.c-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 14px; }
.c-head time { color: var(--faint); font-size: 12.5px; }
.c-body { margin-top: 3px; white-space: pre-line; word-break: break-word; line-height: 1.5; }
.c-del { width: 34px; height: 34px; margin: -4px -6px 0 0; color: var(--faint); }
.c-del .icon { width: 17px; height: 17px; }
.c-empty { padding: 18px 0 6px; color: var(--muted); text-align: center; }
.c-more { margin-top: 18px; }
.comment.fresh { animation: modal-in .3s ease-out; }

/* "Continue watching" progress under the thumbnail */
.thumb .watched { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgb(255 255 255 / 30%); }
.thumb .watched i { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }

/* Free-preview countdown and the paywall on the player */
.vp-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px 6px 9px;
  border-radius: 999px;
  background: rgb(0 0 0 / 72%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.vp-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.vp-badge.low::before { background: var(--warn); }
.vp-badge.low { color: #ffe3a3; }
.vp.locked .vp-controls, .vp.locked .vp-center { display: none; }
.vp-overlay.paywall { z-index: 4; background: rgb(0 0 0 / 82%); }
.paywall p { margin: 0; color: rgb(255 255 255 / 75%); font-size: 13.5px; }
.paywall .linkish { margin-top: 4px; padding: 6px; border: 0; background: none; color: #fff; font-size: 13.5px; font-weight: 650; text-decoration: underline; }
@media (min-width: 600px) { .paywall strong { font-size: 19px; } }

/* Pass plans */
.plans { display: grid; gap: 10px; margin-top: 20px; }
.plan {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 12px;
  width: 100%;
  min-height: 64px;
  padding: 12px 16px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-align: left;
  transition: border-color .15s, background-color .15s;
}
.plan:hover { border-color: var(--faint); }
.plan[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.plan-name { font-size: 16px; font-weight: 700; }
.plan-price { grid-row: span 2; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.plan-note { color: var(--muted); font-size: 13px; }
.plan-note b { color: var(--accent); font-weight: 750; }
.plan.skeleton { background: var(--skeleton); border-color: transparent; }
.modal-foot a { color: inherit; text-decoration: underline; }
.menu-pass.on { color: var(--ok); font-weight: 650; }

.site-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
  padding: 8px var(--gutter) calc(28px + env(safe-area-inset-bottom));
  color: var(--faint);
  font-size: 13px;
}
.site-foot a:hover { color: var(--text); }

/* Terms, privacy, refunds, contact */
.legal { max-width: 720px; margin: 0 auto; padding: 28px var(--gutter) 40px; line-height: 1.65; }
.legal h1 { font-size: 28px; letter-spacing: -0.02em; }
.legal h2 { margin: 28px 0 8px; font-size: 18px; }
.legal p, .legal li { color: var(--text); }
.legal ul { padding-left: 20px; }
.legal li + li { margin-top: 6px; }
.legal a { color: var(--accent); text-decoration: underline; }
.legal-updated { margin-top: 4px; color: var(--muted); font-size: 14px; }
.contact-list { display: grid; gap: 12px; padding: 0 !important; list-style: none; }
.contact-list li { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.contact-list b { color: var(--muted); font-size: 13px; font-weight: 650; }

/* Pricing page */
.trial-note { margin: 18px 0 4px; padding: 12px 16px; border-radius: 14px; background: var(--ok-soft); }
.price-list { display: grid; gap: 10px; }
.price-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); }
.price-card.best { border-color: var(--accent); background: var(--accent-soft); }
.price-card strong { display: block; font-size: 17px; }
.price-card span { color: var(--muted); font-size: 13.5px; }
.price-card span b { color: var(--accent); }
.price-card .price { flex: none; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.legal-small { color: var(--muted); font-size: 13.5px; }
.legal ol { padding-left: 20px; }
.legal ol li + li { margin-top: 6px; }
.legal .btn.primary { margin-top: 8px; color: var(--on-accent); text-decoration: none; }

/* Messages inside the player (errors, paywall): always say what to do next */
.vp-overlay { overflow-y: auto; }
.vp-overlay p { margin: 0; max-width: 380px; color: rgb(255 255 255 / 78%); font-size: 13.5px; line-height: 1.45; }
.vp-overlay .row { flex-wrap: wrap; justify-content: center; }
.vp-help { font-size: 12.5px !important; }
.vp-help a { color: #fff; text-decoration: underline; }
.vp.compact .vp-overlay p { font-size: 12.5px; }
.vp.compact .vp-overlay { padding: 10px; }

/* Payment status dialog */
.pay-status { display: grid; justify-items: center; gap: 10px; padding-top: 6px; text-align: center; }
.pay-status h2 { font-size: 20px; }
.pay-status p { color: var(--muted); font-size: 14.5px; }
.pay-status .mono { font-family: var(--mono); font-size: 13px; color: var(--text); }
.pay-status .btn { width: 100%; }
.pay-icon { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; }
.pay-icon .icon { width: 28px; height: 28px; stroke-width: 2.4; }
.pay-icon.ok { background: var(--ok-soft); color: var(--ok); }
.pay-icon.warn { background: var(--warn-soft); color: var(--warn); }
.pay-icon.bad { background: var(--danger-soft); color: var(--danger); }
.pay-icon.wait { background: var(--surface-2); }
.pay-spin { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: vp-spin .8s linear infinite; }
.plans-help { margin-top: 10px; color: var(--muted); font-size: 13.5px; text-align: center; }
.plans-help a { color: var(--accent); text-decoration: underline; }
.c-empty .linkish, .form-error a { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 650; text-decoration: underline; cursor: pointer; }
/* While a message covers the player, hide what sits underneath it */
.vp-overlay { z-index: 4; }
.vp-error { background: rgb(0 0 0 / 90%); }
.vp:has(.vp-error) .vp-controls, .vp:has(.vp-error) .vp-center, .vp:has(.vp-error) .vp-badge, .vp:has(.vp-error) .vp-note { display: none; }
.vp.compact .vp-error small { display: none; }

.vp-preview .vp-time .sep, .vp-preview .vp-dur { display: none; }
