@import url(https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;700;900&display=swap);
/* --- GLOBAL RESET & MODERN DEFAULTS --- */
* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; width: 100%; height: 100%;
  overflow: hidden;
  font-family: 'Montserrat', sans-serif;
  background: radial-gradient(circle, #A00000 0%, #400000 100%);
  color: #f5e9d3;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- INITIAL START SCREEN --- */
#initial-start-screen {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 4000;
  background: radial-gradient(circle, #D32F2F 0%, #B71C1C 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  animation: fadeIn 1s ease-in-out;
}

.logo-tile {
  background-color: #fff;
  padding: 20px;
  border-radius: 25px;
  border: 4px solid #B71C1C;
  box-shadow: 0 10px 0 #8c1616, 0 20px 40px rgba(0,0,0,0.5); /* 3D Shadow */
}

.start-logo {
  max-width: 150px;
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* --- SHARED SCREEN STYLES --- */
#video-preview-container,
#photo-preview-container {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
  z-index: 2000;
  background: rgba(183, 28, 28, 0.3);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* --- REFINED CARD CONTAINER --- */
#video-preview-popup, 
#photo-preview-popup {
  position: relative;
  width: 90%;
  max-width: 400px;
  background: #C62828;
  border-radius: 20px; 
  border: 3px solid #D4AF37; /* Solid Gold Border */
  box-shadow: 0 20px 40px rgba(0,0,0,0.5), inset 0 0 10px rgba(0,0,0,0.5);
  padding: 24px; 
  display: flex;
  flex-direction: column;
}

/* --- EMBOSSED 3D BUTTONS --- */
.modern-button {
  background: #D4AF37;
  color: #8c1616;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 15px 40px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 5px 0 #a27b10, 0 8px 15px rgba(0,0,0,0.4), inset 0 1px 1px rgba(255,253,228,0.5); /* 3D effect + highlight */
  transition: all 0.1s ease-out;
}
.modern-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #a27b10, 0 10px 20px rgba(0,0,0,0.35), inset 0 1px 1px rgba(255,253,228,0.5);
}
.modern-button:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #a27b10, 0 5px 10px rgba(0,0,0,0.4), inset 0 1px 1px rgba(255,253,228,0.5);
}

/* --- APP & PROGRESSIVE LOADER --- */
#main-app-container { position: relative; width: 100%; height: 100%; z-index: 1; }
#canvas { width: 100%; height: 100%; display: block; }
#loading-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background-color: #B71C1C; 
  z-index: 3000;
  color: #D4AF37;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 30px;
}
.progress-track {
  width: 70%; 
  max-width: 340px; 
  height: 10px;
  background: #8B0000;
  border-radius: 50px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
  overflow: hidden;
}
.progress-fill {
  width: 0%;
  height: 100%;
  background: #D4AF37;
  box-shadow: 0 0 10px #D4AF37, 0 0 15px #D4AF37;
  transition: width 0.3s ease-out;
}
#loading-text, #loading-percentage {
  color: #D4AF37;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
#loading-percentage { 
  font-size: 0.9rem;
  color: #f5e9d3;
}

/* --- PROCESSING LOADER --- */
#processing-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
}
.spinner {
  width: 60px;
  height: 60px;
  border: 6px solid #a27b10;
  border-top-color: #FBE79A;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}


/* --- 3D IN-APP CONTROLS --- */
#controls {
  position: absolute; bottom: 40px; width: 100%;
  display: flex; justify-content: center; align-items: center; gap: 50px; z-index: 999;
}
#photo-capture-button, #video-capture-button {
  width: 75px; height: 75px; border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  box-shadow: 0 8px 15px rgba(0,0,0,0.4), inset 0 2px 2px rgba(255,255,255,0.3), inset 0 -2px 2px rgba(0,0,0,0.4);
}
#photo-capture-button:active, #video-capture-button:active { 
  transform: translateY(3px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.45), inset 0 2px 2px rgba(255,255,255,0.3), inset 0 -2px 2px rgba(0,0,0,0.4);
}
#photo-capture-button {
  background: #D4AF37;
  background-image: url(assets/cam.png);
  background-size: 45%;
  background-position: center;
  background-repeat: no-repeat;
}
#video-capture-button {
  background: radial-gradient(circle at 50% 40%, #E53935, #C62828);
}
#video-capture-button::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: #D4AF37; /* Gold */
  box-shadow: 0 0 5px #FBE79A, 0 0 10px #FBE79A;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  width: 25px;
  height: 25px;
  border-radius: 50%;
}
#video-capture-button.recording::after {
  width: 28px;
  height: 28px;
  border-radius: 8px; 
  animation: pulse-gold-dot 1.5s infinite;
}
@keyframes pulse-gold-dot {
    0% { box-shadow: 0 0 5px #FBE79A, 0 0 10px #FBE79A; }
    70% { box-shadow: 0 0 10px #FFFDE4, 0 0 20px #FFFDE4; }
    100% { box-shadow: 0 0 5px #FBE79A, 0 0 10px #FBE79A; }
}


/* --- PREVIEW SCREENS --- */
.preview-media-wrapper {
  border: 3px solid #D4AF37;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.3), inset 0 5px 15px rgba(0,0,0,0.5);
  width: 100%; 
  aspect-ratio: 9/16; 
  max-height: 55vh; 
  border-radius: 16px; 
  overflow: hidden; 
  margin-bottom: 20px; 
  background: black;
}
.popup-cta-button {
  box-shadow: 0 4px 0 #a27b10;
  flex: 1; 
  padding: 12px; 
  border-radius: 50px; 
  border: none; 
  font-weight: 700; 
  cursor: pointer; 
  letter-spacing: 1px; 
  text-transform: uppercase; 
  font-size: 0.9rem; 
  transition: transform 0.2s;
}
.popup-cta-button:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #a27b10;
}
#share-video-button, #share-photo-button {
  background: #D4AF37;
  color: #8c1616;
}
#download-video-button, #save-photo-button {
  background: transparent;
  box-shadow: none;
  border: 2px solid #D4AF37;
  color: #D4AF37;
}
#download-video-button:active, #save-photo-button:active {
  transform: translateY(0);
  background: rgba(212, 175, 55, 0.2);
}
#close-video-preview-button, #close-photo-preview-button {
  background: #C62828;
  border: 1px solid #D4AF37;
  color: #D4AF37;
  position: absolute; 
  top: 10px; 
  right: 10px; 
  font-size: 20px; 
  width: 35px; 
  height: 35px; 
  border-radius: 50%; 
  font-weight: bold; 
  cursor: pointer; 
  z-index: 2505; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  transition: transform 0.2s;
}
#close-video-preview-button:active, #close-photo-preview-button:active { 
  transform: scale(0.9); 
}
#popup-actions, #photo-popup-actions { 
  position: relative; 
  gap: 15px; 
  margin-top: 5px; 
  width: 100%; 
  display: flex; 
}
#preview-video, #preview-image { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
}
.poweredbysnap-logo { 
  position: absolute; 
  bottom: 10px; 
  left: 10px; 
  z-index: 2; 
}
.poweredbysnap-logo img { 
  width: 80px; 
  opacity: 0.9; 
}
