html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #000;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

/* App container */
#app {
  position: relative;
  width: 100%;
  height: 100vh;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Media container */
#media-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* SCALE DOWN images/videos — never scale up */
#media-container img,
#media-container video {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Overlay container */
#overlay {
  position: absolute;
  box-sizing: border-box;
}

/* Overlay internals */
.overlay-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: move; /* draggable area */
}

.overlay-inner h2 {
  margin: 0 0 4px 0;
  font-size: 20px;
}

.overlay-inner p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

/* Images inside overlay body (HTML content) */
.overlay-inner img {
  display: block;
  padding: 12px 0;
  max-width: 100%;
  height: auto;
}

/* CTA button */
.overlay-inner .cta-button {
  display: inline-block;
  background-color: #ffffff;
  color: #000000;
  padding: 8px 14px;
  margin: 12px 0;
  border-radius: 999px;
  font-size: 14px;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
  border: none;
}

.overlay-inner .cta-button:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.overlay-inner .cta-button:active {
  transform: translateY(0);
}

/* === Bottom nav: dots - Previous - Next === */

.overlay-bottom-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

/* Dots */
.step-indicators {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 6px;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: width 0.15s ease,
              background-color 0.15s ease,
              opacity 0.15s ease;
}

.step-dot.active {
  width: 16px;
  background-color: #ffffff;
  opacity: 1;
}

.step-dot:hover {
  opacity: 0.8;
}

/* Buttons container */
.overlay-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Navigation buttons */
button.nav-btn {
  border: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
  background: #ffffff;
  color: #000000;
}

button.nav-btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

button.nav-btn:active {
  transform: translateY(0);
}

button.nav-btn:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
}

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 600px) {
  /* 1. Fixed bottom overlay positioning */
  #overlay {
    position: fixed !important;
    top: auto !important;
    bottom: 30px !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .overlay-inner {
    border-radius: 16px 16px 0 0 !important;
    padding: 20px 16px 24px !important;
    cursor: default; /* disable drag cursor on mobile */
  }

  /* Shift image centering upward to avoid overlay collision */
  #media-container img,
  #media-container video {
    transform: translateY(-15%);
  }

  /* 2. Larger touch targets */
  .step-dot {
    width: 10px;
    height: 10px;
  }

  .step-dot.active {
    width: 20px;
  }

  .step-indicators {
    gap: 10px; /* more space between dots for easier tapping */
  }

  button.nav-btn {
    padding: 12px 20px;
    font-size: 15px;
    min-height: 44px;
  }

  .overlay-inner .cta-button {
    padding: 12px 20px;
    font-size: 15px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* 4. Bottom row layout adjustment */
  .overlay-bottom-row {
    flex-direction: column-reverse;
    gap: 14px;
    margin-top: 12px;
  }

  .overlay-buttons {
    width: 100%;
    justify-content: space-between;
  }

  .step-indicators {
    justify-content: center;
  }

  /* 5. Typography improvements */
  .overlay-inner h2 {
    font-size: 17px;
    line-height: 1.3;
  }

  .overlay-inner p,
  .overlay-inner div {
    font-size: 14px;
    line-height: 1.5;
  }
}