/* ============================================================================
   Sobre de pantalla completa (apertura tipo «toca para abrir»)
   Se monta con el campo newSobre del renderer (dentro de section#carta) y lo maneja assets/js/jwd-sobre.js.
   Dos modos:
     - solapas: sobre dibujado con CSS (papel, solapa en V, lacre con iniciales). Sin archivos.
     - video:   video de la apertura a pantalla completa con su póster; si no arranca, cae a «solapas».
   Variables (las pone el JS desde los data-*): --jsb-papel, --jsb-lacre, --jsb-tinta
   ============================================================================ */

.jwd-sobre {
    --jsb-papel: #efe6d6;
    --jsb-lacre: #a8823a;
    --jsb-tinta: #6b5636;
    position: fixed;
    inset: 0;
    z-index: 10000;
    overflow: hidden;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    background: var(--jsb-papel);
    outline: none;
}
.jwd-sobre:focus-visible .jsb-pista { outline: 2px solid var(--jsb-tinta); outline-offset: 6px; border-radius: 999px; }

/* ---------- escena (lo que «entra la cámara») ---------- */
.jsb-escena {
    position: absolute;
    inset: 0;
    perspective: 1400px;
    perspective-origin: 50% 0%;
    transform-origin: 50% 42%;
    transition: transform 1.25s cubic-bezier(.55, 0, .3, 1);
}

/* Papel: color + grano (SVG con ruido) + viñeta suave */
.jsb-papel,
.jsb-solapa-cara,
.jsb-interior {
    background-color: var(--jsb-papel);
    background-image:
        radial-gradient(120% 90% at 50% 40%, rgba(255, 255, 255, .35), rgba(0, 0, 0, .08) 70%, rgba(0, 0, 0, .18)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.jsb-papel { position: absolute; inset: 0; }
/* Foto de papel propia (data-fondo): reemplaza el grano dibujado, conserva la viñeta */
.jwd-sobre.con-fondo .jsb-papel,
.jwd-sobre.con-fondo .jsb-solapa-cara,
.jwd-sobre.con-fondo .jsb-interior {
    background-image: radial-gradient(120% 90% at 50% 40%, rgba(255, 255, 255, .2), rgba(0, 0, 0, .06) 70%, rgba(0, 0, 0, .16)), var(--jsb-fondo);
    background-size: cover, cover;
    background-position: center, center;
}
.jwd-sobre[data-modo="video"] .jsb-pista { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .6), 0 0 1px rgba(0, 0, 0, .8); }

/* Interior del sobre: se ve al levantar la solapa (más oscuro, con sombra hacia adentro) */
.jsb-interior {
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 52%;
    clip-path: polygon(0 0, 100% 0, 100% 18%, 50% 100%, 0 18%);
    filter: brightness(.78);
    box-shadow: inset 0 40px 60px rgba(0, 0, 0, .25);
}

/* Tarjeta que asoma y sube al abrir */
.jsb-carta {
    position: absolute;
    left: 9%; right: 9%;
    top: 14%;
    height: 46%;
    border-radius: 6px;
    background: #fffdf8;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
    display: grid;
    place-items: center;
    text-align: center;
    color: var(--jsb-tinta);
    font-family: 'Titles', 'Cinzel', Georgia, serif;
    font-size: clamp(26px, 8vw, 44px);
    padding: 0 8%;
    opacity: 0;
    transform: translateY(18%);
    transition: transform 1s cubic-bezier(.3, .7, .2, 1), opacity .5s;
}
.jsb-carta > div { max-width: 64%; line-height: 1.05; }   /* nombres largos: en dos renglones dentro del hueco en V */
.jsb-carta small { display: block; font: 600 11px/1.4 'Montserrat', system-ui, sans-serif; letter-spacing: .3em; text-transform: uppercase; opacity: .7; margin-bottom: 6px; }

/* Frente del sobre (la parte de abajo, tapa la tarjeta) */
.jsb-frente {
    position: absolute;
    inset: 0;
    clip-path: polygon(0 18.5%, 50% 52.5%, 100% 18.5%, 100% 100%, 0 100%);
}
.jsb-frente::after {           /* pliegues laterales, muy tenues */
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to bottom right, transparent 49.6%, rgba(0, 0, 0, .06) 50%, transparent 50.6%) left bottom / 50% 55% no-repeat,
        linear-gradient(to bottom left, transparent 49.6%, rgba(0, 0, 0, .06) 50%, transparent 50.6%) right bottom / 50% 55% no-repeat;
}

/* ---------- solapa (dos caras: papel por fuera, interior por dentro) ---------- */
.jsb-solapa-sombra {           /* la sombra sigue la V (clip-path corta box-shadow) */
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 56%;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .22));
    perspective: 1400px;          /* el filtro aplana el 3D: la perspectiva va aquí */
    perspective-origin: 50% 0%;
    z-index: 3;
}
.jsb-solapa {
    position: absolute;
    inset: 0;
    transform-origin: 50% 0;
    transform-style: preserve-3d;
    transition: transform 1.1s cubic-bezier(.6, .05, .25, 1);
}
.jsb-solapa-cara {
    position: absolute;
    inset: 0;
    clip-path: polygon(0 0, 100% 0, 100% 33%, 50% 94%, 0 33%);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
.jsb-solapa-cara.frente { filter: brightness(1.04); }
.jsb-solapa-cara.dentro { transform: rotateX(180deg); filter: brightness(.82); }
.jsb-solapa-cara.frente::after {  /* filo dorado opcional en el borde de la V */
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 60%, rgba(0, 0, 0, .05));
}

/* ---------- lacre ---------- */
.jsb-lacre {
    position: absolute;
    left: 50%;
    top: 94%;
    width: clamp(78px, 24vw, 112px);
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .55), transparent 32%),
        radial-gradient(circle at 50% 50%, var(--jsb-lacre) 55%, color-mix(in srgb, var(--jsb-lacre) 70%, #000) 72%, var(--jsb-lacre) 76%, color-mix(in srgb, var(--jsb-lacre) 60%, #000) 100%);
    box-shadow:
        0 3px 6px rgba(0, 0, 0, .35),
        0 10px 18px rgba(0, 0, 0, .18),
        inset 0 -4px 8px rgba(0, 0, 0, .3),
        inset 0 3px 6px rgba(255, 255, 255, .35);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transition: transform .35s cubic-bezier(.3, 1.6, .5, 1), opacity .4s;
}
.jsb-lacre::before {           /* anillo hundido */
    content: '';
    position: absolute;
    inset: 13%;
    border-radius: 50%;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, .35), 0 1px 1px rgba(255, 255, 255, .35);
}
.jsb-lacre span {
    position: relative;
    font-family: 'Titles', 'Cinzel', Georgia, serif;
    font-size: clamp(22px, 7vw, 34px);
    line-height: 1;
    color: color-mix(in srgb, var(--jsb-lacre) 55%, #000);
    text-shadow: 0 1px 0 rgba(255, 255, 255, .45), 0 -1px 0 rgba(0, 0, 0, .25);
    white-space: nowrap;
}

/* ---------- textos ---------- */
.jsb-titulo {
    position: absolute;
    left: 6%; right: 6%;
    top: 66%;
    text-align: center;
    color: var(--jsb-tinta);
    font-family: 'Titles', 'Cinzel', Georgia, serif;
    font-size: clamp(24px, 7.5vw, 40px);
    line-height: 1.15;
    z-index: 2;
}
.jsb-pista {
    position: absolute;
    left: 50%;
    bottom: calc(7% + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 4;
    font: 600 11px/1 'Montserrat', system-ui, sans-serif;
    letter-spacing: .32em;
    text-transform: uppercase;
    color: var(--jsb-tinta);
    text-shadow: 0 1px 0 rgba(255, 255, 255, .7);
    white-space: nowrap;
    padding: 8px 12px;
    animation: jsb-latido 2.2s ease-in-out infinite;
}
@keyframes jsb-latido { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* ---------- video ---------- */
.jsb-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 5;
    background: var(--jsb-papel) center / cover no-repeat;
}
.jwd-sobre[data-modo="video"] .jsb-escena { visibility: hidden; }
.jwd-sobre[data-modo="video"].sin-video .jsb-escena { visibility: visible; }
.jwd-sobre.sin-video .jsb-video { display: none; }

/* ---------- velo blanco del final ---------- */
.jsb-velo {
    position: absolute;
    inset: 0;
    z-index: 8;
    background: #fff;
    opacity: 0;
    pointer-events: none;
    transition: opacity .7s ease;
}

/* ================= apertura ================= */
.jwd-sobre.abriendo { cursor: default; }
.jwd-sobre.abriendo .jsb-pista { animation: none; opacity: 0; transition: opacity .2s; }
.jwd-sobre.abriendo .jsb-lacre { transform: translate(-50%, -50%) scale(.92); }
.jwd-sobre.solapa-arriba .jsb-solapa { transform: rotateX(-178deg); }
.jwd-sobre.solapa-arriba .jsb-solapa-sombra { z-index: 0; }   /* abierta, queda detrás de la tarjeta */
.jwd-sobre.carta-fuera .jsb-carta { opacity: 1; transform: translateY(-22%); }
.jwd-sobre.carta-fuera .jsb-titulo { opacity: 0; transition: opacity .4s; }
.jwd-sobre.camara .jsb-escena { transform: scale(2.1) translateY(6%); }
.jwd-sobre.blanco .jsb-velo { opacity: 1; }

/* El sobre se va: el velo blanco se desvanece y deja ver la invitación */
#carta:has(.jwd-sobre) { background: transparent; z-index: 1000000; }   /* encima del menú fijo de inviWeb (.menu-fixed: 999999) */
#carta.desaparecer:has(.jwd-sobre) { transition: opacity 1s ease, visibility 1s; }

@media (prefers-reduced-motion: reduce) {
    .jsb-escena, .jsb-solapa, .jsb-carta { transition-duration: .01s !important; }
    .jsb-pista { animation: none; opacity: 1; }
}

/* ============================================================================
   v2 (inviJWD): lacre de cera en SVG, forro estampado, filo en la solapa, «Para», destello al abrir
   ============================================================================ */
.jwd-sobre {
    --jsb-lacre-claro: color-mix(in srgb, var(--jsb-lacre) 68%, #fff);
    --jsb-lacre-oscuro: color-mix(in srgb, var(--jsb-lacre) 52%, #000);
    --jsb-forro: var(--jsb-lacre);
    --jsb-filo: color-mix(in srgb, var(--jsb-lacre) 75%, #fff);
}
/* Lacre: el dibujo lo pone el JS (lacreSvg); aquí solo tamaño y sombra */
.jsb-lacre {
    background: none;
    box-shadow: none;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .35)) drop-shadow(0 10px 14px rgba(0, 0, 0, .18));
}
.jsb-lacre::before { display: none; }
.jsb-lacre svg { width: 100%; height: 100%; overflow: visible; }
/* Lacre grande (iniciales de 3 letras o más, como «D & Y», o data-lacre-tam=grande) */
.jwd-sobre.lacre-grande .jsb-lacre { width: clamp(124px, 40vw, 178px); }
.jsb-ini { fill: var(--jsb-lacre-oscuro); font-family: 'JWDNombre', 'Titles', 'Cinzel', Georgia, serif; letter-spacing: .02em; }

/* Forro del sobre (se ve al abrir: dentro del sobre y en la cara interior de la solapa) */
.jsb-forro {
    position: absolute;
    inset: 0;
    background-color: color-mix(in srgb, var(--jsb-forro) 82%, #000);
    background-image:
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, .2) 1.6px, transparent 2.2px),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, .2) 1.6px, transparent 2.2px),
        linear-gradient(45deg, rgba(255, 255, 255, .07) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, .07) 75%),
        linear-gradient(-45deg, rgba(255, 255, 255, .07) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, .07) 75%);
    background-size: 24px 24px;
    box-shadow: inset 0 40px 60px rgba(0, 0, 0, .3);
}
.jsb-interior { filter: none; box-shadow: none; }
.jsb-solapa-cara.dentro { filter: none; }

/* Filo metálico en el borde de la solapa */
.jsb-filo { position: absolute; inset: 0; width: 100%; height: 100%; }
.jsb-filo polyline { fill: none; stroke: var(--jsb-filo); stroke-width: 2; vector-effect: non-scaling-stroke; transform: translateY(-1.6%); opacity: .9; }

/* «Para: Familia X» en el frente */
.jsb-para { font-family: 'JWDNombre', 'Titles', 'Cinzel', Georgia, serif; font-size: clamp(30px, 9vw, 46px); }
.jsb-para small {
    display: block;
    font: 600 10px/1 'Montserrat', system-ui, sans-serif;
    letter-spacing: .38em;
    text-transform: uppercase;
    opacity: .7;
    margin-bottom: 10px;
}

/* Destello de luz que sale del sobre antes del blanco */
.jsb-luz {
    position: absolute;
    left: 50%; top: 40%;
    width: 40px; height: 40px;
    margin: -20px 0 0 -20px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0%, rgba(255, 248, 228, .92) 32%, rgba(255, 240, 205, 0) 70%);
    opacity: 0;
    transform: scale(0);
    transition: transform 1.1s cubic-bezier(.5, 0, .7, 1), opacity .45s;
    z-index: 4;
    pointer-events: none;
}
.jwd-sobre.camara .jsb-luz { opacity: 1; transform: scale(45); }
/* Forro más fino: mezcla del lacre con el papel, estampado delicado */
.jsb-forro {
    background-color: color-mix(in srgb, var(--jsb-forro) 38%, var(--jsb-papel));
    background-image:
        radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--jsb-forro) 55%, transparent) 1.4px, transparent 1.9px),
        linear-gradient(45deg, transparent 46%, color-mix(in srgb, var(--jsb-forro) 22%, transparent) 47%, color-mix(in srgb, var(--jsb-forro) 22%, transparent) 53%, transparent 54%),
        linear-gradient(-45deg, transparent 46%, color-mix(in srgb, var(--jsb-forro) 22%, transparent) 47%, color-mix(in srgb, var(--jsb-forro) 22%, transparent) 53%, transparent 54%);
    background-size: 18px 18px, 36px 36px, 36px 36px;
    box-shadow: inset 0 50px 70px rgba(0, 0, 0, .22);
}
/* Nombre del frente con la tipografía del nombre; lacre un poco más grande */
.jsb-titulo { font-family: 'JWDNombre', 'Titles', 'Cinzel', Georgia, serif; font-size: clamp(38px, 12vw, 58px); }
.jsb-lacre { width: clamp(92px, 28vw, 128px); }
/* Iniciales del lacre: tono oscuro de la misma cera, con trazo para que la letra fina se vea estampada */
.jsb-ini {
    fill: color-mix(in srgb, var(--jsb-lacre) 58%, #000);
    stroke: color-mix(in srgb, var(--jsb-lacre) 50%, #000);
    stroke-width: .7px;
    paint-order: stroke;
}

/* ============================================================================
   Estilo «relieve» (modo solapas + --jsb-estilo: relieve, o data-modo="relieve"):
   papel con textura y relieve, cuatro solapas en rombo, ramitas doradas y lacre; abre en 3D (assets/js/jwd-sobre.js)
   ============================================================================ */
.jwd-sobre[data-modo="relieve"] {
    --jsr-oro: color-mix(in srgb, var(--jsb-lacre) 85%, #fff);
    --jsr-oro-claro: color-mix(in srgb, var(--jsb-lacre) 45%, #fff);
    --jsr-oro-oscuro: color-mix(in srgb, var(--jsb-lacre) 70%, #000);
    background: var(--jsb-papel);
}
.jsr { position: absolute; inset: 0; perspective: 1100px; perspective-origin: 50% 40%; overflow: hidden; }
.jsr-interior {
    position: absolute; inset: 0; display: grid; place-items: center;
    background:
        radial-gradient(120% 70% at 50% 45%, color-mix(in srgb, var(--jsb-papel) 96%, #fff) 0%, var(--jsb-papel) 60%, color-mix(in srgb, var(--jsb-papel) 88%, #000) 100%);
    box-shadow: inset 0 0 90px rgba(0, 0, 0, .18);
}
.jsr-carta { text-align: center; color: var(--jsb-tinta); font: 400 clamp(30px, 9vw, 52px)/1.1 'JWDNombre', 'Titles', 'Cinzel', Georgia, serif; padding: 0 10%;
    opacity: 0; transform: translateY(12px) scale(.97); transition: opacity .8s ease, transform 1.1s cubic-bezier(.2, .7, .2, 1); }
.jsr-carta small { display: block; font: 500 11px/1.4 'Montserrat', system-ui, sans-serif; letter-spacing: .32em; text-transform: uppercase; opacity: .7; margin-bottom: 10px; }

.jsr-solapa { position: absolute; inset: 0; will-change: transform; }
.jsr-solapa.jsr-arriba { transform-style: preserve-3d; }
.jsr-cara { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; backface-visibility: hidden; -webkit-backface-visibility: hidden;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .16)) drop-shadow(0 1px 1px rgba(0, 0, 0, .12)); }
.jsr-cara polygon { fill: var(--jsr-tono, var(--jsb-papel)); }
.jsr-cara.dentro { transform: rotateX(180deg); }
.jsr-cara.dentro polygon { fill: color-mix(in srgb, var(--jsb-papel) 90%, #000); }
.jsr-filo-luz, .jsr-filo-sombra { fill: none; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.jsr-filo-luz { stroke: rgba(255, 255, 255, .85); stroke-width: 1.6px; transform: translateY(.25px); }
.jsr-filo-sombra { stroke: color-mix(in srgb, var(--jsb-lacre) 45%, transparent); stroke-width: 1px; }
.jsr-solapa.jsr-izq   { --jsr-tono: color-mix(in srgb, var(--jsb-papel) 95%, #000); transform-origin: 0 53%; }
.jsr-solapa.jsr-der   { --jsr-tono: color-mix(in srgb, var(--jsb-papel) 95%, #000); transform-origin: 100% 53%; }
.jsr-solapa.jsr-abajo { --jsr-tono: color-mix(in srgb, var(--jsb-papel) 97.5%, #000); transform-origin: 50% 100%; }
.jsr-solapa.jsr-arriba { --jsr-tono: color-mix(in srgb, var(--jsb-papel) 99%, #fff); transform-origin: 50% 0; z-index: 2; }
.jsr-adornos { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.jsr-pos { position: absolute; line-height: 0; }
.jsr-ramo { display: block; height: auto; opacity: .92; }
.jsr-tallo { stroke-width: 1.6; fill: none !important; }
.jsr-hoja, .jsr-petalo { stroke-width: .5; }
.jsr-centro, .jsr-baya { stroke: none; }
.jsr-lacre {
    position: absolute; left: 50%; top: 55%; width: clamp(92px, 28vw, 136px); aspect-ratio: 1; transform: translate(-50%, -50%); z-index: 3;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .35)) drop-shadow(0 10px 14px rgba(0, 0, 0, .18));
}
.jwd-sobre.lacre-grande .jsr-lacre { width: clamp(118px, 38vw, 170px); }
.jsr-lacre svg { width: 100%; height: 100%; overflow: visible; }
/* textura de papel (ruido) y luz suave arriba, como en foto */
.jsr-textura { position: absolute; inset: 0; pointer-events: none; z-index: 4; opacity: .22; mix-blend-mode: multiply; transition: opacity .5s;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .45  0 0 0 0 .4  0 0 0 0 .33  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.jsr-luz { position: absolute; inset: 0; pointer-events: none; z-index: 4;
    background: radial-gradient(90% 55% at 50% 18%, rgba(255, 255, 255, .45), transparent 60%), radial-gradient(140% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, .14)); }
.jsr-pista { display: inline-flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .88); color: color-mix(in srgb, var(--jsb-tinta) 85%, transparent);
    padding: 9px 18px; border-radius: 999px; box-shadow: 0 4px 16px rgba(0, 0, 0, .12); z-index: 6; }
.jsr-pista svg { width: 16px; height: 16px; }

/* --- apertura --- */
.jwd-sobre[data-modo="relieve"].abriendo .jsb-pista { opacity: 0; transition: opacity .3s; }
.jwd-sobre.rl-1 .jsr-solapa.jsr-arriba { transform: rotateX(176deg); opacity: 0; transition: transform 1.25s cubic-bezier(.45, .05, .25, 1), opacity .45s ease .8s; }
.jwd-sobre.rl-1 .jsr-lacre { transform: translate(-50%, -260%) scale(.7) rotateX(60deg); opacity: 0; transition: transform 1.1s cubic-bezier(.45, .05, .25, 1), opacity .5s ease .55s; }
.jwd-sobre.rl-1 .jsr-textura { opacity: 0; }
.jwd-sobre.rl-2 .jsr-solapa.jsr-izq   { transform: rotateY(-165deg); opacity: 0; transition: transform 1.1s cubic-bezier(.45, .05, .25, 1), opacity .45s ease .65s; }
.jwd-sobre.rl-2 .jsr-solapa.jsr-der   { transform: rotateY(165deg);  opacity: 0; transition: transform 1.1s cubic-bezier(.45, .05, .25, 1), opacity .45s ease .65s; }
.jwd-sobre.rl-2 .jsr-solapa.jsr-abajo { transform: rotateX(-165deg); opacity: 0; transition: transform 1.15s cubic-bezier(.45, .05, .25, 1) .08s, opacity .45s ease .75s; }
.jwd-sobre.rl-3 .jsr-carta { opacity: 1; transform: none; }
.jwd-sobre[data-modo="relieve"] .jsb-velo { background: var(--jsb-papel); }
@media (prefers-reduced-motion: reduce) {
    .jwd-sobre[data-modo="relieve"] * { transition-duration: .01s !important; }
}
/* --- texturas del papel (estilo relieve): --jsb-textura: lino | damasco | marmol | brillo | puntos | imagen --- */
.jsr-tex { position: absolute; inset: 0; pointer-events: none; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.jwd-sobre[data-textura="lino"] .jsr-tex {
    background: repeating-linear-gradient(0deg, rgba(60, 45, 20, .05) 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, rgba(60, 45, 20, .045) 0 1px, transparent 1px 4px); }
.jwd-sobre[data-textura="damasco"] .jsr-tex { background: var(--jsr-oro); opacity: .16; -webkit-mask: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cpath d='M32 3 L61 32 L32 61 L3 32Z' fill='none' stroke='%23000' stroke-width='1'/%3E%3Cpath d='M32 18c5 5 5 8 0 13c-5-5-5-8 0-13zM32 46c5-5 5-8 0-13c-5 5-5 8 0 13zM18 32c5-5 8-5 13 0c-5 5-8 5-13 0zM46 32c-5-5-8-5-13 0c5 5 8 5 13 0z' fill='%23000'/%3E%3Ccircle cx='0' cy='0' r='2.4'/%3E%3Ccircle cx='64' cy='0' r='2.4'/%3E%3Ccircle cx='0' cy='64' r='2.4'/%3E%3Ccircle cx='64' cy='64' r='2.4'/%3E%3C/svg%3E") 0 0 / 64px 64px repeat; mask: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cpath d='M32 3 L61 32 L32 61 L3 32Z' fill='none' stroke='%23000' stroke-width='1'/%3E%3Cpath d='M32 18c5 5 5 8 0 13c-5-5-5-8 0-13zM32 46c5-5 5-8 0-13c-5 5-5 8 0 13zM18 32c5-5 8-5 13 0c-5 5-8 5-13 0zM46 32c-5-5-8-5-13 0c5 5 8 5 13 0z' fill='%23000'/%3E%3Ccircle cx='0' cy='0' r='2.4'/%3E%3Ccircle cx='64' cy='0' r='2.4'/%3E%3Ccircle cx='0' cy='64' r='2.4'/%3E%3Ccircle cx='64' cy='64' r='2.4'/%3E%3C/svg%3E") 0 0 / 64px 64px repeat; }
.jwd-sobre[data-textura="marmol"] .jsr-tex { background: color-mix(in srgb, var(--jsr-oro-oscuro) 60%, #777); opacity: .2; -webkit-mask: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='520'%3E%3Cfilter id='m' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.006 .018' numOctaves='5' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  -3 0 0 0 1.55'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23m)'/%3E%3C/svg%3E") 0 0 / 520px 520px repeat; mask: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='520'%3E%3Cfilter id='m' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.006 .018' numOctaves='5' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  -3 0 0 0 1.55'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23m)'/%3E%3C/svg%3E") 0 0 / 520px 520px repeat; }
.jwd-sobre[data-textura="brillo"] .jsr-tex { background: linear-gradient(115deg, var(--jsr-oro-oscuro), var(--jsr-oro-claro) 45%, var(--jsr-oro) 60%, var(--jsr-oro-oscuro)); background-size: 300% 100%;
    -webkit-mask: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cg fill='%23000'%3E%3Ccircle cx='12' cy='18' r='1.1'/%3E%3Ccircle cx='46' cy='8' r='.7'/%3E%3Ccircle cx='88' cy='22' r='1.4'/%3E%3Ccircle cx='120' cy='12' r='.8'/%3E%3Ccircle cx='30' cy='52' r='.9'/%3E%3Ccircle cx='70' cy='60' r='1.2'/%3E%3Ccircle cx='108' cy='48' r='.7'/%3E%3Ccircle cx='8' cy='92' r='1.3'/%3E%3Ccircle cx='52' cy='98' r='.8'/%3E%3Ccircle cx='96' cy='90' r='1'/%3E%3Ccircle cx='132' cy='84' r='1.2'/%3E%3Ccircle cx='26' cy='128' r='.9'/%3E%3Ccircle cx='76' cy='124' r='1.4'/%3E%3Ccircle cx='116' cy='130' r='.7'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 140px 140px repeat; mask: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cg fill='%23000'%3E%3Ccircle cx='12' cy='18' r='1.1'/%3E%3Ccircle cx='46' cy='8' r='.7'/%3E%3Ccircle cx='88' cy='22' r='1.4'/%3E%3Ccircle cx='120' cy='12' r='.8'/%3E%3Ccircle cx='30' cy='52' r='.9'/%3E%3Ccircle cx='70' cy='60' r='1.2'/%3E%3Ccircle cx='108' cy='48' r='.7'/%3E%3Ccircle cx='8' cy='92' r='1.3'/%3E%3Ccircle cx='52' cy='98' r='.8'/%3E%3Ccircle cx='96' cy='90' r='1'/%3E%3Ccircle cx='132' cy='84' r='1.2'/%3E%3Ccircle cx='26' cy='128' r='.9'/%3E%3Ccircle cx='76' cy='124' r='1.4'/%3E%3Ccircle cx='116' cy='130' r='.7'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 140px 140px repeat; animation: jsr-brillo 4s linear infinite; }
@keyframes jsr-brillo { to { background-position: 300% 0; } }
.jwd-sobre[data-textura="puntos"] .jsr-tex { background: radial-gradient(circle, var(--jsr-oro) 1.3px, transparent 1.8px) 0 0 / 20px 20px; opacity: .45; }
.jwd-sobre[data-textura="imagen"] .jsr-tex { background: var(--jsb-fondo, none) center / cover no-repeat; mix-blend-mode: multiply; opacity: .9; }
.jwd-sobre[data-textura="imagen"].con-fondo { background-image: none; }
@media (prefers-reduced-motion: reduce) { .jwd-sobre[data-textura="brillo"] .jsr-tex { animation: none; } }
.jwd-sobre.papel-oscuro .jsr-luz { background: radial-gradient(90% 55% at 50% 18%, rgba(255, 255, 255, .12), transparent 60%), radial-gradient(140% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, .3)); }
.jwd-sobre.papel-oscuro .jsr-interior { background: radial-gradient(120% 70% at 50% 45%, color-mix(in srgb, var(--jsb-papel) 88%, #fff) 0%, var(--jsb-papel) 60%, color-mix(in srgb, var(--jsb-papel) 80%, #000) 100%); }
.jwd-sobre.papel-oscuro .jsr-filo-luz { stroke: rgba(255, 255, 255, .25); }
.jwd-sobre.papel-oscuro .jsr-pista { background: rgba(255, 255, 255, .14); color: #f3ead8; }
.jwd-sobre.papel-oscuro .jsr-carta { color: #f3ead8; }

/* --- marco (estilo relieve): --jsb-marco: grecas | doble | perlas. Va en cada solapa: al abrir se parte con ellas --- */
.jsr-marco { position: absolute; inset: clamp(12px, 3.6vmin, 22px); pointer-events: none;
    filter: drop-shadow(.6px .8px .4px rgba(0, 0, 0, .28)) drop-shadow(-.4px -.5px .3px rgba(255, 255, 255, .7)); }
.jsr-marco i { position: absolute; display: block; }
.jwd-sobre[data-marco="grecas"] .jsr-marco i { background: var(--jsr-oro); }
.jwd-sobre[data-marco="grecas"] .jsr-marco .t, .jwd-sobre[data-marco="grecas"] .jsr-marco .b { left: 0; right: 0; height: 16px;
    -webkit-mask: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='16'%3E%3Cpath d='M0 1 H32 M0 15 H32 M4 1 V12 H26 V4.5 H11 V9 H20' fill='none' stroke='%23000' stroke-width='1.1'/%3E%3C/svg%3E") 0 0 / 32px 16px repeat-x; mask: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='16'%3E%3Cpath d='M0 1 H32 M0 15 H32 M4 1 V12 H26 V4.5 H11 V9 H20' fill='none' stroke='%23000' stroke-width='1.1'/%3E%3C/svg%3E") 0 0 / 32px 16px repeat-x; }
.jwd-sobre[data-marco="grecas"] .jsr-marco .t { top: 0; }
.jwd-sobre[data-marco="grecas"] .jsr-marco .b { bottom: 0; transform: scaleY(-1); }
.jwd-sobre[data-marco="grecas"] .jsr-marco .l, .jwd-sobre[data-marco="grecas"] .jsr-marco .r { top: 16px; bottom: 16px; width: 16px;
    -webkit-mask: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='32'%3E%3Cpath d='M1 0 V32 M15 0 V32 M1 4 H12 V26 H4.5 V11 H9 V20' fill='none' stroke='%23000' stroke-width='1.1'/%3E%3C/svg%3E") 0 0 / 16px 32px repeat-y; mask: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='32'%3E%3Cpath d='M1 0 V32 M15 0 V32 M1 4 H12 V26 H4.5 V11 H9 V20' fill='none' stroke='%23000' stroke-width='1.1'/%3E%3C/svg%3E") 0 0 / 16px 32px repeat-y; }
.jwd-sobre[data-marco="grecas"] .jsr-marco .l { left: 0; }
.jwd-sobre[data-marco="grecas"] .jsr-marco .r { right: 0; transform: scaleX(-1); }
.jwd-sobre[data-marco="doble"] .jsr-marco { border: 1.6px solid var(--jsr-oro); }
.jwd-sobre[data-marco="doble"] .jsr-marco::after { content: ''; position: absolute; inset: 6px; border: 1px solid var(--jsr-oro); }
.jwd-sobre[data-marco="perlas"] .jsr-marco { border: 4px dotted var(--jsr-oro); border-radius: 4px; }
.jwd-sobre[data-marco="perlas"] .jsr-marco::after { content: ''; position: absolute; inset: 9px; border: 1px solid color-mix(in srgb, var(--jsr-oro) 70%, transparent); }
.jsr-espiral { stroke: var(--jsr-oro-oscuro); stroke-width: .9; }.jsr-pos.jsr-solo { transform: translate(-50%, -50%); }
.jsr-motivo { opacity: .95; }
