* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    position: fixed;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: radial-gradient(ellipse at top, #1a0b2e 0%, #0d0520 40%, #05010d 100%);
    color: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* DAY PROGRESS */
.day-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #ff5c9d, #ffb8d4, #7fdde8);
    box-shadow: 0 0 10px rgba(255, 92, 157, 0.7);
    z-index: 100;
    transition: width 1s linear;
}

/* PRELOADER */
.preloader {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, #12061f 0%, #05010d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.heart {
    width: 88px;
    height: 88px;
    display: block;
    animation: heartbeat 1.2s ease-in-out infinite;
    transform-origin: 50% 55%;
    will-change: transform;
    filter: drop-shadow(0 0 14px rgba(255, 45, 120, 0.85));
}

@keyframes heartbeat {
    0%   { transform: scale(1); }
    14%  { transform: scale(1.15); }
    28%  { transform: scale(1); }
    42%  { transform: scale(1.15); }
    70%  { transform: scale(1); }
    100% { transform: scale(1); }
}

.preloader-text {
    color: #ffb8d4;
    font-size: 16px;
    letter-spacing: 0.5px;
    animation: fadeText 2s ease-in-out infinite;
}

@keyframes fadeText {
    0%, 100% { opacity: 0.5; }
    50%      { opacity: 1; }
}

/* CELEBRATION */
.celebration {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(30, 8, 50, 0.98), rgba(5, 1, 13, 0.99));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.celebration.show {
    opacity: 1;
    visibility: visible;
}

.celebration.anniversary-celebration {
    background:
        radial-gradient(circle at 50% 42%, rgba(255, 92, 157, .18), transparent 28%),
        radial-gradient(circle at 20% 20%, rgba(255, 184, 212, .10), transparent 24%),
        radial-gradient(circle at 80% 75%, rgba(255, 92, 157, .10), transparent 26%),
        radial-gradient(ellipse at center, rgba(35, 7, 52, .985), rgba(5, 1, 13, .995));
}

.celebration.anniversary-celebration::before,
.celebration.anniversary-celebration::after {
    content: "❤  ✦  ❤  ✦  ❤  ✦  ❤";
    position: absolute;
    left: 0;
    width: 100%;
    text-align: center;
    color: rgba(255, 92, 157, .55);
    font-size: 18px;
    letter-spacing: 14px;
    text-shadow: 0 0 14px rgba(255, 92, 157, .8);
    animation: anniversaryFloat 4s ease-in-out infinite;
    pointer-events: none;
}

.celebration.anniversary-celebration::before { top: 13%; }
.celebration.anniversary-celebration::after { bottom: 13%; animation-delay: -2s; }

.anniversary-celebration .celebration-content {
    position: relative;
    padding: 46px 28px;
    border: 1px solid rgba(255, 92, 157, .34);
    border-radius: 30px;
    background: rgba(255, 92, 157, .055);
    box-shadow: 0 0 45px rgba(255, 92, 157, .18), inset 0 0 35px rgba(255, 92, 157, .045);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    animation: anniversaryCard 2.8s ease-in-out infinite;
}

.anniversary-celebration .celebration-emoji {
    filter: drop-shadow(0 0 22px rgba(255, 92, 157, .8));
}

@keyframes anniversaryCard {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.018); }
}

@keyframes anniversaryFloat {
    0%, 100% { transform: translateY(0); opacity: .45; }
    50% { transform: translateY(-10px); opacity: .9; }
}

.celebration-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px 30px;
    max-width: 400px;
    text-align: center;
}

.celebration-emoji {
    font-size: 72px;
    animation: bounceEmoji 1.5s ease-in-out infinite;
}

@keyframes bounceEmoji {
    0%, 100% { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-12px) scale(1.1); }
}

.celebration-title {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #ffb8d4 60%, #ff5c9d 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.3;
}

.celebration-text {
    font-size: 16px;
    color: rgba(255, 184, 212, 0.95);
    line-height: 1.5;
}

.celebration-btn {
    margin-top: 16px;
    padding: 14px 32px;
    border-radius: 16px;
    border: 1px solid rgba(255, 92, 157, 0.5);
    background: linear-gradient(135deg, rgba(255, 45, 120, 0.4), rgba(255, 92, 157, 0.25));
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
    box-shadow: 0 0 30px rgba(255, 92, 157, 0.4);
}

.celebration-btn:active { transform: scale(0.96); }

/* MAIN */
.main {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 1s ease 0.3s;
    overflow: hidden;
}

.main.visible { opacity: 1; }

.stars-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(1.5px 1.5px at 20% 30%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1.5px 1.5px at 70% 20%, rgba(255,184,212,0.8), transparent),
        radial-gradient(1px 1px at 40% 70%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1.5px 1.5px at 85% 60%, rgba(120,220,232,0.6), transparent),
        radial-gradient(1px 1px at 15% 85%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 60% 90%, rgba(255,184,212,0.5), transparent),
        radial-gradient(1.5px 1.5px at 90% 15%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 30% 15%, rgba(255,255,255,0.4), transparent);
}

/* PARTICLES */
.particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.particle {
    position: absolute;
    bottom: -10px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #ff5c9d;
    box-shadow: 0 0 8px currentColor;
    animation: rise linear infinite;
}

.particle.aqua {
    background: #7fdde8;
    box-shadow: 0 0 8px #7fdde8;
}

@keyframes rise {
    0% { transform: translateY(0) translateX(0) scale(0.6); opacity: 0; }
    10% { opacity: 0.9; }
    90% { opacity: 0.9; }
    100% { transform: translateY(-105vh) translateX(var(--drift, 20px)) scale(1); opacity: 0; }
}

/* SLIDER */
.slider {
    position: relative;
    flex: 1;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    z-index: 2;
}

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

.slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    scroll-snap-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 18px 20px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.slide-inner {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    margin: auto 0;
}

.slide-title {
    font-size: 15px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 184, 212, 0.9);
    font-weight: 600;
    text-align: center;
}

/* GREETING */
.greeting {
    font-size: 26px;
    line-height: 1.35;
    font-weight: 600;
    text-align: center;
    background: linear-gradient(135deg, #ffffff 0%, #ffb8d4 60%, #ff5c9d 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: #ff5c9d;
    margin-left: 3px;
    vertical-align: -0.15em;
    animation: blink 0.7s step-end infinite;
    box-shadow: 0 0 8px rgba(255, 92, 157, 0.9);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0; }
}

/* LOVE LANGS */
.love-langs {
    font-size: 15px;
    letter-spacing: 1.5px;
    color: rgba(255, 184, 212, 0.85);
    text-align: center;
    min-height: 22px;
    transition: opacity 0.5s ease, transform 0.5s ease;
    font-weight: 500;
}

.love-langs.changing {
    opacity: 0;
    transform: translateY(-6px);
}

/* EVENT CARD */
.event-card {
    width: 100%;
    padding: 20px 16px;
    background: linear-gradient(135deg, rgba(255, 92, 157, 0.12), rgba(127, 221, 232, 0.12));
    border: 1px solid rgba(255, 92, 157, 0.35);
    border-radius: 22px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255,255,255,0.12);
}

.event-label {
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255, 184, 212, 0.9);
    margin-bottom: 10px;
    font-weight: 600;
}

.event-counter {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
}

#eventDays {
    font-size: 52px;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 22px rgba(255, 92, 157, 0.8);
    letter-spacing: 1px;
    line-height: 1;
}

.event-unit {
    font-size: 15px;
    color: rgba(255,255,255,0.7);
}

.event-sub {
    margin-top: 8px;
    font-size: 13px;
    color: rgba(255,255,255,0.55);
    letter-spacing: 0.5px;
}

.event-remind-btn {
    margin-top: 14px;
    width: 100%;
    padding: 12px 16px;
    border-radius: 13px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #ffb8d4;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
    transition: transform 0.15s ease, background 0.2s ease;
}

.event-remind-btn:active {
    transform: scale(0.97);
    background: rgba(255, 92, 157, 0.2);
}

/* TIMER */
.timer-card {
    width: 100%;
    padding: 22px 14px 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 22px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.timer-title {
    text-align: center;
    font-size: 12px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(255, 184, 212, 0.85);
    margin-bottom: 16px;
    font-weight: 500;
}

.timer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
}

.time-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 3px 9px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 13px;
    min-height: 74px;
}

.time-value {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    line-height: 1;
    text-shadow: 0 0 14px rgba(255, 92, 157, 0.55);
    margin-bottom: 7px;
}

.time-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: rgba(255, 184, 212, 0.75);
    font-weight: 500;
}

/* GALLERY */
.gallery-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    border-radius: 20px;
    width: 100%;
}

.gallery-track::-webkit-scrollbar { display: none; }

.gallery-slide {
    flex: 0 0 100%;
    scroll-snap-align: center;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    aspect-ratio: 3 / 4;
}

.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 18px 16px 14px;
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
    color: #fff;
    font-size: 14px;
    text-align: center;
}

.gallery-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.gallery-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transition: all 0.3s ease;
}

.gallery-dot.active {
    background: #ff5c9d;
    width: 20px;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(255, 92, 157, 0.8);
}

.add-photo-btn {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px dashed rgba(255, 184, 212, 0.4);
    background: rgba(255, 92, 157, 0.08);
    color: #ffb8d4;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
    transition: transform 0.15s ease, background 0.2s ease;
}

.add-photo-btn:active {
    transform: scale(0.97);
    background: rgba(255, 92, 157, 0.2);
}

/* COMPLIMENT */
.compliment-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.compliment-btn {
    width: 100%;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid rgba(255, 184, 212, 0.3);
    background: rgba(255, 92, 157, 0.14);
    color: #ffb8d4;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.compliment-btn:active {
    transform: scale(0.97);
    background: rgba(255, 92, 157, 0.25);
}

.compliment-text {
    text-align: center;
    font-size: 18px;
    line-height: 1.5;
    color: #fff;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    padding: 0 8px;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.compliment-text.show {
    opacity: 1;
    transform: translateY(0);
}

/* CAPSULE */
.capsule-text {
    font-size: 13px;
    color: rgba(255,255,255,0.65);
    text-align: center;
    line-height: 1.5;
    padding: 0 10px;
}

.capsule-btn {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, rgba(255, 92, 157, 0.35), rgba(127, 221, 232, 0.35));
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
}

.capsule-btn:active { transform: scale(0.97); }

.capsule-message {
    font-size: 15px;
    line-height: 1.5;
    color: #ffb8d4;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s ease, opacity 0.4s ease, margin 0.4s ease;
    opacity: 0;
    text-align: center;
    padding: 0 8px;
}

.capsule-message.open {
    max-height: 400px;
    opacity: 1;
    margin-top: 6px;
}

/* KISS */
.kiss-zone {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.kiss-btn {
    width: 100%;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(255, 92, 157, 0.5);
    background: linear-gradient(135deg, rgba(255, 45, 120, 0.35), rgba(255, 92, 157, 0.2));
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 0 24px rgba(255, 92, 157, 0.25);
}

.kiss-btn:active { transform: scale(0.96); }

.kiss-emoji {
    font-size: 20px;
    display: inline-block;
    animation: pulseEmoji 1.6s ease-in-out infinite;
}

@keyframes pulseEmoji {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.2); }
}

.kiss-counter {
    font-size: 13px;
    color: rgba(255, 184, 212, 0.8);
    text-align: center;
}

.kiss-counter span {
    color: #fff;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

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

.flying-kiss {
    position: fixed;
    font-size: 26px;
    pointer-events: none;
    animation: flyKiss 1.6s ease-out forwards;
}

@keyframes flyKiss {
    0% { transform: translate(0, 0) scale(0.6) rotate(0deg); opacity: 0; }
    15% { opacity: 1; }
    100% { transform: translate(var(--tx, 0px), var(--ty, -300px)) scale(1.3) rotate(var(--rot, 20deg)); opacity: 0; }
}

/* BATTERY */
.battery-card {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    text-align: center;
}

.battery-text {
    font-size: 14px;
    color: #ffb8d4;
    line-height: 1.4;
}

.footer-note {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
    margin-top: 4px;
}

/* SLIDER NAV */
.slider-nav {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 20px 22px;
    background: linear-gradient(to top, rgba(5,1,13,0.9), transparent);
    flex-shrink: 0;
}

.nav-arrow {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    color: #ffb8d4;
    font-size: 22px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
    padding-bottom: 3px;
}

.nav-arrow:active { transform: scale(0.9); }

.slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transition: all 0.3s ease;
}

.slider-dot.active {
    background: #ff5c9d;
    width: 22px;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(255, 92, 157, 0.8);
}

/* LOVE DRAWING */
.love-drawing {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .55s ease, visibility .55s ease;
}

.love-drawing.show {
    opacity: 1;
    visibility: visible;
}

/* Более живое мягкое розовое свечение на всех карточках и рамках. */
.event-card,
.timer-card,
.time-block,
.gallery-slide,
.compliment-card,
.capsule-btn,
.kiss-btn,
.battery-card,
.add-photo-btn,
.nav-arrow,
.slider-dot,
.gallery-dot {
    transition: box-shadow .35s ease, border-color .35s ease, transform .2s ease, background .35s ease;
}

.event-card,
.timer-card,
.gallery-slide,
.battery-card {
    border-color: rgba(255, 92, 157, .30);
    box-shadow: 0 0 18px rgba(255, 92, 157, .08), 0 8px 32px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.12);
}

.event-card:hover,
.timer-card:hover,
.gallery-slide:hover,
.battery-card:hover,
.time-block:hover {
    border-color: rgba(255, 92, 157, .58);
    box-shadow: 0 0 26px rgba(255, 92, 157, .18), 0 8px 32px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.14);
}

.time-block {
    border-color: rgba(255, 92, 157, .18);
    box-shadow: inset 0 0 16px rgba(255, 92, 157, .025), 0 0 10px rgba(255, 92, 157, .04);
}

.event-card::after,
.timer-card::after,
.gallery-slide::after,
.battery-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 0 18px rgba(255, 92, 157, .06);
}

.event-card,
.timer-card,
.gallery-slide,
.battery-card { position: relative; }

@keyframes anniversaryGlow {
    0%, 100% { box-shadow: 0 0 18px rgba(255,92,157,.10), 0 8px 32px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.12); }
    50% { box-shadow: 0 0 34px rgba(255,92,157,.28), 0 8px 32px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.16); }
}

.event-card { animation: anniversaryGlow 3.2s ease-in-out infinite; }

@media (max-width: 360px) {
    .greeting { font-size: 22px; }
    .time-value { font-size: 20px; }
    .time-block { min-height: 68px; }
    #eventDays { font-size: 42px; }
    .slide { padding: 20px 14px 16px; }
}


/* ===== LOADING SAFETY =====
   JavaScript normally hides the preloader. This fallback makes sure a
   broken/blocked script cannot keep the loading screen forever. */
@keyframes preloaderFailsafe {
    0%, 70% { opacity: 1; visibility: visible; pointer-events: auto; }
    100% { opacity: 0; visibility: hidden; pointer-events: none; }
}

.preloader {
    animation: preloaderFailsafe 2s ease forwards;
}

@media (prefers-reduced-motion: reduce) {
    .preloader {
        animation-duration: 0.8s;
    }
}

/* ===== ENHANCED LOVE EFFECT ===== */
.love-drawing {
    background: radial-gradient(circle at 50% 36%, rgba(255, 35, 115, .035), transparent 42%);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    transition: opacity .28s ease, visibility .28s ease;
}

.love-drawing.show {
    animation: loveCanvasIn .45s ease-out both;
}

@keyframes loveCanvasIn {
    from { opacity: 0; filter: brightness(.7); }
    to { opacity: 1; filter: brightness(1); }
}

/* ===== PHONE LOVE EFFECT ===== */
.love-drawing {
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

@media (max-width: 600px) {
    .love-drawing {
        background: radial-gradient(circle at 50% 30%, rgba(255, 35, 115, .065), transparent 46%);
    }
}

@media (max-width: 380px) {
    .love-drawing { background: radial-gradient(circle at 50% 28%, rgba(255, 35, 115, .08), transparent 48%); }
}


/* ===== STAR SKY 2.0 ===== */
.stars-bg::before,
.stars-bg::after {
    content: "";
    position: absolute;
    inset: -20%;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 12% 18%, rgba(255,255,255,.9) 0 1px, transparent 1.8px),
        radial-gradient(circle at 34% 64%, rgba(255,184,212,.8) 0 1.2px, transparent 2px),
        radial-gradient(circle at 62% 28%, rgba(255,255,255,.75) 0 1px, transparent 1.8px),
        radial-gradient(circle at 83% 74%, rgba(255,122,174,.8) 0 1px, transparent 1.8px),
        radial-gradient(circle at 92% 34%, rgba(255,255,255,.7) 0 1.2px, transparent 2px);
    background-size: 210px 190px, 260px 230px, 190px 210px, 240px 220px, 180px 170px;
    animation: starDrift 28s linear infinite;
    opacity: .62;
}
.stars-bg::after {
    inset: -10%;
    filter: blur(.3px);
    opacity: .35;
    animation: starDriftReverse 36s linear infinite, starTwinkle 4s ease-in-out infinite;
}
@keyframes starDrift { from { transform: rotate(0deg) translate3d(0,0,0); } to { transform: rotate(4deg) translate3d(18px,-10px,0); } }
@keyframes starDriftReverse { from { transform: rotate(0deg) translate3d(0,0,0); } to { transform: rotate(-3deg) translate3d(-14px,12px,0); } }
@keyframes starTwinkle { 0%,100% { opacity:.25; } 50% { opacity:.55; } }

/* ===== EVENT CARDS ===== */
.event-actions { display:flex; gap:8px; justify-content:center; flex-wrap:wrap; }
.event-actions .event-remind-btn { flex:1 1 130px; min-width:120px; }
.birthday-card { background: linear-gradient(135deg, rgba(255,190,85,.10), rgba(255,92,157,.12)); border-color: rgba(255,180,100,.28); }
.birthday-card #birthdayDays { color:#fff7df; text-shadow:0 0 22px rgba(255,173,83,.65); }
.event-card.is-today { animation: todayPulse 1.7s ease-in-out infinite; }
@keyframes todayPulse { 0%,100% { transform:scale(1); } 50% { transform:scale(1.018); } }

/* ===== OUR PATH MODAL ===== */
.path-modal { position:fixed; inset:0; z-index:3000; display:none; align-items:flex-end; justify-content:center; }
.path-modal.show { display:flex; }
.path-backdrop { position:absolute; inset:0; background:rgba(5,2,12,.74); backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px); animation:fadeIn .28s ease both; }
.path-sheet { position:relative; width:min(100%,560px); max-height:92dvh; overflow:auto; border:1px solid rgba(255,92,157,.32); border-bottom:0; border-radius:28px 28px 0 0; padding:28px 20px 38px; background:linear-gradient(180deg,rgba(24,15,38,.98),rgba(10,5,20,.99)); box-shadow:0 -12px 50px rgba(255,45,120,.18); animation:pathUp .45s cubic-bezier(.2,.8,.2,1) both; }
.path-close { position:absolute; right:14px; top:12px; width:38px; height:38px; border-radius:50%; border:1px solid rgba(255,184,212,.2); background:rgba(255,255,255,.06); color:#fff; font-size:28px; line-height:1; cursor:pointer; z-index:2; }
.path-kicker { margin:0; text-align:center; color:#ff8fba; letter-spacing:2.5px; font-size:10px; }
.path-sheet h2 { margin:7px 0 6px; text-align:center; font-size:30px; background:linear-gradient(135deg,#fff,#ff9fc4); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; }
.path-subtitle { margin:0 auto 24px; max-width:390px; text-align:center; color:rgba(255,214,229,.72); font-size:13px; line-height:1.5; }
.timeline { position:relative; padding:4px 4px 0 12px; }
.timeline::before { content:""; position:absolute; left:28px; top:10px; bottom:34px; width:1px; background:linear-gradient(#ff5c9d,rgba(255,92,157,.08)); box-shadow:0 0 10px rgba(255,92,157,.45); }
.timeline-item { position:relative; display:flex; gap:15px; margin:0 0 20px; }
.timeline-dot { flex:0 0 34px; height:34px; display:grid; place-items:center; border-radius:50%; background:rgba(255,92,157,.12); border:1px solid rgba(255,92,157,.38); box-shadow:0 0 18px rgba(255,92,157,.16); z-index:1; }
.timeline-item > div { flex:1; padding:6px 0 0; }
.timeline-item strong { display:block; color:#fff; font-size:15px; }
.timeline-item small { display:block; margin-top:5px; color:rgba(255,211,227,.68); font-size:12px; line-height:1.45; }
.timeline-item img { display:block; width:100%; max-height:150px; object-fit:cover; border-radius:16px; margin-top:10px; border:1px solid rgba(255,92,157,.22); box-shadow:0 0 22px rgba(255,92,157,.12); }
.timeline-future { margin:4px 0 0 49px; padding:17px; text-align:center; border:1px solid rgba(255,92,157,.22); border-radius:18px; background:rgba(255,92,157,.06); color:#ffd7e6; box-shadow:inset 0 0 20px rgba(255,92,157,.04); }
.timeline-future span { display:block; font-size:28px; animation:heartBeat 1.4s ease-in-out infinite; }
.timeline-future b { display:block; margin-top:5px; font-size:14px; }
@keyframes pathUp { from { opacity:0; transform:translateY(30px) scale(.98); } to { opacity:1; transform:none; } }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes heartBeat { 0%,100%{transform:scale(1)} 50%{transform:scale(1.12)} }
body.path-open { overflow:hidden; }

/* ===== CELEBRATION PARTICLES ===== */
.celebration-particles { position:absolute; inset:0; overflow:hidden; pointer-events:none; z-index:0; }
.celebration-particles span { position:absolute; top:-40px; animation:celebrateFall 4.5s cubic-bezier(.18,.72,.2,1) forwards; filter:drop-shadow(0 0 8px rgba(255,92,157,.65)); }
.celebration-content { position:relative; z-index:2; }
.birthday-celebration .celebration-content { box-shadow:0 0 80px rgba(255,160,90,.12); }
@keyframes celebrateFall { 0%{transform:translate3d(0,-30px,0) rotate(0deg);opacity:0} 12%{opacity:1} 100%{transform:translate3d(var(--drift),110vh,0) rotate(460deg);opacity:0} }

@media (max-width:600px) {
    .slide-inner { gap:16px; }
    .event-card { padding:17px 14px; border-radius:20px; }
    .event-actions .event-remind-btn { padding:11px 10px; font-size:12px; }
    .birthday-card { margin-top:-2px; }
    .path-sheet { padding-left:16px; padding-right:16px; }
}

/* ===== HEADER CONTROLS ===== */
.top-bar {
    position: fixed;
    top: 14px;
    left: 14px;
    right: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 150;
    pointer-events: none;
}
.top-couple-badge {
    pointer-events: auto;
    background: rgba(255, 92, 157, 0.12);
    border: 1px solid rgba(255, 92, 157, 0.28);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #ffb8d4;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    transition: transform 0.2s, background 0.2s;
}
.top-couple-badge:active { transform: scale(0.96); }
.top-actions {
    display: flex;
    gap: 8px;
    pointer-events: auto;
}
.top-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 184, 212, 0.22);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    font-size: 16px;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.top-btn:active { transform: scale(0.92); background: rgba(255, 92, 157, 0.2); }

/* ===== GENERIC MODAL / SHEET ===== */
.app-modal {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.app-modal.show { display: flex; }
.app-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 2, 12, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: fadeIn 0.25s ease both;
}
.app-modal-card {
    position: relative;
    width: min(100%, 420px);
    max-height: 85dvh;
    overflow-y: auto;
    background: linear-gradient(180deg, rgba(26, 13, 38, 0.98), rgba(12, 5, 22, 0.99));
    border: 1px solid rgba(255, 92, 157, 0.35);
    border-radius: 28px;
    padding: 24px 20px;
    box-shadow: 0 12px 50px rgba(255, 45, 120, 0.22);
    animation: pathUp 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    z-index: 2;
}
.app-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}
.app-modal-head h3 {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #ff9fc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.app-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255, 184, 212, 0.2);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 20px;
    display: grid;
    place-items: center;
    cursor: pointer;
}

/* ===== FORM CONTROLS ===== */
.form-group {
    margin-bottom: 15px;
    text-align: left;
}
.form-group label {
    display: block;
    font-size: 12px;
    color: #ffb8d4;
    margin-bottom: 6px;
    font-weight: 600;
}
.form-input, .form-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 92, 157, 0.25);
    border-radius: 14px;
    padding: 12px 14px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}
.form-input:focus, .form-textarea:focus {
    border-color: #ff5c9d;
    box-shadow: 0 0 12px rgba(255, 92, 157, 0.35);
}
.form-btn {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #ff2d78, #ff5c9d);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(255, 45, 120, 0.35);
    transition: transform 0.2s, opacity 0.2s;
    margin-top: 6px;
}
.form-btn:active { transform: scale(0.98); }
.form-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 184, 212, 0.22);
    color: #ffd6e6;
    box-shadow: none;
}

/* ===== ONBOARDING SCREEN ===== */
.onboarding-screen {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(ellipse at center, #1b0a2c 0%, #080312 100%);
}
.onboarding-screen.show { display: flex; }
.onboarding-box {
    width: min(100%, 420px);
    text-align: center;
    animation: fadeIn 0.5s ease both;
}
.onboarding-heart {
    font-size: 52px;
    margin-bottom: 12px;
    display: inline-block;
    animation: heartBeat 1.4s infinite;
}
.onboarding-title {
    font-size: 26px;
    font-weight: 800;
    background: linear-gradient(135deg, #fff, #ff85b3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}
.onboarding-desc {
    color: rgba(255, 214, 229, 0.72);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 24px;
}
.onboarding-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 92, 157, 0.28);
    border-radius: 24px;
    padding: 22px 18px;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

/* ===== GALLERY CONTROLS & DELETE ===== */
.gallery-slide {
    position: relative;
}
.photo-del-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ff5c9d;
    font-size: 13px;
    display: grid;
    place-items: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
    z-index: 5;
    transition: transform 0.2s;
}
.photo-del-icon:active { transform: scale(0.9); }
.gallery-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

/* ===== NOTES SECTION IN SLIDE ===== */
.notes-container {
    width: min(100%, 360px);
    margin: 12px auto 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}
.note-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 92, 157, 0.2);
    border-radius: 16px;
    padding: 12px 14px;
    text-align: left;
    position: relative;
    backdrop-filter: blur(8px);
}
.note-text {
    font-size: 13px;
    line-height: 1.45;
    color: #fff;
    white-space: pre-wrap;
}
.note-meta {
    margin-top: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: #ffb8d4;
    opacity: 0.75;
}
.note-del-btn {
    background: none;
    border: none;
    color: #ff5c9d;
    font-size: 11px;
    cursor: pointer;
    opacity: 0.8;
}

/* ===== INVITE BOX ===== */
.invite-box {
    background: rgba(255, 92, 157, 0.08);
    border: 1px dashed rgba(255, 92, 157, 0.4);
    border-radius: 18px;
    padding: 14px;
    margin-top: 14px;
    text-align: center;
}
.invite-box p {
    font-size: 12px;
    color: #ffd7e6;
    margin-bottom: 8px;
}
.invite-badge {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    color: #ff85b3;
    background: rgba(255, 92, 157, 0.18);
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(28, 12, 38, 0.95);
    border: 1px solid rgba(255, 92, 157, 0.4);
    color: #fff;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
