/* ==========================================================================
   Wedding Virtual Photobooth - Modern Luxury Styling
   ========================================================================== */

@font-face {
  font-family: 'Rustico';
  src: url('/fonts/Rustico.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --primary: #7A1426; /* Deep romantic wedding maroon */
  --primary-dark: #580B1A;
  --primary-light: #FCEEEA; /* Delicate cream-pink */
  --primary-gradient: linear-gradient(135deg, #8C1C30 0%, #680E1E 100%);
  --primary-glow: 0 4px 20px rgba(122, 20, 38, 0.32);
  
  --bg-main: #F7EFE4; /* Warm noticeable wedding cream */
  --bg-secondary: #EFE4D6;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-dark: #1F0D11; /* Deep maroon night for camera/modals */
  
  --text-dark: #2A181B; /* Very dark warm charcoal for high contrast */
  --text-muted: #74575C; /* Warm dusty rose gray */
  --text-light: #FDF8F5;
  
  --maroon: #7A1426;
  --maroon-dark: #580B1A;
  --maroon-light: #942238;
  --maroon-gradient: linear-gradient(135deg, #8C1C30 0%, #680E1E 100%);
  --maroon-glow: 0 4px 20px rgba(122, 20, 38, 0.32);
  
  --pink-soft: #F9EBE6; /* Soft blush cream-pink */
  --pink-tint: #F2DCD6; /* Dusty rose tint */
  --pink-accent: #D98895; /* Elegant rose pink */
  --pink-rose: #B84D60;
  
  --border-light: rgba(122, 20, 38, 0.16);
  --border-pink: #E8D0C9;
  --border-glass: rgba(255, 255, 255, 0.6);
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  --shadow-subtle: 0 4px 16px rgba(122, 20, 38, 0.05);
  --shadow-card: 0 10px 30px rgba(88, 11, 26, 0.08);
  --shadow-float: 0 16px 40px rgba(88, 11, 26, 0.15);

  --font-rustico: 'Rustico', 'Cinzel', sans-serif;
  --font-serif: 'Playfair Display', 'Cinzel', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-script: 'Great Vibes', 'Alex Brush', cursive;
}

/* Reset & Basics */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-dark);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* App Container */
.app-container {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  background-color: var(--bg-main);
  box-shadow: 0 0 40px rgba(122, 20, 38, 0.08);
}

/* Background Atmosphere */
.bg-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: 
    radial-gradient(circle at 12% 12%, rgba(245, 218, 212, 0.7) 0%, transparent 45%),
    radial-gradient(circle at 88% 88%, rgba(217, 136, 149, 0.22) 0%, transparent 45%),
    linear-gradient(180deg, #F9F2E7 0%, #F5ECE0 100%);
}

/* Views / Screens */
.view-screen {
  display: none !important;
  flex-direction: column;
  flex: 1;
  width: 100%;
  position: relative;
  z-index: 1;
}

.view-screen.active {
  display: flex !important;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.top-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--pink-soft);
  border: 1px solid var(--border-pink);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--maroon);
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(122, 20, 38, 0.04);
}

.admin-link-btn {
  background: var(--pink-soft);
  border: 1px solid var(--border-pink);
  color: var(--maroon);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.admin-link-btn:hover {
  color: var(--maroon-dark);
  background: var(--pink-tint);
}

/* ==========================================================================
   Landing Page
   ========================================================================== */
.landing-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 20px calc(56px + env(safe-area-inset-bottom, 0px));
  min-height: calc(100vh - 80px);
  min-height: calc(100dvh - 80px);
}

.wedding-prefix {
  font-family: 'Cinzel', var(--font-serif);
  font-size: 0.95rem;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--primary-dark);
  font-weight: 600;
  margin-bottom: 6px;
}

.wedding-couple-names {
  font-family: var(--font-rustico);
  font-size: clamp(2.6rem, 8.5vw, 4.2rem);
  font-weight: normal;
  color: var(--maroon);
  line-height: 1.15;
  margin: 6px 0 12px;
  letter-spacing: 2px;
  text-align: center;
  text-shadow: 0 2px 10px rgba(128, 0, 0, 0.12);
}

.wedding-date-venue {
  font-size: 1.1rem;
  letter-spacing: 4px;
  color: var(--primary-dark);
  font-weight: 700;
  margin-bottom: 28px;
}

.landing-welcome-box {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  margin-bottom: 28px;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-subtle);
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.wedding-welcome-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  width: 100%;
}

.wedding-welcome-text .welcome-line,
.landing-welcome-box p {
  font-size: 0.94rem;
  color: var(--text-muted);
  line-height: 1.55;
  text-align: center;
  margin: 0;
  width: 100%;
  word-break: break-word;
}

.wedding-welcome-text .welcome-line:first-child {
  font-weight: 600;
  color: var(--maroon);
}

.landing-cta-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  width: 100%;
  max-width: 320px;
}

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

.btn-primary {
  background: var(--maroon-gradient);
  color: #FFF;
  box-shadow: var(--maroon-glow);
}

.btn-primary:hover {
  opacity: 0.96;
  box-shadow: 0 6px 24px rgba(122, 20, 38, 0.45);
}

.btn-secondary {
  background: #FFF;
  color: var(--maroon);
  border: 1.5px solid var(--border-pink);
}

.btn-secondary:hover {
  background: var(--pink-soft);
}

.btn-dark {
  background: var(--bg-dark);
  color: #FFF;
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   In-App Browser Warning Alert
   ========================================================================== */
.inapp-alert-banner {
  display: none;
  background: #FDF3F1;
  border: 1px solid #ECC6BE;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin: 12px 20px;
  text-align: left;
  box-shadow: 0 4px 12px rgba(122, 20, 38, 0.08);
}

.inapp-alert-banner.show {
  display: block;
}

.inapp-header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--maroon);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.inapp-desc {
  font-size: 0.8rem;
  color: #6C3D43;
  line-height: 1.4;
  margin-bottom: 10px;
}

.inapp-actions {
  display: flex;
  gap: 8px;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.8rem;
  width: auto;
  border-radius: var(--radius-md);
}

/* ==========================================================================
   Setup Screen (Frame & Timer Choice)
   ========================================================================== */
.setup-content {
  flex: 1;
  padding: 16px 20px calc(56px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--maroon);
  margin-bottom: 4px;
  text-align: center;
}

.section-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 20px;
}

.orientation-selector-wrapper {
  margin-bottom: 22px;
  display: flex;
  justify-content: center;
  width: 100%;
}

.orientation-pills-row {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 300px;
  background: var(--pink-soft);
  border: 1.5px solid var(--border-pink);
  padding: 4px;
  border-radius: var(--radius-full);
  box-shadow: inset 0 1px 3px rgba(122, 20, 38, 0.06);
  user-select: none;
  gap: 0;
}

/* Sliding background indicator pill */
.orientation-slider-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: var(--radius-full);
  background: var(--maroon-gradient);
  box-shadow: 0 4px 14px rgba(122, 20, 38, 0.32);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 1;
  will-change: transform;
}

/* Fallback CSS translation */
.orientation-pills-row[data-orientation="portrait"] .orientation-slider-indicator {
  transform: translateX(0);
}

.orientation-pills-row[data-orientation="landscape"] .orientation-slider-indicator {
  transform: translateX(100%);
}

.orientation-pill {
  position: relative;
  z-index: 2;
  flex: 1 1 50%;
  min-width: 0;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 16px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.25s ease, transform 0.15s ease;
  user-select: none;
}

.orientation-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  text-box: trim-both cap alphabetic;
}

.orientation-pill.selected {
  background: transparent;
  color: #FFF;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(88, 11, 26, 0.25);
}

.orientation-pill:active {
  transform: scale(0.97);
}

@media (prefers-reduced-motion: reduce) {
  .orientation-slider-indicator {
    transition: none !important;
  }
  .orientation-pill {
    transition: none !important;
  }
}

.frame-carousel-container {
  margin-bottom: 24px;
}

.frame-options-list {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 8px 4px 16px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.frame-options-list::-webkit-scrollbar {
  height: 6px;
}

.frame-options-list::-webkit-scrollbar-thumb {
  background: var(--border-pink);
  border-radius: 4px;
}

.frame-card-option {
  flex: 0 0 160px;
  scroll-snap-align: center;
  border-radius: var(--radius-md);
  background: #FFF;
  border: 2px solid transparent;
  padding: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.frame-card-option.wide-canvas {
  flex: 0 0 220px;
}

.frame-card-option.selected {
  border-color: var(--maroon);
  box-shadow: 0 8px 24px rgba(122, 20, 38, 0.22);
  transform: translateY(-2px);
}

.frame-thumb-box {
  width: 100%;
  aspect-ratio: 9/16;
  background: var(--pink-soft);
  border: 1px solid var(--border-pink);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.frame-thumb-box.wide-canvas {
  aspect-ratio: 16/9;
}

.frame-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.frame-name-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dark);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* ==========================================================================
   Camera Viewport Screen
   ========================================================================== */
#camera-screen {
  background: #000;
  color: #FFF;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  width: 100%;
}

#camera-screen.active {
  display: flex !important;
  flex-direction: column;
}

#camera-screen:not(.active) {
  display: none !important;
}

.camera-header-bar {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  z-index: 20;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 18px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #000;
  flex-shrink: 0;
}

.slot-indicator-pill {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #FFF;
}

.camera-controls-top {
  display: flex;
  gap: 10px;
}

.cam-btn-circle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  border: none;
  color: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

/* Top Bar Timer Dropdown */
.cam-timer-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.cam-btn-pill {
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  background: rgba(28, 10, 14, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(238, 215, 207, 0.35);
  color: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.cam-btn-pill:hover,
.cam-btn-pill.menu-open {
  background: rgba(122, 20, 38, 0.8);
  border-color: rgba(238, 215, 207, 0.6);
}

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

.cam-timer-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
}

.timer-badge-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.72rem;
  font-family: var(--font-sans);
  letter-spacing: -0.02em;
  background: var(--pink-accent, #F06292);
  color: #1C0A0E;
  padding: 1px 6px;
  border-radius: 999px;
  min-width: 24px;
  height: 20px;
  line-height: 1;
}

.cam-timer-label {
  font-family: var(--font-sans);
  letter-spacing: 0.02em;
  font-weight: 700;
}

.timer-caret {
  transition: transform 0.2s ease;
  margin-left: 2px;
}

.cam-btn-pill.menu-open .timer-caret {
  transform: rotate(180deg);
}

.cam-timer-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: rgba(28, 10, 14, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(238, 215, 207, 0.35);
  border-radius: 12px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.95);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
}

.cam-timer-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.cam-timer-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.88);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.cam-timer-option:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #FFF;
}

.cam-timer-option.active {
  background: var(--maroon-gradient);
  color: #FFF;
  font-weight: 700;
}

.cam-timer-option.active .timer-badge-num {
  background: #FFF;
  color: var(--maroon);
}

.timer-opt-icon {
  font-size: 0.9rem;
}

.timer-opt-text {
  flex: 1;
}

.timer-opt-check {
  font-size: 0.85rem;
  opacity: 0;
  color: #FFF;
  font-weight: 800;
}

.cam-timer-option.active .timer-opt-check {
  opacity: 1;
}

.camera-viewport {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #0D0D0D;
}

#camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

#camera-video.mirrored {
  transform: scaleX(-1);
}

/* Crop guide overlay bounded within camera viewport */
.camera-crop-guide {
  position: absolute;
  pointer-events: none;
  border: 2.5px dashed rgba(255, 255, 255, 0.75);
  border-radius: 16px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.42);
  width: 92%;
  aspect-ratio: 3/4;
  max-height: 94%;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.camera-crop-guide.landscape {
  width: 94%;
  aspect-ratio: 760 / 360;
  max-height: 92%;
}

.camera-crop-guide::after {
  content: attr(data-label);
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}

/* Shutter flash effect */
.camera-flash {
  position: absolute;
  inset: 0;
  background: #FFF;
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  transition: opacity 0.08s ease-out;
}

.camera-flash.flash-active {
  opacity: 1;
}

/* Big countdown overlay */
.countdown-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

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

.countdown-number {
  font-size: 7.5rem;
  font-family: var(--font-serif);
  font-weight: 800;
  color: #FFF;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6), 0 0 40px rgba(148, 34, 56, 0.85);
  animation: countdownPulse 0.9s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

@keyframes countdownPulse {
  0% { transform: scale(0.6); opacity: 0; }
  40% { transform: scale(1.15); opacity: 1; }
  75% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.2; }
}

/* Bottom Bar Controls - Dedicated control bar below camera viewport */
.camera-bottom-bar {
  position: relative;
  bottom: auto;
  left: auto;
  right: auto;
  width: 100%;
  height: calc(108px + env(safe-area-inset-bottom, 0px));
  padding: 10px 20px calc(14px + env(safe-area-inset-bottom, 0px));
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  z-index: 25;
}

.shutter-btn-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.shutter-btn {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-full);
  background: #FFF;
  border: 4px solid var(--maroon);
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  box-shadow: 0 0 24px rgba(122, 20, 38, 0.65);
  pointer-events: auto !important;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.shutter-btn-inner {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--maroon-gradient);
  transition: all 0.15s ease;
  pointer-events: none;
}

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

.shutter-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none !important;
}

.slot-progress-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 18px;
  background: rgba(28, 10, 14, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 2px;
  pointer-events: auto;
}

.progress-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.35);
  transition: all 0.3s ease;
}

.progress-dot.active {
  background: var(--pink-accent);
  box-shadow: 0 0 10px var(--pink-accent);
  transform: scale(1.3);
}

.progress-dot.completed {
  background: #FFF;
}

/* ==========================================================================
   Modern Dialog Modal (Complies with prevent-page-scroll-under-modal-dialog)
   ========================================================================== */
dialog:modal {
  /* MANDATORY from modern-web-guidance */
  overscroll-behavior: contain;
  margin: auto;
  border: 1px solid var(--border-pink);
  background: #FFFDFB;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  width: 90%;
  max-width: 420px;
  padding: 24px;
}

dialog::backdrop {
  /* MANDATORY from modern-web-guidance */
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(31, 13, 17, 0.65);
  backdrop-filter: blur(4px);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 14px;
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--maroon);
  text-align: center;
  width: 100%;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
}

.slot-preview-box {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  margin: 0 auto 18px;
  position: relative;
  border: 1px solid var(--border-pink);
  box-shadow: var(--shadow-card);
  transition: aspect-ratio 0.2s ease;
}

.slot-preview-box.landscape {
  aspect-ratio: 760 / 360;
}

.slot-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slot-preview-card-wrap {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  width: 100% !important;
  margin: 0 auto !important;
}

.modal-actions,
#slot-preview-modal .modal-actions {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: center !important;
  gap: 8px !important;
  width: 100% !important;
  margin: 0 auto !important;
  text-align: center !important;
  box-sizing: border-box !important;
}

.modal-actions .btn,
#slot-preview-modal .modal-actions .btn {
  width: 100% !important;
  max-width: none !important;
  margin: 0 auto !important;
  justify-content: center !important;
  text-align: center !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  padding: 10px 16px !important;
  font-size: 0.88rem !important;
}

@media (orientation: landscape) {
  #slot-preview-modal {
    max-width: min(92vw, 580px);
    width: fit-content;
    padding: 12px 18px;
    max-height: 94vh;
    overflow-y: auto;
  }
  #slot-preview-modal[open] {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  #slot-preview-modal .modal-header {
    margin-bottom: 8px;
    width: 100%;
    text-align: center;
  }
  #slot-preview-modal .modal-title {
    font-size: 1.05rem;
  }
  #slot-preview-modal .slot-preview-card-wrap {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: fit-content !important;
    margin: 0 auto !important;
  }
  #slot-preview-modal .slot-preview-box {
    margin: 0 auto 10px;
    border-radius: var(--radius-md);
    overflow: hidden;
  }
  #slot-preview-modal .slot-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  #slot-preview-modal .modal-actions {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
  }
  #slot-preview-modal .modal-actions .btn {
    width: 100% !important;
    max-width: none !important;
    padding: 9px 14px !important;
    font-size: 0.85rem !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
  }
}

/* ==========================================================================
   4-Slot Review Grid Screen
   ========================================================================== */
.review-content {
  flex: 1;
  padding: 16px 20px calc(56px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
}

.review-grid-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 12px;
  margin: 16px 0 24px;
}

.review-grid-container.strip-1x4,
.review-grid-container.strip-single-col {
  grid-template-columns: 1fr;
  max-width: 320px;
  margin: 16px auto 24px;
  gap: 12px;
}

.review-slot-card {
  position: relative;
  aspect-ratio: 3/4;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
  border: 2px solid var(--border-pink);
  background: #FAF2EE;
  transition: aspect-ratio 0.2s ease;
}

.review-slot-card.landscape {
  aspect-ratio: 760 / 360;
}

.review-slot-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slot-badge-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(31, 13, 17, 0.75);
  color: #FFF;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(4px);
}

.retake-slot-overlay-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--maroon);
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--border-pink);
  padding: 5px 10px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.retake-slot-overlay-btn:active {
  transform: scale(0.94);
}

/* ==========================================================================
   Merging & Loading Overlay
   ========================================================================== */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(253, 249, 245, 0.96);
  backdrop-filter: blur(8px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.loading-overlay.active {
  display: flex;
}

.loader-spinner {
  width: 54px;
  height: 54px;
  border: 4px solid var(--pink-tint);
  border-top-color: var(--maroon);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

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

.loading-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--maroon);
  margin-bottom: 8px;
}

.loading-status-text {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Result Screen
   ========================================================================== */
.result-content {
  flex: 1;
  padding: 16px 20px calc(56px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
}

.result-image-wrapper {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 12px 0 24px;
  perspective: 1000px;
  transition: max-width 0.3s ease;
}

.result-image-wrapper.landscape {
  max-width: 440px;
}

.result-photo-card {
  width: 100%;
  aspect-ratio: 9/16;
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(88, 11, 26, 0.14), 0 2px 10px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  background: #FFF;
  border: 1px solid var(--border-pink);
  position: relative;
  transition: aspect-ratio 0.3s ease;
}

.result-photo-card.landscape {
  aspect-ratio: 16/9;
}

#merged-result-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ios-tip-box {
  background: #FDF4F5;
  border: 1px solid #ECC7CD;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 24px;
  font-size: 0.8rem;
  color: var(--maroon);
  line-height: 1.45;
  width: 100%;
  max-width: 340px;
}

.result-actions-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* Hidden canvas for client-side processing */
#merge-canvas {
  display: none;
}

/* ==========================================================================
   Fixed App Footer (#lucKYcanTAkeyourlove)
   ========================================================================== */
.fixed-app-footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 50;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 16px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  background: linear-gradient(to top, rgba(247, 239, 228, 0.96) 0%, rgba(247, 239, 228, 0.8) 65%, transparent 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.3s ease;
}

.fixed-hashtag-text {
  font-family: 'Cinzel', var(--font-serif);
  font-size: 0.85rem;
  line-height: 1.4;
  letter-spacing: 0.14em;
  color: var(--maroon);
  font-weight: 700;
  text-align: center;
  text-wrap: balance;
  overflow-wrap: break-word;
  user-select: none;
  pointer-events: auto;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

/* On Camera Screen, style the fixed footer to blend seamlessly over the camera preview */
body:has(#camera-screen.active) .fixed-app-footer,
body[data-active-screen="camera"] .fixed-app-footer {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 65%, transparent 100%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body:has(#camera-screen.active) .fixed-hashtag-text,
body[data-active-screen="camera"] .fixed-hashtag-text {
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}

/* ==========================================================================
   Landscape Frame Camera & Rotation Popup Styles
   ========================================================================== */

/* Fullscreen Rotation Popup Overlay */
.landscape-rotate-overlay {
  position: absolute;
  inset: 0;
  z-index: 999;
  background: rgba(15, 6, 9, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px calc(56px + env(safe-area-inset-bottom, 0px));
  animation: fadeInRotateOverlay 0.25s ease-out;
}

@keyframes fadeInRotateOverlay {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.rotate-overlay-card {
  max-width: 360px;
  width: 100%;
  background: rgba(36, 15, 20, 0.95);
  border: 1px solid rgba(238, 215, 207, 0.25);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  color: #FFF;
}

.rotate-phone-animation {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 0 24px rgba(122, 20, 38, 0.4);
}

.phone-device-icon {
  font-size: 2.6rem;
  color: #FFF;
  display: inline-block;
  animation: phoneRotateGuide 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes phoneRotateGuide {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(0deg); }
  55% { transform: rotate(-90deg); }
  85% { transform: rotate(-90deg); }
  100% { transform: rotate(0deg); }
}

.rotate-phone-animation.to-portrait .phone-device-icon {
  animation: phoneRotateToPortraitGuide 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes phoneRotateToPortraitGuide {
  0% { transform: rotate(-90deg); }
  25% { transform: rotate(-90deg); }
  55% { transform: rotate(0deg); }
  85% { transform: rotate(0deg); }
  100% { transform: rotate(-90deg); }
}

/* Landscape-oriented popup overlay for Result Screen */
.result-rotate-portrait-overlay {
  display: none !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999 !important;
  background: rgba(15, 6, 9, 0.94) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 12px 18px !important;
  padding: max(10px, env(safe-area-inset-top, 10px)) max(18px, env(safe-area-inset-right, 18px)) max(10px, env(safe-area-inset-bottom, 10px)) max(18px, env(safe-area-inset-left, 18px)) !important;
  box-sizing: border-box !important;
}

.result-rotate-portrait-overlay.active {
  display: flex !important;
}

.result-rotate-portrait-overlay .rotate-overlay-card.landscape-card {
  max-width: 620px !important;
  width: 100% !important;
  max-height: calc(100vh - 20px) !important;
  max-height: calc(100dvh - 20px) !important;
  overflow-y: auto !important;
  padding: 14px 20px !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 18px !important;
  text-align: left !important;
  background: rgba(36, 15, 20, 0.96) !important;
  border: 1px solid rgba(238, 215, 207, 0.3) !important;
  border-radius: var(--radius-lg, 18px) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7) !important;
  box-sizing: border-box !important;
}

.result-rotate-portrait-overlay .rotate-card-left {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.result-rotate-portrait-overlay .rotate-phone-animation {
  width: 64px !important;
  height: 64px !important;
  margin: 0 !important;
  box-shadow: 0 0 20px rgba(122, 20, 38, 0.5) !important;
}

.result-rotate-portrait-overlay .phone-device-icon {
  font-size: 2rem !important;
}

.result-rotate-portrait-overlay .rotate-badge-status {
  font-size: 0.7rem;
  font-weight: 600;
  color: #FFD54F;
  background: rgba(255, 213, 79, 0.12);
  border: 1px solid rgba(255, 213, 79, 0.3);
  border-radius: 20px;
  padding: 2px 8px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.result-rotate-portrait-overlay .rotate-card-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result-rotate-portrait-overlay .rotate-overlay-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem !important;
  font-weight: 700;
  color: #FFF !important;
  margin: 0 !important;
  line-height: 1.25 !important;
  text-align: left !important;
}

.result-rotate-portrait-overlay .rotate-overlay-desc {
  font-size: 0.78rem !important;
  color: rgba(255, 255, 255, 0.82) !important;
  line-height: 1.35 !important;
  margin: 0 !important;
  text-align: left !important;
}

.result-rotate-portrait-overlay .rotate-lock-warning-box {
  background: rgba(255, 179, 0, 0.1) !important;
  border: 1px solid rgba(255, 179, 0, 0.3) !important;
  border-radius: 8px !important;
  padding: 6px 10px !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.result-rotate-portrait-overlay .warning-icon-badge {
  width: 24px !important;
  height: 24px !important;
  font-size: 0.75rem !important;
  margin-top: 0 !important;
  background: rgba(255, 179, 0, 0.22) !important;
}

.result-rotate-portrait-overlay .warning-text-content {
  font-size: 0.72rem !important;
  line-height: 1.3 !important;
}

.result-rotate-portrait-overlay .warning-text-content strong {
  font-size: 0.74rem !important;
  margin-bottom: 1px !important;
  display: inline-block !important;
  margin-right: 4px !important;
}

.result-rotate-portrait-overlay .warning-text-content p {
  display: inline !important;
  font-size: 0.72rem !important;
}

.result-rotate-portrait-overlay .rotate-overlay-actions {
  display: flex !important;
  justify-content: flex-start !important;
  margin-top: 2px !important;
}

.result-rotate-portrait-overlay #dismiss-result-rotate-btn {
  height: 34px !important;
  padding: 4px 14px !important;
  font-size: 0.8rem !important;
  border-radius: var(--radius-full) !important;
  color: #FFF !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  background: rgba(255, 255, 255, 0.1) !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.result-rotate-portrait-overlay #dismiss-result-rotate-btn:hover {
  background: rgba(255, 255, 255, 0.2) !important;
}

@media (max-width: 480px) {
  .result-rotate-portrait-overlay .rotate-overlay-card.landscape-card {
    gap: 12px !important;
    padding: 10px 14px !important;
  }
  .result-rotate-portrait-overlay .rotate-phone-animation {
    width: 52px !important;
    height: 52px !important;
  }
  .result-rotate-portrait-overlay .phone-device-icon {
    font-size: 1.6rem !important;
  }
}

.rotate-overlay-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #FFF;
  line-height: 1.3;
}

.rotate-overlay-desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.5;
  margin-bottom: 16px;
}

.rotate-lock-warning-box {
  background: rgba(255, 179, 0, 0.12);
  border: 1px solid rgba(255, 179, 0, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
}

.warning-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 179, 0, 0.25);
  color: #FFB300;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.warning-text-content {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.45;
}

.warning-text-content strong {
  display: block;
  font-size: 0.84rem;
  color: #FFD54F;
  margin-bottom: 3px;
}

.warning-text-content p {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
}

.rotate-overlay-actions {
  display: flex;
  justify-content: center;
}

.rotate-overlay-actions #cancel-to-frames-btn {
  color: #FF4D4F !important;
  border: 1.5px solid rgba(255, 77, 79, 0.45) !important;
  background: rgba(255, 77, 79, 0.08);
  font-weight: 600;
  border-radius: var(--radius-full);
  padding: 8px 18px;
  transition: all 0.2s ease;
}

.rotate-overlay-actions #cancel-to-frames-btn i {
  color: #FF4D4F !important;
  margin-right: 4px;
}

.rotate-overlay-actions #cancel-to-frames-btn:hover,
.rotate-overlay-actions #cancel-to-frames-btn:active {
  background: rgba(255, 77, 79, 0.2);
  border-color: #FF4D4F !important;
  color: #FF7875 !important;
  transform: translateY(-1px);
}

.rotate-overlay-actions #cancel-to-frames-btn:hover i,
.rotate-overlay-actions #cancel-to-frames-btn:active i {
  color: #FF7875 !important;
}

/* ==========================================================================
   Landscape Camera Mode UI Layout
   When taking photo for landscape frame and device is in landscape
   ========================================================================== */

/* Maximize container and viewport width in landscape camera mode */
body[data-camera-mode="landscape"] .app-container,
.app-container:has(#camera-screen.is-landscape-camera.active) {
  max-width: 100vw !important;
  width: 100vw !important;
  box-shadow: none;
}

#camera-screen.active.is-landscape-camera {
  display: flex !important;
  flex-direction: row;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  position: fixed;
  inset: 0;
  z-index: 60;
}

#camera-screen.active.is-landscape-camera .camera-viewport {
  width: 100%;
  height: 100%;
  flex: 1;
}

#camera-screen.active.is-landscape-camera #camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Header bar container in landscape mode */
#camera-screen.active.is-landscape-camera .camera-header-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 0;
  background: none;
  pointer-events: none;
  z-index: 70;
}

/* Slot indicator on top-left */
#camera-screen.active.is-landscape-camera .slot-indicator-pill {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: calc(16px + env(safe-area-inset-left, 0px));
  pointer-events: auto;
  z-index: 75;
}

/* Tombol close, tombol putar kamera, dan timer diposisikan pada pojok kanan atas */
#camera-screen.active.is-landscape-camera .camera-controls-top {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: calc(14px + env(safe-area-inset-right, 0px));
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  z-index: 75;
}

#camera-screen.active.is-landscape-camera .cam-timer-menu {
  top: calc(100% + 8px);
  right: 0;
  left: auto;
}

/* Shutter button bar positioned at the right side (OUTSIDE camera viewfinder) */
#camera-screen.active.is-landscape-camera .camera-bottom-bar {
  position: relative !important;
  top: auto;
  bottom: auto;
  right: auto;
  left: auto;
  width: calc(112px + env(safe-area-inset-right, 0px));
  height: 100%;
  padding: 0;
  padding-right: calc(6px + env(safe-area-inset-right, 0px));
  background: #000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  order: 2;
  z-index: 60;
  pointer-events: auto;
}

#camera-screen.active.is-landscape-camera .shutter-btn-wrapper {
  margin: 0;
  pointer-events: auto;
}

#camera-screen.active.is-landscape-camera .shutter-btn {
  width: 76px;
  height: 76px;
  box-shadow: 0 0 24px rgba(122, 20, 38, 0.85);
}

/* Crop guide in landscape camera mode: centered inside camera-viewport without any overlap */
#camera-screen.active.is-landscape-camera .camera-crop-guide,
#camera-screen.active.is-landscape-camera .camera-crop-guide.landscape {
  width: 95%;
  height: auto;
  max-height: 90%;
  aspect-ratio: 16 / 9;
  border: 2.5px dashed rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.42);
  border-radius: 14px;
  margin: 0 auto;
}

/* Hide fixed hashtag footer during camera capture or when orientation popups are active */
body:has(#camera-screen.active) .fixed-app-footer,
body[data-active-screen="camera"] .fixed-app-footer,
body[data-camera-mode="landscape"] .fixed-app-footer,
body.rotate-overlay-active .fixed-app-footer,
body:has(#result-rotate-portrait-overlay.active) .fixed-app-footer,
body:has(#result-rotate-portrait-overlay:not([style*="display: none"]):not([style*="display:none"])) .fixed-app-footer,
body:has(#landscape-rotate-overlay:not([style*="display: none"]):not([style*="display:none"])) .fixed-app-footer {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ==========================================================================
   VOICE NOTE FEATURE STYLES
   ========================================================================== */

/* 1. Voice Note Invitation Card on Result Screen */
.voicenote-invite-box {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(254, 247, 243, 0.98) 100%);
  border: 1.5px solid rgba(122, 20, 38, 0.16);
  border-radius: var(--radius-lg, 18px);
  padding: 16px 18px;
  margin-top: 14px;
  margin-bottom: 4px;
  box-shadow: 0 4px 18px rgba(122, 20, 38, 0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.25s ease;
  text-align: left;
}

.voicenote-invite-box:hover {
  border-color: rgba(122, 20, 38, 0.32);
  box-shadow: 0 6px 22px rgba(122, 20, 38, 0.1);
}

.voicenote-invite-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.voicenote-invite-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7A1426 0%, #A82035 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(122, 20, 38, 0.25);
}

.voicenote-invite-text {
  flex: 1;
}

.voicenote-invite-title {
  font-family: var(--font-heading, 'Playfair Display', serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--burgundy-dark, #5E101E);
  margin: 0 0 3px 0;
  line-height: 1.3;
}

.voicenote-invite-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted, #6B5B52);
  margin: 0;
  line-height: 1.45;
}

.voicenote-status-badge {
  background: rgba(46, 125, 50, 0.12);
  border: 1px solid rgba(46, 125, 50, 0.3);
  color: #2E7D32;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-md, 10px);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-voicenote {
  width: 100%;
  background: linear-gradient(135deg, #7A1426 0%, #9E1B32 100%) !important;
  color: #FFFFFF !important;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 13px 20px;
  border-radius: var(--radius-full, 9999px);
  border: none;
  box-shadow: 0 4px 14px rgba(122, 20, 38, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-voicenote:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(122, 20, 38, 0.38);
  background: linear-gradient(135deg, #8C172C 0%, #B31F3A 100%) !important;
}

.btn-voicenote:active {
  transform: translateY(0);
}

.btn-voicenote i {
  font-size: 1.1rem;
}

/* 2. Dedicated Voice Note Screen Layout */
#voicenote-screen {
  background: var(--bg-sand, #FAF6F0);
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: 60px;
}

.voicenote-screen-content {
  padding: 16px 20px 40px;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.voicenote-hero-banner {
  text-align: center;
  margin-top: 4px;
  margin-bottom: 4px;
}

.header-back-btn {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(122, 20, 38, 0.15);
  color: var(--burgundy-dark, #5E101E);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.header-back-btn:hover {
  background: #FFFFFF;
  border-color: var(--burgundy, #7A1426);
  transform: scale(1.05);
}

/* Photo Context Strip */
.voicenote-photo-context {
  background: #FFFFFF;
  border: 1px solid rgba(122, 20, 38, 0.12);
  border-radius: var(--radius-lg, 16px);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.voicenote-thumb-wrap {
  width: 48px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  background: #EEE;
  border: 1.5px solid var(--gold-accent, #D4AF37);
  flex-shrink: 0;
}

.voicenote-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.voicenote-context-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
}

.context-tag {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--burgundy, #7A1426);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.context-desc {
  font-size: 0.78rem;
  color: var(--text-muted, #6B5B52);
  line-height: 1.35;
}

/* Sender Name Input Card */
.voicenote-sender-card {
  background: #FFFFFF;
  border: 1px solid rgba(122, 20, 38, 0.12);
  border-radius: var(--radius-lg, 16px);
  padding: 14px 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  text-align: left;
}

.sender-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--burgundy-dark, #5E101E);
  margin-bottom: 8px;
}

.sender-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid rgba(122, 20, 38, 0.2);
  border-radius: var(--radius-md, 10px);
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--text-main, #2A2016);
  background: #FCFAF8;
  outline: none;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.sender-input:focus {
  border-color: var(--burgundy, #7A1426);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(122, 20, 38, 0.12);
}

/* 3. Recording Studio Card */
.recorder-studio-card {
  background: #FFFFFF;
  border: 1.5px solid rgba(122, 20, 38, 0.15);
  border-radius: var(--radius-xl, 22px);
  padding: 24px 20px 22px;
  box-shadow: 0 6px 24px rgba(122, 20, 38, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.recorder-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  border-radius: var(--radius-full, 9999px);
  background: rgba(122, 20, 38, 0.07);
  color: var(--burgundy-dark, #5E101E);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 14px;
  transition: all 0.2s ease;
}

.recorder-status-pill .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--burgundy, #7A1426);
  display: inline-block;
}

.recorder-status-pill.recording {
  background: rgba(220, 38, 38, 0.12);
  color: #DC2626;
}

.recorder-status-pill.recording .status-dot {
  background: #DC2626;
  animation: dotBlink 1s infinite;
}

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

.recorder-timer-display {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 2.3rem;
  font-weight: 700;
  color: var(--burgundy-dark, #5E101E);
  letter-spacing: 2px;
  margin-bottom: 12px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
}

.recorder-max-time {
  font-size: 1rem;
  color: var(--text-muted, #8C786E);
  font-weight: 500;
}

/* Soundwave Animation Bars */
.soundwave-bars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 38px;
  margin-bottom: 18px;
  opacity: 0.25;
  transition: opacity 0.3s ease;
}

.soundwave-bars.active {
  opacity: 1;
}

.wave-bar {
  width: 4px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to top, #7A1426, #D4AF37);
  transition: height 0.15s ease;
}

.soundwave-bars.active .wave-bar:nth-child(1) { animation: waveBounce 0.7s infinite ease-in-out; }
.soundwave-bars.active .wave-bar:nth-child(2) { animation: waveBounce 0.5s infinite 0.1s ease-in-out; }
.soundwave-bars.active .wave-bar:nth-child(3) { animation: waveBounce 0.8s infinite 0.2s ease-in-out; }
.soundwave-bars.active .wave-bar:nth-child(4) { animation: waveBounce 0.6s infinite 0.15s ease-in-out; }
.soundwave-bars.active .wave-bar:nth-child(5) { animation: waveBounce 0.9s infinite 0.05s ease-in-out; }
.soundwave-bars.active .wave-bar:nth-child(6) { animation: waveBounce 0.65s infinite 0.25s ease-in-out; }
.soundwave-bars.active .wave-bar:nth-child(7) { animation: waveBounce 0.75s infinite 0.12s ease-in-out; }
.soundwave-bars.active .wave-bar:nth-child(8) { animation: waveBounce 0.55s infinite 0.18s ease-in-out; }
.soundwave-bars.active .wave-bar:nth-child(9) { animation: waveBounce 0.7s infinite 0.08s ease-in-out; }

@keyframes waveBounce {
  0%, 100% { height: 6px; }
  50% { height: 34px; }
}

/* Mic Trigger Container & Pulse Ring */
.mic-trigger-container {
  position: relative;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.mic-pulse-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(122, 20, 38, 0.3);
  opacity: 0;
  pointer-events: none;
}

.mic-pulse-ring.pulsing {
  opacity: 1;
  animation: micRingPulse 1.6s infinite ease-out;
}

@keyframes micRingPulse {
  0% { transform: scale(0.9); opacity: 0.8; border-color: rgba(220, 38, 38, 0.6); }
  100% { transform: scale(1.4); opacity: 0; border-color: rgba(220, 38, 38, 0); }
}

.mic-record-btn {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7A1426 0%, #A82035 100%);
  border: none;
  color: #FFFFFF;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(122, 20, 38, 0.35);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
}

.mic-record-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(122, 20, 38, 0.45);
}

.mic-record-btn:active {
  transform: scale(0.96);
}

.mic-record-btn.recording {
  background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
  box-shadow: 0 0 26px rgba(220, 38, 38, 0.65);
}

.mic-record-btn.recording i::before {
  content: "\f04d" !important; /* Font Awesome fa-stop */
  font-size: 1.6rem;
}

.mic-hint-text {
  font-size: 0.8rem;
  color: var(--text-muted, #6B5B52);
  line-height: 1.4;
  max-width: 280px;
}

/* Post-Recording Custom Audio Player */
.voice-preview-panel {
  width: 100%;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed rgba(122, 20, 38, 0.2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preview-panel-header {
  text-align: left;
}

.preview-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--burgundy-dark, #5E101E);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.voice-audio-custom-player {
  background: #FAF6F0;
  border: 1px solid rgba(122, 20, 38, 0.15);
  border-radius: var(--radius-full, 9999px);
  padding: 6px 14px 6px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.voice-play-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--burgundy, #7A1426);
  border: none;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease, background 0.15s ease;
}

.voice-play-toggle-btn:hover {
  background: var(--burgundy-dark, #5E101E);
  transform: scale(1.06);
}

.voice-progress-track {
  flex: 1;
  height: 6px;
  background: rgba(122, 20, 38, 0.12);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.voice-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, #7A1426, #D4AF37);
  border-radius: 3px;
  transition: width 0.1s linear;
}

.voice-playback-time {
  font-family: monospace;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--burgundy-dark, #5E101E);
  min-width: 42px;
  text-align: right;
}

.preview-retake-action {
  display: flex;
  justify-content: center;
  margin-top: 2px;
}

/* 4. Action Buttons Stack - Equal length and perfectly aligned */
.voicenote-screen-actions {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  width: 100% !important;
  gap: 10px !important;
  margin-top: 6px !important;
}

.voicenote-screen-actions .btn,
.voicenote-screen-actions button {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
  height: 48px !important;
  padding: 12px 20px !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  border-radius: var(--radius-full) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  gap: 10px !important;
  margin: 0 !important;
}

.voicenote-screen-actions #send-voicenote-btn {
  background: var(--maroon-gradient) !important;
  color: #FFFFFF !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(122, 20, 38, 0.28) !important;
}

.voicenote-screen-actions #send-voicenote-btn:disabled {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  transform: none !important;
}

.voicenote-screen-actions #cancel-voicenote-btn {
  background: #FFFFFF !important;
  color: var(--maroon) !important;
  border: 1.5px solid var(--border-pink) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

.voicenote-screen-actions #cancel-voicenote-btn:hover {
  background: var(--pink-soft) !important;
}

/* ==========================================================================
   Confirm Restart Photo Modal (Belum Download Foto)
   ========================================================================== */
.confirm-restart-modal {
  border: 1.5px solid var(--border-pink);
  border-radius: var(--radius-lg, 20px);
  background: #FFFDFB;
  box-shadow: 0 16px 40px rgba(88, 11, 26, 0.22);
  width: 90%;
  max-width: 400px;
  padding: 24px 20px;
  margin: auto;
  text-align: center;
}

.confirm-restart-modal::backdrop {
  background: rgba(31, 13, 17, 0.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.confirm-icon-badge {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255, 171, 0, 0.14);
  border: 2px solid rgba(255, 171, 0, 0.45);
  color: #D97706;
  font-size: 1.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.confirm-modal-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 10px 0 20px;
}

.confirm-modal-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 100%;
}

.confirm-modal-actions .btn {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
  height: 46px;
  padding: 10px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}



