/* Aspecto «plano» (20/10/2026): dibujos sencillos y animados como en «L'Arxipèlag d'Ona»,
   todo el mundo en una pantalla, islas con niveles y tarjetas limpias. Manda sobre los demás estilos. */

/* ---------- Colores de fondo de cada terreno ---------- */
[data-terreno="mar"] { --fondo: radial-gradient(120% 90% at 50% 40%, #5DB5DE 0%, #3B98CD 55%, #1D5C8A 100%); }
[data-terreno="bosque"] { --fondo: radial-gradient(120% 90% at 50% 40%, #A7DB8E 0%, #5FAE68 55%, #2F6B45 100%); }
[data-terreno="cielo"] { --fondo: linear-gradient(180deg, #D4EEFF 0%, #8FD0F5 55%, #5AA9E6 100%); }
[data-terreno="valle"] { --fondo: linear-gradient(180deg, #CFEFFF 0%, #DDF0C2 40%, #9BD07E 100%); }
[data-terreno="espacio"] { --fondo: radial-gradient(120% 90% at 50% 40%, #3B3F9E 0%, #1E2060 55%, #0B0C2A 100%); }
[data-terreno="submarino"] { --fondo: linear-gradient(180deg, #5BCBE0 0%, #2C86BF 55%, #0E3B66 100%); }
[data-terreno="selva"] { --fondo: radial-gradient(120% 90% at 50% 40%, #8FD27A 0%, #3E9E5A 55%, #1E5C36 100%); }
[data-terreno="tierras"] { --fondo: radial-gradient(120% 90% at 50% 40%, #FBEFD2 0%, #EBD6A6 60%, #C9A77A 100%); }

/* Fondo de las pantallas de la cuenta, el alta y el descanso: el mar del original */
#app.con-fondo-portada { background: radial-gradient(120% 90% at 50% 30%, #5DB5DE 0%, #3B98CD 55%, #1D5C8A 100%); }
body { background: #1D5C8A; }

/* Textos dentro de los dibujos */
.mapa-svg text, .isla-arte text, .mundo-img text, .portada-fondo text { font-family: var(--letra-titulo); }

/* ---------- Mapa ---------- */
.pantalla.mapa { background: var(--fondo, #3B98CD); }
.pantalla.mapa::before { display: none; }
.mapa-dibujo { position: absolute; inset: 0; }
body.dibujos-3d .mapa-dibujo { background: var(--fondo-3d) center / cover no-repeat; }
.mapa-svg { width: 100%; height: 100%; display: block; }
.mapa-dibujo.desliza { overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.mapa-barra { background: linear-gradient(180deg, rgba(20, 30, 60, .45), rgba(20, 30, 60, 0)); }
.mapa-ruta { stroke: #fff; stroke-opacity: .55; stroke-width: 5; stroke-dasharray: 2 16; stroke-linecap: round; }
.isla-toque { cursor: pointer; }
.isla-toque:focus { outline: none; }
.isla-toque:focus-visible .isla-etiqueta rect { stroke: var(--sol); stroke-width: 6; }
.isla-toque:active .isla-flota { transform: scale(.97); transform-origin: 150px 150px; }
.isla-flota { animation: flotaIsla 5s ease-in-out infinite; }
[data-terreno="cielo"] .isla-flota { animation-duration: 4s; animation-name: flotaCielo; }
@keyframes flotaIsla { 50% { transform: translateY(-3px); } }
@keyframes flotaCielo { 50% { transform: translateY(-9px); } }
.mapa-pin { transition: transform .85s cubic-bezier(.45, .05, .3, 1); pointer-events: none; }
.pin-bota { animation: botaPin 1.6s ease-in-out infinite; }
@keyframes botaPin { 50% { transform: translateY(-8px); } }

/* Animaciones de los fondos */
.ola { animation: ola 4s ease-in-out infinite; } .ola.o2 { animation-delay: -1.3s; } .ola.o3 { animation-delay: -2.6s; }
@keyframes ola { 50% { transform: translateY(6px); } }
.gaviota { animation: gaviota 24s linear infinite; }
@keyframes gaviota { from { transform: translateX(-120px); } to { transform: translateX(1300px); } }
.luciernaga { animation: luciernaga 3.5s ease-in-out infinite; }
@keyframes luciernaga { 0%, 100% { opacity: .1; } 50% { opacity: .95; } }
.nube-va { animation: nubeVa 70s linear infinite; }
@keyframes nubeVa { from { transform: translateX(-160px); } to { transform: translateX(1360px); } }
.titila { animation: titila 2.6s ease-in-out infinite; }
@keyframes titila { 50% { opacity: .15; } }
.fugaz { animation: fugaz 9s linear infinite; opacity: 0; }
@keyframes fugaz { 0% { transform: translate(100px, 80px); opacity: 0; } 4% { opacity: 1; } 12% { transform: translate(700px, 300px); opacity: 0; } 100% { opacity: 0; } }
.burbuja { animation: burbuja 9s linear infinite; }
@keyframes burbuja { from { transform: translateY(0); opacity: 0; } 10% { opacity: 1; } to { transform: translateY(-1300px); opacity: .2; } }
.alga { transform-box: fill-box; transform-origin: 50% 100%; animation: alga 4s ease-in-out infinite; }
@keyframes alga { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
.pez { animation: pez 30s linear infinite; }
@keyframes pez { from { transform: translateX(-80px); } to { transform: translateX(1300px); } }
/* Animaciones de los edificios */
.haz { transform-box: fill-box; transform-origin: 50% 50%; animation: haz 5s linear infinite; }
@keyframes haz { 0%, 100% { transform: rotate(-30deg); opacity: .2; } 50% { transform: rotate(30deg); opacity: .6; } }
.brilla { transform-box: fill-box; transform-origin: center; animation: brilla 2.2s ease-in-out infinite; }
@keyframes brilla { 50% { transform: scale(1.25); } }
.humo { animation: humo 3s ease-in-out infinite; }
@keyframes humo { 0% { transform: translateY(4px); opacity: 0; } 40% { opacity: .8; } 100% { transform: translateY(-14px); opacity: 0; } }
.engranaje, .aspas { animation: gira 8s linear infinite; }
.aspas { animation-duration: 6s; }
@keyframes gira { to { transform: rotate(360deg); } }
.aguja-larga { animation: gira 12s linear infinite; }
.bandera { transform-box: fill-box; transform-origin: 0 50%; animation: bandera 1.6s ease-in-out infinite; }
@keyframes bandera { 50% { transform: scaleX(.75); } }
.llama { transform-box: fill-box; transform-origin: 50% 0; animation: llama .4s ease-in-out infinite alternate; }
@keyframes llama { to { transform: scaleY(1.25); } }
.parpadea { animation: titila 1.4s ease-in-out infinite; }
.ahorro .ola, .ahorro .gaviota, .ahorro .nube-va, .ahorro .burbuja, .ahorro .alga, .ahorro .pez, .ahorro .isla-flota, .ahorro .luciernaga, .ahorro .titila, .ahorro .fugaz { animation: none; }

/* En vertical, los botones del mapa van en fila debajo del título (para no tapar las islas) */
@media (orientation: portrait) {
  .mapa-acciones { flex-direction: row; left: 0; right: 0; justify-content: center; top: calc(max(10px, env(safe-area-inset-top)) + 60px) !important; }
  .mapa-barra .contador-estrellas { font-size: 15px; padding: 4px 8px; }
}
/* Botones y bocadillo del mapa */
.mapa-acciones { top: calc(max(10px, env(safe-area-inset-top)) + 66px); }
.mapa-dice-fila { align-items: center; }
.mapa-guia { flex: none; width: 70px; height: 70px; padding: 0; border: none; background: none; }
.mapa-guia img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .3)); animation: flotar 3s ease-in-out infinite; }
.mapa-guia img.guia-familia { object-fit: cover; }
#lumi-dice { font-size: 19px; padding: 10px 16px; }

/* ---------- Isla: lista de niveles ---------- */
.pantalla.isla { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; padding: 0; height: 100vh; height: 100dvh; min-height: 0;
  background: linear-gradient(170deg, var(--isla-1, #5B3FA0), var(--isla-2, #B79BE8)); overflow-y: auto; }
.pantalla.isla[hidden] { display: none; }
.isla-barra { display: flex; align-items: center; gap: 12px; padding: max(12px, env(safe-area-inset-top)) 16px 8px; }
.isla-barra h1 { flex: 1; min-width: 0; margin: 0; color: #fff; font-size: clamp(22px, 5vw, 32px); text-shadow: 0 2px 0 rgba(0, 0, 0, .2); }
.isla-cuerpo { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "guia" "niveles" "arte"; gap: 14px; padding: 4px 16px 24px; width: min(1100px, 100%); margin: 0 auto; }
.isla-guia-fila { grid-area: guia; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.isla-guia-fila img { width: 84px; height: 84px; flex: none; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .25)); animation: flotar 3s ease-in-out infinite; }
.isla-guia-fila p { flex: 1; margin: 0; background: var(--papel); border-radius: 20px; padding: 12px 16px; font-weight: 700; font-size: 19px; line-height: 1.35; box-shadow: 0 4px 0 rgba(0, 0, 0, .18); }
.isla-guia-fila p.nuevo { animation: aparecer .3s cubic-bezier(.3, 1.4, .5, 1) both; }
.isla-arte { grid-area: arte; width: min(360px, 80%); height: auto; margin: 0 auto; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .18)); }
.niveles { grid-area: niveles; display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.nivel { position: relative; width: 118px; min-height: 136px; border: none; border-radius: 26px; background: var(--papel); box-shadow: 0 6px 0 rgba(0, 0, 0, .2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 10px 6px; color: var(--tinta); }
.nivel .num { font-family: var(--letra-titulo); font-weight: 800; font-size: 42px; line-height: 1; color: var(--isla-1, #5B3FA0); }
.nivel .dif { font-size: 14px; font-weight: 700; color: var(--tinta-suave); }
.nivel .est i { font-style: normal; font-size: 22px; color: rgba(46, 40, 64, .18); }
.nivel .est i.si { color: #FFB800; text-shadow: 0 1px 0 #C98A00; }
.nivel.gran { width: 140px; background: var(--sol); }
.nivel.gran .num { color: var(--tinta); }
.nivel.cerrado { background: rgba(255, 255, 255, .3); box-shadow: none; }
.nivel.cerrado .num, .nivel.cerrado .dif { color: rgba(255, 255, 255, .95); }
.nivel.siguiente { animation: latirNivel 1.8s ease-in-out infinite; }
@keyframes latirNivel { 0%, 100% { box-shadow: 0 6px 0 rgba(0, 0, 0, .2), 0 0 0 0 rgba(255, 201, 60, .9); } 50% { box-shadow: 0 6px 0 rgba(0, 0, 0, .2), 0 0 0 14px rgba(255, 201, 60, 0); } }
.nivel:active { transform: translateY(3px); }
.nivel.tiembla { animation: temblor .4s; }
@media (min-width: 820px) and (orientation: landscape) {
  .isla-cuerpo { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); grid-template-areas: "guia niveles" "arte niveles"; align-items: start; }
  .isla-guia-fila { flex-wrap: wrap; }
  .isla-guia-fila img:not(.guia-familia) { flex-basis: 100%; object-position: left center; }
  .isla-guia-fila img.guia-familia { width: 96px; height: 96px; }
  .niveles { padding-top: 6px; justify-content: flex-start; }
  .isla-arte { width: 100%; }
}

/* ---------- Nivel (retos): tarjeta limpia sobre el color de la isla ---------- */
.pantalla.aventura { background: linear-gradient(170deg, var(--isla-1, #2F6B45), var(--isla-2, #A7DB8E)); }
.av-fondo, .pantalla.aventura > .ambiente { display: none; }
.av-camino .paso.medio { background: #FFB38A; border-color: #fff; }
.av-camino .paso.ahora { background: #fff; transform: scaleY(1.25); }
.av-zona { font-size: 16px; }
.av-reto { border-radius: 26px; box-shadow: 0 6px 0 rgba(0, 0, 0, .18); }
.av-asignatura { background: #F1EADB; color: var(--isla-1, #2F7A4B); text-transform: none; letter-spacing: 0; font-size: 14px; }
.av-pregunta { white-space: pre-line; }
.av-dibujo { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin: -2px 0 10px; }
.av-dibujo[hidden] { display: none; }
.av-dibujo .cosas { background: #FFF1D6; border-radius: 14px; padding: 4px 10px; font-size: 26px; line-height: 1.25; letter-spacing: 2px; max-width: 100%; word-break: break-all; }
.av-dibujo .cosas b { font-family: var(--letra-titulo); font-size: 26px; color: #6B4423; letter-spacing: 0; }
.av-dibujo .cosas-mas { font-size: 24px; color: var(--tinta-suave); }
.av-lumi img { width: 80px; height: 80px; object-fit: contain; }
.av-ayudas { align-items: center; }
.av-ayudas .btn-voz { width: 56px; height: 52px; min-height: 0; padding: 0; display: grid; place-items: center; }
.av-final-lumi { width: 140px; height: 140px; object-fit: contain; }
.av-final-estrellas span { font-size: 54px; color: rgba(46, 40, 64, .15); display: inline-block; }
.av-final-estrellas span.si { color: #FFB800; text-shadow: 0 3px 0 #C98A00; }
.av-final-texto { font-size: 19px; font-weight: 700; margin: 0 0 8px; color: var(--tinta-suave); }
.btn-verde { background: var(--hoja); box-shadow: 0 5px 0 #2E9A57; }
.btn-verde:active { box-shadow: 0 2px 0 #2E9A57; }
.final-tarjeta .btn[hidden] { display: none; }

/* ---------- Explicación con dibujo ---------- */
.av-capa.explica { z-index: 10; }
.explica-carta { width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--papel); border-radius: 28px; padding: 18px 18px 16px;
  text-align: center; border: 4px solid var(--sol); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); animation: aparecer .4s cubic-bezier(.3, 1.4, .5, 1) both; }
.explica-titulo { margin: 0 0 8px; font-family: var(--letra-titulo); font-weight: 800; font-size: 24px; color: #B5523B; }
.explica-dibujo { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 10px; }
.explica-regla { margin: 0 0 12px; padding: 10px 14px; background: #FFF0C4; border-radius: 16px; font-size: 19px; font-weight: 700; line-height: 1.35; }
.explica-botones { display: flex; gap: 10px; }
.explica-botones .btn { flex: 1; margin: 0; }
.ex-solucion { margin: 0; padding: 6px 18px; border-radius: 16px; background: #DDF5E5; border: 3px solid var(--hoja); font-family: var(--letra-titulo); font-weight: 800; font-size: 30px; color: #1E6B3A; }
.ex-cuenta { margin: 0; font-size: 19px; font-weight: 700; }
.ex-cuenta b { font-family: var(--letra-titulo); font-size: 26px; color: #1E6B3A; }
.ex-columnas { display: grid; gap: 0 2px; justify-content: center; font-family: var(--letra-titulo); font-weight: 800; font-size: 40px; line-height: 1.15; }
.ex-c { color: var(--c); text-align: center; }
.ex-c.ex-signo { color: var(--tinta); }
.ex-c.ex-letra { font-size: 14px; line-height: 1.6; color: var(--c); opacity: .8; }
.ex-c.ex-lleva { font-size: 18px; line-height: 1.2; color: #E2574C; }
.ex-c.ex-res { background: #DDF5E5; border-radius: 8px; }
.ex-raya { border-top: 4px solid var(--tinta); margin: 2px 0 4px; }
.ex-puntos { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.ex-fila { display: flex; gap: 5px; align-items: center; }
.ex-fila i, .ex-grupo i { width: 16px; height: 16px; border-radius: 50%; background: var(--c); display: inline-block; }
.ex-fila small { margin-left: 6px; font-weight: 800; color: var(--tinta-suave); }
.ex-grupos { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ex-grupo { display: flex; flex-wrap: wrap; gap: 4px; width: 74px; min-height: 40px; padding: 6px; border: 3px dashed #D9CFBA; border-radius: 14px; justify-content: center; align-content: center; }
.ex-quesito, .ex-reloj { width: 130px; height: 130px; }
.ex-monedas { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.ex-descompone { display: flex; gap: 6px; }
.ex-descompone span { display: flex; flex-direction: column; align-items: center; min-width: 52px; padding: 4px 8px; border-radius: 12px; background: #fff; border: 3px solid var(--c); }
.ex-descompone b { font-family: var(--letra-titulo); font-size: 34px; color: var(--c); line-height: 1.1; }
.ex-descompone small { font-weight: 800; color: var(--c); }
.ex-palabra { margin: 0; font-family: var(--letra-titulo); font-size: 40px; font-weight: 800; letter-spacing: .04em; }
.ex-palabra mark { background: #DDF5E5; color: #1E6B3A; border-radius: 8px; padding: 0 4px; }
.ex-palabra.mal { font-size: 28px; color: var(--tinta-suave); text-decoration: line-through; text-decoration-thickness: 2px; }
.ex-palabra mark.no { background: #FFE1DC; color: #9B2C1F; }
.ex-texto { margin: 0; padding: 10px 12px; background: #FFF1D6; border-radius: 14px; text-align: left; font-size: 18px; line-height: 1.5; max-height: 34vh; overflow-y: auto; }
.ex-texto mark { background: #FFE27A; border-radius: 4px; padding: 0 2px; }
.ex-afirmacion { margin: 0; font-size: 19px; font-weight: 700; }
.ex-orden { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.ex-orden span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 12px; background: #DDF5E5; border: 3px solid var(--hoja); font-weight: 800; font-size: 20px; }
.ex-orden small { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--hoja); color: #fff; font-size: 13px; }
.ex-parejas { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px 8px; align-items: center; }
.ex-parejas span { padding: 6px 10px; border-radius: 12px; background: #DDF5E5; font-weight: 800; font-size: 18px; }
.ex-parejas b { color: var(--hoja); font-size: 22px; }

/* ---------- Portada ---------- */
.portada-fondo { display: block; animation: none; background: radial-gradient(120% 90% at 50% 40%, #5DB5DE 0%, #3B98CD 55%, #1D5C8A 100%); }
.portada-fondo svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.portada-lumi { position: absolute; z-index: 2; pointer-events: none; left: 4%; bottom: 20px; width: min(190px, 22vw); filter: drop-shadow(0 8px 8px rgba(0, 0, 0, .3)); animation: flotar 3s ease-in-out infinite; }
@media (orientation: portrait) { .portada-lumi { left: auto; right: 6%; bottom: auto; top: calc(max(28px, env(safe-area-inset-top)) + clamp(60px, 16vw, 100px)); width: min(120px, 26vw); } }
@media (orientation: landscape) and (max-height: 600px) { .portada-lumi { display: none; } }
.portada-contenido { background: linear-gradient(180deg, transparent, rgba(20, 40, 80, .55) 45%); }

/* ---------- Elegir mundo ---------- */
.pantalla.mundos, .pantalla.album { background: radial-gradient(ellipse at 50% 0%, #5DB5DE, #1D5C8A 75%); }
.mundo-img { position: relative; background: var(--fondo, #3B98CD); overflow: hidden; }
.mundo-img svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Pantallas bajas (móvil en horizontal) y estrechas (móvil en vertical) */
@media (max-height: 600px), (max-width: 619px) {
  .mapa-guia { width: 52px; height: 52px; }
  #lumi-dice { font-size: 16px; padding: 8px 12px; }
  .nivel { width: 100px; min-height: 112px; } .nivel .num { font-size: 34px; }
  .ex-columnas { font-size: 32px; }
}

/* ================= Novedades (20/10/2026, noche) ================= */

/* ---------- Nivel: ayuda al lado de la pregunta (como en el original) ---------- */
.av-cuerpo { display: flex; flex-direction: column-reverse; gap: 10px; }
.av-lado { display: flex; flex-direction: column; gap: 8px; }
.av-ayudas { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0; }
.av-ayuda { min-height: 48px; padding: 0 14px; border: none; border-radius: 16px; background: var(--papel); color: var(--tinta); font-weight: 800; font-size: 16px; box-shadow: 0 4px 0 rgba(0, 0, 0, .18); }
.av-ayuda[hidden] { display: none; }
.av-ayuda.pasos { background: #8E44AD; color: #fff; box-shadow: 0 4px 0 #5E2D73; }
.av-apoyo { background: var(--papel); border-radius: 20px; padding: 10px; box-shadow: 0 4px 0 rgba(0, 0, 0, .18); display: flex; flex-direction: column; align-items: center; }
.av-apoyo[hidden] { display: none; }
.av-apoyo .ex-columnas { font-size: 30px; }
.apoyo-titulo { margin: 0 0 4px; font-weight: 800; font-size: 15px; color: var(--tinta-suave); }
.av-escuchar { display: block; margin: 0 auto 12px; }
.av-escuchar[hidden] { display: none; }
@media (min-width: 900px) and (orientation: landscape) {
  .pantalla.aventura > .av-cuerpo { width: min(1100px, 100%); }
  .av-cuerpo { display: grid; grid-template-columns: 250px minmax(0, 1fr); align-items: start; gap: 16px; }
  .av-lado { position: sticky; top: 8px; }
  .av-lado .av-lumi { flex-direction: column; align-items: flex-start; }
  .av-lado .av-lumi img { width: 120px; height: 120px; }
  .av-lado .av-lumi-dice::before { left: 40px; top: -9px; margin: 0; border: 9px solid transparent; border-top: 0; border-bottom-color: var(--papel); }
  .av-lado .av-lumi-dice { width: 100%; }
  .av-lado .av-ayudas { justify-content: flex-start; }
  .pantalla.aventura > .av-barra, .pantalla.aventura > .av-zona { width: min(1100px, 100%); }
}
.reto-final .av-reto { border: 4px solid var(--sol); }
.av-final-monedas { margin: 0 0 8px; font-family: var(--letra-titulo); font-weight: 800; font-size: 30px; color: #8A5A00; }

/* ---------- Mini explicación ---------- */
.av-capa#teoria, .av-capa#historia { z-index: 25; }
.teoria-texto { margin: 0 0 8px; font-size: 21px; font-weight: 700; line-height: 1.4; }
.teoria-ejemplo { margin: 0 0 12px; padding: 10px 14px; background: #E3F2FF; border-radius: 16px; font-size: 19px; line-height: 1.4; }
.isla-teoria { width: auto; margin: 0; min-height: 48px; font-size: 17px; }
@media (orientation: portrait), (max-width: 819px) { .isla-teoria { flex-basis: 100%; } }

/* ---------- Historia y reconocimiento ---------- */
.historia-quien { margin: 0 0 4px; font-weight: 800; color: var(--tinta-suave); font-size: 15px; }
.historia-gema { display: flex; justify-content: center; margin-bottom: 4px; }
.historia-gema:empty { display: none; }
.historia-gema svg, .gema { filter: drop-shadow(0 0 8px rgba(255, 255, 255, .9)); }
.historia-gema svg { animation: salto 1s ease-in-out infinite; }
.diploma { margin: 0 0 14px; padding: 16px; border: 4px double #D4A017; border-radius: 18px; background: #FFFBEA; }
.diploma p { margin: 2px 0; }
.diploma-titulo { font-family: var(--letra-titulo); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #B8860B; }
.diploma-nombre { font-family: var(--letra-titulo); font-weight: 800; font-size: 34px; }
.diploma-fecha { font-size: 14px; color: var(--tinta-suave); }
.diploma-gemas { display: flex; justify-content: center; gap: 4px; margin: 6px 0; }
#historia { overflow-y: auto; align-items: safe center; }
#historia .historia-carta { margin-top: 120px; margin-bottom: 16px; }
#historia.con-reconocimiento .historia-carta { margin-top: 110px; }

/* ---------- Mapa: destino, transporte ---------- */
.destino-toque .isla-etiqueta rect { filter: drop-shadow(0 0 6px rgba(255, 201, 60, .8)); }
.destino-toque.abierto .isla-flota { animation-name: flotaCielo; }
.mapa-pin { transition: transform .9s cubic-bezier(.45, .05, .3, 1); }
.balanceo { transform-origin: 80px 100px; animation: balanceo 3s ease-in-out infinite; }
@keyframes balanceo { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.flota-veh { animation: flotaIsla 3s ease-in-out infinite; }
.bote-veh { animation: bote .6s ease-in-out infinite alternate; }
@keyframes bote { to { transform: translateY(-2px); } }
.helice { animation: gira .25s linear infinite; }
.burbujita { animation: burbujita 2s ease-in infinite; } .burbujita.b2 { animation-delay: .9s; }
@keyframes burbujita { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-24px); opacity: 0; } }
.mariposa { animation: titila 3s ease-in-out infinite; }
#mapa-monedas { color: #FFE7A8; }

/* ---------- Tienda ---------- */
.pantalla.tienda { display: block; padding: max(14px, env(safe-area-inset-top)) 14px 24px; background: radial-gradient(ellipse at 50% 0%, #FFD36B, #E8762B 70%); overflow-y: auto; height: 100vh; height: 100dvh; min-height: 0; }
.pantalla.tienda[hidden] { display: none; }
.tienda-vehiculos, .tienda-pestanas { display: flex; gap: 8px; overflow-x: auto; width: min(820px, 100%); margin: 0 auto 10px; padding-bottom: 4px; }
.tienda-vehiculos button, .tienda-pestanas button { flex: none; min-height: 44px; padding: 0 16px; border: 3px solid transparent; border-radius: 16px; background: rgba(255, 251, 242, .85); font-weight: 800; font-size: 16px; color: var(--tinta); }
.tienda-vehiculos button.si, .tienda-pestanas button.si { border-color: var(--tinta); background: #fff; }
.tienda-vista { display: flex; justify-content: center; width: min(820px, 100%); margin: 0 auto; padding: 10px; background: rgba(255, 255, 255, .35); border-radius: 26px; }
.tienda-vista svg { width: min(320px, 80%); height: auto; filter: drop-shadow(0 8px 8px rgba(0, 0, 0, .2)); }
.tienda-aviso { min-height: 1.5em; text-align: center; font-weight: 800; color: #fff; text-shadow: 0 2px 2px rgba(0, 0, 0, .3); margin: 6px 0; }
.tienda-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; width: min(820px, 100%); margin: 0 auto; }
.tienda-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border: 3px solid transparent; border-radius: 18px; background: var(--papel); box-shadow: 0 4px 0 rgba(0, 0, 0, .2); color: var(--tinta); }
.tienda-item b { font-size: 14px; color: #8A5A00; }
.tienda-item.tiene b { color: #1E6B3A; }
.tienda-item.puesto { border-color: var(--hoja); background: #EFFFF3; }
.tienda-item small { font-weight: 700; color: var(--tinta-suave); }
.tienda-item.tiembla { animation: temblor .4s; }
.tienda-color { display: block; width: 44px; height: 44px; border-radius: 50%; border: 3px solid #2E2840; }
.tienda-emoji { font-size: 38px; line-height: 1.1; }
.tienda-mascota { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }

/* ---------- Mundos: gemas e Isla Arcoíris ---------- */
.mundo-carta { position: relative; }
.mundo-gema { position: absolute; right: 10px; top: 10px; opacity: .35; filter: grayscale(1); }
.mundo-gema.si { opacity: 1; filter: none; }
.mundo-carta.arcoiris { border-color: #FF9EC0; }
.mundo-carta.arcoiris.abierta { animation: latirNivel 1.8s ease-in-out infinite; }
.gemas-fila { display: flex; gap: 2px; }
.gemas-fila span { opacity: .3; filter: grayscale(1); }
.gemas-fila span.si { opacity: 1; filter: none; }

/* ---------- Avatar parecido ---------- */
.avatar-caja.parecido { width: min(640px, 100%); }
.parecido h2 { display: flex; align-items: center; gap: 10px; margin: 0; }
/* Cabecera fija con el botón de volver, para que siempre se vea aunque se baje */
.parecido-cabecera { position: sticky; top: -18px; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: -18px -18px 8px; padding: 12px 18px; background: var(--papel); border-bottom: 2px solid #EDE5D3; }
.parecido-cabecera h2 { flex: 1; font-size: 20px; }
.parecido-cabecera .parecido-res { flex-basis: 100%; margin: 0; grid-template-columns: repeat(3, minmax(0, min(120px, 18vh))); justify-content: center; gap: 14px; }
.parecido-cabecera .parecido-res button { border-color: #E4DCCB; background: #fff; }
.parecido-cabecera .av-salir { background: #fff; border: 3px solid #E4DCCB; box-shadow: none; }
.parecido-foto { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; }
.parecido-fila { display: grid; grid-template-columns: 70px 1fr; gap: 6px; align-items: start; margin: 6px 0; }
.parecido-fila > span { font-weight: 800; font-size: 15px; padding-top: 8px; }
.parecido-fila > div { display: flex; flex-wrap: wrap; gap: 6px; }
.parecido-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 3px solid #E4DCCB; border-radius: 14px; background: #fff; font-weight: 700; font-size: 15px; color: var(--tinta); }
.parecido-chip i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #2E2840; display: inline-block; }
.parecido-chip.si { border-color: var(--hoja); background: #DDF5E5; }
.parecido-res { grid-template-columns: repeat(3, 1fr); }
.parecido-botones { display: flex; gap: 8px; flex-wrap: wrap; }
.parecido-botones .btn { flex: 1; min-width: 180px; }

/* ---------- Personajes: personalidad ---------- */
.personaje-etiqueta { margin: 10px 0 4px; font-weight: 800; font-size: 14px; }
.personaje-rasgos, .alta-rasgos { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.personaje-rasgos .alta-chip, .alta-rasgos .alta-chip { min-height: 36px; padding: 0 10px; font-size: 14px; }
.personaje-nuevo { grid-template-columns: 1fr; border: 3px dashed #D9CDB4; }
.personaje-nuevo .alta-input { flex: 1 1 160px; min-height: 44px; font-size: 16px; }
.personaje .personaje-quitar { margin-top: 4px; background: #E9E1D2; color: var(--tinta); }
.personaje-especial, .alta-especial { font-size: 16px !important; min-height: 44px !important; }
.btn-mini-2 { background: #9AA3AD !important; }
.alta-parecido { margin-top: 6px; border: none; }

/* ---------- Reiniciar (zona de padres) ---------- */
.reiniciar-caja { margin-top: 16px; padding-top: 10px; border-top: 2px dashed #E4DCCB; }
.btn-peligro { position: relative; overflow: hidden; background: #fff; color: #9B2C1F; border: 3px solid #E8A598; box-shadow: 0 5px 0 #E8A598; font-size: 17px; user-select: none; -webkit-user-select: none; touch-action: none; }
.btn-peligro i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #FFE1DC; }
.btn-peligro.cargando i { width: 100%; transition: width 3s linear; }
.btn-peligro span { position: relative; }

/* ================= Dibujos 3D (img/3d/) o planos ================= */
/* Cada dibujo va en un .d3-par con su versión 3D (.d3) y la plana (.plano). Si la 3D falta (.falla), se ve la plana. */
body:not(.dibujos-3d) .d3 { display: none; }
body.dibujos-3d .d3-par:not(:has(.falla)) > .plano { display: none; }
body.dibujos-3d .d3-par:has(.falla) > .d3 { display: none; }
.portada-par, .portada-par > .d3, .portada-par > .plano { position: absolute; inset: 0; display: block; }
body.dibujos-3d .portada-par:not(:has(.falla)) > .plano { display: none; }
body.dibujos-3d .portada-par:has(.falla) > .d3 { display: none; }
.portada-3d { width: 100%; height: 100%; object-fit: cover; display: block; animation: zoomLento 40s ease-in-out infinite alternate; }
body.dibujos-3d #app.con-fondo-portada { background: url('../img/3d/fondo-cuenta.jpg') center / cover no-repeat, radial-gradient(120% 90% at 50% 30%, #5DB5DE 0%, #3B98CD 55%, #1D5C8A 100%); }
/* En 3D, menos animación de fondo: que se vea limpio */
body.dibujos-3d .d3-par:not(:has(.falla)) .isla-flota { animation-duration: 7s; }

/* Quien habla en el nivel (familia o guía): su nombre en el bocadillo */
.av-lumi-dice .av-quien { display: block; font-size: .78em; color: var(--isla-1, #2F7A4B); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.av-acomp img.guia-familia { border: 0; box-shadow: none; }
