/* ===== RESETEO ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #0033A0, #00A9E0);
  color: #fff;
  text-align: center;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto; /* 🔹 permite desplazamiento */
}

/* ===== HEADER TELCEL ===== */
.main-header {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 90px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  position: relative;
  z-index: 20; /* 🔹 siempre encima del fondo */
  background: transparent;
}

.logo-telcel {
  height: 60px;
  width: auto;
  object-fit: contain;
}

/* ===== FONDO ANIMADO CANVAS ===== */
#gridCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #020617;
  z-index: 0;
  pointer-events: none;
}

/* ===== PANTALLAS ===== */
.screen {
  display: none;
  position: relative;
  width: 100%;
  min-height: calc(100vh - 150px);
  overflow-y: auto;
  padding: 20px;
  z-index: 10;
  animation: fadeIn 0.6s ease-in-out;
}

.screen.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== PANTALLA DE BIENVENIDA ===== */
.hero {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  height: calc(100vh - 90px);
  color: #fff;
  font-family: "Orbitron", sans-serif;
  padding: 0 20px;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  transform: translateY(-10vh);
}

.hero-title {
  font-size: 2.3rem;
  letter-spacing: 2px;
  margin-bottom: 1rem;
  text-shadow: 0px 0px 15px rgba(0, 169, 224, 0.6);
}

/* ===== BOTÓN FUTURISTA ===== */
.cta-btn {
  background: transparent;
  border: 2px solid #00A9E0;
  color: #00A9E0;
  font-size: 1.2rem;
  padding: 1rem 2rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
  font-family: "Orbitron", sans-serif;
}

.cta-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(0, 169, 224, 0.2);
  transition: left 0.4s ease;
}

.cta-btn:hover::before {
  left: 100%;
}

.cta-btn:hover {
  color: #fff;
  box-shadow: 0 0 15px rgba(0, 169, 224, 0.8),
              0 0 30px rgba(0, 169, 224, 0.6);
}

/* ===== FOOTER ===== */
.welcome-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem;
  z-index: 20;
  background: transparent;
}

.welcome-footer img {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.logo-footer.buenfin {
  filter: none !important;
  opacity: 1 !important;
}

.logo-footer.vie {
  transform: translateX(-8px);
}

/* ===== FORMULARIOS ===== */
form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 500px;
  margin: 20px auto;
  text-align: left;
}

label {
  font-weight: bold;
  color: #0033A0;
  padding: 4px 10px;
  border-radius: 6px;
}

input, select {
  padding: 12px;
  font-size: 1rem;
  border-radius: 10px;
  border: 2px solid #00A9E0;
  outline: none;
}

input:focus, select:focus {
  border-color: #0033A0;
}

/* ===== CARD FORM ===== */
.card-form {
  position: relative;
  z-index: 10;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 2rem;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.25);
  text-align: left;
  color: #fff;
  animation: fadeIn 0.6s ease-in-out;
}

.card-form h2 {
  text-align: center;
  margin-bottom: 1rem;
  padding-top: 1rem;
  color: #fff;
  font-weight: 700;
}

.card-form label {
  color: #FFFFFF;
}

.card-form input,
.card-form select {
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid #00A9E0;
  color: #0033A0;
}

.card-form .btn {
  background: #00A9E0;
  color: white;
  border: none;
  padding: 12px;
  font-size: 1.1rem;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.3s ease;
  width: 100%;
}

.card-form .btn:hover {
  background: #007ACC;
  transform: scale(1.03);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero-title { font-size: 1.8rem; }
  .cta-btn { font-size: 1rem; padding: 0.8rem 1.5rem; }
  .welcome-footer { height: 55px; padding: 0 15px; }
  .welcome-footer img { height: 30px; }
}

#game-area {
    position: relative;
    width: 100%;
    height: 400px;
    background: #0f1b3e;
    margin: 20px 0;
    border-radius: 12px;
    overflow: hidden;
}

#target {
    position: absolute;
    width: 50px;
    height: 50px;
    background: #f59e0b;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}
/* ===== PANTALLAS CENTRADAS ===== */
.screen {
  display: none;
  position: fixed;              /* fija al viewport */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 420px;
  color: white;
  padding: 25px 20px;
  text-align: center;
  animation: fadeIn 0.6s ease-in-out;
  z-index: 15;

  /* 🔹 Asegura que no se corte el contenido */
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  overflow-x: hidden;
}

/* Cuando está activa */
.screen.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* ===== ANIMACIÓN ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -60%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* ===== RESPONSIVE ===== */
@media (max-height: 700px) {
  .screen {
    top: 55%;
    transform: translate(-50%, -55%);
    max-height: 90vh;
    padding: 20px 15px;
  }
}
/* =========================================================
   🔹 ESTILOS COMPLEMENTARIOS PARA TOTEM (MISMA BASE VISUAL)
   ========================================================= */

/* ===== CONTENEDOR PRINCIPAL ===== */
.totem-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  position: relative;
  z-index: 10;
  text-align: center;
}

/* ===== HEADER Y SUBTÍTULOS ===== */
.totem-header {
  text-align: center;
  color: #fff;
  margin-bottom: 1.5rem;
}

.totem-header .logo {
  font-size: 3.5rem;
  font-weight: 800;
  text-transform: uppercase;
  text-shadow: 0 0 25px rgba(0, 169, 224, 0.8);
}

.totem-header .subtitle {
  font-size: 1.5rem;
  color: #bdeaff;
  opacity: 0.9;
  font-weight: 400;
  margin-top: 0.5rem;
}

/* ===== PANTALLA DE ESPERA ===== */
.waiting-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border-radius: 25px;
  padding: 2rem 3rem;
  box-shadow: 0 0 40px rgba(0, 169, 224, 0.25);
}

.qr-container {
  background: rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  border-radius: 20px;
  box-shadow: inset 0 0 20px rgba(0, 169, 224, 0.25);
  display: inline-block;
}

.qr-code {
  width: 260px;
  height: 260px;
  border-radius: 15px;
}

.scan-instruction {
  font-size: 1.5rem;
  font-weight: 700;
  color: #00A9E0;
  margin-top: 1rem;
  text-shadow: 0 0 10px rgba(0, 169, 224, 0.6);
}

.url-display {
  font-size: 1rem;
  color: #fff;
  opacity: 0.85;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  margin-top: 0.5rem;
  letter-spacing: 0.5px;
}

/* ===== LISTA DE JUGADORES ===== */
.players-waiting {
  margin-top: 1.5rem;
}

.players-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #00A9E0;
  margin-bottom: 1rem;
}

.player-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  justify-items: center;
}

.player-card {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(0, 169, 224, 0.6);
  border-radius: 15px;
  padding: 1rem;
  text-align: center;
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 169, 224, 0.2);
  transition: all 0.3s ease;
}

.player-card:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(0, 169, 224, 0.4);
}

.player-card-name {
  font-weight: 700;
  color: #00A9E0;
  font-size: 1.1rem;
}

.player-card-status {
  font-size: 0.9rem;
  color: #bdeaff;
  margin-top: 0.25rem;
}

/* ===== BOTÓN DE INICIO ===== */
.start-btn {
  background: transparent;
  border: 2px solid #00A9E0;
  color: #00A9E0;
  font-size: 1.5rem;
  padding: 1rem 3rem;
  border-radius: 15px;
  cursor: pointer;
  font-family: "Orbitron", sans-serif;
  font-weight: 700;
  transition: all 0.4s ease;
  text-transform: uppercase;
  margin-top: 2rem;
}

.start-btn:hover {
  background: #00A9E0;
  color: #fff;
  box-shadow: 0 0 25px rgba(0, 169, 224, 0.6);
  transform: scale(1.05);
}

.start-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== SCOREBOARD ===== */
.scoreboard {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
  width: 100%;
}

.score-card {
  background: rgba(0, 51, 160, 0.3);
  border: 2px solid rgba(0, 169, 224, 0.5);
  color: #fff;
  border-radius: 15px;
  padding: 1rem;
  box-shadow: 0 0 15px rgba(0, 169, 224, 0.25);
  text-align: center;
}

.score-name {
  font-weight: bold;
  color: #00A9E0;
  margin-bottom: 0.5rem;
}

.score-points {
  font-size: 2rem;
  font-weight: 700;
}

/* ===== PREGUNTAS Y RESPUESTAS ===== */
.question-container {
  margin-top: 2rem;
  width: 100%;
}

.question-text {
  font-size: 1.8rem;
  font-weight: bold;
  background: rgba(255, 255, 255, 0.1);
  border-left: 6px solid #00A9E0;
  border-radius: 10px;
  padding: 1.5rem;
  color: #fff;
  text-shadow: 0 0 10px rgba(0, 169, 224, 0.4);
  margin-bottom: 2rem;
}

.answers-display {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.answer-option {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(0, 169, 224, 0.4);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  font-size: 1.2rem;
  color: #fff;
  transition: all 0.3s ease;
  position: relative;
}

.answer-option.correct {
  background: rgba(0, 255, 102, 0.25);
  border-color: #00ff99;
  box-shadow: 0 0 20px rgba(0, 255, 102, 0.5);
}

.answer-votes {
  position: absolute;
  top: 8px;
  right: 12px;
  background: #00A9E0;
  color: #fff;
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.9rem;
}

/* ===== RESULTADOS Y PODIO ===== */
.results-screen {
  text-align: center;
}

.trophy {
  font-size: 6rem;
  color: #FFD700;
  margin: 2rem 0;
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.winner-announcement {
  font-size: 2.5rem;
  color: #FFD700;
  font-weight: bold;
  margin: 1.5rem 0;
  text-shadow: 0 0 25px rgba(255, 215, 0, 0.4);
}

.podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1rem;
  margin-top: 2rem;
}

.podium-place {
  min-width: 160px;
  padding: 1rem;
  border-radius: 15px;
  color: #fff;
  text-align: center;
}

.podium-place.first {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  transform: scale(1.1);
}

.podium-place.second {
  background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
}

.podium-place.third {
  background: linear-gradient(135deg, #CD7F32, #B8860B);
}

/* ===== BOTÓN REINICIAR ===== */
.restart-btn {
  background: transparent;
  border: 2px solid #FFD700;
  color: #FFD700;
  font-size: 1.5rem;
  padding: 1rem 3rem;
  border-radius: 15px;
  cursor: pointer;
  margin-top: 2rem;
  font-family: "Orbitron", sans-serif;
  transition: all 0.4s ease;
}

.restart-btn:hover {
  background: #FFD700;
  color: #0033A0;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
  transform: scale(1.05);
}

/* ===== RESPONSIVE TOTEM ===== */
@media (max-width: 768px) {
  .qr-code { width: 200px; height: 200px; }
  .answer-option { font-size: 1rem; }
  .question-text { font-size: 1.3rem; padding: 1rem; }
}
.answer-btn {
  display: block;
  width: 100%;
  background: #ffffff10;
  border: 2px solid #0078d7;
  color: #ffffff;
  font-weight: 600;
  border-radius: 14px;
  padding: 14px 18px;
  margin: 10px 0;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.25s ease-in-out;
  backdrop-filter: blur(4px);
}

.answer-btn:hover {
  background: #0078d7;
  color: #fff;
  transform: scale(1.04);
}
.answer-btn.correct {
  background-color: #4CAF50 !important;
  color: white !important;
  border-color: #4CAF50 !important;
}

.answer-btn.incorrect {
  background-color: #f44336 !important;
  color: white !important;
  border-color: #f44336 !important;
}
.answer-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.answers-container {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  margin-top: 20px;
}

.question-text {
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 15px;
}
