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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #ffeef8 0%, #e8f4ff 50%, #fff0f5 100%);
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
    position: relative;
}

/* Буквы R на фоне */
.background-letter {
    position: fixed;
    pointer-events: none;
    user-select: none;
    z-index: 0;
    white-space: nowrap;
    line-height: 1;
    opacity: 1;
    transform-origin: center center;
    margin: 0;
    padding: 0;
}

.sparkle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

.fireworks-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

/* Надпись "Вы встретились!" */
.congratulations-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    z-index: 200;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s ease-out;
}

.congratulations-overlay.active {
    display: flex;
}

.congratulations-text {
    font-size: 5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #FFD700 0%, #FF4081 25%, #2196F3 50%, #9C27B0 75%, #FFD700 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    animation: gradientShift 3s ease infinite, scalePulse 1s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    padding: 30px 60px;
    border-radius: 30px;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

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

.background-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.18;
    background-image: 
        /* Hearts - повторяющийся паттерн */
        url("data:image/svg+xml,%3Csvg width='30' height='30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15 5c-2-2-5-2-7 0-2 2-2 5 0 7l7 7 7-7c2-2 2-5 0-7-2-2-5-2-7 0z' fill='none' stroke='%23ffb6c1' stroke-width='0.8' opacity='0.35'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='25' height='25' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.5 4c-1.5-1.5-4-1.5-5.5 0-1.5 1.5-1.5 4 0 5.5l5.5 5.5 5.5-5.5c1.5-1.5 1.5-4 0-5.5-1.5-1.5-4-1.5-5.5 0z' fill='none' stroke='%23add8e6' stroke-width='0.7' opacity='0.3'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 3c-1-1-2.5-1-3.5 0-1 1-1 2.5 0 3.5l3.5 3.5 3.5-3.5c1-1 1-2.5 0-3.5-1-1-2.5-1-3.5 0z' fill='none' stroke='%23ffb6c1' stroke-width='0.6' opacity='0.28'/%3E%3C/svg%3E"),
        /* Stars - повторяющийся паттерн */
        url("data:image/svg+xml,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 2l2 4 4 1-3 3 1 4-4-2-4 2 1-4-3-3 4-1z' fill='none' stroke='%23ffb6c1' stroke-width='0.6' opacity='0.28'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='18' height='18' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 1.5l1.5 3 3 0.5-2 2 0.5 3-3-1.5-3 1.5 0.5-3-2-2 3-0.5z' fill='none' stroke='%23add8e6' stroke-width='0.5' opacity='0.25'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='16' height='16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 1.5l1.5 3 3 0.5-2 2 0.5 3-3-1.5-3 1.5 0.5-3-2-2 3-0.5z' fill='none' stroke='%23ffb6c1' stroke-width='0.5' opacity='0.25'/%3E%3C/svg%3E"),
        /* Flowers */
        url("data:image/svg+xml,%3Csvg width='22' height='22' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='11' cy='11' r='3' fill='none' stroke='%23ffb6c1' stroke-width='0.6' opacity='0.28'/%3E%3Cpath d='M11 5v3M11 16v3M5 11h3M16 11h3M7.5 7.5l2 2M14.5 14.5l2 2M7.5 14.5l2-2M14.5 7.5l2-2' stroke='%23ffb6c1' stroke-width='0.5' opacity='0.28'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='18' height='18' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='9' cy='9' r='2.5' fill='none' stroke='%23add8e6' stroke-width='0.5' opacity='0.25'/%3E%3Cpath d='M9 4v2.5M9 12.5v2.5M4 9h2.5M12.5 9h2.5M6.5 6.5l1.5 1.5M12.5 12.5l1.5 1.5M6.5 12.5l1.5-1.5M12.5 6.5l1.5-1.5' stroke='%23add8e6' stroke-width='0.4' opacity='0.25'/%3E%3C/svg%3E"),
        /* Small hearts */
        url("data:image/svg+xml,%3Csvg width='15' height='15' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7.5 2.5c-1-1-2.5-1-3.5 0-1 1-1 2.5 0 3.5l3.5 3.5 3.5-3.5c1-1 1-2.5 0-3.5-1-1-2.5-1-3.5 0z' fill='none' stroke='%23add8e6' stroke-width='0.5' opacity='0.25'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='12' height='12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 2c-0.8-0.8-2-0.8-2.8 0-0.8 0.8-0.8 2 0 2.8l2.8 2.8 2.8-2.8c0.8-0.8 0.8-2 0-2.8-0.8-0.8-2-0.8-2.8 0z' fill='none' stroke='%23ffb6c1' stroke-width='0.4' opacity='0.22'/%3E%3C/svg%3E"),
        /* Musical notes */
        url("data:image/svg+xml,%3Csvg width='16' height='16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 8v4c0 1-1 2-2 2s-2-1-2-2 1-2 2-2c0.5 0 1 0.3 1.3 0.7V4h4' fill='none' stroke='%23ffb6c1' stroke-width='0.6' opacity='0.25'/%3E%3Ccircle cx='10' cy='6' r='1.5' fill='none' stroke='%23ffb6c1' stroke-width='0.6' opacity='0.25'/%3E%3C/svg%3E"),
        /* Bubbles */
        url("data:image/svg+xml,%3Csvg width='12' height='12' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='6' cy='6' r='3' fill='none' stroke='%23add8e6' stroke-width='0.4' opacity='0.25'/%3E%3Ccircle cx='5' cy='4' r='0.8' fill='%23add8e6' opacity='0.18'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='10' height='10' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='5' cy='5' r='2.5' fill='none' stroke='%23ffb6c1' stroke-width='0.35' opacity='0.22'/%3E%3Ccircle cx='4' cy='3.5' r='0.6' fill='%23ffb6c1' opacity='0.15'/%3E%3C/svg%3E"),
        /* Cherries */
        url("data:image/svg+xml,%3Csvg width='14' height='14' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='5' cy='8' r='2.5' fill='none' stroke='%23ffb6c1' stroke-width='0.5' opacity='0.25'/%3E%3Ccircle cx='9' cy='9' r='2.5' fill='none' stroke='%23ffb6c1' stroke-width='0.5' opacity='0.25'/%3E%3Cpath d='M5 5.5L4 3M9 6.5L10 4' stroke='%23add8e6' stroke-width='0.4' opacity='0.22'/%3E%3C/svg%3E");
    background-size: 
        150px 150px,
        130px 130px,
        100px 100px,
        100px 100px,
        90px 90px,
        80px 80px,
        110px 110px,
        95px 95px,
        75px 75px,
        60px 60px,
        80px 80px,
        65px 65px,
        55px 55px,
        50px 50px;
    background-position: 
        0 0,
        0 0,
        0 0,
        0 0,
        0 0,
        0 0,
        0 0,
        0 0,
        0 0,
        0 0,
        0 0,
        0 0,
        0 0,
        0 0;
    background-repeat: repeat;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease-out;
}

.title {
    font-size: 4rem;
    background: linear-gradient(135deg, #ff9ec5 0%, #8bb5ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    text-shadow: 0 4px 20px rgba(255, 158, 197, 0.3);
    font-weight: 700;
}

.countdown {
    display: inline-flex;
    align-items: baseline;
    gap: 15px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    padding: 20px 45px;
    border-radius: 60px;
    box-shadow: 0 8px 32px rgba(255, 158, 197, 0.2), 
                0 0 0 2px rgba(255, 255, 255, 0.5);
    animation: pulse 2s ease-in-out infinite;
    cursor: pointer;
    transition: all 0.3s ease;
}

.countdown:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(255, 158, 197, 0.3), 
                0 0 0 2px rgba(255, 255, 255, 0.6);
}

.countdown-number {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ff6ba3 0%, #6ba3ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.countdown-text {
    font-size: 1.8rem;
    color: #8b6fa8;
    font-weight: 500;
}

.calendar-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
    position: relative;
}

.sparkle-overlay {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 5;
    opacity: 1;
    overflow: hidden;
    border-radius: 20px;
}

/* Полоса, которая движется вместе с фитилем и закрашивает пройденные даты */
.sparkle-stripe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 182, 193, 0.7);
    border-radius: 20px;
    box-shadow: 
        inset 0 0 12px rgba(255, 182, 193, 0.4),
        0 0 20px rgba(255, 182, 193, 0.35),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
    pointer-events: none;
    z-index: 1;
    transition: all 0.15s ease-out;
    opacity: 1;
}

.sparkle-stripe.past-days {
    background: rgba(255, 182, 193, 0.7);
    box-shadow: 
        inset 0 0 12px rgba(255, 182, 193, 0.4),
        0 0 20px rgba(255, 182, 193, 0.35),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
    opacity: 1;
}

.sparkle-front {
    display: none !important;
}

.sparkle-front.stopped {
    display: none !important;
}

@keyframes sparkleFront {
    0%, 100% {
        opacity: 0.8;
        box-shadow: 
            0 0 15px rgba(255, 182, 193, 0.3),
            0 0 30px rgba(255, 182, 193, 0.2),
            inset 0 0 15px rgba(255, 182, 193, 0.25);
    }
    50% {
        opacity: 1;
        box-shadow: 
            0 0 20px rgba(255, 182, 193, 0.4),
            0 0 40px rgba(255, 182, 193, 0.3),
            inset 0 0 18px rgba(255, 182, 193, 0.35);
    }
}

.month {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 40px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(255, 158, 197, 0.15),
                0 0 0 1px rgba(255, 255, 255, 0.5);
    animation: fadeInUp 0.6s ease-out;
    max-width: 600px;
    margin: 0 auto;
}

.month-title {
    text-align: center;
    font-size: 1.5rem;
    color: #8b6fa8;
    margin-bottom: 15px;
    font-weight: 600;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.weekday {
    text-align: center;
    font-weight: 600;
    color: #b88fc4;
    font-size: 0.85rem;
    padding: 8px;
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    position: relative;
}

.range-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Полоса, соединяющая все даты в диапазоне - просто линия без кругов */
.range-stripe {
    position: absolute;
    background: rgba(255, 182, 193, 0.2);
    border-radius: 0;
    pointer-events: none;
    z-index: 1;
}

.day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    z-index: 6;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent !important;
    color: #8b6fa8;
    overflow: visible;
    box-shadow: none;
    border: none;
    outline: none;
}

/* Убираем фон у отдельных дней - только полоса соединяет даты */
.day.in-range {
    background: transparent !important;
    color: #8b6fa8;
    font-weight: 600;
    position: relative;
    z-index: 2;
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
    border-radius: 0 !important;
}

.day.other-month {
    opacity: 0.3;
    color: #c4b5d4;
}

.day.today:not(.in-range) {
    background: linear-gradient(135deg, #ff9ec5 0%, #8bb5ff 100%);
    color: white;
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(255, 158, 197, 0.4);
    transform: scale(1.08);
    z-index: 10;
    border-radius: 22px;
}

.day.today.in-range {
    /* Текущая дата в диапазоне без фона - только полоса */
    transform: none !important;
    box-shadow: none !important;
    background: transparent !important;
    color: #8b6fa8;
    border-radius: 0 !important;
    z-index: 2;
    /* Убеждаемся, что текущая дата не создает эффект на следующую */
    position: relative;
    isolation: isolate;
    /* Убираем все возможные эффекты */
    border: none !important;
    outline: none !important;
}

.day.start-date,
.day.end-date {
    /* Убираем отдельное выделение - даты входят в общую полосу */
    background: transparent;
    color: #8b6fa8;
    font-weight: 600;
    transform: none;
    box-shadow: none;
    z-index: 1;
    border-radius: 20px;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes sparkle {
    0%, 100% {
        opacity: 0.5;
        box-shadow: 0 0 10px rgba(255, 182, 193, 0.5);
    }
    50% {
        opacity: 1;
        box-shadow: 0 0 20px rgba(255, 182, 193, 0.8), 
                    0 0 30px rgba(173, 216, 230, 0.6);
    }
}

@keyframes sparkleTrail {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }
    
    .countdown-number {
        font-size: 2rem;
    }
    
    .countdown-text {
        font-size: 1.1rem;
    }
    
    .month {
        padding: 15px;
        border-radius: 35px;
    }
    
    .month-title {
        font-size: 1.3rem;
    }
    
    .day {
        font-size: 0.85rem;
        border-radius: 18px;
    }
    
    .title {
        font-size: 3rem;
    }
    
    .countdown-number {
        font-size: 2.5rem;
    }
    
    .countdown-text {
        font-size: 1.4rem;
    }
    
    .modal-content {
        padding: 30px 20px;
        max-width: 90%;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 1rem;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
}

/* Модальное окно со статистикой */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideUp 0.3s ease-out;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2.5rem;
    color: #8b6fa8;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 182, 193, 0.2);
    transform: rotate(90deg);
}

.modal-title {
    font-size: 2rem;
    color: #8b6fa8;
    margin-bottom: 30px;
    text-align: center;
    font-weight: 700;
}

.modal-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(255, 182, 193, 0.1);
    border-radius: 15px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255, 182, 193, 0.2);
    transform: translateX(5px);
}

.stat-item.stat-param {
    background: rgba(173, 216, 230, 0.15);
    font-size: 0.95rem;
}

.stat-item.stat-param:hover {
    background: rgba(173, 216, 230, 0.25);
}

.stat-label {
    font-size: 1.1rem;
    color: #8b6fa8;
    font-weight: 600;
}

.stat-value {
    font-size: 1.2rem;
    color: #ff6ba3;
    font-weight: 700;
}

.stat-item.stat-param .stat-value {
    font-size: 1rem;
    color: #6ba3ff;
    font-family: 'Courier New', monospace;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

