* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Dancing Script', cursive;
    background: #fdf6e3;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.hearts-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.hearts-bg span {
    position: absolute;
    color: #f5b9c6;
    opacity: 0.55;
    bottom: -10%;
    animation: floatUp linear infinite;
}

@keyframes floatUp {
    from {
        transform: translateY(0) rotate(0deg);
    }

    to {
        transform: translateY(-110vh) rotate(20deg);
    }
}

.container {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 20px 80px;
    text-align: center;
}

.intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    background: linear-gradient(160deg, #f7a8bd, #ec5f86);
    transition: opacity 0.5s ease, visibility 0.5s;
}

.intro-overlay.fading {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.intro-heart {
    width: 160px;
    height: 150px;
}

.intro-heart-outline {
    fill: none;
    stroke: #fff;
    stroke-width: 1.2;
}

.intro-heart-fill {
    fill: #fff;
    transition: y 0.05s linear;
}

.hold-btn {
    background: #fff;
    color: #ec5f86;
    border: none;
    border-radius: 30px;
    padding: 16px 44px;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
    user-select: none;
    transition: transform 0.15s ease;
}

.hold-btn:active {
    transform: scale(0.95);
}

.container {
    transition: opacity 0.35s ease, transform 0.35s ease;
    opacity: 1;
    transform: scale(1);
}

.container.hidden {
    opacity: 0;
    transform: scale(0.96);
    pointer-events: none;
    position: absolute;
    inset: 0;
}

.title {
    color: #ec5f86;
    font-size: 3rem;
    letter-spacing: 6px;
    margin-bottom: 70px;
    text-shadow: 1px 1px 0 #fff;
}

.people {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    margin-bottom: 50px;
}

.person {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    border: 4px solid #fff;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.person-name {
    margin-top: 14px;
    color: #555;
    font-size: 1.1rem;
}

.counter {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.heart-icon {
    color: #ec5f86;
    font-size: 2.5rem;
    display: inline-block;
    animation: heartbeat 1.1s ease-in-out infinite;
}

@keyframes heartbeat {

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

    25% {
        transform: scale(1.15);
    }

    50% {
        transform: scale(0.95);
    }

    75% {
        transform: scale(1.1);
    }
}

.days {
    color: #ec5f86;
    font-size: 2.6rem;
    font-weight: bold;
    margin-top: 6px;
}

.days-label {
    color: #ec5f86;
    font-size: 1.1rem;
    margin-top: 4px;
}

.time-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 50px;
}

.time-unit {
    background: #fff5f8;
    border: 3px solid #f5b9c6;
    border-radius: 16px;
    padding: 16px 24px;
    font-size: 2.2rem;
    font-weight: 700;
    color: #ec5f86;
    box-shadow: 0 4px 10px rgba(236, 95, 134, 0.18);
    min-width: 80px;
}

.colon {
    color: #ec5f86;
    font-size: 2.2rem;
    font-weight: bold;
}

.photo-btn {
    background: #ec5f86;
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 16px 40px;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(236, 95, 134, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.photo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(236, 95, 134, 0.45);
}

.memories-view {
    display: flex;
    flex-direction: row;
    position: fixed;
    inset: 0;
    z-index: 10;
    background: transparent;
    align-items: center;
    justify-content: center;
    gap: 60px;
    flex-wrap: wrap;
    padding: 40px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.96);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s;
}

.memories-view.open {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    pointer-events: auto;
}

.memories-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
}

.memories-hint {
    color: #444;
    font-size: 1.6rem;
    line-height: 1.5;
}

.memories-gif {
    width: 140px;
    height: auto;
    border-radius: 12px;
    object-fit: contain;
}

.memories-controls {
    display: flex;
    gap: 20px;
}

.icon-btn {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s ease;
}

.icon-btn:hover {
    transform: translateY(-2px) scale(1.05);
}

.camera-btn {
    background: #fff47f;
}

.back-btn {
    background: #20ffec;
    color: #fff;
}

.polaroid {
    background: #fff;
    padding: 10px 10px 28px;
    border-radius: 6px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transform: rotate(-4deg);
    transition: transform 0.25s ease;
}

.polaroid:hover {
    transform: rotate(0deg) scale(1.04);
}

.polaroid img {
    display: block;
    width: min(320px, 85vw);
    max-width: 100%;
    height: calc(min(320px, 85vw) * 3 / 4);
    object-fit: cover;
    border-radius: 2px;
    background: #111;
}

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 20;
    background: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
}

.lightbox.open {
    display: flex;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

@media (max-width: 700px) {
    .memories-view {
        flex-direction: column;
        gap: 20px;
        padding: 24px 16px;
    }

    .polaroid {
        order: 1;
    }

    .memories-info {
        order: 2;
        align-items: center;
        text-align: center;
    }

    .memories-hint {
        font-size: 1.3rem;
    }
}

@media (max-width: 600px) {
    body {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
    }

    .container {
        width: 100%;
    }

    .title {
        font-size: 2rem;
        letter-spacing: 3px;
    }

    .people {
        gap: 24px;
    }

    .avatar {
        width: 100px;
        height: 100px;
    }

    .time-unit {
        padding: 12px 16px;
        font-size: 1.4rem;
        min-width: 56px;
    }
}