@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 (reusing .balloon class) with varied shapes, smaller base size */
.balloon {
  position: absolute;
  width: 260px;   /* medium size */
  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;
}

/* extra puffs for different cloud silhouettes */
.balloon::before,
.balloon::after {
  content: "";
  position: absolute;
  background: #ffffff;
  border-radius: 50%;
}

/* shape A (default) */
.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);
}

/* shape B */
.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%;
}

/* shape C */
.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%;
}

/* clouds drifting left → right */
@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(2.8rem, 11vw, 7rem); /* tuned for phones & tablets */
  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;     /* keep GE Fair on one line */
  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);}
}

.layout-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);
}

.layout-selection {
  display: flex;
  gap: 18px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  justify-content: center;
}
.layout-option {
  border: 3px solid #38bdf8;
  border-radius: 16px;
  font-size: 1.35rem;
  padding: 10px 7px;
  background: rgba(255,255,255,0.85);
  color: #1e293b;
  margin: 0 2px;
  transition: box-shadow 0.2s, border 0.2s, background 0.21s;
  box-shadow: 0 2px 8px rgba(15,23,42,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}
.layout-option:focus, .layout-option:hover {
  background: #eff6ff;
  box-shadow: 0 0 0 5px #38bdf833;
  outline: none;
  border-color: #0ea5e9;
}

.frame-selection {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 14px;
  justify-content: center;
}
.frame, .frame-4stacked, .frame-4grid {
  cursor: pointer;
  border: 3px solid #38bdf8;
  border-radius: 16px;
  background: #fff;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 10px;
  margin-right: 6px;
  box-shadow: 0 2px 8px rgba(15,23,42,0.06);
  transition: box-shadow 0.18s, border 0.18s, background 0.18s, transform 0.15s;
  min-width: clamp(100px, 22vw, 180px);
  min-height: clamp(80px, 18vw, 168px);
}
.frame.selected,
.frame-4stacked.selected,
.frame-4grid.selected {
  transform: scale(1.07);
  border: 3.5px solid #0ea5e9;
  box-shadow: 0 4px 16px rgba(56,189,248,0.35);
}
.frame img, .frame-4stacked img, .frame-4grid img {
  width: clamp(110px, 21vw, 180px);
  height: auto;
  display: block;
  border-radius: 13px;
}

/* 4-GRID: remove extra padding above and below, enlarge previews */
#layout-frames-page-4grid,
#layout-frames-page-4grid .frame-selection {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  background: transparent !important;
}
#layout-frames-page-4grid .frame-4grid img {
  width: clamp(210px, 42vw, 320px);
  height: auto;
  border-radius: 14px;
  box-shadow: 0 2px 14px rgba(15,23,42,0.18), 0 0 0 rgba(0,0,0,0.18);
}
#layout-frames-page-4grid .frame-4grid {
  min-width: 210px;
  min-height: 128px;
  max-width: 320px;
  max-height: 240px;
  margin-bottom: 9px;
  margin-top: 0;
  background: #fff;
}
#layout-frames-page-4grid .frame-selection {
  gap: 24px !important;
}

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

.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;
}
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: 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;
}
@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,
#countdown-overlay-4stacked,
#countdown-overlay-4grid {
  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 over video */
.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;
}

/* Photostrip images: small for 3/4-stacked */
#strip img,
#strip-4stacked img {
  width: 34vw;
  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);
}
@media (max-width: 500px) {
  #strip img,
  #strip-4stacked img {
    width: 70vw;
    max-width: 165px;
    min-width: 70px;
    margin: 5px auto;
  }
}

/* 4-grid photostrip: much larger, responsive */
#strip-4grid img {
  width: 76vw;
  max-width: 680px;
  min-width: 220px;
  height: auto;
  display: block;
  margin: 18px auto;
  border-radius: 13px;
  box-shadow: 0 0 19px rgba(15,23,42,0.2);
}
@media (max-width: 700px) {
  #strip-4grid img {
    width: 99vw;
    max-width: 400px;
    min-width: 100px;
    margin: 7px auto;
  }
}

.controls {
  display: flex;
  gap: 13px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 16px 0;
}
#progress-bar,
#progress-bar-4,
#progress-bar-4grid {
  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,
#progress-fill-4,
#progress-fill-4grid {
  background: linear-gradient(90deg, #22c55e, #0ea5e9);
  width: 0%;
  height: 100%;
  transition: width 0.4s;
  border-radius: 13px;
}
#qr-box,
#qr-box-4,
#qr-box-4grid {
  margin: 16px 0;
  display: flex;
  justify-content: center;
}
