:root {
  --bg: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --soft: #f8fafc;
  --purple: #6d4fc7;
  --purple2: #8b6fd4;
  --purple3: #5a3fb0;
  --purple-glow: rgba(124, 92, 191, 0.12);
  --radius: 16px;
  --font: "Segoe UI", ui-sans-serif, system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}

html.guard-lock body {
  filter: blur(12px);
  pointer-events: none;
  user-select: none;
}

html.guard-lock::after {
  content: "Protected view";
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  font-family: var(--font);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  background: rgba(15, 23, 42, 0.72);
  pointer-events: auto;
}

body {
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.28;
  pointer-events: none;
  z-index: 0;
}

body::before {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, #c4b5fd 0%, transparent 70%);
  top: -120px;
  right: -100px;
}

body::after {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #93c5fd 0%, transparent 70%);
  bottom: -100px;
  left: -80px;
}

a { color: inherit; text-decoration: none; }

.wrap {
  position: relative;
  z-index: 1;
  width: min(1200px, 94vw);
  margin: 0 auto;
  padding: 32px 0 80px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 40px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  height: 42px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-text strong {
  font-size: 1.08rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.brand-text span {
  font-size: 0.82rem;
  color: var(--muted);
}

.hero {
  margin-bottom: 32px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 2.8vw, 2.5rem);
  letter-spacing: -0.03em;
  font-weight: 760;
  line-height: 1.15;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 52ch;
  font-size: 1.05rem;
  line-height: 1.55;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow:
    0 1px 0 #fff inset,
    0 10px 24px rgba(15, 23, 42, 0.05),
    0 4px 10px var(--purple-glow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: #c4b5fd;
  box-shadow:
    0 1px 0 #fff inset,
    0 16px 32px rgba(15, 23, 42, 0.08),
    0 8px 18px rgba(109, 79, 199, 0.16);
}

.thumb-wrap {
  position: relative;
  background: #0f172a;
}

.thumb-wrap img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.play-badge {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, transparent 45%, rgba(15, 23, 42, 0.3));
}

.play-badge span {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(180deg, var(--purple2), var(--purple), var(--purple3));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 8px 16px rgba(90, 63, 176, 0.35);
  font-size: 13px;
  padding-left: 2px;
}

.meta {
  padding: 14px 14px 16px;
  background: var(--soft);
  min-height: 64px;
}

.meta h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.back {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  transition: color 0.15s;
}

.back:hover { color: var(--purple); }

.watch-shell {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  padding: 14px;
  box-shadow:
    0 1px 0 #fff inset,
    0 18px 36px rgba(15, 23, 42, 0.07),
    0 6px 14px var(--purple-glow);
  max-width: 960px;
}

.player-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #0b1020;
}

.player-box iframe,
#mediaFrame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  transform: none;
  pointer-events: none;
}

.player-loader {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  gap: 18px;
  background:
    radial-gradient(circle at 50% 40%, rgba(139, 111, 212, 0.35), transparent 55%),
    linear-gradient(160deg, rgba(15, 23, 42, 0.92), rgba(90, 63, 176, 0.78));
  backdrop-filter: blur(8px);
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.player-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-orbit {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto;
}

.loader-orbit .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
}

.loader-orbit .ring-a {
  border-top-color: #c4b5fd;
  border-right-color: rgba(196, 181, 253, 0.35);
  animation: spinA 1s linear infinite;
}

.loader-orbit .ring-b {
  inset: 10px;
  border-bottom-color: #38bdf8;
  border-left-color: rgba(56, 189, 248, 0.35);
  animation: spinB 1.35s linear infinite;
}

.loader-orbit .core {
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  background: linear-gradient(180deg, #8b6fd4, #5a3fb0);
  box-shadow: 0 0 24px rgba(109, 79, 199, 0.65);
  animation: pulseCore 1.2s ease-in-out infinite;
}

.loader-text {
  margin: 0;
  text-align: center;
  color: #e2e8f0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.unmute-btn {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 6;
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(180deg, #8b6fd4 0%, #6d4fc7 45%, #5a3fb0 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.3) inset,
    0 8px 18px rgba(90, 63, 176, 0.4);
  pointer-events: auto;
}

.unmute-btn[hidden] { display: none; }

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

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

@keyframes pulseCore {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.86); opacity: 0.75; }
}

.watch-title {
  margin: 20px 0 0;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  max-width: 960px;
}

.empty {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--soft);
  position: relative;
  z-index: 2;
}

@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 800px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .wrap { padding: 24px 0 56px; }
}

@media (max-width: 520px) {
  .grid { grid-template-columns: 1fr; }
  .brand img { height: 34px; }
  .hero h1 { font-size: 1.55rem; }
  .watch-shell { padding: 8px; }
}
