:root, [data-theme="light"] {
  /* Canvas & Surface */
  --bg-canvas: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-muted: #e2e8f0;

  /* Accent Crimson */
  --accent-red: #dc2626;
  --accent-red-hover: #b91c1c;
  --accent-red-active: #991b1b;
  --accent-red-subtle: #fef2f2;
  --accent-red-border: #fecaca;
  --accent-red-glow: rgba(220, 38, 38, 0.15);

  /* Status Accents */
  --accent-green: #10b981;
  --accent-green-subtle: #ecfdf5;
  --accent-green-border: #a7f3d0;
  --accent-green-text: #059669;

  --accent-gold: #d97706;
  --accent-gold-subtle: #fffbeb;

  /* Neutral Borders */
  --border-subtle: #f1f5f9;
  --border-default: #e2e8f0;
  --border-strong: #cbd5e1;

  /* Typography Colors */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --text-white: #ffffff;

  --dot-grid-color: #e2e8f0;
  --modal-overlay-bg: rgba(0, 0, 0, 0.7);

  /* Typography Families */
  --font-display: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', monospace;
  --font-body: 'Geist', 'Prompt', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-thai: 'Prompt', -apple-system, sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 20px 40px -10px rgba(0, 0, 0, 0.08), 0 1px 3px 0 rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] {
  /* Canvas & Surface */
  --bg-canvas: #090d16;
  --bg-surface: #0f172a;
  --bg-subtle: #1e293b;
  --bg-muted: #334155;

  /* Accent Crimson */
  --accent-red: #ef4444;
  --accent-red-hover: #dc2626;
  --accent-red-active: #b91c1c;
  --accent-red-subtle: rgba(239, 68, 68, 0.14);
  --accent-red-border: rgba(239, 68, 68, 0.35);
  --accent-red-glow: rgba(239, 68, 68, 0.3);

  /* Status Accents */
  --accent-green: #10b981;
  --accent-green-subtle: rgba(16, 185, 129, 0.12);
  --accent-green-border: rgba(16, 185, 129, 0.3);
  --accent-green-text: #34d399;

  --accent-gold: #fbbf24;
  --accent-gold-subtle: rgba(251, 191, 36, 0.1);

  /* Neutral Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.22);

  /* Typography Colors */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-white: #ffffff;

  --dot-grid-color: rgba(255, 255, 255, 0.06);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 40px -10px rgba(0, 0, 0, 0.7);
  --modal-overlay-bg: rgba(2, 6, 23, 0.8);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  background-image: radial-gradient(var(--dot-grid-color) 1px, transparent 1px);
  background-size: 24px 24px;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.booth-container {
  width: 100%;
  max-width: 1240px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px;
}

/* -------------------------------------------------------------------------- */
/* HEADER HUD                                                                 */
/* -------------------------------------------------------------------------- */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  padding: 8px 22px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
}

.brand-logo-img {
  height: 24px;
  width: auto;
  object-fit: contain;
}

.brand-title {
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: 1.5px;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.brand-divider {
  color: var(--border-strong);
  font-weight: 300;
}

.brand-sub {
  color: var(--accent-red);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 1.5px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-theme-toggle {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  font-size: 1rem;
}

.btn-theme-toggle:hover {
  border-color: var(--accent-red);
  transform: scale(1.06);
}

[data-theme="dark"] .theme-icon-sun {
  display: inline-block;
}

[data-theme="dark"] .theme-icon-moon {
  display: none;
}

:root:not([data-theme="dark"]) .theme-icon-sun {
  display: none;
}

:root:not([data-theme="dark"]) .theme-icon-moon {
  display: inline-block;
}

.badge {
  background: var(--accent-green-subtle);
  border: 1px solid var(--accent-green-border);
  color: var(--accent-green-text);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 700;
}

/* -------------------------------------------------------------------------- */
/* MAIN CONTENT & SCREENS                                                     */
/* -------------------------------------------------------------------------- */
.main-content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.step-screen {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hidden {
  display: none !important;
}

/* -------------------------------------------------------------------------- */
/* STEP 1: THEME SELECTION                                                    */
/* -------------------------------------------------------------------------- */
.theme-select-box {
  width: 100%;
  max-width: 980px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  padding: 40px;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  gap: 32px;
  box-shadow: var(--shadow-xl);
}

.step-title-area {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-tag {
  color: var(--accent-red);
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: 2px;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.step-title-area h2 {
  font-family: var(--font-heading);
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.step-desc {
  color: var(--text-muted);
  font-size: 0.98rem;
}

.presets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.preset-card {
  background: var(--bg-surface);
  border: 2px solid var(--border-default);
  padding: 12px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.preset-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.preset-card.active {
  border-color: var(--accent-red);
  background: var(--accent-red-subtle);
  box-shadow: 0 4px 20px var(--accent-red-glow);
  transform: scale(1.02);
}

.preset-visual-box {
  position: relative;
  width: 100%;
  height: 140px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-subtle);
}

.preset-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}

.preset-card:hover .preset-preview-img {
  transform: scale(1.05);
}

.preset-visual-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.preset-placeholder-icon {
  font-size: 2.8rem;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
  transition: transform 0.2s ease;
}

.preset-card:hover .preset-placeholder-icon {
  transform: scale(1.1);
}

/* Stylized Theme Gradients */
.theme-cyberpunk {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #06b6d4 100%);
}

.theme-royal_gold {
  background: linear-gradient(135deg, #18181b 0%, #78350f 50%, #f59e0b 100%);
}

.theme-retro_vintage {
  background: linear-gradient(135deg, #312e81 0%, #831843 50%, #f97316 100%);
}

.theme-anime_hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #4338ca 50%, #ec4899 100%);
}

.theme-cosmic_astronaut {
  background: linear-gradient(135deg, #000000 0%, #18181b 50%, #dc2626 100%);
}

.theme-hollywood_glam {
  background: linear-gradient(135deg, #09090b 0%, #881337 50%, #e11d48 100%);
}

.preset-tag-pill {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.15);
  pointer-events: none;
}

.preset-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 4px 4px;
}

.preset-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.preset-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.action-footer {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

/* -------------------------------------------------------------------------- */
/* STEP 2: CAMERA CAPTURE                                                     */
/* -------------------------------------------------------------------------- */
.camera-card {
  width: 100%;
  max-width: 980px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  padding: 32px;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-shadow: var(--shadow-xl);
}

.camera-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-text {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-text:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: var(--bg-subtle);
}

.selected-badge {
  background: var(--accent-red-subtle);
  border: 1px solid var(--accent-red-border);
  color: var(--accent-red);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  font-weight: 700;
}

/* INPUT MODE TABS */
.input-mode-tabs {
  display: flex;
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 6px;
}

.mode-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.mode-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.6);
}

.mode-tab.active {
  background: var(--bg-surface);
  color: var(--accent-red);
  box-shadow: var(--shadow-sm);
}

.camera-wrapper {
  position: relative;
  width: 100%;
  height: 520px;
  background-color: #090d16;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-default);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

/* FLOATING FLIP CAMERA BUTTON */
.btn-icon-floating {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 15;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.2s;
}

.btn-icon-floating:hover {
  background: var(--accent-red);
  transform: rotate(180deg);
}

/* UPLOAD WRAPPER */
.upload-wrapper {
  position: relative;
  width: 100%;
  height: 520px;
  background-color: var(--bg-canvas);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border-strong);
  transition: all 0.2s;
}

.upload-dropzone {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 24px;
  position: relative;
}

.upload-dropzone.drag-over {
  border-color: var(--accent-red);
  background: var(--accent-red-subtle);
}

.upload-preview {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.upload-placeholder-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.upload-icon {
  font-size: 3.5rem;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.08));
}

.upload-placeholder-content h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

.upload-placeholder-content p {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 340px;
}

.btn-sm {
  padding: 8px 20px;
  font-size: 0.85rem;
  margin-top: 6px;
}

.capture-actions {
  display: flex;
  gap: 12px;
  width: 100%;
}

#webcam {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

/* VIEWFINDER GUIDES */
.viewfinder-guides {
  position: absolute;
  inset: 24px;
  pointer-events: none;
}

.vf-corner {
  position: absolute;
  width: 32px;
  height: 32px;
  border: 3px solid var(--accent-red);
}

.vf-corner.tl { top: 0; left: 0; border-right: none; border-bottom: none; }
.vf-corner.tr { top: 0; right: 0; border-left: none; border-bottom: none; }
.vf-corner.bl { bottom: 0; left: 0; border-right: none; border-top: none; }
.vf-corner.br { bottom: 0; right: 0; border-left: none; border-top: none; }

.vf-oval {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 260px;
  height: 340px;
  border: 2px dashed rgba(255, 255, 255, 0.35);
  border-radius: 50%;
}

/* FLASH SPIKE */
.camera-flash {
  position: absolute;
  inset: 0;
  background: #ffffff;
  z-index: 50;
  animation: flashBurst 0.6s ease-out forwards;
}

/* COUNTDOWN RING */
.countdown-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.countdown-ring {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 6px solid var(--accent-red);
  box-shadow: 0 0 40px rgba(220, 38, 38, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulseCountdown 1s infinite alternate ease-in-out;
}

#countdown-number {
  font-family: var(--font-heading);
  font-size: 6.5rem;
  font-weight: 900;
  color: #fff;
}

.btn-capture {
  width: 100%;
  padding: 16px;
  font-size: 1.2rem;
}

/* -------------------------------------------------------------------------- */
/* STEP 3: LOADING                                                            */
/* -------------------------------------------------------------------------- */
.loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
  background: var(--bg-surface);
  padding: 48px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-xl);
  max-width: 520px;
  width: 100%;
}

.spinner-ring {
  width: 80px;
  height: 80px;
  border: 5px solid var(--bg-subtle);
  border-top-color: var(--accent-red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: spin 1s linear infinite;
  box-shadow: 0 4px 16px var(--accent-red-glow);
}

.spinner-core {
  font-size: 1.8rem;
  animation: counterSpin 1s linear infinite;
}

.loading-box h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
}

#loading-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.progress-bar-wrapper {
  width: 100%;
  height: 8px;
  background: var(--bg-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-top: 10px;
}

.progress-bar-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #dc2626, #f87171);
  border-radius: var(--radius-pill);
  animation: progressFill 2.5s ease-in-out infinite;
}

/* -------------------------------------------------------------------------- */
/* STEP 4: RESULT & QR DOWNLOAD                                               */
/* -------------------------------------------------------------------------- */
.result-card {
  display: flex;
  gap: 40px;
  width: 100%;
  max-width: 1040px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  padding: 36px;
  border-radius: var(--radius-xl);
  align-items: center;
  box-shadow: var(--shadow-xl);
}

.result-image-box {
  flex: 1.2;
}

.photo-frame-container {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-lg);
  background: #000;
}

.photo-frame-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}



.qr-box {
  flex: 0.8;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.qr-badge-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-green-text);
  letter-spacing: 1.5px;
  background: var(--accent-green-subtle);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--accent-green-border);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-green-text);
  border-radius: 50%;
  animation: pulseGlow 1.8s infinite;
}

.qr-box h3 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
}

.qr-code-wrapper {
  background: #fff;
  padding: 14px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-default);
  box-shadow: var(--shadow-md);
}

.qr-code-wrapper img {
  width: 200px;
  height: 200px;
  display: block;
}

.qr-hint {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.result-buttons {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

/* -------------------------------------------------------------------------- */
/* BUTTON STYLES                                                              */
/* -------------------------------------------------------------------------- */
.btn-primary {
  background: var(--accent-red);
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 14px var(--accent-red-glow);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: var(--accent-red-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.25);
}

.btn-primary:active {
  background: var(--accent-red-active);
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--border-default);
  border-color: var(--border-strong);
}

.btn-download {
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.btn-text-btn {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.btn-text-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-subtle);
}



/* -------------------------------------------------------------------------- */
/* KEYFRAMES                                                                  */
/* -------------------------------------------------------------------------- */
@keyframes pulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

@keyframes pulseCountdown {
  0% { transform: scale(0.95); }
  100% { transform: scale(1.05); }
}

@keyframes flashBurst {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

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

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

@keyframes progressFill {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

/* -------------------------------------------------------------------------- */
/* MOBILE & RESPONSIVE LAYOUT                                                 */
/* -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  body {
    align-items: flex-start;
  }

  .booth-container {
    padding: 12px 12px 28px;
    min-height: 100dvh;
  }

  /* Compact 1-row header */
  .header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
  }

  .brand-badge {
    padding: 6px 12px;
    gap: 8px;
  }

  .brand-logo-img {
    height: 18px;
  }

  .brand-title {
    font-size: 0.78rem;
    letter-spacing: 1px;
  }

  .brand-divider,
  .brand-sub {
    display: none;
  }

  .header-right {
    gap: 6px;
  }

  .badge {
    padding: 6px 10px;
    font-size: 0.74rem;
  }

  /* STEP 1: MOBILE THEME SELECT */
  .theme-select-box {
    padding: 18px 14px;
    border-radius: var(--radius-lg);
    gap: 18px;
  }

  .step-tag {
    font-size: 0.72rem;
  }

  .step-title-area h2 {
    font-size: 1.35rem;
    line-height: 1.25;
  }

  .step-desc {
    font-size: 0.84rem;
  }

  .presets-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .preset-card {
    padding: 8px;
    border-radius: var(--radius-md);
    gap: 8px;
  }

  .preset-visual-box {
    height: 96px;
    border-radius: var(--radius-sm);
  }

  .preset-placeholder-icon {
    font-size: 2.2rem;
  }

  .preset-tag-pill {
    font-size: 0.68rem;
    padding: 3px 8px;
    bottom: 6px;
    left: 6px;
  }

  .preset-name {
    font-size: 0.9rem;
  }

  .preset-desc {
    font-size: 0.74rem;
    line-height: 1.25;
  }

  .action-footer {
    position: sticky;
    bottom: 12px;
    z-index: 20;
    margin-top: 4px;
  }

  .action-footer .btn-primary {
    width: 100%;
    padding: 14px 20px;
    font-size: 1.02rem;
    box-shadow: 0 4px 18px rgba(220, 38, 38, 0.4);
  }

  /* STEP 2: MOBILE CAMERA & UPLOAD */
  .camera-card {
    padding: 16px 14px;
    border-radius: var(--radius-lg);
    gap: 14px;
  }

  .camera-wrapper,
  .upload-wrapper {
    height: auto;
    aspect-ratio: 4 / 5;
    max-height: 52vh;
    border-radius: var(--radius-md);
  }

  .vf-oval {
    width: 200px;
    height: 270px;
  }

  .countdown-ring {
    width: 140px;
    height: 140px;
  }

  #countdown-number {
    font-size: 5rem;
  }

  .capture-actions {
    margin-top: 4px;
  }

  .btn-capture {
    padding: 14px;
    font-size: 1.05rem;
  }

  /* STEP 3: LOADING */
  .loading-box {
    padding: 36px 20px;
    border-radius: var(--radius-lg);
    gap: 16px;
  }

  .loading-box h2 {
    font-size: 1.3rem;
  }

  #loading-subtitle {
    font-size: 0.86rem;
  }

  /* STEP 4: MOBILE RESULT */
  .result-card {
    flex-direction: column;
    padding: 18px 14px;
    gap: 20px;
    border-radius: var(--radius-lg);
  }

  .result-image-box {
    width: 100%;
  }

  .photo-frame-container {
    aspect-ratio: 1 / 1;
    width: 100%;
    border-radius: var(--radius-md);
  }

  .qr-box {
    width: 100%;
    gap: 12px;
  }

  .qr-box h3 {
    font-size: 1.3rem;
  }

  .qr-code-wrapper {
    padding: 10px;
  }

  .qr-code-wrapper img {
    width: 150px;
    height: 150px;
  }

  .qr-hint {
    font-size: 0.82rem;
  }

  .result-buttons {
    gap: 8px;
  }

  .result-buttons .btn-primary,
  .result-buttons .btn-secondary,
  .result-buttons .btn-text-btn {
    padding: 12px 18px;
    font-size: 0.95rem;
  }
}
