.stream-player {
  --stream-ink: var(--theme-ink, #e8eef7);
  --stream-quiet: var(--theme-quiet, #a4b1c5);
  --stream-shell: var(--theme-surface, #151e2c);
  --stream-soft: var(--theme-soft, #202e43);
  --stream-line: var(--theme-line, #34435a);
  --stream-accent: var(--theme-accent, #85b4ff);
  --stream-on-accent: var(--theme-on-accent, #111a29);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  color: var(--stream-ink);
  background: var(--stream-shell);
  border: 1px solid color-mix(in srgb, var(--stream-line) 65%, transparent);
  border-radius: 14px;
  overflow: hidden;
  font:
    14px/1.5 system-ui,
    sans-serif;
}
.stream-player *,
.stream-player *::before,
.stream-player *::after {
  box-sizing: border-box;
}
.stream-player [hidden] {
  display: none !important;
}
.stream-player .ui-icon {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.stream-player-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  flex-shrink: 0;
  width: 100%;
}
.stream-player-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--stream-accent);
  background: var(--stream-soft);
  flex-shrink: 0;
}
.stream-player-heading {
  min-width: 0;
  flex: 1;
}
.stream-player-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stream-player-context {
  display: block;
  color: var(--stream-quiet);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stream-live-badge {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 80px;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--stream-quiet);
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--stream-soft);
}
.stream-live-badge[data-live='true'] {
  color: var(--theme-ok, #7fe1b5);
}
.stream-live-badge[data-live='true']::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.stream-header-actions,
.stream-playback-controls,
.stream-view-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.stream-player button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 8px;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  cursor: pointer;
  color: var(--stream-quiet);
  background: transparent;
  font: inherit;
  box-shadow: none;
}
.stream-player button:hover:not(:disabled) {
  background: var(--stream-soft);
  color: var(--stream-accent);
}
.stream-player button[aria-pressed='true'] {
  color: var(--stream-accent);
  background: var(--stream-soft);
}
.stream-player button:disabled {
  opacity: 0.4;
  cursor: default;
}
.stream-player :is(button, select, input):focus-visible,
.stream-player:focus-visible {
  outline: 2px solid var(--stream-accent);
  outline-offset: -2px;
}
.stream-player-stage {
  flex: 1;
  min-height: 0;
  min-width: 0;
  position: relative;
  overflow: auto;
  background: #080e17;
  scrollbar-width: thin;
  scrollbar-color: #48536b #101723;
}
.stream-player-canvas {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  min-width: 100%;
  min-height: 100%;
}
.stream-player video {
  display: block;
  position: static;
  background: #080e17;
  min-width: 0;
  min-height: 0;
  max-width: none;
  max-height: none;
  object-fit: contain;
  border-radius: 0;
}
.stream-player video.mirrored {
  transform: scaleX(-1);
}
.stream-player-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px;
  color: #d5e0f1;
  text-align: center;
  background: radial-gradient(ellipse at 50% 40%, #1b2b43, #0b121f 75%);
}
.stream-empty-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 8px;
  border-radius: 18px;
  color: #9cbef0;
  background: #20334d;
  box-shadow: 0 0 60px #3979d322;
}
.stream-empty-icon .ui-icon {
  width: 28px;
  height: 28px;
}
.stream-player-empty strong {
  font-size: 16px;
  font-weight: 600;
}
.stream-player-empty p {
  margin: 0;
  max-width: 400px;
  color: #a6b7d0;
  font-size: 13px;
}
.stream-player .stream-retry {
  width: auto;
  padding-inline: 18px;
  background: var(--stream-accent);
  color: var(--stream-on-accent);
  font-weight: 600;
}
.stream-player .stream-retry:hover:not(:disabled) {
  background: color-mix(in srgb, var(--stream-accent) 90%, var(--stream-ink));
  color: var(--stream-on-accent);
}
.stream-player-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px 14px;
  background: var(--stream-shell);
  flex-shrink: 0;
  width: 100%;
}
.stream-volume-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 11px;
  font-weight: 400;
}
.stream-volume-caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.stream-volume {
  width: 110px;
  min-width: 65px;
  min-height: 28px;
  accent-color: var(--stream-accent);
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.stream-volume-label output {
  width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--stream-quiet);
}
.stream-player .stream-fit {
  width: auto;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid var(--stream-line);
  border-radius: 7px;
  color: var(--stream-ink);
  background: var(--stream-shell);
  font:
    12px system-ui,
    sans-serif;
}
.stream-resolution {
  color: var(--stream-quiet);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stream-feedback {
  display: flex;
  align-items: start;
  gap: 8px;
  flex-basis: 100%;
  order: -1;
  height: 44px;
  min-width: 0;
}
.stream-player-notice {
  flex: 1;
  min-width: 0;
  max-height: 44px;
  overflow-y: auto;
  overflow-wrap: anywhere;
  color: var(--stream-quiet);
  font-size: 12px;
  line-height: 1.5;
  margin: 0 4px 2px;
}
.stream-player .stream-enable-audio {
  width: auto;
  font-size: 12px;
  padding-inline: 10px;
  background: var(--stream-soft);
}
.stream-player:fullscreen {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
}
.inline-stream-player {
  position: relative;
}
.inline-stream-player .stream-player-context {
  display: none;
}
.inline-stream-player .stream-player-header {
  padding: 10px 12px;
}
.inline-stream-player .stream-player-mark {
  width: 30px;
  height: 30px;
}
.inline-stream-player .stream-player-footer {
  padding: 8px;
  gap: 6px;
}
.inline-stream-player .stream-resolution {
  display: none;
}
.inline-stream-player .stream-volume {
  width: 80px;
}
.inline-stream-player .stream-feedback {
  position: absolute;
  inset: 64px 8px auto;
  height: auto;
  max-height: 44px;
  padding: 4px;
  background: var(--stream-shell);
  border-radius: 6px;
  z-index: 2;
}
.inline-stream-player
  .stream-feedback:not(
    :has(.stream-player-notice:not([hidden]), .stream-enable-audio:not([hidden]))
  ) {
  display: none;
}
@media (max-width: 700px) {
  .stream-player-header {
    padding: 10px;
    gap: 8px;
  }
  .stream-player-mark {
    display: none;
  }
  .stream-player-footer {
    gap: 6px;
    padding: 8px;
  }
  .stream-resolution {
    display: none;
  }
  .stream-playback-controls {
    flex: 1 1 auto;
  }
  .stream-volume-label {
    flex: 1;
  }
  .stream-volume {
    width: 100%;
    max-width: 140px;
  }
  .stream-player .stream-fit {
    font-size: 16px;
    min-height: 44px;
    max-width: 130px;
  }
  .stream-live-badge {
    padding: 3px 6px;
  }
}
@media (max-width: 700px), (pointer: coarse) {
  .stream-player button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }
  .stream-player .stream-fit {
    min-height: 44px;
    font-size: 16px;
  }
}
@media (max-width: 360px) {
  .stream-player-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .stream-header-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
  .inline-stream-player .stream-player-header {
    display: flex;
  }
  .inline-stream-player .stream-live-badge {
    width: 52px;
  }
}
