/* =========================================================
   TEMA & VARIÁVEIS
   ========================================================= */
:root {
  --bg-gradient: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
  --card-bg: rgba(255, 255, 255, 0.95);
  
  --primary: #ff6b6b;
  --primary-dark: #ff5252;
  --accent: #4ecdc4;
  --correct: #4cd964;
  --incorrect: #ff3b30;
  
  --radius: 20px;
  --transition: 0.3s;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Poppins", sans-serif;
  background: var(--bg-gradient);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow-x: hidden;
  will-change: transform;
}

/* =========================================================
   LAYOUT DAS TELAS
   ========================================================= */
.screen {
  display: none;
  flex-direction: column;
  gap: 24px;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
  width: 100%;
  max-width: 600px;
  text-align: center;
  animation: fadeIn 0.6s ease;
  position: relative;
  z-index: 1;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  perspective: 1000px;
  will-change: transform, opacity;
}

#final-screen {
  max-width: 800px;
}

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

.screen.active {
  display: flex;
}

/* =========================================================
   TIPOGRAFIA
   ========================================================= */
h1 {
  font-size: 2.5rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 1.5rem;
}

p {
  font-size: 1.1rem;
  color: #666;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* =========================================================
   BOTÕES
   ========================================================= */
button {
  padding: 16px 32px;
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  will-change: transform;
}

button:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* =========================================================
   QUIZ – Opções & Barra
   ========================================================= */
#options {
  display: grid;
  gap: 12px;
  width: 100%;
  margin: 1.5rem 0;
}

#options button {
  background: white;
  color: #333;
  width: 100%;
  text-align: left;
  padding: 16px 20px;
  border: 2px solid #eee;
  box-shadow: none;
}

#options button:hover:not(:disabled) {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.option.correct {
  background: var(--correct) !important;
  border-color: var(--correct) !important;
  color: white !important;
}

.option.wrong {
  background: var(--incorrect) !important;
  border-color: var(--incorrect) !important;
  color: white !important;
}

header {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-weight: 600;
  color: #333;
  margin-bottom: 1rem;
}

#progress-bar {
  width: 100%;
  height: 8px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 2rem;
}

#progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width var(--transition) linear;
}

/* =========================================================
   CUPOM
   ========================================================= */
.cupom {
  padding: 20px 30px;
  border: 2px dashed var(--primary);
  border-radius: var(--radius);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 2px;
  user-select: all;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(5px);
  width: max-content;
  margin: 2rem auto;
  box-shadow: var(--shadow);
}

small {
  font-size: 0.8rem;
  color: #666;
  display: block;
  margin-top: 8px;
}

/* =========================================================
   TEXTO DIGITAÇÃO & CONTADOR
   ========================================================= */
.typing {
  font-size: 1.2rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-y: auto;
  max-height: 180px;
  border-right: 3px solid var(--primary);
  animation: blink 0.8s step-end infinite;
  min-height: 120px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: max-height 0.4s;
  contain: content;
  will-change: contents;
}

.typing.full {
  border-right: none;
  animation: none;
  max-height: 320px;
}

@keyframes blink {
  50% {
    border-color: transparent;
  }
}

.counter {
  font-size: 1.3rem;
  font-weight: 600;
  color: #333;
  margin: 1rem 0;
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* =========================================================
   SLIDESHOW & EFEITOS
   ========================================================= */
.slideshow {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 340px;
  margin: 2rem 0 0 0;
  background: none;
  box-shadow: none;
  perspective: none;
  position: relative;
  z-index: 2;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  perspective: 1000px;
  will-change: transform;
}

#slide-photo {
  width: 400px;
  height: 320px;
  object-fit: contain;
  background: #fff;
  border-radius: 12px 12px 24px 24px;
  border: 14px solid #fff;
  box-shadow:
    0 8px 32px rgba(0,0,0,0.18),
    0 2px 8px rgba(0,0,0,0.10),
    0 0 24px 4px #fff,
    0 0 0 8px transparent;
  animation: polaroid-glow 2.5s linear infinite;
  opacity: 0;
  transform: rotate(-4deg) scale(0.98);
  margin-bottom: 18px;
  position: relative;
  z-index: 2;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  will-change: transform, opacity;
}

#slide-photo.show {
  opacity: 1;
  transform: rotate(2deg) scale(1.03);
}

/* Remover barra de progresso */
#slide-progress {
  display: none;
}

/* Efeito de hover nas imagens */
.slideshow:hover #slide-photo {
  transform: scale(1.05) translateZ(50px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

/* Sistema de fotos flutuantes */
.floating-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-item {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-size: cover;
  background-position: center center;
  box-shadow: 0 5px 20px 8px rgba(0,0,0,0.10), 0 0 0 8px rgba(255,255,255,0.7);
  transition: all 0.5s cubic-bezier(.4,2,.6,1);
  opacity: 0.7;
  animation: floatDown 15s linear infinite;
  filter: blur(0.5px) brightness(0.98);
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  will-change: transform;
  contain: layout style paint;
}

.floating-item.heart {
  background: none;
  font-size: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  text-shadow: 0 2px 10px rgba(255, 107, 107, 0.3);
  box-shadow: none;
  filter: blur(0.2px);
}

.floating-item:hover {
  transform: scale(1.2) translateX(60px);
  opacity: 1;
  filter: blur(0px) brightness(1);
}

@keyframes floatDown {
  0% {
    transform: translate3d(0, -100px, 0) rotate(0deg);
  }
  100% {
    transform: translate3d(0, calc(100vh + 100px), 0) rotate(360deg);
  }
}

/* =========================================================
   SISTEMA DE IMAGENS FLUTUANTES
   ========================================================= */
.floating-images {
  display: none;
}

/* =========================================================
   RESPONSIVIDADE
   ========================================================= */
@media (max-width: 768px) {
  .screen {
    padding: 15px;
  }

  h1 {
    font-size: 2rem;
  }

  button {
    padding: 14px 28px;
  }

  .floating-item {
    display: none;
  }

  .typing {
    font-size: 0.9rem;
    padding: 10px;
  }

  .cupom {
    padding: 15px 25px;
    font-size: 1.2rem;
  }

  #slide-photo {
    width: 100%;
    height: auto;
    max-height: 200px;
  }
}

@media (max-width: 700px) {
  #slide-photo {
    width: 90vw;
    height: 180px;
    border-width: 8px;
    font-size: 0.9rem;
    object-fit: contain;
  }
}

@keyframes polaroid-glow {
  0% {
    box-shadow:
      0 8px 32px rgba(0,0,0,0.18),
      0 2px 8px rgba(0,0,0,0.10),
      0 0 24px 4px #fff,
      0 0 0 8px #ffb6c1;
  }
  50% {
    box-shadow:
      0 8px 32px rgba(0,0,0,0.18),
      0 2px 8px rgba(0,0,0,0.10),
      0 0 32px 8px #ffe4ec,
      0 0 0 12px #ff6b6b;
  }
  100% {
    box-shadow:
      0 8px 32px rgba(0,0,0,0.18),
      0 2px 8px rgba(0,0,0,0.10),
      0 0 24px 4px #fff,
      0 0 0 8px #ffb6c1;
  }
}

.level-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 1.2rem;
  margin-top: -0.5rem;
  letter-spacing: 1px;
  text-shadow: 0 2px 8px rgba(255,107,107,0.08);
  display: block;
}

.level-transition {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  z-index: 9999;
  font-size: 2.2rem;
  color: var(--primary-dark);
  text-align: center;
  letter-spacing: 1px;
  animation: fadeInScale 0.7s;
}

.level-transition-content {
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.10);
  padding: 2.5rem 2.5rem 2rem 2.5rem;
  min-width: 320px;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}

#level-transition-msg {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--primary);
}

#level-transition-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.2rem;
}

#level-transition-points {
  font-size: 1.1rem;
  color: #444;
  margin-bottom: 0.5rem;
}

#level-transition-btn {
  padding: 14px 32px;
  border: none;
  border-radius: 16px;
  background: var(--primary);
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.18);
}

#level-transition-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px) scale(1.04);
}

@keyframes fadeInScale {
  0% { opacity: 0; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}

.level-transition-alert {
  font-size: 1.3rem;
  color: #ff9800;
  font-weight: 700;
  margin-bottom: 0.7rem;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.premio-final {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff8f0;
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(255,107,107,0.10);
  padding: 2rem 2.5rem 1.5rem 2.5rem;
  margin: 2rem auto 1.5rem auto;
  max-width: 400px;
  gap: 1.2rem;
  border: 2px dashed #ffb6b6;
}
.parabens {
  font-size: 1.3rem;
  font-weight: 700;
  color: #ff6b6b;
  margin-bottom: 0.5rem;
  text-align: center;
}
.valor-premio {
  font-size: 2.1rem;
  font-weight: 800;
  color: #ff6b6b;
  letter-spacing: 2px;
  margin-bottom: 0.2rem;
  margin-top: 0.2rem;
}
.premio-instrucoes {
  font-size: 1rem;
  color: #555;
  text-align: center;
  margin-top: 0.7rem;
}
.cupom-premio {
  background: linear-gradient(90deg, #fff, #ffe4ec 80%);
  border-radius: 18px;
  box-shadow: 0 2px 12px rgba(255,107,107,0.08);
  padding: 1.2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}
.cupom-nome {
  font-size: 1.1rem;
  font-weight: 600;
  color: #b85c5c;
}
.frase-romantica {
  font-size: 1rem;
  color: #a77;
  margin-top: 0.2rem;
  font-style: italic;
}
.cupom-instrucoes {
  font-size: 1rem;
  color: #555;
  text-align: center;
  margin-top: 0.7rem;
}
.cupom-instrucoes small {
  color: #888;
}
  