:root {
  --primary: #bf95f7;
  --accent: #fe4e60;
  --pink: #ff5a70;
  --orange: #ff8a3d;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  background: #1a1a1a;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  overflow-y: auto;
  position: relative;
  -webkit-text-size-adjust: 100%;
}

html[lang="ur"] body {
  font-family: 'Segoe UI', 'Noto Nastaliq Urdu', 'Noto Sans Arabic', Tahoma, sans-serif;
}

html[lang="ne"] body {
  font-family: 'Noto Sans Devanagari', 'Mangal', 'Kokila', 'Segoe UI', Roboto, sans-serif;
}

.container {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 15px;
  display: flex;
  flex-direction: column;
}

.header {
  margin-top: 10px;
}

.description {
  color: #FF007F;
  font-size: 24px;
  text-align: center;
  margin-top: 100px;
  font-weight: 500;
}

.main-image-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 200vh;
  z-index: -1;
  overflow: hidden;
}

.scrolling-images {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 200%;
  animation: scrollBackground 30s linear infinite;
}

.scrolling-image {
  width: 100%;
  height: 50%;
  background-image: url('../image/changtu.jpg');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

@keyframes scrollBackground {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

.left-container {
  position: fixed;
  top: calc(12px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: min(100%, 420px);
  padding: 0 12px;
  pointer-events: none;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  object-position: center top;
  flex-shrink: 0;
  background: #000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
}

.brand-copy {
  min-width: 0;
  flex: 1;
}

.title-text {
  color: #fe4e60;
  font-style: italic;
  font-size: clamp(26px, 8vw, 36px);
  font-weight: 900;
  line-height: 1.05;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.75);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.brand-slogan {
  margin-top: 2px;
  font-size: clamp(10px, 2.8vw, 12px);
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  line-height: 1.25;
  background: linear-gradient(90deg, #ff4d8d, #ff8a3d);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
}

.left-image-text-container {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.left-image {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: #000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.left-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.text-label {
  color: #fff;
  font-size: clamp(13px, 3.6vw, 15px);
  font-weight: 700;
  font-style: normal;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  line-height: 1.35;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
  flex: 1;
  min-width: 0;
  text-align: left;
  word-break: break-word;
}

.thumbnails {
  position: fixed;
  bottom: calc(108px + var(--safe-bottom));
  left: 0;
  width: 100%;
  display: flex;
  gap: 5px;
  z-index: 5;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.thumbnails::-webkit-scrollbar {
  display: none;
}

.thumbnails-container {
  display: flex;
  gap: 6px;
  padding: 0 6px;
  animation: scroll 20s linear infinite;
  will-change: transform;
}

@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.thumbnail {
  width: 96px;
  height: 160px;
  border-radius: 14px;
  object-fit: cover;
  border: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.download-button {
  position: fixed;
  bottom: calc(18px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateZ(0);
  z-index: 99999 !important;
  background: linear-gradient(145deg, #ff5a70, #fe2f50);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  width: min(88vw, 320px);
  min-width: 0;
  height: 58px;
  box-shadow:
    0 8px 30px rgba(254, 78, 96, 0.7),
    0 0 40px rgba(255, 60, 80, 0.55),
    inset 0 -4px 10px rgba(0, 0, 0, 0.2),
    inset 0 4px 10px rgba(255, 255, 255, 0.2);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  animation: glowPulse 2.2s infinite ease-in-out;
  pointer-events: auto;
}

.download-button span {
  color: #fff;
  font-size: clamp(20px, 5.5vw, 26px);
  font-weight: 900;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
  letter-spacing: 1px;
  z-index: 2;
}

.download-button:active {
  transform: translateX(-50%) scale(0.97);
}

@keyframes glowPulse {
  0%, 100% {
    box-shadow:
      0 8px 30px rgba(254, 78, 96, 0.7),
      0 0 40px rgba(255, 60, 80, 0.55),
      inset 0 -4px 10px rgba(0, 0, 0, 0.2),
      inset 0 4px 10px rgba(255, 255, 255, 0.2);
  }
  50% {
    box-shadow:
      0 10px 35px rgba(254, 78, 96, 0.9),
      0 0 50px rgba(255, 60, 80, 0.8),
      inset 0 -4px 10px rgba(0, 0, 0, 0.2),
      inset 0 4px 10px rgba(255, 255, 255, 0.2);
  }
}

/* Very small phones */
@media (max-width: 360px) {
  .brand-logo {
    width: 44px;
    height: 44px;
  }

  .left-image {
    width: 42px;
    height: 42px;
  }

  .left-image-text-container {
    gap: 8px;
    padding: 7px 8px;
  }

  .thumbnail {
    width: 84px;
    height: 140px;
  }

  .thumbnails {
    bottom: calc(96px + var(--safe-bottom));
  }

  .download-button {
    height: 52px;
  }
}

/* Tablet / desktop phone frame */
@media (min-width: 768px) {
  .main-image-section {
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
  }

  .container {
    width: 400px;
    margin: 0 auto;
  }

  body {
    display: flex;
    justify-content: center;
  }

  .left-container {
    width: 400px;
    padding: 0 16px;
    top: 24px;
    gap: 14px;
  }

  .brand-logo {
    width: 64px;
    height: 64px;
    border-radius: 14px;
  }

  .title-text {
    font-size: 40px;
  }

  .brand-slogan {
    font-size: 13px;
    letter-spacing: 1px;
  }

  .left-image-text-container {
    gap: 12px;
    padding: 10px 12px;
  }

  .left-image {
    width: 56px;
    height: 56px;
  }

  .text-label {
    font-size: 15px;
  }

  .thumbnails {
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    bottom: 110px;
  }

  .thumbnail {
    width: 110px;
    height: 180px;
  }

  .download-button {
    height: 72px;
    width: 340px;
  }

  .download-button span {
    font-size: 32px;
  }
}

.main-container,
.modal-overlay,
.loading-overlay {
  display: none;
}

/* Urdu RTL */
html[dir="rtl"] body {
  direction: rtl;
}

html[dir="rtl"] .brand-row,
html[dir="rtl"] .left-image-text-container {
  flex-direction: row-reverse;
}

html[dir="rtl"] .brand-copy,
html[dir="rtl"] .text-label {
  text-align: right;
}

html[dir="rtl"] .title-text {
  font-style: normal;
}

html[dir="rtl"] .brand-slogan {
  letter-spacing: 0;
}

html[dir="rtl"] .thumbnails-container {
  animation-name: scrollRtl;
}

@keyframes scrollRtl {
  0% { transform: translateX(0); }
  100% { transform: translateX(50%); }
}

