/* "Watch here" — the in-browser player. A dark scrim over the whole room with
   firelight controls. The video is the fire; everything else recedes into the
   near-black so the picture leads. */
.hp {
  /* above the shared chrome bar (z 9999) + its login popover (10001) so the
     full-screen player is never bisected by the top bar */
  position: fixed; inset: 0; z-index: 10050;
  display: flex; flex-direction: column;
  background: radial-gradient(120% 100% at 50% 0%, #241a13 0%, #120d0a 60%, #0c0806 100%);
  color: var(--ink);
  opacity: 0;
  transition: opacity .24s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.hp[hidden] { display: none; }
.hp.is-on { opacity: 1; }
.hp * { -webkit-user-select: none; user-select: none; }

/* keep the page behind from scrolling while the player is up */
:root.hp-open, :root.hp-open body { overflow: hidden; }

/* ---- header: back + title ---- */
.hp__head {
  display: flex; align-items: center; gap: .9rem; flex: 0 0 auto;
  padding: calc(.7rem + env(safe-area-inset-top, 0px)) clamp(12px, 3.5vw, 26px) .7rem;
  z-index: 3;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.hp__heading { min-width: 0; }
.hp__eyebrow.hp__eyebrow { margin: 0 0 .12rem; }
.hp__title {
  font-family: var(--f-display); font-size: var(--step-1); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em;
}
.hp__close {
  flex: 0 0 auto; width: auto; height: 44px; padding: 0 1rem 0 .7rem;
  border-radius: 999px; gap: .2rem; font-size: var(--step-0); font-weight: 600;
  background: rgba(52,39,30,.55); color: var(--ink); border: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.hp__close:hover { background: var(--bg-hi); }

/* ---- stage: the video ---- */
.hp__stage {
  position: relative; flex: 1 1 auto; min-height: 0;
  display: grid; place-items: center; overflow: hidden;
}
.hp__video {
  width: 100%; height: 100%; object-fit: contain; background: #000;
  display: block;
}
/* invisible full-stage tap target for play/pause on touch */
.hp__tap {
  position: absolute; inset: 0; border: 0; background: transparent; cursor: pointer;
  z-index: 1;
}
.hp__tap:focus-visible { outline: 2px solid var(--ember); outline-offset: -6px; }

/* ---- loading spinner ---- */
.hp__spinner {
  position: absolute; inset: 0; display: none; place-items: center; z-index: 2;
  pointer-events: none;
}
.hp.is-loading .hp__spinner { display: grid; }
.hp__ring {
  width: 54px; height: 54px; border-radius: 50%;
  border: 3px solid rgba(240,161,90,.22);
  border-top-color: var(--ember);
  box-shadow: 0 0 24px var(--glow);
  animation: hp-spin 0.9s linear infinite;
}
@keyframes hp-spin { to { transform: rotate(360deg); } }

/* ---- error card ---- */
.hp__error {
  position: absolute; inset: 0; z-index: 4;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem;
  text-align: center; padding: 2rem 1.4rem;
  background: rgba(12,8,6,.86); backdrop-filter: blur(6px);
}
.hp__error[hidden] { display: none; }
.hp__error-mark {
  font-size: 2.4rem; filter: drop-shadow(0 0 16px var(--glow-hot)); margin-bottom: .3rem;
}
.hp__error-title { font-family: var(--f-display); font-size: var(--step-2); }
.hp__error-msg { color: var(--ink-dim); max-width: 34ch; margin: 0; font-size: var(--step-0); }
.hp__error-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 1rem; }
.hp__btn {
  min-height: 44px; padding: 0 1.2rem; border-radius: 999px; cursor: pointer;
  font-weight: 600; font-size: var(--step-0); border: 1px solid var(--line); background: transparent; color: var(--ink);
  transition: background .15s, border-color .15s, transform .1s;
}
.hp__btn:active { transform: translateY(1px); }
.hp__btn--primary { background: var(--ember); color: #241005; border-color: transparent; box-shadow: 0 6px 20px -6px var(--glow-hot); }
.hp__btn--primary:hover { background: var(--ember-soft); }
.hp__btn--ghost:hover { background: var(--bg-hi); border-color: var(--line); }

/* ---- control bar ---- */
.hp__bar {
  flex: 0 0 auto; z-index: 3;
  padding: .7rem clamp(12px, 3.5vw, 26px) calc(1rem + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(0deg, rgba(12,8,6,.94), rgba(18,13,10,.4) 70%, transparent);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.hp__scrub { display: flex; align-items: center; gap: .7rem; }
.hp__time {
  font-size: var(--step--1); color: var(--ink-dim); font-variant-numeric: tabular-nums;
  min-width: 44px; flex: 0 0 auto;
}
.hp__time--dur { text-align: right; }

/* seek + volume ranges share a firelit look; --fill paints the played portion */
.hp__seek, .hp__vol {
  -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer;
  flex: 1 1 auto; height: 26px; margin: 0;
}
.hp__seek { --fill: 0%; }
.hp__vol  { --fill: 100%; }
.hp__seek::-webkit-slider-runnable-track, .hp__vol::-webkit-slider-runnable-track {
  height: 5px; border-radius: 5px;
  background: linear-gradient(90deg, var(--ember) 0 var(--fill), var(--line) var(--fill) 100%);
}
.hp__seek::-moz-range-track, .hp__vol::-moz-range-track { height: 5px; border-radius: 5px; background: var(--line); }
.hp__seek::-moz-range-progress, .hp__vol::-moz-range-progress { height: 5px; border-radius: 5px; background: var(--ember); }
.hp__seek::-webkit-slider-thumb, .hp__vol::-webkit-slider-thumb {
  -webkit-appearance: none; margin-top: -7px;
  width: 18px; height: 18px; border-radius: 50%; background: var(--ember);
  box-shadow: 0 0 0 4px rgba(240,161,90,.22), 0 2px 6px rgba(0,0,0,.5); cursor: pointer;
}
.hp__seek::-moz-range-thumb, .hp__vol::-moz-range-thumb {
  width: 18px; height: 18px; border: 0; border-radius: 50%; background: var(--ember);
  box-shadow: 0 0 0 4px rgba(240,161,90,.22);
}

.hp__ctrls {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-top: .55rem;
}
.hp__group { display: flex; align-items: center; gap: .35rem; }
.hp__group--right { gap: .2rem; }
.hp__volwrap { width: 92px; display: flex; align-items: center; }
.hp__vol { height: 24px; }

/* icon buttons — large touch targets */
.hp__ic {
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: transparent; color: var(--ink-dim); font-size: 1.15rem;
  display: inline-grid; place-items: center; line-height: 1;
  transition: background .15s, color .15s, transform .1s;
}
.hp__ic:hover { background: var(--bg-hi); color: var(--ink); }
.hp__ic:active { transform: scale(.94); }
.hp__play.ic--play, .hp__play {
  width: 60px; height: 60px; font-size: 1.2rem;
  background: var(--ember); color: #241005; font-weight: 700;
  box-shadow: 0 6px 22px -6px var(--glow-hot);
}
.hp__play:hover { background: var(--ember-soft); color: #241005; }

/* ---- auto-hide: fade chrome, hide the cursor ---- */
.hp.is-idle .hp__head,
.hp.is-idle .hp__bar {
  opacity: 0; pointer-events: none;
}
.hp.is-idle .hp__head { transform: translateY(-8px); }
.hp.is-idle .hp__bar  { transform: translateY(8px); }
.hp.is-idle { cursor: none; }

/* ---- mobile tightening ---- */
@media (max-width: 560px) {
  .hp__volwrap { display: none; }        /* mute button is enough on phones */
  .hp__title { font-size: var(--step-0); }
  .hp__ic { width: 46px; height: 46px; }
  .hp__play { width: 56px; height: 56px; }
}

/* ---- reduced motion: no fades, no spin drama, but still functional ---- */
@media (prefers-reduced-motion: reduce) {
  .hp, .hp__head, .hp__bar { transition: none; }
  .hp__ring { animation-duration: 1.6s; }
  .hp.is-idle .hp__head, .hp.is-idle .hp__bar { transform: none; }
}
