:root {
  --vh: 1vh;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  touch-action: none;
  -webkit-overflow-scrolling: none;
  overscroll-behavior: none;
}

#app {
  width: 100vw;
  height: calc(var(--vh, 1vh) * 100);
  overflow: hidden;
  position: relative;
}

#video-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

#video-container.no-transition {
  transition: none;
}

.video-slide {
  width: 100vw;
  height: calc(var(--vh, 1vh) * 100);
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.video-slide video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* Loading spinner */
.slide-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.3s;
}

.slide-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Error overlay */
.slide-error {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.6);
  z-index: 3;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.slide-error span {
  font-size: 14px;
  opacity: 0.8;
}

.slide-error button {
  padding: 8px 24px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.slide-error button:active {
  background: rgba(255, 255, 255, 0.2);
}

/* Mute button */
#mute-btn {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s;
}

#mute-btn:active {
  background: rgba(255, 255, 255, 0.3);
}

/* Swipe hint */
#swipe-hint {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 80px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: rgba(255, 255, 255, 0.7);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  z-index: 10;
  animation: hintBounce 1.5s ease-in-out infinite;
  transition: opacity 0.5s;
  pointer-events: none;
}

#swipe-hint.hidden {
  opacity: 0;
}

@keyframes hintBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-8px); }
}
