:root {
  color: #ffffff;
  background: #050505;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #050505;
}

button {
  font: inherit;
}

.player-shell {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, rgb(39 39 42 / 65%), transparent 48%),
    #050505;
}

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

.video-meta {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  left: 0;
  padding: max(20px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right))
    56px max(24px, env(safe-area-inset-left));
  pointer-events: none;
  background: linear-gradient(to bottom, rgb(0 0 0 / 75%), transparent);
}

.video-meta h1 {
  max-width: 900px;
  margin: 0;
  overflow: hidden;
  color: rgb(255 255 255 / 92%);
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 600;
  line-height: 1.4;
  text-overflow: ellipsis;
  text-shadow: 0 2px 12px rgb(0 0 0 / 70%);
  white-space: nowrap;
}

.state-panel,
.play-button {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.state-panel {
  width: min(420px, calc(100% - 40px));
  text-align: center;
}

.state-panel h1 {
  margin: 18px 0 8px;
  font-size: clamp(22px, 5vw, 30px);
}

.state-panel p {
  margin: 10px 0 0;
  color: #a1a1aa;
  font-size: 15px;
  line-height: 1.7;
}

.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 16px;
  border: 3px solid rgb(255 255 255 / 16%);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.error-mark {
  display: grid;
  width: 46px;
  height: 46px;
  margin: 0 auto;
  border: 1px solid rgb(248 113 113 / 45%);
  border-radius: 50%;
  place-items: center;
  color: #fca5a5;
  background: rgb(127 29 29 / 25%);
  font-size: 24px;
  font-weight: 700;
}

#retryButton {
  min-width: 112px;
  margin-top: 24px;
  padding: 10px 18px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 999px;
  color: #ffffff;
  background: rgb(255 255 255 / 10%);
  cursor: pointer;
}

#retryButton:hover {
  background: rgb(255 255 255 / 16%);
}

#retryButton:focus-visible,
.play-button:focus-visible {
  outline: 3px solid #60a5fa;
  outline-offset: 4px;
}

.play-button {
  display: grid;
  min-width: 176px;
  padding: 22px 28px 20px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 18px;
  place-items: center;
  color: #ffffff;
  background: rgb(14 14 16 / 82%);
  box-shadow: 0 18px 50px rgb(0 0 0 / 42%);
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.play-button:hover {
  border-color: rgb(255 255 255 / 28%);
  background: rgb(28 28 31 / 90%);
}

.play-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.play-button > span:nth-child(2) {
  margin-top: 14px;
  font-size: 18px;
  font-weight: 650;
}

.play-button small {
  margin-top: 6px;
  color: #a1a1aa;
  font-size: 12px;
}

.play-icon {
  width: 0;
  height: 0;
  margin-left: 5px;
  border-top: 16px solid transparent;
  border-bottom: 16px solid transparent;
  border-left: 25px solid #ffffff;
  filter: drop-shadow(0 3px 8px rgb(0 0 0 / 45%));
}

[hidden] {
  display: none !important;
}

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

@media (max-width: 640px) {
  .video-meta {
    padding-bottom: 42px;
  }

  .play-button {
    min-width: 160px;
    padding: 20px 22px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 1.6s;
  }
}
