* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  min-height: 100vh;
}

body {
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  background:
    linear-gradient(
      160deg,
      #fff7f2,
      #f6e7df
    );

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 18px;

  color: #3b2a24;
}

body.no-scroll {
  overflow: hidden;
  height: 100dvh;
}

.card {
  width: 100%;
  max-width: 430px;

  background:
    rgba(255, 255, 255, 0.88);

  border-radius: 28px;

  padding: 28px 22px;

  box-shadow:
    0 20px 60px rgba(80, 45, 30, 0.16);

  text-align: center;
}

.heart {
  font-size: 44px;
  margin-bottom: 8px;
}

h1 {
  font-size: 28px;
  line-height: 1.15;
  margin: 0 0 14px;
}

h2 {
  font-size: 20px;
  margin-top: 30px;
}

p {
  font-size: 16px;
  line-height: 1.45;
  color: #6d5650;
}

input {
  width: 100%;

  border:
    1px solid #ead7cf;

  border-radius: 18px;

  padding: 16px;

  margin-top: 12px;

  font-size: 17px;

  background: #fff;
}

button,
.uploadButton {

  display: block;

  width: 100%;

  border: none;

  border-radius: 22px;

  background: #9f6b5d;

  color: white;

  font-size: 18px;
  font-weight: 700;

  padding: 18px;

  margin-top: 12px;

  cursor: pointer;

  box-shadow:
    0 12px 24px rgba(159, 107, 93, 0.28);

  text-align: center;
}

#status {
  min-height: 28px;
  margin-top: 18px;
  font-weight: 600;
}

/* =========================
   CAROUSEL (thumbnails)
   ========================= */

.carousel {
  display: flex;

  gap: 12px;

  overflow-x: auto;
  overflow-y: hidden;

  padding: 8px 2px 12px;

  scroll-snap-type: x proximity;
  scroll-padding: 0 2px;

  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.carousel::-webkit-scrollbar {
  display: none;
}

.carousel img {
  flex: 0 0 78%;

  height: 230px;

  object-fit: cover;

  border-radius: 22px;

  scroll-snap-align: center;

  box-shadow:
    0 10px 24px rgba(80, 45, 30, 0.16);

  -webkit-touch-callout: none;
  user-select: none;

  cursor: pointer;

  transition: transform 0.15s ease;
}

.carousel img:active {
  transform: scale(0.97);
}

/* =========================
   LIGHTBOX (fullscreen viewer)
   ========================= */

.lightbox-overlay {
  position: fixed;
  inset: 0;

  background: rgba(15, 8, 6, 0.97);

  z-index: 999;

  opacity: 0;
  pointer-events: none;

  transition: opacity 0.2s ease;
}

.lightbox-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-track {
  height: 100dvh;
  width: 100%;

  display: flex;

  overflow-x: auto;
  overflow-y: hidden;

  scroll-snap-type: x mandatory;
  scroll-snap-stop: always;

  -webkit-overflow-scrolling: touch;
}

.lightbox-track::-webkit-scrollbar {
  display: none;
}

.lightbox-slide {
  flex: 0 0 100%;
  width: 100vw;
  height: 100dvh;

  display: flex;
  align-items: center;
  justify-content: center;

  scroll-snap-align: center;
  scroll-snap-stop: always;

  padding: 0;
}

.lightbox-slide img {
  max-width: 100%;
  max-height: 100%;

  width: auto;
  height: auto;

  object-fit: contain;

  -webkit-touch-callout: none;
  user-select: none;

  display: block;
}

.lightbox-close {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;

  width: 42px;
  height: 42px;

  border-radius: 50%;

  background: rgba(255, 255, 255, 0.12);
  color: #fff;

  border: none;
  font-size: 22px;
  line-height: 1;

  display: flex;
  align-items: center;
  justify-content: center;

  z-index: 1001;
}

.lightbox-counter {
  position: fixed;
  top: max(22px, env(safe-area-inset-top));
  left: 18px;

  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  font-weight: 600;

  z-index: 1001;
}

/* =========================
   DOWNLOAD SHEET (long press)
   ========================= */

.download-sheet-backdrop {
  position: fixed;
  inset: 0;

  background: rgba(0, 0, 0, 0.35);

  z-index: 1010;

  opacity: 0;
  pointer-events: none;

  transition: opacity 0.15s ease;
}

.download-sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.download-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;

  background: #fffaf7;

  border-radius: 24px 24px 0 0;

  padding: 18px 18px max(18px, env(safe-area-inset-bottom));

  z-index: 1011;

  transform: translateY(100%);
  transition: transform 0.2s ease;

  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.25);
}

.download-sheet-backdrop.open .download-sheet {
  transform: translateY(0);
}

.download-sheet p {
  margin: 0 0 14px;
  font-weight: 600;
  color: #3b2a24;
}

.download-sheet a.download-btn {
  display: block;
  text-decoration: none;
  background: #9f6b5d;
  color: #fff;
  font-weight: 700;
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 10px;
}

.download-sheet button.cancel-btn {
  display: block;
  width: 100%;
  background: #f1e4dd;
  color: #6d5650;
  border: none;
  border-radius: 18px;
  padding: 16px;
  font-weight: 700;
  font-size: 16px;
}
