:root {
    --primary: #c33a68;
    --secondary: #f7dbe6;
    --page-bg: #fff9f6;
    --text: #3c2931;
    --paper: #fffdf9;

    --builder-bg: #f8f4f6;
    --builder-card: rgba(255, 255, 255, 0.92);
    --builder-border: #eadde2;
    --builder-muted: #7b6870;
    --builder-dark: #38262e;
}

/* =========================================================
   RESET
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

.gift-body,
#giftContent,
.story-section {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

.story-section > .container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.row,
[class*="col-"] {
    min-width: 0;
}

img,
svg,
canvas,
iframe,
video {
    max-width: 100%;
}


html {
    width: 100%;
    min-height: 100%;
    margin: 0;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    color: var(--text);
    background: var(--page-bg);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

img,
svg {
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.fw-black {
    font-weight: 900;
}

.brand-dot {
    color: var(--primary);
}

/* =========================================================
   BUILDER / INDEX PAGE
   ========================================================= */

.builder-body {
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--builder-dark);
    background:
        radial-gradient(
            circle at 88% 4%,
            rgba(240, 177, 199, 0.38),
            transparent 27rem
        ),
        radial-gradient(
            circle at 6% 36%,
            rgba(248, 218, 178, 0.24),
            transparent 25rem
        ),
        linear-gradient(
            180deg,
            #ffffff 0,
            #fbf7f8 38rem,
            var(--builder-bg) 100%
        );
}

.builder-body .navbar {
    z-index: 1000;
    background: rgba(255, 255, 255, 0.86) !important;
    border-color: rgba(70, 40, 51, 0.09) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.builder-body .navbar-brand {
    color: #35232b;
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.builder-body .navbar-text {
    color: #806c74 !important;
}

.builder-hero {
    position: relative;
    overflow: hidden;
    padding: 5.5rem 0 6.5rem;
}

.builder-hero::before {
    content: "";
    position: absolute;
    top: -13rem;
    right: -8rem;
    width: 37rem;
    height: 37rem;
    border-radius: 50%;
    background: rgba(219, 95, 139, 0.18);
    filter: blur(70px);
    pointer-events: none;
}

.builder-hero::after {
    content: "";
    position: absolute;
    bottom: -15rem;
    left: -12rem;
    width: 34rem;
    height: 34rem;
    border-radius: 50%;
    background: rgba(247, 208, 163, 0.24);
    filter: blur(80px);
    pointer-events: none;
}

.builder-hero .container {
    position: relative;
    z-index: 2;
}

.builder-hero h1 {
    max-width: 760px;
    margin: 0 0 1.55rem;
    color: #342229;
    font-size: clamp(3.2rem, 7vw, 6.8rem);
    font-weight: 900;
    line-height: 0.92;
    letter-spacing: -0.067em;
}

.builder-hero .lead {
    max-width: 690px;
    color: #78676e !important;
    font-size: clamp(1.08rem, 2vw, 1.3rem);
    line-height: 1.72;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.58rem 0.92rem;
    border: 1px solid rgba(195, 58, 104, 0.15);
    border-radius: 999px;
    color: #a42c56;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 12px 32px rgba(75, 33, 48, 0.07);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.builder-body .btn-danger {
    --bs-btn-bg: #c33a68;
    --bs-btn-border-color: #c33a68;
    --bs-btn-hover-bg: #aa2d59;
    --bs-btn-hover-border-color: #aa2d59;
    --bs-btn-active-bg: #94234c;
    --bs-btn-active-border-color: #94234c;

    border-radius: 999px;
    padding-inline: 1.5rem;
    font-weight: 850;
    box-shadow: 0 17px 40px rgba(195, 58, 104, 0.22);
}

.builder-body .btn-dark,
.builder-body .btn-outline-dark {
    border-radius: 999px;
    padding-inline: 1.5rem;
    font-weight: 850;
}

.phone-showcase {
    min-height: 620px;
    position: relative;
    display: grid;
    place-items: center;
}

.phone-glow {
    position: absolute;
    width: 440px;
    height: 440px;
    border-radius: 50%;
    background: rgba(222, 108, 146, 0.31);
    filter: blur(88px);
}

.phone-frame {
    width: 310px;
    height: 610px;
    position: relative;
    overflow: hidden;
    border: 10px solid #191617;
    border-radius: 52px;
    color: #fff;
    background:
        radial-gradient(
            circle at 20% 10%,
            rgba(255, 255, 255, 0.35),
            transparent 31%
        ),
        linear-gradient(
            145deg,
            #df90aa,
            #ad4169 53%,
            #68213e
        );
    box-shadow:
        0 46px 110px rgba(62, 26, 40, 0.35),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    transform: rotate(4deg);
}

.phone-island {
    position: absolute;
    top: 13px;
    left: 50%;
    width: 110px;
    height: 29px;
    border-radius: 20px;
    background: #171516;
    transform: translateX(-50%);
}

.showcase-lock {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 80px 30px 35px;
    text-align: center;
}

.showcase-lock h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.45rem;
    font-weight: 400;
    line-height: 1.05;
}

.mini-kicker {
    margin-bottom: 1rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.mini-code {
    margin: 3rem 0 2rem;
    font-size: 1rem;
    letter-spacing: 0.42rem;
}

.mini-flower {
    font-size: 4rem;
    animation: builderFlowerFloat 3s ease-in-out infinite;
}

.builder-form {
    display: grid;
    gap: 1.45rem;
    padding-bottom: 5rem;
}

.form-section {
    position: relative;
    overflow: hidden;
    padding: clamp(1.55rem, 4vw, 3rem);
    border: 1px solid var(--builder-border);
    border-radius: 30px;
    background: var(--builder-card);
    box-shadow:
        0 24px 65px rgba(67, 31, 44, 0.075),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.form-section::after {
    content: "";
    position: absolute;
    top: -5rem;
    right: -5rem;
    width: 12rem;
    height: 12rem;
    border-radius: 50%;
    background: rgba(242, 198, 213, 0.18);
    pointer-events: none;
}

.form-section > * {
    position: relative;
    z-index: 2;
}

.form-section h2 {
    margin-bottom: 0.35rem;
    color: #3b2830;
    font-size: 1.55rem;
    font-weight: 900;
    letter-spacing: -0.025em;
}

.form-section > div > p,
.form-section > p {
    margin-bottom: 1.65rem;
    color: var(--builder-muted);
}

.step-number {
    position: absolute;
    top: 1.05rem;
    right: 1.4rem;
    z-index: 1;
    color: rgba(195, 58, 104, 0.09);
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 900;
    line-height: 1;
}

.builder-body .form-label {
    margin-bottom: 0.46rem;
    color: #59454e;
    font-size: 0.81rem;
    font-weight: 850;
}

.builder-body .form-control,
.builder-body .form-select {
    min-height: 50px;
    border: 1px solid #dfd1d6;
    border-radius: 14px;
    color: #39282f;
    background-color: #fffdfd;
    box-shadow: none;
}

.builder-body textarea.form-control {
    min-height: 150px;
    padding-top: 0.9rem;
    resize: vertical;
}

.builder-body .form-control::placeholder {
    color: #ad9ca3;
}

.builder-body .form-control:focus,
.builder-body .form-select:focus {
    border-color: rgba(195, 58, 104, 0.75);
    box-shadow: 0 0 0 0.23rem rgba(195, 58, 104, 0.11);
}

.builder-body .form-control-color {
    height: 52px;
    padding: 0.4rem;
}

.builder-summary {
    top: 96px;
}

.summary-card {
    padding: 2rem;
    border: 1px solid var(--builder-border);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.89);
    box-shadow: 0 24px 65px rgba(67, 31, 44, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.eyebrow {
    color: #b32f5d;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.17em;
    text-transform: uppercase;
}

.journey-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(69, 43, 53, 0.08);
}

.journey-item:last-child {
    border-bottom: 0;
}

.journey-item > span {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #a52b55;
    background: #f7e2e9;
    font-size: 0.85rem;
    font-weight: 900;
}

.journey-item > div {
    display: flex;
    flex-direction: column;
}

.journey-item strong {
    color: #3b2930;
}

.journey-item small {
    color: #88747c;
}

.success-panel {
    padding: clamp(1.5rem, 4vw, 2.7rem);
    border: 1px solid #dce8df;
    border-radius: 28px;
    background:
        radial-gradient(
            circle at 95% 10%,
            rgba(127, 195, 148, 0.15),
            transparent 15rem
        ),
        #fff;
    box-shadow: 0 22px 60px rgba(43, 73, 50, 0.09);
}

.success-panel .input-group .form-control {
    min-height: 48px;
    border-radius: 13px 0 0 13px;
}

.success-panel .input-group .btn {
    border-radius: 0 13px 13px 0;
}

.memory-builder-block {
    margin-top: 1.3rem;
    padding: 1.3rem;
    border: 1px solid rgba(195, 58, 104, 0.12);
    border-radius: 20px;
    background: rgba(250, 242, 245, 0.62);
}

/* =========================================================
   GIFT VIEW: SCROLL CONTAINER
   ========================================================= */

.gift-body {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
    background: var(--page-bg);
}

#giftContent {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    opacity: 0;
    transition: opacity 0.8s ease;
}

#giftContent.gift-visible {
    opacity: 1;
}

.story-section {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 90px 0;
    scroll-snap-align: start;
    scroll-snap-stop: normal;
}

.story-section > .container {
    width: 100%;
}

.progress-line {
    position: fixed;
    inset: 0 0 auto 0;
    height: 3px;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.35);
}

.progress-line > div {
    width: 0;
    height: 100%;
    background: var(--primary);
}

/* =========================================================
   TOUCH / ZOOM CONTROL
   ========================================================= */

.gift-body *,
.gift-body *::before,
.gift-body *::after {
    -webkit-touch-callout: none;
}

.key,
.keypad,
.hint-button,
.scroll-button,
.text-button,
.preview-button,
.puzzle-tile,
.reason-card,
.wax-seal,
.final-button,
.final-love-button,
.playlist-play-button,
.open-music-button {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.memory-slider {
    touch-action: pan-x;
}

.scratch-card,
#scratchCanvas {
    touch-action: none;
}

.preview-button {
    touch-action: none;
}

input,
textarea,
select {
    touch-action: manipulation;
}

/* =========================================================
   PASSCODE SCREEN
   ========================================================= */

.passcode-screen {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
    padding:
        max(24px, env(safe-area-inset-top))
        20px
        max(24px, env(safe-area-inset-bottom));
    background:
        radial-gradient(
            circle at 15% 15%,
            rgba(255, 244, 214, 0.96),
            transparent 34%
        ),
        radial-gradient(
            circle at 82% 75%,
            rgba(220, 174, 165, 0.72),
            transparent 42%
        ),
        linear-gradient(
            135deg,
            #ebc99c 0%,
            #dec1a8 42%,
            #bda598 100%
        );
    transition:
        opacity 0.75s ease,
        filter 0.75s ease,
        transform 0.75s ease;
}

.passcode-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.24;
    pointer-events: none;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.2'/%3E%3C/svg%3E");
    mix-blend-mode: soft-light;
}

.passcode-screen.passcode-leaving {
    opacity: 0;
    filter: blur(18px);
    transform: scale(1.04);
}

.passcode-ambient {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.3;
    animation: ambientDrift 8s ease-in-out infinite;
}

.ambient-a {
    width: 340px;
    height: 340px;
    left: -120px;
    bottom: -90px;
    background: #ffd889;
}

.ambient-b {
    width: 300px;
    height: 300px;
    right: -100px;
    top: -70px;
    background: #9a7f73;
    animation-delay: -3s;
}

.passcode-panel {
    width: min(100%, 420px);
    position: relative;
    z-index: 2;
    text-align: center;
}

.pixel-heart {
    width: 106px;
    height: 96px;
    margin: 0 auto 24px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
    filter: drop-shadow(0 12px 20px rgba(143, 21, 67, 0.22));
    animation: heartFloat 3.2s ease-in-out infinite;
}

.pixel-heart {
    width: 112px;
    height: 112px;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(7, 1fr);
    gap: 0;
}

.pixel-heart span {
    background: transparent;
}

.pixel-heart span:nth-child(2),
.pixel-heart span:nth-child(3),
.pixel-heart span:nth-child(5),
.pixel-heart span:nth-child(6),

.pixel-heart span:nth-child(8),
.pixel-heart span:nth-child(9),
.pixel-heart span:nth-child(10),
.pixel-heart span:nth-child(11),
.pixel-heart span:nth-child(12),
.pixel-heart span:nth-child(13),
.pixel-heart span:nth-child(14),

.pixel-heart span:nth-child(15),
.pixel-heart span:nth-child(16),
.pixel-heart span:nth-child(17),
.pixel-heart span:nth-child(18),
.pixel-heart span:nth-child(19),
.pixel-heart span:nth-child(20),
.pixel-heart span:nth-child(21),

.pixel-heart span:nth-child(23),
.pixel-heart span:nth-child(24),
.pixel-heart span:nth-child(25),
.pixel-heart span:nth-child(26),
.pixel-heart span:nth-child(27),

.pixel-heart span:nth-child(31),
.pixel-heart span:nth-child(32),
.pixel-heart span:nth-child(33),

.pixel-heart span:nth-child(39) {
    background: #c9134d;
}

.passcode-kicker,
.section-label {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.17em;
    text-transform: uppercase;
}

.passcode-panel h1 {
    max-width: 620px;
    margin: 0 auto;
    color: #4a352f;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.1rem, 7vw, 3.6rem);
    font-weight: 400;
    line-height: 1.08;
}

.passcode-recipient {
    margin: 13px 0 0;
    color: rgba(66, 45, 39, 0.72);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.1rem;
    font-style: italic;
}

.passcode-dots {
    min-height: 20px;
    display: flex;
    justify-content: center;
    gap: 13px;
    margin: 31px 0 26px;
}

.passcode-dots span {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: rgba(91, 64, 53, 0.16);
    box-shadow: inset 0 0 0 1px rgba(91, 64, 53, 0.05);
    transition:
        background 0.18s ease,
        transform 0.18s ease;
}

.passcode-dots span.filled {
    background: #c9134d;
    transform: scale(1.12);
}

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 72px);
    justify-content: center;
    gap: 14px 17px;
}

.key {
    width: 72px;
    height: 72px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    color: #4b3934;
    background: rgba(255, 255, 255, 0.48);
    box-shadow:
        0 10px 28px rgba(68, 45, 35, 0.09),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.45rem;
    cursor: pointer;
    transition:
        transform 0.16s ease,
        background 0.16s ease;
}

.key:active {
    transform: scale(0.91);
    background: rgba(255, 255, 255, 0.74);
}

.key-empty {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    font-family: inherit;
    font-size: 0.75rem;
}

.key-delete {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    font-family: inherit;
    font-size: 1.15rem;
}

.hint-button {
    margin-top: 22px;
    border: 0;
    color: rgba(70, 46, 39, 0.7);
    background: transparent;
    font-size: 0.82rem;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.hint-text,
.code-error {
    min-height: 20px;
    margin: 10px 0 0;
    font-size: 0.82rem;
}

.code-error {
    color: #a71e46;
}

/* =========================================================
   FLOWER TRANSITION
   ========================================================= */

.flower-transition {
    position: fixed;
    inset: 0;
    z-index: 50000;
    display: grid;
    place-items: center;
    overflow: hidden;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    background: #f5cad9;
    transition:
        opacity 0.45s ease,
        visibility 0.45s ease;
}

.flower-transition.active {
    visibility: visible;
    opacity: 1;
}

.flower-transition.leaving {
    opacity: 0;
}

.flower-cloud {
    position: absolute;
    width: 120vmax;
    height: 120vmax;
    border-radius: 50%;
    transform: scale(0.1);
    opacity: 0;
    background:
        radial-gradient(circle at 12% 15%, #f9d2df 0 3%, transparent 3.5%),
        radial-gradient(circle at 22% 24%, #dc7393 0 4%, transparent 4.5%),
        radial-gradient(circle at 34% 13%, #f6edf2 0 5%, transparent 5.5%),
        radial-gradient(circle at 47% 27%, #d95780 0 4%, transparent 4.6%),
        radial-gradient(circle at 63% 17%, #f8c5d7 0 5%, transparent 5.6%),
        radial-gradient(circle at 76% 26%, #e482a0 0 4.5%, transparent 5%),
        radial-gradient(circle at 88% 14%, #f6e3eb 0 4.5%, transparent 5%),
        radial-gradient(circle at 13% 50%, #d55a80 0 5%, transparent 5.5%),
        radial-gradient(circle at 28% 43%, #f8d8e4 0 5.5%, transparent 6%),
        radial-gradient(circle at 44% 54%, #e987a5 0 5%, transparent 5.5%),
        radial-gradient(circle at 61% 43%, #f5c5d6 0 6%, transparent 6.5%),
        radial-gradient(circle at 79% 52%, #d45b80 0 5%, transparent 5.5%),
        radial-gradient(circle at 91% 42%, #f7e6ed 0 5%, transparent 5.5%),
        radial-gradient(circle at 18% 78%, #f4b9ce 0 5%, transparent 5.5%),
        radial-gradient(circle at 36% 72%, #d84d77 0 4.5%, transparent 5%),
        radial-gradient(circle at 53% 83%, #f8dce6 0 6%, transparent 6.5%),
        radial-gradient(circle at 70% 72%, #e47e9d 0 5%, transparent 5.5%),
        radial-gradient(circle at 87% 81%, #f3bfd1 0 5.5%, transparent 6%),
        linear-gradient(135deg, #f4aeca, #f7d9e4);
}

.flower-transition.active .flower-cloud-a {
    animation: flowerBloom 1.1s ease forwards;
}

.flower-transition.active .flower-cloud-b {
    animation: flowerBloom 1.2s 0.12s ease forwards;
}

.flower-transition.active .flower-cloud-c {
    animation: flowerBloom 1.3s 0.24s ease forwards;
}

.flower-cloud-b {
    transform-origin: 20% 80%;
}

.flower-cloud-c {
    transform-origin: 80% 20%;
}

.transition-message {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
    color: #8a294a;
    opacity: 0;
    transform: translateY(12px);
}

.flower-transition.active .transition-message {
    animation: transitionMessageHold 5.5s 0.8s ease forwards;
}

.transition-message span {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.transition-message strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 8vw, 4.5rem);
    font-weight: 400;
}

.celebration-layer {
    position: fixed;
    inset: 0;
    z-index: 60000;
    overflow: hidden;
    pointer-events: none;
}

.celebration-item {
    position: absolute;
    top: -12vh;
    animation: fallingItem linear forwards;
    filter: drop-shadow(0 5px 5px rgba(80, 35, 50, 0.12));
}

/* =========================================================
   WELCOME
   ========================================================= */

.welcome-section {
    background:
        radial-gradient(
            circle at 15% 20%,
            rgba(255, 255, 255, 0.95),
            transparent 30%
        ),
        radial-gradient(
            circle at 85% 80%,
            var(--secondary),
            transparent 38%
        ),
        linear-gradient(
            150deg,
            var(--page-bg),
            #f8e5ec
        );
}

.welcome-title {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(4rem, 13vw, 9rem);
    font-weight: 400;
    line-height: 0.95;
    letter-spacing: -0.055em;
}

.welcome-copy {
    max-width: 650px;
    margin: 28px auto 0;
    color: rgba(60, 41, 49, 0.72);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.15rem, 3vw, 1.5rem);
    line-height: 1.7;
}

.scroll-button {
    margin-top: 38px;
    border: 1px solid rgba(194, 57, 102, 0.22);
    border-radius: 999px;
    padding: 14px 22px;
    color: var(--primary);
    background: rgba(255, 255, 255, 0.68);
    font-weight: 800;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.scroll-button span {
    display: inline-block;
    margin-left: 8px;
    animation: arrowBob 1.4s ease-in-out infinite;
}

.soft-flower,
.final-flower {
    position: absolute;
    width: 280px;
    aspect-ratio: 1;
    border-radius: 48% 52% 46% 54%;
    opacity: 0.16;
    background:
        radial-gradient(circle at 50% 50%, #c22e62 0 7%, transparent 8%),
        radial-gradient(ellipse at 50% 20%, #ef8ead 0 17%, transparent 18%),
        radial-gradient(ellipse at 80% 50%, #f4b2c7 0 17%, transparent 18%),
        radial-gradient(ellipse at 50% 80%, #e9799d 0 17%, transparent 18%),
        radial-gradient(ellipse at 20% 50%, #f6c7d6 0 17%, transparent 18%);
    animation: softRotate 20s linear infinite;
}

.flower-top-left {
    top: -80px;
    left: -70px;
}

.flower-bottom-right {
    right: -80px;
    bottom: -90px;
    animation-direction: reverse;
}

/* =========================================================
   PUZZLE
   ========================================================= */

.puzzle-section {
    background: #fffaf7;
}

.floral-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.27;
    background-image:
        radial-gradient(circle at 10% 12%, #ed8bab 0 22px, transparent 23px),
        radial-gradient(circle at 15% 18%, #f9d6e1 0 34px, transparent 35px),
        radial-gradient(circle at 89% 15%, #e8a0b8 0 28px, transparent 29px),
        radial-gradient(circle at 83% 23%, #f7d5e0 0 42px, transparent 43px),
        radial-gradient(circle at 8% 82%, #eda4bc 0 35px, transparent 36px),
        radial-gradient(circle at 16% 90%, #f7d8e3 0 48px, transparent 49px),
        radial-gradient(circle at 92% 84%, #e98cab 0 31px, transparent 32px),
        radial-gradient(circle at 84% 93%, #f9dce6 0 45px, transparent 46px);
}

.puzzle-heading {
    max-width: 700px;
    margin: 0 auto 34px;
}

.puzzle-heading h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 400;
    line-height: 1;
}

.puzzle-heading p:last-child {
    max-width: 590px;
    margin: 17px auto 0;
    color: rgba(60, 41, 49, 0.65);
}

.puzzle-card {
    width: min(100%, 590px);
    margin: 0 auto;
    padding: 18px;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow:
        0 28px 85px rgba(101, 53, 70, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.puzzle-grid {
    --puzzle-preview-image: none;

    width: 100%;
    aspect-ratio: 1;
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 6px;
    overflow: hidden;
    border-radius: 20px;
    background: #fff;
    transition:
        transform 0.35s ease,
        box-shadow 0.35s ease;
}

.puzzle-grid::after {
    content: "";
    position: absolute;
    inset: 4px;
    z-index: 20;
    border-radius: 16px;

    background-image: var(--puzzle-preview-image);
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    background-color: #fff;

    opacity: 0;
    visibility: hidden;
    transform: scale(0.97);

    transition:
        opacity 0.18s ease,
        visibility 0.18s ease,
        transform 0.18s ease;

    pointer-events: none;
}

.puzzle-grid.preview::after {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.puzzle-grid.solved {
    animation: puzzleSnap 0.75s cubic-bezier(0.2, 0.9, 0.2, 1);
    box-shadow: 0 26px 75px rgba(173, 61, 101, 0.3);
}

.puzzle-grid.solved .puzzle-tile {
    border-radius: 0;
}

.puzzle-tile {
    aspect-ratio: 1;
    border: 0;
    border-radius: 12px;
    background-repeat: no-repeat;
    background-size: 400% 400%;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
    transition:
        transform 0.16s ease,
        filter 0.16s ease,
        opacity 0.16s ease;
}

.puzzle-tile.selected {
    transform: scale(0.9);
    filter: brightness(0.72);
    opacity: 0.82;
}

.puzzle-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 14px;
}

.text-button {
    border: 0;
    color: var(--primary);
    background: transparent;
    font-size: 0.78rem;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.puzzle-complete {
    margin: 24px 0 5px;
    text-align: center;
    opacity: 0;
    transform: translateY(18px) scale(0.96);
    transition:
        opacity 0.6s ease,
        transform 0.6s ease;
}

.puzzle-complete.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.puzzle-complete-heart {
    color: var(--primary);
    font-size: 3.7rem;
    line-height: 1;
    animation: puzzleHeartBeat 1.25s ease-in-out infinite;
}

.puzzle-complete strong {
    display: block;
    margin-top: 8px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.65rem;
    font-weight: 400;
}

.puzzle-complete p {
    margin: 7px 0 0;
    color: rgba(60, 41, 49, 0.64);
    font-family: Georgia, "Times New Roman", serif;
}

.puzzle-complete small {
    display: block;
    margin-top: 10px;
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* =========================================================
   LETTER / ENVELOPE
   ========================================================= */

.letter-section {
    perspective: 1400px;
    background:
        radial-gradient(
            circle at 20% 20%,
            rgba(255, 255, 255, 0.42),
            transparent 30%
        ),
        #eadbc8;
}

.letter-envelope {
    width: min(100%, 860px);
    min-height: 570px;
    position: relative;
    margin: 0 auto;
    perspective: 1400px;
}

.envelope-back {
    position: absolute;
    inset: 90px 0 0;
    border-radius: 12px;
    background: linear-gradient(145deg, #d4b99a, #bea080);
    box-shadow: 0 38px 100px rgba(75, 52, 34, 0.25);
}

.letter-paper {
    width: calc(100% - 70px);
    min-height: 490px;
    position: relative;
    z-index: 2;
    margin: 70px auto 0;
    padding: clamp(35px, 7vw, 82px);
    overflow: hidden;
    border-radius: 6px;
    background:
        linear-gradient(
            rgba(255, 253, 247, 0.97),
            rgba(255, 253, 247, 0.97)
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 31px,
            #eadfce 32px
        );
    box-shadow: 0 25px 60px rgba(77, 54, 37, 0.16);
    transform:
        translateY(180px)
        rotateX(-76deg)
        scale(0.91);
    transform-origin: bottom center;
    opacity: 0.72;
    transition:
        transform 2s cubic-bezier(0.2, 0.8, 0.2, 1),
        opacity 0.8s ease;
}

.envelope-flap {
    position: absolute;
    top: 90px;
    right: 0;
    left: 0;
    z-index: 5;
    height: 250px;
    background: linear-gradient(145deg, #dec5a8, #c4a485);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    transform-origin: top center;
    transition:
        transform 2s cubic-bezier(0.2, 0.8, 0.2, 1),
        opacity 0.5s ease;
}

.wax-seal {
    width: 82px;
    height: 82px;
    position: absolute;
    top: 250px;
    left: 50%;
    z-index: 10;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: #f8cbd8;
    background:
        radial-gradient(
            circle at 35% 28%,
            #e76d94,
            #a92251 60%,
            #7b173b
        );
    box-shadow:
        0 13px 30px rgba(91, 26, 49, 0.3),
        inset 0 0 0 5px rgba(255, 255, 255, 0.08);
    font-size: 2rem;
    transform: translateX(-50%);
    cursor: pointer;
    transition:
        transform 1s ease,
        opacity 0.4s ease;
}

.wax-seal:hover {
    transform: translateX(-50%) scale(1.07);
}

.open-letter-hint {
    position: absolute;
    top: 344px;
    left: 50%;
    z-index: 11;
    color: rgba(72, 49, 39, 0.68);
    font-size: 0.75rem;
    font-weight: 850;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    transform: translateX(-50%);
    transition: opacity 0.4s ease;
}

.letter-envelope.opened .envelope-flap {
    opacity: 0;
    transform: rotateX(180deg);
    pointer-events: none;
}

.letter-envelope.opened .wax-seal {
    opacity: 0;
    transform:
        translateX(-50%)
        scale(0.5)
        rotate(20deg);
    pointer-events: none;
}

.letter-envelope.opened .open-letter-hint {
    opacity: 0;
}

.letter-envelope.opened .letter-paper {
    opacity: 1;
    transform:
        translateY(0)
        rotateX(0)
        scale(1);
}

.letter-paper h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.7rem, 7vw, 5.8rem);
    font-weight: 400;
    line-height: 1;
}

.letter-copy {
    min-height: 190px;
    margin-top: 34px;
    white-space: pre-wrap;
    font-family:
        "Segoe Print",
        "Bradley Hand",
        "Comic Sans MS",
        cursive;
    font-size: clamp(1.08rem, 2.5vw, 1.42rem);
    line-height: 1.85;
}

.letter-copy::after {
    content: "";
    display: inline-block;
    width: 2px;
    height: 1.1em;
    margin-left: 3px;
    vertical-align: -0.15em;
    background: var(--primary);
    animation: writingCursor 0.72s steps(1) infinite;
}

.letter-copy.finished::after {
    display: none;
}

.letter-signature {
    margin-top: 38px;
    font-family:
        "Segoe Print",
        "Bradley Hand",
        cursive;
    font-size: 1.15rem;
    opacity: 0;
    clip-path: inset(0 100% 0 0);
}

.letter-envelope.signature-visible .letter-signature {
    animation: drawSignature 1.5s ease forwards;
}

.letter-signature span,
.letter-signature strong {
    display: block;
}

.letter-signature strong {
    color: var(--primary);
    font-size: 1.65rem;
    font-weight: 500;
}

.letter-flower-stamp {
    position: absolute;
    right: 30px;
    bottom: 24px;
    color: var(--primary);
    font-size: 3rem;
    opacity: 0;
    transform: scale(2) rotate(25deg);
}

.letter-envelope.stamp-visible .letter-flower-stamp {
    animation: stampFlower 0.55s ease forwards;
}

/* =========================================================
   MEMORY LANE
   ========================================================= */

.memories-section {
    background:
        radial-gradient(
            circle at 15% 15%,
            rgba(255, 255, 255, 0.9),
            transparent 28%
        ),
        linear-gradient(145deg, #f3dfe7, #fffaf7);
}

.memory-decoration {
    position: absolute;
    width: 330px;
    height: 330px;
    border-radius: 50%;
    opacity: 0.14;
    background:
        radial-gradient(circle, var(--primary) 0 13%, transparent 14%),
        radial-gradient(circle at 30% 30%, #ef8cab 0 18%, transparent 19%),
        radial-gradient(circle at 70% 30%, #f5b6ca 0 18%, transparent 19%),
        radial-gradient(circle at 50% 72%, #db6d92 0 18%, transparent 19%);
}

.memory-decoration-left {
    top: -100px;
    left: -120px;
}

.memory-decoration-right {
    right: -130px;
    bottom: -110px;
}

.memory-heading {
    max-width: 720px;
    margin: 0 auto 38px;
}

.memory-heading h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.9rem, 8vw, 6rem);
    font-weight: 400;
    line-height: 0.98;
}

.memory-heading > p:last-child {
    margin-top: 18px;
    color: rgba(60, 41, 49, 0.64);
}

.memory-slider {
    width: 100%;
    max-width: 100%;
    display: flex;
    gap: 24px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 15px 18px 40px;
    margin-inline: 0;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.memory-slider::-webkit-scrollbar {
    display: none;
}

.memory-card {
    width: min(82vw, 430px);
    flex: 0 0 min(82vw, 430px);
    overflow: hidden;
    border-radius: 29px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 28px 75px rgba(86, 42, 58, 0.16);
    scroll-snap-align: center;
    transform: rotate(-0.5deg);
}

.memory-card:nth-child(even) {
    transform: rotate(0.7deg);
}

.memory-photo {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #eadde2;
}

.memory-photo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.memory-card:hover .memory-photo img {
    transform: scale(1.04);
}

.memory-card-content {
    min-height: 230px;
    position: relative;
    padding: 28px 28px 52px;
}

.memory-date {
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.memory-card h3 {
    margin: 9px 0 13px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2rem;
    font-weight: 400;
}

.memory-card p {
    margin: 0;
    color: rgba(60, 41, 49, 0.68);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.06rem;
    line-height: 1.65;
}

.memory-number {
    position: absolute;
    right: 24px;
    bottom: 18px;
    color: rgba(195, 58, 104, 0.15);
    font-size: 3.4rem;
    font-weight: 900;
    line-height: 1;
}

.memory-swipe-hint {
    margin: 5px 0 0;
    color: rgba(60, 41, 49, 0.55);
    text-align: center;
    font-size: 0.78rem;
    font-weight: 800;
}

/* =========================================================
   REASONS
   ========================================================= */

.reasons-section {
    background:
        radial-gradient(
            circle at 50% 25%,
            rgba(255, 255, 255, 0.8),
            transparent 30%
        ),
        linear-gradient(180deg, #fcecf1, #f4cfdc);
}

.reasons-heading {
    max-width: 720px;
    margin: 0 auto 42px;
}

.reasons-heading h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(3rem, 9vw, 6.5rem);
    font-weight: 400;
    line-height: 0.95;
}

.reasons-heading > p:last-child {
    margin-top: 17px;
    color: rgba(60, 41, 49, 0.63);
}

.reasons-deck {
    width: min(100%, 470px);
    height: 380px;
    position: relative;
    margin: 0 auto;
    perspective: 1300px;
}

.reason-card {
    position: absolute;
    inset: 0;
    border: 0;
    border-radius: 31px;
    padding: 0;
    color: var(--text);
    background: transparent;
    opacity: 0;
    pointer-events: none;
    transform:
        translateX(70px)
        translateY(12px)
        scale(0.92)
        rotate(5deg);
    transition:
        opacity 0.5s ease,
        transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform-style: preserve-3d;
}

.reason-card.active {
    z-index: 5;
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

.reason-card.previous {
    opacity: 0;
    transform:
        translateX(-100px)
        rotate(-8deg)
        scale(0.86);
}

.reason-card.next {
    opacity: 0.18;
    transform:
        translateX(20px)
        translateY(16px)
        scale(0.94)
        rotate(3deg);
}

.reason-card-front,
.reason-card-back {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 35px;
    border-radius: 31px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    box-shadow: 0 32px 85px rgba(92, 39, 59, 0.21);
    transition: transform 0.75s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reason-card-front {
    color: #fff;
    background:
        radial-gradient(
            circle at 25% 15%,
            rgba(255, 255, 255, 0.22),
            transparent 29%
        ),
        linear-gradient(145deg, #d45a84, #a92d59);
}

.reason-card-back {
    background:
        linear-gradient(
            rgba(255, 255, 255, 0.96),
            rgba(255, 255, 255, 0.96)
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 28px,
            #f0dce4 29px
        );
    transform: rotateY(180deg);
}

.reason-card.revealed .reason-card-front {
    transform: rotateY(-180deg);
}

.reason-card.revealed .reason-card-back {
    transform: rotateY(0);
}

.reason-card-front small {
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.reason-card-front strong {
    margin-top: 18px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.1rem;
    font-weight: 400;
}

.reason-card-front > span {
    margin-top: 24px;
    font-size: 3rem;
}

.reason-card-back > span {
    color: var(--primary);
    font-size: 2.8rem;
}

.reason-card-back strong {
    max-width: 350px;
    margin-top: 17px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.45rem, 4vw, 2rem);
    font-weight: 400;
    line-height: 1.45;
}

.reason-card-back small {
    margin-top: 25px;
    color: rgba(60, 41, 49, 0.52);
}

.reason-progress {
    margin-top: 25px;
    color: rgba(60, 41, 49, 0.57);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.16em;
}

/* =========================================================
   SCRATCH CARD
   ========================================================= */

.scratch-section {
    background:
        radial-gradient(
            circle at 20% 15%,
            rgba(255, 255, 255, 0.9),
            transparent 30%
        ),
        linear-gradient(145deg, #fff9f4, #f0ddd0);
}

.scratch-heading {
    max-width: 700px;
    margin: 0 auto 38px;
}

.scratch-heading h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 400;
    line-height: 0.97;
}

.scratch-heading > p:last-child {
    margin-top: 17px;
    color: rgba(60, 41, 49, 0.62);
}

.scratch-card {
    width: min(100%, 590px);
    min-height: 310px;
    position: relative;
    overflow: hidden;
    margin: 0 auto;
    border: 10px solid rgba(255, 255, 255, 0.8);
    border-radius: 31px;
    background: #fff;
    box-shadow: 0 32px 90px rgba(85, 47, 39, 0.18);
}

.scratch-secret {
    min-height: 290px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #5e3041;
    background:
        radial-gradient(
            circle at 50% 25%,
            rgba(255, 255, 255, 0.95),
            transparent 30%
        ),
        linear-gradient(145deg, #fbe4ec, #f2c8d6);
}

.scratch-secret span {
    color: var(--primary);
    font-size: 3rem;
}

.scratch-secret p {
    max-width: 430px;
    margin: 17px 0 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.35rem, 4vw, 2rem);
    line-height: 1.5;
}

#scratchCanvas {
    position: absolute;
    inset: 0;
    z-index: 2;
    cursor: crosshair;
    transition: opacity 0.7s ease;
}

#scratchCanvas.scratch-finished {
    opacity: 0;
    pointer-events: none;
}

.scratch-complete-text {
    margin-top: 22px;
    color: var(--primary);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.15rem;
    font-style: italic;
}

/* =========================================================
   PLAYLIST
   ========================================================= */

.playlist-section {
    color: #fff;
    background:
        radial-gradient(
            circle at 85% 20%,
            rgba(195, 58, 104, 0.36),
            transparent 35%
        ),
        #171317;
}

.premium-playlist {
    width: min(100%, 1080px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 0.92fr 1.08fr;
    gap: clamp(35px, 7vw, 85px);
    align-items: center;
}

.playlist-visual {
    position: relative;
    isolation: isolate;
}

.playlist-cover {
    width: 100%;
    aspect-ratio: 1;
    display: block;
    border-radius: 28px;
    object-fit: cover;
    box-shadow: 0 42px 110px rgba(0, 0, 0, 0.5);
}

.playlist-visual::after {
    content: "";
    position: absolute;
    right: -9%;
    bottom: -8%;
    z-index: -1;
    width: 80%;
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        repeating-radial-gradient(
            circle,
            #111 0 4px,
            #29252a 5px 7px
        );
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    animation: recordSpin 16s linear infinite;
}

.playlist-play-button {
    width: 76px;
    height: 76px;
    position: absolute;
    right: 24px;
    bottom: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #151217;
    background: #fff;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.34);
    text-decoration: none;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.playlist-play-button:hover {
    transform: scale(1.08);
}

.playlist-play-button span {
    margin-left: 5px;
    font-size: 1.6rem;
}

.playlist-information h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(3rem, 7vw, 5.6rem);
    font-weight: 400;
    line-height: 0.95;
}

.playlist-description {
    margin-top: 18px;
    color: rgba(255, 255, 255, 0.64);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.1rem;
}

.playlist-track-list {
    margin: 30px 0 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.playlist-track-list li {
    display: grid;
    grid-template-columns: 38px 1fr 30px;
    align-items: center;
    gap: 10px;
    padding: 15px 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.track-number {
    color: rgba(255, 255, 255, 0.38);
    font-size: 0.74rem;
    font-weight: 800;
}

.track-title {
    color: rgba(255, 255, 255, 0.92);
}

.track-heart {
    color: rgba(255, 255, 255, 0.52);
    text-align: right;
    font-size: 1.25rem;
}

.open-music-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 28px;
    border-radius: 999px;
    padding: 14px 21px;
    color: #171317;
    background: #fff;
    font-weight: 900;
    text-decoration: none;
}

/* Legacy playlist support */

.playlist-card {
    width: min(100%, 1050px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: clamp(30px, 7vw, 80px);
    align-items: center;
    padding: clamp(28px, 5vw, 64px);
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 34px;
    background: rgba(255, 255, 255, 0.055);
}

.playlist-art {
    display: grid;
    place-items: center;
}

.record {
    width: min(62vw, 310px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background:
        repeating-radial-gradient(
            circle,
            #0e0d0f 0 4px,
            #242125 5px 7px
        );
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
    animation: recordSpin 14s linear infinite;
}

.record-centre {
    width: 34%;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--primary);
    font-size: 2rem;
}

.playlist-copy h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.7rem, 7vw, 5.2rem);
    font-weight: 400;
    line-height: 1;
}

.playlist-copy iframe {
    width: 100%;
    height: 160px;
    margin-top: 20px;
    border: 0;
    border-radius: 18px;
}

/* =========================================================
   TIMER
   ========================================================= */

.timer-section {
    background:
        radial-gradient(
            circle at 50% 18%,
            rgba(255, 255, 255, 0.94),
            transparent 30%
        ),
        linear-gradient(
            180deg,
            var(--page-bg),
            var(--secondary)
        );
}

.timer-heading {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(3rem, 8vw, 6.5rem);
    font-weight: 400;
    line-height: 1;
}

.timer-grid {
    width: min(100%, 960px);
    margin: 52px auto 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 13px;
}

.timer-card {
    padding: 30px 12px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 27px;
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 20px 60px rgba(83, 43, 58, 0.1);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.timer-card strong {
    display: block;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.4rem, 7vw, 5.4rem);
    font-weight: 400;
    line-height: 0.95;
}

.timer-card span {
    display: block;
    margin-top: 10px;
    color: rgba(60, 41, 49, 0.56);
    font-size: 0.69rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.timer-footer {
    margin-top: 34px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.3rem;
    font-style: italic;
}

/* =========================================================
   FINAL
   ========================================================= */

.final-section {
    isolation: isolate;
    color: #fff;
    background:
        radial-gradient(
            circle at 50% 35%,
            rgba(255, 255, 255, 0.12),
            transparent 32%
        ),
        linear-gradient(145deg, #bd3263, #751638);
}

.final-moving-stars {
    position: absolute;
    inset: -20%;
    z-index: -2;
    opacity: 0.46;
    background-image:
        radial-gradient(circle, #fff 0 1px, transparent 1.5px),
        radial-gradient(circle, #ffd7e4 0 1.5px, transparent 2px),
        radial-gradient(circle, #fff 0 1px, transparent 1.5px);
    background-position:
        0 0,
        45px 80px,
        90px 30px;
    background-size:
        120px 120px,
        170px 170px,
        210px 210px;
    animation: starsMove 30s linear infinite;
}

.final-glow {
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.25;
}

.final-glow-one {
    width: 340px;
    height: 340px;
    top: -100px;
    left: -100px;
    background: #ffd1df;
}

.final-glow-two {
    width: 380px;
    height: 380px;
    right: -130px;
    bottom: -120px;
    background: #ff83aa;
}

.final-heart {
    font-size: clamp(6rem, 18vw, 10rem);
    line-height: 1;
    text-shadow: 0 20px 60px rgba(77, 0, 29, 0.3);
    animation: finalHeartbeat 1.8s ease-in-out infinite;
}

.final-sequence-line,
.final-name,
.final-custom-message,
.final-love-button,
.final-response {
    opacity: 0;
    transform: translateY(24px);
}

.final-section.playing .final-line-one {
    animation: finalLineReveal 1s 0.5s ease forwards;
}

.final-section.playing .final-line-two {
    animation: finalLineReveal 1s 1.8s ease forwards;
}

.final-section.playing .final-name {
    animation: finalNameReveal 1.2s 3s ease forwards;
}

.final-section.playing .final-custom-message {
    animation: finalLineReveal 1s 4.2s ease forwards;
}

.final-section.playing .final-love-button {
    animation: finalLineReveal 1s 5.25s ease forwards;
}

.final-sequence-line {
    margin: 15px 0 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.35rem, 4vw, 2.25rem);
}

.final-name {
    margin: 15px 0 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(4.3rem, 14vw, 9rem);
    font-weight: 400;
    line-height: 0.95;
}

.final-custom-message {
    max-width: 740px;
    margin: 28px auto 0;
    color: rgba(255, 255, 255, 0.78);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.1rem, 3vw, 1.55rem);
    line-height: 1.7;
}

.final-love-button,
.final-button {
    display: inline-block;
    margin-top: 35px;
    border: 0;
    border-radius: 999px;
    padding: 16px 25px;
    color: #a52451;
    background: #fff;
    box-shadow: 0 18px 50px rgba(60, 0, 23, 0.28);
    font-weight: 900;
    text-decoration: none;
}

.final-response {
    margin-top: 20px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.2rem;
    font-style: italic;
}

.final-response.visible {
    animation: finalLineReveal 0.8s ease forwards;
}

/* =========================================================
   SCROLL REVEALS
   ========================================================= */

.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition:
        opacity 0.85s ease,
        transform 0.85s ease;
}

.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

.shake {
    animation: shake 0.4s ease;
}

/* =========================================================
   THEMES
   ========================================================= */

.theme-midnight {
    --page-bg: #171419;
    --text: #f8edf2;
}

.theme-midnight .welcome-section,
.theme-midnight .timer-section,
.theme-midnight .puzzle-section {
    color: #f8edf2;
    background:
        radial-gradient(
            circle at 20% 10%,
            rgba(195, 58, 104, 0.22),
            transparent 30%
        ),
        #1b171d;
}

.theme-midnight .welcome-copy,
.theme-midnight .puzzle-heading p:last-child,
.theme-midnight .timer-card span,
.theme-midnight .timer-footer {
    color: rgba(255, 255, 255, 0.68);
}

.theme-midnight .puzzle-card,
.theme-midnight .timer-card {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

.theme-cream {
    --page-bg: #fffaf0;
    --secondary: #efe3cd;
    --text: #493b33;
}

.theme-cream .welcome-section,
.theme-cream .timer-section {
    background:
        radial-gradient(
            circle at 20% 15%,
            rgba(255, 255, 255, 0.95),
            transparent 32%
        ),
        linear-gradient(145deg, #fffaf0, #efe3cd);
}

/* =========================================================
   ANIMATIONS
   ========================================================= */

@keyframes builderFlowerFloat {
    50% {
        transform: translateY(-12px) rotate(4deg);
    }
}

@keyframes ambientDrift {
    50% {
        transform: translate(25px, 20px) scale(1.08);
    }
}

@keyframes heartFloat {
    50% {
        transform: translateY(-8px);
    }
}

@keyframes flowerBloom {
    0% {
        opacity: 0;
        transform: scale(0.1) rotate(-8deg);
    }

    70% {
        opacity: 1;
    }

    100% {
        opacity: 1;
        transform: scale(1.15) rotate(0);
    }
}

@keyframes transitionMessageHold {
    0% {
        opacity: 0;
        transform: translateY(14px);
    }

    15% {
        opacity: 1;
        transform: translateY(0);
    }

    88% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-8px);
    }
}

@keyframes fallingItem {
    to {
        transform:
            translate3d(var(--drift), 115vh, 0)
            rotate(720deg);
    }
}

@keyframes arrowBob {
    50% {
        transform: translateY(6px);
    }
}

@keyframes softRotate {
    to {
        transform: rotate(360deg);
    }
}

@keyframes puzzleSnap {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(0.97);
    }

    72% {
        transform: scale(1.035);
    }

    100% {
        transform: scale(1.015);
    }
}

@keyframes puzzleHeartBeat {
    20% {
        transform: scale(1.2);
    }

    40% {
        transform: scale(1);
    }

    60% {
        transform: scale(1.15);
    }

    80% {
        transform: scale(1);
    }
}

@keyframes writingCursor {
    50% {
        opacity: 0;
    }
}

@keyframes drawSignature {
    to {
        opacity: 1;
        clip-path: inset(0 0 0 0);
    }
}

@keyframes stampFlower {
    70% {
        opacity: 1;
        transform: scale(0.86) rotate(-5deg);
    }

    100% {
        opacity: 0.78;
        transform: scale(1) rotate(-3deg);
    }
}

@keyframes recordSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes starsMove {
    to {
        transform: translate3d(-120px, 100px, 0);
    }
}

@keyframes finalHeartbeat {
    20% {
        transform: scale(1.13);
    }

    35% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.17);
    }

    70% {
        transform: scale(1);
    }
}

@keyframes finalLineReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes finalNameReveal {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }

    70% {
        opacity: 1;
        transform: translateY(0) scale(1.04);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes shake {
    25% {
        transform: translateX(-9px);
    }

    50% {
        transform: translateX(9px);
    }

    75% {
        transform: translateX(-5px);
    }
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 991px) {
    .builder-hero {
        padding-top: 3rem;
    }

    .builder-summary {
        position: static !important;
    }

    .phone-showcase {
        min-height: 570px;
    }
}

@media (max-width: 850px) {
    .premium-playlist,
    .playlist-card {
        grid-template-columns: 1fr;
    }

    .playlist-visual {
        width: min(100%, 430px);
        margin: 0 auto;
    }

    .playlist-information,
    .playlist-card {
        text-align: center;
    }

    .playlist-track-list {
        text-align: left;
    }

    .timer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 575px) {
    .builder-hero {
        padding: 2.5rem 0 4rem;
    }

    .builder-hero h1 {
        font-size: clamp(3.15rem, 15vw, 4.7rem);
    }

    .builder-hero .lead {
        font-size: 1rem;
    }

    .builder-hero .btn {
        width: 100%;
    }

    .phone-showcase {
        min-height: 515px;
    }

    .phone-frame {
        width: 260px;
        height: 510px;
        border-width: 8px;
        border-radius: 44px;
    }

    .form-section {
        padding: 1.4rem;
        border-radius: 23px;
    }

    .step-number {
        top: 0.75rem;
        right: 1rem;
        font-size: 3.2rem;
    }

    .summary-card {
        padding: 1.4rem;
        border-radius: 23px;
    }
}

@media (max-width: 520px) {
    .passcode-screen {
        padding-top: max(18px, env(safe-area-inset-top));
        padding-bottom: max(18px, env(safe-area-inset-bottom));
    }

    .passcode-panel {
        margin-top: -8px;
    }

    .pixel-heart {
        width: 82px;
        height: 74px;
        margin-bottom: 17px;
    }

    .passcode-panel h1 {
        font-size: 2.25rem;
    }

    .passcode-dots {
        margin: 24px 0 21px;
    }

    .keypad {
        grid-template-columns: repeat(3, 64px);
        gap: 12px 15px;
    }

    .key {
        width: 64px;
        height: 64px;
    }

    .story-section {
        min-height: 100dvh;
        padding: 64px 0;
    }

    .welcome-title {
        font-size: clamp(3.8rem, 18vw, 5.7rem);
    }

    .welcome-copy {
        padding-inline: 8px;
        font-size: 1.08rem;
    }

    .puzzle-heading {
        margin-bottom: 24px;
    }

    .puzzle-heading h2 {
        font-size: 2.65rem;
    }

    .puzzle-card {
        padding: 10px;
        border-radius: 21px;
    }

    .puzzle-grid {
        gap: 4px;
        padding: 4px;
    }

    .puzzle-tile {
        border-radius: 8px;
    }

    .letter-envelope {
        min-height: 610px;
    }

    .letter-paper {
        width: calc(100% - 20px);
        min-height: 525px;
        margin-top: 60px;
        padding: 34px 23px;
    }

    .envelope-back,
    .envelope-flap {
        top: 80px;
    }

    .wax-seal {
        top: 250px;
    }

    .open-letter-hint {
        top: 345px;
        width: 100%;
        text-align: center;
    }

    .letter-copy {
        font-size: 1.08rem;
        line-height: 1.8;
    }

    .memory-card {
        width: 84vw;
        flex-basis: 84vw;
    }

    .memory-card-content {
        min-height: 210px;
        padding: 23px 23px 48px;
    }

    .memory-card h3 {
        font-size: 1.7rem;
    }

    .reasons-deck {
        width: min(100%, 360px);
        height: 345px;
    }

    .reason-card-front,
    .reason-card-back {
        padding: 27px;
        border-radius: 25px;
    }

    .reason-card-front strong {
        font-size: 1.8rem;
    }

    .scratch-card {
        min-height: 270px;
        border-width: 7px;
        border-radius: 25px;
    }

    .scratch-secret {
        min-height: 256px;
        padding: 26px;
    }

    .playlist-visual {
        width: min(84vw, 390px);
    }

    .playlist-information h2,
    .playlist-copy h2 {
        font-size: 2.8rem;
    }

    .playlist-play-button {
        width: 64px;
        height: 64px;
        right: 18px;
        bottom: 18px;
    }

    .timer-grid {
        gap: 8px;
    }

    .timer-card {
        padding: 23px 8px;
        border-radius: 20px;
    }

    .timer-card strong {
        font-size: 2.65rem;
    }

    .final-name {
        font-size: clamp(4rem, 17vw, 5.8rem);
    }

    .final-custom-message {
        padding-inline: 5px;
        font-size: 1.15rem;
    }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =========================================================
   DEFINITIVE MOBILE WIDTH FIX
   Keep this block at the VERY END of the stylesheet.
   ========================================================= */

html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
}

body,
body.gift-body {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden !important;
    position: relative;
}

#giftContent {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
}

.story-section,
.passcode-screen,
.flower-transition,
.celebration-layer,
.progress-line {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
}

/* Prevent Bootstrap rows from extending outside their container. */
.story-section > .container,
.story-section > .container-fluid,
.passcode-screen > .container,
#giftContent .container,
#giftContent .container-fluid {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
}

#giftContent .row,
.story-section .row,
.passcode-screen .row {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    --bs-gutter-x: 0 !important;
}

#giftContent .row > *,
.story-section .row > *,
.passcode-screen .row > * {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Make all principal content blocks shrink inside the viewport. */
.passcode-panel,
.puzzle-heading,
.puzzle-card,
.letter-envelope,
.letter-paper,
.memory-heading,
.memory-slider,
.memory-card,
.reasons-heading,
.reasons-deck,
.reason-card,
.scratch-heading,
.scratch-card,
.premium-playlist,
.playlist-card,
.playlist-visual,
.playlist-information,
.playlist-track-list,
.timer-grid,
.final-custom-message {
    max-width: 100% !important;
    min-width: 0 !important;
}

/* Long user-entered text or URLs must wrap instead of widening the page. */
h1,
h2,
h3,
p,
span,
strong,
small,
a,
button,
li,
.letter-copy,
.final-custom-message,
.playlist-description,
.track-title {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Horizontal memory slider may scroll internally but cannot widen the page. */
.memory-slider {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    contain: inline-size;
}

.memory-card {
    width: min(82%, 430px) !important;
    flex: 0 0 min(82%, 430px) !important;
}

/* Decorative and animated elements must not affect page width. */
.soft-flower,
.final-flower,
.memory-decoration,
.passcode-ambient,
.final-glow,
.final-moving-stars,
.floral-pattern,
.playlist-visual::after,
.builder-hero::before,
.builder-hero::after,
.form-section::after {
    max-width: none;
}

/* Media must never exceed its parent. */
img,
svg,
canvas,
video,
iframe {
    display: block;
    max-width: 100% !important;
}

/* iPhone-specific hardening. */
@supports (-webkit-touch-callout: none) {
    html,
    body,
    body.gift-body,
    #giftContent {
        overflow-x: hidden !important;
    }
}

@media (max-width: 575px) {
    .story-section > .container,
    .story-section > .container-fluid,
    #giftContent .container,
    #giftContent .container-fluid {
        padding-left: 18px !important;
        padding-right: 18px !important;
    }

    .letter-paper {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .premium-playlist,
    .playlist-card {
        width: 100% !important;
    }

    .playlist-visual {
        width: min(100%, 390px) !important;
    }

    .reasons-deck,
    .scratch-card,
    .puzzle-card,
    .timer-grid {
        width: 100% !important;
    }
}


/* Builder usability fixes */
.builder-summary .summary-card { max-height: calc(100vh - 120px); overflow-y: auto; }
.memory-builder-block .remove-memory { flex: 0 0 auto; }
@media (max-width: 991.98px) { .builder-summary .summary-card { max-height: none; overflow: visible; } }
