:root{--bg:#000;--fg:#fff;--muted:rgba(255,255,255,.78)}
*{box-sizing:border-box}
html,body{height:100%;margin:0;background:var(--bg);color:var(--fg)}
body{overflow:hidden;font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial}
.viewport{position:fixed;inset:0;overflow-y:auto;scroll-snap-type:y mandatory;-webkit-overflow-scrolling:touch;overscroll-behavior-y:contain}
.reel{position:relative;height:100dvh;width:100%;scroll-snap-align:start;background:#000;display:flex;align-items:center;justify-content:center;isolation:isolate}
.video-wrap{position:relative;width:100%;height:100%}
video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;background:#000}
video,.video-wrap,.reel{-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
.overlay-top,.overlay-btm{position:absolute;left:0;right:0;z-index:2;pointer-events:none}
.overlay-top{top:0;height:18vh;background:linear-gradient(to bottom,rgba(0,0,0,.6),transparent)}
.overlay-btm{bottom:0;height:34vh;background:linear-gradient(to top,rgba(0,0,0,.72),transparent)}
.back-btn{position:fixed;top:16px;left:16px;z-index:10;appearance:none;border:0;border-radius:12px;padding:10px 16px;background:rgba(255,255,255,.12);color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:8px;backdrop-filter:blur(6px);transition:transform .12s ease,background .2s ease;-webkit-tap-highlight-color:transparent;text-decoration:none;font-size:14px;font-weight:500;min-height:44px}
.back-btn:hover{background:rgba(255,255,255,.18)}
.back-btn:active{transform:scale(.96)}
.title{position:absolute;left:16px;right:16px;bottom:calc(88px + 72px);z-index:3;pointer-events:none;font-weight:700;line-height:1.3;font-size:clamp(16px,3.8vw,22px);text-shadow:0 1px 2px rgba(0,0,0,.7);transition:opacity .3s ease}
@media(min-width:768px){.title{bottom:72px}}
.controls{position:absolute;left:0;right:0;bottom:calc(88px + 16px);z-index:4;display:flex;align-items:center;gap:10px;padding:0 12px;pointer-events:auto;transition:opacity .3s ease}
.controls.hidden{opacity:0;pointer-events:none}
@media(min-width:768px){.controls{bottom:16px}}
.ctrl-btn{appearance:none;border:0;border-radius:12px;padding:10px;min-width:44px;min-height:44px;background:rgba(255,255,255,.12);color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;backdrop-filter:blur(6px);transition:transform .12s ease;-webkit-tap-highlight-color:transparent}
.ctrl-btn:active{transform:scale(.96)}
.time{font-size:12px;color:var(--muted);user-select:none;width:80px;text-align:center}
.seek{flex:1;display:flex;align-items:center;gap:8px}
.range{-webkit-appearance:none;appearance:none;width:100%;height:4px;border-radius:999px;background:rgba(255,255,255,.25);outline:none}
.range::-webkit-slider-thumb{-webkit-appearance:none;width:14px;height:14px;border-radius:50%;background:#fff;cursor:pointer;box-shadow:0 0 0 2px rgba(0,0,0,.25)}
.range::-moz-range-thumb{width:14px;height:14px;border-radius:50%;background:#fff;cursor:pointer;box-shadow:0 0 0 2px rgba(0,0,0,.25)}
.toast{position:fixed;left:50%;bottom:18px;transform:translateX(-50%);background:rgba(0,0,0,.68);color:#fff;padding:10px 14px;border-radius:12px;font-size:13px;opacity:0;pointer-events:none;transition:opacity .2s ease;z-index:999}
.toast.show{opacity:1}
.empty{height:100dvh;display:flex;align-items:center;justify-content:center;color:#bbb}

/* Modern Buffering Indicator with Dot Animation */
.buffering-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 16px;
  padding: 24px;
  width: 100px;
  height: 100px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  backdrop-filter: blur(8px);
}
.buffering-indicator.active {
  opacity: 1;
}
.buffering-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 8px;
}
.buffering-spinner i {
  width: 8px;
  height: 8px;
  background-color: #fff;
  border-radius: 50%;
  animation: dot-pulse 1.5s infinite ease-in-out;
}
.buffering-spinner i:nth-child(2) {
  animation-delay: 0.2s;
}
.buffering-spinner i:nth-child(3) {
  animation-delay: 0.4s;
}
.buffering-text {
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 1px;
}
@keyframes dot-pulse {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* Lazy loading placeholder */
.lazy-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.lazy-placeholder i {
  color: #444;
  font-size: 40px;
}
