.memory-dialog{position:fixed;inset:0;margin:auto;width:97vw;max-width:1700px;height:96dvh;max-height:96dvh;padding:18px 22px;border:2px solid #ecc572;border-radius:22px;background:radial-gradient(ellipse at top,#4b2b65,#1a1029 75%);color:#fff1c7;overflow:hidden}
.memory-dialog[open]{display:flex;flex-direction:column;gap:12px}
.memory-dialog::backdrop{background:#100719f2;backdrop-filter:blur(12px)}
.memory-heading{display:flex;justify-content:space-between;align-items:center;flex:none;width:100%;height:auto;max-width:none;padding:0 4px}
.memory-heading span{font-size:12px;letter-spacing:2px;color:#e9bd69;font-weight:800}
.memory-heading h2{font-size:34px;letter-spacing:-.5px;line-height:1.2;color:#fff0c3}
.memory-counter{color:#e9d8e8;font-size:19px}
.memory-media-stage{position:relative;min-height:0;flex:1;display:flex;align-items:center;justify-content:center;background:#10091b;border-radius:12px;overflow:hidden}
.memory-media-stage>img,.memory-media-stage>video{display:block;width:100%;height:100%;min-height:0;object-fit:contain;animation:memory-arrive .65s ease both}
.memory-load-note,.memory-play-video{position:absolute;bottom:20px;max-width:90%;padding:14px 22px;border-radius:24px;background:#f4c563;color:#2e194d;font-size:20px;font-weight:700;text-align:center}
.memory-progress{flex:none;height:4px;border-radius:5px;overflow:hidden;background:#ffffff24}
.memory-progress i{display:block;width:0;height:100%;background:#f4c563}
.memory-controls{display:flex;gap:12px;align-items:center;flex:none;height:auto;min-height:0;padding:0;margin:0;max-width:none;width:100%;border:0}
.memory-controls p{font-size:15px;line-height:1.3;color:#dfcde8;flex:1}
.memory-controls button{flex:none;padding:10px 19px;border-radius:30px;border:1px solid #edcc83;background:#ffffff0d;color:#ffedbe;font-size:18px;font-weight:700}
.memory-controls button:focus-visible,.memory-play-video:focus-visible{outline:3px solid white;outline-offset:3px}
.memory-controls .memory-continue{background:#f4c563;color:#2e194d}
.memory-preview-button{margin:12px auto 0}
@keyframes memory-progress{to{width:100%}}
@keyframes memory-arrive{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:700px){.memory-dialog{padding:13px;gap:8px}.memory-heading h2{font-size:27px}.memory-counter{font-size:15px}.memory-controls{flex-wrap:wrap;gap:8px}.memory-controls p{flex-basis:100%;order:2;font-size:12px}.memory-controls button{font-size:15px;padding:8px 13px}}
@media(prefers-reduced-motion:reduce){.memory-media-stage>img,.memory-media-stage>video{animation:none}}

.memory-intro{position:absolute;inset:0;display:grid;place-items:center;isolation:isolate;background:radial-gradient(ellipse at center,#6c467d,#3e2459 60%,#241638);overflow:hidden}
.memory-intro:before{content:'';position:absolute;width:420px;height:420px;border:1px solid #f3d09850;border-radius:50%;box-shadow:0 0 0 34px #ffe3b308,0 0 0 70px #ffe3b306;z-index:-1;animation:memory-halo 3s ease-out both}
.memory-intro-copy{text-align:center;z-index:2;animation:memory-title-pop .9s cubic-bezier(.2,1.3,.4,1) both}
.memory-intro-copy>p:first-child{font-size:13px;font-weight:800;letter-spacing:3px;color:#efc9ab}
.memory-intro-copy h3{font-family:Georgia,serif;color:#fff0cf;font-size:clamp(65px,8vw,120px);font-weight:400;line-height:.95;letter-spacing:-3px;margin:18px 0 4px;text-shadow:0 4px 0 #2c173944}
.memory-intro-copy h3 em{font-size:1.1em;color:#f4c563;font-weight:400}
.memory-intro-heart{display:inline-block;color:#f3b8cd;font-size:42px;line-height:1.2;animation:memory-heart 1.4s ease-in-out infinite}
.memory-intro-copy p.memory-intro-subtitle{color:#f8e2ef;font-size:21px;font-style:italic;margin-top:4px}
.memory-paper{position:absolute;width:clamp(120px,19vw,260px);height:clamp(155px,24vw,320px);padding:15px 15px 45px;background:#fff2dc;box-shadow:0 15px 35px #10071955;border-radius:4px;top:22%;display:grid;place-items:center;animation:memory-card-swing 1s ease-out both}
.memory-paper:before{content:'';position:absolute;top:-12px;left:35%;width:30%;height:28px;background:#f1c67a99;transform:rotate(-7deg)}
.memory-paper span{display:grid;place-items:center;background:#d5b4c9;color:#a46d96;width:100%;height:100%;font-size:90px}
.paper-left{left:9%;transform:rotate(-13deg)}.paper-right{right:9%;transform:rotate(13deg);animation-delay:.16s}.paper-right span{background:#b9d8d1;color:#5c9e94}
.memory-spark{position:absolute;font-size:46px;color:#f6d58d;animation:memory-twinkle 1.6s ease-in-out infinite alternate}
.spark-one{top:11%;left:24%}.spark-two{bottom:12%;left:16%;color:#f0a8c7;animation-delay:.4s}.spark-three{top:13%;right:22%;animation-delay:.8s}.spark-four{bottom:12%;right:17%;color:#d8bfdc;animation-delay:1.1s}
@keyframes memory-title-pop{from{opacity:0;transform:translateY(20px) scale(.8)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes memory-card-swing{from{opacity:0;translate:0 70px}to{opacity:1;translate:0 0}}
@keyframes memory-heart{50%{transform:scale(1.15)}}
@keyframes memory-twinkle{from{opacity:.4;scale:.8}to{opacity:1;scale:1.15}}
@keyframes memory-halo{from{opacity:0;scale:.65}to{opacity:1;scale:1}}
@media(max-width:700px){.memory-paper{opacity:.45;top:28%}.paper-left{left:-5%}.paper-right{right:-5%}.memory-intro-copy h3{font-size:75px}.memory-intro-copy p.memory-intro-subtitle{font-size:17px}.memory-intro-copy>p:first-child{font-size:10px;letter-spacing:2px}}
@media(prefers-reduced-motion:reduce){.memory-intro *,.memory-intro:before{animation:none}}
