:root {
    --bg-1: #09060b;
    --rose: #f7aec7;
    --rose-strong: #ff86b7;
    --blush: #f4d8df;
    --off-white: #f5edf0;
    --text-soft: #d6c5cc;
    --text-muted: #bca9b2;
    --page-width: min(92vw, 430px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: var(--bg-1);
    color: var(--off-white);
    font-family: "Poppins", sans-serif;
    overflow: hidden;
    letter-spacing: 0.01em;
}

button,
input,
textarea {
    font: inherit;
}

img,
video {
    max-width: 100%;
    display: block;
}

.background {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 15% 15%, rgba(246, 120, 176, 0.22), transparent 28%),
        radial-gradient(circle at 75% 12%, rgba(129, 88, 168, 0.22), transparent 25%),
        radial-gradient(circle at 55% 70%, rgba(143, 43, 82, 0.22), transparent 32%),
        linear-gradient(160deg, var(--bg-1), #110a10 48%, #0d0709 100%);
    z-index: -6;
}

.background::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, 0.18) 0 1.2px, transparent 1.6px),
        radial-gradient(circle, rgba(255, 214, 232, 0.15) 0 1.1px, transparent 1.5px);
    background-size: 140px 140px, 100px 100px;
    background-position: 0 0, 32px 22px;
    opacity: 0.9;
}

.grain {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.02)),
        radial-gradient(circle, rgba(255, 255, 255, 0.1) 0.7px, transparent 0.7px);
    background-size: 100% 100%, 16px 16px;
    opacity: 0.2;
    mix-blend-mode: screen;
}

.space-field {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -4;
}

.star {
    position: absolute;
    display: block;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8), 0 0 16px rgba(255, 192, 221, 0.7);
    opacity: 0;
    animation: twinkle var(--duration, 3s) ease-in-out infinite alternate;
    animation-delay: var(--delay, 0s);
}

.star:nth-child(odd) {
    background: rgba(255, 220, 235, 1);
    box-shadow: 0 0 10px rgba(255, 205, 232, 0.85), 0 0 18px rgba(255, 255, 255, 0.8);
}

.star:nth-child(3n) {
    width: 2px;
    height: 2px;
}


.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.25;
    pointer-events: none;
    animation: drift 12s ease-in-out infinite alternate;
}

.orb-1 {
    width: 260px;
    height: 260px;
    background: rgba(250, 122, 180, 0.5);
    top: 8%;
    left: -40px;
}

.orb-2 {
    width: 200px;
    height: 200px;
    background: rgba(141, 101, 245, 0.35);
    bottom: 12%;
    right: -20px;
    animation-delay: 3s;
}

.orb-3 {
    width: 180px;
    height: 180px;
    background: rgba(178, 74, 116, 0.28);
    left: 20%;
    bottom: 8%;
    animation-delay: 5s;
}

@keyframes drift {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    100% {
        transform: translate3d(18px, -18px, 0) scale(1.08);
    }
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.15;
        transform: scale(0.7);
    }

    25% {
        opacity: 0.9;
        transform: scale(1.15);
    }

    50% {
        opacity: 0.45;
        transform: scale(0.9);
    }

    75% {
        opacity: 1;
        transform: scale(1.3);
    }
}


#floatingParticles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.spark,
.heart-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: rise linear forwards;
}

.spark {
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}

.heart-particle {
    color: rgba(255, 137, 186, 0.9);
    font-size: 13px;
    opacity: 0.9;
}

@keyframes rise {
    0% {
        opacity: 0;
        transform: translate3d(0, 0, 0) scale(0.5);
    }

    18% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate3d(var(--x), calc(var(--y) * -1), 0) scale(1.2);
    }
}

.app-shell {
    position: relative;
    z-index: 1;
}

.screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 16px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(18px) scale(0.985);
    transition: opacity 0.7s ease, transform 0.7s ease, visibility 0.7s ease;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.app-shell,
#floatingParticles,
#globalMuteButton {
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

body:not(.is-unlocked) .app-shell,
body:not(.is-unlocked) #floatingParticles,
body:not(.is-unlocked) #globalMuteButton {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.password-screen {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 16px;
}

.password-screen.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

.password-panel {
    width: var(--page-width);
}

.password-copy {
    color: var(--text-soft);
    font-size: 0.95rem;
    line-height: 1.8;
    position: relative;
    z-index: 1;
}

.password-form {
    position: relative;
    z-index: 1;
}

.password-input {
    width: 100%;
    min-height: 52px;
    margin-top: 20px;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(255, 166, 200, 0.35);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--off-white);
    text-align: center;
    letter-spacing: 0.18em;
    outline: none;
}

.password-input:focus {
    border-color: var(--rose);
    box-shadow: 0 0 0 3px rgba(247, 174, 199, 0.12);
}

.password-form .primary-button {
    margin-top: 14px;
}

.password-error {
    min-height: 1.5em;
    margin-top: 12px;
    color: var(--rose-strong);
    font-size: 0.82rem;
}

.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;
}

.panel {
    width: var(--page-width);
    max-width: 440px;
    background: rgba(18, 10, 16, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 32px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    padding: 38px 24px 30px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.eyebrow {
    color: var(--rose);
    letter-spacing: 0.24em;
    text-transform: uppercase;
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 10px;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

h1,
h2,
h3 {
    font-family: "Cormorant Garamond", serif;
    font-weight: 600;
    line-height: 0.96;
    position: relative;
    z-index: 1;
}

h1 {
    font-size: clamp(3rem, 10vw, 5.1rem);
    letter-spacing: -0.04em;
    color: var(--off-white);
    text-align: center;
    margin: 0 auto;
}

h1 span {
    display: block;
    color: var(--rose-strong);
    font-style: italic;
    text-align: center;
}

.divider {
    color: rgba(255, 153, 192, 0.8);
    font-size: 1.9rem;
    letter-spacing: 0.3em;
    margin: 18px 0 12px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.lead-copy {
    color: var(--text-soft);
    font-size: 0.95rem;
    line-height: 1.8;
    position: relative;
    z-index: 1;
    margin-bottom: 12px;
}

.primary-button,
.secondary-button,
.audio-button,
.text-button,
.story-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
}

.primary-button,
.secondary-button,
.audio-button {
    appearance: none;
    border: 1px solid rgba(255, 166, 200, 0.45);
    background: rgba(255, 132, 180, 0.12);
    color: var(--off-white);
    border-radius: 999px;
    padding: 0.9rem 1.35rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    cursor: pointer;
    min-height: 52px;
    box-shadow: 0 18px 40px rgba(168, 82, 116, 0.12);
}

.primary-button:hover,
.secondary-button:hover,
.audio-button:hover,
.story-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 162, 200, 0.7);
    box-shadow: 0 18px 28px rgba(0, 0, 0, 0.16);
}

.primary-button {
    margin-top: 22px;
    width: 100%;
    max-width: 220px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.loading-screen {
    background: rgba(14, 10, 12, 0.45);
}

.loading-card {
    width: min(88vw, 360px);
    text-align: center;
    padding: 24px 18px;
}

.loading-word {
    opacity: 0;
    transform: translateY(20px);
    color: var(--off-white);
    font-size: clamp(1.75rem, 7vw, 2.7rem);
    font-family: "Cormorant Garamond", serif;
    letter-spacing: 0.02em;
    text-shadow: 0 18px 28px rgba(0, 0, 0, 0.3);
}

.loading-word-sub {
    margin-top: 12px;
    color: var(--rose);
}

.loading-word.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.delay-1 {
    transition-delay: 0.8s;
}

.music-panel,
.story-panel,
.memories-panel,
.letter-panel,
.time-panel,
.present-panel,
.surprise-panel,
.voice-panel {
    padding-top: 36px;
}

.music-panel h2,
.story-panel h2,
.section-heading {
    font-size: clamp(2.2rem, 8vw, 3.5rem);
    color: var(--off-white);
    margin-bottom: 18px;
    line-height: 1.1;
}

.story-title {
    font-size: clamp(2.1rem, 7vw, 3.2rem);
    font-family: "Cormorant Garamond", serif;
    font-weight: 600;
    color: var(--off-white);
    line-height: 1.1;
    margin-top: 4px;
    margin-bottom: 24px;
}

.track-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--blush);
    font-size: 1.1rem;
    line-height: 1.5;
    margin: 10px auto 18px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.track-name {
    font-size: 1.8rem;
    font-family: "Cormorant Garamond", serif;
    color: var(--rose);
}

.track-artist {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.audio-visual {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 0 auto 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vinyl-wrap {
    position: relative;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.35), 0 0 25px rgba(255, 150, 185, 0.08);
    overflow: visible;
}

.vinyl-spin {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        repeating-radial-gradient(circle at center, #0b0b0d 0px, #0b0b0d 3px, #19171a 3px, #19171a 4px, #0c0c0e 4px, #0c0c0e 7px);
    border: 2px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.025), inset 0 0 20px rgba(0, 0, 0, 0.8), 0 10px 25px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.vinyl-spin::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.10), transparent 22%, transparent 65%, rgba(255, 255, 255, 0.035));
    pointer-events: none;
}

.vinyl-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #f2a4c2, #d35b87);
    color: white;
    font-size: 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.025), 0 4px 12px rgba(0, 0, 0, 0.35);
    z-index: 5;
}

.music-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 4;
}

.music-particles .particle {
    position: absolute;
    display: block;
    left: var(--particle-left);
    top: var(--particle-top);
    width: var(--particle-size);
    height: var(--particle-size);
    color: var(--particle-color);
    opacity: 0;
    transform: translate(0, 0) scale(0.7);
    will-change: opacity, transform;
}

.music-particles .particle-dot {
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 7px currentColor;
}

.music-particles .particle-note {
    width: auto;
    height: auto;
    font-family: "Cormorant Garamond", serif;
    font-size: var(--particle-size);
    line-height: 0.8;
    text-shadow: 0 0 8px currentColor;
}

.audio-visual.playing .music-particles {
    opacity: 1;
}

.audio-visual.playing .music-particles .particle {
    animation: musicParticle 3.8s ease-in-out infinite;
    animation-delay: var(--particle-delay);
}

.music-particles .particle:nth-child(1) {
    --particle-left: 12%;
    --particle-top: 34%;
    --particle-size: 6px;
    --particle-color: #e99ab9;
    --particle-delay: 0s;
    --drift-x: -5px;
    --drift-y: -13px;
}

.music-particles .particle:nth-child(2) {
    --particle-left: 26%;
    --particle-top: 13%;
    --particle-size: 22px;
    --particle-color: #d8a8c3;
    --particle-delay: 1.1s;
    --drift-x: -8px;
    --drift-y: -11px;
}

.music-particles .particle:nth-child(3) {
    --particle-left: 71%;
    --particle-top: 12%;
    --particle-size: 5px;
    --particle-color: #cda8d6;
    --particle-delay: 2.2s;
    --drift-x: 7px;
    --drift-y: -13px;
}

.music-particles .particle:nth-child(4) {
    --particle-left: 87%;
    --particle-top: 37%;
    --particle-size: 23px;
    --particle-color: #e4a5c0;
    --particle-delay: 0.6s;
    --drift-x: 9px;
    --drift-y: -7px;
}

.music-particles .particle:nth-child(5) {
    --particle-left: 81%;
    --particle-top: 68%;
    --particle-size: 6px;
    --particle-color: #b995c8;
    --particle-delay: 1.7s;
    --drift-x: 8px;
    --drift-y: 10px;
}

.music-particles .particle:nth-child(6) {
    --particle-left: 58%;
    --particle-top: 88%;
    --particle-size: 21px;
    --particle-color: #e99ab9;
    --particle-delay: 2.8s;
    --drift-x: 5px;
    --drift-y: 10px;
}

.music-particles .particle:nth-child(7) {
    --particle-left: 20%;
    --particle-top: 76%;
    --particle-size: 5px;
    --particle-color: #cda8d6;
    --particle-delay: 0.25s;
    --drift-x: -7px;
    --drift-y: 9px;
}

.music-particles .particle:nth-child(8) {
    --particle-left: 8%;
    --particle-top: 58%;
    --particle-size: 22px;
    --particle-color: #d8a8c3;
    --particle-delay: 2.1s;
    --drift-x: -8px;
    --drift-y: 6px;
}

@keyframes musicParticle {
    0%, 100% {
        opacity: 0;
        transform: translate(0, 0) scale(0.7);
    }

    28% {
        opacity: 0.8;
    }

    72% {
        opacity: 0.45;
        transform: translate(var(--drift-x), var(--drift-y)) scale(1);
    }
}

.audio-visual.playing .vinyl-spin {
    animation: vinylRotation 6s linear infinite;
}

@keyframes vinylRotation {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.equalizer {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: flex-end;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
    height: 22px;
}

.audio-visual.playing .equalizer {
    opacity: 1;
}

.equalizer span {
    width: 4px;
    border-radius: 999px;
    background: #e99ab9;
    animation: vinylEqualizer 0.8s ease-in-out infinite alternate;
    height: 6px;
}

.equalizer span:nth-child(1) {
    animation-delay: 0.1s;
}

.equalizer span:nth-child(2) {
    animation-delay: 0.25s;
}

.equalizer span:nth-child(3) {
    animation-delay: 0.4s;
}

.equalizer span:nth-child(4) {
    animation-delay: 0.55s;
}

.equalizer span:nth-child(5) {
    animation-delay: 0.7s;
}

@keyframes vinylEqualizer {
    from {
        height: 5px;
    }

    to {
        height: 19px;
    }
}

@media (max-width: 600px) {
    .audio-visual {
        width: 205px;
        height: 205px;
    }

    .vinyl-wrap {
        width: 175px;
        height: 175px;
    }

    .vinyl-center {
        width: 54px;
        height: 54px;
    }
}

.music-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.audio-button {
    min-width: 120px;
}

.secondary-button {
    min-width: 150px;
    opacity: 0.55;
    pointer-events: none;
}

.secondary-button.enabled {
    opacity: 1;
    pointer-events: auto;
}

.music-status {
    margin-top: 16px;
    color: var(--text-muted);
    text-align: center;
    font-size: 0.82rem;
    min-height: 18px;
    position: relative;
    z-index: 1;
}

.back-button {
    position: absolute;
    top: 20px;
    left: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--rose);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    padding: 6px 14px;
    z-index: 10;
    transition: all 0.25s ease;
    backdrop-filter: blur(8px);
}

.back-button:hover {
    background: rgba(255, 166, 200, 0.18);
    border-color: rgba(255, 166, 200, 0.45);
    color: var(--off-white);
    transform: translateX(-3px);
}

.text-button {
    color: var(--text-soft);
}

.story-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 6px;
    position: relative;
    z-index: 1;
}

.story-card {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    text-align: left;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 64px;
    color: var(--off-white);
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.story-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 166, 200, 0.45);
    background: linear-gradient(135deg, rgba(255, 137, 186, 0.14) 0%, rgba(255, 255, 255, 0.04) 100%);
    box-shadow: 0 12px 28px rgba(217, 93, 136, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.card-number {
    font-family: "Cormorant Garamond", serif;
    color: var(--rose-strong);
    font-size: 2.1rem;
    line-height: 1;
    font-weight: 700;
    min-width: 38px;
    display: flex;
    align-items: center;
    letter-spacing: -0.02em;
}

.card-label {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--off-white);
    line-height: 1.35;
    flex: 1;
    letter-spacing: 0.01em;
}

.card-arrow {
    color: var(--rose);
    font-size: 1.25rem;
    opacity: 0.7;
    transition: transform 0.25s ease, opacity 0.25s ease, color 0.25s ease;
}

.story-card:hover .card-arrow {
    opacity: 1;
    color: var(--rose-strong);
    transform: translateX(4px);
}

@keyframes photoEnter {
    0% {
        opacity: 0;
        transform: scale(1.12);
    }

    100% {
        opacity: 1;
        transform: scale(1.02);
    }
}

.letter-panel {
    overflow: hidden;
    max-height: 92vh;
}

.letter-story {
    max-height: 58vh;
    overflow-y: auto;
    padding-right: 6px;
    position: relative;
    z-index: 1;
    scrollbar-width: thin;
}

.letter-story p {
    color: var(--text-soft);
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(1.2rem, 4.8vw, 1.7rem);
    line-height: 1.7;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.letter-story p.visible {
    opacity: 1;
    transform: translateY(0);
}

.final-letter-line {
    color: var(--rose) !important;
    text-align: center;
    margin-top: 12px;
}

/* ══════════════════════════════════════════════
   GIFT STAGE
══════════════════════════════════════════════ */
.gift-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    margin-top: 18px;
    position: relative;
    z-index: 1;
}

/* ══════════════════════════════════════════════
   GIFT BOX — Ultra-Realistic 3D Render
══════════════════════════════════════════════ */

/* Clickable wrapper */
.gift-3d-wrap {
    display: inline-block;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative;
    width: 240px;
    height: 240px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s ease;
    animation: floatBox 4s ease-in-out infinite alternate;
}

.gift-3d-wrap:hover {
    transform: translateY(-8px) scale(1.04);
}

.gift-3d-wrap:active {
    transform: scale(0.98);
}

.gift-box-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    -webkit-user-drag: none;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.6)) drop-shadow(0 4px 12px rgba(255, 120, 180, 0.25));
    transition: transform 0.5s ease, opacity 0.5s ease;
}

@keyframes floatBox {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-8px);
    }
}

/* Shake Animation */
@keyframes giftShake {

    0%,
    100% {
        transform: rotate(0deg) scale(1);
    }

    20% {
        transform: rotate(-6deg) scale(1.05);
    }

    50% {
        transform: rotate(7deg) scale(1.07);
    }

    80% {
        transform: rotate(-5deg) scale(1.05);
    }
}

.gift-3d-wrap.shake,
#giftBox.shake {
    animation: giftShake 0.45s ease-in-out 2;
}

/* Open Animation */
#giftBox.open {
    animation: none;
    transform: translateY(-10px) scale(0.96);
    filter: drop-shadow(0 28px 36px rgba(0, 0, 0, 0.7));
}







@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.gift-hint {
    margin-top: 18px;
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

@keyframes heartBeat {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.18);
    }
}

body.gift-open .screen:not(#surprise) {
    filter: brightness(0.7) saturate(0.9);
    transition: filter 0.35s ease;
}

body.gift-open .screen#surprise {
    background: rgba(9, 7, 10, 0.18);
}

/* ══════════════════════════════════════════════
   PRESENT REVEAL PAGE
══════════════════════════════════════════════ */
.present-panel {
    padding-top: 48px;
    text-align: center;
    max-height: 92vh;
    overflow-y: auto;
    scrollbar-width: thin;
}

.present-card {
    margin: 14px auto 8px;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.present-img-frame {
    position: relative;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(18, 10, 16, 0.6);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 25px rgba(255, 134, 183, 0.2);
    animation: presentCardPop 0.7s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.present-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.present-img-frame:hover .present-img {
    transform: scale(1.03);
}

@keyframes presentCardPop {
    0% {
        transform: scale(0.92) translateY(16px);
        opacity: 0;
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.present-content {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 16px 18px;
    width: 100%;
    max-width: 320px;
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.present-tagline {
    color: var(--rose-strong);
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(1.4rem, 4.5vw, 1.8rem);
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0.01em;
    margin: 0;
    text-shadow: 0 2px 12px rgba(255, 134, 183, 0.25);
}


@media (max-width: 420px) {
    .panel {
        padding-left: 18px;
        padding-right: 18px;
    }

    .track-banner {
        flex-direction: column;
        gap: 2px;
    }

    .story-grid {
        gap: 10px;
    }

    .voice-stage {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .character-frame video {
        aspect-ratio: 16 / 10;
    }

    .floating-mute-btn {
        top: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
    }
}

/* Persistent Global Floating Mute Button */
.floating-mute-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(18, 10, 16, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    color: var(--rose);
    display: grid;
    place-items: center;
    cursor: pointer;
    z-index: 999;
    transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
    padding: 0;
    outline: none;
}

.floating-mute-btn:hover {
    transform: scale(1.08);
    background: rgba(30, 16, 26, 0.85);
    border-color: rgba(255, 166, 200, 0.5);
    color: var(--rose-strong);
    box-shadow: 0 0 20px rgba(255, 134, 183, 0.35), 0 8px 24px rgba(0, 0, 0, 0.45);
}

.floating-mute-btn:active {
    transform: scale(0.95);
}

.mute-icon {
    width: 20px;
    height: 20px;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.floating-mute-btn .sound-off {
    display: none;
}

.floating-mute-btn .sound-on {
    display: block;
}

.floating-mute-btn.is-muted {
    color: var(--text-muted);
    border-color: rgba(255, 255, 255, 0.1);
}

.floating-mute-btn.is-muted .sound-on {
    display: none;
}

.floating-mute-btn.is-muted .sound-off {
    display: block;
    color: #e57373;
}

/* "Our Time Together" Counter Component */
.time-together-container {
    margin: 0 0 20px;
    padding: 18px 14px 16px;
    background: rgba(20, 15, 25, 0.45);
    border: 1px solid rgba(255, 107, 129, 0.22);
    border-radius: 24px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
    text-align: center;
}

.time-heart {
    margin: -4px 0 12px;
    color: var(--rose);
    font-family: "Cormorant Garamond", serif;
    font-size: 1.6rem;
    line-height: 1;
    text-shadow: 0 0 8px rgba(247, 174, 199, 0.22);
    animation: timeHeartPulse 3.6s ease-in-out infinite;
}

@keyframes timeHeartPulse {
    0%, 78%, 100% {
        opacity: 0.72;
        transform: scale(1);
    }

    88% {
        opacity: 1;
        transform: scale(1.08);
    }
}

.time-counter-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 6px;
    margin: 0 auto;
}

.time-separator {
    align-self: center;
    justify-self: center;
    color: var(--rose);
    font-size: 0.9rem;
    line-height: 1;
    text-shadow: 0 0 7px rgba(247, 174, 199, 0.24);
}

.time-card {
    background: rgba(20, 15, 25, 0.6);
    border: 1px solid rgba(255, 107, 129, 0.25);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-height: 82px;
    padding: 12px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.time-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 107, 129, 0.55);
    box-shadow: 0 0 18px rgba(255, 107, 129, 0.35), 0 8px 20px rgba(0, 0, 0, 0.3);
}

.time-number {
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(1.35rem, 4.5vw, 1.9rem);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.1;
    text-shadow: 0 0 10px rgba(255, 107, 129, 0.6), 0 0 20px rgba(255, 134, 183, 0.3);
}

.time-label {
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ff6b81;
    margin-top: 4px;
    white-space: nowrap;
}

.time-panel .section-heading {
    font-size: clamp(1.75rem, 7vw, 2.8rem);
    margin-bottom: 8px;
    white-space: nowrap;
}

.time-panel {
    padding-top: 68px;
}

.time-together-subtext {
    font-family: "Cormorant Garamond", serif;
    font-style: italic;
    font-size: 0.88rem;
    color: var(--text-soft);
    margin-top: 14px;
    letter-spacing: 0.02em;
    opacity: 0.9;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.voice-panel {
    width: min(94vw, 780px);
    background: #000;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 1px, transparent 1.5px),
        radial-gradient(circle, rgba(255, 255, 255, 0.55) 0 1px, transparent 1.5px);
    background-size: 86px 86px, 137px 137px;
    background-position: 8px 16px, 48px 62px;
}

.voice-stage {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(190px, 0.85fr);
    align-items: center;
    gap: 24px;
    margin-top: 10px;
    position: relative;
    z-index: 1;
}

.time-since {
    margin: 0 0 18px;
    color: var(--text-soft);
    font-family: "Cormorant Garamond", serif;
    font-size: 0.95rem;
    font-style: italic;
    line-height: 1.4;
    text-align: left;
}

.character-frame {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    background: #050505;
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.45);
}

.character-frame video {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: contain;
    object-position: center;
}

.voice-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.voice-player-label {
    color: var(--off-white);
    font-family: "Cormorant Garamond", serif;
    font-size: 1.55rem;
}

.voice-note-animation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 58px;
}

.voice-note-animation span {
    width: 6px;
    height: 18px;
    border-radius: 99px;
    background: var(--rose);
    opacity: 0.45;
}

.voice-note-animation.playing span {
    animation: voiceWave 0.8s ease-in-out infinite alternate;
}

.voice-note-animation span:nth-child(2) { animation-delay: 0.12s; }
.voice-note-animation span:nth-child(3) { animation-delay: 0.24s; }
.voice-note-animation span:nth-child(4) { animation-delay: 0.36s; }
.voice-note-animation span:nth-child(5) { animation-delay: 0.48s; }

@keyframes voiceWave {
    from { height: 14px; opacity: 0.5; }
    to { height: 48px; opacity: 1; }
}
/* Production/MVP additions */
.error-panel {
    width: min(92vw, 520px);
    text-align: center;
}

.present-note {
    margin-top: 14px;
    color: var(--rose);
    font-family: "Cormorant Garamond", serif;
    font-size: 1.2rem;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .6s ease, transform .6s ease;
}

.present-note.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 620px) {
    .voice-stage {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .character-frame {
        max-width: 310px;
        width: 100%;
        margin: 0 auto;
    }
}


/* =====================================================
   WRONG PASSWORD SHAKE
===================================================== */

#password-input.shake-error {
    animation: passwordShake 0.45s ease-in-out;
}

@keyframes passwordShake {
    0% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-8px);
    }

    40% {
        transform: translateX(8px);
    }

    60% {
        transform: translateX(-6px);
    }

    80% {
        transform: translateX(6px);
    }

    100% {
        transform: translateX(0);
    }
}

body.memory-lightbox-open {
    overflow: hidden;
}

.memories-panel {
    max-height: 92vh;
    overflow-y: auto;
    scrollbar-width: thin;
}

.memories-heading {
    margin-bottom: 12px;
}

.memories-heading span {
    display: block;
    color: var(--rose-strong);
    font-style: italic;
}

.memories-intro {
    position: relative;
    z-index: 1;
    max-width: 340px;
    margin: 0 auto 24px;
    color: var(--text-soft);
    font-size: 0.9rem;
    line-height: 1.7;
    text-align: center;
}

.memory-video-card {
    position: relative;
    z-index: 1;
    width: 100%;
    margin: 0 auto 28px;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(10, 7, 10, 0.75);
    box-shadow: 0 22px 45px rgba(0, 0, 0, 0.38), 0 0 25px rgba(255, 120, 175, 0.08);
}

.memory-video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: #090709;
}

.memory-video-caption {
    padding: 11px 14px;
    text-align: center;
    background: rgba(255, 255, 255, 0.025);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.memory-video-caption span {
    color: var(--rose);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.20em;
    text-transform: uppercase;
}

.memories-label {
    position: relative;
    z-index: 1;
    margin: 6px 0 14px;
    color: var(--rose);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-align: left;
}

.memory-gallery {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 150px;
    gap: 10px;
}

.memory-photo {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 17px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.025);
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.memory-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.55s ease, filter 0.55s ease;
}

.memory-photo:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 166, 200, 0.35);
    box-shadow: 0 15px 32px rgba(0, 0, 0, 0.32), 0 0 18px rgba(255, 130, 180, 0.08);
}

.memory-photo:hover img {
    transform: scale(1.045);
    filter: brightness(1.05) saturate(1.06);
}

.memory-photo-tall {
    grid-row: span 2;
}

.memory-photo-wide {
    grid-column: span 2;
}

.memories-ending {
    position: relative;
    z-index: 1;
    margin: 30px auto 4px;
    text-align: center;
}

.memories-ending-heart {
    color: var(--rose);
    font-family: "Cormorant Garamond", serif;
    font-size: 1.55rem;
    margin-bottom: 4px;
    opacity: 0.85;
    animation: memoriesHeart 3.5s ease-in-out infinite;
}

.memories-ending p {
    margin: 0;
    color: var(--text-muted);
    font-family: "Cormorant Garamond", serif;
    font-size: 1rem;
    font-style: italic;
    line-height: 1.5;
}

@keyframes memoriesHeart {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.7;
    }

    50% {
        transform: scale(1.12);
        opacity: 1;
    }
}

.memory-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(7, 4, 7, 0.94);
    backdrop-filter: blur(14px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.memory-lightbox.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.memory-lightbox img {
    display: block;
    max-width: 92vw;
    max-height: 82vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65);
}

.memory-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: var(--off-white);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
}

.memory-lightbox-close:hover {
    background: rgba(255, 150, 190, 0.15);
    transform: scale(1.05);
}

.memory-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(18, 12, 18, 0.7);
    color: var(--off-white);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
    z-index: 2;
}

.memory-lightbox-nav:hover {
    background: rgba(255, 150, 190, 0.18);
    border-color: rgba(255, 166, 200, 0.45);
    transform: translateY(-50%) scale(1.04);
}

.memory-lightbox-prev {
    left: 18px;
}

.memory-lightbox-next {
    right: 18px;
}

@media (max-width: 420px) {
    .memory-gallery {
        grid-auto-rows: 125px;
        gap: 8px;
    }

    .memory-photo {
        border-radius: 14px;
    }

    .memory-video-card {
        border-radius: 20px;
    }

    .memory-lightbox {
        padding: 14px;
    }
}