/* =========================================================
   Experimentamos (casa/experimentos/ y aula/experimentos/, js/experimentos.js)
   Mismo estilo que «Cocinamos juntos», con fondo azul de laboratorio.
   ========================================================= */
.experimentos { display: grid; gap: 22px; }
.exp-casillas { display: flex; margin: 0; }
#experimentos-inicio[hidden], .exp-uno[hidden] { display: none; }

/* Lista */
.exp-lista { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 16px; }
.exp-ficha {
  display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; height: 100%;
  padding: 14px 18px 14px 14px; border-radius: var(--r-l); text-decoration: none; color: var(--tinta);
  background: var(--papel); box-shadow: inset 0 0 0 2px var(--borde), 0 4px 0 var(--sombra-boton);
}
.exp-ficha:hover { box-shadow: inset 0 0 0 2px var(--celeste-4), 0 6px 0 var(--sombra-boton); }
.exp-ficha__dibujo { display: block; border-radius: 20px; background: #E6F3FC; padding: 6px; }
.exp-ficha__dibujo svg { width: 100%; height: auto; display: block; }
.exp-ficha__texto { display: grid; gap: 4px; }
.exp-ficha__texto strong { font-family: var(--f-titulo); font-size: 1.3rem; line-height: 1.15; }
.exp-ficha__dato { color: var(--tinta-2); font-size: .98rem; }
.exp-ficha__dato span + span::before, .exp-dato span + span::before { content: " · "; }

/* Un experimento */
.exp-uno { display: grid; gap: 16px; }
.exp-arriba { display: grid; gap: 6px; }
.exp-volver { justify-self: start; margin: 0; }
.exp-titulo { margin: 0; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.exp-titulo:focus { outline: none; }

.exp-cosas-caja, .exp-paso, .exp-adivina, .exp-resultado, .exp-porque {
  padding: clamp(18px, 3.5vw, 32px); border-radius: var(--r-l);
  background: linear-gradient(180deg, #E6F3FC, var(--papel) 70%); border: 2px solid var(--borde);
}
.exp-cosas-caja, .exp-paso, .exp-resultado {
  display: grid; grid-template-columns: minmax(140px, 260px) 1fr; gap: clamp(18px, 4vw, 36px); align-items: start;
}
:root[data-theme="dark"] .exp-cosas-caja, :root[data-theme="dark"] .exp-paso, :root[data-theme="dark"] .exp-adivina,
:root[data-theme="dark"] .exp-resultado, :root[data-theme="dark"] .exp-porque { background: var(--papel); }
.exp-grande { border-radius: 28px; background: #FFF; padding: 12px; box-shadow: inset 0 0 0 2px #CFE5F5; }
.exp-grande svg { width: 100%; height: auto; display: block; }
.exp-cosas-caja h3 { margin: 6px 0 2px; font-size: 1.4rem; }
.exp-cosas-caja .discreto { margin: 0 0 12px; }
.exp-dato { margin: 0; font-weight: 700; color: var(--tinta-2); }

.exp-cosas { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 10px; }
.exp-cosa, .exp-opcion {
  width: 100%; display: grid; grid-template-columns: 52px 1fr 30px; gap: 10px; align-items: center; text-align: left;
  padding: 8px 12px 8px 8px; cursor: pointer; font: inherit; font-weight: 700; color: var(--tinta);
  background: var(--papel); border: 0; border-radius: 18px; box-shadow: inset 0 0 0 2px var(--borde), 0 3px 0 var(--sombra-boton);
}
.exp-cosa__dibujo { width: 52px; height: 52px; display: block; border-radius: 14px; background: #FFF; }
.exp-cosa__dibujo svg, .exp-opcion__dibujo svg { width: 100%; height: 100%; display: block; }
.exp-cosa__texto { order: 2; line-height: 1.2; }
.exp-cosa__marca { order: 3; width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 2.5px var(--borde); }
.exp-cosa[aria-pressed="true"], .exp-opcion[aria-pressed="true"] { background: #D5F0E2; color: #38251F; box-shadow: inset 0 0 0 2px #8FD0AA, 0 3px 0 var(--sombra-boton); }
.exp-cosa[aria-pressed="true"] .exp-cosa__marca, .exp-opcion[aria-pressed="true"] .exp-cosa__marca {
  background: #3E9B6A url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/70% no-repeat;
  box-shadow: none;
}
.exp-todo { margin: 12px 0 0; min-height: 1.5em; font-weight: 800; color: #2E7D55; }
:root[data-theme="dark"] .exp-todo { color: #A9DDB8; }

/* Paso a paso */
.exp-paso__texto { display: grid; gap: 10px; align-content: start; }
.exp-paso__texto .botones { margin-top: 8px; }
.exp-num { margin: 0; font-weight: 700; color: var(--tinta-2); }
.exp-frase { margin: 0; font-family: var(--f-titulo); font-weight: 700; line-height: 1.25; font-size: clamp(1.4rem, 3.2vw, 2rem); }
.exp-frase--media { font-size: clamp(1.2rem, 2.6vw, 1.6rem); }
.exp-puntos { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.exp-puntos li { width: 28px; height: 8px; border-radius: 999px; background: var(--borde); }
.exp-puntos li.hecho { background: #8FD0AA; }
.exp-puntos li.ahora { background: var(--tinta); }
.exp-quien { justify-self: start; margin: 0; padding: 4px 14px; border-radius: 999px; font-weight: 800; color: #38251F; }
.exp-quien--tu { background: #FFD86B; }
.exp-quien--adulto { background: #9DCBEA; }
.exp-quien--juntos { background: #FFB3C4; }
.exp-etiqueta { justify-self: start; margin: 0; padding: 4px 14px; border-radius: 999px; font-weight: 800; color: #38251F; background: #B9AAEE; }

/* ¿Qué crees que pasará? */
.exp-adivina { display: grid; gap: 16px; }
.exp-adivina__arriba { display: grid; gap: 10px; }
.exp-adivina__arriba .discreto { margin: 0; }
.exp-adivina .botones { margin: 0; }
.exp-opciones { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.exp-opciones--dos { grid-template-columns: repeat(2, minmax(0, 260px)); }
.exp-opciones > li { display: grid; }
.exp-opcion { grid-template-columns: 1fr; grid-template-rows: auto auto; justify-items: center; text-align: center; padding: 14px 12px 16px; position: relative; gap: 8px; }
.exp-opcion__dibujo { width: min(150px, 100%); aspect-ratio: 1; display: block; border-radius: 20px; background: #FFF; box-shadow: inset 0 0 0 2px #CFE5F5; }
.exp-opcion__texto { font-size: 1.15rem; line-height: 1.2; }
.exp-opcion .exp-cosa__marca { position: absolute; top: 10px; right: 10px; background: var(--papel); }
.exp-opcion--voto { position: relative; display: grid; border-radius: 18px; background: var(--papel); box-shadow: inset 0 0 0 2px var(--borde), 0 3px 0 var(--sombra-boton); }
.exp-opcion__toca { display: grid; justify-items: center; gap: 8px; padding: 14px 12px 12px; font: inherit; font-weight: 700; color: var(--tinta); background: none; border: 0; cursor: pointer; text-align: center; border-radius: 18px; }
.exp-votos { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 14px; border-radius: 999px; background: #FFE7A3; color: #38251F; }
.exp-votos strong { font-family: var(--f-titulo); font-size: 1.6rem; line-height: 1; }
.exp-menos { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 50%; border: 0; font: inherit; font-size: 1.5rem; font-weight: 800; line-height: 1; color: var(--tinta); background: var(--cielo-2); box-shadow: inset 0 0 0 2px var(--borde); cursor: pointer; }
.exp-opcion--late .exp-votos { animation: exp-late .35s ease-out; }
@keyframes exp-late { 50% { transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) { .exp-opcion--late .exp-votos { animation: none; } }

/* Al final */
.exp-fin { display: grid; gap: 16px; }
.exp-resultado { align-items: center; }
.exp-resultado > div { display: grid; gap: 10px; justify-items: start; }
.exp-acierto { margin: 0; padding: 8px 16px; border-radius: 16px; font-weight: 800; background: #FFE7A3; color: #38251F; }
.exp-acierto--si { background: #D5F0E2; }
.exp-porque { display: grid; grid-template-columns: 150px 1fr; gap: clamp(14px, 3vw, 28px); align-items: center; }
.exp-porque h3 { margin: 0 0 8px; font-size: 1.4rem; }
.exp-nina svg, .exp-nina img { width: 100%; height: auto; display: block; }
.exp-mas { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.exp-nota { padding: 16px 20px; border-radius: var(--r-l); background: var(--papel); border: 2px dashed var(--celeste-4); }
.exp-nota h3 { margin: 0 0 6px; font-size: 1.2rem; }
.exp-nota p, .exp-nota ul { margin: 0; }
.exp-nota ul { padding-left: 1.2em; display: grid; gap: 4px; }
.exp-fin .botones { margin: 0; }

@media (max-width: 640px) {
  .exp-cosas-caja, .exp-paso, .exp-resultado { grid-template-columns: 1fr; }
  .exp-cosas-caja > .exp-grande { width: 130px; justify-self: center; }
  .exp-paso > .exp-grande, .exp-resultado > .exp-grande { width: min(200px, 66%); justify-self: center; }
  .exp-porque { grid-template-columns: 90px 1fr; }
  .exp-ficha { grid-template-columns: 76px 1fr; }
  .exp-opciones { grid-template-columns: 1fr 1fr; gap: 10px; }
  .exp-opciones--dos { grid-template-columns: 1fr 1fr; }
  .exp-opcion__texto { font-size: 1rem; }
}

/* Hoja impresa: una hoja A4 */
@media print {
  .exp-hoja { font-family: "Nunito", sans-serif; color: #38251F; padding: 4mm 6mm; }
  .exp-hoja__cabeza { display: flex; align-items: center; gap: 8mm; border-bottom: .8mm solid #DDE7F2; padding-bottom: 3mm; }
  .exp-hoja__dibujo { width: 26mm; }
  .exp-hoja svg { width: 100%; height: auto; display: block; }
  .exp-hoja h1 { font-family: "Nunito", sans-serif; font-size: 26pt; margin: 0; }
  .exp-hoja__cabeza p { margin: 2mm 0 0; font-size: 11pt; color: #6B7894; }
  .exp-hoja h2 { font-family: "Nunito", sans-serif; font-size: 15pt; margin: 4mm 0 2mm; }
  .exp-hoja__cosas { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1.5mm 8mm; }
  .exp-hoja__cosas li { display: grid; grid-template-columns: 11mm 1fr; gap: 3mm; align-items: center; font-size: 11.5pt; }
  .exp-hoja__pasos { margin: 0; padding: 0 0 0 7mm; display: grid; gap: 1.5mm; }
  .exp-hoja__pasos li { padding-left: 2mm; break-inside: avoid; display: list-item; }
  .exp-hoja__pasos li svg { float: left; width: 12mm; margin: 0 3mm 0 0; }
  .exp-hoja__pasos li span { display: block; min-height: 12mm; font-size: 11.5pt; line-height: 1.35; padding-top: 1mm; }
  .exp-hoja__registro { break-inside: avoid; }
  .exp-hoja__nombre { margin: 0 0 2mm; font-size: 12pt; border-bottom: .4mm solid #C9D6E6; padding-bottom: 5mm; width: 60%; }
  .exp-hoja__cuadros { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; }
  .exp-hoja__cuadro { height: 58mm; border: .6mm dashed #9DB3CF; border-radius: 4mm; padding: 2mm 4mm; }
  .exp-hoja__cuadro p { margin: 0; font-weight: 800; font-size: 12pt; }
}
