/*
 * THEME.CSS
 * =========
 * This file is the override layer for animation durations, easing, 
 * and theme-specific visual styling.
 *
 * Rules:
 * - Global defaults for background-slide and background-animation
 *   durations/easing are defined here.
 * - GSAP controls keyframes and motion (legacy Animate.css is neutralized).
 * - Layout.css manages structural placement and composition.
 *
 * If a project wants to customize timing or easing, this is the only
 * file that should be modified.
 */
 
:root {
  --anim-speed: 1.5s;
  --anim-speed-fast: 600ms;
  --anim-speed-medium: 1500ms;
  --anim-speed-slow: 2500ms;
  --audio-gate-z: 1200;
  --audio-gate-bg: rgba(0, 0, 0, 0.40);
  --audio-gate-fg: #fff;
  --audio-gate-radius: 12px;
  --audio-gate-shadow: 0 10px 30px rgba(0,0,0,0.35);
  --audio-gate-width: min(92vw, 28rem);
  --audio-gate-padding: 1rem 1.25rem;
  --background-slide-duration: 10000ms;
  --background-slide-ease: ease-in-out;
  --background-animation-duration: 12000ms;
  --background-animation-ease: ease-in-out;
  --kb-zoom: 1.12;
  --kb-origin: 50% 50%;
  --kb-from-x: 0;
  --kb-from-y: 0;
  --kb-to-x: 0;
  --kb-to-y: 0;
  

  /* HUD / captions / tap-to-play fade variables */
  --hud-fade-duration: 750ms;
  --hud-fade-ease: cubic-bezier(.22,.61,.36,1);
  --cc-fade-duration: 500ms;
  --cc-fade-ease: cubic-bezier(.22,.61,.36,1);
  --hud-header-height: 56px;

    /* Reel End UX theming */
  --sc-reel-accent: #ffd200;                /* countdown number color */
  --sc-reel-bg: rgba(0, 0, 0, 0.55);        /* Next button background */
  --sc-reel-overlay-grad: linear-gradient(to right, transparent 60%, rgba(0,0,0,.35)); /* overlay tint */
}

/* Section-level animation speed overrides */
section[anim-speed="fast"]   { --anim-speed: var(--anim-speed-fast); }
section[anim-speed="medium"] { --anim-speed: var(--anim-speed-medium); }
section[anim-speed="slow"]   { --anim-speed: var(--anim-speed-slow); }

/* Typography */
html, body {
  margin: 0;
  padding: 0;
  font-family: system-ui, sans-serif;
}

.display-3 {
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1.1;
}
@media (min-width: 768px) {
  .display-3 { font-size: 5rem; }
}
.display-5 {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.25;
}
@media (min-width: 768px) {
  .display-5 { font-size: 3rem; }
}
.lead {
  font-size: 1.125rem;
  line-height: 1.75rem;
}
@media (min-width: 768px) {
  .lead { font-size: 1.25rem; }
}
strong { font-weight: bold; }
em { font-style: italic; }

/* Overlay Styles */
.bg-dark.opacity-50 {
  background: rgba(0, 0, 0, 0.5);
}
.overlay-soft-white {
  background: rgba(255, 255, 255, 0.3);
}
.overlay-soft-black {
  background: rgba(0, 0, 0, 0.3);
}
.overlay-gradient-black-diagonal {
  background: linear-gradient(135deg, rgba(0,0,0,0.7), transparent);
}
.overlay-gradient-white-up {
  background: linear-gradient(to top, rgba(255, 255, 255, 0.9), transparent);
}
.overlay-gradient-white-down {
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.9), transparent);
}
.overlay-gradient-black-up {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
}
.overlay-gradient-black-down {
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent);
}



/* Scroll Arrow */
.scroll-arrow {
  font-size: 2.5rem;
  color: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.95;
  transition: opacity 0.45s ease, transform 0.45s ease, box-shadow 0.45s ease;
  position: relative;
  border-radius: 999px;
  background: rgba(12, 15, 25, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 12px 30px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.scroll-arrow::before {
  content: "";
  position: absolute;
  inset: 6%;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.18);
  opacity: 0.5;
  pointer-events: none;
}
.scroll-arrow::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  animation: arrowPulse 2.8s ease-in-out infinite;
}
.scroll-arrow span {
  transition: opacity 0.35s ease;
  display: block;
}
.scroll-arrow.hidden { opacity: 0; }
.scroll-arrow:hover,
.scroll-arrow:focus-visible {
  opacity: 1;
  transform: translateY(-2px);
}
@media (max-width: 768px) {
  .scroll-arrow { font-size: 3rem; }
}
@media (min-width: 1025px) {
  .scroll-arrow { font-size: 3.5rem; }
}

@keyframes arrowPulse {
  0% {
    opacity: 0.35;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.35);
  }
  60% {
    opacity: 0;
    box-shadow: 0 0 0 26px rgba(255, 255, 255, 0);
  }
  100% {
    opacity: 0;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

/* Horizontal Rules */
hr {
  border: 0;
  border-top: 4px solid #145c2a;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  width: 100%;
  max-width: 340px;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--anim-speed) ease, opacity var(--anim-speed) ease;
}
hr.visible { transform: scaleX(1); opacity: 1; }
hr.line-match-title { max-width: 340px; }
hr.line-full        { max-width: 100%; }
hr.thick            { border-top-width: 8px; }
hr.dashed           { border-top-style: dashed; }
hr.dotted           { border-top-style: dotted; }
hr.color-a          { border-color: #217346; }
hr.color-b          { border-color: #145c2a; }
hr.color-c          { border-color: #4caf50; }
hr.color-d          { border-color: #cde8d4; }

/* In-section Divider Look (theme) */
.sc-divider {
  border: none;
  height: 2px;
  background: currentColor;   /* inherits section text color */
  margin: 0.75rem 0;
  transform-origin: 50% 50%;
  backface-visibility: hidden;
  transform: translateZ(0);   /* reduce subpixel wobble */
}

/* Defaults (JS may override width for short variant) */
.sc-divider-short { width: 40%; }
.sc-divider-long  { width: clamp(320px, 80%, 1100px); margin-left: auto; margin-right: auto; }

/* Optional brand variants */
.sc-divider-strong { height: 4px; }

/* Captions */
.caption {
  color: white;
  font-size: 0.85rem;
  margin-top: 0.25rem;
  opacity: 0;
  transition: opacity var(--anim-speed) ease;
}
.caption.visible {
  opacity: 1;
}



/* Overlay Box */
.overlay-box {
  background: rgba(0, 0, 0, 0.5);
  padding: 1.5rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(4px);
  color: white;
  transform: translateY(10px);
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.overlay-box.visible { opacity: 1; transform: translateY(0); transition-delay: 1.2s; }

/* HUD Controls — Unified Styling */
.hud-btn {
  width: var(--hud-btn, 44px);
  height: var(--hud-btn, 44px);
  min-width: var(--hud-btn, 44px);
  min-height: var(--hud-btn, 44px);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(12, 15, 25, 0.35);
  color: rgba(255, 255, 255, 0.95);
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition:
    opacity var(--hud-fade-duration) var(--hud-fade-ease),
    transform .2s cubic-bezier(.22,.61,.36,1),
    box-shadow .2s cubic-bezier(.22,.61,.36,1),
    background-color .2s cubic-bezier(.22,.61,.36,1);
  font-size: 1.25rem;
  box-sizing: border-box;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 8px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.hud-btn::before {
  content: "";
  position: absolute;
  inset: 6%;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.12);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}
.hud-btn::after {
  content: "";
  position: absolute;
  inset: 6%;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  pointer-events: none;
  z-index: 0;
}
.hud-btn:hover,
.hud-btn:focus-visible {
  transform: translateY(-1px) scale(1.02);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 10px 26px rgba(0, 0, 0, 0.45);
}

/* Inline text panels (line-level overlays) */
.sc-text-panel,
.sc-anim[data-text-panel] {
  display: inline-flex;
  align-items: center;
  padding: 0.2em 0.55em;
  margin: 0.1em 0;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: rgba(10, 12, 18, 0.45);
  color: inherit;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 8px 20px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.sc-anim[data-text-panel="light"],
.sc-text-panel[data-text-panel="light"] {
  background: rgba(255, 255, 255, 0.65);
  color: rgba(10, 12, 18, 0.95);
  border-color: rgba(255, 255, 255, 0.85);
}
.sc-anim[data-text-panel="dark"],
.sc-text-panel[data-text-panel="dark"] {
  background: rgba(5, 6, 10, 0.65);
  color: rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 255, 255, 0.45);
}
.sc-anim[data-text-panel="blur"],
.sc-text-panel[data-text-panel="blur"] {
  background: rgba(12, 15, 25, 0.4);
}

.sc-anim[data-text-style~="shadow"],
.sc-text-panel[data-text-style~="shadow"] {
  text-shadow:
    0 2px 6px rgba(0, 0, 0, 0.65),
    0 0 10px rgba(0, 0, 0, 0.35);
}

.sc-anim[data-text-style~="shadow-light"],
.sc-text-panel[data-text-style~="shadow-light"] {
  text-shadow:
    0 2px 6px rgba(255, 255, 255, 0.8),
    0 0 10px rgba(255, 255, 255, 0.55);
}

.sc-anim[data-text-style~="stroke"],
.sc-text-panel[data-text-style~="stroke"] {
  -webkit-text-stroke: 1px rgba(8, 10, 20, 0.75);
  text-shadow: none;
}

.sc-anim[data-text-style~="stroke-light"],
.sc-text-panel[data-text-style~="stroke-light"] {
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.85);
  text-shadow: none;
}

/* Like button hover/active (uses generic .hud-btn circle) */
.like-button:hover {
  transform: scale(1.1);
}
.like-button.active {
  color: #ff4d4d; /* icon image may not inherit color, kept for future inline-SVG */
}
.like-count {
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  line-height: 1;
  color: #fff;
}
/* Ensure button stack aligns icon + counter neatly */
.button-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.25rem; /* tighter spacing between circle and counter */
}

.button-stack .like-count {
  margin: 0; /* reset margins for centering */
  font-size: 0.8rem;
  line-height: 1;
  text-align: center;
  color: #fff;
}
.hud-btn > svg,
.hud-btn > img {
  width: 60%;
  height: 60%;
  display: block;
  object-fit: contain;
  fill: #fff;
  pointer-events: none;
  position: relative;
  z-index: 1;
}
.cc-button > svg,
.cc-button > img,
.mute-button > svg,
.mute-button > img {
  width: 60%;
  height: 60%;
  display: block;
  object-fit: contain;
  fill: #fff;
}


/* HUD Controls — fade behavior */
.hud-reel-controls:not(.hud-active) .button-stack:not(.always-visible) {
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--hud-fade-duration) var(--hud-fade-ease);
}

.hud-reel-controls .button-stack {
  opacity: 1;
  transition: opacity var(--hud-fade-duration) var(--hud-fade-ease);
}

/* Ensure HUD buttons are clickable when visible */
.hud-reel-controls .hud-btn { pointer-events: auto; }

/* HUD timeout (controls auto-hide delay) */
.hud-reel-controls {
  --hud-timeout-ms: 4000; /* 4s */
}
/* Reel Audio Gate Overlay (replaces Tap-to-Play) */
.reel-audio-gate {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--audio-gate-bg);
  z-index: var(--audio-gate-z);
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none; /* enabled when .show is applied */
}
.reel-audio-gate.show {
  opacity: 1;
  pointer-events: auto;
}
.reel-audio-gate-inner {
  background: rgba(0,0,0,0.4);
  color: var(--audio-gate-fg);
  padding: var(--audio-gate-padding);
  border-radius: var(--audio-gate-radius);
  box-shadow: var(--audio-gate-shadow);
  text-align: center;
  opacity: 1;
  display: inline-block;
}

.reel-audio-gate-inner p {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--audio-gate-fg);
  font-weight: 500;
  opacity: 1 !important;
  visibility: visible !important;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}

.reel-audio-gate .btns {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}
.reel-audio-gate .btns button {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color .2s ease, transform .2s ease;
}

/* Distinguish Yes/No buttons by position — keep markup unchanged */
.reel-audio-gate .btns button:first-child {
  background: rgba(76, 175, 80, 0.9); /* green */
  border: 1px solid rgba(76, 175, 80, 1);
}
.reel-audio-gate .btns button:first-child:hover {
  background: rgba(76, 175, 80, 1);
}

.reel-audio-gate .btns button:last-child {
  background: rgba(244, 67, 54, 0.9); /* red */
  border: 1px solid rgba(244, 67, 54, 1);
}
.reel-audio-gate .btns button:last-child:hover {
  background: rgba(244, 67, 54, 1);
}
.reel-audio-gate .btns button:hover {
  background: rgba(255,255,255,0.25);
  transform: scale(1.05);
}
.reel-audio-gate .btns button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}


/* Pause/Play button icon handling */

/* Centered overlay variant (works even if appended inside HUD stack) */
.hud-reel-controls .pause-button.centered,
.reel-frame .pause-button.centered,
.sc-stage .pause-button.centered {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1001; /* above video, with HUD */
}

.pause-button.centered > svg,
.pause-button.centered .icon {
  width: 78% !important;
  height: 78% !important;
}

/* Centered pause/play follows HUD timeout on the same controls container */
.hud-reel-controls .pause-button.centered {
  transition: opacity var(--hud-fade-duration) var(--hud-fade-ease);
}
.hud-reel-controls:not(.hud-active) .pause-button.centered {
  opacity: 0;
  pointer-events: none;
}
.hud-reel-controls.hud-active .pause-button.centered {
  opacity: 1;
  pointer-events: auto;
}

/* Default: video is playing → show pause bars */
.pause-button .icon-play  { display: none; }
.pause-button .icon-pause { display: block; }

/* When video is paused, show the play triangle */
.pause-button.is-paused .icon-play  { display: block; }
.pause-button.is-paused .icon-pause { display: none; }

/* Ensure the injected SVG with class="icon" transitions smoothly */
.pause-button .icon {
  transition: transform 150ms ease, opacity 150ms ease;
}

/* Subtle CC toggle pop */
@keyframes cc-pop {
  0%   { transform: scale(0.9); opacity: 0.9; }
  50%  { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1);   opacity: 1; }
}
.cc-button.pop {
  animation: cc-pop 180ms ease-out;
}

.cc-button:disabled {
  opacity: 0.4;
  pointer-events: none;
  background-color: rgba(255, 255, 255, 0.1);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reel-audio-gate,
  .video-reel-controls,
  .sc-captions-layer,
  .pause-overlay {
    transition: none !important;
  }
}

/* Keep Scrolling Teaser */
.keep-scrolling-teaser {
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  max-width: 80%;
  margin: 0 auto;
  text-align: center;
  /* Restored theme-level styles for keep-scrolling positioning */
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
  z-index: 880;
  pointer-events: none;
}
@media (orientation: landscape) {
  .keep-scrolling-teaser { display: none !important; }
}

/* Code Blocks */
code, pre {
  font-family: monospace;
  background: rgba(0,0,0,0.05);
  padding: 0.2em 0.4em;
  border-radius: 4px;
}

/* Section Image */
.section-image { opacity: 0; transition: opacity var(--anim-speed) ease, transform var(--anim-speed) ease; }

/* ====================================================================== */
/* Theme-level styles restored from layout.css (to live here)             */
/* ====================================================================== */


/* Typography spacing */
h1, h2, p {
  margin-bottom: 1.25rem;
  line-height: 1.3;
}
@media (min-width: 768px) {
  .container .content { padding: 2rem; }
}
[data-video="v"] .container {
  user-select: none;
  -webkit-user-drag: none;
}

/* Video element sizing */
section.video-reel .video-reel-video {
  display: block;
  object-fit: cover;
  object-position: center;
}
/* Scrollbar Styling */
/* WebKit browsers (Chrome, Edge, Safari) */
::-webkit-scrollbar {
  width: 8px;              /* slim vertical scrollbar */
}

::-webkit-scrollbar-track {
  background: #f0f0f0;     /* light grey track */
}

::-webkit-scrollbar-thumb {
  background-color: #999;  /* grey thumb */
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #777;  /* darker on hover */
}

/* Firefox */

/* Ensure stable scrollbar gutter to prevent layout shift */
html { scrollbar-gutter: stable both-edges; }

/* Scope Firefox scrollbar styling to vertical contexts only */
html, body, #scroll-wrapper {
  scrollbar-width: thin;
  scrollbar-color: #999 #f0f0f0;
}

/* Progress bar — enforce grey and hide by default (no green trail) */
#storycore-progress-bar {
  position: fixed;
  top: 0; right: 0;
  width: 5px;                 /* final thickness */
  height: 56px;               /* default handle height; JS may override */
  background: #9e9e9e;        /* solid grey */
  background-image: none !important;
  border-radius: 3px;         /* slightly more rounded */
  transform: translateY(0);   /* move without scaling */
  opacity: 0;                 /* hidden by default */
  visibility: hidden;
  transition: transform .16s ease-out, opacity .18s linear, visibility 0s linear .18s;
  will-change: transform;
  z-index: 1000;
  pointer-events: none;
}
#storycore-progress-bar.visible {
  opacity: 1;
  visibility: visible;
  transition: transform .16s ease-out, opacity .18s linear;
}

/* Legacy background animation classes are intentionally neutralized below; GSAP owns motion now. */
/* === GSAP takeover: neutralize legacy motion & set initial states === */

/* 1) Initial hidden pose for revealable blocks (GSAP will animate these) */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  will-change: transform, opacity;
}

/* 2) Turn off legacy keyframes/transitions on text-effect classes */
[data-anim],
.slide-up, .slide-down, .slide-left, .slide-right,
.fade-in, .fade-scale, .fade-blur,
.float-up, .float-down, .float-up-cinematic, .cinematic {
  animation: none !important;
  transition: none !important;
}

/* 3) Background classes: don’t auto-animate via CSS anymore (GSAP owns it) */
.bg-anim-sprite,
.slide-bg, .bg-slide-x, .bg-slide-y,
.bg-kenburns-in, .bg-kenburns-out,
.sc-kb-zoom-in, .sc-kb-zoom-out,
.sc-kb-pan-up, .sc-kb-pan-down {
  animation: none !important;
  transition: none !important;
}

/* ——— Subtle visual polish ——— */

/* 1) HUD fade is defined in :root above (kept here for reference) */

/* 2) Pause overlay button: crisper, but still subtle */
.pause-overlay .pause-button {
  box-shadow: 0 10px 28px rgba(0,0,0,.35), 0 2px 6px rgba(0,0,0,.2);
  backdrop-filter: blur(2px);
}

/* 7) Keep-scrolling teaser: small lift on dark bg */
.keep-scrolling-teaser {
  box-shadow: 0 8px 20px rgba(0,0,0,.35);
  backdrop-filter: blur(2px);
}
 
/* Unified Premium Captions (Netflix/Disney+ style) */
.sc-caption {
  font-family: "Inter", "Helvetica Neue", system-ui, sans-serif;
  font-size: clamp(16px, 2.4vw, 26px);
  font-weight: 600;
  line-height: 1.45;
  color: #fff;
  text-align: center;
  letter-spacing: 0.35px;
  background: rgba(0, 0, 0, 0.68);
  border-radius: 10px;
  padding: 10px 14px;
  max-width: min(92vw, 1000px);
  margin: 0 auto;
  backdrop-filter: blur(4px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--cc-fade-duration, 280ms) var(--cc-fade-ease, cubic-bezier(.22,.61,.36,1)),
              transform var(--cc-fade-duration, 280ms) var(--cc-fade-ease, cubic-bezier(.22,.61,.36,1));
  transition-delay: 0ms;
}
.sc-caption:not(.visible) {
  transition-delay: 0ms;
}
.sc-caption.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: 120ms;
  animation: caption-pop 280ms cubic-bezier(.34,1.56,.64,1);
}
@keyframes caption-pop {
  0%   { transform: translateY(6px) scale(0.95); opacity: 0; }
  40%  { transform: translateY(0) scale(1.05);  opacity: 1; }
  70%  { transform: translateY(0) scale(0.98);  }
  100% { transform: translateY(0) scale(1);    }
}
.sc-caption .highlight {
  color: #4caf50;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(76, 175, 80, 0.8),
               0 0 14px rgba(76, 175, 80, 0.5);
}
@media (max-width: 600px) {
  .sc-caption {
    font-size: 15px;
    padding: 6px 10px;
    border-radius: 6px;
  }
}
.sc-captions-layer .sc-caption:empty {
  display: none !important;
}
.sc-captions-layer {
  position: absolute;
  left: 50%;
  bottom: var(--cc-bottom-offset, 12vh);
  transform: translateX(-50%);
  max-width: min(90vw, 1000px);
  transition: opacity var(--cc-fade-duration) var(--cc-fade-ease);
  pointer-events: none;
  z-index: var(--captions-z, 980);
}
/* Fallback SRT cue container (same placement/behavior as premium layer) */
.srt-caption {
  position: absolute;
  left: 50%;
  bottom: calc(var(--cc-bottom-offset, 12vh) + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  max-width: min(90vw, 1000px);
  z-index: var(--captions-z, 980);
  pointer-events: none;
  text-align: center;
  transition: opacity var(--cc-fade-duration) var(--cc-fade-ease);
}
/* CC visibility applies to both premium and SRT captions */
section[data-cc-hidden="1"] .sc-captions-layer,
section[data-cc-hidden="1"] .srt-caption {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
section[data-cc-hidden="0"] .sc-captions-layer,
section[data-cc-hidden="0"] .srt-caption {
  opacity: 1 !important;
  visibility: visible !important;
}
@media (max-width: 640px) {
  :root {
    --cc-bottom-offset: 16vh;
  }
}

/* ==========================================================
   Reel End UX — theme overrides (win via higher specificity)
   ========================================================== */
.sc-reel-end-overlay.sc-anim-pop {
  background: var(--sc-reel-overlay-grad);
}
.sc-reel-end-overlay .sc-reel-end-next {
  background: var(--sc-reel-bg);
}
.sc-reel-end-overlay .sc-reel-end-count {
  color: var(--sc-reel-accent);
}
.sc-reel-end-overlay .sc-reel-end-next:focus-visible {
  outline: 2px solid var(--sc-reel-accent);
  outline-offset: 2px;
}

/* Force CC button to hide with HUD (mobile Safari/Chrome) */
.hud-reel-controls:not(.hud-active) .cc-button,
.hud-reel-controls:not(.hud-active) .cc-button img,
.hud-reel-controls:not(.hud-active) .cc-button svg {
  opacity: 0;
  pointer-events: none;
}
