html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    margin: 0;
    font-family: "Inter", sans-serif;
    background: #f2eee9;
    color: #010101;
}

.wm-page {
    position: relative;
    height: 100vh;
    padding: 40px 16px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.wm-back-link {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 4;
    display: block;
    text-decoration: none;
    background: transparent;
    color: #723366;
    font-size: 44px;
    line-height: 1;
    font-family: "Inter", sans-serif;
    font-weight: 500;
}

.wm-back-link:hover {
    opacity: 0.85;
}

.wish-top-blobs {
    position: absolute;
    top: -78px;
    right: -117px;
    width: 360px;
    height: 240px;
    pointer-events: none;
    z-index: 1;
}

.wish-bottom-blobs {
    position: absolute;
    bottom: -33px;
    left: -120px;
    width: 360px;
    height: 240px;
    pointer-events: none;
    z-index: 1;
}

.wm-top-blob {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    transform: rotate(65.44deg);
}

.wm-top-blob--light {
    top: -78px;
    right: 86px;
    background: rgba(245, 223, 226, 0.3);
}

.wm-top-blob--dark {
    top: -14px;
    right: -4px;
    background: rgba(245, 223, 226, 0.5);
}

.wm-bottom-blob--light {
    top: 24px;
    left: 68px;
    background: rgba(245, 223, 226, 0.3);
}

.wm-bottom-blob--dark {
    top: 72px;
    left: -18px;
    background: rgba(245, 223, 226, 0.5);
}

.wm-blob-dot {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(114, 51, 102, 0.28);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.55);
    animation: wm-dot-glow 2.8s ease-in-out infinite;
}

.wm-blob-dot--1 { width: 25px; height: 25px; top: 111px; right: 242px; filter: blur(2.5px); animation-delay: 0s; }
.wm-blob-dot--2 { width: 15px; height: 15px; top: 107px; right: 331px; filter: blur(2px); animation-delay: 0.4s; }
.wm-blob-dot--3 { width: 16px; height: 16px; top: 239px; right: 155px; filter: blur(1.7px); animation-delay: 0.8s; }
.wm-blob-dot--4 { width: 8px; height: 8px; top: 214px; right: 151px; filter: blur(1px); animation-delay: 1.2s; }
.wm-blob-dot--5 { width: 10px; height: 10px; top: 94px; right: 218px; filter: blur(1px); animation-delay: 1.6s; }
.wm-blob-dot--out-1 { width: 10px; height: 10px; top: 98px; right: 309px; filter: blur(1.4px); animation-delay: 0.2s; z-index: 1; }
.wm-blob-dot--out-2 { width: 9px; height: 9px; top: 151px; right: 321px; filter: blur(1px); animation-delay: 1s; z-index: 1; }
.wm-blob-dot--b1 { width: 21px; height: 21px; top: 94px; left: 230px; filter: blur(2.4px); animation-delay: 0.1s; }
.wm-blob-dot--b2 { width: 13px; height: 13px; top: 132px; left: 304px; filter: blur(1.8px); animation-delay: 0.55s; }
.wm-blob-dot--b3 { width: 14px; height: 14px; top: 202px; left: 138px; filter: blur(1.5px); animation-delay: 0.95s; }
.wm-blob-dot--b4 { width: 8px; height: 8px; top: 172px; left: 126px; filter: blur(1px); animation-delay: 1.35s; }
.wm-blob-dot--b5 { width: 10px; height: 10px; top: 74px; left: 188px; filter: blur(1px); animation-delay: 1.75s; }
.wm-blob-dot--out-left-1 { width: 10px; height: 10px; bottom: 201px; left: 332px; filter: blur(1.4px); animation-delay: 0.35s; z-index: 1; }
.wm-blob-dot--out-left-2 { width: 9px; height: 9px; bottom: 149px; left: 301px; filter: blur(1px); animation-delay: 1.15s; z-index: 1; }

@keyframes wm-dot-glow {
    0%, 100% { opacity: 0.45; transform: scale(0.92); }
    50% { opacity: 1; transform: scale(1.08); }
}

.wm-slider {
    width: 100%;
    max-width: 1140px;
    position: relative;
    z-index: 2;
}

.wm-card {
    position: relative;
    border: 8px solid #723366;
    border-radius: 40px;
    background: #f8e4e4db;
    padding: 58px 28px;
    display: grid;
    grid-template-columns: 285px 1fr;
    gap: 20px;
}

.wm-polaroid {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f2eeed;
    border-radius: 8px;
    box-shadow: 0 0 8px rgba(69, 69, 69, 0.12);
    transform: rotate(-8deg);
    padding: 4px 4px 8px;
    gap: 16px;
    width: 285px;
    height: 312px;
    margin-left: 12px;
    margin-top: 10px;
}

.wm-polaroid-pin {
    position: absolute;
    left: -5px;
    top: -11px;
    width: 36px;
    height: 43px;
    transform: rotate(-38deg);
}

.wm-polaroid-image {
    width: 277px;
    height: 258px;
    object-fit: cover;
    border-radius: 8px 8px 8px 32px;
    display: block;
}

.wm-polaroid-name {
    margin: 0;
    text-align: center;
    font-family: "Great Vibes", cursive;
    font-size: 24px;
    line-height: 30px;
    color: #723366;
}

.wm-polaroid-heart-corner {
    position: absolute;
    left: 12px;
    bottom: 12px;
    width: 30px;
    height: auto;
    object-fit: contain;
    transform: rotate(-16deg);
    z-index: 3;
    pointer-events: none;
}

.wm-note {
    width: 100%;
    max-width: 700px;
    justify-self: start;
    margin-left: 44px;
}

.wm-note-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 16px;
}

.wm-note h1 {
    margin: 0;
    color: #8F5A6A;
    font-size: 28px;
    line-height: 1.1;
    font-weight: bold;
}

.wm-note-heart {
    width: 86px;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.wm-note-box {
    border: 1px dashed #723366;
    border-radius: 24px;
    background: #fbf1f2;
    padding: 14px;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wm-to {
    margin: 0;
    font-size: 24px;
    line-height: 1.5;
    color: #b68dae;
}

.wm-message {
    margin: 0;
    font-size: 20px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.wm-card.is-empty {
    display: block;
    padding: 42px 24px;
}

.wm-card.is-empty .wm-polaroid,
.wm-card.is-empty .wm-polaroid-heart-corner,
.wm-card.is-empty .wm-note-head,
.wm-card.is-empty .wm-to,
.wm-card.is-empty .wm-sign {
    display: none;
}

.wm-card.is-empty .wm-note {
    max-width: none;
    margin-left: 0;
}

.wm-card.is-empty .wm-note-box {
    min-height: 320px;
    display: grid;
    place-items: center;
    border-style: solid;
}

.wm-message--empty {
    font-family: "Great Vibes", cursive;
    font-size: clamp(44px, 7vw, 92px);
    line-height: 1.1;
    text-align: center;
    color: #723366;
    letter-spacing: 0.02em;
    text-shadow: 0 8px 24px rgba(114, 51, 102, 0.2);
    animation: wm-empty-float 2.6s ease-in-out infinite;
}

@keyframes wm-empty-float {
    0%, 100% {
        transform: translateY(0) scale(0.98);
        opacity: 0.78;
    }
    50% {
        transform: translateY(-8px) scale(1);
        opacity: 1;
    }
}

.wm-sign {
    margin: auto -6px 6px auto;
    align-self: flex-end;
    width: auto;
    max-width: 180px;
    max-height: 72px;
    object-fit: contain;
    display: block;
    transform: translateY(-6px);
}

.wm-controls {
    margin: 26px auto 0;
    width: 224px;
    height: 56px;
    border-radius: 40px;
    background: #ece4e2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
}

.wm-arrow {
    border: 0;
    background: transparent;
    color: #723366;
    font-size: 44px;
    line-height: 1;
    cursor: pointer;
}

.wm-arrow:disabled {
    opacity: 0.45;
    cursor: default;
}

.wm-count {
    color: #723366;
    font-weight: 700;
    font-size: 24px;
}

@media (max-width: 1024px) {
    .wm-card {
        grid-template-columns: 250px 1fr;
        padding: 40px 22px;
        gap: 16px;
    }

    .wm-polaroid {
        width: 250px;
        height: 282px;
        margin-left: 4px;
    }

    .wm-polaroid-image {
        width: 242px;
        height: 228px;
    }

    .wm-note {
        max-width: 560px;
        margin-left: 20px;
    }

    .wm-note h1 {
        font-size: 24px;
    }

    .wm-note-box {
        min-height: 280px;
    }

    .wm-to {
        font-size: 21px;
    }

    .wm-message {
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    html,
    body {
        height: auto;
        min-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .wm-page {
        padding: 18px 10px 10px;
        min-height: 100vh;
        min-height: 100dvh;
        height: auto;
        overflow: visible;
        align-items: flex-start;
    }

    .wm-back-link {
        top: 12px;
        left: 12px;
        font-size: 38px;
    }

    .wm-slider {
        max-width: 440px;
        padding-top: 54px;
    }

    .wm-card {
        border-width: 6px;
        border-radius: 28px;
        grid-template-columns: 1fr;
        padding: 16px 14px 18px;
        gap: 14px;
        touch-action: pan-y;
    }

    .wm-polaroid {
        width: 216px;
        height: 246px;
        margin: 0 auto;
        transform: rotate(-6deg);
        gap: 12px;
    }

    .wm-polaroid-image {
        width: 208px;
        height: 194px;
    }

    .wm-polaroid-name {
        font-size: 21px;
        line-height: 26px;
    }

    .wm-polaroid-pin {
        width: 30px;
        height: 36px;
        left: -6px;
        top: -9px;
    }

    .wm-note {
        max-width: none;
        margin-left: 0;
    }

    .wm-note-head {
        margin: 0 0 10px;
    }

    .wm-note h1 {
        font-size: 18px;
    }

    .wm-note-heart {
        width: 62px;
    }

    .wm-note-box {
        border-radius: 18px;
        padding: 12px;
        min-height: 210px;
        gap: 12px;
    }

    .wm-to {
        font-size: 18px;
        line-height: 1.35;
    }

    .wm-message {
        font-size: 15px;
        line-height: 1.45;
    }

    .wm-card.is-empty {
        padding: 16px 14px 18px;
    }

    .wm-card.is-empty .wm-note-box {
        min-height: 210px;
    }

    .wm-message--empty {
        font-size: clamp(34px, 10vw, 62px);
    }

    .wm-sign {
        max-width: 140px;
        max-height: 54px;
    }

    .wm-controls {
        margin-top: 10px;
        width: 178px;
        height: 46px;
        gap: 28px;
    }

    .wm-arrow {
        font-size: 34px;
    }

    .wm-count {
        font-size: 18px;
    }

    .wish-top-blobs {
        top: -110px;
        right: -175px;
        transform: scale(0.7);
        transform-origin: top right;
    }

    .wish-bottom-blobs {
        display: none;
    }

    .wm-blob-dot--out-left-1,
    .wm-blob-dot--out-left-2 {
        display: none;
    }
}

@media (max-width: 390px) {
    .wm-slider {
        padding-top: 50px;
    }

    .wm-page {
        padding: 14px 8px 8px;
    }

    .wm-back-link {
        top: 10px;
        left: 10px;
        font-size: 34px;
    }

    .wm-card {
        padding: 14px 10px 14px;
        gap: 12px;
    }

    .wm-polaroid {
        width: 192px;
        height: 222px;
    }

    .wm-polaroid-image {
        width: 184px;
        height: 170px;
    }

    .wm-note h1 {
        font-size: 18px;
    }

    .wm-note-heart {
        width: 54px;
    }

    .wm-note-box {
        min-height: 186px;
    }

    .wm-to {
        font-size: 16px;
    }

    .wm-message {
        font-size: 14px;
    }

    .wm-message--empty {
        font-size: clamp(30px, 11vw, 50px);
    }

    .wm-controls {
        width: 166px;
        height: 42px;
        gap: 24px;
    }

    .wm-arrow {
        font-size: 30px;
    }

    .wm-count {
        font-size: 16px;
    }
}
