/* === RESET & CONFIGS === */
*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root{
  --gold: #caa85a;
  --goldLight: #f6d68f;
  --bg: #080503;
  --optionBg: rgba(18, 12, 8, 0.86);
  --optionBorder: rgba(183, 139, 57, 0.35);
  --correct: #58c06d;
  --wrong: #d35c5c;
  --cream: rgba(255, 235, 205, 0.92);
}

html, body{
  width: 100%;
  height: 100%;
  background: #000;
  font-family: 'Cinzel', serif;
  color: var(--cream);
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
}

/* BACKGROUND FIXED */
#bg{
  position: fixed;
  inset: 0;
  background: url('./fundovertical.png') center center / cover no-repeat;
  z-index: 0;
}

/* CONTROLE DE OPACIDADE DO FUNDO */
#bg::after{
  content: '';
  position: absolute;
  inset: 0;
  /* El degradado inicial de la intro y el resultado */
  background: linear-gradient(to bottom, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.15) 30%, rgba(0,0,0,0.55) 65%, rgba(0,0,0,0.92) 100%);
  opacity: 1;
  transition: background 0.5s ease;
}

/* SEGUNDO PUNTO: Cuando las preguntas están activas, oscurecemos el fondo un 85% para que no distraiga */
body:has(#screen-question.active) #bg::after {
  background: rgba(0, 0, 0, 0.85);
}

/* ESTRUTURA DAS TELAS */
.screen{
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 20px;
  overflow-x: hidden;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.screen.active{
  opacity: 1;
  pointer-events: auto;
}

/* Espacio vacío enorme en el medio */
.spacer-middle {
  flex: 1; 
  width: 100%;
}

/* TELA: INTRO */
#screen-intro{
  justify-content: flex-start;
  padding-top: 30px;
  padding-bottom: 40px;
}

.logo-top{
  width: min(65vw, 280px);
  filter: drop-shadow(0 0 20px rgba(255,160,0,0.25));
}

.intro-bottom {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px; /* Separación fija entre el logo horizontal y el botón */
}

/* PRIMER PUNTO: Logo horizontal más grande arriba del botón */
.logo-intro-horizontal {
  width: min(85vw, 380px);
  height: auto;
  filter: drop-shadow(0 0 25px rgba(255,140,0,0.3));
}

/* BOTÕES PRINCIPAIS */
.btn-primary{
  width: 100%;
  max-width: 340px;
  padding: 16px 24px;
  border-radius: 6px;
  border: 1.5px solid rgba(230,180,80,0.75);
  background: linear-gradient(135deg, rgba(130,90,30,0.25), rgba(80,40,10,0.15));
  color: var(--goldLight);
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary:hover{
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(255,160,0,0.25);
  border-color: var(--goldLight);
}

/* TELA: PERGUNTAS */
#screen-question{ 
  justify-content: flex-start; 
}

.question-logo{
  width: min(45vw, 180px);
  margin-bottom: 10px;
}

.q-progress{
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.q-dots{ display: flex; gap: 8px; }
.q-dot{
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,180,80,0.15);
  border: 1px solid rgba(255,180,80,0.3);
  transition: all 0.3s ease;
}
.q-dot.done{ background: var(--gold); }
.q-dot.current{
  background: var(--goldLight);
  transform: scale(1.3);
  box-shadow: 0 0 8px var(--gold);
}

.q-image-wrap { margin-bottom: 15px; }
.q-image{
  width: 110px; height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(220,170,70,0.6);
  box-shadow: 0 0 25px rgba(255,120,0,0.2);
}

.q-text{
  width: 100%;
  max-width: 480px;
  text-align: center;
  font-size: clamp(16px, 4.5vw, 22px);
  line-height: 1.4;
  font-weight: 700;
  margin-bottom: 20px;
}

/* OPÇÕES DE RESPOSTA */
.q-options{
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 90px;
}

.q-option{
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: var(--optionBg);
  border: 1.5px solid var(--optionBorder);
  border-radius: 6px;
  color: var(--cream);
  font-family: 'Cinzel', serif;
  cursor: pointer;
  transition: all 0.2s ease;
}

.q-option:hover{
  border-color: rgba(255,190,90,0.6);
  transform: translateX(4px);
  background: rgba(255,255,255,0.03);
}

.q-option.correct{
  background: rgba(40, 85, 45, 0.7) !important;
  border-color: var(--correct) !important;
  box-shadow: 0 0 15px rgba(80,200,90,0.2);
}

.q-option.wrong{
  background: rgba(90, 20, 20, 0.7) !important;
  border-color: var(--wrong) !important;
  animation: shake 0.3s ease;
}

@keyframes shake{
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.opt-letter{
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(220,170,70,0.4);
  color: var(--goldLight); font-weight: 700; font-size: 12px; flex-shrink: 0;
}

.opt-text{ font-size: 13px; letter-spacing: .1em; text-transform: uppercase; text-align: left; }

/* FEEDBACK & NEXT FLUTUANTES */
#feedback{
  position: fixed; left: 50%; bottom: 95px; transform: translateX(-50%);
  z-index: 100; padding: 10px 22px; border-radius: 4px;
  font-size: 12px; font-weight: 700; letter-spacing: .15em;
  text-transform: uppercase; opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
#feedback.show{ opacity: 1; }
#feedback.correct{ background: rgba(35,90,45,0.95); border: 1px solid var(--correct); color: #9fffaf; }
#feedback.wrong{ background: rgba(90,25,25,0.95); border: 1px solid var(--wrong); color: #ffb0b0; }

#btn-next{
  position: fixed; left: 50%; bottom: 25px; transform: translateX(-50%);
  z-index: 110; width: calc(100% - 40px); max-width: 340px;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
#btn-next.show{ opacity: 1; pointer-events: auto; }

/* TELA: RESULTADO */
#screen-result{ 
  justify-content: flex-start; 
  padding-top: 30px;
  padding-bottom: 15px;
}

.result-bottom{
  width: 100%; display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding-bottom: 15px;
}

/* TERCER PUNTO: Logo horizontal arriba de las frases en el resultado */
.result-logo-horizontal {
  width: min(65vw, 260px);
  margin-bottom: 5px;
  filter: drop-shadow(0 0 18px rgba(255,160,0,0.2));
}

.result-title{
  font-family: 'Cinzel Decorative', serif; font-size: clamp(18px, 4.5vw, 26px);
  color: var(--goldLight); text-align: center;
}
.result-score{ font-size: 48px; font-weight: 900; color: var(--goldLight); margin: -5px 0; }
.result-msg{ max-width: 300px; line-height: 1.5; font-size: 13px; color: rgba(255,230,190,0.8); text-align: center; margin-bottom: 10px; }

/* OPTIMIZACIÓN IPAD / TABLETS */
@media (min-width: 720px){
  .screen{
    max-width: 600px; margin: 0 auto; left: 50%; transform: translateX(-50%);
    padding: 40px 20px;
  }
  .q-image{ width: 130px; height: 130px; }
  .logo-top { width: 240px; }
  .logo-intro-horizontal { width: 360px; }
  .result-logo-horizontal { width: 260px; }
  #btn-next, #feedback { left: 50%; transform: translateX(-50%); width: 100%; max-width: 340px; }
}

/* === FIX DEFINITIVO DE SOBREPOSIÇÃO === */
.screen {
  z-index: 5;
}

#screen-result {
  z-index: 15 !important;
}

#screen-question.active {
  z-index: 10;
}

.screen:not(.active) {
  pointer-events: none;
  opacity: 0 !important;
}