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


html, body {
    font-family: 'Georgia', 'Times New Roman', serif;
    height: 100vh;
    height: 100svh;
    width: 100vw;
    overflow: hidden;
    position: fixed;
    -webkit-overflow-scrolling: none;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    /* Убираем background и transition - фон теперь в отдельном div */
    background: transparent;
}

/* Постоянный фоновый слой для градиентов */
.permanent-background-layer {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100svh !important;
    z-index: -10 !important;
    pointer-events: none !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    transition: opacity 1.2s ease-in-out !important;
}

/* Фоновые градиенты (legacy) */
.bg-gradient-1 {
    background: linear-gradient(135deg, #ffeef8 0%, #f8e8ff 50%, #fff0f5 100%);
}

.bg-gradient-2 {
    background: linear-gradient(135deg, #fff5f0 0%, #ffe8e0 50%, #fff0e6 100%);
}

.bg-gradient-3 {
    background: linear-gradient(135deg, #f0fff8 0%, #e8fff0 50%, #f5fff8 100%);
}

.bg-gradient-4 {
    background: linear-gradient(135deg, #f8f0ff 0%, #f0e8ff 50%, #f5f0ff 100%);
}

.bg-gradient-5 {
    background: linear-gradient(135deg, #fff8f0 0%, #fff0e8 50%, #fff8f5 100%);
}

/* Анимированные паттерны */
.bg-gradient-1::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(255, 192, 203, 0.2) 0%, transparent 40%),
                radial-gradient(circle at 80% 20%, rgba(221, 160, 221, 0.2) 0%, transparent 40%),
                radial-gradient(circle at 40% 40%, rgba(255, 218, 185, 0.2) 0%, transparent 40%);
    animation: float 8s ease-in-out infinite;
}

.bg-gradient-2::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 70% 30%, rgba(255, 228, 196, 0.2) 0%, transparent 40%),
                radial-gradient(circle at 30% 70%, rgba(255, 218, 185, 0.2) 0%, transparent 40%);
    animation: float 10s ease-in-out infinite reverse;
}

.bg-gradient-3::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 60% 60%, rgba(144, 238, 144, 0.2) 0%, transparent 40%),
                radial-gradient(circle at 20% 20%, rgba(152, 251, 152, 0.2) 0%, transparent 40%);
    animation: float 12s ease-in-out infinite;
}

.bg-gradient-4::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 80% 80%, rgba(230, 230, 250, 0.2) 0%, transparent 40%),
                radial-gradient(circle at 40% 20%, rgba(221, 160, 221, 0.2) 0%, transparent 40%);
    animation: float 9s ease-in-out infinite reverse;
}

.bg-gradient-5::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(255, 248, 220, 0.2) 0%, transparent 50%),
                radial-gradient(circle at 90% 10%, rgba(255, 228, 196, 0.2) 0%, transparent 40%);
    animation: float 11s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-20px) scale(1.1);
        opacity: 0.5;
    }
}

.container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 600px;
    padding: 20px;
}

/* Место под сердечко резервируем только когда оно есть на экране */
.container.has-heart {
    padding-bottom: 96px;
}

.compliment-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
    max-width: 600px;
    animation: cardAppear 1.2s ease-out;
    transition: height 1s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (max-width: 600px) {
  .compliment-card {
    padding: 6.667vw 5vw;
  }
}

.compliment-content {
    transition: opacity 0.32s ease-in-out;
}

.compliment-text {
    font-size: 29px;
    line-height: 1.4;
    color: #333;
    margin: 0;
    font-style: italic;
    animation: textSlide 0.8s ease-out 0.4s both;
}
@media (max-width: 600px) {
  .compliment-text {
    font-size: calc(4.833vw);
  }
}

/* Эмодзи не курсивом */
.compliment-text .emoji {
    font-style: normal;
}

/* Эмодзи в мотивационном блоке тоже не курсивом */
.motivation-title .emoji,
.motivation-text .emoji {
    font-style: normal;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* Загрузка на body */
.body-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    height: 100svh;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: opacity 0.8s ease-in-out;
}

.body-loading .heart {
    font-size: 3.6em;
    margin-bottom: 20px;
    animation: heartbeat 1.5s infinite;
}

.body-loading p {
    font-size: 1.4em;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-style: italic;
    color: #555;
    /* Без этого многострочная фраза прижимается влево:
       align-items центрирует сам блок, но не текст внутри него */
    text-align: center;
    line-height: 1.45;
    max-width: 520px;
    padding: 0 28px;
    margin: 0 auto;
}

@media (max-width: 600px) {
    .body-loading p {
        font-size: 1.15em;
    }

    .body-loading .heart {
        font-size: 3em;
        margin-bottom: 16px;
    }
}

.body-loading.fade-out .heart {
    animation: none;
}

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

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


/* Случайный счетчик внизу страницы */
.bottom-counter {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    opacity: 0;
    /* Анимация будет запускаться через JavaScript после завершения расширения карточки */
}

.random-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Jost', 'Montserrat', 'Helvetica Neue', sans-serif;
    font-size: 0.85em;
    padding: 12px 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    font-weight: 500;
    /* border: 1px solid rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); */
    overflow: hidden;
    background-clip: padding-box;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: none;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1), 0 4px 15px rgba(0,0,0,0.1);
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    transform: translateZ(0);
    will-change: transform;

    white-space: nowrap;
    text-align: center;
    height: 41px;
    line-height: 17px;
    min-width: 41px;
}

.counter-text {
    margin: 0 20px;
    flex-shrink: 0;
    color: transparent;
}

/* Анимация 1: Кружок выезжает снизу (БЕЗ текста) */
@keyframes counterCircleUp {
    0% {
        opacity: 0;
        width: 41px;
        height: 41px;
        border-radius: 50%;
        transform: translateX(-50%) translateY(50px);
        color: transparent;
    }
    100% {
        opacity: 1;
        width: 41px;
        height: 41px;
        border-radius: 50%;
        transform: translateX(-50%) translateY(0);
        color: transparent;
    }
}


/* Анимация 2: Кружок ПЛАВНО раскрывается в таблетку */
@keyframes counterExpand {
    from {
        width: 41px;
        border-radius: 50%;
    }
    to {
        width: var(--counter-target-width, 320px);
        border-radius: 25px;
    }
}

/* Анимация 3: Текст плавно появляется */
@keyframes counterTextAppear {
    0% {
        color: transparent;
    }
    100% {
        color: #666;
    }
}


@keyframes counterAppear {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

/* Мотивационная страница для неавторизованных пользователей */
.motivation-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    padding: 20px;
}

.motivation-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 30px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    max-width: 600px;
    animation: motivationAppear 1.5s ease-out;
}

.lock-icon {
    font-size: 4em;
    margin-bottom: 5px;
    animation: gentle-bounce 2.5s infinite ease-in-out;
}

@media (max-width: 600px) {
    .lock-icon {
        font-size: 12vw;
        margin-bottom: 1vw;
    }
}

@media (max-width: 600px) {
    .motivation-card {
        /* padding: 5vw 5vw; */
        max-width: 90vw;
    }
}

/* Стили для Chrome мобильного (применяется через JS) */
.chrome-mobile .motivation-card {
    padding: 30px !important;
}

.chrome-mobile .body-loading p {
    font-size: 1rem !important;
}



.motivation-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.5em;
    color: #333;
    margin-bottom: 10px;
    font-style: italic;
}

@media (max-width: 600px) {
    .motivation-title {
        font-size: 3.7vw;
    }
}

.motivation-text {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.5em;
    line-height: 1.4;
    color: #333;
    margin: 0;
    font-style: italic;
}

@media (max-width: 600px) {
    .motivation-text {
        font-size: calc(3.7vw);
    }
}

.motivation-emoji {
    font-size: 2em;
    animation: gentle-pulse 3s infinite;
}

@media (max-width: 600px) {
    .motivation-emoji {
        font-size: 6vw;
    }
}

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

@keyframes gentle-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

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


/* ═══════════════ Сердечко под комплиментом ═══════════════ */

.heart-area {
    /* Прижато к низу: сайт почти всегда открывают с телефона,
       а там низ экрана — единственное место, куда удобно дотянуться большим пальцем */
    position: fixed;
    left: 0;
    right: 0;
    bottom: 34px;
    bottom: calc(34px + env(safe-area-inset-bottom, 0px));
    z-index: 20;
    display: flex;
    justify-content: center;
    /* Появляется чуть позже карточки, чтобы не спорить с ней за внимание */
    animation: heartAreaAppear 0.7s ease-out 0.5s both;
}

@media (max-height: 620px) {
    .heart-area {
        bottom: 20px;
        bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    }
}

.heart-area[hidden] {
    display: none;
}

.heart-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.heart-button:active {
    transform: scale(0.94);
}

.heart-shape {
    width: 34px;
    height: 34px;
    overflow: visible;
    fill: transparent;
    stroke: #ffffff;
    stroke-width: 1.6;
    stroke-linejoin: round;
    /* Тень нужна, чтобы контур читался и на белом фоне */
    filter: drop-shadow(0 1px 2.5px rgba(120, 120, 130, 0.45));
    transition: fill 0.3s ease, stroke 0.3s ease;
}

/* Отмеченное состояние */
.heart-button.is-liked .heart-shape {
    fill: #ff5f7e;
    stroke: #ff5f7e;
    filter: drop-shadow(0 2px 4px rgba(255, 95, 126, 0.4));
}

/* Мягкий толчок в момент нажатия */
.heart-button.is-bursting .heart-shape {
    animation: heartBeat 0.52s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Кольцо, расходящееся от сердечка */
.heart-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    border-radius: 50%;
    border: 1.5px solid #ff8fa5;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.55);
}

.heart-button.is-bursting .heart-ripple {
    animation: heartRipple 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@keyframes heartBeat {
    0%   { transform: scale(1); }
    30%  { transform: scale(0.86); }
    62%  { transform: scale(1.22); }
    82%  { transform: scale(0.97); }
    100% { transform: scale(1); }
}

@keyframes heartRipple {
    0% {
        opacity: 0.6;
        transform: scale(0.55);
    }
    100% {
        opacity: 0;
        transform: scale(2.3);
    }
}

/* Уважаем системную настройку «меньше движения» */
@media (prefers-reduced-motion: reduce) {
    .heart-area,
    .heart-button.is-bursting .heart-shape,
    .heart-button.is-bursting .heart-ripple {
        animation: none;
    }
    .heart-button {
        transition: none;
    }
}

/* ═══════════════ Ответ на вопрос ═══════════════ */

.answer-area {
    margin-top: 26px;
    animation: heartAreaAppear 0.7s ease-out 0.5s both;
}

.answer-area[hidden] {
    display: none;
}

.answer-form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 6px 6px 18px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 26px;
    box-shadow: 0 6px 18px rgba(120, 120, 140, 0.13);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.answer-form:focus-within {
    border-color: rgba(255, 150, 175, 0.5);
    box-shadow: 0 8px 22px rgba(255, 140, 168, 0.2);
}

.answer-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: none;
    font-family: inherit;
    font-size: 16px; /* 16px, иначе iOS зумит страницу при фокусе */
    font-style: italic;
    color: #3a3a42;
    padding: 8px 0;
}

.answer-input::placeholder {
    color: #b3b3bf;
    font-style: italic;
}

.answer-send {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #ffd7e0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.answer-send svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: #d05a79;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.25s ease, transform 0.25s ease;
}

.answer-send:hover {
    background: #ffc8d5;
}

.answer-send:hover svg {
    transform: translateX(2px);
}

.answer-send:active {
    transform: scale(0.92);
}

.answer-send:disabled {
    opacity: 0.45;
    cursor: default;
    transform: none;
}

/* Подтверждение после отправки */
.answer-done {
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 26px;
    box-shadow: 0 6px 18px rgba(120, 120, 140, 0.13);
    text-align: center;
    font-size: 15px;
    font-style: italic;
    color: #5a5a66;
    animation: answerDoneAppear 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.answer-done[hidden] {
    display: none;
}

.answer-done .answer-echo {
    display: block;
    margin-top: 5px;
    color: #c2506b;
    font-size: 16px;
}

@keyframes answerDoneAppear {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(6px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .answer-area,
    .answer-done {
        animation: none;
    }
    .answer-send,
    .answer-send svg {
        transition: none;
    }
}

/* ═══════════════ Событие с этапами ═══════════════ */

.event-card {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 34px 28px 26px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
    animation: cardAppear 0.8s ease-out both;
}

.event-card[hidden] {
    display: none;
}

@media (max-width: 600px) {
    .event-card {
        padding: 6.5vw 5vw 5vw;
    }
}

.event-head {
    margin-bottom: 22px;
}

.event-title {
    font-size: 15px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #b58a9a;
    margin-bottom: 8px;
}

.event-meta {
    font-size: 15px;
    color: #7a7a88;
    font-style: italic;
    line-height: 1.5;
}

.event-meta:empty {
    display: none;
}

/* Тело шага — меняется при переходе */
.event-body {
    min-height: 96px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.event-step {
    animation: eventStepIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.event-step.is-leaving {
    animation: eventStepOut 0.25s ease-in both;
}

.event-text {
    font-size: 24px;
    line-height: 1.4;
    color: #333;
    font-style: italic;
    margin-bottom: 22px;
}

@media (max-width: 600px) {
    .event-text {
        font-size: 5vw;
    }
}

.event-text .emoji {
    font-style: normal;
}

/* Кнопки шага */
.event-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.event-btn {
    width: 100%;
    max-width: 320px;
    padding: 13px 22px;
    border: 1px solid rgba(255, 170, 190, 0.55);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.75);
    font-family: inherit;
    font-size: 16px;
    color: #4a4a55;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.25s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

.event-btn:hover {
    background: #fff3f6;
    box-shadow: 0 6px 16px rgba(255, 140, 168, 0.18);
}

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

.event-btn.is-primary {
    background: #ffd7e0;
    border-color: transparent;
    color: #b8455f;
}

.event-btn.is-primary:hover {
    background: #ffc8d5;
}

.event-btn.is-chosen {
    background: #ffd7e0;
    border-color: transparent;
    color: #b8455f;
}

/* Поле ввода на шаге */
.event-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    padding: 5px 5px 5px 18px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 170, 190, 0.5);
    border-radius: 26px;
    transition: box-shadow 0.3s ease;
}

.event-input-row:focus-within {
    box-shadow: 0 6px 18px rgba(255, 140, 168, 0.2);
}

.event-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: none;
    font-family: inherit;
    font-size: 16px;
    font-style: italic;
    color: #3a3a42;
    padding: 8px 0;
}

.event-input::placeholder {
    color: #b8b8c4;
}

/* Точки прогресса */
.event-dots {
    display: flex;
    justify-content: center;
    gap: 7px;
    margin-top: 24px;
}

.event-dots:empty {
    display: none;
}

.event-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(180, 150, 165, 0.28);
    transition: background 0.35s ease, transform 0.35s ease;
}

.event-dot.is-done {
    background: rgba(255, 150, 175, 0.65);
}

.event-dot.is-current {
    background: #ff5f7e;
    transform: scale(1.35);
}

/* Финальный экран */
.event-finish {
    font-size: 25px;
    line-height: 1.4;
    color: #333;
    font-style: italic;
    animation: eventFinishIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.event-finish .emoji {
    font-style: normal;
}

.event-recap {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(180, 150, 165, 0.18);
    font-size: 14px;
    font-style: normal;
    color: #8a8a98;
    line-height: 1.6;
}

.event-recap strong {
    color: #c2506b;
    font-weight: normal;
}

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

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

@keyframes eventFinishIn {
    from { opacity: 0; transform: scale(0.94); }
    to   { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .event-card,
    .event-step,
    .event-finish {
        animation: none;
    }
    .event-btn,
    .event-dot {
        transition: none;
    }
}
