* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --morado-1: #6a3fb5;
  --morado-2: #9b59d9;
  --morado-3: #c489ec;
  --amarillo: #ffd93d;
  --verde: #4ecb71;
  --rosa: #ff8fb3;
  --texto-oscuro: #3a2960;
  --blanco: #ffffff;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Nunito', sans-serif;
  background: linear-gradient(135deg, var(--morado-1), var(--morado-2) 55%, var(--morado-3));
  color: var(--texto-oscuro);
  min-height: 100vh;
  position: relative;
}

[hidden] { display: none !important; }

/* ---------- Formas decorativas flotantes ---------- */
.shapes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.shape {
  position: absolute;
  font-size: 48px;
  opacity: 0.55;
  animation: flotar 7s ease-in-out infinite;
}

.shape-sun { top: 6%; right: 8%; font-size: 62px; animation-duration: 9s; }
.c1 { top: 10%; left: 6%; animation-delay: 0.3s; }
.c2 { top: 65%; right: 5%; font-size: 40px; animation-delay: 1.2s; }
.l1 { bottom: 8%; left: 10%; animation-delay: 0.6s; }
.l2 { bottom: 14%; right: 14%; animation-delay: 1.6s; }
.f1 { top: 40%; left: 3%; font-size: 36px; animation-delay: 0.9s; }
.f2 { top: 30%; right: 3%; font-size: 36px; animation-delay: 0.2s; }

@keyframes flotar {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-16px) rotate(6deg); }
}

/* ---------- Layout general ---------- */
.app {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pantalla {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.pantalla.activa {
  display: flex;
}

.titulo {
  font-family: 'Fredoka One', cursive;
  font-size: 34px;
  text-align: center;
  color: black;
  text-shadow: 0 3px 0 rgba(0,0,0,0.15);
  margin-bottom: 6px;
}

.titulo-chico { font-size: 24px; }

.subtitulo {
  text-align: center;
  font-weight: 800;
  color: var(--blanco);
  margin-bottom: 18px;
  font-size: 16px;
}

/* ---------- Tarjetas ---------- */
.tarjeta {
  background: var(--blanco);
  border-radius: 28px;
  box-shadow: 0 14px 0 rgba(0,0,0,0.12);
  padding: 28px 34px;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
}

.tarjeta-inicio { text-align: center; }

/* ---------- Campos de formulario ---------- */
.campo {
  text-align: left;
  margin-bottom: 16px;
}

.campo label {
  display: block;
  font-family: 'Fredoka One', cursive;
  font-size: 15px;
  color: var(--morado-1);
  margin-bottom: 6px;
}

.campo input,
.campo textarea {
  width: 100%;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 16px;
  text-transform: uppercase;
  padding: 12px 14px;
  border: 3px solid #e4d9f7;
  border-radius: 14px;
  background: #faf8ff;
  color: var(--texto-oscuro);
  outline: none;
  resize: none;
}

.campo input::placeholder,
.campo textarea::placeholder {
  color: #bdb0d9;
  font-weight: 700;
  text-transform: none;
}

.campo input:focus,
.campo textarea:focus {
  border-color: var(--morado-2);
  background: #ffffff;
}

/* Campos donde el alumno escribe con letra cursiva (nombre del animal y oraciones) */
.campo input.cursiva,
.campo textarea.cursiva {
  font-family: 'Caveat', cursive;
  font-weight: 700;
  font-size: 26px;
  text-transform: none;
  line-height: 1.3;
}

.campo input.cursiva::placeholder,
.campo textarea.cursiva::placeholder {
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  text-transform: none;
}

.error-inline {
  color: #e0554a;
  font-weight: 800;
  font-size: 13px;
  text-align: center;
  margin: -6px 0 14px;
}

/* ---------- Botones ---------- */
.boton {
  font-family: 'Fredoka One', cursive;
  font-size: 18px;
  color: var(--blanco);
  background: var(--verde);
  border: none;
  border-radius: 18px;
  padding: 14px 20px;
  cursor: pointer;
  box-shadow: 0 6px 0 #2f9950;
  transition: transform 0.08s ease;
}

.boton:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #2f9950;
}

.boton-grande {
  width: 100%;
  min-height: 56px;
}

.boton-volver {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 14px;
  color: var(--morado-1);
  background: #f1e9fd;
  border: none;
  border-radius: 12px;
  padding: 8px 14px;
  margin-bottom: 14px;
  cursor: pointer;
}

/* ---------- Selector de animales ---------- */
.encabezado-selector {
  text-align: center;
  margin-bottom: 18px;
  max-width: 640px;
}

.saludo {
  color: var(--amarillo);
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 4px;
}

.grilla-animales {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  max-width: 760px;
  width: 100%;
}

.animal-card {
  background: var(--blanco);
  border-radius: 20px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  border: 4px solid transparent;
  box-shadow: 0 6px 0 rgba(0,0,0,0.12);
  transition: transform 0.1s ease;
  position: relative;
}

.animal-card:hover {
  transform: translateY(-3px);
}

.animal-card:active {
  transform: translateY(2px);
}

.animal-card img {
  width: 100%;
  height: 72px;
  object-fit: contain;
  margin-bottom: 4px;
}

.animal-card .animal-nombre {
  font-family: 'Fredoka One', cursive;
  font-size: 13px;
  color: var(--morado-1);
}

.animal-card.completado {
  border-color: var(--verde);
}

.animal-card .check {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--verde);
  color: white;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 3px 0 #2f9950;
}

.animal-card.completado .check {
  display: flex;
}

/* ---------- Ficha del animal ---------- */
.tarjeta-ficha { text-align: left; }

.ficha-imagen-wrap {
  text-align: center;
  background: #f1ecfb;
  border-radius: 20px;
  padding: 10px;
  margin-bottom: 16px;
}

.ficha-imagen-wrap img {
  height: 140px;
  object-fit: contain;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(58, 41, 96, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.modal-caja {
  background: var(--blanco);
  border-radius: 26px;
  padding: 32px;
  text-align: center;
  max-width: 380px;
  box-shadow: 0 14px 0 rgba(0,0,0,0.15);
}

.modal-emoji {
  font-size: 56px;
  margin-bottom: 8px;
}

.modal-caja h2 {
  font-family: 'Fredoka One', cursive;
  color: var(--morado-1);
  margin-bottom: 8px;
  font-size: 22px;
}

.modal-caja p {
  font-weight: 700;
  color: var(--texto-oscuro);
  margin-bottom: 18px;
  font-size: 14px;
}

/* ---------- Responsive: Chromebook / pantallas chicas ---------- */
@media (max-height: 620px) {
  .titulo { font-size: 26px; }
  .tarjeta { padding: 18px 22px; }
  .ficha-imagen-wrap img { height: 100px; }
}

@media (max-width: 760px) {
  .grilla-animales { grid-template-columns: repeat(3, 1fr); }
}
