/* Cada apertura vive en su contenedor; el sobre de Carta conserva sus estilos. */
.model-opening-screen{position:relative;z-index:3;padding:0}
.model-opening{box-sizing:border-box;display:flex;min-height:100svh;flex-direction:column;align-items:center;justify-content:center;gap:24px;padding:max(30px,env(safe-area-inset-top)) 18px max(30px,env(safe-area-inset-bottom));overflow:hidden;text-align:center}
.opening-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.model-opening-button{display:block;max-width:100%;margin:0;padding:0;border:0;background:transparent;color:inherit;font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
.model-opening-button:focus-visible{outline:3px solid var(--wine);outline-offset:12px;border-radius:5px}
.model-opening-button:disabled{cursor:default}
.opening-model-hint{margin:0;color:var(--muted);font-size:1rem;line-height:1.5}
.model-opening-album{--opening-leather:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27180%27%20height%3D%27180%27%3E%3Cfilter%20id%3D%27g%27%3E%3CfeTurbulence%20type%3D%27fractalNoise%27%20baseFrequency%3D%27.8%27%20numOctaves%3D%272%27%20seed%3D%277%27%20stitchTiles%3D%27stitch%27%2F%3E%3CfeColorMatrix%20type%3D%27saturate%27%20values%3D%270%27%2F%3E%3C%2Ffilter%3E%3Crect%20width%3D%27100%25%27%20height%3D%27100%25%27%20opacity%3D%27.025%27%20filter%3D%27url%28%23g%29%27%2F%3E%3C%2Fsvg%3E");--opening-grain:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27180%27%20height%3D%27180%27%3E%3Cfilter%20id%3D%27g%27%3E%3CfeTurbulence%20type%3D%27fractalNoise%27%20baseFrequency%3D%27.8%27%20numOctaves%3D%272%27%20seed%3D%277%27%20stitchTiles%3D%27stitch%27%2F%3E%3CfeColorMatrix%20type%3D%27saturate%27%20values%3D%270%27%2F%3E%3C%2Ffilter%3E%3Crect%20width%3D%27100%25%27%20height%3D%27100%25%27%20opacity%3D%27.025%27%20filter%3D%27url%28%23g%29%27%2F%3E%3C%2Fsvg%3E");perspective:1600px;--opening-cover:#eee8dc;--opening-edge:#d6cdbb;--opening-gold:#6b6051}
.opening-album-button{width:min(72vw,320px);perspective:1400px;overflow:visible}
.opening-closed-book{position:relative;display:block;width:100%;aspect-ratio:.72;transform-style:preserve-3d;transform:rotate(-2deg);transition:transform .2s ease}
.opening-album-button:focus-visible{border-radius:24px}
.opening-album-button:hover .opening-closed-book{transform:rotate(0)}
.opening-book-pages{position:absolute;inset:7px -6px -5px 7px;overflow:hidden;border:1px solid #d4cbb8;border-radius:13px 24px 25px 14px;background:repeating-linear-gradient(0deg,#fbf8ef 0 2px,#d9d2c4 2px 3px,#f4f0e5 3px 5px);box-shadow:2px 3px 0 #e1d9c9,3px 7px 0 #e8e0d0,3px 17px 24px rgba(69,59,42,.16)}
.opening-book-pages::after{content:"";position:absolute;top:13px;right:0;bottom:12px;width:7px;border-radius:0 18px 18px 0;background:repeating-linear-gradient(90deg,#fbf8ef 0 2px,#d3cbbd 2px 3px,#f4f0e5 3px 5px)}
.opening-book-inside{position:absolute;inset:5px;border:1px solid #ded6c7;border-radius:12px 22px 22px 12px;background:#f8f5ec;background-image:var(--opening-grain);background-size:180px 180px;box-shadow:inset 10px 0 15px rgba(117,103,80,.08)}
.opening-inside-heart{display:none}
.opening-cover-turn{position:absolute;inset:0;display:block;transform-origin:0 50%;transform-style:preserve-3d}
.opening-cover-back{position:absolute;inset:0;display:block;border:2px solid var(--opening-cover);border-radius:14px 25px 25px 14px;background:#f8f5ec;background-image:var(--opening-grain);background-size:180px 180px;box-shadow:inset -9px 0 15px rgba(113,101,80,.09);transform:rotateY(180deg) translateZ(1px);backface-visibility:hidden}
.opening-cover-front{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:28px 24px 28px 32px;border:1px solid #d8d0bf;border-radius:14px 26px 26px 14px;background-color:var(--opening-cover);background-image:var(--opening-leather),linear-gradient(100deg,rgba(177,165,142,.09),rgba(255,255,255,.22) 16%,transparent 58%,rgba(151,135,108,.035));background-size:180px 180px,100% 100%;box-shadow:inset 0 1px 1px rgba(255,255,255,.8),inset -1px -2px 3px rgba(124,106,77,.07),0 2px 0 #d8cfbd;transform:translateZ(1px);backface-visibility:hidden}
.opening-cover-front::before{content:"";position:absolute;top:0;bottom:0;left:0;width:17px;border:0;border-radius:13px 0 0 13px;background:linear-gradient(90deg,#cbc2b0,#e2dacc 22%,#f0eade 53%,#d9d0be 88%,#c7bda8);box-shadow:1px 0 0 rgba(157,143,118,.18);pointer-events:none}
.opening-cover-front::after{content:"";position:absolute;inset:0;border-radius:inherit;opacity:0;background:linear-gradient(90deg,rgba(94,80,57,.17),transparent 32%,rgba(255,255,255,.35) 78%,rgba(106,91,67,.07));pointer-events:none}
.opening-cover-plate{padding:16px 10px;border:0;background:transparent;box-shadow:none;display:flex;max-width:100%;flex-direction:column;align-items:center;gap:22px;color:var(--opening-gold);text-shadow:none}
.opening-cover-heart{width:38px;height:38px;fill:none;stroke:#937c70;stroke-width:1.3}
.opening-cover-title{display:block;max-width:100%;font-family:"Playfair Display",Georgia,serif;font-size:clamp(1.25rem,5.3vw,1.85rem);font-weight:600;line-height:1.28;overflow-wrap:anywhere}
.has-long-title .opening-cover-title{font-size:clamp(1rem,4vw,1.35rem);line-height:1.2}
.has-long-title .opening-cover-plate{gap:10px;padding:10px 8px}
.has-long-title .opening-cover-heart{width:28px;height:28px}
.opening-cover-rule{display:none}
.model-opening-album.is-opening .opening-closed-book{transition:none;transform:rotate(0)}
.model-opening-album.is-opening .opening-cover-turn{animation:opening-album-cover .82s cubic-bezier(.4,.08,.3,1) both}
.model-opening-album.is-opening .opening-cover-front::after{animation:opening-cover-light .82s ease both}
.model-opening-album.is-opening .opening-model-hint{animation:opening-caption-out .3s ease both}
@keyframes opening-album-cover{0%{transform:rotateY(0)}35%{transform:rotateY(-44deg) rotateZ(-.7deg) skewY(-.7deg)}75%{transform:rotateY(-132deg) rotateZ(-.5deg)}100%{transform:rotateY(-173deg)}}
@keyframes opening-cover-light{0%,100%{opacity:0}42%{opacity:.78}75%{opacity:.35}}
.model-opening-historia{gap:20px;--map-paper:#f0e8d6;--map-ink:#6d604c;--map-park:#d1d7bb;--map-water:#a4c6cc;--map-road:#fffaf0;--map-road-edge:#d7cbb4;--map-point:#8b3d52;--map-point:var(--wine)}
.opening-map-title{width:min(100%,620px);margin:0;color:var(--wine);font-family:"Playfair Display",Georgia,serif;font-size:clamp(1.8rem,6.5vw,3rem);font-weight:600;line-height:1.15;overflow-wrap:anywhere}
.opening-map-button{width:min(88vw,620px);border-radius:16px}
.opening-map-window{position:relative;display:block;width:100%;height:clamp(280px,54svh,460px);overflow:hidden;border:7px solid var(--paper);border-radius:15px;background:var(--map-paper);box-shadow:0 12px 30px rgba(var(--wine-rgb),.15),0 0 0 1px var(--line);isolation:isolate}
.opening-map-window::after{content:"";position:absolute;z-index:3;inset:0;pointer-events:none;box-shadow:inset 0 0 24px rgba(98,75,34,.12)}
.opening-map-paper{position:absolute;inset:0;display:block;transform-origin:58% 47%;background:var(--map-paper)}
.opening-map-drawing{width:100%;height:100%;display:block}
.map-ground{fill:var(--map-paper)}
.map-park{fill:var(--map-park);opacity:.8}
.map-river{fill:none;stroke:var(--map-water);stroke-width:53;stroke-linecap:round}
.map-road,.map-road-edge{fill:none;stroke-linecap:round;stroke-linejoin:round}
.map-road-edge{stroke:var(--map-road-edge);stroke-width:20}
.map-road{stroke:var(--map-road);stroke-width:15}
.map-contour{fill:none;stroke:var(--map-ink);stroke-width:1.2;opacity:.16}
.map-journey{fill:none;stroke:var(--map-point);stroke-width:3;stroke-linecap:round;stroke-dasharray:3 8;opacity:.7}
.map-stop{fill:var(--map-paper);stroke:var(--map-point);stroke-width:2}
.opening-map-pin{position:absolute;z-index:2;top:47%;left:58%;display:grid;width:54px;height:54px;place-items:center;border:3px solid var(--paper);border-radius:50% 50% 50% 7px;color:var(--button-ink);background:var(--map-point);box-shadow:0 5px 12px rgba(48,30,30,.23);transform:translate(-50%,-120%) rotate(-45deg)}
.opening-pin-heart{width:28px;height:28px;fill:currentColor;transform:rotate(45deg)}
.model-opening-historia.is-opening .opening-map-paper{animation:opening-map-enter 1.1s cubic-bezier(.48,.06,.4,1) both}
.model-opening-historia.is-opening .opening-map-pin{animation:opening-pin-out .45s ease both}
.model-opening-historia.is-opening .opening-map-title,.model-opening-historia.is-opening .opening-model-hint{animation:opening-caption-out .32s ease both}
@keyframes opening-map-enter{0%{transform:scale(1);opacity:1}60%{opacity:1}100%{transform:scale(18);opacity:0}}
@keyframes opening-pin-out{0%{opacity:1}100%{opacity:0;transform:translate(-50%,-130%) rotate(-45deg) scale(.85)}}
@keyframes opening-caption-out{to{opacity:0;transform:translateY(-4px)}}
[data-theme=medianoche] .model-opening-historia,[data-theme=galaxia] .model-opening-historia{--map-paper:#343442;--map-ink:#e4dbc4;--map-park:#424a46;--map-water:#3f627b;--map-road:#686475;--map-road-edge:#272736}
@media(max-width:360px){.model-opening{padding-left:12px;padding-right:12px;gap:20px}.opening-cover-front{padding:24px 20px 24px 27px}.opening-cover-plate{gap:18px}.opening-cover-title{font-size:1.2rem}.opening-model-hint{font-size:.92rem}.opening-map-window{height:clamp(270px,50svh,420px)}}
@media(prefers-reduced-motion:reduce){.opening-closed-book{transition:none}.model-opening.is-opening .opening-cover-turn,.model-opening.is-opening .opening-cover-front::after,.model-opening.is-opening .opening-map-paper,.model-opening.is-opening .opening-map-pin,.model-opening.is-opening .opening-map-title,.model-opening.is-opening .opening-model-hint{animation:none}.model-opening.is-opening{opacity:0;transition:opacity .15s ease}}
