.ap-root {
  position: relative;
  background: #000;
  overflow: hidden;
}

.ap-root video,
.ap-root .ap-iframe {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.ap-hidden {
  display: none !important;
}

.ap-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.ap-topbar,
.ap-bottom,
.ap-center-play {
  transition: opacity .22s ease, transform .22s ease;
}

.ap-topbar {
  display: flex;
  justify-content: flex-start;
  padding: 1rem;
}

.ap-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: #fff;
  background: rgba(10, 10, 10, .55);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
  padding: .45rem .8rem;
  font-size: .82rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,.22);
}

.ap-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.ap-center-play {
  pointer-events: auto;
  width: 76px;
  height: 76px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(10,10,10,.52);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 44px rgba(0,0,0,.28);
  transition: transform .16s ease, opacity .16s ease;
}

.ap-center-play:hover {
  transform: scale(1.05);
}

.ap-center-play svg {
  width: 34px;
  height: 34px;
}

.ap-center-hidden {
  opacity: 0;
  pointer-events: none;
}

.ap-bottom {
  position: relative;
  pointer-events: none;
}

.ap-bottom-gradient {
  position: absolute;
  inset: auto 0 0 0;
  height: 120px;
  background: linear-gradient(to top, rgba(0,0,0,.86), rgba(0,0,0,.30), transparent);
}

.ap-progress-wrap {
  position: relative;
  z-index: 2;
  padding: 0 1rem .55rem;
  pointer-events: auto;
}

.ap-progress {
  width: 100%;
  appearance: none;
  height: 4px;
  background: rgba(255,255,255,.18);
  border-radius: 999px;
  outline: none;
}

.ap-progress::-webkit-slider-runnable-track {
  height: 4px;
  background: rgba(255,255,255,.18);
  border-radius: 999px;
}

.ap-progress::-webkit-slider-thumb {
  appearance: none;
  margin-top: -5px;
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,.18);
  cursor: pointer;
}

.ap-progress::-moz-range-track {
  height: 4px;
  background: rgba(255,255,255,.18);
  border-radius: 999px;
}

.ap-progress::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,.18);
  cursor: pointer;
}

.ap-controls {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0 1rem 1rem;
  pointer-events: auto;
}

.ap-controls-left,
.ap-controls-right,
.ap-controls-center {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.ap-controls-left {
  justify-content: flex-start;
}

.ap-controls-center {
  justify-content: center;
}

.ap-controls-right {
  justify-content: flex-end;
}

.ap-btn {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: .9rem;
  background: rgba(10,10,10,.48);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  transition: transform .16s ease, background .16s ease, opacity .16s ease;
  cursor: pointer;
}

.ap-btn:hover {
  transform: translateY(-1px);
  background: rgba(28,28,28,.7);
}

.ap-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
  transform: none;
}

.ap-btn:disabled:hover {
  background: rgba(10,10,10,.48);
}

.ap-btn svg {
  width: 21px;
  height: 21px;
}

.ap-time {
  color: #fff;
  font-size: .92rem;
  font-weight: 600;
  min-width: 96px;
  letter-spacing: .01em;
}

.ap-volume-wrap {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.ap-volume {
  width: 90px;
  appearance: none;
  height: 4px;
  background: rgba(255,255,255,.18);
  border-radius: 999px;
  outline: none;
}

.ap-volume::-webkit-slider-runnable-track {
  height: 4px;
  background: rgba(255,255,255,.18);
  border-radius: 999px;
}

.ap-volume::-webkit-slider-thumb {
  appearance: none;
  margin-top: -4px;
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
}

.ap-volume::-moz-range-track {
  height: 4px;
  background: rgba(255,255,255,.18);
  border-radius: 999px;
}

.ap-volume::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
}

.ap-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 40px;
  padding: 0 .85rem;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(10,10,10,.48);
  color: rgba(255,255,255,.92);
  font-size: .84rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

.ap-mode-btn:hover {
  transform: translateY(-1px);
  background: rgba(28,28,28,.7);
}

.ap-mode-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.36);
  box-shadow: 0 0 0 2px rgba(255,255,255,.06);
  transition: background .16s ease, box-shadow .16s ease;
}

.ap-mode-btn-active {
  background: rgba(127, 29, 29, .72);
  border-color: rgba(239,68,68,.38);
  color: #fff;
}

.ap-mode-btn-active .ap-mode-dot {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,.18);
}

.ap-quality-wrap {
  position: relative;
}

.ap-quality-btn {
  width: auto;
  min-width: 86px;
  padding: 0 .8rem;
  gap: .45rem;
  font-weight: 800;
}

.ap-quality-btn svg {
  width: 16px;
  height: 16px;
  opacity: .82;
}

.ap-quality-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + .55rem);
  min-width: 9rem;
  padding: .35rem;
  background: rgba(10,10,10,.92);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 1rem;
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 56px rgba(0,0,0,.38);
}

.ap-quality-item {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: #fff;
  text-align: left;
  padding: .8rem .9rem;
  border-radius: .75rem;
  font-size: .92rem;
  cursor: pointer;
}

.ap-quality-item:hover {
  background: rgba(239,68,68,.18);
}

.ap-quality-item-active {
  background: rgba(239,68,68,.28);
  font-weight: 700;
}

.ap-quality-item-disabled {
  opacity: .35;
  cursor: not-allowed;
}

.ap-resume {
  position: absolute;
  left: 50%;
  bottom: 4.25rem;
  transform: translateX(-50%);
  max-width: 340px;
  width: calc(100% - 2rem);
  background: linear-gradient(135deg, rgba(24,24,27,.96), rgba(185,28,28,.92));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 1rem;
  padding: 1rem;
  z-index: 70;
  box-shadow: 0 18px 50px rgba(0,0,0,.4);
  backdrop-filter: blur(14px);
  pointer-events: auto;
}

.ap-resume * {
  pointer-events: auto;
}

.ap-resume-text {
  color: #fff;
  font-size: .92rem;
  margin-bottom: .75rem;
}

.ap-resume-actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
}

.ap-resume-secondary,
.ap-resume-primary {
  border: 0;
  border-radius: .65rem;
  cursor: pointer;
}

.ap-resume-secondary {
  background: transparent;
  color: rgba(255,255,255,.82);
  font-size: .78rem;
  padding: .45rem .6rem;
}

.ap-resume-primary {
  background: #ef4444;
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  padding: .45rem .8rem;
}

.ap-is-buffering .ap-center-play {
  opacity: .78;
}

.ap-is-fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  border-radius: 0 !important;
}

.ap-root.ap-is-fullscreen.ap-ui-hidden .ap-topbar,
.ap-root.ap-is-fullscreen.ap-ui-hidden .ap-bottom {
  opacity: 0;
  pointer-events: none;
}

.ap-root.ap-is-fullscreen.ap-ui-hidden .ap-topbar {
  transform: translateY(-14px);
}

.ap-root.ap-is-fullscreen.ap-ui-hidden .ap-bottom {
  transform: translateY(18px);
}

.ap-root.ap-is-fullscreen.ap-ui-hidden .ap-center-play {
  opacity: 0;
  transform: scale(.9);
  pointer-events: none;
}

.ap-root.ap-is-fullscreen.ap-fs-idle,
.ap-root.ap-is-fullscreen.ap-fs-idle * {
  cursor: none !important;
}

@media (max-width: 1100px) {
  .ap-controls {
    grid-template-columns: 1fr;
    gap: .8rem;
  }

  .ap-controls-left,
  .ap-controls-center,
  .ap-controls-right {
    justify-content: center;
  }
}

@media (max-width: 900px) {
  .ap-time {
    min-width: 82px;
    font-size: .82rem;
  }

  .ap-volume-wrap {
    display: none;
  }

  .ap-controls-left,
  .ap-controls-right,
  .ap-controls-center {
    gap: .5rem;
    flex-wrap: wrap;
  }

  .ap-btn {
    width: 38px;
    height: 38px;
  }

  .ap-quality-btn {
    min-width: 74px;
    padding: 0 .65rem;
  }

  .ap-center-play {
    width: 64px;
    height: 64px;
  }

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

  .ap-mode-btn {
    min-height: 36px;
    padding: 0 .72rem;
    font-size: .78rem;
  }
}

@media (max-width: 640px) {
  .ap-topbar {
    padding: .75rem;
  }

  .ap-pill {
    font-size: .74rem;
    padding: .4rem .65rem;
  }

  .ap-controls {
    padding: 0 .75rem .75rem;
  }

  .ap-progress-wrap {
    padding: 0 .75rem .45rem;
  }

  .ap-time {
    min-width: 72px;
    font-size: .76rem;
  }

  .ap-quality-btn {
    min-width: 68px;
  }

  .ap-quality-menu {
    min-width: 8rem;
  }
}
