:root {
  --crema: #FFF4E0;
  --papel: #FFFFFF;
  --tinta: #3A2F4B;
  --tinta-suave: #6E6480;
  --coral: #F2705F;
  --verde: #2BA89B;
  --oro: #E9A62A;
  --linea: #EADFCB;
  --sombra: 0 6px 0 rgba(58, 47, 75, .10);
  --radio: 22px;
  --fuente: ui-rounded, "Nunito", "Quicksand", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--crema); color: var(--tinta); font-family: var(--fuente); }
body { min-height: 100vh; font-size: 18px; line-height: 1.4; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.15; }
h1 { font-size: 1.9rem; } h2 { font-size: 1.45rem; } h3 { font-size: 1.15rem; }
p { margin: 0 0 .8em; }
a { color: var(--coral); }
.oculto { display: none !important; }

.pantalla { max-width: 760px; margin: 0 auto; padding: 16px 16px 96px; padding-top: max(16px, env(safe-area-inset-top)); }
.barra { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.barra .titulo { font-weight: 800; font-size: 1.15rem; flex: 1; text-align: center; }

.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 22px;
  border-radius: 999px; background: var(--coral); color: #fff; font-weight: 800; box-shadow: var(--sombra); transition: transform .08s; }
.btn:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(58,47,75,.10); }
.btn.verde { background: var(--verde); }
.btn.claro { background: var(--papel); color: var(--tinta); border: 2px solid var(--linea); }
.btn.chico { min-height: 44px; padding: 8px 16px; font-size: .95rem; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icono-btn { color: var(--tinta); text-decoration: none; width: 48px; height: 48px; border-radius: 50%; background: var(--papel); box-shadow: var(--sombra); font-size: 1.4rem; display: grid; place-items: center; }

.tarjeta { background: var(--papel); border-radius: var(--radio); padding: 18px; box-shadow: var(--sombra); border: 2px solid var(--linea); margin-bottom: 14px; }
.suave { color: var(--tinta-suave); }
.chico-texto { font-size: .9rem; }
.centro { text-align: center; }
.fila { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }

/* Bienvenida / perfiles */
.hero { text-align: center; padding-top: 24px; }
.hero img.mascota { width: 190px; height: 190px; margin: 0 auto 8px; border-radius: 50%; background: #fff; box-shadow: var(--sombra); object-fit: cover; }
.avatares { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 12px 0; }
.avatar { width: 64px; height: 64px; font-size: 2rem; border-radius: 50%; background: var(--papel); border: 3px solid var(--linea); display: grid; place-items: center; }
.avatar.sel { border-color: var(--coral); background: #FFE9E3; transform: scale(1.08); }
input[type=text], input[type=password], input[type=number], textarea {
  width: 100%; font: inherit; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--linea); background: #fff; color: var(--tinta); }
input:focus, textarea:focus, button:focus-visible { outline: 3px solid #8CB8FF; outline-offset: 2px; }
label { display: block; font-weight: 700; margin: 10px 0 6px; }

/* Mapa de unidades */
.saludo { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.saludo img { width: 84px; height: 84px; border-radius: 50%; background: #fff; box-shadow: var(--sombra); object-fit: cover; flex: none; }
.burbuja { background: var(--papel); border: 2px solid var(--linea); border-radius: 20px; padding: 12px 16px; position: relative; font-weight: 700; }
.mapa { display: grid; gap: 14px; }
.isla { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; background: var(--papel); border-radius: var(--radio);
  border: 3px solid var(--c, var(--linea)); box-shadow: var(--sombra); padding: 14px; }
.isla .letra { width: 68px; height: 68px; border-radius: 20px; background: var(--c); color: #fff; display: grid; place-items: center; font-size: 1.9rem; font-weight: 900; flex: none; }
.isla .datos { flex: 1; min-width: 0; }
.isla .datos strong { display: block; font-size: 1.15rem; }
.isla .est { font-size: 1.3rem; letter-spacing: 2px; }
.isla.bloq { opacity: .6; filter: grayscale(.3); }
.etiqueta { display: inline-block; font-size: .72rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: #E6F6F3; color: #0E7468; }
.etiqueta.pago { background: #FFF0D2; color: #8A5A00; }
.pronto { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.pronto span { background: var(--papel); border: 2px dashed var(--linea); border-radius: 14px; padding: 6px 14px; font-weight: 800; color: var(--tinta-suave); }

/* Unidad */
.palabras { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pal { background: var(--papel); border: 2px solid var(--linea); border-radius: var(--radio); box-shadow: var(--sombra); padding: 10px; text-align: center; }
.pal img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; background: #fff; }
.pal .sils { margin-top: 8px; font-size: 1.5rem; font-weight: 900; display: flex; justify-content: center; gap: 2px; flex-wrap: wrap; }
.sil { padding: 2px 8px; border-radius: 10px; }
.sil.a0 { background: #FFE3DE; } .sil.a1 { background: #DDF3EF; } .sil.a2 { background: #E8E1FA; } .sil.a3 { background: #FFEFC9; }
.familia { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.familia .btn { font-size: 1.6rem; min-width: 72px; background: var(--c); }

/* Lección */
.progreso { height: 14px; background: #fff; border: 2px solid var(--linea); border-radius: 999px; overflow: hidden; flex: 1; }
.progreso > i { display: block; height: 100%; background: var(--verde); border-radius: 999px; transition: width .4s; }
.consigna { text-align: center; margin: 8px 0 14px; }
.consigna h2 { margin-bottom: 4px; }
.altavoz { width: 72px; height: 72px; font-size: 2rem; border-radius: 50%; background: var(--oro); color: #fff; box-shadow: var(--sombra); margin: 0 auto 10px; display: grid; place-items: center; }
.opciones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.opcion { background: var(--papel); border: 3px solid var(--linea); border-radius: var(--radio); box-shadow: var(--sombra); padding: 8px; font-weight: 900; font-size: 2.2rem;
  display: grid; place-items: center; min-height: 110px; }
.opcion img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; }
.opcion.ok { border-color: var(--verde); background: #E6F6F3; }
.opcion.mal { border-color: var(--coral); background: #FFE9E3; animation: sacudir .4s; }
.imagen-grande { width: min(60vw, 260px); margin: 0 auto 12px; border-radius: 24px; background: #fff; box-shadow: var(--sombra); border: 3px solid var(--linea); }
.huecos { display: flex; gap: 10px; justify-content: center; margin: 10px 0 18px; flex-wrap: wrap; }
.hueco { min-width: 78px; height: 74px; border-radius: 18px; border: 3px dashed #CDBFA3; display: grid; place-items: center; font-size: 1.9rem; font-weight: 900; background: #fff; }
.hueco.lleno { border-style: solid; border-color: var(--verde); background: #E6F6F3; }
.fichas { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.ficha { min-width: 78px; height: 74px; padding: 0 18px; border-radius: 18px; background: var(--oro); color: #fff; font-size: 1.9rem; font-weight: 900; box-shadow: var(--sombra); }
.ficha.usada { opacity: .25; pointer-events: none; }
.aplauso { width: 150px; height: 150px; border-radius: 50%; font-size: 4rem; background: var(--coral); color: #fff; box-shadow: var(--sombra); margin: 6px auto; display: grid; place-items: center; }
.aplauso:active { transform: scale(.94); }
.contador { text-align: center; font-size: 3rem; font-weight: 900; min-height: 3.4rem; }
.mensaje { text-align: center; min-height: 2.2em; font-weight: 800; font-size: 1.2rem; margin-top: 12px; }
.mensaje.ok { color: #0E7468; } .mensaje.mal { color: #B2412F; }

.final { text-align: center; padding-top: 20px; }
.final img { width: 170px; height: 170px; margin: 0 auto 10px; border-radius: 50%; background: #fff; box-shadow: var(--sombra); object-fit: cover; }
.estrellas { font-size: 3rem; letter-spacing: 6px; margin: 8px 0 14px; }
.confeti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 20; }
.confeti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: caer 2.6s linear forwards; }

/* Zona de padres */
.pestanas { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 4px; }
.pestana { padding: 10px 16px; border-radius: 999px; background: var(--papel); border: 2px solid var(--linea); font-weight: 800; white-space: nowrap; }
.pestana.sel { background: var(--tinta); color: #fff; border-color: var(--tinta); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--linea); }
.num { font-size: 2rem; font-weight: 900; line-height: 1; }
.pin { letter-spacing: .6em; text-align: center; font-size: 1.6rem; }
.aviso { background: #FFF7DD; border: 2px solid #F1DDA0; border-radius: 16px; padding: 12px 14px; font-size: .9rem; }
.barra-fina { height: 10px; background: #F0E8D8; border-radius: 99px; overflow: hidden; }
.barra-fina i { display: block; height: 100%; background: var(--verde); }
.lista-chulos { padding-left: 20px; margin: 0; } .lista-chulos li { margin-bottom: 8px; }

/* Descanso */
.descanso { position: fixed; inset: 0; background: rgba(58,47,75,.92); color: #fff; display: grid; place-items: center; text-align: center; padding: 24px; z-index: 30; }
.descanso img { width: 150px; height: 150px; border-radius: 50%; margin: 0 auto 10px; object-fit: cover; background: #fff; }

/* Imprimibles */
.hoja { background: #fff; border: 2px solid var(--linea); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.cartas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.carta { border: 2px dashed #888; border-radius: 12px; padding: 8px; text-align: center; break-inside: avoid; }
.carta img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.carta b { display: block; font-size: 1.6rem; margin-top: 4px; }
.carta.sil-grande { font-size: 3.4rem; font-weight: 900; padding: 22px 6px; }
.renglones .linea-trazo { font-size: 3.2rem; font-weight: 900; letter-spacing: .15em; color: transparent; -webkit-text-stroke: 1.5px #9a9a9a; border-bottom: 2px solid #bbb; margin-bottom: 14px; line-height: 1.5; }
.bingo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-width: 420px; margin: 0 auto 10px; }
.bingo div { border: 3px solid #333; border-radius: 12px; text-align: center; padding: 22px 4px; font-size: 2.2rem; font-weight: 900; }
.diploma { border: 8px double var(--oro); border-radius: 18px; text-align: center; padding: 36px 20px; }
.diploma .nombre { font-size: 2.6rem; font-weight: 900; margin: 10px 0; }

@keyframes sacudir { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@keyframes caer { to { transform: translateY(110vh) rotate(540deg); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 420px) { body { font-size: 17px; } .opcion { font-size: 1.8rem; min-height: 96px; } }

@media print {
  body { background: #fff; font-size: 14px; }
  .no-imprimir, .barra, .pestanas { display: none !important; }
  .pantalla { max-width: none; padding: 0; }
  .hoja { border: 0; padding: 0; margin: 0 0 12px; page-break-after: always; }
  .hoja:last-child { page-break-after: auto; }
  * { box-shadow: none !important; }
}
