/* CineVerse HLS player (cv-player) UI */

.cvp {
  position: absolute;
  inset: 0;
  background: #000;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  z-index: 2;
}

.cvp, .cvp * { box-sizing: border-box; }

.cvp video {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: contain;
}

.cvp.cvp-cursor-hidden { cursor: none; }
.cvp.cvp-cursor-hidden video { cursor: none; }

/* Big play button */
.cvp-bigplay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(242, 241, 236, 0.96);
  color: #08090b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  padding-left: 5px;
  cursor: pointer;
  z-index: 6;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
  border: none;
}
.cvp-bigplay:hover { transform: translate(-50%, -50%) scale(1.08); background: #fff; }
.cvp-bigplay.cvp-hidden { opacity: 0; pointer-events: none; }

/* Spinner */
.cvp-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(242, 241, 236, 0.9);
  font-size: 40px;
  z-index: 6;
  display: none;
}
.cvp-spinner.cvp-on { display: block; }
.cvp-spinner i { animation: cvpSpin 0.9s linear infinite; }
@keyframes cvpSpin { to { transform: rotate(360deg); } }

/* Error box */
.cvp-error {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: rgba(242, 241, 236, 0.75);
  padding: 30px;
  z-index: 7;
  background: #000;
}
.cvp-error.cvp-on { display: flex; }
.cvp-error i { font-size: 54px; color: rgba(239, 68, 68, 0.6); margin-bottom: 16px; }
.cvp-error h3 { color: #fff; font-size: 18px; margin-bottom: 8px; font-weight: 700; }
.cvp-error p { font-size: 13px; max-width: 420px; line-height: 1.6; margin-bottom: 18px; }
.cvp-retry {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--fg, #f2f1ec);
  color: #08090b;
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.cvp-retry:hover { background: #fff; }

/* Controls bar */
.cvp-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  padding: 46px 16px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.35) 55%, rgba(0, 0, 0, 0));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}
.cvp.cvp-showing .cvp-controls { opacity: 1; visibility: visible; }

.cvp-progress-row { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.cvp-time {
  font-size: 12px;
  color: rgba(242, 241, 236, 0.85);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: 0.2px;
  display: flex;
  gap: 6px;
}
.cvp-t-sep { color: rgba(242, 241, 236, 0.4); }
.cvp-t-dur { color: rgba(242, 241, 236, 0.55); }

.cvp-seek-wrap { flex: 1; display: flex; align-items: center; }
.cvp-seek {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(242, 241, 236, 0.22);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  transition: height 0.15s ease;
}
.cvp-seek:hover { height: 6px; }
.cvp-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--gold, #f0b429);
  border: 2px solid #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
  transition: transform 0.12s ease;
}
.cvp-seek:hover::-webkit-slider-thumb { transform: scale(1.15); }
.cvp-seek::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--gold, #f0b429);
  border: 2px solid #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

.cvp-btns { display: flex; align-items: center; gap: 4px; }
.cvp-btn {
  width: 38px;
  height: 38px;
  border: none;
  background: none;
  color: rgba(242, 241, 236, 0.9);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
  font-family: inherit;
}
.cvp-btn:hover { background: rgba(242, 241, 236, 0.12); color: #fff; }
.cvp-btn.cvp-on { color: var(--gold, #f0b429); }

.cvp-quality {
  width: auto;
  min-width: 52px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: rgba(242, 241, 236, 0.9);
}

.cvp-vol-wrap { display: flex; align-items: center; }
.cvp-vol-range {
  width: 0;
  overflow: hidden;
  opacity: 0;
  transition: width 0.2s ease, opacity 0.2s ease, margin 0.2s ease;
}
.cvp-vol-wrap:hover .cvp-vol-range,
.cvp-vol-range.cvp-on { width: 74px; opacity: 1; margin: 0 8px 0 2px; }
.cvp-vol-range input { width: 74px; }
.cvp-vol-range input {
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(242, 241, 236, 0.22);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}
.cvp-vol-range input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold, #f0b429);
  border: 2px solid #fff;
}
.cvp-vol-range input::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold, #f0b429);
  border: 2px solid #fff;
}

.cvp-spacer { flex: 1; }

/* Settings menu */
.cvp-menu {
  position: absolute;
  right: 16px;
  bottom: 58px;
  z-index: 9;
  width: 240px;
  max-height: calc(100% - 120px);
  overflow-y: auto;
  background: rgba(16, 17, 21, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(242, 241, 236, 0.1);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  padding: 8px;
  display: none;
}
.cvp-menu.cvp-on { display: block; }
.cvp-menu-panel { display: none; }
.cvp-menu-panel.cvp-on { display: block; }

.cvp-menu-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(242, 241, 236, 0.5);
  padding: 8px 12px 4px;
}
.cvp-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--fg, #f2f1ec);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.13s ease;
}
.cvp-menu-item:hover { background: rgba(242, 241, 236, 0.07); }
.cvp-menu-item em {
  font-style: normal;
  font-size: 12px;
  color: rgba(242, 241, 236, 0.55);
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cvp-menu-item .cvp-mi-icon { font-size: 11px; color: rgba(242, 241, 236, 0.4); }

.cvp-sub-back {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  color: rgba(242, 241, 236, 0.8);
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
}
.cvp-sub-back:hover { background: rgba(242, 241, 236, 0.07); }
.cvp-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: none;
  border-radius: 9px;
  color: rgba(242, 241, 236, 0.85);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.13s ease;
}
.cvp-opt:hover { background: rgba(242, 241, 236, 0.07); }
.cvp-opt.cvp-selected { color: var(--gold, #f0b429); font-weight: 700; }
.cvp-opt .cvp-opt-check { font-size: 11px; opacity: 0; }
.cvp-opt.cvp-selected .cvp-opt-check { opacity: 1; }

/* Goated-style settings menu grid */
.cvp-mi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 2px 2px 8px; }
.cvp-mi-grid .cvp-menu-item { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 11px; background: rgba(242, 241, 236, 0.05); border: 1px solid rgba(242, 241, 236, 0.08); }
.cvp-mi-grid .cvp-menu-item:hover { background: rgba(242, 241, 236, 0.1); }
.cvp-mi-grid .cvp-mi-ic { font-size: 13px; color: rgba(242, 241, 236, 0.55); }
.cvp-mi-grid .cvp-mi-txt { font-size: 12px; font-weight: 600; }
.cvp-mi-grid .cvp-menu-item em { order: 2; font-style: normal; font-size: 10.5px; font-weight: 700; color: rgba(242, 241, 236, 0.45); max-width: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cvp-menu-item .cvp-mi-ic { font-size: 13px; color: rgba(242, 241, 236, 0.55); width: 18px; text-align: center; }
.cvp-menu-item .cvp-mi-txt { flex: 1; }

/* Playback settings panel */
.cvp-pb-sec { padding: 8px 2px; border-top: 1px solid rgba(242, 241, 236, 0.07); }
.cvp-pb-sec:first-child { border-top: none; }
.cvp-pb-sec-title { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: rgba(242, 241, 236, 0.4); padding: 4px 10px 6px; }
.cvp-pb-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; }
.cvp-pb-label { flex: 0 0 84px; font-size: 12.5px; color: rgba(242, 241, 236, 0.8); }
.cvp-pb-val { flex: 0 0 42px; text-align: right; font-size: 12px; font-weight: 700; color: var(--gold, #f0b429); font-variant-numeric: tabular-nums; }
.cvp-pb-range { flex: 1; -webkit-appearance: none; appearance: none; height: 4px; background: rgba(242, 241, 236, 0.22); border-radius: 3px; outline: none; cursor: pointer; }
.cvp-pb-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--gold, #f0b429); border: 2px solid #fff; }
.cvp-pb-range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--gold, #f0b429); border: 2px solid #fff; }

/* Sleep timer panel */
.cvp-sleep-wrap { padding: 8px 4px; }
.cvp-sleep-active { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 10px; border-radius: 12px; background: rgba(242, 241, 236, 0.06); }
.cvp-sleep-active-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: rgba(242, 241, 236, 0.45); }
.cvp-sleep-count { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; color: #fff; }
.cvp-sleep-adj { display: flex; gap: 8px; }
.cvp-sleep-pill { border: none; border-radius: 999px; background: rgba(242, 241, 236, 0.08); color: rgba(242, 241, 236, 0.75); font-size: 12px; font-weight: 600; padding: 7px 14px; cursor: pointer; font-family: inherit; }
.cvp-sleep-pill:hover { background: rgba(242, 241, 236, 0.14); }
.cvp-sleep-cancel { margin-top: 4px; border: none; border-radius: 999px; background: rgba(214, 69, 69, 0.16); color: #e07171; font-size: 13px; font-weight: 600; padding: 8px 18px; cursor: pointer; font-family: inherit; }
.cvp-sleep-cancel:hover { background: rgba(214, 69, 69, 0.26); }
.cvp-sleep-set { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.cvp-sleep-min { flex: 1; min-width: 0; padding: 9px; border-radius: 8px; border: 1px solid rgba(242, 241, 236, 0.25); background: rgba(242, 241, 236, 0.06); color: #fff; font-size: 14px; text-align: center; font-weight: 700; caret-color: var(--gold, #f0b429); }
.cvp-sleep-min::placeholder { color: rgba(242, 241, 236, 0.3); }
.cvp-sleep-setbtn { border: none; border-radius: 8px; background: var(--gold, #f0b429); color: #16130b; font-size: 13px; font-weight: 700; padding: 9px 14px; cursor: pointer; font-family: inherit; }
.cvp-sleep-setbtn-ghost { background: transparent; color: rgba(242, 241, 236, 0.9); border: 1px solid rgba(242, 241, 236, 0.25); }

/* Download panel */
.cvp-dl-wrap { padding: 8px 4px; }
.cvp-dl-note { margin: 0 0 12px; font-size: 12.5px; line-height: 1.5; color: rgba(242, 241, 236, 0.7); }

/* Pause details overlay */
.cvp-details {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: none;
  align-items: center;
  padding: 40px;
  background: linear-gradient(to right, rgba(5, 6, 9, 0.94) 0%, rgba(5, 6, 9, 0.78) 42%, rgba(5, 6, 9, 0.5) 100%);
  cursor: pointer;
  overflow: hidden;
}
.cvp-details.cvp-on { display: flex; }
.cvp-details-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
  filter: blur(8px) brightness(0.75);
  pointer-events: none;
}
.cvp-details-body {
  position: relative;
  max-width: 640px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.cvp-details-title {
  margin: 0;
  font-size: clamp(26px, 4vw, 44px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.65);
}
.cvp-details-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  font-size: 14px;
  color: rgba(242, 241, 236, 0.72);
}
.cvp-details-meta i.fa-star { color: var(--gold, #f0b429); }
.cvp-details-rate { font-weight: 700; color: rgba(242, 241, 236, 0.95); }
.cvp-details-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(242, 241, 236, 0.78);
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}
.cvp-details-resume {
  margin-top: 4px;
  background: var(--gold, #f0b429);
  color: #16130b;
  border: none;
  border-radius: 999px;
  padding: 12px 26px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(240, 180, 41, 0.32);
}
.cvp-details-resume:hover { filter: brightness(1.08); }

/* Sleep timer chip */
.cvp-sleep-chip {
  position: absolute;
  top: 12px;
  right: 56px;
  z-index: 6;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(18, 18, 24, 0.85);
  border: 1px solid rgba(242, 241, 236, 0.16);
  color: rgba(242, 241, 236, 0.9);
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
}
.cvp-sleep-chip.cvp-on { display: inline-flex; }
.cvp-sleep-chip i { color: var(--gold, #f0b429); }

/* Toast */
.cvp-toast {
  position: absolute;
  bottom: 66px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  max-width: 84%;
  padding: 9px 16px;
  border-radius: 8px;
  background: rgba(18, 18, 24, 0.92);
  border: 1px solid rgba(242, 241, 236, 0.16);
  color: rgba(242, 241, 236, 0.95);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.cvp-toast.cvp-on { opacity: 1; }

/* Watch party badge */
.cvp-wp-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 6;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(18, 18, 24, 0.85);
  border: 1px solid rgba(240, 180, 41, 0.55);
  color: var(--gold, #f0b429);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
}
.cvp-wp-badge.cvp-on { display: inline-flex; }

/* Watch party panel */
.cvp-wp-wrap { padding: 8px 4px; }
.cvp-wp-intro { margin: 0 0 12px; font-size: 12.5px; line-height: 1.5; color: rgba(242, 241, 236, 0.75); }
.cvp-wp-btn {
  width: 100%;
  margin: 4px 0;
  padding: 10px 0;
  border: none;
  border-radius: 10px;
  background: var(--gold, #f0b429);
  color: #16130b;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.cvp-wp-btn i { margin-right: 6px; }
.cvp-wp-btn:disabled { opacity: 0.4; cursor: default; }
.cvp-wp-btn-ghost { background: transparent; color: rgba(242, 241, 236, 0.9); border: 1px solid rgba(242, 241, 236, 0.25); }
.cvp-wp-btn-danger { background: rgba(214, 69, 69, 0.18); color: #e07171; border: 1px solid rgba(214, 69, 69, 0.45); }
.cvp-wp-btn-danger:hover { background: rgba(214, 69, 69, 0.28); }
.cvp-wp-row { display: flex; gap: 6px; align-items: center; }
.cvp-wp-row .cvp-wp-btn { flex: 0 0 auto; width: auto; padding: 11px 18px; }
.cvp-wp-input {
  flex: 1;
  min-width: 0;
  padding: 11px 8px;
  border-radius: 10px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 4px;
  text-transform: uppercase;
  caret-color: var(--gold, #f0b429);
  outline: 1px solid rgba(255, 255, 255, 0.12);
  font-family: inherit;
}
.cvp-wp-input:focus { outline-color: rgba(240, 180, 41, 0.55); }
.cvp-wp-input::placeholder { color: rgba(255, 255, 255, 0.22); font-size: 15px; letter-spacing: 3px; }
.cvp-wp-error { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; padding: 8px 10px; border-radius: 8px; background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.35); }
.cvp-wp-error-txt { flex: 1; font-size: 12.5px; color: #f2a8a8; }
.cvp-wp-error-x { border: none; background: none; color: rgba(255, 255, 255, 0.5); font-size: 13px; cursor: pointer; padding: 2px; }
.cvp-wp-error-x:hover { color: #fff; }
.cvp-wp-room { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 12px; margin-bottom: 10px; border-radius: 12px; background: rgba(242, 241, 236, 0.06); }
.cvp-wp-room-cta { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: rgba(242, 241, 236, 0.45); }
.cvp-wp-share { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border-radius: 8px; border: none; background: rgba(255, 255, 255, 0.06); cursor: pointer; font-family: inherit; }
.cvp-wp-share:hover { background: rgba(255, 255, 255, 0.1); }
.cvp-wp-share-url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; color: rgba(242, 241, 236, 0.7); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-align: left; }
.cvp-wp-copy-ic { font-size: 13px; color: rgba(242, 241, 236, 0.5); }
.cvp-wp-room-or { font-size: 12px; color: rgba(242, 241, 236, 0.5); margin: 2px 0; }
.cvp-wp-room-code { font-size: 32px; font-weight: 800; letter-spacing: 8px; color: var(--gold, #f0b429); }
.cvp-wp-room-label { font-size: 12.5px; color: rgba(242, 241, 236, 0.65); }
.cvp-wp-count { font-size: 12.5px; color: rgba(242, 241, 236, 0.6); margin-top: 4px; }
.cvp-wp-cancel { width: 100%; margin-top: 4px; border: none; background: none; color: rgba(242, 241, 236, 0.45); font-size: 13px; cursor: pointer; padding: 8px; font-family: inherit; }
.cvp-wp-cancel:hover { color: #fff; }

/* Loading overlay (initial) */
.cvp-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  background: #000;
  color: rgba(242, 241, 236, 0.85);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.cvp-loading.cvp-hidden { display: none; }

@media (max-width: 640px) {
  .cvp-controls { padding: 40px 10px 10px; }
  .cvp-bigplay { width: 68px; height: 68px; font-size: 24px; }
  .cvp-menu { right: 10px; bottom: 52px; width: 220px; }
  .cvp-btn { width: 34px; height: 34px; font-size: 14px; }
  .cvp-vol-wrap { display: none; }
}

/* Fake-fullscreen fallback (iOS Safari / unsupported browsers) */
.cvp.cvp-fake-fs {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  z-index: 2147483000 !important;
  background: #000 !important;
}
body.cvp-fake-fs-body { overflow: hidden !important; }
