/* переменные */
#triggerArea {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 300px;
    height: 300px;
    z-index: 10;
    pointer-events: auto;
}
:root {
    --panel-h: 68px; /* 48px кнопка + 2×10px отступа сверху/снизу */
    --btn-bg: #e0e0e0;
    --btn-fg: #141414;
    --speed: 6s;
    --step: 0.375s;
    --base-clamp: clamp(30px, max(5vw, 7vmin), 100px);
    --scale: 1;
    --fz-base: calc(var(--base-clamp) * var(--scale));
}

/* базовые ресеты */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    //background: #f5f5f5;
    //background: #eed5ab;
    background: #f5f5f7;
    //background: #dddddd;
    //background: #f7cea0;
    color: var(--btn-fg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: "Great Vibes", cursive;
}

/* круг */
.circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--btn-bg);
    color: var(--btn-fg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
}

.ellipse {
    /* фиксируем высоту */
    height: 48px;
    /* ширина зависит от контента */
    width: auto; /* растёт сколько нужно */
    min-width: 100px; /* можно оставить минимальное */
    padding: 0 18px; /* регулируйте по вкусу */
    /* закругляем половину высоты → ровная капсула */
    border-radius: 24px; /* 48 / 2  */
    /* или просто 9999px — то же самое */
    /* остальное без изменений */
    background: var(--btn-bg);
    color: var(--btn-fg);
    display: inline-flex; /* или flex/inline-block — как удобно */
    align-items: center;
    gap: 8px;
    justify-content: center;
    border: none;
    cursor: pointer;
    white-space: nowrap; /* запрет переноса внутри, если нужно */
}
/* внутри овала-счётчика все svg держим одного размера */
.ellipse svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0; /* запрещаем сжиматься при нехватке места */
}
.circle svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}
/* крупные цифры в счётчике */
.counter-num {
    font-size: 22px; /* выберите 22–26 px, как нравится */
    line-height: 1; /* чтобы не «подпрыгивали» */
}
/* шапка */
.panel {
    position: fixed;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    white-space: nowrap;
}
.controls {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}
.spd-text {
    font-size: 26px;
    font-style: normal;
    //width: 48px;
    text-align: center;
}

/* счётчик */
.counter {
    margin-right: 12px;
}
#langSel {
    margin-left: 12px;
    flex: 0 0 auto;
}
.sep {
    margin: 0 2px;
    font-size: 24px;
}

.hidden {
    display: none !important;
}

/* ----------- ручная пауза пользователя ----------- */
.userPaused .w,
.userPaused .waviy span {
    animation-play-state: paused !important; /* гасим и waviy, и intro */
}

/* --- Значок паузы ------------------------------------------------------- */
.pause-badge {
    position: fixed;
    bottom: 5vh; /* чуть выше низа экрана */
    left: 50%;
    transform: translateX(-50%);
    width: 64px;
    height: 64px;
    background: rgba(128, 128, 128, 0.25); /* полупрозрачный серый кружок */
    backdrop-filter: blur(6px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.25s ease;
    pointer-events: none; /* клики проходят сквозь */
}
.pause-badge svg {
    width: 34px;
    height: 34px;
    fill: #777; /* похожий на macOS grey */
}
.pause-badge.hidden {
    opacity: 0;
    transform: translate(-50%, 20px) scale(0.8);
}

/* ---------- общая «волна» для всех слов ---------- */
.w {
    display: inline-block;
    margin-right: 0.3em;
    animation-name: wave;
    animation-duration: var(--speed);
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-fill-mode: both;
    /* задержку будем переопределять ниже */
}

@keyframes wave {
    0%,
    15%,
    100% {
        transform: scale(1);
    }
    10% {
        transform: scale(1.2);
        color: #e4491d;
    }
}

/* мантра */
.centered {
    //height: calc(100vh - var(--panel-h));
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
.waviy {
    font-size: var(--fz-base);
    display: flex; /* вертикальный столбец строк */
    flex-direction: column;
    align-items: center;
    line-height: 1.3;
    white-space: normal; /* переносы как в intro */
    -webkit-box-reflect: below -10px
        linear-gradient(transparent, rgba(0, 0, 0, 0.1));
}
.waviy > div {
    white-space: nowrap;
} /* каждая строка не ломается */

.waviy.paused span {
    animation-play-state: paused;
    opacity: 0;
}
.waviy .w {
    animation-delay: calc(var(--step) * var(--i));
}

/* intro */
.intro {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: var(--fz-base);
    text-align: center;
    pointer-events: none;
    white-space: normal;
    line-height: 1.3;
    display: flex;
    flex-direction: column;
    //gap: 0.6em;
}

.intro div {
    display: inline-block;
    white-space: nowrap;
}

.intro .w {
    animation-delay: var(--delay);
    animation-duration: 10s; /* или var(--introDur) */
}

/* панель масштабирования шрифта */

@media (min-width: 1024px) {
    .font-ctrl {
        position: fixed;
        right: 40px;
        bottom: 40px;
        display: flex;
        flex-direction: column;
        gap: 8px;
        opacity: 0;
        pointer-events: none;
        transition: 0.25s;
        z-index: 2000;
    }
    .font-ctrl.active {
        opacity: 1;
        pointer-events: auto;
    }
    .f-btn {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        border: none;
        background: var(--btn-bg);
        font-size: 24px;
        cursor: pointer;
    }
}

@media (max-width: 1023px) and (orientation: landscape) {
    .font-ctrl {
        display: none;
    }
    .intro,
    .centered {
        --panel-h: 68px; /* 48px кнопка + 2×10px отступа сверху/снизу */
        padding-top: var(--panel-h);
    }
}
@media (max-width: 767px) and (orientation: portrait) {
    .font-ctrl {
        display: none;
    }
    #langSel {
        font-size: 20px;
        min-width: 60px; /* ширина под один emoji-флаг */
        width: 60px;
        padding: 0 10px; /* чуть места по краям */
        overflow: hidden; /* всё, что не влезло — прячем */
        text-overflow: clip; /* на всякий случай */
        white-space: nowrap; /* не переносить */
    }
    .controls {
        gap: 0px;
    }
}
