.player {
  --osd-accent: #00a4dc;
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  color: #fff;
  overflow: hidden;
  user-select: none;
}
.player .stage {
  position: absolute;
  inset: 0;
  line-height: 0;
  background: #000;
}
.player .stage video {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  background: #000;
  position: relative;
  z-index: 0;
}
.player .stage canvas,
.player .JASSUB {
  z-index: 2;
  pointer-events: none;
}

.osd {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  opacity: 1;
  transition: opacity .25s ease;
}
.player.osd-idle .osd { opacity: 0; pointer-events: none; }
.player.osd-idle .osd-top,
.player.osd-idle .osd-bottom { pointer-events: none; }
.player.osd-idle { cursor: none; }

.osd-top, .osd-bottom {
  pointer-events: auto;
  padding: 12px 18px 18px;
}
.osd-top {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, rgba(16, 16, 16, .82) 0%, rgba(16, 16, 16, 0) 100%);
  padding-bottom: 48px;
}
.osd-title {
  flex: 1;
  min-width: 0;
  font-size: 18px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .8);
}
.osd-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .45);
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.osd-center svg { width: 40px; height: 40px; margin-left: 4px; }
.player.is-paused .osd-center { display: flex; }

.osd-bottom {
  background: linear-gradient(0deg, rgba(16, 16, 16, .82) 0%, rgba(16, 16, 16, 0) 100%);
  padding-top: 56px;
}
.osd-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.osd-spacer { flex: 1; min-width: 8px; }
.osd-time {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  opacity: .92;
  margin-left: 6px;
}
.player-live .osd-time {
  letter-spacing: 0.08em;
  font-weight: 650;
  color: #ff5a5a;
}
.osd-status {
  font-size: 12px;
  color: rgba(255, 255, 255, .7);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.osd-status.bad { color: #ff8a80; }

.osd-btn {
  appearance: none;
  background: transparent;
  border: none;
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  flex: none;
}
.osd-btn:hover { background: rgba(255, 255, 255, .12); }
.osd-btn svg { width: 24px; height: 24px; display: block; }
.osd-btn.osd-play { width: 48px; height: 48px; }
.osd-btn.osd-play svg { width: 28px; height: 28px; }
.osd-skip { position: relative; }
.osd-skip span {
  position: absolute;
  bottom: 6px;
  right: 6px;
  font-size: 9px;
  font-weight: 700;
  pointer-events: none;
}

.osd-sel[hidden] { display: none !important; }
.osd-sel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, .8);
  font-size: 12px;
}
.osd-sel select {
  background: rgba(0, 0, 0, .35);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 4px;
  padding: 4px 8px;
  max-width: 180px;
}
.osd-chk {
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .35);
  border: 1px solid rgba(255, 255, 255, .2);
}
.osd-chk input[type="checkbox"] {
  margin: 0;
  accent-color: var(--osd-accent);
  cursor: pointer;
}

.osd-seek, .osd-vol {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  height: 18px;
  margin: 0 0 8px;
  width: 100%;
  cursor: pointer;
}
.osd-vol {
  width: 90px;
  margin: 0 6px 0 0;
  flex: none;
}
.osd-seek::-webkit-slider-runnable-track,
.osd-vol::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right,
    var(--osd-accent) 0 var(--pct, 0%),
    rgba(255, 255, 255, .28) var(--pct, 0%) 100%);
}
.osd-seek::-moz-range-track,
.osd-vol::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .28);
}
.osd-seek::-moz-range-progress,
.osd-vol::-moz-range-progress {
  height: 4px;
  border-radius: 2px;
  background: var(--osd-accent);
}
.osd-seek::-webkit-slider-thumb,
.osd-vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--osd-accent);
  border: none;
  margin-top: -5px;
}
.osd-seek::-moz-range-thumb,
.osd-vol::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--osd-accent);
  border: none;
}

.player .stage canvas,
.player .JASSUB {
  z-index: 2;
  pointer-events: none;
}

@media (max-width: 840px) {
  .osd-top, .osd-bottom { padding-left: 10px; padding-right: 10px; }
  .osd-title { font-size: 15px; }
  .osd-vol { display: none; }
  .osd-status { max-width: 40vw; }
}
