* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Montserrat", sans-serif;
  background-image: url('Fondo.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

.app {
  max-width: 1000px;
  margin: 0 auto;
  padding: 30px 20px 60px;
  text-align: center;
}

h1 {
  margin-bottom: 30px;
  font-size: clamp(24px, 5vw, 44px);
  color: rgb(255, 255, 255);
  text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
}

.pantalla {
  display: none;
}

.pantalla.activa {
  display: block;
}

/* ── RULETA ── */
.ruleta-wrapper {
  position: relative;
  width: min(380px, 80vw);
  height: min(380px, 80vw);
  margin: 20px auto 30px;
}

.ruleta {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 10px solid #ffffff;
  position: relative;
  overflow: hidden;
  transition: transform 4s cubic-bezier(0.23, 1, 0.32, 1);
  background: conic-gradient(
    #0ab48f 0deg 60deg,
    #066d68 60deg 120deg,
    #17ca94 120deg 180deg,
    #0c8d62 180deg 240deg,
    #045c49 240deg 300deg,
    #2dcfb4 300deg 360deg
  );
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.centro-ruleta {
  position: absolute;
  width: clamp(70px, 28%, 110px);
  height: clamp(70px, 28%, 110px);
  background: linear-gradient(145deg, #ffffff, #f0f0f0);
  color: #111;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: clamp(16px, 5vw, 28px);
  z-index: 2;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  border: 4px solid #fff;
}

.puntero {
  width: 0;
  height: 0;
  border-left: 22px solid transparent;
  border-right: 22px solid transparent;
  border-top: 45px solid #ffffff;
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* ── ETIQUETAS CATEGORÍAS ── */
.categoria-label {
  position: absolute;
  width: 80%;
  height: 80%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: clamp(11px, 2.5vw, 16px);
  color: white;
  text-shadow: 2px 2px 6px rgba(0,0,0,0.9);
  pointer-events: none;
  top: 10%;
  left: 10%;
  text-align: center;
  padding: 10px;
  line-height: 1.2;
}

.categoria-0 { transform: rotate(30deg); }
.categoria-1 { transform: rotate(90deg); }
.categoria-2 { transform: rotate(150deg); }
.categoria-3 { transform: rotate(210deg); }
.categoria-4 { transform: rotate(270deg); }
.categoria-5 { transform: rotate(330deg); }

.texto-info {
  margin-top: 18px;
  font-size: clamp(16px, 4vw, 24px);
  font-weight: bold;
  min-height: 32px;
  color: white;
  text-shadow: 2px 2px 6px rgba(0,0,0,0.8);
  padding: 0 10px;
}

/* ── BOTÓN GIRAR ── */
.btn-girar {
  padding: clamp(14px, 3vw, 22px) clamp(28px, 8vw, 60px);
  font-size: clamp(16px, 4vw, 26px);
  border: none;
  border-radius: 60px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.9);
  color: rgb(0, 0, 0);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 3px;
  box-shadow: 0 12px 30px rgba(7, 56, 52, 0.5);
  transition: all 0.3s ease;
  margin-top: 25px;
  width: clamp(240px, 80vw, 400px);
}

.btn-girar:hover {
  transform: translateY(-6px) scale(1.05);
  box-shadow: 0 20px 40px rgba(100, 226, 184, 0.7);
}

.btn-girar:active {
  transform: translateY(-3px) scale(1.02);
}

.btn-girar:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 8px 20px rgba(14, 11, 11, 0.3);
}

/* ── BOTONES GENERALES ── */
button {
  padding: 14px 28px;
  font-size: clamp(16px, 3.5vw, 22px);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.9);
  color: #0c3c2c;
  font-weight: bold;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

button:hover {
  background: linear-gradient(45deg, #0f8a6d, #00b398);
  color: rgb(255, 255, 255);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(30, 128, 98, 0.2);
}

/* ── PANEL PREGUNTAS ── */
.panel {
  max-width: 820px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(15px);
  padding: clamp(16px, 4vw, 30px);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.barra-superior {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 20px;
  font-size: clamp(14px, 3.5vw, 22px);
  font-weight: bold;
  color: white;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
  flex-wrap: wrap;
}

#preguntaTexto {
  font-size: clamp(18px, 4.5vw, 34px);
  line-height: 1.4;
  margin-bottom: 24px;
  color: white;
  text-shadow: 2px 2px 6px rgba(0,0,0,0.8);
}

/* ── OPCIONES ── */
.opciones {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.opcion-btn {
  padding: clamp(12px, 3vw, 18px);
  font-size: clamp(14px, 3.5vw, 22px);
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,0.8);
  background: rgba(255, 255, 255, 0.9);
  color: #0c3c2c;
  cursor: pointer;
  font-weight: bold;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  word-break: break-word;
  hyphens: auto;
  line-height: 1.3;
}

.opcion-btn:hover:not(:disabled) {
  background: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.opcion-btn:disabled {
  cursor: not-allowed;
}

.opcion-btn.correcta {
  background: #2ecc71;
  color: white;
  border-color: #2ecc71;
  animation: pulse 0.6s ease-in-out;
}

.opcion-btn.incorrecta {
  background: #e74c3c;
  color: white;
  border-color: #e74c3c;
  animation: shake 0.5s ease-in-out;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.mensaje {
  min-height: 34px;
  font-size: clamp(16px, 4vw, 24px);
  font-weight: bold;
  margin-top: 20px;
  color: white;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}

/* ── RESULTADOS ── */
.resultado p {
  font-size: clamp(18px, 4vw, 28px);
  margin: 14px 0;
  color: white;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}

#btnReiniciar {
  background: linear-gradient(45deg, #2ecc71, #27ae60);
  color: white;
  font-size: clamp(16px, 3.5vw, 22px);
  padding: 16px 40px;
  margin-top: 20px;
}

/* ── RESPONSIVE: pantallas pequeñas / portrait ── */
@media (max-width: 600px) {
  .app {
    padding: 20px 12px 40px;
  }

  .barra-superior {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
  }

  .opciones {
    grid-template-columns: 1fr;
  }

  .panel {
    margin: 0 4px;
  }
}

/* ── RESPONSIVE: pantallas muy pequeñas ── */
@media (max-width: 380px) {
  .app {
    padding: 14px 8px 30px;
  }

  .puntero {
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-top: 32px solid #ffffff;
  }
}

/* ── LANDSCAPE en móvil: asegura que la ruleta no se corte ── */
@media (max-height: 500px) and (orientation: landscape) {
  .ruleta-wrapper {
    width: min(260px, 45vh);
    height: min(260px, 45vh);
    margin: 10px auto 16px;
  }

  h1 {
    font-size: 22px;
    margin-bottom: 10px;
  }

  .btn-girar {
    margin-top: 10px;
    padding: 10px 30px;
  }
}

