  :root {
  --primary-color: #fe2c55;
  --secondary-color: #25f4ee;
  --text-color: #ffffff;
  --bg-color: #000000;
  --control-bg: rgba(0, 0, 0, 0.4);
  --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  height: 100%;
}

.reel,
.video-container,
.video-player {
  height: 100dvh !important;
  max-height: 100dvh !important;
  width: 100%;
}

.reels-container {
  height: 100dvh;
  min-height: 100dvh;
  width: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-snap-stop: always;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none; /* Internet Explorer and Edge */
}

.reels-container::-webkit-scrollbar {
  display: none;                  /* Chrome, Safari, Opera */
}

.reel {
  height: 100dvh;
  min-height: 100dvh;
  width: 100%;
  scroll-snap-align: start;
  overflow: hidden;
  position: relative;
}

.ad-reel {
  height: 100vh;
  scroll-snap-align: start;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  background-color: #111;
}

.video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.video-player {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ad-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: #000;
}

.reel-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 50%);
  z-index: 2;
  pointer-events: none;
  padding-bottom: calc(20px + var(--safe-area-inset-bottom));
}

.reel-info {
  margin-bottom: 20px;
  pointer-events: auto;
}

.ad-reel .reel-info {
  margin-bottom: 40px;
}

.ad-reel .reel-info h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.ad-reel .reel-info p {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 12px;
}

.reel-category {
  display: inline-block;
  padding: 4px 12px;
  background-color: var(--control-bg);
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 8px;
}

.reel-controls {
  position: absolute;
  right: 16px;
  bottom: 16vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  z-index: 100;
  pointer-events: auto;
}

.control-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: white;
}

.control-icon {
  width: 48px;
  height: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--control-bg);
  border-radius: 50%;
  margin-bottom: 4px;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.control-icon:active {
  transform: scale(0.95);
}

.control-label {
  font-size: 12px;
  font-weight: 500;
}

.player-controls {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px 12px;
  position: relative;
  z-index: 10;
  pointer-events: auto;
  box-sizing: border-box;
}

.player-btn {
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  position: relative;
}

.player-btn:active {
  transform: scale(0.9);
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  font-size: 12px;
  opacity: 0.85;
  margin-bottom: 8px;
}

.progress-container {
  flex: 1;
  height: 3px;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background-color: var(--primary-color);
  width: 0%;
  transition: width 0.1s linear;
}

.time-display {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  opacity: 0.8;
  pointer-events: none;
}

.speed-popup {
  position: fixed;
  z-index: 9999;
  background-color: rgba(0, 0, 0, 0.95);
  border-radius: 8px;
  padding: 12px;
  display: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  touch-action: manipulation;
}

.skip-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.skip-icon-wrapper i {
  font-size: 18px;
}

.skip-number {
  position: absolute;
  font-size: 10px;
  font-weight: bold;
  bottom: -2px;
  right: -6px;
  background-color: white;
  color: black;
  border-radius: 50%;
  padding: 2px 4px;
  line-height: 1;
}

.skip-icon-wrapper.forward .skip-number {
  right: auto;
  left: -6px;
}

.speed-option {
  padding: 8px 12px;
  color: white;
  cursor: pointer;
  border-radius: 4px;
}

.speed-option:active {
  background-color: rgba(255, 255, 255, 0.1);
}

.speed-option.active {
  color: var(--primary-color);
  font-weight: bold;
}

.speed-btn {
  font-size: 14px;
  font-weight: bold;
  padding: 6px 12px;
  background-color: var(--control-bg);
  border-radius: 4px;
}

.video-interaction-area {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 80%;
  z-index: 1;
  pointer-events: auto;
}

.ad-link {
  display: inline-block;
  padding: 8px 16px;
  background-color: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  margin-top: 12px;
  font-weight: bold;
  pointer-events: auto;
}

.ad-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 30%);
  z-index: 10;
  pointer-events: auto;
  opacity: 1;
  padding-bottom: calc(20px + var(--safe-area-inset-bottom));
}

.ad-badge {
  display: inline-block;
  padding: 6px 12px;
  background: linear-gradient(135deg, #fe2c55 0%, #ff6b81 100%);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: white;
}

.ad-title {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: white;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.ad-description {
  margin: 0 0 20px 0;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(255,255,255,0.85);
}

.ad-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  background: #e1af59;
  color: #111;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s ease;
}

.ad-cta:active {
  transform: scale(0.95);
}

.ad-cta i {
  margin-left: 8px;
  font-size: 14px;
}

.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.unmute-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.unmute-popup-content {
  background-color: #111;
  padding: 24px;
  border-radius: 12px;
  max-width: 320px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.unmute-popup h3 {
  margin-bottom: 12px;
  font-size: 18px;
}

.unmute-popup p {
  margin-bottom: 20px;
  opacity: 0.8;
  font-size: 14px;
}

.unmute-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto;
  cursor: pointer;
  transition: transform 0.2s;
}

.unmute-btn:active {
  transform: scale(0.95);
}

.unmute-btn i {
  font-size: 16px;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
}

.header-logo {
  height: 30px;
  filter: brightness(0) invert(1);
}

.breaking-badge {
  display: inline-block;
  padding: 4px 8px;
  background-color: #ff0000;
  color: white;
  font-size: 12px;
  font-weight: bold;
  border-radius: 4px;
  margin-left: 8px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

.timestamp {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 4px;
  margin-bottom: 12px;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
}

.header-logo {
    height: 30px;
    filter: brightness(0) invert(1);
}

.video-interaction-area {
  position: absolute;
  top: 40%;
  height: 40%;
  left: 0;
  width: 100%;
  z-index: 3;
  pointer-events: auto;
  cursor: pointer;
}

.play-pause-feedback {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 40px;
  color: white;
  opacity: 0;
  animation: pop-fade 1s ease-out;
  pointer-events: none;
}

@keyframes pop-fade {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  20%  { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  50%  { transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; }
}

.ad-overlay {
  transition: opacity 0.3s ease;
}

@media (min-width: 768px) {
  .reels-container {
    max-width: 450px;
    margin: 0 auto;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
  }
}

@media (max-width: 500px) {
  .control-icon {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .player-btn {
    font-size: 18px;
    padding: 4px;
  }

  .speed-btn {
    font-size: 12px;
    padding: 4px 8px;
  }

  .timestamp {
    margin-bottom: 12px;
  }
}