/* yes these are duplicates with framework */
.torrent-player {
  --download: 0%;
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-content: center;
  color: #ececec;
  user-select: none;
  font-family: Roboto, Arial, Helvetica, sans-serif;
  z-index: 10;
  will-change: width, right, bottom, position, display;
  bottom: 2rem;
  right: 2rem;
  width: 25%;
  height: auto;
  transition: width 0.2s ease;
  overflow: hidden;
}

.torrent-player:target {
  bottom: 0;
  right: 0;
  position: relative;
  width: 100%;
  height: 100%;
  transition: none !important;
}

.torrent-player:target .middle,
.torrent-player:target .bottom {
  display: flex;
}

.torrent-player video {
  position: relative;
  flex: 0 1 auto;
  z-index: -1;
  width: 100%;
  height: 100%;
  background: #191c209d;
  backdrop-filter: blur(10px);
}

.torrent-player:target video {
  position: absolute;
  background: none;
}

.torrent-player a.miniplayer {
  z-index: 5;
  position: absolute;
  width: 100%;
  height: 100%;
}

.torrent-player.pip {
  background: #000;
}

.torrent-player.pip canvas {
  left: 99.9% !important;
  /*hack to hide the canvas but still keep it updating*/
}

.torrent-player .material-icons {
  font-size: 2.2rem;
  padding: 1.2rem;
  transition: all 0.2s ease;
  display: flex;
}

.torrent-player.immersed {
  cursor: none;
}

.torrent-player.immersed .top,
.torrent-player.immersed .middle .ctrl,
.torrent-player.immersed .bottom {
  opacity: 0;
}

.torrent-player .ctrl[data-name='downloadFile'] {
  text-decoration: none !important;
  color: #ececec !important;
  justify-self: end;
}

.torrent-player:target a.miniplayer,
.torrent-player .bottom input[type='range'][data-name='setProgress']+img[src=' '],
.torrent-player video[src='']:not([poster]),
.torrent-player .ctrl[disabled],
.torrent-player .ctrl[href=''],
.torrent-player:fullscreen .ctrl[data-name='toggleTheatre'],
.torrent-player:fullscreen .ctrl[data-name='openPlaylist'],
.torrent-player:fullscreen .ctrl[data-name='togglePopout'] {
  display: none !important;
}

.torrent-player.pip video {
  visibility: hidden;
}

.torrent-player .top {
  background: linear-gradient(to bottom,
      rgba(0, 0, 0, 0.8),
      rgba(0, 0, 0, 0.4) 25%,
      rgba(0, 0, 0, 0.2) 50%,
      rgba(0, 0, 0, 0.1) 75%,
      transparent);
  display: none;
  transition: 0.5s opacity ease;
  border-width: 0;
  border-top-width: 1px;
  border-image-slice: 1;
  border-style: solid;
  border-image-source: linear-gradient(90deg,
      #e5204c var(--download),
      rgba(0, 0, 0, 0.8) var(--download));
  grid-template-columns: 1fr auto 1fr;
}

.torrent-player:target .top {
  display: grid;
}

.torrent-player .stats {
  justify-content: center;
}

.torrent-player .top .stats {
  display: flex;
}

.torrent-player .top span[data-name='peers']::after,
.torrent-player .top span[data-name='downSpeed']::after,
.torrent-player .top span[data-name='upSpeed']::after,
.torrent-player .top div[data-name='nowPlaying'] {
  content: attr(data-value);
  font-size: 1.8rem !important;
  white-space: nowrap;
  align-self: center;
  font-weight: 600;
  font-family: Roboto, Arial, Helvetica, sans-serif;
  padding-left: 1.2rem;
}

.torrent-player .top div[data-name='nowPlaying'] {
  padding-left: 1.2rem !important;
  overflow: hidden;
  text-overflow: ellipsis;
}

.torrent-player .top span[data-name='downloadFile'][disabled] {
  display: block !important;
  cursor: not-allowed;
  color: rgba(255, 255, 255, 0.4);
}

.torrent-player .middle {
  height: 100%;
  flex: 1;
  display: none;
  flex-direction: row;
  position: relative;
  justify-content: center;
  align-items: center;
}

.torrent-player .middle div[data-name='bufferingDisplay'] {
  border: 4px solid #ffffff00;
  border-top: 4px solid #fff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  opacity: 0;
  transition: 0.5s opacity ease;
  position: absolute;
  filter: drop-shadow(0 0 8px #000);
}

.torrent-player.buffering .middle div[data-name='bufferingDisplay'] {
  opacity: 1 !important;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.torrent-player .middle .ctrl[data-name="ppToggle"] {
  position: absolute;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 2;
}

.torrent-player .middle .ctrl {
  font-size: 4rem;
  margin: 2rem;
  z-index: 3;
  display: none;
}

@media (pointer:none),
(pointer:coarse) {
  .torrent-player .middle .ctrl {
    display: flex;
  }
}

.torrent-player .middle .ctrl[data-name='playPause'] {
  font-size: 6rem;
}

.torrent-player .middle .ctrl,
.torrent-player .bottom .ctrl:hover {
  filter: drop-shadow(0 0 8px #000);
}

.torrent-player .bottom {
  background: linear-gradient(to top,
      rgba(0, 0, 0, 0.8),
      rgba(0, 0, 0, 0.4) 25%,
      rgba(0, 0, 0, 0.2) 50%,
      rgba(0, 0, 0, 0.1) 75%,
      transparent);
  display: none;
  transition: 0.5s opacity ease;
}

.torrent-player .bottom .ctrl {
  cursor: pointer;
}

.torrent-player .bottom input[type='range'] {
  -webkit-appearance: none;
  background: transparent;
  margin: 0;
  cursor: pointer;
}

.torrent-player .bottom input[type='range']:focus {
  outline: none;
}

.torrent-player .bottom input[type='range']::-webkit-slider-runnable-track {
  height: 3px;
}

.torrent-player .bottom input[type='range']::-moz-range-track {
  height: 3px;
}

.torrent-player .bottom input[type='range']::-webkit-slider-thumb {
  height: 0;
  width: 0;
  border-radius: 50%;
  background: #e5204c;
  -webkit-appearance: none;
  appearance: none;
  margin-top: 2px;
  transition: all 0.1s ease;
}

.torrent-player .bottom input[type='range']::-moz-range-thumb {
  height: 0;
  width: 0;
  border-radius: 50%;
  background: #e5204c;
  -moz-appearance: none;
  appearance: none;
  margin-top: 2px;
  transition: all 0.1s ease;
  border: none;
}

.torrent-player .bottom input[type='range']:hover::-webkit-slider-thumb {
  height: 12px;
  width: 12px;
  margin-top: -4px;
}

.torrent-player .bottom input[type='range']:hover::-moz-range-thumb {
  height: 12px;
  width: 12px;
  margin-top: -4px;
}

.torrent-player .bottom input[type='range'][data-name='setProgress']::-webkit-slider-runnable-track {
  background: linear-gradient(90deg,
      #e5204c var(--progress),
      rgba(255, 255, 255, 0.2) var(--progress));
}

.torrent-player .bottom input[type='range'][data-name='setVolume']::-webkit-slider-runnable-track {
  background: linear-gradient(90deg,
      #e5204c var(--volume-level),
      rgba(255, 255, 255, 0.2) var(--volume-level));
}

.torrent-player .bottom input[type='range'][data-name='setProgress']::-moz-range-track {
  background: linear-gradient(90deg,
      #e5204c var(--progress),
      rgba(255, 255, 255, 0.2) var(--progress));
}

.torrent-player .bottom input[type='range'][data-name='setVolume']::-moz-range-track {
  background: linear-gradient(90deg,
      #e5204c var(--volume-level),
      rgba(255, 255, 255, 0.2) var(--volume-level));
}

.torrent-player .bottom .volume {
  display: flex;
  width: auto;
}

.torrent-player .bottom .volume:hover input[type='range'] {
  width: 5vw;
  display: inline-block;
  transition: all 0.1s ease;
  margin-right: 1rem;
}

.torrent-player .bottom .volume input[type='range'] {
  width: 0;
  transition: all 0.1s ease;
}

.torrent-player .bottom div[data-name='progressWrapper'] {
  --progress: 0%;
}

.torrent-player .bottom input[type='range'][data-name='setProgress'],
.torrent-player .bottom div[data-name='progressWrapper'],
.torrent-player .bottom div[data-name='progressWrapper'] div {
  display: flex;
  width: 100%;
  height: 100%;
  position: relative;
}

.torrent-player .bottom input[type='range'][data-name='setProgress']+img,
.torrent-player .bottom input[type='range'][data-name='setProgress']::before {
  pointer-events: none;
  opacity: 0;
  position: absolute;
  transform: translate(-50%, -100%);
  font-family: Roboto, Arial, Helvetica, sans-serif;
  white-space: nowrap;
  align-self: center;
  left: var(--progress);
  font-weight: 600;
  transition: 0.2s opacity ease;
}

.torrent-player .bottom input[type='range'][data-name='setProgress']+img {
  top: -2rem;
  width: 150px;
}

.torrent-player .bottom input[type='range'][data-name='setProgress']::before {
  top: 0.5rem;
  content: attr(data-elapsed);
  color: #ececec;
}

.torrent-player .bottom input[type='range'][data-name='setProgress']:active+img,
.torrent-player .bottom input[type='range'][data-name='setProgress']:active::before {
  opacity: 1;
}

.torrent-player .bottom div[data-name='progressWrapper']::before,
.torrent-player .bottom div[data-name='progressWrapper']::after {
  color: #ececec;
  font-size: 1.8rem !important;
  white-space: nowrap;
  align-self: center;
  cursor: default;
  line-height: var(--base-line-height);
  padding: 0 1.2rem;
  font-weight: 600;
}

.torrent-player .bottom div[data-name='progressWrapper']::before {
  content: attr(data-elapsed);
}

.torrent-player .bottom div[data-name='progressWrapper']::after {
  content: attr(data-remaining);
}

.torrent-player .bottom .popup {
  position: relative;
}

.torrent-player .bottom .popup input {
  display: none;
}

.torrent-player .bottom .popup input:checked+label {
  color: white
}

.torrent-player .bottom .popup label {
  cursor: pointer;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}

.torrent-player .bottom .popup .popup-menu {
  visibility: hidden;
  position: absolute;
  transform: translateY(-100%);
  text-transform: capitalize;
  top: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  min-width: 5rem;
  background: #191c20;
  padding: .8rem;
  border-radius: 3px;
  font-size: 1.6rem
}

.torrent-player .bottom .popup:hover .popup-menu {
  visibility: visible;
}

@media (pointer:none),
(pointer:coarse) {

  .torrent-player .bottom .ctrl[data-name='playPause'],
  .torrent-player .bottom .ctrl[data-name='playNext'],
  .torrent-player .bottom .volume,
  .torrent-player .bottom .ctrl[data-name='togglePopout'],
  .torrent-player .bottom .ctrl[data-name='toggleFullscreen'] {
    display: none
  }
}