/* ═══════════════════════════════════════
   NISAR_BOOTH — Ceria · Fun · Gemes · Modern
   ═══════════════════════════════════════ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --maroon: #D4536B;
  --maroon-dark: #B8384E;
  --maroon-light: #E8869A;
  --maroon-glow: rgba(212,83,107,0.3);
  --cream: #FFF8F0;
  --cream-soft: #FFFDF7;
  --white: #FFFFFF;
  --black: #2D2D2D;
  --soft-black: #4A4A4A;
  --gold: #FFD700;
  --confetti-1: #FF6B6B;
  --confetti-2: #FFD93D;
  --confetti-3: #6BCB77;
  --confetti-4: #4D96FF;
  --confetti-5: #FF8CEA;
  --confetti-6: #FFB347;
  --shadow-sm: 0 4px 15px rgba(0,0,0,0.08);
  --shadow-md: 0 8px 30px rgba(0,0,0,0.12);
  --shadow-lg: 0 15px 50px rgba(0,0,0,0.15);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 30px;
  --radius-full: 50%;
  --font-fredoka: 'Fredoka One', cursive;
  --font-caveat: 'Caveat', cursive;
  --font-nunito: 'Nunito', sans-serif;
  --transition: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-smooth: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-nunito);
  background: var(--maroon);
  color: var(--black);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* ═══════════════════════════════════════
   SCREENS
   ═══════════════════════════════════════ */

.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  z-index: 1;
}

.screen.active {
  display: flex;
  animation: screenIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.screen.exit {
  animation: screenOut 0.35s ease forwards;
}

@keyframes screenIn {
  0% { opacity: 0; transform: scale(0.92) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes screenOut {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.95) translateY(-10px); }
}

.screen-0, .screen-1, .screen-2, .screen-3, .screen-5, .screen-6, .screen-7 {
  background: linear-gradient(160deg, var(--maroon) 0%, var(--maroon-dark) 100%);
}

.screen-4 {
  background: #000;
  padding: 0;
}
.screen-4 ~ .screen-indicator {
  background: rgba(255,255,255,0.2);
}

.screen-content {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.screen-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 20px 24px;
  z-index: 10;
}

.screen-title {
  font-family: var(--font-fredoka);
  font-size: 1.8rem;
  color: var(--white);
  text-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.screen-subtitle {
  font-family: var(--font-caveat);
  font-size: 1.2rem;
  color: rgba(255,255,255,0.8);
  margin-top: 4px;
}

/* ════════════════════════════════════════════════════════════
   CONFETTI LAYER
   ════════════════════════════════════════════════════════════ */

.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -20px;
  animation: confettiFall linear infinite;
}

@keyframes confettiFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ════════════════════════════════════════════════════════════
   SESSION TIMER
   ════════════════════════════════════════════════════════════ */

.session-timer {
  position: fixed;
  top: 16px;
  right: 16px;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  padding: 8px 16px;
  border-radius: var(--radius-lg);
  display: none;
  align-items: center;
  gap: 8px;
  z-index: 50;
  font-family: var(--font-nunito);
  font-weight: 700;
  color: var(--white);
  font-size: 0.9rem;
  border: 1px solid rgba(255,255,255,0.15);
}

.session-timer.visible { display: flex; }

.timer-icon { font-size: 1rem; }

/* ════════════════════════════════════════════════════════════
   SCREEN INDICATOR
   ════════════════════════════════════════════════════════════ */

.screen-indicator {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 50;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  padding: 8px 16px;
  border-radius: var(--radius-lg);
}

.indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.3);
  transition: var(--transition);
}

.indicator-dot.active {
  background: var(--white);
  transform: scale(1.3);
}

/* ════════════════════════════════════════════════════════════
   DOODLES
   ════════════════════════════════════════════════════════════ */

.screen-bg-doodles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.doodle {
  position: absolute;
  font-size: 1.8rem;
  opacity: 0.2;
  animation: doodleFloat 4s ease-in-out infinite;
}

@keyframes doodleFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(10deg); }
}

/* ════════════════════════════════════════════════════════════
   SCREEN 0 — BRAND
   ════════════════════════════════════════════════════════════ */

.brand-content { gap: 12px; }

.brand-logo { margin-bottom: 10px; }

.logo-icon-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-camera-icon {
  font-size: 3.5rem;
  z-index: 2;
  animation: cameraBounce 2s ease-in-out infinite;
}

@keyframes cameraBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.05); }
}

.logo-ring {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-full);
  border: 3px dashed rgba(255,255,255,0.3);
  animation: ringSpin 8s linear infinite;
}

@keyframes ringSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.brand-title {
  font-family: var(--font-fredoka);
  font-size: 2.8rem;
  color: var(--white);
  text-shadow: 0 3px 15px rgba(0,0,0,0.2);
  letter-spacing: 1px;
  animation: titlePop 1s ease;
}

@keyframes titlePop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.brand-subtitle {
  font-family: var(--font-caveat);
  font-size: 1.5rem;
  color: rgba(255,255,255,0.85);
  margin-top: -4px;
}

.brand-dots { display: flex; gap: 8px; margin: 8px 0; }

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.5);
  animation: dotPulse 1.5s ease-in-out infinite;
}

.brand-dot:nth-child(2) { animation-delay: 0.3s; }
.brand-dot:nth-child(3) { animation-delay: 0.6s; }

@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.4); opacity: 1; }
}

.brand-tap {
  font-family: var(--font-caveat);
  font-size: 1.1rem;
  color: rgba(255,255,255,0.6);
  animation: fadePulse 2s ease-in-out infinite;
}

@keyframes fadePulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

/* ════════════════════════════════════════════════════════════
   SCREEN 1 — PAYMENT
   ════════════════════════════════════════════════════════════ */

.payment-content { gap: 16px; }

.payment-logo { margin-bottom: 4px; }

.payment-brand {
  font-family: var(--font-fredoka);
  font-size: 2rem;
  color: var(--white);
}

.payment-title {
  font-family: var(--font-nunito);
  font-size: 1.1rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
}

.payment-options {
  display: flex;
  gap: 12px;
  width: 100%;
}

.payment-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.1);
  color: var(--white);
  font-family: var(--font-nunito);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.payment-option:hover { background: rgba(255,255,255,0.2); }

.payment-option.active {
  border-color: var(--white);
  background: rgba(255,255,255,0.2);
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(255,255,255,0.15);
}

.payment-icon { font-size: 1.8rem; }

.qrcode-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.qrcode-placeholder {
  width: 180px;
  height: 180px;
  background: var(--white);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

.qrcode-placeholder.large {
  width: 220px;
  height: 220px;
}

.qrcode-inner {
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-icon { font-size: 3rem; opacity: 0.3; }

.qrcode-label {
  font-family: var(--font-caveat);
  font-size: 1.2rem;
  color: rgba(255,255,255,0.85);
}

/* ════════════════════════════════════════════════════════════
   SCREEN 2 — START
   ════════════════════════════════════════════════════════════ */

.start-content { gap: 24px; }

.start-decoration { display: flex; gap: 16px; }

.deco-star {
  font-size: 2.5rem;
  animation: starSpin 2s ease-in-out infinite;
}

@keyframes starSpin {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.3) rotate(20deg); }
}

.start-title {
  font-family: var(--font-fredoka);
  font-size: 3rem;
  color: var(--white);
  text-shadow: 0 3px 20px rgba(0,0,0,0.2);
  animation: titlePop 1.2s ease;
}

.start-subtitle {
  font-family: var(--font-caveat);
  font-size: 1.4rem;
  color: rgba(255,255,255,0.75);
  margin-top: -12px;
}

.btn-start {
  font-family: var(--font-fredoka);
  font-size: 2rem;
  padding: 20px 60px;
  border: none;
  border-radius: var(--radius-lg);
  background: var(--white);
  color: var(--maroon);
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  transition: var(--transition);
  animation: startPulse 2s ease-in-out infinite;
}

.btn-start:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}

.btn-start:active { transform: scale(0.95); }

@keyframes startPulse {
  0%, 100% { box-shadow: 0 8px 30px rgba(0,0,0,0.2); }
  50% { box-shadow: 0 8px 40px rgba(255,255,255,0.3); }
}

/* ════════════════════════════════════════════════════════════
   SCREEN 3 — LAYOUT
   ════════════════════════════════════════════════════════════ */

.layout-content { padding-top: 90px; gap: 20px; }

.layout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
}

.layout-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.12);
  border: 3px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}

.layout-option:hover { background: rgba(255,255,255,0.2); }

.layout-option.active {
  border-color: var(--white);
  background: rgba(255,255,255,0.2);
  transform: scale(1.03);
}

.layout-preview {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
}

.preview-frame {
  flex: 1;
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
}

.preview-strip-4 { gap: 5px; }
.preview-strip-3 { gap: 6px; }
.preview-grid-4 {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 5px;
}
.preview-grid-4 .preview-frame {
  flex: 1 1 calc(50% - 3px);
}
.preview-single .preview-frame { flex: 1; }

.layout-name {
  font-family: var(--font-nunito);
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
}

/* ─── Frame Selector ─── */
.frame-select-section {
  width: 100%;
}

.frame-select-label {
  font-family: var(--font-nunito);
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.frame-select-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.frame-select-bar::-webkit-scrollbar { display: none; }

.frame-chip {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: 2px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.08);
  cursor: pointer;
  transition: var(--transition);
  min-width: 60px;
}

.frame-chip:hover { background: rgba(255,255,255,0.15); }

.frame-chip.active {
  border-color: var(--white);
  background: rgba(255,255,255,0.2);
  transform: scale(1.05);
  box-shadow: 0 0 16px rgba(255,255,255,0.2);
}

.frame-chip-preview {
  width: 50px;
  height: 40px;
  border-radius: 4px;
  background: rgba(255,255,255,0.15);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.frame-chip-name {
  font-family: var(--font-nunito);
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
}

/* ─── Frame Chip Preview Variants ─── */
.fp-simple { border: 3px solid var(--maroon); }
.fp-polaroid { border: 4px solid white; box-shadow: 0 1px 6px rgba(0,0,0,0.2); }
.fp-double { border: 2px solid var(--maroon); box-shadow: inset 0 0 0 2px var(--confetti-5); }
.fp-vintage { border: 2px solid #8B4513; }
.fp-film { border-top: 4px solid #333; border-bottom: 4px solid #333; }
.fp-soft { border: 3px solid rgba(255,255,255,0.6); border-radius: 8px; }
.fp-party { border: 2px dashed var(--gold); }

/* ════════════════════════════════════════════════════════════
   SCREEN 4 — CAMERA
   ════════════════════════════════════════════════════════════ */

.camera-wrapper {
  position: absolute;
  inset: 0;
  background: #000;
}

.camera-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, #2D2D2D, #4A4A4A);
  color: white;
  z-index: 5;
}

.camera-loading {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(0,0,0,0.7);
  color: white;
  z-index: 5;
}
.camera-loading.show { display: flex; }

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255,255,255,0.2);
  border-top-color: var(--maroon-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-family: var(--font-nunito);
  font-size: 0.95rem;
  color: rgba(255,255,255,0.8);
}

.camera-error {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--cream);
  color: var(--black);
  z-index: 6;
  padding: 20px;
  text-align: center;
}

.camera-error.show { display: flex; }
.camera-error span { font-size: 2rem; }

.countdown-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  z-index: 10;
}

.countdown-overlay.show { display: flex; }

#countdownNumber {
  font-family: var(--font-fredoka);
  font-size: 10rem;
  color: var(--white);
  text-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

@keyframes countPop {
  0% { transform: scale(0.3); opacity: 0; }
  40% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

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

.flash-overlay.flash { opacity: 0.9; }

/* ─── Frame Overlay (live preview on camera) ─── */
.frame-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  transition: all 0.3s ease;
}

/* None */
.fo-none { display: none; }

/* Simple */
.fo-simple { border: 14px solid var(--maroon); }

/* Polaroid */
.fo-polaroid {
  border: 18px solid white;
  box-shadow: 0 4px 30px rgba(0,0,0,0.3), inset 0 0 0 1px rgba(0,0,0,0.05);
  margin-bottom: 30px;
}
.fo-polaroid::after {
  content: 'NISAR_BOOTH';
  position: absolute;
  bottom: -38px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-fredoka);
  font-size: 0.7rem;
  color: var(--soft-black);
  letter-spacing: 2px;
}

/* Double */
.fo-double {
  border: 10px solid var(--maroon);
  box-shadow: inset 0 0 0 6px var(--confetti-5);
}

/* Vintage */
.fo-vintage {
  border: 4px solid #8B4513;
  box-shadow: inset 0 0 40px rgba(139,69,19,0.3);
}
.fo-vintage::before,
.fo-vintage::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  border-color: #8B4513;
  border-style: solid;
}
.fo-vintage::before {
  top: 8px; left: 8px;
  border-width: 3px 0 0 3px;
}
.fo-vintage::after {
  bottom: 8px; right: 8px;
  border-width: 0 3px 3px 0;
}

/* Film */
.fo-film {
  border-top: 28px solid #333;
  border-bottom: 28px solid #333;
  border-left: 2px solid #555;
  border-right: 2px solid #555;
}
.fo-film::before,
.fo-film::after {
  content: '';
  position: absolute;
  left: 8px; right: 8px;
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    #222 0px, #222 10px,
    transparent 10px, transparent 22px
  );
}
.fo-film::before { top: 10px; }
.fo-film::after { bottom: 10px; }

/* Soft */
.fo-soft {
  border: 12px solid rgba(255,255,255,0.5);
  border-radius: 20px;
  box-shadow: 0 6px 40px rgba(0,0,0,0.25), inset 0 0 20px rgba(0,0,0,0.08);
}

/* Party */
.fo-party {
  border: 10px dotted var(--white);
  box-shadow:
    inset 0 0 0 4px var(--maroon),
    0 0 0 4px rgba(255,215,0,0.4);
  animation: partyFrame 1.5s ease-in-out infinite;
}
@keyframes partyFrame {
  0%, 100% { border-color: var(--confetti-1); box-shadow: inset 0 0 0 4px var(--maroon), 0 0 0 4px rgba(255,215,0,0.4); }
  25% { border-color: var(--confetti-2); }
  50% { border-color: var(--confetti-3); box-shadow: inset 0 0 0 4px var(--confetti-5), 0 0 0 4px rgba(255,215,0,0.4); }
  75% { border-color: var(--confetti-4); }
}

.camera-counter {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-fredoka);
  font-size: 1.5rem;
  color: var(--white);
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
  z-index: 7;
  display: none;
}

.camera-counter.show { display: block; }

.camera-controls {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 0;
  display: flex;
  gap: 16px;
  justify-content: center;
  padding: 0 24px;
  z-index: 7;
}

.camera-controls .btn {
  min-width: 120px;
  padding: 14px 24px;
  font-size: 1rem;
}

.camera-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  z-index: 7;
  display: none;
}

.camera-progress.show { display: block; }

.progress-bar {
  height: 100%;
  background: var(--maroon-light);
  transition: width 0.4s ease;
  width: 0%;
}

/* ════════════════════════════════════════════════════════════
   SCREEN 5 — FILTER
   ════════════════════════════════════════════════════════════ */

.filter-content { padding-top: 90px; gap: 14px; justify-content: flex-start; }

.filter-preview-wrapper {
  width: 100%;
  max-height: 55vh;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--black);
}

.filter-preview-wrapper img {
  width: 100%;
  display: block;
}

.filter-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 8px 0;
  width: 100%;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar { display: none; }

.filter-chip {
  flex-shrink: 0;
  padding: 10px 24px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-lg);
  background: transparent;
  font-family: var(--font-nunito);
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.filter-chip:hover { background: rgba(255,255,255,0.15); }

.filter-chip.active {
  border-color: var(--white);
  background: var(--white);
  color: var(--maroon);
  transform: scale(1.05);
}

/* ════════════════════════════════════════════════════════════
   SCREEN 6 — RESULT
   ════════════════════════════════════════════════════════════ */

.result-content { gap: 20px; }

.result-celebration { text-align: center; }

.celebration-emoji { font-size: 3rem; display: block; margin-bottom: 8px; }

.result-title {
  font-family: var(--font-fredoka);
  font-size: 2.2rem;
  color: var(--white);
  text-shadow: 0 2px 15px rgba(0,0,0,0.15);
}

.result-photo-wrapper {
  width: 100%;
  max-width: 320px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 4px solid var(--white);
}

.result-photo-wrapper img {
  width: 100%;
  display: block;
}

.result-actions { display: flex; gap: 12px; width: 100%; }
.result-actions .btn { flex: 1; }

/* ════════════════════════════════════════════════════════════
   SCREEN 7 — DOWNLOAD
   ════════════════════════════════════════════════════════════ */

.download-content { gap: 20px; }

.download-title {
  font-family: var(--font-fredoka);
  font-size: 2rem;
  color: var(--white);
}

.download-subtitle {
  font-family: var(--font-caveat);
  font-size: 1.2rem;
  color: rgba(255,255,255,0.75);
}

.download-hint {
  font-family: var(--font-nunito);
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
}

.download-qr-wrapper {
  padding: 16px;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

/* ════════════════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-lg);
  font-family: var(--font-nunito);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--white);
  color: var(--maroon);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  background: rgba(255,255,255,0.2);
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.3);
}

.btn-secondary:hover { background: rgba(255,255,255,0.3); }

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.5);
}

.btn-outline:hover { background: rgba(255,255,255,0.15); border-color: var(--white); }

.btn-link {
  background: transparent;
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  padding: 8px;
}

.btn-link:hover { color: rgba(255,255,255,0.9); }

.btn-lg { padding: 18px 36px; font-size: 1.1rem; }

.btn-pulse {
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 4px 20px rgba(0,0,0,0.15); }
  50% { box-shadow: 0 4px 30px rgba(255,255,255,0.25); }
}

/* ════════════════════════════════════════════════════════════
   QR CODE REAL (generated)
   ════════════════════════════════════════════════════════════ */

.qr-generated {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ════════════════════════════════════════════════════════════
   THEME SELECTOR
   ════════════════════════════════════════════════════════════ */

.theme-select-section {
  width: 100%;
}

.theme-select-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.theme-select-bar::-webkit-scrollbar { display: none; }

.theme-chip {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: 2px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.08);
  cursor: pointer;
  transition: var(--transition);
  min-width: 56px;
}

.theme-chip:hover { background: rgba(255,255,255,0.15); }
.theme-chip.active { border-color: var(--white); background: rgba(255,255,255,0.2); transform: scale(1.05); box-shadow: 0 0 16px rgba(255,255,255,0.2); }

.theme-chip-swatch {
  width: 44px;
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.theme-chip-name {
  font-family: var(--font-nunito);
  font-size: 0.6rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
}

/* ════════════════════════════════════════════════════════════
   PROPS (Virtual Props on Camera)
   ════════════════════════════════════════════════════════════ */

.props-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 9;
  overflow: hidden;
}

.prop-item {
  position: absolute;
  font-size: 5rem;
  display: none;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
  transition: transform 0.3s ease;
  line-height: 1;
}

.prop-item.active { display: block; }

#propGlasses { top: 40%; left: 50%; font-size: 6rem; transform: translate(-50%, -50%) rotate(-3deg); }
#propCrown { top: 12%; left: 50%; font-size: 5rem; }
#propCat { top: 15%; left: 50%; font-size: 7rem; }
#propBow { top: 22%; left: 15%; font-size: 4rem; transform: translate(-50%, -50%) rotate(-15deg); }
#propHat { top: 8%; left: 50%; font-size: 5.5rem; }
#propBowtie { top: 48%; left: 50%; font-size: 3rem; }
#propFlower { top: 18%; left: 75%; font-size: 4rem; }

.props-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 12px;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(6px);
  z-index: 7;
  position: relative;
  scrollbar-width: none;
  justify-content: center;
}

.props-bar::-webkit-scrollbar { display: none; }

.prop-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.1);
  font-size: 1.3rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.prop-btn:hover { background: rgba(255,255,255,0.2); }
.prop-btn.active { border-color: var(--white); background: rgba(255,255,255,0.25); transform: scale(1.1); }

/* ════════════════════════════════════════════════════════════
   PRINT ANIMATION
   ════════════════════════════════════════════════════════════ */

.print-animation {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
}

.print-animation.show { display: flex; }

.print-slide {
  width: 280px;
  background: white;
  padding: 16px 16px 50px;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  animation: printOut 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: bottom center;
}

@keyframes printOut {
  0% { transform: translateY(80vh) scale(0.6) rotate(5deg); opacity: 0; }
  40% { transform: translateY(-20px) scale(1.02) rotate(-1deg); opacity: 1; }
  60% { transform: translateY(5px) scale(0.99) rotate(0deg); }
  80% { transform: translateY(-3px) scale(1) rotate(0deg); }
  100% { transform: translateY(0) scale(1) rotate(0deg); opacity: 1; }
}

.print-slide img {
  width: 100%;
  display: block;
  border-radius: 4px;
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */

@media (min-width: 600px) {
  .layout-grid { grid-template-columns: repeat(4, 1fr); }
  .payment-options { gap: 16px; }
  .payment-option { padding: 16px; }
  .qrcode-placeholder { width: 220px; height: 220px; }
  .brand-title { font-size: 3.5rem; }
  .start-title { font-size: 3.8rem; }
}

@media (max-height: 600px) {
  .brand-title { font-size: 2rem; }
  .brand-subtitle { font-size: 1.1rem; }
  .logo-icon-wrapper { width: 70px; height: 70px; }
  .logo-camera-icon { font-size: 2.5rem; }
  .layout-content { padding-top: 70px; }
  .filter-content { padding-top: 70px; }
  .screen-content { gap: 10px; }
  .screen-title { font-size: 1.4rem; }
  .screen-subtitle { font-size: 1rem; }
  .start-title { font-size: 2.2rem; }
  .btn-start { font-size: 1.5rem; padding: 14px 40px; }
  .brand-dots { display: none; }
  .layout-grid { gap: 10px; }
  .layout-option { padding: 10px; }
  .filter-preview-wrapper { max-height: 40vh; }
  .qrcode-placeholder { width: 130px; height: 130px; }
  .qrcode-placeholder.large { width: 160px; height: 160px; }
  .result-title { font-size: 1.6rem; }
  .btn-lg { padding: 12px 24px; font-size: 0.95rem; }
  .frame-select-section, .theme-select-section { display: none; }
}

@media (max-height: 480px) {
  .screen-header { padding: 10px 16px; }
  .screen-title { font-size: 1.2rem; }
  .screen-subtitle { font-size: 0.85rem; }
  .layout-content { padding-top: 50px; gap: 8px; }
  .layout-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .layout-option { padding: 6px; }
  .layout-preview { display: none; }
  .brand-title { font-size: 1.5rem; }
  .brand-subtitle { display: none; }
  .payment-brand { font-size: 1.4rem; }
  .payment-options { gap: 6px; }
  .payment-option { padding: 8px 4px; font-size: 0.65rem; }
  .payment-icon { font-size: 1.2rem; }
  .screen-indicator { display: none; }
  .start-decoration { display: none; }
}

/* Landscape orientation */
@media (orientation: landscape) and (max-height: 500px) {
  .screen-0 .screen-content, .screen-2 .screen-content {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
  .brand-logo { margin-bottom: 0; }
  .logo-icon-wrapper { width: 50px; height: 50px; }
  .logo-camera-icon { font-size: 1.8rem; }
  .brand-title { font-size: 1.6rem; }
  .brand-subtitle { font-size: 0.9rem; }
  .brand-tap { display: none; }
  .start-title { font-size: 1.8rem; }
  .start-subtitle { font-size: 1rem; }
  .btn-start { font-size: 1.2rem; padding: 10px 30px; }
  .start-decoration { display: none; }
}

/* ════════════════════════════════════════════════════════════
   NEW FEATURES
   ════════════════════════════════════════════════════════════ */

/* ─── Language Toggle ─── */
.lang-toggle {
  position: fixed;
  top: 16px;
  left: 16px;
  display: flex;
  gap: 2px;
  z-index: 60;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-lg);
  padding: 3px;
  border: 1px solid rgba(255,255,255,0.15);
}
.lang-btn {
  padding: 4px 12px;
  border: none;
  border-radius: var(--radius-lg);
  font-family: var(--font-nunito);
  font-size: 0.7rem;
  font-weight: 700;
  background: transparent;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: var(--transition);
}
.lang-btn.active {
  background: var(--white);
  color: var(--maroon);
}
.screen-4 ~ .lang-toggle { background: rgba(255,255,255,0.2); }

/* ─── Music Player ─── */
.music-player {
  position: fixed;
  bottom: 70px;
  right: 16px;
  z-index: 55;
}
.music-toggle {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  border: 2px solid rgba(255,255,255,0.3);
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}
.music-toggle:hover { background: rgba(0,0,0,0.6); transform: scale(1.1); }
.music-toggle.playing { border-color: var(--gold); animation: musicPulse 1.5s ease-in-out infinite; }

@keyframes musicPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,215,0,0.4); }
  50% { box-shadow: 0 0 20px 4px rgba(255,215,0,0.2); }
}

.music-dropdown {
  position: absolute;
  bottom: 52px;
  right: 0;
  width: 200px;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-md);
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  display: none;
}
.music-dropdown.show { display: block; }

.music-dropdown-title {
  font-family: var(--font-nunito);
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
  margin-bottom: 8px;
}
.music-track-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.music-track-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.8);
  font-family: var(--font-nunito);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}
.music-track-btn:hover { background: rgba(255,255,255,0.15); }
.music-track-btn.active { background: rgba(255,215,0,0.2); color: var(--gold); }
.music-track-btn .track-icon { font-size: 1rem; }

/* ─── Share Actions ─── */
.share-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  flex-wrap: wrap;
  justify-content: center;
}
.btn-share {
  flex: 1;
  min-width: 100px;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-nunito);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  color: white;
}
#shareWaBtn { background: #25D366; }
#shareWaBtn:hover { transform: scale(1.05); box-shadow: 0 4px 20px rgba(37,211,102,0.4); }
#shareIgBtn { background: linear-gradient(45deg, #F58529, #DD2A7B, #8134AF); }
#shareIgBtn:hover { transform: scale(1.05); box-shadow: 0 4px 20px rgba(221,42,123,0.4); }
#shareMoreBtn { background: rgba(255,255,255,0.2); border: 2px solid rgba(255,255,255,0.3); }
#shareMoreBtn:hover { background: rgba(255,255,255,0.3); transform: scale(1.05); }

/* ─── Camera Feature Bar ─── */
.camera-feature-bar {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 7;
}
.feature-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 2px solid rgba(255,255,255,0.3);
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.feature-btn:hover { background: rgba(0,0,0,0.6); }
.feature-btn.active { border-color: var(--gold); background: rgba(255,215,0,0.2); }

/* ─── Camera Badges ─── */
.camera-badge {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 7;
}
.badge-item {
  padding: 4px 10px;
  border-radius: var(--radius-lg);
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  font-family: var(--font-nunito);
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.15);
}
.badge-item.active-badge { border-color: var(--gold); background: rgba(255,215,0,0.2); }

.camera-auto-hint {
  position: absolute;
  bottom: 150px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  padding: 8px 20px;
  border-radius: var(--radius-lg);
  font-family: var(--font-nunito);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--white);
  z-index: 11;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadePulse 1.5s ease-in-out infinite;
}

/* ─── Watermark Toggle ─── */
.watermark-toggle-section {
  width: 100%;
}
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.toggle-row:hover { background: rgba(255,255,255,0.15); }
.toggle-label {
  flex: 1;
  font-family: var(--font-nunito);
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
}
.toggle-row input { display: none; }
.toggle-switch {
  width: 40px;
  height: 24px;
  background: rgba(255,255,255,0.2);
  border-radius: 12px;
  position: relative;
  transition: var(--transition);
}
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--white);
  transition: var(--transition);
}
.toggle-row input:checked + .toggle-switch { background: var(--maroon-light); }
.toggle-row input:checked + .toggle-switch::after { left: 18px; }

/* ─── Gallery ─── */
.gallery-content {
  padding-top: 80px;
  gap: 16px;
}
.gallery-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 4px;
  scrollbar-width: thin;
}
.gallery-grid::-webkit-scrollbar { width: 4px; }
.gallery-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 4px; }

.gallery-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  aspect-ratio: 1;
  cursor: pointer;
  transition: var(--transition);
  border: 3px solid rgba(255,255,255,0.15);
}
.gallery-item:hover { transform: scale(1.03); border-color: var(--white); }
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-item .gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-item .gallery-overlay button {
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--maroon);
  color: white;
  font-family: var(--font-nunito);
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
}

.gallery-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 20px;
  text-align: center;
}
.gallery-empty.show { display: flex; }
.gallery-empty-icon { font-size: 3rem; opacity: 0.5; }
.gallery-empty p {
  font-family: var(--font-nunito);
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
}

/* ─── Gallery Fullscreen Viewer ─── */
.gallery-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
}
.gallery-viewer.show { display: flex; }
.gallery-viewer img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}
.gallery-viewer-actions {
  display: flex;
  gap: 12px;
}
.gallery-viewer-actions button {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-nunito);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}
.gallery-viewer-actions .gv-download { background: var(--maroon-light); color: white; }
.gallery-viewer-actions .gv-delete { background: rgba(255,80,80,0.8); color: white; }
.gallery-viewer-actions .gv-close { background: rgba(255,255,255,0.2); color: white; }
.gallery-viewer-actions button:hover { transform: scale(1.05); }

/* ─── Slideshow / Booth Gallery Mode ─── */
.booth-slideshow {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.booth-slideshow.show { display: flex; }
.booth-slideshow img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.booth-slideshow .slideshow-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.5);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
}
.booth-slideshow .slideshow-counter {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.7);
  font-family: var(--font-nunito);
  font-size: 0.9rem;
  font-weight: 700;
  background: rgba(0,0,0,0.5);
  padding: 6px 16px;
  border-radius: var(--radius-lg);
}

/* ─── AR Face overlay canvas ─── */
.ar-overlay-canvas {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

/* ─── Beauty Filter intensity ─── */
.beauty-slider-container {
  position: absolute;
  bottom: 148px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  min-width: 160px;
}
.beauty-slider-container.show { display: flex; }
.beauty-slider-container label {
  font-family: var(--font-nunito);
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
}
.beauty-slider-container input {
  width: 100%;
  accent-color: var(--maroon-light);
}

/* ─── Screen 8 indicator ─── */
.screen-8 ~ .screen-indicator .indicator-dot:nth-child(9) { display: block; }

/* ─── Responsive for Gallery ─── */
@media (max-width: 400px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .share-actions { flex-direction: column; }
  .btn-share { min-width: auto; }
  .music-dropdown { right: 0; left: auto; width: 180px; }
}
@media (max-height: 600px) {
  .gallery-content { padding-top: 60px; }
  .gallery-grid { max-height: 50vh; }
}
