/* Shared video player. Colours come from the theme tokens with safe fallbacks. */
.sp-player {
  --sp-accent: var(--primary, #2563eb);
  --sp-fg: #fff;
  --sp-scrim: rgba(8, 8, 12, .62);
  position: relative;
  display: block;
  width: 100%;
  background: #000;
  border-radius: var(--radius-media, var(--radius, 14px));
  overflow: hidden;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  isolation: isolate;
}
.sp-player:focus-visible { box-shadow: 0 0 0 3px var(--sp-accent); }
.sp-player > video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: inherit;
  object-fit: contain;
  background: #000;
}
.sp-player:fullscreen, .sp-player:-webkit-full-screen { border-radius: 0; width: 100%; height: 100%; }
.sp-player:fullscreen > video { height: 100%; max-height: none; }

.sp-player .sp-big-play {
  position: absolute; top: 50%; left: 50%; z-index: 4;
  width: 68px; height: 68px; margin: -34px 0 0 -34px;
  border-radius: 999px; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .94); color: #111;
  font-size: 22px; padding-left: 4px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  transition: transform .18s ease, opacity .18s ease;
}
.sp-player .sp-big-play:hover { transform: scale(1.06); }
.sp-player.has-started:not(.is-paused) .sp-big-play,
.sp-player.has-started .sp-big-play { opacity: 0; pointer-events: none; transform: scale(.9); }
.sp-player.has-started.is-paused .sp-big-play { opacity: 1; pointer-events: auto; transform: none; }

.sp-player .sp-spinner {
  position: absolute; top: 50%; left: 50%; z-index: 3;
  width: 44px; height: 44px; margin: -22px 0 0 -22px;
  color: rgba(255, 255, 255, .9); font-size: 30px;
  display: none; align-items: center; justify-content: center; pointer-events: none;
}
.sp-player.is-loading .sp-spinner { display: flex; }

.sp-player .sp-skip {
  position: absolute; top: 50%; z-index: 3;
  width: 74px; height: 74px; margin-top: -37px;
  border-radius: 999px; background: rgba(0, 0, 0, .45); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 18px; opacity: 0; pointer-events: none;
}
.sp-player .sp-skip span { font-size: 11px; font-weight: 700; }
.sp-player .sp-skip--left { left: 12%; }
.sp-player .sp-skip--right { right: 12%; }
.sp-player .sp-skip.is-on { animation: spSkip .6s ease-out; }
@keyframes spSkip { 0% { opacity: 0; transform: scale(.8); } 25% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.05); } }

.sp-player .sp-bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 26px 10px 6px;
  background: linear-gradient(to top, var(--sp-scrim), rgba(0, 0, 0, 0));
  color: var(--sp-fg);
  opacity: 0; transform: translateY(6px);
  transition: opacity .2s ease, transform .2s ease;
}
.sp-player.is-awake .sp-bar,
.sp-player.is-paused .sp-bar,
.sp-player:focus-within .sp-bar { opacity: 1; transform: none; }
.sp-player .sp-bar-row { display: flex; align-items: center; gap: 2px; }
.sp-player .sp-spacer { flex: 1; }
.sp-player .sp-time { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; margin-left: 6px; white-space: nowrap; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.sp-player .sp-btn {
  min-width: 40px; height: 40px; padding: 0 8px;
  border: 0; background: transparent; color: inherit; cursor: pointer;
  border-radius: 10px; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center;
}
.sp-player .sp-btn:hover, .sp-player .sp-btn:focus-visible { background: rgba(255, 255, 255, .16); outline: none; }
.sp-btn-speed .sp-speed-label { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.sp-btn-speed.is-active { color: var(--sp-accent); }
.sp-player .sp-btn-speed.is-active { color: #fff; background: var(--sp-accent); }
.sp-player--compact .sp-btn-pip, .sp-player--compact .sp-time { display: none; }
@media (max-width: 420px) { .sp-player .sp-btn-pip { display: none; } }

/* Seek bar: thin at rest, thicker with a thumb while hovering or dragging. */
.sp-seek {
  --sp-h: 4px;
  position: relative;
  height: 22px;
  display: flex; align-items: center;
  cursor: pointer;
  touch-action: none;
  outline: none;
}
.sp-seek-rail { position: relative; width: 100%; height: 100%; display: flex; align-items: center; }
.sp-seek-track {
  position: relative; width: 100%; height: var(--sp-h);
  border-radius: 99px; background: rgba(255, 255, 255, .28);
  overflow: hidden;
  transition: height .15s ease;
}
.sp-seek-buf, .sp-seek-fill { position: absolute; top: 0; left: 0; bottom: 0; width: 0; border-radius: 99px; }
.sp-seek-buf { background: rgba(255, 255, 255, .35); }
.sp-seek-fill { background: var(--sp-accent, var(--primary, #2563eb)); }
.sp-seek-thumb {
  position: absolute; top: 50%; left: 0;
  width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 999px; background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .22), 0 2px 6px rgba(0, 0, 0, .4);
  transform: scale(0); transition: transform .15s ease;
  pointer-events: none;
}
.sp-seek-bubble {
  position: absolute; bottom: 100%; left: 50%;
  transform: translate(-50%, -6px);
  padding: 4px 9px; border-radius: 8px;
  background: rgba(10, 10, 14, .86); color: #fff;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .12s ease;
}
.sp-seek.is-hover, .sp-seek.is-scrubbing, .sp-seek:focus-visible { --sp-h: 7px; }
.sp-seek.is-hover .sp-seek-thumb, .sp-seek.is-scrubbing .sp-seek-thumb, .sp-seek:focus-visible .sp-seek-thumb { transform: scale(1); }
.sp-seek.is-scrubbing .sp-seek-bubble, .sp-seek.is-hover .sp-seek-bubble { opacity: 1; }
.sp-seek.is-scrubbing .sp-seek-bubble { left: 50% !important; font-size: 15px; padding: 6px 12px; }
.sp-seek:focus-visible .sp-seek-track { box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }

/* Feed variant: edge-to-edge strip at the bottom of a clip. */
.sp-seek--feed { height: 26px; padding: 0 12px; }
.sp-seek--feed .sp-seek-track { --sp-h: 3px; height: var(--sp-h); }
.sp-seek--feed.is-hover .sp-seek-track, .sp-seek--feed.is-scrubbing .sp-seek-track { height: 6px; }
.sp-seek--feed .sp-seek-thumb { width: 16px; height: 16px; margin: -8px 0 0 -8px; }
.sp-seek--feed.is-scrubbing .sp-seek-bubble { position: fixed; top: 42%; bottom: auto; left: 50% !important; transform: translate(-50%, -50%); font-size: 22px; padding: 10px 18px; border-radius: 14px; }

/* Speed menu */
.sp-speed-menu {
  position: absolute; right: 10px; bottom: 64px; z-index: 30;
  min-width: 170px; padding: 6px;
  border-radius: 14px;
  background: rgba(18, 18, 24, .96); color: #fff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: spPop .14s ease-out;
}
.sp-speed-menu[hidden] { display: none; }
@keyframes spPop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.sp-speed-title { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .6; padding: 6px 10px 4px; }
.sp-speed-opt {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 9px 10px; border: 0; border-radius: 9px;
  background: transparent; color: inherit; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600; text-align: left;
}
.sp-speed-opt:hover, .sp-speed-opt:focus-visible { background: rgba(255, 255, 255, .1); outline: none; }
.sp-speed-opt.is-on { color: var(--sp-accent, var(--primary, #2563eb)); }
.sp-speed-opt.is-on::after { content: "\2713"; font-weight: 800; }

@media (prefers-reduced-motion: reduce) {
  .sp-player *, .sp-seek *, .sp-speed-menu { transition: none !important; animation: none !important; }
}
