:root {
  --bg: #f8f2ee;
  --bg-2: #fdfaf8;
  --paper: rgba(255, 255, 255, 0.72);
  --card: rgba(255, 250, 247, 0.9);
  --text: #3e2b2f;
  --muted: #8c6f72;
  --accent: #b87b84;
  --accent-dark: #9f646d;
  --accent-soft: #ead7d7;
  --gold: #c8a978;
  --gold-soft: #efe3d2;
  --border: rgba(142, 102, 108, 0.18);
  --shadow: 0 14px 40px rgba(114, 77, 84, 0.12);
  --shadow-soft: 0 8px 20px rgba(114, 77, 84, 0.08);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  color: var(--text);
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.7), transparent 32%),
    radial-gradient(circle at bottom right, rgba(232, 199, 202, 0.35), transparent 35%),
    linear-gradient(135deg, var(--bg) 0%, #f4e8e4 45%, #f7efe9 100%);
}

#divine-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.5), transparent 25%),
    radial-gradient(circle at 80% 30%, rgba(232, 199, 202, 0.18), transparent 22%),
    radial-gradient(circle at 60% 80%, rgba(200,169,120,0.12), transparent 20%);
}

.doodle {
  position: absolute;
  font-family: "Parisienne", cursive;
  font-size: clamp(1.4rem, 3.5vw, 2.35rem);
  color: rgba(184, 123, 132, 0.5);
  opacity: 0;
  white-space: nowrap;
  animation: floatWrite 10s ease-in-out infinite;
  letter-spacing: 0.02em;
}

.doodle-1 { top: 9%; left: 6%; animation-delay: 0s; }
.doodle-2 { top: 18%; right: 8%; animation-delay: 1.4s; }
.doodle-3 { top: 40%; left: 10%; animation-delay: 3s; }
.doodle-4 { bottom: 17%; right: 12%; animation-delay: 4.5s; }
.doodle-5 { bottom: 10%; left: 8%; animation-delay: 6s; }
.doodle-6 { top: 68%; right: 9%; animation-delay: 7.6s; }

@keyframes floatWrite {
  0% {
    opacity: 0;
    transform: translateY(20px) rotate(-4deg) scale(0.96);
  }
  15% {
    opacity: 0.75;
    transform: translateY(0) rotate(-1deg) scale(1);
  }
  50% {
    opacity: 0.6;
    transform: translateY(-8px) rotate(1deg) scale(1.02);
  }
  85% {
    opacity: 0.2;
    transform: translateY(-16px) rotate(3deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-22px) rotate(4deg) scale(0.98);
  }
}

.pagedemo {
  min-height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  position: relative;
  z-index: 1;
  animation: fadeInPage 0.6s ease;
}

@keyframes fadeInPage {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.78rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.balloon-heading {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(3rem, 9vw, 6.2rem);
  line-height: 0.95;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--accent-dark);
  margin: 0;
  text-align: center;
}

#booth-line {
  color: var(--gold);
  margin-bottom: 26px;
}

h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1;
  font-weight: 600;
  margin: 0 0 18px;
  color: var(--accent-dark);
  text-align: center;
}

.emoji-btn {
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--border);
  color: var(--text);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  box-shadow: var(--shadow-soft);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
}

.emoji-btn:hover,
.emoji-btn:focus {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  background: rgba(255,255,255,0.82);
  border-color: rgba(184, 123, 132, 0.35);
  outline: none;
}

#enter-photobooth {
  padding: 14px 28px;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.layout-selection {
  display: flex;
  gap: 18px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  justify-content: center;
}

.layout-option {
  min-width: 140px;
  min-height: 160px;
  padding: 18px 16px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.layout-option.selected {
  border-color: rgba(184, 123, 132, 0.4);
  box-shadow: 0 0 0 4px rgba(184, 123, 132, 0.12), var(--shadow);
}

.layout-icon {
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--accent-dark);
}

.layout-label {
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.frame-selection {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 14px;
  justify-content: center;
  max-width: 1100px;
}

.frame,
.frame-4stacked,
.frame-4grid {
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  min-width: clamp(100px, 22vw, 180px);
  min-height: clamp(80px, 18vw, 168px);
}

.frame.selected,
.frame-4stacked.selected,
.frame-4grid.selected {
  transform: translateY(-3px);
  border-color: rgba(184, 123, 132, 0.45);
  box-shadow: 0 0 0 4px rgba(184, 123, 132, 0.12), var(--shadow);
}

.frame img,
.frame-4stacked img,
.frame-4grid img {
  width: clamp(110px, 21vw, 180px);
  height: auto;
  display: block;
  border-radius: 10px;
}

#layout-frames-page-4grid .frame-4grid img {
  width: clamp(210px, 42vw, 320px);
  border-radius: 12px;
}

#layout-frames-page-4grid .frame-4grid {
  min-width: 210px;
  min-height: 128px;
  max-width: 320px;
  max-height: 240px;
}

#layout-frames-page-4grid .frame-selection {
  gap: 24px;
}

.controls-single {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.controls-single button,
.controls button {
  padding: 12px 20px;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.video-container {
  position: relative;
  display: block;
  width: 95vw;
  max-width: 425px;
  aspect-ratio: 16 / 9;
  margin: 0 auto 14px;
  overflow: hidden;
  border-radius: 24px;
  background: rgba(255,255,255,0.65);
  border: 1px solid rgba(255,255,255,0.45);
  box-shadow: var(--shadow);
}

video,
#video-4stacked,
#video-4grid {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scaleX(-1);
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#camera-guide .center-box,
#camera-guide-4stacked .center-box,
#camera-guide-4grid .center-box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 76%;
  aspect-ratio: 16/9;
  border: 2px solid rgba(255,255,255,0.78);
  border-radius: 18px;
  box-sizing: border-box;
  box-shadow: 0 0 0 1px rgba(200,169,120,0.2), 0 0 24px rgba(184,123,132,0.15);
  animation: guideGlow 1.6s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes guideGlow {
  0% {
    box-shadow: 0 0 0 1px rgba(200,169,120,0.16), 0 0 14px rgba(184,123,132,0.08);
  }
  100% {
    box-shadow: 0 0 0 1px rgba(200,169,120,0.28), 0 0 28px rgba(184,123,132,0.16);
  }
}

#countdown-overlay,
#countdown-overlay-4stacked,
#countdown-overlay-4grid {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 64px;
  color: #fff8f2;
  font-weight: 700;
  font-family: 'Cormorant Garamond', serif;
  pointer-events: none;
  text-shadow: 0 6px 18px rgba(62, 43, 47, 0.35);
  display: none;
  z-index: 9;
}

.flash-overlay {
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0;
  pointer-events: none;
  z-index: 8;
  transition: opacity 0.2s ease-out;
}

.flash-overlay.active {
  opacity: 0.92;
}

.instructions {
  font-size: 0.98rem;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  border: 1px solid rgba(184, 123, 132, 0.14);
  margin-bottom: 12px;
  width: 100%;
  max-width: 430px;
  margin-left: auto;
  margin-right: auto;
  padding: 12px 18px;
  display: block;
  box-shadow: var(--shadow-soft);
}

.strip img,
.strip-4stacked img {
  width: 39.1vw;
  max-width: 224px;
  min-width: 94px;
  height: auto;
  display: block;
  margin: 10px auto;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.strip-4grid img {
  width: 76vw;
  max-width: 680px;
  min-width: 220px;
  height: auto;
  display: block;
  margin: 18px auto;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

@media (max-width: 500px) {
  .strip img,
  .strip-4stacked img {
    width: 80.5vw;
    max-width: 190px;
    min-width: 81px;
    margin: 6px auto;
  }
}

@media (max-width: 700px) {
  .strip-4grid img {
    width: 99vw;
    max-width: 400px;
    min-width: 100px;
    margin: 8px auto;
  }
}

.controls {
  display: flex;
  gap: 13px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 16px 0;
}

#progress-bar,
#progress-bar-4,
#progress-bar-4grid {
  height: 14px;
  width: min(82%, 420px);
  background: rgba(91, 62, 67, 0.12);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 15px;
  display: block;
  box-shadow: inset 0 1px 2px rgba(62, 43, 47, 0.06);
}

#progress-fill,
#progress-fill-4,
#progress-fill-4grid {
  background: linear-gradient(90deg, var(--accent), var(--gold));
  width: 0;
  height: 100%;
  transition: width 0.4s ease;
  border-radius: 999px;
}

#qr-box,
#qr-box-4,
#qr-box-4grid {
  margin: 16px 0;
  display: flex;
  justify-content: center;
  min-height: 120px;
  align-items: center;
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 480px) {
  .doodle-1 { left: 3%; top: 8%; }
  .doodle-2 { right: 3%; top: 18%; }
  .doodle-5 { left: 3%; bottom: 11%; }
  .doodle-6 { right: 6%; top: 67%; }

  .layout-option {
    min-width: 120px;
  }

  .balloon-heading {
    font-size: clamp(2.4rem, 13vw, 4.6rem);
  }
}