:root {
  color-scheme: dark;
  --bg: #090b10;
  --panel: #11151d;
  --line: #252b37;
  --text: #f5f7fb;
  --muted: #9aa4b5;
  --red: #f22f46;
  --blue: #4387ff;
}
* {
  box-sizing: border-box;
}
html,
body {
  width: 100%;
  height: 100%;
}
body {
  margin: 0;
  overflow: hidden;
  background: radial-gradient(circle at 50% -15%, #1a2130 0, #090b10 45%);
  color: var(--text);
  font:
    16px/1.5 Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
.page {
  display: grid;
  width: 100%;
  height: 100dvh;
  padding: 16px;
  place-items: center;
}
.watch {
  width: min(calc(100vw - 32px), calc(177.7778vh - 56.8889px));
  width: min(calc(100vw - 32px), calc(177.7778dvh - 56.8889px));
  aspect-ratio: 16 / 9;
}
.player-shell {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  min-height: 0;
  border: 1px solid #252a34;
  border-radius: 16px;
  background: #000;
  box-shadow: 0 28px 80px #0008;
}
video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.loading,
.error-panel {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  background: #05070bd9;
  backdrop-filter: blur(4px);
}
.loading[hidden],
.error-panel[hidden] {
  display: none;
}
.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #ffffff2b;
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}
.loading {
  color: #d6dbe5;
  font-size: 0.9rem;
}
.error-panel {
  text-align: center;
  padding: clamp(24px, 5vw, 64px);
  direction: rtl;
  background:
    radial-gradient(circle at 50% 35%, #0f292b 0, transparent 40%),
    linear-gradient(145deg, #080a0fef, #05060aef);
}
.error-panel::before {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0.16;
  pointer-events: none;
  background-image:
    linear-gradient(30deg, #fff 1px, transparent 1px),
    linear-gradient(150deg, #fff 1px, transparent 1px);
  background-size: 54px 94px;
  mask-image: radial-gradient(circle, #000, transparent 66%);
}
.offline-art {
  position: relative;
  display: grid;
  width: clamp(92px, 11vw, 138px);
  aspect-ratio: 1;
  place-items: center;
  margin-bottom: 4px;
}
.offline-art svg {
  position: relative;
  z-index: 2;
  width: 72%;
  filter: drop-shadow(0 16px 30px #43d9c74a);
}
.signal-ring {
  position: absolute;
  inset: 5%;
  border: 1px solid #43d9c75c;
  border-radius: 50%;
}
.signal-ring-one { animation: signal 2.4s ease-out infinite; }
.signal-ring-two { animation: signal 2.4s 1.2s ease-out infinite; }
.offline-copy {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 8px;
}
.offline-label {
  color: #43d9c7;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.channel-name {
  color: #f8fafc !important;
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 800;
}
.offline-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 3px;
  color: #7f8999 !important;
  font-size: 0.76rem;
}
.mini-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid #ffffff22;
  border-top-color: #43d9c7;
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}
.error-panel strong {
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.25;
}
.error-panel span {
  color: var(--muted);
}
.youtube-chip {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  padding: 7px 12px;
  border: 1px solid #ff566459;
  border-radius: 999px;
  background: #ff2d4121;
  color: #ffd8dc;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease;
}
.youtube-chip svg {
  width: 18px;
  fill: #ff4b5f;
}
.youtube-chip span { color: inherit; }
.youtube-chip:hover {
  border-color: #ff6d78a6;
  background: #ff2d4133;
}
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes signal {
  from { opacity: 0.8; transform: scale(0.72); }
  to { opacity: 0; transform: scale(1.22); }
}
@media (max-width: 700px) {
  .page {
    padding: 8px;
  }
  .watch {
    width: min(calc(100vw - 16px), calc(177.7778vh - 28.4444px));
    width: min(calc(100vw - 16px), calc(177.7778dvh - 28.4444px));
  }
  .player-shell {
    border-radius: 10px;
    min-height: unset;
  }
}
