/* =============================================================================
   New Memory — escenas especiales                                      v1.0.0
   Cables · Saltarín · Burbujas. Todo dibujado con CSS (y un SVG para los
   cables): no hay imágenes de plantilla.
   ============================================================================= */

.nm-juego.es-escena { gap: .55em; }
.nm-escena {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    border-radius: var(--radio);
    overflow: hidden;
    overflow: clip;
    touch-action: none;            /* arrastrar cables sin que el navegador desplace */
    -webkit-user-select: none;
    user-select: none;
}
.nm-escena .nm-chispas { position: absolute; z-index: 30; }
.nm-escena .nm-carta__texto--falta { font-size: .7em; }

/* =============================================================================
   🔌 CABLES
   ============================================================================= */
.nm-cables {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(2.6em, .5fr) minmax(0, 1fr);
    padding: .7em .6em;
    background:
        radial-gradient(circle at 1.1em 1.1em, #8b93a7 .18em, transparent .22em),
        radial-gradient(circle at calc(100% - 1.1em) 1.1em, #8b93a7 .18em, transparent .22em),
        radial-gradient(circle at 1.1em calc(100% - 1.1em), #8b93a7 .18em, transparent .22em),
        radial-gradient(circle at calc(100% - 1.1em) calc(100% - 1.1em), #8b93a7 .18em, transparent .22em),
        repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 2px, transparent 2px 6px),
        linear-gradient(160deg, #2a3142, #151a25 70%);
    border: .2em solid #3a4256;
    box-shadow: inset 0 0 2em rgba(0, 0, 0, .6), var(--sombra);
}
.nm-cables__col {
    --n: 6;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: .45em;
    min-width: 0;
    z-index: 2;
}
.nm-cables__medio {
    display: grid;
    place-items: center;
    z-index: 1;
}
.nm-cables__rayo {
    font-size: 1.6em;
    opacity: .25;
    filter: grayscale(.3);
    animation: nm-rayo 2.4s ease-in-out infinite;
}
@keyframes nm-rayo { 50% { opacity: .5; transform: scale(1.15); } }
.nm-cables__svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
    overflow: visible;
}

.nm-modulo {
    position: relative;
    height: min(6.6em, calc((100% - (var(--n) - 1) * .45em) / var(--n)));
    min-height: 2.2em;
    border-radius: .65em;
    background: #f5f7fb;
    border: .16em solid #c7cede;
    box-shadow: 0 .2em 0 #9aa3b8, 0 .35em .7em rgba(0, 0, 0, .35);
    cursor: grab;
    animation: nm-entra-modulo .45s var(--resorte) both;
    animation-delay: calc(var(--i, 0) * 30ms);
    transition: transform .15s var(--curva), box-shadow .15s, border-color .15s;
}
@keyframes nm-entra-modulo { from { opacity: 0; transform: translateX(-1.2em) scale(.9); } }
.nm-modulo--b { animation-name: nm-entra-modulo-b; }
@keyframes nm-entra-modulo-b { from { opacity: 0; transform: translateX(1.2em) scale(.9); } }
.nm-modulo:hover { transform: translateY(-.08em); }
.nm-modulo .nm-carta__frente {
    position: absolute;
    inset: 0;
    transform: none;
    -webkit-backface-visibility: visible;
    backface-visibility: visible;
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 4% 9%;
}
.nm-modulo--a .nm-carta__frente { padding-right: 14%; }
.nm-modulo--b .nm-carta__frente { padding-left: 14%; }
.nm-carta__frente.es-fila { flex-direction: row; gap: 6%; }
.nm-carta__frente.es-fila .nm-carta__img { width: auto; height: 100%; max-width: 45%; flex: 0 0 auto; }
.nm-carta__frente.es-fila.es-solo-imagen .nm-carta__img { max-width: 100%; }
.nm-carta__frente.es-fila .nm-carta__texto { text-align: left; }
.nm-carta__frente.es-fila.es-solo-texto .nm-carta__texto { text-align: center; }

/* El enchufe, sobresaliendo hacia el centro */
.nm-enchufe {
    position: absolute;
    top: 50%;
    width: 1.35em; height: 1.35em;
    margin-top: -.675em;
    border-radius: 50%;
    background: radial-gradient(circle, #1a1d26 32%, #5b6378 36%, #8b93a7 60%, #4b5263 64%);
    box-shadow: 0 .1em .25em rgba(0, 0, 0, .5);
    z-index: 2;
}
.nm-modulo--a .nm-enchufe { right: -.75em; }
.nm-modulo--b .nm-enchufe { left: -.75em; }
.nm-modulo__led {
    position: absolute;
    top: .35em;
    width: .45em; height: .45em;
    border-radius: 50%;
    background: #57606f;
    box-shadow: inset 0 0 .1em rgba(0,0,0,.6);
}
.nm-modulo--a .nm-modulo__led { left: .4em; }
.nm-modulo--b .nm-modulo__led { right: .4em; }

/* Tapa: la carta B escondida detrás de una placa con el dorso del juego */
.nm-modulo__tapa {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: .5em;
    transform: none;
    -webkit-backface-visibility: visible;
    backface-visibility: visible;
    transform-origin: 50% 0;
    transition: transform .35s var(--curva), opacity .35s;
}
.nm-modulo__tapa .nm-carta__simbolo { font-size: 1em; width: 1.6em; height: 1.6em; }
.nm-modulo:not(.es-tapado) .nm-modulo__tapa { transform: perspective(30em) rotateX(-95deg); opacity: 0; pointer-events: none; }

.nm-modulo.es-elegida { border-color: var(--acento-2); box-shadow: 0 0 0 .2em var(--acento-2), 0 .35em .9em rgba(0, 0, 0, .4); transform: scale(1.03); }
.nm-modulo.es-apunta { border-color: #fde047; box-shadow: 0 0 0 .22em #fde047, 0 0 1.2em rgba(253, 224, 71, .6); transform: scale(1.04); }
.nm-modulo.es-error { animation: nm-sacude-modulo .4s ease-in-out; border-color: var(--mal); }
@keyframes nm-sacude-modulo { 25% { transform: translateX(-.3em); } 75% { transform: translateX(.3em); } }
.nm-modulo.es-hallada { border-color: var(--ok); cursor: default; }
.nm-modulo.es-hallada .nm-modulo__led { background: #4ade80; box-shadow: 0 0 .5em #4ade80, 0 0 1em #22c55e; }
.nm-modulo.es-revelada { opacity: .7; }

/* El cable */
.nm-cable path { fill: none; stroke-linecap: round; }
.nm-cable__sombra { stroke: rgba(0, 0, 0, .45); stroke-width: 9; transform: translate(0, 3px); }
.nm-cable__cuerpo { stroke-width: 7; }
.nm-cable__brillo { stroke: rgba(255, 255, 255, .45); stroke-width: 2; transform: translate(0, -1.5px); }
.nm-cable__energia { stroke: transparent; stroke-width: 3; }
.nm-cable__ficha { stroke: #1a1d26; stroke-width: 2.5; }
.nm-cable.es-viva .nm-cable__energia {
    stroke: #fff;
    stroke-dasharray: 4 18;
    filter: drop-shadow(0 0 3px #fff);
    animation: nm-energia .6s linear infinite;
}
@keyframes nm-energia { to { stroke-dashoffset: -22; } }
.nm-cable.es-viva .nm-cable__cuerpo { filter: drop-shadow(0 0 4px currentColor); }
.nm-cable.es-corto .nm-cable__cuerpo { stroke: #ef4444 !important; animation: nm-corto .12s steps(2) 5; }
@keyframes nm-corto { 50% { stroke: #fde047; } }
.nm-cable.es-tirando { opacity: .92; }
.nm-cable.es-cayendo { opacity: .75; transition: opacity .38s; }

/* =============================================================================
   🍄 SALTARÍN
   ============================================================================= */
.nm-plat {
    --suelo: 60px;
    --heroe: 60px;
    background: linear-gradient(180deg, var(--fondo-2) 0%, var(--fondo-1) 55%, var(--acento) 160%);
    box-shadow: var(--sombra);
}
.nm[data-tema="papel"] .nm-plat { background: linear-gradient(180deg, #8fd0ff 0%, #c9ecff 70%, #fff6d8 100%); }
.nm-plat__cielo {
    position: absolute; inset: 0;
    background: radial-gradient(120% 60% at 50% 100%, rgba(255, 255, 255, .14), transparent 60%);
}
.nm-plat__astro {
    position: absolute;
    top: 7%; right: 9%;
    width: 3.4em; height: 3.4em;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #fffbe6, var(--oro) 60%, #f59e0b);
    box-shadow: 0 0 2em rgba(250, 204, 21, .55);
}
.nm-plat__nube {
    position: absolute;
    width: 5.5em; height: 1.6em;
    border-radius: 2em;
    background: rgba(255, 255, 255, .8);
    box-shadow: 1.6em -.7em 0 .1em rgba(255, 255, 255, .8), 3em -.2em 0 -.1em rgba(255, 255, 255, .8);
    animation: nm-nube 38s linear infinite;
    opacity: .85;
}
.nm-plat__nube--1 { top: 9%; animation-duration: 42s; animation-delay: -6s; }
.nm-plat__nube--2 { top: 22%; transform: scale(.7); animation-duration: 55s; animation-delay: -30s; opacity: .6; }
.nm-plat__nube--3 { top: 4%; transform: scale(.55); animation-duration: 64s; animation-delay: -48s; opacity: .5; }
@keyframes nm-nube { from { left: -9em; } to { left: 105%; } }
.nm-plat__colina {
    position: absolute;
    left: -10%; right: -10%;
    border-radius: 50% 50% 0 0;
}
.nm-plat__colina--lejos {
    bottom: calc(var(--suelo) - 1em);
    height: 32%;
    background:
        radial-gradient(40% 90% at 18% 100%, rgba(0, 0, 0, .22) 60%, transparent 61%),
        radial-gradient(35% 75% at 62% 100%, rgba(0, 0, 0, .2) 60%, transparent 61%),
        radial-gradient(30% 85% at 92% 100%, rgba(0, 0, 0, .22) 60%, transparent 61%);
}
.nm-plat__colina--cerca {
    bottom: calc(var(--suelo) - .6em);
    height: 20%;
    background:
        radial-gradient(30% 90% at 35% 100%, rgba(22, 101, 52, .55) 60%, transparent 61%),
        radial-gradient(28% 80% at 80% 100%, rgba(22, 101, 52, .5) 60%, transparent 61%);
}
.nm-plat__suelo {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    background:
        linear-gradient(180deg, #7cc242 0, #5ea42f .55em, #3f7c1f .7em, transparent .72em),
        repeating-linear-gradient(90deg, transparent 0 1.9em, rgba(0, 0, 0, .18) 1.9em 2em),
        repeating-linear-gradient(0deg, transparent 0 .95em, rgba(0, 0, 0, .18) .95em 1em),
        linear-gradient(180deg, #b0703a, #8a5226);
    box-shadow: inset 0 .2em 0 rgba(255, 255, 255, .15);
}
.nm-plat__bloques { position: absolute; inset: 0; z-index: 2; }

.nm-bloque {
    position: absolute;
    perspective: 600px;
    animation: nm-entra-bloque .5s var(--resorte) both;
    animation-delay: calc(var(--i, 0) * 35ms);
}
@keyframes nm-entra-bloque { from { opacity: 0; transform: translateY(-1.5em) scale(.6); } }
.nm-bloque__cuerpo {
    position: absolute; inset: 0;
    transform-style: preserve-3d;
    transition: transform .4s var(--curva);
}
.nm-bloque.es-vuelta .nm-bloque__cuerpo,
.nm-bloque.es-hallada .nm-bloque__cuerpo { transform: rotateY(180deg); }
.nm-bloque__dorso, .nm-bloque .nm-carta__frente {
    position: absolute; inset: 0;
    border-radius: .35em;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}
.nm-bloque__dorso {
    display: grid; place-items: center;
    background:
        radial-gradient(circle at 12% 12%, #7a4a12 .13em, transparent .16em),
        radial-gradient(circle at 88% 12%, #7a4a12 .13em, transparent .16em),
        radial-gradient(circle at 12% 88%, #7a4a12 .13em, transparent .16em),
        radial-gradient(circle at 88% 88%, #7a4a12 .13em, transparent .16em),
        linear-gradient(180deg, #ffd34d, #f5a700);
    border: .18em solid #7a4a12;
    box-shadow: inset -.18em -.22em 0 rgba(122, 74, 18, .45), inset .18em .18em 0 rgba(255, 255, 255, .45), 0 .25em .5em rgba(0, 0, 0, .35);
    animation: nm-brilla-bloque 2.2s ease-in-out infinite;
    animation-delay: calc(var(--i, 0) * -170ms);
}
@keyframes nm-brilla-bloque { 50% { filter: brightness(1.12); } }
.nm-bloque__simbolo {
    font-weight: 900;
    font-size: 2.2em;
    color: #fff7d6;
    text-shadow: .06em .06em 0 #7a4a12;
    line-height: 1;
}
.nm-bloque .nm-carta__frente {
    transform: rotateY(180deg);
    background: var(--cara);
    color: var(--cara-tinta);
    border: .18em solid #7a4a12;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 6%; gap: 4%;
    box-shadow: 0 .25em .5em rgba(0, 0, 0, .3);
}
.nm-bloque.es-marcado .nm-bloque__dorso { box-shadow: 0 0 0 .2em #fff, 0 0 1em rgba(255, 255, 255, .8); }
.nm-bloque.es-golpe { animation: nm-golpe .32s var(--resorte); }
@keyframes nm-golpe { 40% { transform: translateY(-.55em); } }
.nm-bloque.es-error .nm-carta__frente { border-color: var(--mal); }
.nm-bloque.es-hallada .nm-carta__frente { border-color: var(--ok); box-shadow: 0 0 0 .15em var(--ok), 0 0 1em rgba(34, 197, 94, .5); }
.nm-bloque.es-revelada .nm-carta__frente { opacity: .75; }

.nm-moneda {
    position: absolute;
    aspect-ratio: 1;
    z-index: 3;
    pointer-events: none;
    background: radial-gradient(circle at 40% 35%, #fff7c2, var(--oro) 45%, #d97706 75%);
    border-radius: 50%;
    border: .15em solid #b45309;
    transform-origin: 50% 50%;
    animation: nm-moneda .85s var(--curva) forwards;
    scale: .55;
}
@keyframes nm-moneda {
    0% { transform: translateY(0) rotateY(0); opacity: 1; }
    60% { transform: translateY(-160%) rotateY(540deg); opacity: 1; }
    100% { transform: translateY(-220%) rotateY(720deg); opacity: 0; }
}

/* El saltarín */
.nm-heroe {
    position: absolute;
    left: 0;
    bottom: var(--suelo);
    width: calc(var(--heroe) * .8);
    height: var(--heroe);
    z-index: 4;
    pointer-events: none;
    will-change: transform;
}
.nm-heroe__cuerpo {
    position: absolute;
    left: 0; right: 0; top: 18%; bottom: 14%;
    border-radius: 45% 45% 38% 38%;
    background: linear-gradient(180deg, var(--acento-2), var(--acento));
    border: .14em solid rgba(0, 0, 0, .55);
    box-shadow: inset -.25em -.25em 0 rgba(0, 0, 0, .15);
    transform-origin: 50% 100%;
    animation: nm-respira 1.6s ease-in-out infinite;
}
@keyframes nm-respira { 50% { transform: scaleY(.95) scaleX(1.03); } }
.nm-heroe.es-izquierda .nm-heroe__cuerpo,
.nm-heroe.es-izquierda .nm-heroe__antena { transform: scaleX(-1); }
.nm-heroe__ojo {
    position: absolute;
    top: 26%;
    width: 24%; height: 30%;
    border-radius: 50%;
    background: #fff;
    border: .08em solid rgba(0, 0, 0, .5);
}
.nm-heroe__ojo::after {
    content: '';
    position: absolute;
    right: 14%; top: 30%;
    width: 45%; height: 45%;
    border-radius: 50%;
    background: #1c1d2e;
}
.nm-heroe__ojo--i { left: 22%; }
.nm-heroe__ojo--d { left: 54%; }
.nm-heroe__boca {
    position: absolute;
    left: 38%; top: 64%;
    width: 26%; height: 12%;
    border-radius: 0 0 1em 1em;
    background: #1c1d2e;
}
.nm-heroe__antena {
    position: absolute;
    left: 46%; top: 0;
    width: 8%; height: 22%;
    background: rgba(0, 0, 0, .55);
    border-radius: 1em;
}
.nm-heroe__antena::after {
    content: '';
    position: absolute;
    left: -60%; top: -40%;
    width: 220%; aspect-ratio: 1;
    border-radius: 50%;
    background: var(--oro);
    box-shadow: 0 0 .5em var(--oro);
}
.nm-heroe__pie {
    position: absolute;
    bottom: 0;
    width: 32%; height: 16%;
    border-radius: 1em 1em .4em .4em;
    background: #1c1d2e;
}
.nm-heroe__pie--i { left: 8%; }
.nm-heroe__pie--d { right: 8%; }
.nm-heroe.es-corriendo .nm-heroe__pie--i { animation: nm-paso .22s ease-in-out infinite; }
.nm-heroe.es-corriendo .nm-heroe__pie--d { animation: nm-paso .22s ease-in-out infinite reverse; }
@keyframes nm-paso { 50% { transform: translateY(-.35em); } }
.nm-heroe.es-corriendo .nm-heroe__cuerpo { animation: nm-trota .22s ease-in-out infinite; }
@keyframes nm-trota { 50% { transform: translateY(-.15em) rotate(-3deg); } }
.nm-heroe.es-saltando .nm-heroe__cuerpo { animation: none; transform: scaleY(1.08) scaleX(.94); }
.nm-heroe.es-izquierda.es-saltando .nm-heroe__cuerpo { transform: scaleX(-.94) scaleY(1.08); }
.nm-heroe.es-aterriza .nm-heroe__cuerpo { animation: none; transform: scaleY(.85) scaleX(1.12); }
.nm-heroe.es-festeja .nm-heroe__cuerpo { animation: nm-festeja .35s ease-in-out 2; }
@keyframes nm-festeja { 50% { transform: translateY(-.5em) rotate(8deg); } }
.nm-heroe__mareo {
    position: absolute;
    left: 50%; top: -.6em;
    transform: translateX(-50%);
    color: var(--oro);
    font-size: .8em;
    white-space: nowrap;
    opacity: 0;
    text-shadow: 0 0 .3em rgba(0, 0, 0, .5);
}
.nm-heroe.es-mareado .nm-heroe__mareo { opacity: 1; animation: nm-mareo .5s linear infinite; }
@keyframes nm-mareo { 50% { transform: translateX(-50%) rotate(12deg) scale(1.1); } }
.nm-heroe.es-mareado .nm-heroe__ojo::after { right: 28%; top: 28%; animation: nm-ojo-mareado .4s linear infinite; }
@keyframes nm-ojo-mareado { 25% { right: 10%; } 50% { top: 45%; } 75% { right: 40%; } }

/* =============================================================================
   🫧 BURBUJAS
   ============================================================================= */
.nm-burb {
    --d: 110px;
    background:
        radial-gradient(90% 60% at 50% 0%, rgba(255, 255, 255, .12), transparent 60%),
        linear-gradient(180deg, rgba(14, 165, 233, .18), rgba(0, 0, 0, .25));
    box-shadow: inset 0 0 3em rgba(0, 0, 0, .35);
}
.nm-burb__fondo { position: absolute; inset: 0; pointer-events: none; }
.nm-burb__subida {
    position: absolute;
    bottom: -20px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .45);
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .5), transparent 55%);
    animation: nm-sube-burbuja linear infinite;
}
@keyframes nm-sube-burbuja {
    from { transform: translate(0, 0); opacity: 0; }
    10% { opacity: .8; }
    to { transform: translate(1.5em, -110vh); opacity: 0; }
}
.nm-burbuja {
    position: absolute;
    left: 0; top: 0;
    width: var(--d); height: var(--d);
    border-radius: 50%;
    will-change: transform;
    z-index: 2;
}
.nm-burbuja__mueve {
    position: absolute; inset: 0;
    border-radius: 50%;
    animation: nm-flota-burbuja 3s ease-in-out infinite;
    animation-delay: calc(var(--i, 0) * -230ms);
}
@keyframes nm-flota-burbuja {
    0%, 100% { transform: scale(1, 1); }
    33% { transform: scale(1.04, .97); }
    66% { transform: scale(.97, 1.04); }
}
.nm-burbuja .nm-carta__frente {
    position: absolute;
    inset: 9%;
    border-radius: 50%;
    transform: scale(.6);
    opacity: 0;
    -webkit-backface-visibility: visible;
    backface-visibility: visible;
    background: rgba(255, 255, 255, .96);
    color: var(--cara-tinta);
    border: none;
    box-shadow: none;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 14%; gap: 3%;
    transition: transform .35s var(--resorte), opacity .25s;
}
.nm-burbuja .nm-carta__img { max-height: 70%; }
.nm-burbuja__niebla {
    position: absolute; inset: 0;
    border-radius: 50%;
    display: grid; place-items: center;
    background:
        radial-gradient(circle at 50% 50%, transparent 52%, rgba(255, 255, 255, .55) 70%, rgba(255, 255, 255, .85) 72%, transparent 73%),
        radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--acento) 55%, transparent), color-mix(in srgb, var(--acento-2) 35%, transparent) 70%);
    border: .12em solid rgba(255, 255, 255, .55);
    box-shadow: inset 0 -.5em 1em rgba(0, 0, 0, .15), 0 .3em .9em rgba(0, 0, 0, .25);
    transition: opacity .3s, transform .3s;
}
@supports not (background: color-mix(in srgb, red, blue)) {
    .nm-burbuja__niebla {
        background:
            radial-gradient(circle at 50% 50%, transparent 52%, rgba(255, 255, 255, .55) 70%, rgba(255, 255, 255, .85) 72%, transparent 73%),
            radial-gradient(circle at 50% 60%, rgba(167, 139, 250, .55), rgba(240, 171, 252, .35) 70%);
    }
}
.nm-burbuja__simbolo {
    font-weight: 900;
    font-size: calc(var(--d) * .28);
    color: rgba(255, 255, 255, .92);
    text-shadow: 0 .05em .2em rgba(0, 0, 0, .3);
}
.nm-burbuja__brillo {
    position: absolute;
    left: 16%; top: 12%;
    width: 30%; height: 20%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 70%);
    transform: rotate(-30deg);
    pointer-events: none;
}
.nm-burbuja.es-abierta .nm-burbuja__niebla { opacity: .25; transform: scale(1.06); }
.nm-burbuja.es-abierta .nm-burbuja__simbolo { opacity: 0; }
.nm-burbuja.es-abierta .nm-carta__frente { transform: scale(1); opacity: 1; }
.nm-burbuja.es-abierta { z-index: 5; }
.nm-burbuja.es-abierta .nm-burbuja__mueve { animation-duration: 6s; }
.nm-burbuja.es-error .nm-burbuja__mueve { animation: nm-tiembla-burbuja .3s ease-in-out 2; }
@keyframes nm-tiembla-burbuja { 25% { transform: translateX(-.3em) scale(1.05, .95); } 75% { transform: translateX(.3em) scale(.95, 1.05); } }
.nm-burbuja.es-error .nm-carta__frente { box-shadow: 0 0 0 .2em var(--mal); }
.nm-burbuja.es-hallada .nm-carta__frente { box-shadow: 0 0 0 .2em var(--ok), 0 0 1.2em rgba(34, 197, 94, .6); }
.nm-burbuja.es-pop .nm-burbuja__mueve { animation: nm-pop .35s ease-out forwards; }
@keyframes nm-pop { 0% { transform: scale(1); opacity: 1; } 40% { transform: scale(1.35); opacity: .9; } 100% { transform: scale(1.7); opacity: 0; } }
.nm-burbuja.es-revelada .nm-carta__frente { opacity: .75; }
.nm-burb__onda {
    position: absolute;
    width: 2em; height: 2em;
    margin: -1em 0 0 -1em;
    border-radius: 50%;
    border: .2em solid rgba(255, 255, 255, .9);
    pointer-events: none;
    z-index: 6;
    animation: nm-onda .65s ease-out forwards;
}
@keyframes nm-onda { to { transform: scale(7); opacity: 0; border-width: .05em; } }

@media (prefers-reduced-motion: reduce) {
    .nm-plat__nube, .nm-burb__subida, .nm-cables__rayo { animation: none !important; }
}

/* =============================================================================
   🔦 A OSCURAS
   ============================================================================= */
.nm-oscuras {
    --lx: 50%;
    --ly: 50%;
    --haz: 140px;
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .025) 0 3px, transparent 3px 46px),
        linear-gradient(180deg, #2b2438, #1c1726);
    box-shadow: var(--sombra);
    cursor: crosshair;
}
.nm-oscuras__cartas { position: absolute; inset: 0; }   /* sin z-index: así las cartas destacadas pueden pasar por encima de la sombra */
.nm-foco {
    position: absolute;
    border-radius: .7em;
    animation: nm-entra-foco .4s var(--curva) both;
    animation-delay: calc(var(--i, 0) * 25ms);
}
@keyframes nm-entra-foco { from { opacity: 0; transform: scale(.85); } }
.nm-foco .nm-carta__frente {
    position: absolute; inset: 0;
    transform: none;
    -webkit-backface-visibility: visible; backface-visibility: visible;
    border-radius: inherit;
    background: #f7f3ea;
    color: #2a2233;
    border: .15em solid #d9cfbd;
    box-shadow: 0 .3em .7em rgba(0, 0, 0, .45);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 6%; gap: 4%;
}
/* La oscuridad, con un agujero de luz cálida donde apunta la linterna */
.nm-oscuras__sombra {
    position: absolute; inset: 0;
    z-index: 2;
    pointer-events: none;
    background: radial-gradient(circle var(--haz) at var(--lx) var(--ly),
        rgba(255, 236, 170, .10) 0%, rgba(255, 236, 170, .05) 45%,
        rgba(8, 6, 14, .9) 72%, rgb(5, 4, 9) 100%);
    transition: opacity .6s;
}
.nm-oscuras:not(.es-encendida) .nm-oscuras__sombra {
    background: radial-gradient(circle var(--haz) at var(--lx) var(--ly),
        rgba(255, 236, 170, .08) 0%, rgba(8, 6, 14, .9) 70%, rgb(5, 4, 9) 100%);
}
.nm-oscuras.es-relampago .nm-oscuras__sombra { animation: nm-relampago .9s ease-out; }
@keyframes nm-relampago { 0% { opacity: 0; } 15% { opacity: .15; } 25% { opacity: 0; } 100% { opacity: 1; } }
/* Al errar, la linterna titila: se APAGA un instante (nunca deja ver más) */
.nm-oscuras__sombra::after {
    content: '';
    position: absolute; inset: 0;
    background: rgb(5, 4, 9);
    opacity: 0;
}
.nm-oscuras.es-parpadeo .nm-oscuras__sombra::after { animation: nm-titila .55s steps(1) 1; }
@keyframes nm-titila { 0% { opacity: 1; } 25% { opacity: 0; } 45% { opacity: 1; } 65% { opacity: 0; } 100% { opacity: 0; } }
.nm-oscuras.es-luz-prendida .nm-oscuras__sombra { opacity: 0; }
/* Motas de polvo que solo se ven dentro del haz */
.nm-oscuras__polvo {
    position: absolute; inset: 0; z-index: 3; pointer-events: none;
    -webkit-mask-image: radial-gradient(circle var(--haz) at var(--lx) var(--ly), #000 30%, transparent 75%);
    mask-image: radial-gradient(circle var(--haz) at var(--lx) var(--ly), #000 30%, transparent 75%);
}
.nm-oscuras__mota {
    position: absolute; width: 3px; height: 3px; border-radius: 50%;
    background: rgba(255, 240, 200, .7);
    animation: nm-mota linear infinite;
}
@keyframes nm-mota { 50% { transform: translate(1.2em, -1.6em); opacity: .3; } 100% { transform: translate(0, 0); } }
/* Elegidas y encontradas brillan por encima de la oscuridad */
.nm-foco.es-elegida, .nm-foco.es-hallada { z-index: 4; }
.nm-foco.es-elegida .nm-carta__frente {
    border-color: #fbbf24;
    box-shadow: 0 0 0 .2em #fbbf24, 0 0 1.6em rgba(251, 191, 36, .65);
    transform: translateY(-.15em) scale(1.04);
}
.nm-foco.es-hallada .nm-carta__frente {
    border-color: var(--ok);
    box-shadow: 0 0 0 .15em var(--ok), 0 0 1.4em rgba(253, 224, 71, .5);
    animation: nm-vela 2.6s ease-in-out infinite;
}
@keyframes nm-vela { 50% { box-shadow: 0 0 0 .15em var(--ok), 0 0 2em rgba(253, 224, 71, .7); } }
.nm-foco.es-error .nm-carta__frente { border-color: var(--mal); animation: nm-sacude-modulo .4s ease-in-out; }
.nm-oscuras.es-luz-prendida { cursor: default; }
@media (hover: none) { .nm-oscuras { cursor: default; } }

/* =============================================================================
   🎟️ RASPADITA
   ============================================================================= */
.nm-raspa {
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .08), transparent 40%),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, .04) 0 10px, transparent 10px 20px),
        linear-gradient(160deg, #0f5132, #0b3d26);
    box-shadow: inset 0 0 2.5em rgba(0, 0, 0, .45), var(--sombra);
    border: .2em solid #14532d;
}
.nm-billete {
    position: absolute;
    border-radius: .55em;
    background: #fffdf5;
    box-shadow: 0 .3em .7em rgba(0, 0, 0, .4);
    overflow: hidden;
    cursor: crosshair;
    animation: nm-entra-billete .45s var(--resorte) both;
    animation-delay: calc(var(--i, 0) * 35ms);
}
@keyframes nm-entra-billete { from { opacity: 0; transform: translateY(1em) rotate(-4deg); } }
/* Borde dentado de billete */
.nm-billete::before {
    content: '';
    position: absolute; inset: 0;
    border-radius: inherit;
    border: .18em dashed rgba(180, 83, 9, .35);
    margin: .2em;
    pointer-events: none;
    z-index: 1;
}
.nm-billete .nm-carta__frente {
    position: absolute; inset: 0;
    transform: none;
    -webkit-backface-visibility: visible; backface-visibility: visible;
    background: transparent;
    border: none; box-shadow: none;
    color: #2a2233;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 9%; gap: 4%;
}
.nm-billete__capa {
    position: absolute; left: 0; top: 0;
    z-index: 2;
    touch-action: none;
    transition: opacity .35s;
}
.nm-billete.es-descubierta .nm-billete__capa { opacity: 0; pointer-events: none; }
.nm-billete.es-regenera .nm-billete__capa { animation: nm-regenera .5s ease-out; }
@keyframes nm-regenera { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.nm-billete.es-error { animation: nm-sacude-modulo .4s ease-in-out; box-shadow: 0 0 0 .2em var(--mal), 0 .3em .7em rgba(0, 0, 0, .4); }
.nm-billete.es-hallada { box-shadow: 0 0 0 .2em #facc15, 0 0 1.4em rgba(250, 204, 21, .55); cursor: default; }
.nm-billete__sello {
    position: absolute;
    right: 6%; top: 6%;
    z-index: 3;
    padding: .1em .4em;
    border: .14em solid #dc2626;
    border-radius: .3em;
    color: #dc2626;
    font-weight: 900;
    font-size: .8em;
    letter-spacing: .05em;
    transform: rotate(12deg) scale(0);
    opacity: 0;
    pointer-events: none;
}
.nm-billete.es-hallada .nm-billete__sello { animation: nm-sello-billete .45s var(--resorte) forwards; }
@keyframes nm-sello-billete { to { transform: rotate(12deg) scale(1); opacity: .9; } }
.nm-billete.es-revelada .nm-carta__frente { opacity: .75; }

/* =============================================================================
   🎣 PESCA
   ============================================================================= */
.nm-pesca {
    --cielo: 80px;
    --pez-w: 90px;
    --pez-h: 54px;
    --cartel: 140px;
    background: #0b4a6f;
    box-shadow: var(--sombra);
    touch-action: manipulation;
}
.nm-pesca__cielo {
    position: absolute; left: 0; right: 0; top: 0;
    height: var(--cielo);
    background: linear-gradient(180deg, #7cc8f2, #c8ecff 85%, #e6f7ff);
}
.nm-pesca__sol {
    position: absolute;
    right: 9%; top: calc(var(--cielo) * .16);
    width: calc(var(--cielo) * .5); height: calc(var(--cielo) * .5);
    border-radius: 50%;
    background: radial-gradient(circle, #fff7c2, #fde047 60%, #facc15);
    box-shadow: 0 0 1.4em rgba(253, 224, 71, .8);
    animation: nm-late-sol 4s ease-in-out infinite;
}
@keyframes nm-late-sol { 50% { box-shadow: 0 0 2.2em rgba(253, 224, 71, .95); } }
.nm-pesca__agua {
    position: absolute; left: 0; right: 0; bottom: 0;
    top: var(--cielo);
    overflow: hidden;
    background: linear-gradient(180deg, #1e9ad6 0%, #0e6fa6 35%, #0a4d78 75%, #083a5c 100%);
}
.nm-pesca__olas {
    position: absolute; left: -10%; right: -10%; top: -6px;
    height: 14px;
    background: radial-gradient(circle at 10px -2px, transparent 9px, rgba(255, 255, 255, .55) 10px, transparent 12px) 0 0 / 22px 14px repeat-x;
    animation: nm-olas 3s linear infinite;
}
@keyframes nm-olas { to { transform: translateX(22px); } }
.nm-pesca__rayos {
    position: absolute; inset: 0;
    background: repeating-linear-gradient(100deg, rgba(255, 255, 255, .07) 0 22px, transparent 22px 70px);
    -webkit-mask-image: linear-gradient(180deg, #000, transparent 70%);
    mask-image: linear-gradient(180deg, #000, transparent 70%);
    animation: nm-rayos 7s ease-in-out infinite alternate;
}
@keyframes nm-rayos { to { transform: translateX(-30px); } }
.nm-pesca__fondo {
    position: absolute; left: 0; right: 0; bottom: 0;
    height: 30%;
    background: radial-gradient(120% 60% at 50% 115%, #c9a76a 40%, #a6834a 55%, transparent 56%);
}
.nm-pesca__alga {
    position: absolute; bottom: 8%;
    width: 10px;
    border-radius: 10px 10px 2px 2px;
    background: linear-gradient(90deg, #15803d, #22c55e 50%, #15803d);
    transform-origin: 50% 100%;
    animation: nm-alga 4s ease-in-out infinite;
    opacity: .8;
}
@keyframes nm-alga { 50% { transform: rotate(9deg) scaleY(1.04); } }

/* El bote, centrado sobre la línea del agua */
.nm-pesca__bote {
    position: absolute;
    left: 50%;
    bottom: calc(100% - var(--cielo) - 8px);
    width: clamp(90px, 22%, 170px);
    aspect-ratio: 2.2;
    transform: translateX(-50%);
    z-index: 3;
    pointer-events: none;
    animation: nm-meceo 3.4s ease-in-out infinite;
}
@keyframes nm-meceo { 50% { margin-top: 3px; rotate: 2deg; } }
.nm-pesca__casco {
    position: absolute; left: 0; right: 0; bottom: 0;
    height: 52%;
    background: linear-gradient(180deg, #ef4444 0 28%, #fff 28% 40%, #b45309 40%);
    clip-path: polygon(0 0, 100% 0, 86% 100%, 14% 100%);
    border-radius: 0 0 40% 40%;
}
.nm-pesca__pescador {
    position: absolute;
    left: 38%; bottom: 48%;
    width: 13%; height: 46%;
    border-radius: 40% 40% 10% 10%;
    background: #fbbf24;
}
.nm-pesca__cabeza {
    position: absolute;
    left: 50%; bottom: 92%;
    width: 120%; aspect-ratio: 1;
    transform: translateX(-50%);
    border-radius: 50%;
    background: #f5c99a;
    box-shadow: inset 0 .35em 0 #2563eb;      /* gorrito */
}
.nm-pesca__cana {
    position: absolute;
    left: 45%; top: 40%;
    width: 59.6%; height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, #78350f, #a16207);
    transform-origin: 0 50%;
    transform: rotate(-46.5deg);
}
.nm-pesca__balde {
    position: absolute;
    left: 13%; top: 18%;
    width: 18%; height: 32%;
    background: linear-gradient(90deg, #64748b, #cbd5e1 45%, #64748b);
    clip-path: polygon(0 0, 100% 0, 85% 100%, 15% 100%);
    border-top: 2px solid #334155;
}
.nm-pesca__svg { position: absolute; left: 0; top: 0; z-index: 4; pointer-events: none; overflow: visible; }
.nm-pesca__sedal { fill: none; stroke: rgba(255, 255, 255, .85); stroke-width: 1.5; }
.nm-pesca__anzuelo { fill: #e5e7eb; stroke: #475569; stroke-width: 1; }
.nm-pesca__salpica {
    position: absolute;
    width: 3.6em; height: 1em;
    margin-left: -1.8em; margin-top: -.5em;
    border-radius: 50%;
    border: .18em solid rgba(255, 255, 255, .9);
    z-index: 5;
    pointer-events: none;
    animation: nm-salpica .65s ease-out forwards;
}
@keyframes nm-salpica { to { transform: scale(2.4); opacity: 0; border-width: .04em; } }

/* Los peces */
.nm-pez {
    position: absolute;
    left: 0; top: 0;
    width: var(--pez-w); height: var(--pez-h);
    padding: 0; border: 0; background: none;
    cursor: pointer;
    z-index: 2;
    will-change: transform;
    -webkit-tap-highlight-color: transparent;
}
.nm-pez__nado {
    position: absolute; inset: 0;
    transition: transform .25s;
}
.nm-pez.es-izquierda .nm-pez__nado { transform: scaleX(-1); }
.nm-pez__cuerpo {
    position: absolute;
    left: 22%; top: 8%;
    width: 74%; height: 84%;
    border-radius: 55% 45% 45% 55% / 50%;
    background: hsl(var(--h), 85%, 58%);
    box-shadow: inset 0 -.35em .4em hsla(var(--h), 80%, 30%, .45), inset 0 .25em .3em rgba(255, 255, 255, .35);
    animation: nm-colea-cuerpo .5s ease-in-out infinite alternate;
}
.nm-pez[data-dibujo="1"] .nm-pez__cuerpo {
    background:
        repeating-linear-gradient(90deg, transparent 0 18%, hsla(var(--h), 70%, 28%, .55) 18% 26%),
        hsl(var(--h), 85%, 58%);
}
.nm-pez[data-dibujo="2"] .nm-pez__cuerpo {
    background:
        radial-gradient(circle at 30% 35%, #fff 0 7%, transparent 8%),
        radial-gradient(circle at 55% 65%, #fff 0 6%, transparent 7%),
        radial-gradient(circle at 42% 70%, rgba(255, 255, 255, .8) 0 4%, transparent 5%),
        hsl(var(--h), 85%, 58%);
}
@keyframes nm-colea-cuerpo { to { transform: rotate(-3deg); } }
.nm-pez__cola {
    position: absolute;
    left: 0; top: 18%;
    width: 30%; height: 64%;
    background: hsl(var(--h), 75%, 45%);
    clip-path: polygon(0 0, 100% 50%, 0 100%, 22% 50%);
    transform-origin: 100% 50%;
    animation: nm-colea .32s ease-in-out infinite alternate;
}
@keyframes nm-colea { from { transform: scaleY(.8) rotate(-12deg); } to { transform: scaleY(1.05) rotate(12deg); } }
.nm-pez__ojo {
    position: absolute;
    right: 16%; top: 26%;
    width: 17%; aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle at 60% 45%, #111 0 38%, #fff 40%);
}
.nm-pez__aleta {
    position: absolute;
    left: 34%; top: 46%;
    width: 24%; height: 34%;
    clip-path: polygon(100% 0, 60% 22%, 0 100%, 30% 22%);
    background: hsla(var(--h), 70%, 34%, .8);
    transform-origin: 100% 0;
    animation: nm-aleta .4s ease-in-out infinite alternate;
}
@keyframes nm-aleta { to { transform: rotate(25deg); } }
.nm-pez.es-enganchado { z-index: 6; }
.nm-pez.es-enganchado .nm-pez__cola { animation-duration: .1s; }
.nm-pez.es-enganchado .nm-pez__nado { transform: rotate(-70deg); }
/* El cartel con la carta: aparece cuando el pez sale a la superficie */
.nm-pez__cartel {
    position: absolute;
    left: 50%; top: 50%;
    width: var(--cartel); height: var(--cartel);
    margin: calc(var(--cartel) / -2) 0 0 calc(var(--cartel) / -2);
    border-radius: .8em;
    background: #fffdf5;
    border: .22em solid hsl(var(--h), 80%, 52%);
    box-shadow: 0 .4em 1em rgba(0, 0, 0, .35);
    transform: scale(.2);
    opacity: 0;
    pointer-events: none;
    transition: transform .4s var(--resorte), opacity .2s;
    overflow: hidden;
}
.nm-pez__cartel .nm-carta__frente {
    position: absolute; inset: 0;
    transform: none;
    -webkit-backface-visibility: visible; backface-visibility: visible;
    background: transparent; border: none; box-shadow: none;
    color: #2a2233;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 7%; gap: 4%;
}
.nm-pez.es-atrapado { z-index: 7; }
.nm-pez.es-atrapado .nm-pez__nado { opacity: 0; transform: scale(.5); }
.nm-pez.es-atrapado .nm-pez__cartel { transform: scale(1); opacity: 1; pointer-events: auto; }   /* tapa: no se pesca lo que nada detrás */
.nm-pez.es-error .nm-pez__cartel { border-color: var(--mal); animation: nm-sacude-modulo .4s ease-in-out; }
.nm-pez.es-hallada .nm-pez__cartel { border-color: var(--ok); box-shadow: 0 0 0 .2em var(--ok), 0 0 1.4em rgba(34, 197, 94, .55); }
.nm-pez.es-al-balde .nm-pez__cartel { transform: scale(.25); opacity: .6; transition-duration: .5s; }
.nm-pez.es-al-balde .nm-pez__nado { opacity: 1; transform: none; }
.nm-pez.es-revelada .nm-pez__cartel { transform: scale(.62); opacity: .92; }
.nm-pez.es-revelada { z-index: 5; }

/* =============================================================================
   🚀 COHETE
   ============================================================================= */
.nm-cohete {
    --d: 80px;
    background:
        radial-gradient(60% 50% at 20% 85%, rgba(147, 51, 234, .25), transparent 70%),
        radial-gradient(50% 45% at 85% 15%, rgba(14, 165, 233, .2), transparent 70%),
        linear-gradient(180deg, #0b1026, #050713);
    box-shadow: var(--sombra);
    touch-action: manipulation;
}
.nm-cohete__estrellas {
    position: absolute; inset: -20%;
    pointer-events: none;
    background-image:
        radial-gradient(1.2px 1.2px at 12% 18%, #fff, transparent),
        radial-gradient(1px 1px at 33% 72%, #fff, transparent),
        radial-gradient(1.5px 1.5px at 51% 40%, #fde68a, transparent),
        radial-gradient(1px 1px at 68% 9%, #fff, transparent),
        radial-gradient(1.3px 1.3px at 82% 63%, #bae6fd, transparent),
        radial-gradient(1px 1px at 92% 30%, #fff, transparent),
        radial-gradient(1px 1px at 6% 88%, #fff, transparent);
    background-size: 220px 220px;
}
.nm-cohete__estrellas--1 { animation: nm-titilan 3s ease-in-out infinite alternate; }
.nm-cohete__estrellas--2 { background-size: 340px 340px; opacity: .6; animation: nm-deriva 90s linear infinite; }
@keyframes nm-titilan { to { opacity: .45; } }
@keyframes nm-deriva { to { transform: translate(-340px, 120px); } }
.nm-cohete__orbitas { position: absolute; inset: 0; pointer-events: none; }
.nm-cohete__orbita {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px dashed rgba(165, 180, 252, .32);
}
.nm-cohete__sol {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle at 40% 38%, #fffbe6, #fde047 35%, #f97316 75%, #ea580c);
    box-shadow: 0 0 1.5em #f59e0b, 0 0 3.5em rgba(249, 115, 22, .55);
    animation: nm-sol-late 3s ease-in-out infinite;
    pointer-events: none;
}
@keyframes nm-sol-late { 50% { box-shadow: 0 0 2.2em #fbbf24, 0 0 5em rgba(249, 115, 22, .7); } }
.nm-cohete.es-completa .nm-cohete__sol { animation: nm-supernova 1.2s ease-out; }
@keyframes nm-supernova { 40% { transform: translate(-50%, -50%) scale(1.8); box-shadow: 0 0 4em #fff, 0 0 9em #fbbf24; } }
.nm-cohete__svg { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; z-index: 1; }
.nm-cohete__constelacion {
    stroke: #fde68a;
    stroke-width: 2;
    stroke-dasharray: 2 6;
    stroke-linecap: round;
    filter: drop-shadow(0 0 3px rgba(253, 230, 138, .9));
    animation: nm-constelacion 1.4s linear infinite;
}
@keyframes nm-constelacion { to { stroke-dashoffset: -16; } }

.nm-planeta {
    position: absolute;
    left: 0; top: 0;
    width: var(--d); height: var(--d);
    padding: 0; border: 0; background: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
    will-change: transform;
    -webkit-tap-highlight-color: transparent;
    animation: nm-entra-planeta .5s var(--resorte) both;
    animation-delay: calc(var(--i, 0) * 40ms);
}
@keyframes nm-entra-planeta { from { opacity: 0; scale: .2; } }
.nm-planeta__esfera {
    position: absolute; inset: 0;
    border-radius: 50%;
    background:
        radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .55), transparent 38%),
        radial-gradient(circle at 70% 75%, rgba(0, 0, 0, .45), transparent 60%),
        hsl(var(--h), 70%, 55%);
    box-shadow: inset -.4em -.4em .8em rgba(0, 0, 0, .4), 0 0 .8em hsla(var(--h), 90%, 60%, .45);
    transition: opacity .35s, transform .35s;
}
.nm-planeta[data-tipo="1"] .nm-planeta__esfera {      /* gaseoso, con bandas */
    background:
        radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .45), transparent 38%),
        radial-gradient(circle at 70% 75%, rgba(0, 0, 0, .45), transparent 60%),
        repeating-linear-gradient(168deg, hsl(var(--h), 70%, 60%) 0 14%, hsl(calc(var(--h) + 20), 60%, 42%) 14% 22%);
}
.nm-planeta[data-tipo="2"] .nm-planeta__esfera {      /* con cráteres */
    background:
        radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .45), transparent 38%),
        radial-gradient(circle at 62% 40%, hsla(var(--h), 40%, 25%, .6) 0 9%, transparent 10%),
        radial-gradient(circle at 38% 66%, hsla(var(--h), 40%, 25%, .6) 0 7%, transparent 8%),
        radial-gradient(circle at 72% 72%, rgba(0, 0, 0, .45), transparent 60%),
        hsl(var(--h), 45%, 58%);
}
.nm-planeta__anillo {
    position: absolute;
    left: -22%; right: -22%; top: 38%; height: 24%;
    border-radius: 50%;
    border: .16em solid hsla(calc(var(--h) + 40), 80%, 75%, .8);
    transform: rotate(-18deg);
    display: none;
    pointer-events: none;
}
.nm-planeta[data-tipo="3"] .nm-planeta__anillo { display: block; }
.nm-planeta .nm-carta__frente {
    position: absolute;
    inset: -7%;                    /* un poco más grande que el planeta: más lugar para leer */
    border-radius: 50%;
    transform: scale(.3);
    opacity: 0;
    -webkit-backface-visibility: visible; backface-visibility: visible;
    background: rgba(255, 255, 255, .97);
    color: #1e1b4b;
    border: .14em solid hsl(var(--h), 80%, 60%);
    box-shadow: 0 0 1em hsla(var(--h), 90%, 60%, .6);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 11%; gap: 3%;
    transition: transform .4s var(--resorte), opacity .25s;
}
.nm-planeta .nm-carta__img { max-height: 70%; }
.nm-planeta__escaner {
    position: absolute; inset: -10%;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0 75%, rgba(103, 232, 249, .7) 90%, transparent);
    opacity: 0;
    pointer-events: none;
}
.nm-planeta__bandera {
    position: absolute;
    right: -4%; top: -14%;
    font-size: calc(var(--d) * .3);
    line-height: 1;
    color: #fde047;
    text-shadow: 0 0 .3em rgba(0, 0, 0, .6);
    transform: scale(0) rotate(-30deg);
    transform-origin: 0 100%;
    pointer-events: none;
}
.nm-planeta.es-abierta { z-index: 5; }
.nm-planeta.es-abierta .nm-planeta__esfera { opacity: .15; transform: scale(1.12); }
.nm-planeta.es-abierta .nm-carta__frente { transform: scale(1); opacity: 1; }
.nm-planeta.es-abierta .nm-planeta__escaner { animation: nm-escanea .8s ease-out 1; }
@keyframes nm-escanea { 0% { opacity: 1; transform: rotate(0); } 100% { opacity: 0; transform: rotate(540deg); } }
.nm-planeta.es-error .nm-carta__frente { border-color: var(--mal); box-shadow: 0 0 0 .18em var(--mal); animation: nm-sacude-modulo .4s ease-in-out; }
.nm-planeta.es-hallada { z-index: 3; cursor: default; }
.nm-planeta.es-hallada .nm-carta__frente {
    transform: scale(1); opacity: 1;
    border-color: #fde047;
    box-shadow: 0 0 0 .14em #fde047, 0 0 1.4em rgba(253, 224, 71, .6);
}
.nm-planeta.es-hallada .nm-planeta__esfera { opacity: .25; transform: scale(1.15); }
.nm-planeta.es-hallada .nm-planeta__bandera { animation: nm-bandera .5s var(--resorte) forwards; }
@keyframes nm-bandera { to { transform: scale(1) rotate(0); } }
.nm-planeta.es-revelada .nm-carta__frente { opacity: .78; transform: scale(.92); }

/* La nave */
.nm-nave {
    position: absolute;
    left: 0; top: 0;
    width: calc(var(--d) * .32); height: calc(var(--d) * .58);
    margin: calc(var(--d) * -.29) 0 0 calc(var(--d) * -.16);
    z-index: 8;
    pointer-events: none;
    will-change: transform;
}
.nm-nave__casco {
    position: absolute;
    left: 14%; right: 14%; top: 0; bottom: 18%;
    border-radius: 50% 50% 22% 22% / 62% 62% 18% 18%;
    background: linear-gradient(90deg, #cbd5e1, #fff 45%, #94a3b8);
    box-shadow: inset 0 -.25em 0 #ef4444;
}
.nm-nave__ventana {
    position: absolute;
    left: 50%; top: 28%;
    width: 46%; aspect-ratio: 1;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #e0f2fe, #38bdf8 60%, #0369a1);
    border: 2px solid #475569;
}
.nm-nave__aleta {
    position: absolute;
    bottom: 12%;
    width: 30%; height: 36%;
    background: #ef4444;
}
.nm-nave__aleta--i { left: 0; clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 55%); }
.nm-nave__aleta--d { right: 0; clip-path: polygon(0 0, 100% 55%, 100% 100%, 0 100%); }
.nm-nave__llama {
    position: absolute;
    left: 30%; right: 30%; top: 76%;
    height: 22%;
    border-radius: 0 0 50% 50%;
    background: linear-gradient(180deg, #fde047, #f97316 60%, transparent);
    transform-origin: 50% 0;
    transform: scaleY(.4);
    opacity: .7;
    animation: nm-llama .12s ease-in-out infinite alternate;
}
@keyframes nm-llama { to { filter: brightness(1.3); } }
.nm-nave.es-volando .nm-nave__llama { transform: scaleY(1.8); opacity: 1; }
.nm-nave.es-sacude .nm-nave__casco { animation: nm-sacude-modulo .4s ease-in-out 2; }
.nm-nave__estela {
    position: absolute;
    width: 9px; height: 9px;
    margin: -4.5px 0 0 -4.5px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff, #fde047 40%, rgba(249, 115, 22, 0) 70%);
    z-index: 7;
    pointer-events: none;
    animation: nm-estela .6s ease-out forwards;
}
@keyframes nm-estela { to { transform: scale(2.6); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    .nm-pesca__olas, .nm-pesca__rayos, .nm-pesca__alga, .nm-pesca__bote, .nm-pesca__sol,
    .nm-pez__cola, .nm-pez__cuerpo, .nm-pez__aleta,
    .nm-cohete__estrellas, .nm-cohete__sol, .nm-cohete__constelacion { animation: none !important; }
}
