/* Hiệu ứng cao cấp cho thiệp trả phí (premium.js) */
.pm { --px: 0; --py: 0; }
.pm-cv { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pm-confetti { z-index: 9; }
.pm-dust { z-index: 6; mix-blend-mode: screen; }

/* hologram: dải cầu vồng chạy theo góc nhìn + tự quét nhẹ */
.pm-holo { position: absolute; inset: -20%; z-index: 6; pointer-events: none; mix-blend-mode: soft-light; opacity: .55;
  background: linear-gradient(115deg, transparent 20%, rgba(255, 0, 170, .55) 32%, rgba(255, 230, 0, .5) 40%, rgba(0, 255, 200, .5) 48%, rgba(80, 120, 255, .55) 56%, transparent 68%);
  background-size: 260% 260%; background-position: calc(50% + var(--px) * 120%) calc(50% + var(--py) * 120%); transition: background-position .25s ease-out; animation: pm-holo 7s ease-in-out infinite alternate; }
@keyframes pm-holo { from { translate: -6% -4%; } to { translate: 6% 4%; } }

/* ánh sáng điện ảnh */
.pm-leak { position: absolute; inset: 0; z-index: 6; pointer-events: none; mix-blend-mode: screen; overflow: hidden; }
.pm-leak i { position: absolute; width: 70cqmax; height: 50cqmax; border-radius: 50%; filter: blur(10cqmin); opacity: .32; }
.pm-leak i:nth-child(1) { left: -40%; top: -10%; background: radial-gradient(circle, #ffb36b, #ff5e62 60%, transparent 70%); animation: pm-leak 14s ease-in-out infinite; }
.pm-leak i:nth-child(2) { right: -40%; bottom: -20%; background: radial-gradient(circle, #ffe29f, #ffa99f 55%, transparent 70%); animation: pm-leak 18s -7s ease-in-out infinite reverse; }
@keyframes pm-leak { 0%, 100% { transform: translate(0, 0) scale(1); opacity: .12; } 50% { transform: translate(55cqw, 18cqh) scale(1.25); opacity: .4; } }

/* hạt phim + viền tối */
.pm-grain { position: absolute; inset: -50%; z-index: 7; pointer-events: none; opacity: .14; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: pm-grain .9s steps(5) infinite; }
.pm:has(.pm-grain)::after { content: ''; position: absolute; inset: 0; z-index: 7; pointer-events: none; background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .38) 100%); }
@keyframes pm-grain { 20% { translate: -8% 4%; } 40% { translate: 6% -6%; } 60% { translate: -4% 8%; } 80% { translate: 8% 2%; } }

/* chiều sâu 3D: nội dung và nền dịch ngược chiều nhau */
.pm-parallax .pl, .pm-parallax .ak, .pm-parallax .cs-tilt { translate: calc(var(--px) * -14px) calc(var(--py) * -14px); transition: translate .3s ease-out; }
.pm-parallax .cs-bg, .pm-parallax .cs-glow, .pm-parallax .cs-stars, .pm-parallax .cs-particles { translate: calc(var(--px) * 22px) calc(var(--py) * 22px); transition: translate .4s ease-out; }

/* vệt sao theo ngón tay */
.pm-spark { position: absolute; z-index: 8; pointer-events: none; transform: translate(-50%, -50%); text-shadow: 0 0 6px currentColor; animation: pm-spark .9s ease-out forwards; }
@keyframes pm-spark { to { transform: translate(calc(-50% + var(--dx)), 20px) scale(.2) rotate(120deg); opacity: 0; } }

/* mở đầu kiểu trailer */
.pm-cinema { position: absolute; inset: 0; z-index: 12; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2cqmin; padding: 6cqmin; text-align: center; color: #fff; background: rgba(0, 0, 0, .9); pointer-events: none; transition: background 1s ease; }
.pm-cinema.fs { position: fixed; z-index: 60; }
.pm-cinema.fs .pm-c1 { font-size: max(11px, 2.4vmin); }
.pm-cinema.fs .pm-c2 { font-size: clamp(34px, 9vmin, 72px); text-shadow: 0 0 4vmin color-mix(in srgb, var(--accent2) 60%, transparent); }
.pm-cinema .bar { position: absolute; left: 0; right: 0; height: 13%; background: #000; transition: transform 1s cubic-bezier(.6, 0, .3, 1); }
.pm-cinema .bar.t { top: 0; } .pm-cinema .bar.b { bottom: 0; }
.pm-c1 { margin: 0; font: 600 max(11px, 2.4cqmin) 'Be Vietnam Pro', system-ui, sans-serif; letter-spacing: .4em; text-transform: uppercase; opacity: 0; animation: pm-fade 1.6s .2s ease forwards; }
.pm-c2 { margin: 0; font-family: var(--tf); font-weight: 400; font-size: 8cqmin; line-height: 1.15; opacity: 0; transform: scale(1.15); animation: pm-title 2s 1.4s ease forwards; text-shadow: 0 0 4cqmin color-mix(in srgb, var(--accent2) 60%, transparent); }
@keyframes pm-fade { 0% { opacity: 0; } 30%, 70% { opacity: 1; } 100% { opacity: 0; } }
@keyframes pm-title { to { opacity: 1; transform: scale(1); } }
.pm-cinema.out { background: transparent; }
.pm-cinema.out .bar.t { transform: translateY(-100%); } .pm-cinema.out .bar.b { transform: translateY(100%); }
.pm-cinema.out .pm-c2 { opacity: 0; transition: opacity .6s; animation: none; }

/* nút & màn đoạn kết */
.pm-finale-btn { position: absolute; z-index: 11; right: 3cqmin; top: 3cqmin; display: inline-flex; align-items: center; gap: .5em; padding: .6em 1.1em; border: 1px solid rgba(255, 255, 255, .5); border-radius: 999px; background: rgba(0, 0, 0, .45); color: #fff; font: 700 max(11px, 2.2cqmin) 'Be Vietnam Pro', system-ui, sans-serif; cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; transform: translateY(-1em); pointer-events: none; transition: all .6s cubic-bezier(.3, 1.4, .5, 1); }
.pm-finale-btn.in { opacity: 1; transform: none; pointer-events: auto; }
.pm-finale-btn .dot { width: .6em; height: .6em; border-radius: 50%; background: #ff3b3b; box-shadow: 0 0 0 0 rgba(255, 59, 59, .7); animation: pm-rec 1.4s infinite; }
@keyframes pm-rec { 70% { box-shadow: 0 0 0 .5em rgba(255, 59, 59, 0); } }
.pm-finale { position: absolute; inset: 0; z-index: 13; overflow: hidden; background: #000; opacity: 0; transition: opacity .6s; }
.pm-finale.on { opacity: 1; }
.pm-reel { position: absolute; inset: 0; display: grid; place-items: center; }
.pm-reel i { position: absolute; inset: -6%; background: center / cover; opacity: 0; transform: scale(1.14); transition: opacity 1.2s ease, transform 4.5s ease-out; }
.pm-reel i.on { opacity: 1; transform: scale(1); }
.pm-reel-emo { font-size: 30cqmin; opacity: .5; animation: pm-title 2s ease forwards; }
.pm-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, .2) 35%, rgba(0, 0, 0, .6)); }
.pm-credits { position: absolute; left: 50%; top: 100%; width: min(90cqw, 520px); transform: translateX(-50%); text-align: center; color: #fff; animation: pm-roll 15s linear forwards; text-shadow: 0 .1em .4em rgba(0, 0, 0, .6); }
@keyframes pm-roll { to { top: 0; transform: translate(-50%, -100%); } }
.pm-finale.ended .pm-credits { animation: none; top: 50%; transform: translate(-50%, -50%); }
.pm-finale.ended .pm-credits > :not(.c-e) { display: none; }
.pm-credits .sp { height: 6cqh; }
.pm-credits .c-h { margin: 0; font-family: var(--tf); font-weight: 400; font-size: 7cqmin; line-height: 1.15; }
.pm-credits .c-k { margin: 2.6cqh 0 0; font: 600 max(10px, 1.9cqmin) 'Be Vietnam Pro', system-ui, sans-serif; letter-spacing: .3em; text-transform: uppercase; opacity: .7; }
.pm-credits .c-v { margin: .4em 0 0; font: 700 max(14px, 3.4cqmin) 'Be Vietnam Pro', system-ui, sans-serif; }
.pm-credits .c-m { margin: 0; font-family: var(--bf); font-style: italic; font-size: max(13px, 3cqmin); line-height: 1.6; white-space: pre-line; }
.pm-credits .c-e { margin: 0; font-family: var(--tf); font-size: 10cqmin; color: var(--accent2); }
.pm-finale.ended .c-e { animation: pm-title 1.6s ease both; }
.pm-close, .pm-again { position: absolute; z-index: 3; border: 0; cursor: pointer; color: #fff; background: rgba(255, 255, 255, .15); backdrop-filter: blur(6px); font: 700 max(12px, 2.2cqmin) 'Be Vietnam Pro', system-ui, sans-serif; }
.pm-close { top: 3cqmin; right: 3cqmin; width: 2.4em; height: 2.4em; border-radius: 50%; font-size: max(16px, 3cqmin); }
.pm-again { bottom: 4cqh; left: 50%; transform: translateX(-50%); padding: .6em 1.2em; border-radius: 999px; opacity: 0; transition: opacity .6s; }
.pm-finale.ended .pm-again { opacity: 1; }
.pm-fw { z-index: 2; }

@media (prefers-reduced-motion: reduce) { .pm-holo, .pm-grain { animation: none; } .pm-credits { animation-duration: 40s; } }
