:root {
  --glp-edge: 14px;
  --glp-youtube-red: #ff0033;
  --glp-bg: rgba(20, 20, 20, 0.96);
  --glp-surface: rgba(36, 36, 36, 0.88);
  --glp-line: rgba(255, 255, 255, 0.14);
  --glp-text: #f8f8f8;
  --glp-subtle: rgba(255, 255, 255, 0.64);
}

#globalLivePlayer {
  position: fixed;
  right: var(--glp-edge);
  bottom: var(--glp-edge);
  width: min(480px, calc(100vw - 24px));
  z-index: 9999;
  border: 1px solid var(--glp-line);
  border-radius: 16px;
  background: var(--glp-bg);
  color: var(--glp-text);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
}

.glp-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px;
}

.glp-left {
  min-width: 0;
}

.glp-viewport {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--glp-line);
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
  max-height: 240px;
}

.glp-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  background: #000;
}

#globalLivePlayer.is-video .glp-media {
  object-fit: contain;
  margin: auto;
}

.glp-audio-label {
  position: absolute;
  inset: auto 6px 6px 6px;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.64);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#globalLivePlayer.is-video .glp-audio-label {
  display: none;
}

#globalLivePlayer.is-audio .glp-media {
  filter: saturate(0.2) brightness(0.65);
}

#globalLivePlayer.is-audio .glp-left {
  display: none;
}

#globalLivePlayer.is-audio .glp-shell {
  grid-template-columns: 1fr;
}

#globalLivePlayer.is-video .glp-left {
  display: block;
}

.glp-main {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.glp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.glp-row-video-actions {
  display: none;
}

.glp-video-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-wrap: wrap;
}

.glp-meta,
.glp-actions,
.glp-row-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.glp-pill,
.glp-btn,
.glp-time {
  font-family: "Trebuchet MS", Arial, sans-serif;
}

.glp-pill {
  border-radius: 999px;
  border: 1px solid var(--glp-line);
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.95);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 4px 7px;
}

.glp-pill.live {
  color: #ffd5dc;
  border-color: rgba(255, 53, 87, 0.78);
  background: rgba(255, 0, 51, 0.28);
}

.glp-pill.audio {
  color: #ffe3bf;
  border-color: rgba(255, 170, 71, 0.78);
  background: rgba(255, 142, 31, 0.28);
}

.glp-pill.video {
  color: #d8e8ff;
  border-color: rgba(87, 152, 255, 0.78);
  background: rgba(40, 117, 255, 0.3);
}

.glp-pill-live {
  color: #d5ffe0;
  border-color: rgba(53, 196, 112, 0.8);
  background: rgba(37, 166, 94, 0.32);
}

.glp-title-wrap {
  min-width: 0;
}

.glp-title-wrap strong {
  display: block;
  font-size: 12px;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
}

.glp-title-wrap small {
  margin-top: 2px;
  display: block;
  color: var(--glp-subtle);
  font-size: 10px;
}

.glp-status {
  min-height: 12px;
  visibility: hidden;
}

.glp-status.active {
  visibility: visible;
}

.glp-btn {
  border-radius: 999px;
  border: 1px solid var(--glp-line);
  background: var(--glp-surface);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 6px 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.glp-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 10px;
  line-height: 1;
}

.glp-btn-text {
  line-height: 1;
}

.glp-btn:hover {
  border-color: rgba(255, 255, 255, 0.34);
}

.glp-btn:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.24);
}

.glp-video-only {
  display: none;
}

#globalLivePlayer.is-video .glp-video-only {
  display: inline-flex;
}

#globalLivePlayer.is-video .glp-row-video-actions {
  display: flex;
}

#glpJoin {
  border-color: var(--glp-line);
  background: var(--glp-surface);
}

.glp-control {
  min-width: 56px;
}

.glp-time {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.84);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.glp-volume {
  width: 92px;
}

.glp-actions {
  margin-left: auto;
}

.glp-meta {
  flex: 1 1 auto;
}

.glp-row-controls {
  width: 100%;
}

.glp-progress-wrap {
  position: relative;
  height: 16px;
}

.glp-error {
  min-height: 14px;
  color: #ff7e96;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 10px;
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.glp-error.active {
  opacity: 1;
}

.glp-progress {
  position: absolute;
  inset: 5px 0 auto 0;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--glp-youtube-red) 0 0%, rgba(255, 255, 255, 0.22) 0% 100%);
  pointer-events: none;
}

.glp-seek {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 16px;
  opacity: 1;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
}

.glp-seek::-webkit-slider-runnable-track {
  height: 16px;
  background: transparent;
}

.glp-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 3px;
  height: 14px;
  margin-top: 1px;
  border: 0;
  border-radius: 999px;
  background: #fff;
}

.glp-seek::-moz-range-track {
  height: 16px;
  background: transparent;
  border: 0;
}

.glp-seek::-moz-range-thumb {
  width: 3px;
  height: 14px;
  border: 0;
  border-radius: 999px;
  background: #fff;
}

.glp-seek:disabled {
  cursor: not-allowed;
}

body.has-global-live-player {
  padding-bottom: 0;
}

body.has-global-live-player.glp-hidden {
  padding-bottom: 0;
}

#globalLivePlayer.video-large {
  width: min(860px, calc(100vw - 24px));
}

#globalLivePlayer.video-large .glp-shell {
  grid-template-columns: 1fr;
}

#globalLivePlayer.video-large .glp-viewport {
  max-height: 420px;
}

#globalLivePlayer:fullscreen,
#globalLivePlayer.is-fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  background: #000;
  border: 0;
  border-radius: 0;
  inset: 0;
}

#globalLivePlayer:fullscreen .glp-shell,
#globalLivePlayer.is-fullscreen .glp-shell {
  position: relative;
  height: 100%;
  display: block;
  padding: 0;
}

#globalLivePlayer:fullscreen .glp-left,
#globalLivePlayer:fullscreen .glp-main,
#globalLivePlayer.is-fullscreen .glp-left,
#globalLivePlayer.is-fullscreen .glp-main {
  min-height: 0;
}

#globalLivePlayer:fullscreen .glp-left,
#globalLivePlayer.is-fullscreen .glp-left {
  height: 100%;
}

#globalLivePlayer:fullscreen .glp-main,
#globalLivePlayer.is-fullscreen .glp-main {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 5;
  max-width: min(980px, calc(100vw - 32px));
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(10, 10, 10, 0.22), rgba(10, 10, 10, 0.72));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#globalLivePlayer:fullscreen .glp-viewport,
#globalLivePlayer.is-fullscreen .glp-viewport {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
}

#globalLivePlayer:fullscreen .glp-media,
#globalLivePlayer.is-fullscreen .glp-media {
  object-fit: contain;
}

#globalLivePlayer:fullscreen.controls-idle,
#globalLivePlayer.is-fullscreen.controls-idle {
  cursor: none;
}

#globalLivePlayer:fullscreen.controls-idle .glp-main,
#globalLivePlayer.is-fullscreen.controls-idle .glp-main {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

#globalLivePlayer:fullscreen #glpTheater,
#globalLivePlayer:fullscreen #glpJoin,
#globalLivePlayer:fullscreen #glpHide,
#globalLivePlayer.is-fullscreen #glpTheater,
#globalLivePlayer.is-fullscreen #glpJoin,
#globalLivePlayer.is-fullscreen #glpHide {
  display: none !important;
}

#globalLivePlayer.hidden {
  display: none;
}

.glp-show-btn {
  position: fixed;
  right: var(--glp-edge);
  bottom: var(--glp-edge);
  z-index: 10000;
  display: none;
  border: 1px solid rgba(255, 0, 51, 0.58);
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.95);
  color: #ffe3e9;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 9px 11px;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.glp-show-btn.visible {
  display: inline-flex;
  align-items: center;
}

.glp-show-btn.is-playing {
  border-color: rgba(53, 196, 112, 0.78);
  color: #d5ffe0;
}

@media (max-width: 1024px) {
  #globalLivePlayer {
    width: min(640px, calc(100vw - 20px));
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
  }

  #globalLivePlayer.video-large {
    width: min(92vw, 760px);
  }

  #globalLivePlayer.video-large .glp-viewport {
    max-height: 360px;
  }
}

@media (max-width: 720px) {
  #globalLivePlayer {
    width: auto;
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
  }

  .glp-shell {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
  }

  .glp-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    gap: 8px;
  }

  .glp-row-controls {
    gap: 7px;
  }

  .glp-control {
    min-width: 0;
    flex: 1 1 calc(50% - 5px);
    justify-content: center;
  }

  .glp-time {
    display: block;
    width: 100%;
    margin-left: 0;
    text-align: right;
    font-size: 9px;
    letter-spacing: 0.06em;
  }

  .glp-volume {
    width: 100%;
    min-width: 120px;
    flex: 1 1 100%;
  }

  .glp-btn {
    min-height: 42px;
    padding: 9px 10px;
    font-size: 10px;
  }

  .glp-actions .glp-btn {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
  }

  .glp-seek::-webkit-slider-thumb {
    width: 7px;
  }

  .glp-seek::-moz-range-thumb {
    width: 7px;
  }

}
