* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background-color: #4a2f1a;
}

body {
  font-family: 'Lora', serif;
  background: #4a2f1a;
  background: linear-gradient(135deg, #4a2f1a 0%, #6B4423 100%);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #F5F1E8;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.app-container {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  position: relative;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.header {
  background: linear-gradient(135deg, #4a2f1a 0%, #6B4423 100%);
  color: #F5F1E8;
  padding: 12px 20px;
  border-radius: 0 0 20px 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
  border-bottom: 3px solid #2a1505;
  display: flex;
  margin-bottom: 5px;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.header-logo {
  max-width: clamp(60px, 8vw, 130px);
  height: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.header-text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.header-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.2em, 3vw, 1.8em);
  font-weight: 700;
  letter-spacing: 1px;
  color: #F5F1E8;
  line-height: 1;
}

.header-subtitle {
  font-family: 'Lora', serif;
  font-size: clamp(0.75em, 2vw, 1em);
  font-weight: 400;
  letter-spacing: 0.5px;
  color: #D4AF37;
  line-height: 1;
}

.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.screen {
  display: none;
  flex: 1;
  padding: 40px 30px;
  text-align: center;
  animation: fadeIn 0.5s ease-in;
}

.screen.active {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.screen {
  animation: fadeIn 0.5s ease-in;
}

.result-content {
  animation: slideInDown 0.6s ease-out;
}

.screen.active {
  animation: fadeIn 0.4s ease-in;
}

#welcomeScreen {
  background: transparent;
  justify-content: space-between;
  flex-direction: column;
  padding: 5px 20px;
  gap: 0;
  overflow: hidden;
}

.welcome-intro {
  text-align: center;
  flex-shrink: 0;
}

.welcome-intro h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.4em, 4vw, 3.8em);
  color: #D4AF37;
  margin-bottom: 8px;
  font-weight: 700;
  letter-spacing: 2px;
}

.welcome-subtitle {
  font-size: 0.95em;
  color: #F5F1E8;
  margin: 0;
  line-height: 1.5;
  font-weight: 300;
}

.welcome-video-container {
  width: 100%;
  margin: 10px 0;
  background: transparent;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#welcomeVideo {
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
  border-radius: 15px;
  border: 2px solid #2a1505;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.welcome-footer {
  text-align: center;
  flex-shrink: 0;
}

.welcome-footer p {
  font-size: 0.95em;
  color: #F5F1E8;
  margin-bottom: 15px;
  font-weight: 300;
}

.welcome-content {
  text-align: center;
}

.welcome-content p {
  font-size: 1.1em;
  color: #5C4033;
  margin-bottom: 30px;
  line-height: 1.6;
  font-weight: 300;
}

.btn-primary-custom {
  background: #2a1505;
  color: #F5F1E8;
  padding: clamp(12px, 2vh, 28px) clamp(20px, 4vw, 70px);
  font-size: clamp(0.9em, 1.5vw, 1.6em);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 25px rgba(107, 68, 35, 0.3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  width: 100%;
  border: none;
}

.btn-primary-custom:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 35px rgba(107, 68, 35, 0.4);
  background: #1a0d03;
}

.btn-primary-custom:active {
  transform: translateY(-2px);
}

.btn-secondary-custom {
  background: white;
  color: #8B5A3C;
  border: 2px solid #8B5A3C;
  padding: 14px 40px;
  font-size: 1em;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: 100%;
}

.btn-secondary-custom:hover {
  background: #8B5A3C;
  color: white;
  transform: translateY(-2px);
}

#videoScreen {
  background: transparent;
  justify-content: space-between;
  flex-direction: column;
  padding: 5px 20px;
  gap: 0;
  overflow: hidden;
}

#videoScreen h2 {
  color: #D4AF37;
  font-size: clamp(1.4em, 4vw, 3.8em);
  margin-bottom: 8px;
  font-weight: 700;
  font-family: 'Playfair Display', serif;
  letter-spacing: 2px;
}

#videoPlayer {
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
  border-radius: 15px;
  border: 2px solid #2a1505;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.video-info {
  color: #F5F1E8;
  font-size: 0.95em;
  opacity: 1;
  margin: 0;
  flex-shrink: 0;
}

#cameraScreen {
  background: transparent;
  justify-content: space-between;
  padding: 20px 20px;
}

#cameraScreen h2 {
  color: #D4AF37;
  font-size: 1.8em;
  margin-bottom: 10px;
  font-weight: 700;
  font-family: 'Playfair Display', serif;
  letter-spacing: 1px;
}

.camera-help-text {
  color: rgba(245, 241, 232, 0.8);
  font-size: 0.95em;
  margin-bottom: 15px;
}

.camera-container {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  margin-bottom: 15px;
  flex-grow: 1;
  aspect-ratio: 4 / 5;
  display: flex;
  align-items: center;
  justify-content: center;
}

#video {
  width: 100%;
  height: 100%;
  display: block;
  transform: scaleX(-1);
  object-fit: cover;
}

#canvas {
  display: none;
}

/* Camera overlay para indicador de centro */
.camera-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.camera-info-box {
  background: rgba(0, 0, 0, 0.3);
  padding: 40px 60px;
  border-radius: 20px;
  border: 2px solid #2a1505;
  text-align: center;
  min-width: 280px;
}

.camera-info-text {
  color: white;
  font-size: 1.3em;
  font-weight: bold;
  margin: 0 0 30px 0;
  letter-spacing: 3px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

/* Countdown timer dentro do box */
.countdown-timer {
  position: static;
  text-align: center;
}

.timer-number {
  font-size: 3.5em;
  font-weight: bold;
  color: white;
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
  font-family: 'Playfair Display', serif;
  animation: countdownPulse 1s ease-in-out;
  margin: 0;
}

@keyframes countdownPulse {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.camera-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 15px;
}

.btn-camera {
  background: #2a1505;
  color: #F5F1E8;
  border: none;
  padding: 14px 30px;
  font-size: 1em;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(107, 68, 35, 0.3);
  font-weight: 600;
  flex: 1;
  border: 2px solid #2a1505;
}

.btn-camera:hover:not(:disabled) {
  background: #1a0d03;
  transform: translateY(-2px);
}

.btn-camera:disabled {
  background: #6c757d;
  cursor: not-allowed;
  opacity: 0.7;
}

.btn-back {
  background: transparent;
  color: #F5F1E8;
  border: 2px solid #2a1505;
  padding: 12px 25px;
  font-size: 1em;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  flex: 1;
}

.btn-back:hover {
  background: #D4AF37;
  color: #3D2817;
}

#resultScreen {
  background: transparent;
  justify-content: flex-start;
  align-items: center;
  padding: 15px 15px;
  padding-top: 15px;
  overflow-x: hidden;
  overflow-y: auto;
  height: 100%;
}

#resultScreen h2 {
  color: #6B4423;
  font-size: 1.8em;
  margin-bottom: 20px;
  font-weight: 700;
  font-family: 'Playfair Display', serif;
  letter-spacing: 1px;
}

.result-content {
  background: linear-gradient(135deg, #8B5A3C 0%, #6B4423 100%);
  color: #F5F1E8;
  padding: 15px;
  padding-top: 60px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(107, 68, 35, 0.3);
  margin-top: 50px;
  margin-bottom: 10px;
  border: 2px solid #2a1505;
  overflow: visible;
  position: relative;
  width: 100%;
  max-width: 600px;
}

.analysis-text {
  font-size: 1em;
  line-height: 1.7;
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  font-weight: 400;
}

.product-recommendation {
  text-align: center;
  margin: 0;
  margin-top: -70px;
  margin-bottom: 8px;
  overflow: visible;
  position: relative;
  z-index: 10;
}

.product-recommendation .product-image-3d {
  width: 100%;
  max-width: 130px;
  max-height: 12vh;
  object-fit: contain;
  border-radius: 12px;
  border: 3px solid #D4AF37;
  background: #F5F1E8;
  box-shadow: 
    0 10px 25px rgba(0, 0, 0, 0.3),
    0 5px 15px rgba(0, 0, 0, 0.25),
    0 0 20px rgba(212, 175, 55, 0.2);
  transform: perspective(1200px) rotateX(8deg) translateZ(30px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-recommendation .product-image-3d:hover {
  transform: perspective(1000px) rotateX(0deg) translateZ(30px) scale(1.05);
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.35),
    0 8px 20px rgba(0, 0, 0, 0.3),
    0 0 30px rgba(212, 175, 55, 0.25);
}

.product-recommendation h2 {
  font-size: 2.2em;
  margin-bottom: 15px;
  font-weight: 700;
  color: #F5F1E8;
  font-family: 'Playfair Display', serif;
  letter-spacing: 1px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.product-recommendation h3 {
  font-size: 1.8em;
  margin-bottom: 12px;
  font-weight: 700;
  color: #D4AF37;
  font-family: 'Playfair Display', serif;
  letter-spacing: 1px;
}

.product-details {
  font-size: 0.95em;
  line-height: 1.6;
  opacity: 0.95;
}

#audioPlayer {
  width: 100%;
  margin: 20px 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  opacity: 0;
  height: 0;
  padding: 0;
  border: none;
}

/* Estilo para o texto sincronizado */
#syncedText {
  font-family: 'Lora', serif;
  color: #F5F1E8;
}

/* Esconder scrollbar no #syncedText - WebKit (Chrome, Safari) */
#syncedText::-webkit-scrollbar {
  display: none;
}

/* Esconder scrollbar no Firefox */
#syncedText {
  scrollbar-width: none;
}

/* Esconder scrollbar no IE/Edge */
#syncedText {
  -ms-overflow-style: none;
}

/* Loading */
.loading {
  padding: 0;
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.spinner {
  border: 5px solid rgba(245, 241, 232, 0.2);
  border-radius: 50%;
  border-top: 5px solid #2a1505;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  color: white;
  font-size: 1.2em;
  font-weight: 600;
}

.loading-subtext {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95em;
  margin-top: 10px;
}

/* Error */
.error {
  background: #f8d7da;
  color: #721c24;
  padding: 20px;
  border-radius: 10px;
  border-left: 5px solid #f5c6cb;
  margin: 20px 0;
}

.btn-retry {
  background: #2a1505;
  color: white;
  border: none;
  padding: 14px 30px;
  font-size: 1em;
  border-radius: 50px;
  cursor: pointer;
  margin-top: 15px;
  font-weight: 600;
  width: 100%;
}

.btn-retry:hover {
  transform: translateY(-2px);
}

.content::-webkit-scrollbar {
  width: 6px;
}

.content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

.content::-webkit-scrollbar-thumb {
  background: #8B5A3C;
  border-radius: 3px;
}

.content::-webkit-scrollbar-thumb:hover {
  background: #6B4423;
}

/* =============================================
   RESPONSIVE DESIGN - Mobile First
   ============================================= */

/* --- Mobile (< 480px) --- */
@media (max-width: 479px) {
  .header {
    padding: 12px 10px;
    border-radius: 0 0 12px 12px;
  }

  .header-logo {
    max-width: 110px;
  }

  .screen {
    padding: 16px 12px;
  }

  #welcomeScreen {
    padding: 4px 12px;
  }

  .welcome-intro h2 {
    font-size: 1.4em;
    margin-bottom: 4px;
  }

  .welcome-subtitle {
    font-size: 0.8em;
  }

  .welcome-video-container {
    margin: 6px 0;
  }

  #welcomeVideo {
    border-radius: 10px;
  }

  .welcome-footer p {
    font-size: 0.8em;
    margin-bottom: 8px;
  }

  .btn-primary-custom {
    padding: 12px 20px;
    font-size: 0.9em;
  }

  .btn-secondary-custom {
    padding: 10px 20px;
    font-size: 0.85em;
  }

  #videoScreen {
    padding: 12px 12px;
  }

  #videoScreen h2 {
    font-size: 1.3em;
    margin-bottom: 8px;
  }

  #videoPlayer {
    border-radius: 10px;
  }

  .video-info {
    font-size: 0.8em;
    margin: 8px 0;
  }

  #cameraScreen {
    padding: 12px 12px;
  }

  .camera-container {
    border-radius: 10px;
    margin-bottom: 10px;
    aspect-ratio: 3 / 4;
  }

  .camera-info-box {
    padding: 20px 30px;
    min-width: 180px;
    border-radius: 14px;
  }

  .camera-info-text {
    font-size: 1em;
    letter-spacing: 2px;
    margin: 0 0 16px 0;
  }

  .timer-number {
    font-size: 2.5em;
  }

  .camera-controls {
    gap: 8px;
  }

  .btn-camera {
    padding: 10px 16px;
    font-size: 0.85em;
  }

  .btn-back {
    padding: 10px 16px;
    font-size: 0.85em;
  }

  #resultScreen {
    padding: 8px 8px;
    padding-top: 0px;
  }

  .result-content {
    padding: 12px;
    border-radius: 10px;
    padding-top: 35px;
    margin-top: 25px;
  }

  .analysis-text {
    font-size: 1.05em;
    padding: 10px;
    line-height: 1.5;
  }

  .product-recommendation {
    margin-top: -45px !important;
  }

  .product-recommendation .product-image-3d {
    max-width: 100px !important;
    max-height: 140px !important;
  }

  .product-recommendation h2 {
    font-size: 1.1em !important;
    margin-bottom: 6px !important;
  }

  .product-recommendation h3 {
    font-size: 1.3em;
  }

  .instagram-share-section {
    padding: 8px !important;
    margin: 5px auto !important;
    border-radius: 10px !important;
  }

  .instagram-share-label {
    font-size: 0.8em !important;
    gap: 5px !important;
    margin-bottom: 3px !important;
  }

  .instagram-icon {
    width: 18px !important;
    height: 18px !important;
  }

  .instagram-handle {
    font-size: 0.75em !important;
  }

  .btn-primary-custom.mt-3 {
    padding: 6px 16px !important;
    font-size: 0.85em !important;
  }

  .spinner {
    width: 36px;
    height: 36px;
    border-width: 4px;
  }

  .loading-text {
    font-size: 1em;
  }

  .loading-subtext {
    font-size: 0.8em;
  }
}

/* --- Tablet (480px - 1023px) --- */
@media (min-width: 480px) and (max-width: 1023px) {
  .header {
    padding: 18px 16px;
  }

  .header-logo {
    max-width: 150px;
  }

  .screen {
    padding: 24px 20px;
  }

  #welcomeScreen {
    padding: 5px 20px;
  }

  .welcome-intro h2 {
    font-size: 1.8em;
  }

  .welcome-subtitle {
    font-size: 0.9em;
  }

  .welcome-video-container {
    max-width: 500px;
    margin: 10px auto;
  }

  .btn-primary-custom {
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }

  #videoPlayer {
    border-radius: 12px;
  }

  .camera-container {
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 15px;
    aspect-ratio: 3 / 4;
  }

  .camera-controls {
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }

  .result-content {
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px;
  }

  .btn-primary-custom.mt-3 {
    max-width: 400px;
    display: block;
    margin-left: auto;
    margin-right: auto;
  }
}

/* --- Large screens / Totem (1024px+) --- */
@media (min-width: 1024px) {
  .header {
    padding: 14px 24px;
    border-radius: 0 0 24px 24px;
  }

  .header-logo {
    max-width: 130px;
  }

  .screen {
    padding: 40px 40px;
  }

  #welcomeScreen {
    padding: 10px 40px;
  }

  .welcome-intro h2 {
    font-size: 2.8em;
    margin-bottom: 12px;
  }

  .welcome-subtitle {
    font-size: 1.15em;
  }

  .welcome-video-container {
    max-width: 700px;
    margin: 16px auto;
  }

  #welcomeVideo {
    border-radius: 18px;
  }

  .welcome-footer p {
    font-size: 1.1em;
    margin-bottom: 20px;
  }

  .btn-primary-custom {
    padding: 20px 55px;
    font-size: 1.25em;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }

  .btn-secondary-custom {
    padding: 18px 50px;
    font-size: 1.1em;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }

  #videoScreen {
    padding: 30px 40px;
  }

  #videoScreen h2 {
    font-size: 2.2em;
  }

  #videoPlayer {
    border-radius: 18px;
  }

  #cameraScreen {
    padding: 24px 40px;
  }

  .camera-container {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 18px;
    aspect-ratio: 3 / 4;
  }

  .camera-info-box {
    padding: 50px 80px;
    min-width: 320px;
    border-radius: 24px;
  }

  .camera-info-text {
    font-size: 1.5em;
    letter-spacing: 4px;
    margin: 0 0 36px 0;
  }

  .timer-number {
    font-size: 4.5em;
  }

  .camera-controls {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    gap: 16px;
  }

  .btn-camera {
    padding: 16px 36px;
    font-size: 1.1em;
  }

  .btn-back {
    padding: 14px 30px;
    font-size: 1.1em;
  }

  #resultScreen {
    padding: 24px 40px;
  }

  .result-content {
    padding: 30px;
    border-radius: 18px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 24px;
  }

  .analysis-text {
    font-size: 1.1em;
    padding: 20px;
  }

  .product-recommendation h2 {
    font-size: 2.6em;
  }

  .product-recommendation h3 {
    font-size: 2em;
  }

  .product-details {
    font-size: 1.05em;
  }

  .spinner {
    width: 60px;
    height: 60px;
  }

  .loading-text {
    font-size: 1.4em;
  }

  .loading-subtext {
    font-size: 1.05em;
  }

  .btn-retry {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    display: block;
    font-size: 1.1em;
  }
}

/* --- Extra Large / Totem vertical grande (1200px+ height, portrait) --- */
@media (min-height: 1200px) and (orientation: portrait) {
  .header {
    padding: 16px 30px;
  }

  .header-logo {
    max-width: 150px;
  }

  .welcome-intro h2 {
    font-size: 3.2em;
    margin-bottom: 16px;
  }

  .welcome-subtitle {
    font-size: 1.3em;
  }

  #welcomeVideo {
    border-radius: 20px;
  }

  .welcome-footer p {
    font-size: 1.25em;
    margin-bottom: 24px;
  }

  .btn-primary-custom {
    padding: 24px 60px;
    font-size: 1.4em;
  }

  .camera-container {
    aspect-ratio: 3 / 4;
  }

  .camera-info-box {
    padding: 60px 100px;
    min-width: 380px;
  }

  .camera-info-text {
    font-size: 1.8em;
    letter-spacing: 5px;
  }

  .timer-number {
    font-size: 5.5em;
  }

  .product-recommendation h2 {
    font-size: 3em;
  }

  .analysis-text {
    font-size: 1.25em;
    line-height: 1.9;
  }
}

/* --- Ultra tall totem (1600px+ height) --- */
@media (min-height: 1600px) and (orientation: portrait) {
  .header {
    padding: 18px 36px;
  }

  .header-logo {
    max-width: 170px;
  }

  .welcome-intro h2 {
    font-size: 3.8em;
  }

  .welcome-subtitle {
    font-size: 1.5em;
  }

  .welcome-footer p {
    font-size: 1.4em;
  }

  .btn-primary-custom {
    padding: 28px 70px;
    font-size: 1.6em;
    border-radius: 60px;
  }

  #videoScreen h2 {
    font-size: 2.8em;
  }

  #videoPlayer {
    border-radius: 20px;
  }

  .camera-info-box {
    padding: 70px 120px;
  }

  .camera-info-text {
    font-size: 2.2em;
  }

  .timer-number {
    font-size: 7em;
  }

  .btn-camera {
    padding: 20px 44px;
    font-size: 1.3em;
  }

  .btn-back {
    padding: 18px 36px;
    font-size: 1.3em;
  }

  .result-content {
    padding: 40px;
  }

  .product-recommendation h2 {
    font-size: 3.6em;
  }

  .product-recommendation h3 {
    font-size: 2.6em;
  }

  .analysis-text {
    font-size: 1.4em;
    line-height: 2;
    padding: 28px;
  }

  .loading-text {
    font-size: 1.6em;
  }

  .loading-subtext {
    font-size: 1.2em;
  }

  .spinner {
    width: 70px;
    height: 70px;
    border-width: 6px;
  }

  .btn-retry {
    padding: 18px 40px;
    font-size: 1.3em;
  }
}

/* --- Short screens (landscape mobile, etc.) --- */
@media (max-height: 600px) {
  .header {
    padding: 8px 10px;
    border-radius: 0;
  }

  .header-logo {
    max-width: 90px;
  }

  .screen {
    padding: 8px 12px;
  }

  .welcome-intro h2 {
    font-size: 1.2em;
    margin-bottom: 2px;
  }

  .welcome-subtitle {
    font-size: 0.75em;
  }

  .welcome-video-container {
    margin: 4px 0;
  }

  .welcome-footer p {
    font-size: 0.75em;
    margin-bottom: 6px;
  }

  .btn-primary-custom {
    padding: 10px 20px;
    font-size: 0.85em;
  }

  .camera-container {
    aspect-ratio: 4 / 3;
  }

  #welcomeVideo {
    border-radius: 8px;
  }

  #videoPlayer {
    border-radius: 8px;
  }
}

.mt-3 {
  margin-top: 0.5rem !important;
}

.flex-grow-1 {
  flex-grow: 1;
}


.instagram-share-section {
  background: linear-gradient(135deg, rgba(240, 148, 51, 0.1) 0%, rgba(188, 24, 136, 0.1) 100%);
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 12px;
  padding: 12px;
  margin: 10px auto;
  text-align: center;
  width: 100%;
  max-width: 600px;
  position: relative;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.instagram-share-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 12px;
  padding: 2px;
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  z-index: -1;
}

.instagram-share-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Playfair Display', serif;
  font-size: clamp(0.9em, 2vw, 1.1em);
  font-weight: 600;
  color: #F5F1E8;
  margin-bottom: 6px;
}

.instagram-icon {
  width: clamp(22px, 4vw, 28px);
  height: clamp(22px, 4vw, 28px);
}

.instagram-handle {
  font-family: 'Lora', serif;
  font-size: clamp(0.85em, 1.8vw, 1.05em);
  font-weight: 600;
  color: #D4AF37;
  letter-spacing: 0.5px;
}

.music-player {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 10px;
  padding: 8px 12px;
  margin-top: 6px;
}

.music-player-name {
  font-size: 0.8em;
  color: #D4AF37;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.music-player-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.music-player-btn {
  background: none;
  border: none;
  color: #F5F1E8;
  font-size: 1.3em;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.music-player-progress-wrap {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.music-player-progress {
  height: 100%;
  background: #D4AF37;
  border-radius: 3px;
  width: 0%;
  transition: width 0.2s linear;
}

.music-player-time {
  font-size: 0.7em;
  color: rgba(245, 241, 232, 0.7);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 75px;
  text-align: right;
}