:root {
  --azul: #1769aa;
  --celeste: #eaf6ff;
  --verde: #1b9b67;
  --amarillo: #ffcf56;
  --texto: #243447;
  --blanco: #ffffff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Trebuchet MS", Arial, sans-serif;
  color: var(--texto);
  background: #f5faff;
  line-height: 1.6;
}

.encabezado {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 28px 16px;
  color: white;
  text-align: left;
  background: linear-gradient(120deg, #145b98, #2186c4);
}

.logo {
  font-size: 65px;
}

.encabezado h1 {
  font-size: clamp(20px, 4vw, 32px);
}

.encabezado p {
  margin: 5px 0;
}

.etiqueta {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--amarillo);
  color: #263238;
  font-size: 12px;
  font-weight: bold;
}

.navegacion {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  background: white;
  box-shadow: 0 3px 10px #0000000d;
}

.navegacion a {
  padding: 8px 15px;
  border-radius: 20px;
  color: var(--azul);
  text-decoration: none;
  font-weight: bold;
}

.navegacion a:hover {
  background: var(--celeste);
}

main {
  width: min(1100px, 94%);
  margin: auto;
}

.bienvenida {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin: 28px 0;
  padding: 38px;
  border-radius: 24px;
  background: #fff0c8;
}

.bienvenida-texto {
  max-width: 620px;
}

.subtitulo {
  color: var(--verde);
  font-weight: bold;
}

.bienvenida h2 {
  margin: 8px 0;
  font-size: clamp(27px, 4vw, 42px);
  line-height: 1.2;
}

.bienvenida-texto > p {
  margin-bottom: 18px;
}

.ilustracion {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  font-size: clamp(40px, 7vw, 80px);
}

.boton {
  display: inline-block;
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  background: var(--verde);
  color: white;
  font: inherit;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.boton:hover {
  transform: translateY(-2px);
  background: #13794f;
}

.seccion {
  margin: 28px 0;
  padding: 30px;
  border-radius: 22px;
  background: white;
  box-shadow: 0 5px 20px #2345670d;
}

.seccion h2 {
  color: var(--azul);
  font-size: clamp(23px, 4vw, 32px);
}

.descripcion {
  margin: 8px 0 22px;
  color: #64748b;
}

.rejilla-letras {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.letra {
  min-height: 65px;
  border: 2px solid #d7ebfa;
  border-radius: 15px;
  background: var(--celeste);
  color: var(--azul);
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
}

.letra:hover,
.letra:focus {
  background: var(--amarillo);
  color: #263238;
  transform: scale(1.04);
}

.detalle {
  margin-top: 24px;
  padding: 25px;
  border: 2px dashed #b8dff5;
  border-radius: 20px;
  background: #f8fcff;
  text-align: center;
}

.letra-grande {
  display: block;
  color: var(--verde);
  font-size: 85px;
  font-weight: bold;
  line-height: 1.2;
}

.detalle h3 {
  margin: 8px 0;
  font-size: 25px;
}

.detalle p {
  margin: 5px 0 12px;
}

.boton-audio {
  margin-top: 10px;
  padding: 9px 16px;
  border: none;
  border-radius: 10px;
  background: #d8f6e7;
  color: #116743;
  font: inherit;
  font-weight: bold;
  cursor: pointer;
}

.juego {
  background: #edf8ff;
  text-align: center;
}

.tarjeta-juego {
  max-width: 650px;
  margin: 22px auto 0;
  padding: 25px;
  border-radius: 20px;
  background: white;
}

.pregunta {
  font-weight: bold;
}

.palabra-pregunta {
  margin: 12px 0;
  font-size: 60px;
  font-weight: bold;
  color: var(--verde);
}

.opciones {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
}

.opcion {
  min-width: 75px;
  min-height: 70px;
  border: 2px solid #b9dff5;
  border-radius: 15px;
  background: #f3faff;
  color: var(--azul);
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
}

.opcion:hover {
  background: var(--amarillo);
}

.opcion:disabled {
  cursor: default;
  opacity: 0.8;
}

.mensaje {
  min-height: 32px;
  margin: 12px 0;
  font-weight: bold;
}

.resultados {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0;
}

.resultado {
  padding: 20px 10px;
  border-radius: 16px;
  background: var(--celeste);
  text-align: center;
}

.resultado span {
  font-size: 30px;
}

.resultado h3 {
  font-size: 15px;
}

.resultado p {
  color: var(--azul);
  font-size: 25px;
  font-weight: bold;
}

.progreso {
  height: 18px;
  overflow: hidden;
  border-radius: 20px;
  background: #e2e8f0;
}

#barra-progreso {
  width: 0;
  height: 100%;
  border-radius: 20px;
  background: var(--verde);
  transition: width 0.3s;
}

.resumen {
  margin: 15px 0;
  font-weight: bold;
}

.boton-secundario {
  background: var(--azul);
}

footer {
  margin-top: 40px;
  padding: 28px 15px;
  background: #124d7b;
  color: white;
  text-align: center;
}

@media (max-width: 650px) {
  .encabezado {
    text-align: center;
    flex-direction: column;
  }

  .logo {
    font-size: 48px;
  }

  .bienvenida {
    flex-direction: column;
    padding: 25px 18px;
    text-align: center;
  }

  .seccion {
    padding: 20px 14px;
  }

  .rejilla-letras {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
  }

  .letra {
    min-height: 58px;
    font-size: 25px;
  }

  .resultados {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tarjeta-juego {
    padding: 20px 10px;
  }

  .navegacion {
    gap: 4px;
  }

  .navegacion a {
    padding: 7px 9px;
    font-size: 14px;
  }
}