:root {
  --violet: #706fd3;
  --cream: #f7f1e3;
  --ink: #1c1c2b;
  --muted: #6a6a7c;
  --line: #e2dccb;
}

* { box-sizing: border-box; }

/* The `hidden` attribute must always win. Author rules like
   `.gate-form { display: flex }` otherwise override the UA `[hidden]` rule,
   leaving "hidden" sections (e.g. the request-access form) visible. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family: "Manrope", system-ui, sans-serif;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.gate {
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.headline {
  font-family: "Cormorant Upright", Georgia, serif;
  font-weight: 600;
  font-size: 44px;
  line-height: 1.05;
  margin: 0 0 12px;
  font-variant-numeric: lining-nums;
  font-feature-settings: "lnum" 1;
}

.sub {
  color: var(--muted);
  font-size: 16px;
  margin: 0 0 28px;
}

.gate-form {
  display: flex;
  gap: 8px;
  flex-direction: column;
}

#email {
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: #fff;
}

#email:focus {
  outline: 2px solid var(--violet);
  outline-offset: 1px;
  border-color: var(--violet);
}

.gate-form button {
  height: 48px;
  border: 0;
  border-radius: 10px;
  background: var(--violet);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.gate-form button:disabled { opacity: 0.6; cursor: default; }

.gate-msg {
  min-height: 20px;
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.player-wrap {
  width: 100%;
  max-width: 960px;
}

/* ---- Custom video player ---- */
.vp {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  line-height: 0;
  outline: none;
}

.vp.is-fullscreen { border-radius: 0; }

.player {
  width: 100%;
  display: block;
}

/* transparent click layer for play/pause; sits under the control bar */
.vp-click {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 0;
  background: transparent;
  cursor: pointer;
}

/* centre flash icon on play/pause */
.vp-flash {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 76px;
  height: 76px;
  transform: translate(-50%, -50%) scale(0.7);
  z-index: 2;
  pointer-events: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(28, 28, 43, 0.55);
  opacity: 0;
}

.vp-flash svg { width: 38px; height: 38px; fill: #fff; }
.vp-flash.is-flashing { animation: vp-flash 0.5s ease-out; }

@keyframes vp-flash {
  0% { opacity: 0.9; transform: translate(-50%, -50%) scale(0.7); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.15); }
}

/* seek feedback */
.vp-seek {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(28, 28, 43, 0.55);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
}

.vp-seek svg { width: 22px; height: 22px; fill: #fff; }
.vp-seek--back { left: 24px; }
.vp-seek--fwd { right: 24px; }
.vp-seek.is-showing { animation: vp-seekfade 0.6s ease-out; }

@keyframes vp-seekfade {
  0% { opacity: 0.95; }
  100% { opacity: 0; }
}

/* control bar (Streamable layout: progress on top, controls row below) */
.vp-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 28px 14px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0));
  line-height: 1;
  transition: opacity 0.2s ease;
}

.vp-row { display: flex; align-items: center; }
.vp-row-side { display: flex; align-items: center; gap: 2px; }
.vp-row-side--right { gap: 4px; }

.vp.hide-controls .vp-controls { opacity: 0; }
.vp.hide-controls .vp-click { cursor: none; }

.vp-btn {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.vp-btn:hover { background: rgba(255, 255, 255, 0.15); }
.vp-btn svg { width: 22px; height: 22px; fill: currentColor; }

/* icon state toggles */
/* control bar: play icon when paused, pause icon when playing */
.vp-controls .ic-pause { display: none; }
.vp.is-playing .vp-controls .ic-play { display: none; }
.vp.is-playing .vp-controls .ic-pause { display: block; }
/* centre flash: show the icon of the action just taken (pause when paused) */
.vp-flash .ic-play { display: none; }
.vp.is-playing .vp-flash .ic-pause { display: none; }
.vp.is-playing .vp-flash .ic-play { display: block; }
/* mute button */
.ic-mute { display: none; }
.vp.is-muted .ic-vol { display: none; }
.vp.is-muted .ic-mute { display: block; }

/* scrubber */
.vp-scrub {
  width: 100%;
  display: flex;
  align-items: center;
  height: 16px;
  cursor: pointer;
  touch-action: none;
}

.vp-scrub-track {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.28);
}

.vp-scrub:hover .vp-scrub-track { height: 6px; }

.vp-scrub-buffer,
.vp-scrub-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 4px;
}

.vp-scrub-buffer { background: rgba(255, 255, 255, 0.4); width: 0; }
.vp-scrub-fill {
  background: var(--violet);
  width: 0;
  /* glide between the ~4Hz timeupdate steps so progress looks smooth */
  transition: width 0.25s linear;
}

/* during a drag, track the pointer 1:1 (no easing) */
.vp.is-scrubbing .vp-scrub-fill,
.vp.is-scrubbing .vp-scrub-thumb { transition: none; }

.vp-scrub-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.15s ease, left 0.25s linear;
}

.vp-scrub:hover .vp-scrub-thumb,
.vp.is-scrubbing .vp-scrub-thumb { opacity: 1; }

.vp-time {
  flex: 1 1 auto;
  text-align: center;
  color: #fff;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.vp-btn:focus-visible,
.vp-scrub:focus-visible,
.reaction-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* skip ±10 buttons: arrow icon with a small "10" overlaid */
.vp-btn--skip { position: relative; }
.vp-skip-n {
  position: absolute;
  top: 53%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 8px;
  font-weight: 700;
  pointer-events: none;
}

/* speed text button + menu */
.vp-btn--text {
  width: auto;
  min-width: 34px;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.vp-speed-wrap { position: relative; }

.vp-menu {
  position: absolute;
  right: 0;
  bottom: 42px;
  z-index: 6;
  min-width: 92px;
  padding: 6px;
  border-radius: 10px;
  background: rgba(20, 20, 30, 0.96);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vp-menu button {
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 13px;
  text-align: left;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.vp-menu button:hover { background: rgba(255, 255, 255, 0.14); }
.vp-menu button.is-active { color: var(--violet); font-weight: 700; }

.vp-brand {
  color: rgba(255, 255, 255, 0.85);
  font-family: "Cormorant Upright", Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  padding-left: 6px;
  user-select: none;
}

/* ---- End-of-video screen ---- */
.vp-end {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 20, 30, 0.92);
  line-height: 1.4;
}

.vp-end-close {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.vp-end-close:hover { background: rgba(255, 255, 255, 0.15); }
.vp-end-close svg { width: 22px; height: 22px; }

.vp-end-inner { width: 100%; max-width: 460px; text-align: center; }

.vp-end-title {
  margin: 0 0 12px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
}

.vp-end-box {
  position: relative;
  text-align: left;
}

.vp-end-msg {
  width: 100%;
  resize: none;
  padding: 14px 110px 14px 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font: inherit;
  font-size: 15px;
}
.vp-end-msg::placeholder { color: rgba(255, 255, 255, 0.45); }
.vp-end-msg:focus { outline: none; border-color: var(--violet); }

.vp-end-send {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 9px 18px;
  border: 0;
  border-radius: 8px;
  background: var(--violet);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.vp-end-send:disabled { opacity: 0.6; cursor: default; }

.vp-end-status {
  min-height: 18px;
  margin: 10px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  text-align: left;
}
.vp-end-status.error { color: #ff9b9b; }

.vp-watch-again {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding: 10px 18px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.vp-watch-again:hover { background: rgba(255, 255, 255, 0.12); }
.vp-watch-again svg { width: 20px; height: 20px; }

/* ---- Reactions ---- */
.vp-reactions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

.reaction-btn {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}
.reaction-btn:hover { background: rgba(255, 255, 255, 0.18); transform: translateY(-2px); }
.reaction-btn.is-popped { animation: vp-pop 0.4s ease; }

@keyframes vp-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* reaction bar under the video (centred) */
.reaction-bar {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.reaction-set { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

.reaction-set .reaction-btn {
  width: 44px;
  height: 44px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 20px;
}
.reaction-set .reaction-btn:hover { background: #fdfbf5; }

/* emoji markers dropped on the timeline at the moment of reaction */
.vp-mark {
  position: absolute;
  bottom: 8px;
  transform: translateX(-50%);
  font-size: 13px;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5));
}

/* pulse used both when a reaction is added and when the playhead passes it */
.vp-mark.is-pulse { animation: vp-markpulse 0.55s ease; }

@keyframes vp-markpulse {
  0% { transform: translateX(-50%) scale(1); }
  35% { transform: translateX(-50%) scale(1.7); }
  100% { transform: translateX(-50%) scale(1); }
}

/* pass-by "pop & drop": the emoji springs up (a modest height), drops back onto
   the bar with a small bounce, then fades. Used on the mini bar as the playhead
   reaches a reaction (reactions are not persistently shown). */
.vp-mark--flash {
  font-size: 15px;
  transform-origin: 50% 100%; /* scale from the base so it "lands" on the bar */
  animation: vp-popdrop 1.2s ease-out forwards;
}

@keyframes vp-popdrop {
  0%   { opacity: 0; transform: translateX(-50%) translateY(0) scale(0.6); }
  /* spring up, then fall with gravity (ease-in accelerates the drop) */
  14%  { opacity: 1; transform: translateX(-50%) translateY(-28px) scale(1.9); animation-timing-function: ease-in; }
  38%  { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.5, 0.6); }  /* impact: hard squash */
  52%  { transform: translateX(-50%) translateY(0) scale(0.8, 1.25); }             /* rebound: big stretch */
  64%  { transform: translateX(-50%) translateY(0) scale(1.08, 0.94); }            /* counter-squash */
  74%  { transform: translateX(-50%) translateY(0) scale(1, 1); }                  /* settle */
  86%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(0) scale(1); }
}

/* always-on thin timeline (shown when reactions exist + controls hidden) */
.vp-mini {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  z-index: 3;
  background: rgba(255, 255, 255, 0.25);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

/* the thin bottom timeline shows whenever the full bar is collapsed,
   whether or not there are reactions */
.vp.hide-controls .vp-mini { opacity: 1; }

.vp-mini-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: var(--violet);
  transition: width 0.25s linear;
}

.vp-mini-marks { position: absolute; inset: 0; }
.vp-mini .vp-mark { bottom: 5px; font-size: 12px; }

@media (max-width: 480px) {
  .headline { font-size: 34px; }
}

.request-form { margin-top: 20px; }
.request-lead { margin: 0 0 12px; }

#req-name,
#req-note {
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: #fff;
}

#req-name:focus,
#req-note:focus {
  outline: 2px solid var(--violet);
  outline-offset: 1px;
  border-color: var(--violet);
}

.gate-msg.error { color: #8a2f2f; }
.gate-msg.ok { color: var(--violet); }

.confirm-btn {
  height: 48px;
  padding: 0 28px;
  border: 0;
  border-radius: 10px;
  background: var(--violet);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.confirm-btn:disabled { opacity: 0.6; cursor: default; }

.admin-shell { max-width: 880px; margin: 0 auto; padding: 32px 24px; }

.dashboard { width: 100%; }

.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); margin-bottom: 24px; flex-wrap: wrap; }
.tab {
  appearance: none; border: 0; background: transparent; font: inherit; font-weight: 600;
  color: var(--muted); padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent;
}
.tab[aria-current="true"] { color: var(--ink); border-bottom-color: var(--violet); }

.badge {
  display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px;
  background: var(--violet); color: #fff; border-radius: 9px; font-size: 12px; text-align: center;
}

.panel { width: 100%; }

.row-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.row-form input { flex: 1 1 180px; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; }
.row-form button, #allow-add, .videos button, .requests button {
  height: 44px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--violet);
  color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
.videos button.secondary, .requests button.secondary { background: transparent; color: var(--violet); border: 1px solid var(--line); }

.videos, .allow-list, .requests { list-style: none; padding: 0; margin: 16px 0 0; }
.videos li, .allow-list li, .requests li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; background: #fff;
}
.video-meta { font-size: 14px; color: var(--muted); }
.video-title { font-weight: 600; color: var(--ink); }

.dropzone {
  margin-top: 10px; padding: 18px; border: 1px dashed var(--violet); border-radius: 12px;
  text-align: center; color: var(--muted); font-size: 14px; background: rgba(112,111,211,0.05);
}
.dropzone.dragover { background: rgba(112,111,211,0.12); }

.progress { height: 8px; border-radius: 6px; background: var(--line); overflow: hidden; margin-top: 10px; }
.progress > span { display: block; height: 100%; width: 0; background: var(--violet); transition: width 0.2s; }

.field-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.select, .textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; margin-bottom: 12px;
}
.select { height: 44px; padding: 0 14px; }
.textarea { min-height: 100px; padding: 12px 14px; resize: vertical; }

/* Feedback panel */
.feedback-panel { margin-top: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #faf9f5; }
.feedback-section { margin-bottom: 12px; }
.feedback-section:last-child { margin-bottom: 0; }
.feedback-reactions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.reaction-chip { display: inline-flex; align-items: center; padding: 4px 10px; border: 1px solid var(--line); border-radius: 20px; background: #fff; font-size: 15px; cursor: default; }
.feedback-messages { list-style: none; padding: 0; margin: 6px 0 0; }
.feedback-messages li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.5; }
.feedback-messages li:last-child { border-bottom: none; }
.feedback-email { font-weight: 600; color: var(--ink); }
.feedback-msg { color: var(--ink); }
