* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  max-width: 100vw;
  background-color: #000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow-x: hidden;
  overflow-y: hidden;
}

/* Header: Completely hidden on Mobile */
.app-header {
  display: none !important;
}

/* Vertical Fullscreen Container */
.app-feed {
  height: 100vh;
  width: 100vw;
  overflow-x: hidden;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  
  /* Hide Scrollbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.app-feed::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* Prevent feed scrolling while holding 2x speed */
.app-feed.no-scroll {
  overflow-y: hidden !important;
}

/* Individual Video Screen */
.video-card {
  position: relative;
  height: 100vh;
  width: 100vw;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #000;
  overflow: hidden;
}

/* Base Video Styling */
.video-card video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
}

/* Pause Indicator Icon */
.pause-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 72px;
  height: 72px;
  background-color: rgba(0, 0, 0, 0.55);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 25;
  pointer-events: none;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.pause-indicator::before {
  content: '';
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 14px 0 14px 24px;
  border-color: transparent transparent transparent #ffffff;
  margin-left: 4px;
}

.video-card.paused .pause-indicator {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Resume Flash Indicator (|| Icon) */
.resume-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  width: 72px;
  height: 72px;
  background-color: rgba(0, 0, 0, 0.55);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  z-index: 26;
  pointer-events: none;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.resume-indicator::before,
.resume-indicator::after {
  content: '';
  width: 6px;
  height: 24px;
  background-color: #ffffff;
  border-radius: 2px;
}

.video-card.resumed .resume-indicator {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

/* Unmute Banner (Shown permanently until unmuted) */
.unmute-badge {
  position: absolute;
  top: 30px;
  background-color: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 0.9rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
  z-index: 35;
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* 2x Speed Pill Banner */
.speed-badge {
  position: absolute;
  top: 50px;
  background-color: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  backdrop-filter: blur(6px);
  z-index: 30;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.speed-badge.visible {
  opacity: 1;
}

/* Text Overlay */
.overlay {
  position: absolute;
  bottom: 50px;
  left: 16px;
  right: 16px;
  color: #ffffff;
  pointer-events: none;
  z-index: 10;
  text-shadow: 0px 2px 8px rgba(0, 0, 0, 0.9);
  filter: drop-shadow(0px 2px 6px rgba(0, 0, 0, 0.8));
  opacity: 1;
  transition: opacity 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.video-card.speed-active .overlay {
  opacity: 0;
}

.overlay h3 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.overlay p {
  font-size: 0.95rem;
  opacity: 0.9;
}

/* Double-Tap Floating Heart */
.heart-effect {
  position: absolute;
  width: 90px;
  height: 90px;
  pointer-events: none;
  z-index: 40;
  transform: translate(-50%, -50%) scale(0) rotate(-10deg);
  opacity: 0;
  filter: drop-shadow(0px 4px 12px rgba(0, 0, 0, 0.35));
  animation: heartPop 0.8s ease-out forwards;
}

.heart-effect svg {
  width: 100%;
  height: 100%;
}

@keyframes heartPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0) rotate(-12deg);
  }
  15% {
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(1.3) rotate(0deg);
  }
  30% {
    transform: translate(-50%, -50%) scale(1) rotate(-5deg);
  }
  70% {
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(1.05) translateY(-20px) rotate(5deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8) translateY(-40px) rotate(10deg);
  }
}

/* PROGRESS BAR (Lifted slightly up) */
.progress-container {
  position: absolute;
  bottom: 48px;
  left: 0;
  width: 100%;
  height: 24px;
  display: flex;
  align-items: flex-end;
  cursor: pointer;
  z-index: 20;
}

.progress-container::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: rgba(255, 255, 255, 0.3);
  transition: height 0.15s ease;
}

.progress-bar {
  position: relative;
  height: 3px;
  width: 0%;
  background-color: #FE2C55;
  transition: height 0.15s ease;
}

.progress-bar::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%) scale(0.6);
  width: 12px;
  height: 12px;
  background-color: #FE2C55;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.progress-container:hover::before,
.progress-container.active::before,
.progress-container:hover .progress-bar,
.progress-container.active .progress-bar {
  height: 5px;
}

.progress-container:hover .progress-bar::after,
.progress-container.active .progress-bar::after {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

/* DESKTOP & TABLET */
@media (min-aspect-ratio: 9/16) {
  .app-header {
    display: block !important;
    position: fixed;
    top: 24px;
    left: 32px;
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    z-index: 100;
    pointer-events: none;
  }

  .video-card video {
    object-fit: contain;
    max-width: 450px;
    height: calc(100vh - 40px);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.08);
  }

  .overlay {
    bottom: 50px;
    left: calc(50% - 240px);
    transform: translateX(-100%);
    right: auto;
    width: 250px;
    max-width: none;
    text-align: right;
    padding-right: 20px;
  }

  .video-card.speed-active .overlay {
    opacity: 1;
  }

  .progress-container {
    width: 450px;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 0 0 16px 16px;
    overflow: hidden;
  }
}

/* Top Right Offline Download Button */
.offline-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 50;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  outline: none;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.offline-btn:active {
  transform: scale(0.92);
}

.offline-icon-img {
  width: 22px;
  height: 22px;
  display: block;
  pointer-events: none;
}

/* Offline Button States */
.offline-btn.download {
  background: rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.2);
}

.offline-btn.downloading {
  background: rgba(255, 165, 0, 0.25);
  border-color: rgba(255, 165, 0, 0.6);
  cursor: wait;
}

.offline-btn.downloaded {
  background: rgba(46, 204, 113, 0.25);
  border-color: rgba(46, 204, 113, 0.6);
}

.offline-btn.offline {
  background: rgba(231, 76, 60, 0.25);
  border-color: rgba(231, 76, 60, 0.6);
}

/* Toast Banner */
.toast {
  position: fixed;
  top: 76px;
  right: 20px;
  background: rgba(20, 20, 20, 0.9);
  color: #fff;
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  z-index: 99;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}