:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --background: #07090f;
  --panel: #0d111b;
  --panel-raised: #121827;
  --text: #f4f7ff;
  --muted: #8f9bb1;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #6ee7f2;
  --accent-strong: #37cddd;
  --violet: #8b7bff;
  --danger: #ff7285;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--background);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -20%, rgba(81, 112, 182, 0.16), transparent 42%),
    linear-gradient(180deg, #090c14 0%, var(--background) 72%);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.ambient {
  position: fixed;
  z-index: 0;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  opacity: 0.1;
  filter: blur(110px);
  pointer-events: none;
}

.ambient-one {
  top: 14%;
  left: -18rem;
  background: var(--accent);
}

.ambient-two {
  right: -18rem;
  bottom: 4%;
  background: var(--violet);
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 112px;
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(110, 231, 242, 0.34);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(110, 231, 242, 0.16), rgba(139, 123, 255, 0.12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.brand-mark::after {
  position: absolute;
  width: 8px;
  height: 8px;
  content: "";
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent);
}

.brand-mark span {
  position: absolute;
  width: 19px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--violet));
}

.brand-mark span:first-child {
  transform: translateY(-7px) rotate(34deg);
}

.brand-mark span:last-child {
  transform: translateY(7px) rotate(-34deg);
}

.brand-copy {
  display: grid;
  line-height: 1;
}

.brand-copy strong {
  font-size: 1rem;
  font-weight: 680;
  letter-spacing: -0.02em;
}

.brand-copy small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 570;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.quality-pill {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #b8c2d4;
  background: rgba(15, 20, 31, 0.72);
  font-size: 0.72rem;
  font-weight: 630;
  letter-spacing: 0.04em;
  backdrop-filter: blur(12px);
}

.quality-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 9px rgba(110, 231, 242, 0.85);
}

.player-section {
  padding: 22px 0 36px;
}

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: #030407;
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.55),
    0 8px 28px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  isolation: isolate;
}

.video-frame::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22);
  pointer-events: none;
}

.video-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #020305;
}

.video-placeholder {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  background:
    radial-gradient(circle at center, rgba(63, 83, 124, 0.16), transparent 38%),
    #05070c;
  transition: opacity 240ms ease;
}

.video-placeholder.is-hidden {
  visibility: hidden;
  opacity: 0;
}

.placeholder-logo {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(110, 231, 242, 0.26);
  border-radius: 17px;
  color: var(--accent);
  background: rgba(110, 231, 242, 0.06);
  font-size: 0.9rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  box-shadow: 0 0 50px rgba(110, 231, 242, 0.08);
}

.video-placeholder p {
  margin: 18px 0 0;
  color: #758096;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.center-play {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  display: grid;
  width: 76px;
  height: 76px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  background: rgba(10, 14, 23, 0.72);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(14px);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.center-play:hover {
  border-color: rgba(110, 231, 242, 0.72);
  background: rgba(14, 22, 32, 0.9);
  transform: translate(-50%, -50%) scale(1.05);
}

.center-play svg {
  width: 30px;
  height: 30px;
  margin-left: 4px;
  fill: #fff;
}

.loading-indicator {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  padding: 5px;
  border-radius: 50%;
  background: rgba(5, 7, 12, 0.52);
  transform: translate(-50%, -50%);
  backdrop-filter: blur(8px);
}

.loading-indicator span {
  display: block;
  width: 100%;
  height: 100%;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 750ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.error-panel {
  position: absolute;
  z-index: 7;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 28px;
  text-align: center;
  background: rgba(5, 7, 12, 0.97);
}

.error-icon {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  place-items: center;
  border: 1px solid rgba(255, 114, 133, 0.32);
  border-radius: 50%;
  color: var(--danger);
  background: rgba(255, 114, 133, 0.08);
  font-weight: 750;
}

.error-panel h2 {
  margin: 0;
  font-size: clamp(1.1rem, 3vw, 1.45rem);
  letter-spacing: -0.025em;
}

.error-panel p {
  max-width: 470px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.controls {
  position: absolute;
  z-index: 6;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 70px 22px 17px;
  background: linear-gradient(transparent, rgba(2, 3, 5, 0.9));
  opacity: 1;
  transition: opacity 220ms ease;
}

.video-frame.controls-hidden .controls,
.video-frame.controls-hidden .center-play {
  opacity: 0;
  pointer-events: none;
}

.timeline-wrap {
  display: flex;
  align-items: center;
  height: 18px;
}

.timeline,
.volume-slider {
  margin: 0;
  appearance: none;
  outline: none;
  cursor: pointer;
}

.timeline {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background:
    linear-gradient(to right, var(--accent) 0 var(--played, 0%), transparent var(--played, 0%)),
    linear-gradient(to right, rgba(255, 255, 255, 0.35) 0 var(--buffered, 0%), rgba(255, 255, 255, 0.16) var(--buffered, 0%));
  transition: height 120ms ease;
}

.timeline:hover,
.timeline:focus-visible {
  height: 6px;
}

.timeline::-webkit-slider-thumb,
.volume-slider::-webkit-slider-thumb {
  width: 13px;
  height: 13px;
  appearance: none;
  border: 0;
  border-radius: 50%;
  background: #f7fbff;
  box-shadow: 0 1px 7px rgba(0, 0, 0, 0.45);
}

.timeline::-moz-range-thumb,
.volume-slider::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 0;
  border-radius: 50%;
  background: #f7fbff;
  box-shadow: 0 1px 7px rgba(0, 0, 0, 0.45);
}

.control-row {
  display: flex;
  gap: 7px;
  align-items: center;
  min-height: 40px;
}

.icon-button,
.text-button {
  display: grid;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  transition: background 140ms ease;
}

.icon-button {
  width: 38px;
}

.text-button {
  min-width: 38px;
  padding: 0 8px;
  color: #eef3fb;
  font-size: 0.74rem;
  font-weight: 690;
}

.icon-button:hover,
.text-button:hover,
.icon-button:focus-visible,
.text-button:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.11);
}

.icon-button svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.icon-pause,
.icon-muted,
.icon-collapse,
.is-playing .icon-play,
.is-muted .icon-volume,
.is-fullscreen .icon-expand {
  display: none;
}

.is-playing .icon-pause,
.is-muted .icon-muted,
.is-fullscreen .icon-collapse {
  display: block;
}

.volume-control {
  display: flex;
  align-items: center;
}

.volume-slider {
  width: 72px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(to right, #f5f7fc 0 var(--volume, 100%), rgba(255, 255, 255, 0.22) var(--volume, 100%));
}

.time-display {
  display: flex;
  gap: 6px;
  min-width: 96px;
  margin-left: 4px;
  color: #eef3fb;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  font-weight: 570;
}

.time-divider {
  color: #7d8798;
}

.source-badge {
  margin-left: auto;
  padding: 4px 7px;
  border: 1px solid rgba(110, 231, 242, 0.25);
  border-radius: 5px;
  color: var(--accent);
  background: rgba(110, 231, 242, 0.08);
  font-size: 0.57rem;
  font-weight: 760;
  letter-spacing: 0.09em;
}

.video-details {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 28px 3px 0;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 720;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.video-details h1 {
  margin: 0;
  font-size: clamp(1.35rem, 3.4vw, 2rem);
  font-weight: 650;
  letter-spacing: -0.035em;
}

.video-meta {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.74rem;
}

footer {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 34px 0 48px;
  border-top: 1px solid var(--line);
  color: #687389;
  font-size: 0.69rem;
  letter-spacing: 0.03em;
}

footer strong {
  color: #9ba7ba;
  font-weight: 600;
}

[hidden] {
  display: none !important;
}

@media (max-width: 680px) {
  .page-shell {
    width: min(100% - 24px, 1180px);
  }

  .site-header {
    min-height: 86px;
  }

  .brand-copy small {
    display: none;
  }

  .quality-pill {
    padding: 7px 9px;
    font-size: 0.64rem;
  }

  .player-section {
    padding-top: 8px;
  }

  .video-frame {
    border-radius: 12px;
  }

  .controls {
    padding: 46px 10px 8px;
  }

  .control-row {
    gap: 1px;
  }

  .icon-button {
    width: 34px;
  }

  .volume-slider,
  .source-badge,
  #pip-toggle {
    display: none;
  }

  .time-display {
    min-width: 82px;
    margin-left: 0;
    font-size: 0.65rem;
  }

  #speed-toggle {
    margin-left: auto;
  }

  .center-play {
    width: 58px;
    height: 58px;
  }

  .center-play svg {
    width: 25px;
    height: 25px;
  }

  .video-details {
    display: block;
    padding-top: 21px;
  }

  .video-meta {
    margin-top: 9px;
  }

  footer {
    flex-direction: column;
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
