@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;
}

body {
  font-family: 'Baloo 2', sans-serif;
  background: #181824;
  margin: 0;
  padding: 0;
  color: #f4f8fb;
  overflow-x: hidden;
}

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

.balloon {
  position: absolute;
  width: 88px; height: 130px;
  opacity: 0.19;
  animation: balloon-float ease-in infinite;
  background-size: contain;
  background-repeat: no-repeat;
  will-change: transform, opacity;
}
@keyframes balloon-float {
  0%   { transform: translateY(0) scale(1); opacity: 0.19; }
  10%  { opacity: 0.28; }
  90%  { opacity: 0.18;}
  100% { transform: translateY(-110vh) scale(1.15); opacity: 0.04; }
}

.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.4rem, 12vw, 6.4rem);
  color: #7adfd8;
  letter-spacing: 0.03em;
  text-align: center;
  margin: 0 0 0.13em 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  user-select: none;
  line-height: 1.05;
  max-width: 98vw;
  flex-shrink: 1;
  word-break: break-word;
  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: #7adfd8; }

.emoji-btn {
  background: none;
  border: none;
  font-size: 2.2rem;
  cursor: pointer;
  padding: 0 12px;
  color: #70f0d0;
  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: #fff34b;
  transform: scale(1.21);
}

.layout-selection {
  display: flex;
  gap: 18px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  justify-content: center;
}
.layout-option {
  border: 3px solid #7adfd8;
  border-radius: 16px;
  font-size: 1.35rem;
  padding: 10px 7px;
  background: #181824;
  color: #b9eff9;
  margin: 0 2px;
  transition: box-shadow 0.2s, border 0.2s, background 0.21s;
  box-shadow: 0 2px 8px rgba(20,255,255,0.10);
  display: flex;
  align-items: center;
  justify-content: center;
}
.layout-option:focus, .layout-option:hover {
  background: #232f3a;
  box-shadow: 0 0 0 5px #aafcfc44;
  outline: none;
  border-color: #acf1ea;
}

.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 #7adfd8;
  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(20,255,255,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 #acf1ea;
  box-shadow: 0 4px 16px #7adfd825;
}
.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 #8cfce388, 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: #121123;
}
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.75);
  border-radius: 13px;
  box-sizing: border-box;
  box-shadow: 0 0 14px 2px #7adfd8, 0 0 32px 4px #b3ffec2a;
  animation: guideGlow 1.2s infinite alternate;
  pointer-events: none;
}
@keyframes guideGlow {
  0%   { box-shadow:0 0 7px 2px #7adfd8, 0 0 32px 0px #b3ffec00;}
  100% { box-shadow:0 0 14px 2px #7adfd8, 0 0 32px 4px #b3ffec2a;}
}
#countdown-overlay,
#countdown-overlay-4stacked,
#countdown-overlay-4grid {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 62px;
  color: #ffe243;
  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: #b9eff9;
  background: rgba(40,36,50, 0.29);
  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(0,0,0,0.13);
}
@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(0,0,0,0.17);
}
@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: #232d3c;
  border-radius: 11px;
  overflow: hidden;
  margin-bottom: 13px;
  display: block;
  box-shadow: 0 0 5px #39345f;
}
#progress-fill,
#progress-fill-4,
#progress-fill-4grid {
  background: linear-gradient(90deg, #64ffe4, #41b8f9);
  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;
}
