@font-face {
  font-family: 'ChoretBubble';
  src: url('https://raw.githubusercontent.com/kynahpics4-ship-it/tff/c2817acfdf63b0b1957b32fc89ebcaa162391091/ChoretFudyngBubbleRegular-3zYPG.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* light blue sky background */
body {
  font-family: 'Baloo 2', sans-serif;
  background: linear-gradient(to bottom, #87cefa, #d2edfd);
  margin: 0;
  padding: 0;
  color: #0f172a;
  overflow-x: hidden;
}

/* Animated Floating Clouds Backdrop */
#balloon-bg {
  position: fixed;
  left: 0; right: 0; top: 0; bottom: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 0;
}

/* Clouds with varied shapes */
.balloon {
  position: absolute;
  width: 260px;
  height: 130px;
  opacity: 0.82;
  background: #ffffff;
  border-radius: 50%;
  box-shadow:
    -60px 15px 0 0 rgba(255,255,255,0.95),
    -30px -30px 0 0 rgba(255,255,255,0.95),
    60px -15px 0 0 rgba(255,255,255,0.9);
  animation: cloud-drift linear infinite;
  will-change: transform, opacity;
}

.balloon::before,
.balloon::after {
  content: "";
  position: absolute;
  background: #ffffff;
  border-radius: 50%;
}

.balloon::before {
  width: 60%;
  height: 70%;
  top: -30%;
  left: 0%;
  box-shadow: 0 0 14px rgba(255,255,255,0.6);
}
.balloon::after {
  width: 55%;
  height: 75%;
  top: -15%;
  right: -5%;
  box-shadow: 0 0 14px rgba(255,255,255,0.6);
}

.balloon.shape-b {
  border-radius: 60% 40% 50% 50%;
  box-shadow:
    -50px 10px 0 0 rgba(255,255,255,0.95),
    35px -25px 0 0 rgba(255,255,255,0.92),
    80px 0px 0 0 rgba(255,255,255,0.9);
}
.balloon.shape-b::before {
  width: 50%; height: 70%; top: -25%; left: 10%;
}
.balloon.shape-b::after {
  width: 70%; height: 80%; top: -18%; right: -10%;
}

.balloon.shape-c {
  border-radius: 55% 55% 45% 45%;
  box-shadow:
    -55px 0px 0 0 rgba(255,255,255,0.96),
    0px -25px 0 0 rgba(255,255,255,0.92),
    75px -10px 0 0 rgba(255,255,255,0.9);
}
.balloon.shape-c::before {
  width: 65%; height: 60%; top: -20%; left: -5%;
}
.balloon.shape-c::after {
  width: 50%; height: 70%; top: -30%; right: 15%;
}

@keyframes cloud-drift {
  0% { transform: translateX(-35vw); opacity: 0; }
  10% { opacity: 0.9; }
  90% { opacity: 0.9; }
  100% { transform: translateX(135vw); opacity: 0; }
}

.pagedemo {
  min-height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  animation: fadeInPage 0.9s;
  position: relative;
  z-index: 1;
}
@keyframes fadeInPage { from {opacity:0;} to {opacity:1;} }

.balloon-heading {
  font-family: 'ChoretBubble';
  font-size: clamp(3rem, 11vw, 6.5rem);
  color: #0f172a;
  letter-spacing: 0.03em;
  text-align: center;
  margin: 0 0 0.13em 0;
  padding: 0;
  display: block;
  user-select: none;
  line-height: 1.05;
  max-width: 95vw;
  white-space: nowrap;
  animation: breathe-bubble 2.9s infinite cubic-bezier(.75,0,.25,1);
  will-change: transform;
  font-weight: normal;
}
@keyframes breathe-bubble {
  0%,100% { transform: scale(1); }
  35%     { transform: scale(1.09); }
  65%     { transform: scale(1.04); }
}

.frames-page h1 { color: #0f172a; }

.emoji-btn {
  background: none;
  border: none;
  font-size: 2.2rem;
  cursor: pointer;
  padding: 0 12px;
  color: #2563eb;
  transition: transform 0.1s, color 0.2s;
  margin: 0 2px;
  border-radius: 50%;
  outline: none;
  z-index: 2;
}
.emoji-btn:hover, .emoji-btn:focus {
  color: #f97316;
  transform: scale(1.21);
}

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

/* Simplified frame buttons - actual photostrip size, phone-optimized */
.frame {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  display: block;
  transition: transform 0.2s, filter 0.2s;
  max-width: clamp(120px, 28vw, 160px);
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(56,189,248,0.3));
}
.frame:hover, .frame:focus {
  transform: scale(1.05);
  filter: drop-shadow(0 6px 20px rgba(56,189,248,0.5));
}
.frame.selected {
  transform: scale(1.08);
  filter: drop-shadow(0 8px 25px rgba(14,165,233,0.6));
}
.frame img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

/* STANDARD 16:9 Video Container (both layouts) */
.video-container {
  position: relative;
  display: block;
  width: 95vw;
  max-width: 425px;
  aspect-ratio: 16 / 9;
  margin: 0 auto 10px;
  overflow: hidden;
  border-radius: 13px;
  background: #0f172a;
}

/* 4-Stacked Guide (16:9) - UNCHANGED */
#camera-guide-4stacked .center-box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 76%;
  aspect-ratio: 16/9;
  border: 2.5px dashed rgba(255,255,255,0.95);
  border-radius: 13px;
  box-sizing: border-box;
  box-shadow: 0 0 14px 2px #38bdf8, 0 0 32px 4px rgba(56,189,248,0.35);
  animation: guideGlow 1.2s infinite alternate;
  pointer-events: none;
}

/* 2x3 Grid Guide (571.5:440.5 ratio = ~1.297) */
#preview-page-2x3grid #camera-guide-2x3grid .center-box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 78%;
  aspect-ratio: 571.5 / 440.5;
  border: 2.5px dashed rgba(255,255,255,0.95);
  border-radius: 12px;
  box-sizing: border-box;
  box-shadow: 0 0 14px 2px #38bdf8, 0 0 32px 4px rgba(56,189,248,0.35);
  animation: guideGlow 1.2s infinite alternate;
  pointer-events: none;
}

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

@keyframes guideGlow {
  0%   { box-shadow:0 0 7px 2px #38bdf8, 0 0 32px 0px rgba(125,211,252,0); }
  100% { box-shadow:0 0 14px 2px #38bdf8, 0 0 32px 4px rgba(125,211,252,0.35); }
}

#countdown-overlay-4stacked, #countdown-overlay-2x3grid {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 62px;
  color: #fee440;
  font-weight: bold;
  pointer-events: none;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
  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.9; }

.instructions {
  font-size: 1.45em;
  text-align: center;
  color: #0f172a;
  background: rgba(255,255,255, 0.72);
  border-radius: 9px;
  margin-bottom: 10px;
  width: 100%;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  padding: 5px 13px;
  display: block;
}
#preview-page-2x3grid .instructions { font-size: 1.35em; }

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

#progress-bar-4, #progress-bar-2x3 {
  height: 19px;
  width: 81%;
  background: rgba(15,23,42,0.75);
  border-radius: 11px;
  overflow: hidden;
  margin-bottom: 13px;
  display: block;
  box-shadow: 0 0 5px rgba(15,23,42,0.65);
}
#progress-fill-4, #progress-fill-2x3 {
  background: linear-gradient(90deg, #22c55e, #0ea5e9);
  width: 0%;
  height: 100%;
  transition: width 0.4s;
  border-radius: 13px;
}

/* Smaller optimized results for phone/tablet */
#strip-4stacked img {
  width: clamp(120px, 32vw, 180px);
  max-width: 195px;
  min-width: 82px;
  height: auto;
  display: block;
  margin: 10px auto;
  border-radius: 11px;
  box-shadow: 0 0 12px rgba(15,23,42,0.18);
}

#strip-2x3grid img {
  width: clamp(240px, 64vw, 360px);
  max-width: 400px;
  min-width: 280px;
  height: auto;
  display: block;
  margin: 10px auto;
  border-radius: 13px;
  box-shadow: 0 0 19px rgba(15,23,42,0.2);
}

#qr-box-4, #qr-box-2x3 {
  margin: 16px 0;
  display: flex;
  justify-content: center;
}
