:root { color-scheme: dark; }
html, body {
  margin: 0; padding: 0; height: 100%; background: #000; overflow: hidden;
  -webkit-text-size-adjust: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
/* Faux full screen: the player covers the whole viewport from first paint,
   before any user gesture. Native fullscreen is requested on the first gesture. */
#player {
  position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh;
  object-fit: contain; background: #000; outline: none;
}
/* Fullscreen on the <html> element keeps the overlay available. */
:fullscreen #player, :-webkit-full-screen #player { width: 100%; height: 100%; }

.overlay {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.45); z-index: 10; cursor: pointer;
}
.overlay[hidden], .hint[hidden] { display: none; }
.overlay-btn {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  background: transparent; border: 0; color: #fff; cursor: pointer; padding: 24px;
  -webkit-tap-highlight-color: transparent;
}
.overlay-icon {
  width: 88px; height: 88px; border-radius: 50%; background: rgba(255, 255, 255, 0.95);
  position: relative; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.overlay-icon::after {
  content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-42%, -50%);
  border-left: 30px solid #000; border-top: 18px solid transparent; border-bottom: 18px solid transparent;
}
.overlay.is-unmute .overlay-icon::after {
  transform: translate(-50%, -50%); border: 0; width: 34px; height: 34px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M3 9v6h4l5 5V4L7 9H3zm13.5 3A4.5 4.5 0 0 0 14 7.97v8.05A4.47 4.47 0 0 0 16.5 12zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.overlay.is-replay .overlay-icon::after {
  transform: translate(-50%, -50%); border: 0; width: 36px; height: 36px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.overlay-text { font-size: 18px; font-weight: 600; letter-spacing: 0.01em; text-shadow: 0 2px 8px rgba(0,0,0,.6); }

.hint {
  position: fixed; left: 50%; top: max(16px, env(safe-area-inset-top)); transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 14px; padding: 8px 14px; border-radius: 999px;
  z-index: 9; pointer-events: none; animation: hint-fade 6s ease forwards;
}
@keyframes hint-fade { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }

/* ---------------- "Video not found" screen ---------------- */
.nf { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  color: #fff; background: #07090c; overflow: hidden; padding: 24px 16px; box-sizing: border-box; }
.nf[hidden] { display: none; }
.nf-bg { position: absolute; inset: -40%;
  background:
    radial-gradient(40% 40% at 30% 35%, rgba(0, 143, 92, 0.45), transparent 70%),
    radial-gradient(35% 35% at 70% 65%, rgba(28, 92, 200, 0.40), transparent 70%),
    radial-gradient(30% 30% at 60% 25%, rgba(150, 60, 190, 0.30), transparent 70%);
  filter: blur(40px); animation: nf-drift 18s ease-in-out infinite alternate; }
.nf-card { position: relative; text-align: center; max-width: 440px; }
.nf-art { position: relative; width: 200px; height: 200px; margin: 0 auto 28px; animation: nf-float 5s ease-in-out infinite; }
.nf-art svg { width: 100%; height: 100%; overflow: visible; }
.nf-ring { fill: none; stroke: rgba(255, 255, 255, 0.35); stroke-width: 2; stroke-dasharray: 6 10; stroke-linecap: round;
  transform-origin: 100px 100px; animation: nf-spin 16s linear infinite; }
.nf-disc { fill: rgba(255, 255, 255, 0.08); stroke: rgba(255, 255, 255, 0.5); stroke-width: 1.5;
  transform-origin: 100px 100px; animation: nf-pulse 3.2s ease-in-out infinite; }
.nf-play { fill: #fff; opacity: 0.92; transform-origin: 100px 100px; animation: nf-pulse 3.2s ease-in-out infinite; }
.nf-slash { stroke: #ff5a5f; stroke-width: 8; stroke-linecap: round; stroke-dasharray: 120; stroke-dashoffset: 120;
  filter: drop-shadow(0 0 10px rgba(255, 90, 95, 0.7)); animation: nf-draw 0.9s cubic-bezier(.2,.8,.2,1) 0.5s forwards; }
.nf-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #fff; opacity: 0;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.9); animation: nf-twinkle 4s ease-in-out infinite; }
.nf-dot-1 { left: -6%; top: 22%; animation-delay: 0.3s; }
.nf-dot-2 { right: -8%; top: 40%; width: 7px; height: 7px; animation-delay: 1.6s; }
.nf-dot-3 { left: 20%; bottom: -8%; width: 6px; height: 6px; animation-delay: 2.7s; }
.nf-title { font-size: clamp(28px, 6vw, 40px); font-weight: 700; letter-spacing: -0.01em; margin: 0 0 12px;
  opacity: 0; animation: nf-rise 0.7s ease 0.35s forwards; }
.nf-text { font-size: 16px; line-height: 1.55; color: rgba(255, 255, 255, 0.78); margin: 0 0 18px;
  opacity: 0; animation: nf-rise 0.7s ease 0.55s forwards; }
.nf-code { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255, 255, 255, 0.45); margin: 0;
  opacity: 0; animation: nf-rise 0.7s ease 0.75s forwards; }

@keyframes nf-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes nf-spin { to { transform: rotate(360deg); } }
@keyframes nf-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes nf-draw { to { stroke-dashoffset: 0; } }
@keyframes nf-twinkle { 0%, 100% { opacity: 0; transform: translateY(0) scale(0.6); } 50% { opacity: 1; transform: translateY(-14px) scale(1); } }
@keyframes nf-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes nf-drift { from { transform: translate(-4%, -3%) rotate(0deg); } to { transform: translate(4%, 3%) rotate(8deg); } }

@media (prefers-reduced-motion: reduce) {
  .nf-bg, .nf-art, .nf-ring, .nf-disc, .nf-play, .nf-dot { animation: none; }
  .nf-slash { stroke-dashoffset: 0; animation: none; }
  .nf-title, .nf-text, .nf-code { opacity: 1; animation: none; }
}
