/* ===================================================================
   QCam — AI Photography Co-Pilot
   Design System & Component Styles
   =================================================================== */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* --- Design Tokens --- */
:root {
  /* Surfaces */
  --bg-dark: #0A0A0F;
  --bg-glass: rgba(15, 15, 20, 0.55);
  --bg-glass-heavy: rgba(10, 10, 15, 0.75);
  --bg-glass-light: rgba(255, 255, 255, 0.06);

  /* Accents */
  --accent: hsl(45, 100%, 65%);
  --accent-glow: hsla(45, 100%, 65%, 0.3);
  --accent-green: hsl(145, 72%, 55%);
  --accent-green-glow: hsla(145, 72%, 55%, 0.35);
  --accent-red: hsl(0, 75%, 60%);
  --accent-red-glow: hsla(0, 75%, 60%, 0.25);

  /* Text */
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-tertiary: rgba(255, 255, 255, 0.35);

  /* Effects */
  --blur: blur(24px);
  --blur-light: blur(12px);

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Radii */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-full: 9999px;

  /* Spacing */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html, body {
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  font-family: var(--font);
  background: var(--bg-dark);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

body {
  position: relative;
}

/* Phone frame container — fills viewport on mobile, constrained on desktop */
.phone-frame {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-dark);
}

/* --- Loading State --- */
body:not(.app-ready) #app-overlay {
  opacity: 0;
}

body.app-ready #app-overlay {
  opacity: 1;
  transition: opacity 0.5s var(--ease-out);
}

/* ===================================================================
   CAMERA LAYER
   =================================================================== */

#viewfinder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  background: var(--bg-dark);
}

/* Camera denied — show gradient fallback */
body.camera-denied #viewfinder {
  background: linear-gradient(
    145deg,
    #0A0A0F 0%,
    #12121A 30%,
    #1A1A25 60%,
    #0F0F18 100%
  );
}

body.camera-denied #viewfinder::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 256px;
}

#capture-canvas {
  display: none;
}

/* ===================================================================
   OVERLAY WRAPPER
   =================================================================== */

#app-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

#app-overlay > * {
  pointer-events: auto;
}

/* ===================================================================
   TOP BAR
   =================================================================== */

#top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + var(--safe-top)) 16px 12px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 100%);
  z-index: 20;
}

.top-left, .top-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-center {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Icon buttons */
.icon-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--bg-glass);
  backdrop-filter: var(--blur-light);
  -webkit-backdrop-filter: var(--blur-light);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.icon-btn:active {
  transform: scale(0.9);
  background: var(--bg-glass-heavy);
}

.icon-btn svg {
  width: 22px;
  height: 22px;
}

.icon-btn.flash-on {
  background: var(--accent);
  color: #0A0A0F;
}

/* Back button */
#back-btn {
  width: 38px;
  height: 38px;
}

#back-btn.hidden {
  display: none;
}

/* Logo */
.logo {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.logo span {
  color: var(--accent);
}

/* ===================================================================
   SCORE PILL
   =================================================================== */

.score-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 5px;
  background: var(--bg-glass-heavy);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 0.4s, box-shadow 0.4s;
}

.score-pill.hidden {
  display: none;
}

.score-pill.tier-green {
  border-color: rgba(76, 217, 120, 0.3);
  box-shadow: 0 0 12px var(--accent-green-glow);
}

.score-pill.tier-gold {
  border-color: rgba(255, 204, 77, 0.25);
  box-shadow: 0 0 12px var(--accent-glow);
}

.score-pill.tier-red {
  border-color: rgba(217, 76, 76, 0.25);
  box-shadow: 0 0 12px var(--accent-red-glow);
}

.score-ring-wrapper {
  width: 36px;
  height: 36px;
  position: relative;
}

.score-ring-svg {
  width: 36px;
  height: 36px;
  transform: rotate(-90deg);
}

.score-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 3;
}

.score-ring-progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 113.1;
  stroke-dashoffset: 113.1;
  transition: stroke-dashoffset 0.6s var(--ease-in-out), stroke 0.4s;
}

.score-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.score-label-title {
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-tertiary);
}

.score-number-row {
  display: flex;
  align-items: baseline;
  gap: 1px;
}

#score-number {
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.score-percent {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ===================================================================
   SCENE BADGE
   =================================================================== */

.scene-badge-wrapper {
  display: flex;
  justify-content: center;
  padding-top: 4px;
}

.scene-badge-wrapper.hidden {
  display: none;
}

#scene-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: var(--bg-glass);
  backdrop-filter: var(--blur-light);
  -webkit-backdrop-filter: var(--blur-light);
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  animation: fadeSlideDown 0.4s var(--ease-out);
}

.badge-emoji {
  font-size: 15px;
}


/* ===================================================================
   CAMERA SETTINGS BAR
   =================================================================== */

.camera-settings {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 6px 16px;
  margin: 4px auto 0;
  width: fit-content;
  background: var(--bg-glass);
  backdrop-filter: var(--blur-light);
  -webkit-backdrop-filter: var(--blur-light);
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.06);
  animation: fadeSlideDown 0.4s var(--ease-out);
}

.camera-settings.hidden {
  display: none;
}

.setting-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 12px;
  gap: 1px;
}

.setting-label {
  font-size: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-tertiary);
}

.setting-value {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  transition: color 0.3s;
}

.setting-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
}

/* ===================================================================
   STEP PROGRESS DOTS
   =================================================================== */

.step-dots {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-glass);
  backdrop-filter: var(--blur-light);
  -webkit-backdrop-filter: var(--blur-light);
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.step-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transition: all 0.3s var(--ease-out);
}

.step-dot.dot-active {
  width: 20px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.step-dot.dot-done {
  background: rgba(255, 255, 255, 0.55);
}

/* ===================================================================
   PHOTO PREVIEW OVERLAY
   =================================================================== */

.photo-preview {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.photo-preview.preview-active {
  display: flex;
  animation: previewIn 0.4s var(--ease-out);
}

.photo-preview.preview-exit {
  animation: previewOut 0.4s ease-in forwards;
}

.photo-preview img {
  max-width: 88%;
  max-height: 70%;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
  object-fit: contain;
}

.preview-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 8px 20px;
  background: var(--bg-glass-heavy);
  backdrop-filter: var(--blur-light);
  -webkit-backdrop-filter: var(--blur-light);
  border-radius: var(--radius-full);
  border: 1px solid rgba(76, 217, 120, 0.25);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  animation: fadeSlideDown 0.5s var(--ease-out) 0.2s backwards;
}

.preview-check {
  color: var(--accent-green);
  font-weight: 700;
}

/* ===================================================================
   PICKER EXIT TRANSITION
   =================================================================== */

#scenario-picker.picker-exit {
  animation: pickerFadeOut 0.3s ease-in forwards;
}

/* ===================================================================
   VISUAL OVERLAY (Arrows, Face Box, etc.)
   =================================================================== */

.visual-overlay {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}

.visual-overlay.overlay-visible {
  opacity: 1;
}

/* Direction arrows */
.direction-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  animation: arrowBob 1.2s var(--ease-in-out) infinite;
}

.direction-arrow span {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 4px 12px;
  background: var(--bg-glass-heavy);
  backdrop-filter: var(--blur-light);
  -webkit-backdrop-filter: var(--blur-light);
  border-radius: var(--radius-full);
}

.arrow-up { animation-name: arrowBobUp; }
.arrow-left { 
  flex-direction: row;
  animation-name: arrowBobLeft;
}
.arrow-right { 
  flex-direction: row-reverse;
  animation-name: arrowBobRight;
}

/* Face detection box */
.face-detection-box {
  width: 120px;
  height: 150px;
  position: relative;
  animation: facePulse 1.5s ease-in-out infinite;
}

.face-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border: 3px solid var(--accent);
}

.face-corner.tl { top: 0; left: 0; border-right: none; border-bottom: none; border-radius: 4px 0 0 0; }
.face-corner.tr { top: 0; right: 0; border-left: none; border-bottom: none; border-radius: 0 4px 0 0; }
.face-corner.bl { bottom: 0; left: 0; border-right: none; border-top: none; border-radius: 0 0 0 4px; }
.face-corner.br { bottom: 0; right: 0; border-left: none; border-top: none; border-radius: 0 0 4px 0; }

/* Overlay indicators */
.overlay-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.overlay-sun span {
  font-size: 48px;
  animation: sunPulse 2s ease-in-out infinite;
}

.light-rays {
  width: 100px;
  height: 100px;
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, hsla(45, 100%, 65%, 0.15) 0%, transparent 70%);
  animation: rayPulse 2s ease-in-out infinite;
}

.low-light-icon {
  font-size: 40px;
  animation: moonGlow 2s ease-in-out infinite;
}

.low-light-text {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  padding: 4px 12px;
  background: var(--bg-glass-heavy);
  backdrop-filter: var(--blur-light);
  -webkit-backdrop-filter: var(--blur-light);
  border-radius: var(--radius-full);
}

/* Motion blur lines */
.overlay-motion {
  width: 160px;
  height: 80px;
}

.motion-lines {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.motion-line {
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--accent-red) 30%, var(--accent-red) 70%, transparent 100%);
  border-radius: 2px;
  animation: motionSlide 0.8s ease-in-out infinite;
}

.motion-line:nth-child(2) { animation-delay: 0.15s; width: 80%; margin-left: 10%; }
.motion-line:nth-child(3) { animation-delay: 0.3s; width: 60%; margin-left: 20%; }

/* Shake indicator */
.shake-icon {
  font-size: 40px;
  animation: shakeAnim 0.5s ease-in-out infinite;
}

/* Blend warning */
.overlay-blend {
  align-items: center;
}

.blend-outline {
  width: 100px;
  height: 160px;
  border: 2px dashed var(--accent-red);
  border-radius: var(--radius-sm);
  animation: blendPulse 1.5s ease-in-out infinite;
}

.blend-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent-red);
  padding: 4px 12px;
  background: var(--bg-glass-heavy);
  backdrop-filter: var(--blur-light);
  -webkit-backdrop-filter: var(--blur-light);
  border-radius: var(--radius-full);
  margin-top: 8px;
}

/* Contrast meter */
.contrast-bar {
  width: 140px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.contrast-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-red), var(--accent), var(--accent-green));
  border-radius: 3px;
  transition: width 0.6s var(--ease-out);
}

.contrast-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* Frame guide (rule of thirds) */
.frame-guide {
  position: absolute;
  inset: 15% 8%;
  pointer-events: none;
}

.frame-line {
  position: absolute;
  background: rgba(255, 255, 255, 0.2);
  animation: frameFadeIn 0.6s var(--ease-out);
}

.frame-h1 { left: 0; right: 0; top: 33.33%; height: 1px; }
.frame-h2 { left: 0; right: 0; top: 66.66%; height: 1px; }
.frame-v1 { top: 0; bottom: 0; left: 33.33%; width: 1px; }
.frame-v2 { top: 0; bottom: 0; left: 66.66%; width: 1px; }

/* Improving pulse */
.improving-pulse {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px solid var(--accent-green);
  animation: improvingPulse 1.5s ease-out infinite;
}

/* Ready ring */
.overlay-ready .ready-ring {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--accent-green);
  animation: readyPulse 1.2s ease-out infinite;
  box-shadow: 0 0 30px var(--accent-green-glow), inset 0 0 30px var(--accent-green-glow);
}

/* ===================================================================
   COPILOT LAYER (Suggestion Card + Breakdown)
   =================================================================== */

#copilot-layer {
  position: absolute;
  bottom: 140px;
  left: 0;
  right: 0;
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 0 20px calc(var(--safe-bottom));
  pointer-events: none;
}

#copilot-layer.hidden {
  display: none;
}

/* Suggestion Card */
.suggestion-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  max-width: 360px;
  width: 100%;
  background: var(--bg-glass-heavy);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: auto;
  will-change: transform, opacity;
  transform: translateY(20px);
  opacity: 0;
}

.suggestion-card.tier-green {
  border-color: rgba(76, 217, 120, 0.3);
  box-shadow: 0 4px 24px var(--accent-green-glow);
}

.suggestion-card.tier-gold {
  border-color: rgba(255, 204, 77, 0.2);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.suggestion-card.tier-red {
  border-color: rgba(217, 76, 76, 0.2);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.suggestion-card.card-enter {
  animation: cardSlideIn 0.4s var(--ease-out) forwards;
}

.suggestion-card.card-exit {
  animation: cardSlideOut 0.25s ease-in forwards;
}

#suggestion-icon {
  font-size: 28px;
  flex-shrink: 0;
  line-height: 1;
}

.suggestion-content {
  flex: 1;
  min-width: 0;
}

#suggestion-text {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

#suggestion-subtext {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.3;
}

/* Score Breakdown */
.score-breakdown {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 360px;
  padding: 12px 16px;
  background: var(--bg-glass);
  backdrop-filter: var(--blur-light);
  -webkit-backdrop-filter: var(--blur-light);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.breakdown-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.breakdown-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-tertiary);
  width: 90px;
  flex-shrink: 0;
}

.breakdown-track {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.breakdown-bar {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 0.5s var(--ease-out), background-color 0.4s;
}

.breakdown-val {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  width: 32px;
  text-align: right;
  flex-shrink: 0;
}

/* ===================================================================
   BOTTOM BAR
   =================================================================== */

#bottom-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px calc(20px + var(--safe-bottom));
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 100%);
}

/* Gallery thumbnail */
.gallery-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background-color: rgba(255, 255, 255, 0.08);
  background-size: cover;
  background-position: center;
  border: 2px solid rgba(255, 255, 255, 0.15);
  transition: border-color 0.3s;
}

.gallery-thumb.has-photo {
  border-color: rgba(255, 255, 255, 0.4);
}

/* Shutter button */
.shutter-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s var(--ease-out);
}

.shutter-btn:active {
  transform: scale(0.92);
}

.shutter-outer {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3.5px solid rgba(255, 255, 255, 0.85);
  transition: border-color 0.4s, box-shadow 0.4s;
}

.shutter-inner {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  transition: background 0.3s, transform 0.15s var(--ease-out);
}

.shutter-btn:active .shutter-inner {
  transform: scale(0.88);
}

/* Shutter ready state */
.shutter-btn.shutter-ready .shutter-outer {
  border-color: var(--accent-green);
  box-shadow: 0 0 20px var(--accent-green-glow), 0 0 40px var(--accent-green-glow);
  animation: shutterPulse 1.5s ease-in-out infinite;
}

.shutter-btn.shutter-ready .shutter-inner {
  background: rgba(76, 217, 120, 0.2);
}

/* Flip button */
.flip-btn {
  width: 48px;
  height: 48px;
}

.flip-btn.flip-spin svg {
  animation: flipSpin 0.5s var(--ease-out);
}

/* ===================================================================
   CAPTURE FLASH
   =================================================================== */

#capture-flash {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: white;
  opacity: 0;
  pointer-events: none;
  transition: none;
}

#capture-flash.flash-active {
  animation: captureFlash 0.3s ease-out;
}

/* ===================================================================
   SCENARIO PICKER
   =================================================================== */

#scenario-picker {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

#scenario-picker.hidden {
  display: none;
}

.picker-header {
  text-align: center;
  margin-bottom: 32px;
  animation: fadeSlideDown 0.6s var(--ease-out);
}

.picker-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.picker-title span {
  color: var(--accent);
}

.picker-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 400;
}

#scenario-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 380px;
}

.scenario-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--bg-glass-heavy);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s var(--ease-out), border-color 0.3s, box-shadow 0.3s;
  text-align: left;
  font-family: inherit;
  animation: cardStagger 0.5s var(--ease-out) backwards;
}

.scenario-card:nth-child(1) { animation-delay: 0.1s; }
.scenario-card:nth-child(2) { animation-delay: 0.2s; }
.scenario-card:nth-child(3) { animation-delay: 0.3s; }

.scenario-card:hover, .scenario-card:focus-visible {
  border-color: rgba(255, 204, 77, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transform: scale(1.02);
}

.scenario-card:active {
  transform: scale(0.98);
}

.scenario-emoji {
  font-size: 32px;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass-light);
  border-radius: var(--radius-sm);
}

.scenario-info {
  flex: 1;
  min-width: 0;
}

.scenario-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}

.scenario-desc {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
}

.scenario-arrow {
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: color 0.2s, transform 0.2s;
}

.scenario-card:hover .scenario-arrow {
  color: var(--accent);
  transform: translateX(2px);
}

/* ===================================================================
   KEYFRAME ANIMATIONS
   =================================================================== */

@keyframes cardSlideIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes cardSlideOut {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-10px);
    opacity: 0;
  }
}

@keyframes fadeSlideDown {
  from {
    transform: translateY(-12px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes cardStagger {
  from {
    transform: translateY(16px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes arrowBobUp {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes arrowBobLeft {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-10px); }
}

@keyframes arrowBobRight {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(10px); }
}

@keyframes arrowBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes facePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes sunPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.8; }
}

@keyframes rayPulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.3); opacity: 0.15; }
}

@keyframes moonGlow {
  0%, 100% { text-shadow: 0 0 12px rgba(255, 255, 255, 0.3); }
  50% { text-shadow: 0 0 24px rgba(255, 255, 255, 0.6); }
}

@keyframes motionSlide {
  0%, 100% { transform: translateX(0); opacity: 0.6; }
  50% { transform: translateX(8px); opacity: 1; }
}

@keyframes shakeAnim {
  0%, 100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-4px) rotate(-2deg); }
  75% { transform: translateX(4px) rotate(2deg); }
}

@keyframes blendPulse {
  0%, 100% { opacity: 1; border-color: var(--accent-red); }
  50% { opacity: 0.4; border-color: rgba(217, 76, 76, 0.3); }
}

@keyframes frameFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes improvingPulse {
  0% { transform: scale(1); opacity: 0.6; border-width: 2px; }
  100% { transform: scale(2); opacity: 0; border-width: 1px; }
}

@keyframes readyPulse {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 0.4; }
  100% { transform: scale(1); opacity: 0.8; }
}

@keyframes shutterPulse {
  0%, 100% { box-shadow: 0 0 16px var(--accent-green-glow); }
  50% { box-shadow: 0 0 32px var(--accent-green-glow), 0 0 48px rgba(76, 217, 120, 0.15); }
}

@keyframes captureFlash {
  0% { opacity: 0; }
  30% { opacity: 0.85; }
  100% { opacity: 0; }
}

@keyframes flipSpin {
  from { transform: rotateY(0); }
  to { transform: rotateY(180deg); }
}

/* --- Utility: button shake --- */
.btn-shake {
  animation: shakeBtn 0.4s ease-in-out;
}

@keyframes shakeBtn {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}


/* --- Photo preview animations --- */
@keyframes previewIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes previewOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(1.02); }
}

/* --- Picker exit --- */
@keyframes pickerFadeOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.96); }
}

/* ===================================================================
   RESPONSIVE / DESKTOP PREVIEW
   =================================================================== */

@media (min-width: 480px) {
  /* On desktop, constrain to phone-like proportions */
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #050508;
  }

  .phone-frame {
    width: 390px;
    height: 844px;
    max-height: 100dvh;
    border-radius: 40px;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06), 0 20px 60px rgba(0, 0, 0, 0.5);
  }

  #viewfinder {
    border-radius: 40px;
  }

  #scenario-picker {
    border-radius: 40px;
  }
}

