:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #000;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #000;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  -webkit-user-select: none;
  user-select: none;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.player {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #000;
}

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

.player.is-portrait .story-video {
  object-position: center;
  object-fit: cover;
}

.center-play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  display: grid;
  width: 64px;
  height: 64px;
  padding: 0;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  opacity: 1;
  transform: translate(-50%, -50%);
  transition: opacity 180ms ease, transform 180ms ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.center-play svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.player.is-playing .center-play {
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.9);
}

.controls {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  display: flex;
  min-height: 58px;
  padding: 12px max(12px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  align-items: center;
  gap: 7px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0));
  opacity: 1;
  transition: opacity 180ms ease, transform 180ms ease;
}

.player.is-idle .controls {
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
}

.icon-button {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  color: #fff;
  background: transparent;
  border: 0;
  border-radius: 50%;
}

.icon-button:active {
  background: rgba(255, 255, 255, 0.12);
}

.icon-button svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.scrubber {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  height: 34px;
}

.seek-input {
  --progress: 0%;
  width: 100%;
  height: 22px;
  margin: 0;
  appearance: none;
  background: transparent;
}

.seek-input::-webkit-slider-runnable-track {
  height: 3px;
  background: linear-gradient(
    to right,
    #fff 0,
    #fff var(--progress),
    rgba(255, 255, 255, 0.28) var(--progress),
    rgba(255, 255, 255, 0.28) 100%
  );
  border-radius: 999px;
}

.seek-input::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: -4.5px;
  appearance: none;
  background: #fff;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
}

.seek-input::-moz-range-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 999px;
}

.seek-input::-moz-range-progress {
  height: 3px;
  background: #fff;
  border-radius: 999px;
}

.seek-input::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: #fff;
  border: 0;
  border-radius: 50%;
}

.time-readout {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.8);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 340px) {
  .controls {
    gap: 4px;
    padding-right: max(8px, env(safe-area-inset-right));
    padding-left: max(8px, env(safe-area-inset-left));
  }

  .icon-button {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
  }

  .time-readout {
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .center-play,
  .controls {
    transition: none;
  }
}
