/* ===== Личный кабинет: боковое меню ===== */
.profile [hidden] {
    display: none;
}

.profile__layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 40px;
    margin-top: 30px;
    margin-bottom: 80px;
}

/* Иначе широкое содержимое (лента меню на телефоне) растягивает колонку */
.profile__aside,
.profile__content {
    min-width: 0;
}

.profile-menu {
    display: flex;
    flex-direction: column;
    row-gap: 6px;
}

.profile-user {
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 12px;
    background-color: #F8F8F8;
    text-align: center;
}

.profile-user__avatar {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 90px;
    height: 90px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background-color: #D18ABD;
    color: #fff;
    /* В Alatsi нет кириллицы — первая буква ника может быть русской */
    font-family: "Raleway";
    font-size: 40px;
    font-weight: 700;
    overflow: hidden;
}

.profile-user__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-user__name {
    font-size: 20px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.profile-user__since {
    margin-top: 5px;
    font-size: 14px;
    color: #838383;
}

.profile-menu__item {
    display: flex;
    justify-content: space-between;
    padding: 14px 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.4s;
}

.profile-menu__item:hover {
    background-color: #F8F8F8;
}

.profile-menu__item--active,
.profile-menu__item--active:hover {
    background-color: #141414;
    color: #fff;
}

.profile-menu__badge {
    font-family: "Alatsi";
}

.profile-menu__exit {
    margin-top: 20px;
    padding: 14px 18px;
    color: #b5475b;
    cursor: pointer;
}

.profile-pane {
    display: none;
}

.profile-pane--active {
    display: block;
}

.profile-pane__title {
    margin: 0 0 20px;
    font-size: 28px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Ханты: карточки из ленты счетчика (.counter-hunts__item) в сетке */
.profile-hunts__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 15px;
}

.profile-hunts__action {
    margin-top: 4px;
    padding: 0;
    border: none;
    background-color: transparent;
    font-family: "Raleway";
    font-size: 13px;
    text-transform: uppercase;
    text-decoration: underline;
    color: #141414;
    cursor: pointer;
}

.profile-hunts__action:disabled {
    opacity: 0.5;
    cursor: default;
}

.profile-hunts__empty {
    font-size: 18px;
    color: #838383;
}

.profile-hunts__empty a {
    color: #141414;
    text-decoration: underline;
}

.profile-hunts .load-more {
    margin-top: 40px;
}

/* Обзор: статистика и последние шайни */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 20px;
}

.profile-stats__item {
    padding: 20px;
    border-radius: 12px;
    background-color: #F8F8F8;
}

.profile-stats__value {
    font-family: "Alatsi";
    font-size: 34px;
    font-weight: 700;
    white-space: nowrap;
}

.profile-stats__unit {
    font-family: "Raleway";
    font-size: 20px;
    font-weight: 600;
}

.profile-stats__label {
    margin-top: 4px;
    font-size: 13px;
    color: #838383;
    text-transform: uppercase;
}

.profile-overview__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-top: 45px;
    margin-bottom: 20px;
}

.profile-overview__title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    text-transform: uppercase;
}

.profile-overview__link {
    font-size: 14px;
    text-transform: uppercase;
    text-decoration: underline;
    color: #141414;
    cursor: pointer;
}

/* Найденные шайни */
.profile-hunts--found .profile-hunts__list {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.shiny-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 15px;
    border-radius: 12px;
    background-color: #F8F8F8;
}

.shiny-card__date {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 3px 8px;
    border-radius: 6px;
    background-color: #fff;
    font-size: 12px;
}

.shiny-card__menu-btn {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background-color: transparent;
    font-size: 20px;
    line-height: 100%;
    color: #141414;
    cursor: pointer;
    transition: 0.3s;
}

.shiny-card__menu-btn:hover,
.shiny-card--menu-open .shiny-card__menu-btn {
    background-color: #fff;
}

.shiny-card__menu {
    position: absolute;
    top: 42px;
    right: 8px;
    z-index: 2;
    display: none;
    flex-direction: column;
    min-width: 160px;
    padding: 6px;
    border-radius: 12px;
    background-color: #fff;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}

.shiny-card--menu-open .shiny-card__menu {
    display: flex;
}

.shiny-card__menu-item {
    padding: 9px 12px;
    border: none;
    border-radius: 6px;
    background-color: transparent;
    font-family: "Raleway";
    font-size: 14px;
    color: #141414;
    text-align: left;
    cursor: pointer;
}

.shiny-card__menu-item:hover {
    background-color: #F8F8F8;
}

.shiny-card__menu-item[data-action="delete"] {
    color: #b5475b;
}

.shiny-card__img {
    width: 110px;
    height: 110px;
    margin-top: 15px;
    object-fit: contain;
}

.shiny-card__name {
    margin-top: 8px;
    font-size: 18px;
    text-align: center;
    text-transform: uppercase;
}

.shiny-card__game {
    min-height: 16px;
    margin-top: 3px;
    font-size: 13px;
    color: #838383;
    text-align: center;
}

.shiny-card__stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    margin-top: 15px;
}

.shiny-card__stat {
    padding: 8px;
    border-radius: 6px;
    background-color: #fff;
    text-align: center;
}

.shiny-card__stat--wide {
    grid-column: span 2;
}

.shiny-card__stat-value {
    font-family: "Alatsi";
    font-size: 18px;
}

.shiny-card__stat-label {
    font-size: 11px;
    color: #838383;
    text-transform: uppercase;
}

/* Окна кабинета — общий попап .modal (assets/css/modal.css), здесь только раскладка содержимого */
.profile-modal--edit .modal__card {
    display: flex;
    flex-direction: column;
}

/* Селект сайта (sort-select) в размер полей окна */
.profile-modal .sort-select__head {
    padding: 12px 40px 12px 14px;
    border: 1px solid #d9d9d9;
    background-color: #fff;
    font-size: 15px;
    text-align: left;
}

.profile-modal .sort-select__head::after {
    top: 50%;
    right: 14px;
    margin-top: -5px;
}

/* Список раскрывается внутри окна и сдвигает кнопку — не обрезается прокруткой окна */
.profile-modal .sort-select__body {
    position: static;
    margin-top: 4px;
    border-radius: 6px;
}

.profile-modal .sort-option {
    padding: 10px 14px;
    font-size: 14px;
    text-align: left;
}

/* Настройки */
.profile-settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.profile-settings__block {
    padding: 25px;
    border-radius: 12px;
    background-color: #F8F8F8;
}

.profile-settings__title {
    margin-bottom: 18px;
    font-size: 20px;
    font-weight: 700;
}

.profile-settings__field {
    display: flex;
    flex-direction: column;
    row-gap: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

.profile-settings__input {
    padding: 12px 14px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    background-color: #fff;
    font-family: "Raleway";
    font-size: 15px;
}

.profile-settings__message {
    margin-bottom: 15px;
    font-size: 14px;
    color: #3f8f4f;
}

.profile-settings__message--error {
    color: #b5475b;
}

.profile-settings__message:empty {
    display: none;
}

.profile-settings__hint {
    font-size: 13px;
    color: #838383;
}

/* Аватар: текущий, загрузка и готовые */
.profile-avatar {
    grid-column: 1 / -1;
}

.profile-avatar--saving {
    opacity: 0.6;
    pointer-events: none;
}

.profile-avatar__current {
    display: flex;
    align-items: center;
    gap: 25px;
}

.profile-avatar__preview {
    flex-shrink: 0;
    margin: 0;
}

.profile-avatar__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 20px;
}

.profile-avatar__upload {
    cursor: pointer;
}

.profile-avatar__remove {
    padding: 0;
    border: none;
    background-color: transparent;
    font-family: "Raleway";
    font-size: 14px;
    text-decoration: underline;
    color: #b5475b;
    cursor: pointer;
}

.profile-avatar__actions .profile-settings__hint {
    flex-basis: 100%;
}

/* Окно готовых аватаров: шире окна правки, заголовок и крестик на месте — прокручивается только сетка */
.profile-modal--avatars .modal__card {
    width: 720px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.profile-avatar__presets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 14px;
    min-height: 0;
    padding: 2px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #7b78a8 transparent;
}

.profile-avatar__preset {
    aspect-ratio: 1;
    padding: 0;
    border: 3px solid transparent;
    border-radius: 50%;
    background-color: #F8F8F8;
    overflow: hidden;
    cursor: pointer;
    transition: 0.3s;
}

.profile-avatar__preset:hover {
    border-color: #d9d9d9;
}

.profile-avatar__preset--active,
.profile-avatar__preset--active:hover {
    border-color: #D18ABD;
}

.profile-avatar__preset img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Гость */
.profile__guest {
    max-width: 700px;
    margin-top: 30px;
    margin-bottom: 50px;
}

.profile__guest-text {
    margin-bottom: 25px;
    font-size: 20px;
    line-height: 140%;
}

.profile__guest-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

@media (max-width: 1199px) {
    .profile-hunts--found .profile-hunts__list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 967px) {
    .profile__layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* Пользователь в строку, меню — горизонтальной лентой с прокруткой */
    .profile-user {
        display: flex;
        align-items: center;
        column-gap: 15px;
        margin-bottom: 15px;
        padding: 15px;
        text-align: left;
    }

    .profile-user__avatar {
        flex-shrink: 0;
        width: 56px;
        height: 56px;
        margin: 0;
        font-size: 26px;
    }

    .profile-menu {
        flex-direction: row;
        column-gap: 6px;
        padding-bottom: 6px;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .profile-menu__item,
    .profile-menu__exit {
        flex-shrink: 0;
        column-gap: 8px;
        margin-top: 0;
        padding: 10px 14px;
        white-space: nowrap;
    }

    .profile-menu__item:not(.profile-menu__item--active) {
        background-color: #F8F8F8;
    }

    .profile-settings {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .profile-pane__title {
        font-size: 22px;
    }

    .profile-hunts--found .profile-hunts__list {
        grid-template-columns: 1fr;
    }

    .profile-stats {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .profile-stats__item {
        padding: 15px;
    }

    .profile-stats__value {
        font-size: 26px;
    }

    .profile-stats__unit {
        font-size: 15px;
    }


    .profile-avatar__presets {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }

    .profile-settings__block {
        padding: 20px;
    }

    .profile__guest-text {
        font-size: 16px;
    }

    .profile__guest-btn {
        width: 100%;
    }
}
