/* The Screening Room — customer video gallery at the top of /admin/home.html.
   Built by admin/screening.js, and only for a signed-in customer (some films
   show the settings screens). The films are on Vercel Blob, not in the repo;
   the posters are in admin/videos/. */

.sr {
  --gold: #fbbf24;
  --gold-soft: #f6d48c;
  --ink: #f8fafc;
  --dim: #94a3b8;
  --line: rgba(148, 163, 184, 0.16);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 64px 22px 72px;
  font-family:
    ui-rounded, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  color: var(--ink);
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(79, 70, 229, 0.32), transparent 70%),
    radial-gradient(40% 40% at 90% 90%, rgba(251, 191, 36, 0.08), transparent 70%),
    #060a16;
  border-bottom: 1px solid #1e293b;
}
/* A slow beam of projector light across the room. */
.sr::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -40% -10% auto;
  height: 120%;
  background: conic-gradient(
    from 180deg at 50% 0%,
    transparent 0 160deg,
    rgba(251, 191, 36, 0.07) 172deg,
    rgba(255, 255, 255, 0.05) 180deg,
    rgba(251, 191, 36, 0.07) 188deg,
    transparent 200deg 360deg
  );
  filter: blur(8px);
  animation: sr-beam 14s ease-in-out infinite alternate;
  pointer-events: none;
}
/* Film grain, so the dark reads as a room rather than a flat colour. */
.sr::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}
@keyframes sr-beam {
  from { transform: rotate(-9deg); }
  to { transform: rotate(9deg); }
}

.sr-wrap {
  max-width: 1080px;
  margin: 0 auto;
}

/* ---------- heading ---------- */
.sr-head {
  text-align: center;
  margin-bottom: 40px;
}
.sr-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}
.sr-eyebrow::before,
.sr-eyebrow::after {
  content: "";
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.sr-eyebrow::after {
  transform: scaleX(-1);
}
.sr-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(30px, 5vw, 50px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  background: linear-gradient(180deg, #fff 30%, #c7d2fe 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sr-title em {
  font-style: italic;
  background: linear-gradient(100deg, var(--gold-soft), var(--gold) 50%, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
}
.sr-sub {
  margin: 14px 0 0;
  color: var(--dim);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

/* ---------- shared poster ---------- */
.sr-poster {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: inherit;
  background: #0f172a;
}
.sr-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition:
    transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1),
    filter 0.6s;
  filter: saturate(0.92) contrast(1.04);
}
/* Bottom shade, so anything laid over the picture stays readable. */
.sr-poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 10, 22, 0) 45%, rgba(6, 10, 22, 0.9) 100%),
    radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(6, 10, 22, 0.55));
  pointer-events: none;
}
.sr-play {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(10px) saturate(1.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  transition:
    transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1),
    background 0.35s,
    border-color 0.35s,
    box-shadow 0.35s;
}
.sr-play svg {
  width: 22px;
  height: 22px;
  margin-left: 3px;
  fill: #fff;
  transition: fill 0.35s;
}
.sr-dur {
  position: absolute;
  z-index: 2;
  right: 12px;
  bottom: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
  color: #fff;
  background: rgba(6, 10, 22, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.sr-seen {
  position: absolute;
  z-index: 2;
  left: 12px;
  top: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #052e1b;
  background: #34d399;
}
/* How far in you got last time. */
.sr-prog {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.14);
}
.sr-prog i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, var(--gold));
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.8);
}

/* ---------- the feature ("start here") ---------- */
.sr-feature {
  position: relative;
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  align-items: stretch;
  width: 100%;
  margin: 0 0 30px;
  padding: 0;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.75), rgba(15, 23, 42, 0.85));
  box-shadow:
    0 40px 80px -30px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  color: inherit;
  font: inherit;
  transition:
    border-color 0.4s,
    box-shadow 0.4s;
}
.sr-feature .sr-poster {
  aspect-ratio: 4 / 3;
  border-radius: 0;
}
.sr-feature .sr-play {
  width: 84px;
  height: 84px;
  margin: -42px 0 0 -42px;
}
.sr-feature .sr-play svg {
  width: 28px;
  height: 28px;
}
/* A gold pulse round the big play button: this is where to start. */
.sr-feature .sr-play::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  animation: sr-pulse 2.6s cubic-bezier(0.2, 0.6, 0.3, 1) infinite;
}
@keyframes sr-pulse {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(1.75); opacity: 0; }
}
.sr-feature-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 34px 36px;
}
.sr-tag {
  align-self: flex-start;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #1c1300;
  background: linear-gradient(100deg, var(--gold-soft), var(--gold));
  box-shadow: 0 6px 20px rgba(251, 191, 36, 0.3);
}
.sr-feature-name {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.1;
}
.sr-feature-blurb {
  display: block;
  color: var(--dim);
  font-size: 15px;
  line-height: 1.55;
}
.sr-cta {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 15px;
  color: #1c1300;
  background: linear-gradient(100deg, var(--gold-soft), var(--gold) 55%, #f59e0b);
  box-shadow:
    0 10px 30px -6px rgba(251, 191, 36, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition:
    transform 0.3s,
    box-shadow 0.3s;
}
.sr-cta svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* ---------- the routines, between the Intro and their films ---------- */
.sr-routines {
  margin: 48px 0 44px;
}
.sr-routines:empty {
  display: none;
}

/* ---------- the grid ---------- */
.sr-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  perspective: 1200px;
}
.sr-card {
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50%;
  --my: 50%;
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.sr-frame {
  position: relative;
  display: block;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.03) 40%, transparent);
  box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.9);
  transition:
    box-shadow 0.45s,
    background 0.45s;
}
.sr-card .sr-poster {
  aspect-ratio: 4 / 3;
  border-radius: 15px;
}
/* Light that follows the pointer across the glass. */
.sr-glare {
  position: absolute;
  z-index: 3;
  inset: 1px;
  border-radius: 15px;
  background: radial-gradient(
    circle at var(--mx) var(--my),
    rgba(255, 255, 255, 0.28),
    transparent 45%
  );
  opacity: 0;
  mix-blend-mode: soft-light;
  transition: opacity 0.4s;
  pointer-events: none;
}
.sr-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 4px 0;
}
.sr-num {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 15px;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.sr-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.005em;
  line-height: 1.25;
}

/* Hover only on a real pointer; a tap on a phone goes straight to the film. */
@media (hover: hover) and (pointer: fine) {
  .sr-card:hover .sr-frame {
    background: linear-gradient(160deg, rgba(251, 191, 36, 0.9), rgba(251, 191, 36, 0.15) 45%, rgba(129, 140, 248, 0.5));
    box-shadow:
      0 34px 70px -26px rgba(0, 0, 0, 0.95),
      0 0 46px -8px rgba(251, 191, 36, 0.35);
  }
  .sr-card:hover .sr-glare {
    opacity: 1;
  }
  .sr-card:hover .sr-poster img,
  .sr-feature:hover .sr-poster img {
    transform: scale(1.08);
    filter: saturate(1.08) contrast(1.06);
  }
  .sr-card:hover .sr-play,
  .sr-feature:hover .sr-play {
    transform: scale(1.12);
    background: var(--gold);
    border-color: var(--gold);
    box-shadow: 0 10px 40px rgba(251, 191, 36, 0.55);
  }
  .sr-card:hover .sr-play svg,
  .sr-feature:hover .sr-play svg {
    fill: #1c1300;
  }
  .sr-feature:hover {
    border-color: rgba(251, 191, 36, 0.45);
    box-shadow:
      0 40px 90px -30px rgba(0, 0, 0, 0.9),
      0 0 60px -20px rgba(251, 191, 36, 0.4);
  }
  .sr-feature:hover .sr-cta {
    transform: translateY(-2px);
    box-shadow:
      0 16px 40px -8px rgba(251, 191, 36, 0.7),
      inset 0 1px 0 rgba(255, 255, 255, 0.6);
  }
}
.sr-card:focus-visible,
.sr-feature:focus-visible {
  outline: none;
}
.sr-card:focus-visible .sr-frame,
.sr-feature:focus-visible {
  box-shadow:
    0 0 0 3px var(--gold),
    0 0 40px -6px rgba(251, 191, 36, 0.6);
}

/* Cards rise into place as the room comes into view. */
.sr-in {
  opacity: 0;
  translate: 0 26px;
  transition:
    opacity 0.8s ease,
    translate 0.9s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--d, 0s), var(--d, 0s), 0s;
}
.sr-in.on {
  opacity: 1;
  translate: 0 0;
}

@media (max-width: 860px) {
  .sr-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
  .sr-feature {
    grid-template-columns: 1fr;
  }
  .sr-feature-copy {
    padding: 22px 22px 26px;
  }
}
@media (max-width: 520px) {
  .sr {
    padding: 44px 16px 52px;
  }
  .sr-head {
    margin-bottom: 28px;
  }
  .sr-grid {
    gap: 14px;
  }
  .sr-play {
    width: 46px;
    height: 46px;
    margin: -23px 0 0 -23px;
  }
  .sr-play svg {
    width: 16px;
    height: 16px;
  }
  .sr-dur {
    right: 8px;
    bottom: 8px;
    font-size: 11px;
    padding: 3px 7px;
  }
  .sr-seen {
    left: 8px;
    top: 8px;
    font-size: 9.5px;
  }
  .sr-meta {
    padding-top: 10px;
    gap: 7px;
  }
  .sr-name {
    font-size: 14.5px;
  }
  .sr-num {
    font-size: 13px;
  }
  .sr-feature-blurb {
    font-size: 14px;
  }
}

/* ---------- the player ---------- */
.sr-lb {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: flex;
  flex-direction: column;
  color: #f8fafc;
  font-family:
    ui-rounded, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  background: rgba(3, 5, 12, 0.94);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.4s ease,
    visibility 0s 0.4s;
}
.sr-lb.open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease;
}
/* The poster, blown up and blurred, fills the room behind the screen. */
.sr-lb-bg {
  position: absolute;
  z-index: -1;
  inset: -60px;
  background-size: cover;
  background-position: center;
  filter: blur(60px) saturate(1.5) brightness(0.45);
  transform: scale(1.1);
}
.sr-lb-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 70% at 50% 45%, transparent, rgba(3, 5, 12, 0.85));
}
.sr-lb-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: max(14px, env(safe-area-inset-top)) 20px 12px;
}
.sr-lb-title {
  min-width: 0;
  flex: 1;
}
.sr-lb-title small {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #fbbf24;
  font-variant-numeric: tabular-nums;
}
.sr-lb-title b {
  display: block;
  margin-top: 3px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(18px, 2.6vw, 26px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sr-ico {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition:
    background 0.25s,
    border-color 0.25s;
}
.sr-ico svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sr-ico:hover {
  background: rgba(251, 191, 36, 0.2);
  border-color: rgba(251, 191, 36, 0.6);
}
.sr-ico:focus-visible {
  outline: 2px solid #fbbf24;
  outline-offset: 2px;
}
.sr-ico[disabled] {
  opacity: 0.3;
  cursor: default;
}
.sr-lb-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 16px;
}
.sr-screen {
  position: relative;
  width: min(100%, calc((100vh - 230px) * 16 / 9), 1280px);
  width: min(100%, calc((100dvh - 230px) * 16 / 9), 1280px);
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  box-shadow:
    0 50px 120px -30px rgba(0, 0, 0, 0.95),
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 120px -40px rgba(251, 191, 36, 0.35);
  transform: scale(0.96);
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.sr-lb.open .sr-screen {
  transform: scale(1);
}
.sr-screen video {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
}
/* "Up next", once a film ends. */
.sr-next {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(3, 5, 12, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.sr-next[hidden] {
  display: none;
}
.sr-next-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px;
  max-width: 92%;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 23, 42, 0.8);
}
.sr-next-card img {
  width: 150px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
}
.sr-next-card small {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fbbf24;
}
.sr-next-card b {
  display: block;
  margin: 4px 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: 22px;
}
.sr-next-go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  font-size: 14px;
  color: #1c1300;
  background: linear-gradient(100deg, #f6d48c, #fbbf24 55%, #f59e0b);
  cursor: pointer;
}
.sr-next-go svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}
.sr-next-again {
  margin-left: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: #e2e8f0;
  background: transparent;
  cursor: pointer;
}

/* The film strip under the screen. */
.sr-rail {
  display: flex;
  gap: 12px;
  padding: 18px 20px max(18px, env(safe-area-inset-bottom));
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  justify-content: safe center;
}
.sr-rail::-webkit-scrollbar {
  display: none;
}
.sr-chip {
  flex: none;
  position: relative;
  width: 132px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #0f172a;
  cursor: pointer;
  scroll-snap-align: center;
  opacity: 0.55;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition:
    opacity 0.3s,
    outline-color 0.3s;
}
.sr-chip img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.sr-chip span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 8px 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.85));
}
.sr-chip:hover,
.sr-chip:focus-visible {
  opacity: 0.9;
}
.sr-chip:focus-visible {
  outline-color: rgba(251, 191, 36, 0.6);
}
.sr-chip.on {
  opacity: 1;
  outline-color: #fbbf24;
}
.sr-chip .sr-prog {
  height: 2px;
}

html.sr-locked,
html.sr-locked body {
  overflow: hidden;
}

@media (max-width: 720px) {
  .sr-lb-stage {
    padding: 0;
  }
  .sr-lb-stage > .sr-ico {
    display: none;
  }
  .sr-screen {
    width: 100%;
    border-radius: 0;
  }
  /* The films are a square picture in a 16:9 frame. On a portrait phone, a 4:3
     window trims only black bar from the square shots (a third bigger
     picture) and a sliver off the full-width app screens; fullscreen shows
     the whole frame. */
  @media (orientation: portrait) {
    .sr-screen {
      aspect-ratio: 4 / 3;
    }
    .sr-screen video {
      object-fit: cover;
    }
  }
  .sr-chip {
    width: 104px;
  }
  .sr-next-card {
    flex-direction: column;
    text-align: center;
    padding: 12px;
    gap: 10px;
  }
  .sr-next-card img {
    display: none;
  }
  .sr-next-card b {
    font-size: 18px;
    margin-bottom: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sr::before,
  .sr-feature .sr-play::before {
    animation: none;
  }
  .sr-card,
  .sr-poster img,
  .sr-screen,
  .sr-in {
    transition: none !important;
  }
  .sr-in {
    opacity: 1;
    translate: none;
  }
  .sr-card {
    transform: none !important;
  }
}
