/* ========== Reset básico ========== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
img,
video {
  max-width: 100%;
  height: auto;
}

/* ========== Estructura general ========== */
body {
  background-color: #000;
  color: #fff;
  font-family: "Courier New", Courier, monospace;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  overflow: hidden;
}

/* ========== Frase central ========== */
.latin-phrase {
  font-size: 1.5em;
  margin-bottom: 40px;
  letter-spacing: 2px;
  opacity: 0.9;
  z-index: 2;
}

/* ========== Cuenta regresiva ========== */
.countdown {
  font-size: 3em;
  color: #ff2c2c;
  letter-spacing: 4px;
  z-index: 2;
}

/* ========== Efecto glitch ========== */
.glitch {
  animation: glitch 2s infinite;
}

@keyframes glitch {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.05;
  }
}

/* ========== Parpadeo a pantalla completa ========== */
#parpadeo-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#parpadeo-fullscreen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) brightness(80%) contrast(110%);
  mix-blend-mode: screen;
  animation: static-flicker 0.2s infinite alternate;
  max-width: 100vw;
  max-height: 100vh;
}

@keyframes static-flicker {
  0% {
    filter: brightness(70%) grayscale(100%) contrast(90%);
  }
  100% {
    filter: brightness(90%) grayscale(100%) contrast(120%);
  }
}

/* ========== Preguntas e inputs ========== */
.questions-container {
  display: flex;
  justify-content: space-around;
  gap: 1rem;
  margin-top: 2rem;
  width: 90%;
  max-width: 1000px;
  flex-wrap: wrap;
  z-index: 2;
}

.question {
  flex: 1 1 40%;
  background-color: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 8px;
  color: white;
  text-align: left;
  margin: 0.5rem 0;
  font-size: 1rem;
}

.question input {
  margin-top: 0.8rem;
  padding: 0.5rem;
  border: none;
  border-radius: 5px;
  width: 100%;
  background: #111;
  color: white;
  text-align: center;
}

.estado-respuesta {
  margin-top: 0.3rem;
  font-size: 0.9rem;
}

/* ========== Botón del popup ========== */
.popup-btn {
  position: fixed;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border: none;
  font-size: 1.2rem;
  padding: 0.5rem;
  cursor: pointer;
  z-index: 20;
}

/* ========== Popup secreto ========== */
.popup-container {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.popup-container.active {
  display: flex;
}

.popup-content {
  background: #111;
  padding: 1.5rem;
  border-radius: 10px;
  text-align: center;
  color: white;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
  position: relative;
  width: 90%;
  max-width: 400px;
}

.popup-content input {
  padding: 0.5rem;
  border: none;
  margin-bottom: 1rem;
  width: 100%;
  text-align: center;
  background: #222;
  color: white;
}

.popup-content button {
  padding: 0.5rem 1rem;
  background: #333;
  color: white;
  border: none;
  cursor: pointer;
  margin: 0 0.25rem;
}

.popup-content button.cerrar {
  background: transparent;
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1rem;
}

/* ========== Texto misterioso oculto (si usas) ========== */
.misterioso-link {
  position: fixed;
  bottom: 10px;
  right: 10px;
  color: rgba(255, 255, 255, 0.15);
  font-size: 0.8rem;
  font-style: italic;
  pointer-events: none;
  text-decoration: none;
  transition: opacity 0.3s ease;
  opacity: 0;
  z-index: 10;
}

.misterioso-link.visible {
  opacity: 1;
  color: #7e0000;
  pointer-events: auto;
}

/* ========== Glitch alternativo (si lo usas) ========== */
@keyframes glitch-flicker {
  0% {
    opacity: 1;
    transform: translate(0, 0);
  }
  20% {
    opacity: 0.8;
    transform: translate(-1px, 1px);
  }
  40% {
    opacity: 0.6;
    transform: translate(1px, -1px);
  }
  60% {
    opacity: 0.9;
    transform: translate(-1px, -1px);
  }
  80% {
    opacity: 0.7;
    transform: translate(1px, 1px);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0);
  }
}

.glitch-pista {
  animation: glitch-flicker 0.25s steps(2, end) infinite;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .questions-container {
    flex-direction: column;
    align-items: center;
  }

  .question {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .latin-phrase {
    font-size: 1.2em;
    margin-bottom: 20px;
  }

  .countdown {
    font-size: 2em;
  }

  .popup-content {
    padding: 1rem;
  }

  .popup-btn {
    top: 8px;
    right: 8px;
    font-size: 1rem;
    padding: 0.4rem;
  }

  #parpadeo-fullscreen img {
    width: 100vw;
    height: 100vh;
    object-fit: cover;
  }
}

.pista-reversa-icon {
  margin: 8px 0 14px;
  opacity: 0.6;
  animation: static-flicker 1s infinite alternate;
}

.pista-reversa-icon img {
  height: 24px;
  filter: invert(1) grayscale(1) brightness(0.8);
}
