/* Adapted from FormaFX web/formafx_player for CaptureFX MP4 sharing. */
.ffx-player {
  --ffx-font: "Century Gothic", "Segoe UI", Arial, sans-serif;
  --ffx-accent: #08c8f4;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #000;
  color: #fff;
  border-radius: inherit;
}

.ffx-video {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: contain;
}

.ffx-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
  color: #fff;
  background: rgba(10, 10, 18, .76);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.ffx-btn:hover,
.ffx-btn:focus-visible {
  background: rgba(30, 30, 38, .88);
  border-color: rgba(8, 200, 244, .65);
  transform: translateY(-1px);
  outline: none;
}

.ffx-btn svg { width: 20px; height: 20px; fill: currentColor; }

.ffx-center-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  pointer-events: none;
  opacity: 0;
  transform: scale(.98);
  transition: opacity 220ms ease-in, transform 220ms ease-in;
}

.ffx-controls-visible .ffx-center-overlay {
  opacity: 1;
  transform: scale(1);
}

.ffx-center-overlay .ffx-btn {
  width: 64px;
  height: 64px;
  pointer-events: none;
  background: rgba(10, 10, 18, .72);
  border-color: rgba(255, 255, 255, .16);
}

.ffx-controls-visible .ffx-center-overlay .ffx-btn { pointer-events: auto; }
.ffx-center-overlay .ffx-centerPlay { width: 72px; height: 72px; }
.ffx-center-overlay .ffx-centerPlay svg { width: 30px; height: 30px; }

.ffx-seek-btn {
  gap: 1px;
  grid-template-rows: 18px auto;
  line-height: 1;
}

.ffx-seek-btn svg { width: 20px; height: 18px; }
.ffx-seek-value { font: 900 13px/1 var(--ffx-font); }
.ffx-center-overlay .ffx-seek-value { font-size: 17px; }

.ffx-controls {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 5;
  display: grid;
  grid-template-columns: auto auto auto minmax(90px, 1fr) auto auto auto auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(18, 18, 20, .82), rgba(6, 6, 8, .76));
  box-shadow: 0 18px 44px rgba(0, 0, 0, .34);
  backdrop-filter: blur(18px);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 220ms ease-in, transform 220ms ease-in;
}

.ffx-controls-visible .ffx-controls {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.ffx-progress { width: 100%; min-width: 70px; accent-color: var(--ffx-accent); }

.ffx-time,
.ffx-speed,
.ffx-speed-menu button {
  font-family: var(--ffx-font);
}

.ffx-time {
  min-width: 88px;
  white-space: nowrap;
  color: rgba(255, 255, 255, .9);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

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

.ffx-speed {
  width: auto;
  min-width: 46px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
}

.ffx-speed-menu {
  position: absolute;
  right: 0;
  bottom: 48px;
  display: grid;
  gap: 4px;
  min-width: 72px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 16px;
  background: rgba(12, 12, 14, .94);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .34);
}

.ffx-speed-menu[hidden] { display: none; }

.ffx-speed-menu button {
  border: 0;
  border-radius: 999px;
  padding: 8px 10px;
  color: rgba(255, 255, 255, .86);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.ffx-speed-menu button:hover,
.ffx-speed-menu button.is-active {
  color: #06131a;
  background: var(--ffx-accent);
}

.ffx-loading,
.ffx-error {
  position: absolute;
  z-index: 6;
  font: 700 13px var(--ffx-font);
}

.ffx-loading {
  top: 12px;
  left: 12px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(0, 0, 0, .66);
}

.ffx-error {
  left: 50%;
  top: 50%;
  max-width: min(86%, 360px);
  transform: translate(-50%, -50%);
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(16, 16, 20, .92);
  text-align: center;
}

.ffx-loading[hidden], .ffx-error[hidden] { display: none; }

.ffx-player:fullscreen,
.ffx-player:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  background: #000;
}
