.shell-video-player-shell {
  position: fixed;
  inset: 0;
  z-index: 2200;
  background: #000;
  color: #fff;
  opacity: 1;
  transition: opacity 180ms ease-out;
}

.shell-video-player-shell.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.shell-video-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 35%, rgba(57,255,20,0.10), transparent 34%), #000;
  overflow: hidden;
}

.shell-video-element {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.shell-video-empty {
  max-width: min(620px, calc(100vw - 44px));
  padding: 34px 26px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.54);
  box-shadow: 0 28px 90px rgba(0,0,0,0.54);
}

.shell-video-empty img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(57,255,20,0.32));
}

.shell-video-empty h2 {
  margin: 14px 0 8px;
  font-size: clamp(24px, 3vw, 42px);
  letter-spacing: -0.04em;
}

.shell-video-empty p {
  margin: 0;
  color: rgba(255,255,255,0.72);
  line-height: 1.5;
}

.shell-video-header,
.shell-video-osd {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 2;
  opacity: 1;
  transition: opacity 260ms ease-out;
  pointer-events: none;
}

.shell-video-header {
  top: 0;
  height: clamp(84px, 12vh, 132px);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: calc(18px + env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 34px max(18px, env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(16,16,16,0.82) 0%, rgba(16,16,16,0.50) 42%, rgba(16,16,16,0) 100%);
}

.shell-video-title-block {
  min-width: 0;
  padding-top: 2px;
  text-shadow: 0 2px 18px rgba(0,0,0,0.95);
}

.shell-video-kicker,
.shell-video-osd-meta,
.shell-video-time-extra {
  color: rgba(255,255,255,0.66);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.shell-video-title {
  max-width: min(900px, 78vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(20px, 2.2vw, 34px);
  font-weight: 900;
  letter-spacing: -0.035em;
}

.shell-video-osd {
  bottom: 0;
  padding: clamp(92px, 13vh, 150px) max(18px, env(safe-area-inset-right)) calc(22px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background: linear-gradient(0deg, rgba(16,16,16,0.84) 0%, rgba(16,16,16,0.58) 44%, rgba(16,16,16,0) 100%);
}

.shell-video-osd > * {
  pointer-events: all;
}

.shell-video-osd-text {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 12px;
  text-shadow: 0 2px 18px rgba(0,0,0,0.95);
}

.shell-video-osd h3 {
  margin: 0;
  max-width: min(680px, 62vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(20px, 2.2vw, 34px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.shell-video-position-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.78);
  font-size: 13px;
  font-weight: 800;
}

.shell-video-seek,
.shell-video-volume {
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,0.24);
  cursor: pointer;
}

.shell-video-seek.has-hls-range {
  --hls-range-start: 0%;
  --hls-range-end: 0%;
  --hls-buffered-end: 0%;
  background:
    linear-gradient(90deg,
      rgba(255,255,255,0.24) 0%,
      rgba(255,255,255,0.24) var(--hls-range-start),
      rgba(38,154,255,0.92) var(--hls-range-start),
      rgba(38,154,255,0.92) var(--hls-range-end),
      rgba(255,255,255,0.24) var(--hls-range-end),
      rgba(255,255,255,0.24) 100%);
  box-shadow: inset 0 0 0 1px rgba(38,154,255,0.16), 0 0 16px rgba(38,154,255,0.12);
}

.shell-video-seek.has-hls-range:focus-visible {
  outline: 2px solid rgba(38,154,255,0.86);
  outline-offset: 5px;
}

.shell-video-seek::-webkit-slider-thumb,
.shell-video-volume::-webkit-slider-thumb {
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 16px rgba(57,255,20,0.42);
}

.shell-video-seek::-moz-range-thumb,
.shell-video-volume::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
}

.shell-video-button-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}

.shell-video-left-buttons,
.shell-video-right-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shell-video-time-extra {
  margin-left: auto;
  margin-right: 6px;
  text-transform: none;
  letter-spacing: 0.02em;
}

.shell-video-icon {
  position: relative;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background: rgba(0,0,0,0.32);
  padding: 4px;
  cursor: pointer;
  pointer-events: all;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.shell-video-icon:hover,
.shell-video-icon:focus-visible {
  outline: none;
  transform: translateY(-1px);
  border-color: rgba(57,255,20,0.72);
  background: rgba(57,255,20,0.10);
}

.shell-video-icon.is-primary {
  width: 54px;
  height: 54px;
}

.shell-video-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.shell-video-volume {
  width: 110px;
}


.shell-video-center-pulse[hidden] {
  display: none !important;
}

.shell-video-center-pulse {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 3;
}

.shell-video-center-pulse img {
  width: 96px;
  height: 96px;
  padding: 14px;
  border-radius: 999px;
  background: rgba(0,0,0,0.42);
  box-shadow: 0 0 34px rgba(0,0,0,0.75);
}

.shell-video-center-pulse.is-pulsing img {
  animation: shell-video-pulse 520ms ease-out;
}

@keyframes shell-video-pulse {
  0% { transform: scale(0.86); opacity: 0; }
  35% { opacity: 1; }
  100% { transform: scale(1.16); opacity: 0; }
}

.shell-video-player-shell.is-chrome-hidden .shell-video-header,
.shell-video-player-shell.is-chrome-hidden .shell-video-osd {
  opacity: 0;
}

body.has-shell-video-player {
  overflow: hidden;
}

@media (max-width: 760px) {
  .shell-video-header {
    height: 92px;
    padding: calc(12px + env(safe-area-inset-top)) 12px 30px;
  }

  .shell-video-title {
    max-width: 72vw;
    font-size: 20px;
  }

  .shell-video-osd {
    padding: 80px 12px calc(16px + env(safe-area-inset-bottom));
  }

  .shell-video-osd-text {
    margin-bottom: 8px;
  }

  .shell-video-osd h3,
  .shell-video-osd-meta,
  .shell-video-time-extra,
  .shell-video-volume {
    display: none;
  }

  .shell-video-button-row {
    gap: 8px;
    margin-top: 10px;
  }

  .shell-video-time-extra {
    margin-left: auto;
  }

  .shell-video-icon {
    width: 38px;
    height: 38px;
    padding: 3px;
  }

  .shell-video-icon.is-primary {
    width: 48px;
    height: 48px;
  }

  .shell-video-left-buttons,
  .shell-video-right-buttons {
    gap: 4px;
  }
}

/* v0.0.122 — Jellyfin-style video player controls menu */
.shell-video-menu {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 4;
  width: min(380px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 86px));
  overflow: auto;
  border: 1px solid rgba(57,255,20,0.26);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(14,22,24,0.96), rgba(2,4,5,0.94));
  box-shadow: 0 26px 90px rgba(0,0,0,0.72), inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(18px);
  color: #fff;
}

.shell-video-menu[hidden] {
  display: none !important;
}

.shell-video-menu-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.shell-video-menu-kicker {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.shell-video-menu h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.shell-video-menu-close {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background: rgba(0,0,0,0.34);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.shell-video-menu-body {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.shell-video-option {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  background: rgba(255,255,255,0.045);
  color: #fff;
  text-align: left;
  cursor: default;
}

.shell-video-option.is-active {
  border-color: rgba(57,255,20,0.46);
  background: rgba(57,255,20,0.085);
}

.shell-video-option img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(57,255,20,0.22));
}

.shell-video-option strong,
.shell-video-option em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell-video-option strong {
  font-size: 14px;
  font-weight: 900;
}

.shell-video-option em,
.shell-video-option-note {
  color: rgba(255,255,255,0.66);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.shell-video-option-note {
  padding: 3px 4px 0;
  line-height: 1.4;
}

@media (max-width: 760px) {
  .shell-video-menu {
    left: 10px;
    right: 10px;
    bottom: calc(88px + env(safe-area-inset-bottom));
    width: auto;
    max-height: min(620px, calc(100vh - 96px));
    border-radius: 16px;
  }

  .shell-video-right-buttons [data-video-action="settings"] {
    display: inline-flex;
  }

  .shell-video-right-buttons {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .shell-video-right-buttons .shell-video-icon {
    width: 36px;
    height: 36px;
  }
}

/* v0.0.123 — playback speed and stats wiring */
.shell-video-option[data-video-speed],
.shell-video-option[data-video-menu-jump] {
  cursor: pointer;
}

.shell-video-stats-grid {
  display: grid;
  gap: 8px;
}

.shell-video-stats-grid > div {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
}

.shell-video-stats-grid strong {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.shell-video-stats-grid span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255,255,255,0.82);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 760px) {
  .shell-video-stats-grid > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* v0.0.124 — Direct Play audio track menu foundation */
.shell-video-option[data-video-audio-track] {
  cursor: pointer;
}


/* v0.0.129 — HLS quality menu foundation */
.shell-video-option[data-video-quality] {
  cursor: pointer;
}

.shell-video-option[data-video-quality="hls-start"] {
  border-color: rgba(57,255,20,0.32);
}

/* v0.0.130 — Video Player HLS Debug Panel */
.shell-video-debug-head {
  margin: 10px 2px 2px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.shell-video-hls-debug-grid > div.is-wide {
  grid-template-columns: 1fr;
  align-items: start;
  gap: 5px;
}

.shell-video-stats-grid span.shell-video-debug-wrap,
.shell-video-stats-grid span.shell-video-debug-log {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
}

.shell-video-stats-grid span.shell-video-debug-log {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.76);
}


/* v0.0.162 — taller stats/menu panel only */
.shell-video-menu[data-menu-type="stats"] {
  max-height: min(760px, calc(100vh - 86px));
}

@media (max-width: 760px) {
  .shell-video-menu[data-menu-type="stats"] {
    max-height: min(620px, calc(100vh - 96px));
  }
}

/* v0.0.164: hide extra player status text, keep controls visible */
.shell-video-osd-meta,
.shell-video-time-extra {
  display: none !important;
}

/* v0.0.165: ask Firefox/Chromium not to show native video hover overlays */
.shell-video-element::-webkit-media-controls {
  display: none !important;
}

.shell-video-element::-webkit-media-controls-enclosure {
  display: none !important;
}


.shell-youtube-embed {
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.shell-video-player-shell.is-youtube-player .shell-video-element {
  display: none;
}

.shell-video-player-shell.is-youtube-player .shell-video-osd {
  display: none;
}

.shell-video-player-shell.is-youtube-player .shell-video-header {
  pointer-events: none;
}

.shell-video-player-shell.is-youtube-player .shell-video-header .shell-video-icon {
  pointer-events: all;
}

.shell-video-autoplay-button.is-autoplay-off {
  opacity: 0.46;
  filter: grayscale(1);
  border-color: rgba(255,255,255,0.18);
}

.shell-video-autoplay-button.is-autoplay-off::after {
  content: '';
  position: absolute;
  width: 30px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  transform: rotate(-38deg);
  box-shadow: 0 0 10px rgba(0,0,0,0.8);
}

/* v0.0.420 — Player icon tooltips for desktop hover and TV focus */
.shell-video-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  min-width: max-content;
  max-width: 180px;
  padding: 6px 9px;
  border: 1px solid rgba(57,255,20,0.34);
  border-radius: 999px;
  background: rgba(5,8,10,0.92);
  color: #f4fff4;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 30;
  box-shadow: 0 8px 22px rgba(0,0,0,0.42);
  transition: opacity 140ms ease, transform 140ms ease;
}

.shell-video-tooltip::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  width: 8px;
  height: 8px;
  transform: translate(-50%, -4px) rotate(45deg);
  background: rgba(5,8,10,0.92);
  border-right: 1px solid rgba(57,255,20,0.28);
  border-bottom: 1px solid rgba(57,255,20,0.28);
}

.shell-video-icon:hover .shell-video-tooltip,
.shell-video-icon:focus-visible .shell-video-tooltip,
.shell-video-icon:focus .shell-video-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.shell-video-header .shell-video-tooltip {
  bottom: auto;
  top: calc(100% + 10px);
}

.shell-video-header .shell-video-tooltip::after {
  top: auto;
  bottom: 100%;
  transform: translate(-50%, 4px) rotate(45deg);
  border-right: 0;
  border-bottom: 0;
  border-left: 1px solid rgba(57,255,20,0.28);
  border-top: 1px solid rgba(57,255,20,0.28);
}

/* v0.0.430: poster/backdrop HLS seek cover. Hidden stays authoritative so it cannot appear during normal playback. */
.shell-video-seek-frame[hidden],
.shell-video-seek-mask[hidden] {
  display: none !important;
}

.shell-video-seek-frame,
.shell-video-seek-mask {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.shell-video-seek-frame {
  z-index: 2;
  display: none;
}

.shell-video-seek-mask {
  z-index: 3;
  display: block;
  background-color: #000;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  filter: saturate(1.08) contrast(1.04);
  opacity: 1;
  transition: opacity 180ms ease;
}

.shell-video-seek-mask.is-fading {
  opacity: 0;
}

.shell-video-seek-mask::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(0,0,0,0.06), rgba(0,0,0,0.58));
}

.shell-video-seek-mask span {
  display: none;
}

.shell-video-seek-mask.is-waiting span {
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46px;
  height: 46px;
  margin-left: -23px;
  margin-top: -23px;
  border: 4px solid rgba(255,255,255,0.28);
  border-top-color: rgba(255,255,255,0.92);
  border-radius: 999px;
  z-index: 2;
  animation: shell-video-seek-spin 760ms linear infinite;
}

.shell-video-seek-mask.is-fading span,
.shell-video-seek-mask[hidden] span {
  display: none !important;
}

@keyframes shell-video-seek-spin {
  to { transform: rotate(360deg); }
}
