/* Гадание «На ромашке» */
.mgc-romashka {
    --s: 370px;                     /* диаметр ромашки */
    --ph: calc(var(--s) * 0.135);   /* высота лепестка, длина — по пропорции картинки 200×70 */
    overflow: hidden;               /* летящие лепестки не выходят за блок гадания */
    text-align: center;
    touch-action: manipulation;     /* частые нажатия не увеличивают страницу */
    -webkit-tap-highlight-color: transparent;
}

/* Подсказка, фразы и итог над ромашкой — «виньетки»: фраза курсивом, под ней завиток с сердечком;
   у итога сверху подпись «итог», сам он крупнее и малиновый. Слева от фразы — котик к ней (.mgcrom-icon) */
.mgcrom-answer-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 76px;
}
.mgcrom-answer {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 28px;
    font-style: italic;
    font-weight: 400;
    line-height: 1.15;
}
.mgcrom-answer__text {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}
.mgcrom-answer__text::after {
    content: '';
    width: 120%;
    min-width: 120px;
    height: 10px;
    margin-top: 3px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12'%3E%3Cpath d='M4 6 C30 6 50 3 78 6 M122 6 C150 3 170 6 196 6' stroke='%238b5a2b' stroke-width='1.2' fill='none' stroke-linecap='round'/%3E%3Ccircle cx='84' cy='6' r='1.7' fill='%238b5a2b'/%3E%3Ccircle cx='116' cy='6' r='1.7' fill='%238b5a2b'/%3E%3Cpath d='M100 11 C95 7.5 91 5.5 91 3 C91 1.2 92.6 0 94.6 0 C97 0 98.6 1.3 100 3 C101.4 1.3 103 0 105.4 0 C107.4 0 109 1.2 109 3 C109 5.5 105 7.5 100 11 Z' fill='%23b0245c'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* Фраза появляется «пружинкой»: из маленькой, с лёгким перелётом за полный размер */
.mgcrom-answer_show {
    animation: mgcrom-pop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}
.mgcrom-answer_hint {
    font-size: 19px;
    color: #6b5440;
}
.mgcrom-answer_hint .mgcrom-answer__text::after {
    content: none;
}
.mgcrom-answer_final {
    font-size: 32px;
    color: #b0245c;
}
.mgcrom-answer_final .mgcrom-answer__text::before {
    content: 'итог';
    margin-bottom: 3px;
    padding-left: 0.3em;    /* уравновешивает разрядку после последней буквы */
    font: 600 12px/1 'EB Garamond', Georgia, serif;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #8b5a2b;
}
.mgcrom-answer_final .mgcrom-answer__text::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12'%3E%3Cpath d='M4 6 C30 6 50 3 78 6 M122 6 C150 3 170 6 196 6' stroke='%23b0245c' stroke-width='1.2' fill='none' stroke-linecap='round'/%3E%3Ccircle cx='84' cy='6' r='1.7' fill='%23b0245c'/%3E%3Ccircle cx='116' cy='6' r='1.7' fill='%23b0245c'/%3E%3Cpath d='M100 11 C95 7.5 91 5.5 91 3 C91 1.2 92.6 0 94.6 0 C97 0 98.6 1.3 100 3 C101.4 1.3 103 0 105.4 0 C107.4 0 109 1.2 109 3 C109 5.5 105 7.5 100 11 Z' fill='%23b0245c'/%3E%3C/svg%3E");
}
/* Котик к фразе (размер в разметке — 60 px, на телефоне меньше) */
.mgc-romashka .mgcrom-icon {
    display: block;
    flex: none;
    width: 60px;
    max-width: none;
    height: 60px;
}
@keyframes mgcrom-pop {
    from { opacity: 0; transform: scale(0.4); }
    50% { opacity: 1; }
    to { opacity: 1; transform: scale(1); }
}
@keyframes mgcrom-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}
/* «Уменьшить движение» в системе — без «пружинки», просто проявляется */
@media (prefers-reduced-motion: reduce) {
    .mgcrom-answer_show {
        animation-name: mgcrom-fade;
    }
}

/* Ромашка: лепесток лежит от края цветка к центру и поворачивается вокруг центра */
.mgcrom-flower {
    position: relative;
    width: var(--s);
    height: var(--s);
    margin: 10px auto 0;
}
/* Лепестки с сердцевиной и слой над ними, где летят оторванные лепестки и дождь на итоге */
.mgcrom-head,
.mgcrom-fly {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}
.mgcrom-fly {
    z-index: 2;
    pointer-events: none;
}
.mgcrom-flyer {
    position: absolute;
    will-change: transform, opacity;
}
.mgc-romashka .mgcrom-flyer img {
    display: block;
    width: 100%;
    max-width: none;
    height: 100%;
}
.mgcrom-petal {
    position: absolute;
    top: calc(50% - var(--ph) / 2);
    left: 0;
    width: 50%;
    height: var(--ph);
    transform-origin: 100% calc(var(--ph) / 2);
}
.mgc-romashka .mgcrom-petal img {
    display: block;
    width: auto;
    max-width: 100%;
    height: var(--ph);
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
.mgc-romashka .mgcrom-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(var(--s) * 0.27);
    max-width: none;
    height: auto;
    transform: translate(-50%, -50%);
}

/* Выбор режима и кнопка под ромашкой */
.mgcrom-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

/* Режим: «Все фразы» | «Любит — не любит» */
.mgcrom-seg {
    display: inline-flex;
    padding: 3px;
    border: 1px solid #8b5a2b;
    border-radius: 999px;
    background: #fffaf2;
}
.mgcrom-seg label {
    position: relative;
    cursor: pointer;
}
.mgcrom-seg input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}
.mgcrom-seg span {
    display: block;
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    color: #4a3828;
    transition: background-color 0.2s, color 0.2s;
}
.mgcrom-seg input:checked + span {
    background: #6b4423;
    color: #fff;
}
.mgcrom-seg input:focus-visible + span {
    outline: 2px solid #8b5a2b;
    outline-offset: 2px;
}

/* Кнопка */
.mgc-btn-2 {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 235px;
    height: 65px;
    margin: 10px auto 0;
    background-color: #f1e7d4;
    background-image: url('/wp-content/themes/gadanie-online/assets/images/knopka.webp');
    background-size: cover;
    background-position: center;
    color: #4a3828;
    font-size: 17px;
    font-weight: 400;
    font-family: 'EB Garamond', 'Georgia', serif;
    border: none;
    border-radius: 0;
    padding: 0 0 4px 0;
    outline: none;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}
.mgc-btn-2:hover {
    transform: translateY(-2px);
}
.mgc-btn-2:active,
.mgc-btn-2.mgc-btn-2--active {
    background-image: url('/wp-content/themes/gadanie-online/assets/images/knopka-1.webp');
    transform: translateY(2px);
}

@media (max-width: 600px) {
    .mgc-romashka {
        --s: min(300px, calc(100vw - 50px));
    }
    .mgcrom-answer-wrap {
        height: 72px;   /* подсказка на узком экране — в две строки */
    }
    .mgcrom-answer {
        font-size: 26px;
    }
    .mgcrom-answer_hint {
        font-size: 19px;
    }
    .mgcrom-answer_final {
        font-size: 29px;
    }
    .mgc-romashka .mgcrom-icon {
        width: 52px;
        height: 52px;
    }
    .mgcrom-seg span {
        padding: 8px 14px;
        font-size: 15px;
    }
}
/* Узкий телефон: длинный итог с котиком занимает почти всю ширину — завиток чуть короче, иначе край обрезается */
@media (max-width: 380px) {
    .mgcrom-icon + .mgcrom-answer__text::after {
        width: 108%;
    }
}
