/* =========================================================
   HABIT ICON PICKER V2
   Mobile First
   ========================================================= */

.habit-icon-picker {
    position: fixed;
    inset: 0;
    z-index: 1000;

    width: 100%;
    height: 100dvh;

    display: flex;
    align-items: flex-end;

    box-sizing: border-box;

    background: rgba(20, 25, 35, 0.12);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.habit-icon-picker__sheet {
    width: 100%;
    max-height: 92dvh;

    box-sizing: border-box;

    padding:
        12px
        18px
        calc(18px + env(safe-area-inset-bottom));

    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;

    border-radius: 30px 30px 0 0;

    background:
        radial-gradient(
            circle at 50% 0%,
            #ffffff 0%,
            #fbfcfe 54%,
            #f6f8fc 100%
        );

    box-shadow:
        0 -14px 40px rgba(55, 72, 100, 0.13);
}

.habit-icon-picker__handle {
    width: 54px;
    height: 5px;

    margin: 0 auto 18px;

    border-radius: 999px;

    background: #d7d9df;
}


/* =========================================================
   СЕТКА ЭМОДЗИ
   ========================================================= */

.habit-icon-picker__grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;

    width: 100%;
}

.habit-icon-picker__item {
    aspect-ratio: 1 / 1;

    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 0;
    margin: 0;
    padding: 0;

    border: 1.5px solid transparent;
    border-radius: 50%;
    outline: none;

    background:
        linear-gradient(
            145deg,
            rgba(248, 250, 254, 0.98),
            rgba(239, 243, 249, 0.98)
        );

    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.92);

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Apple Color Emoji",
        "Segoe UI Emoji",
        sans-serif;

    font-size: 25px;
    line-height: 1;

    cursor: pointer;
    user-select: none;

    appearance: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;

    touch-action: manipulation;

    transition:
        transform 90ms ease,
        border-color 120ms ease,
        background 120ms ease,
        box-shadow 120ms ease;
}

.habit-icon-picker__item.is-selected {
    border-color: #3788f5;

    background:
        linear-gradient(
            145deg,
            #f3f8ff,
            #e7f1ff
        );

    box-shadow:
        0 6px 15px rgba(55, 136, 245, 0.14),
        inset 0 1px 1px rgba(255, 255, 255, 0.96);
}

.habit-icon-picker__item:active,
.habit-icon-picker__item.is-pressed {
    transform: scale(0.88);
}


/* =========================================================
   КНОПКА ВЫБРАТЬ
   ========================================================= */

.habit-icon-picker__confirm {
    width: 100%;
    min-height: 58px;

    margin: 18px 0 0;
    padding: 0 20px;

    border: 1px solid rgba(55, 136, 245, 0.12);
    border-radius: 19px;
    outline: none;

    color: #ffffff;

    background:
        linear-gradient(
            145deg,
            #4a97f8,
            #287dea
        );

    box-shadow:
        0 10px 22px rgba(55, 136, 245, 0.2);

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "SF Pro Display",
        Inter,
        Arial,
        sans-serif;

    font-size: 18px;
    font-weight: 650;
    line-height: 1;

    cursor: pointer;
    user-select: none;

    appearance: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;

    touch-action: manipulation;

    transition:
        transform 90ms ease,
        opacity 90ms ease,
        box-shadow 90ms ease;
}

.habit-icon-picker__confirm:active,
.habit-icon-picker__confirm.is-pressed {
    transform: scale(0.98);
    opacity: 0.83;

    box-shadow:
        0 5px 13px rgba(55, 136, 245, 0.15);
}


/* =========================================================
   АДАПТАЦИЯ
   ========================================================= */

@media (max-width: 380px) {

    .habit-icon-picker__sheet {
        padding-left: 14px;
        padding-right: 14px;
    }

    .habit-icon-picker__grid {
        gap: 8px;
    }

    .habit-icon-picker__item {
        font-size: 22px;
    }
}

@media (max-height: 720px) {

    .habit-icon-picker__sheet {
        max-height: 94dvh;
    }

    .habit-icon-picker__grid {
        gap: 7px;
    }

    .habit-icon-picker__confirm {
        min-height: 52px;
        margin-top: 14px;
    }
}