/* Страница покемона (single-pokemons.php). Типы — .pokemon-type из shinydex.css */
.pokemon-page {
    padding-bottom: 65px;
}

.pokemon-page [hidden] {
    display: none;
}

.pokemon-page__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 16px;
    margin-bottom: 24px;
}

.pokemon-page__name {
    font-size: 50px;
    font-weight: 700;
    line-height: 120%;
    text-transform: uppercase;
}

.pokemon-page__number {
    font-family: "Alatsi";
    font-size: 30px;
    color: #838383;
}

.pokemon-page__hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 60px;
}

.pokemon-page__image {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 420px;
    border-radius: 12px;
    background-color: #F8F8F8;
}

.pokemon-page__img {
    width: 70%;
    max-width: 340px;
}

.pokemon-page__gen {
    position: absolute;
    top: 18px;
    left: 20px;
    font-size: 13px;
    color: #838383;
}

/* Покемон уже в коллекции пользователя — иконка в углу, без действия */
.pokemon-page__collected {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    color: #D18ABD;
}

.pokemon-page__collected svg {
    display: block;
    width: 100%;
    height: 100%;
}

.pokemon-page__row {
    margin-bottom: 24px;
}

.pokemon-page__label {
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 700;
    color: #838383;
    text-transform: uppercase;
}

.pokemon-page__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pokemon-type--big {
    padding: 7px 14px;
    font-size: 14px;
}

.pokemon-type--big::before {
    width: 8px;
    height: 8px;
}

.pokemon-type sup {
    margin-left: 2px;
    font-family: "Alatsi";
    font-size: 12px;
    vertical-align: baseline;
}

.pokemon-page__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pokemon-page__descr {
    max-width: 820px;
    font-size: 16px;
    line-height: 160%;
}

/* Плитки: рост, вес, цикл яйца, пол, яйцевые группы */
.pokemon-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.pokemon-tiles__tile {
    padding: 14px 16px;
    border-radius: 12px;
    background-color: #F8F8F8;
}

.pokemon-tiles__tile--wide {
    grid-column: span 2;
}

.pokemon-tiles__label {
    margin-bottom: 6px;
    font-size: 12px;
    color: #838383;
    text-transform: uppercase;
}

.pokemon-tiles__value {
    font-family: "Alatsi";
    font-size: 20px;
}

.pokemon-tiles__value small {
    font-family: "Raleway";
    font-size: 13px;
    color: #838383;
}

.pokemon-tiles__text {
    font-size: 13px;
    line-height: 140%;
    color: #555;
}

.pokemon-gender {
    display: flex;
    height: 8px;
    margin-top: 8px;
    margin-bottom: 6px;
    border-radius: 4px;
    background-color: #ececec;
    overflow: hidden;
}

.pokemon-gender__male {
    background-color: #7ab0e8;
}

.pokemon-gender__female {
    background-color: #D18ABD;
}

.pokemon-gender__text {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

/* Способности: список, описание раскрывается по клику (slideToggle в pokemon.js) */
.pokemon-abilities {
    margin-bottom: 24px;
    border-top: 1px solid #ececec;
}

.pokemon-abilities__item {
    border-bottom: 1px solid #ececec;
}

.pokemon-abilities__head {
    display: flex;
    align-items: center;
    column-gap: 10px;
    width: 100%;
    padding: 14px 4px;
    border: none;
    background: none;
    font-family: "Raleway";
    color: #141414;
    text-align: left;
    cursor: pointer;
}

.pokemon-abilities__name {
    font-size: 16px;
    font-weight: 700;
}

.pokemon-abilities__tag {
    padding: 2px 8px;
    border-radius: 20px;
    background-color: #f3e3ef;
    font-size: 11px;
    color: #9c5689;
}

.pokemon-abilities__arrow {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    margin-top: -4px;
    margin-left: auto;
    border-right: 2px solid #141414;
    border-bottom: 2px solid #141414;
    transform: rotate(45deg);
    transition: 0.3s;
}

.pokemon-abilities__item--open .pokemon-abilities__arrow {
    margin-top: 4px;
    transform: rotate(225deg);
}

.pokemon-abilities__text {
    padding: 0 4px 16px;
    font-size: 15px;
    line-height: 155%;
    color: #3d3d3d;
}

/* Разделы: описание, эволюции, формы, локации */
.pokemon-section {
    margin-bottom: 60px;
}

.pokemon-section__title {
    margin-bottom: 24px;
    font-size: 30px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Эволюции: дерево, условие — внизу карточки */
.pokemon-evolution {
    --line: #d9d9d9;
    padding-top: 12px;
    padding-bottom: 10px;
    overflow-x: auto;
}

.evolution-tree {
    display: flex;
    align-items: center;
}

.evolution-tree__step {
    position: relative;
    flex-shrink: 0;
    width: 60px;
    height: 20px;
}

.evolution-tree__step::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 2px;
    height: 2px;
    margin-top: -1px;
    background-color: var(--line);
}

.evolution-tree__step::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 2px;
    width: 9px;
    height: 9px;
    border-top: 2px solid var(--line);
    border-right: 2px solid var(--line);
    transform: translateY(-50%) rotate(45deg);
}

.evolution-tree__stem {
    flex-shrink: 0;
    width: 20px;
    height: 2px;
    background-color: var(--line);
}

.evolution-tree__children {
    display: flex;
    flex-direction: column;
}

.evolution-tree__child {
    position: relative;
    display: flex;
    align-items: center;
    padding: 10px 0 10px 20px;
}

/* Ствол ветвления: вертикальная линия от первой ветки до последней */
.evolution-tree__child::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    border-left: 2px solid var(--line);
}

.evolution-tree__child:first-child::before {
    top: 50%;
}

.evolution-tree__child:last-child::before {
    bottom: 50%;
}

/* Отвод от ствола к ветке */
.evolution-tree__child::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 20px;
    margin-top: -1px;
    border-top: 2px solid var(--line);
}

.evolution-tree__children--single > .evolution-tree__child {
    padding: 0;
}

.evolution-tree__children--single > .evolution-tree__child::before,
.evolution-tree__children--single > .evolution-tree__child::after {
    display: none;
}

.evolution-tree__grid {
    display: grid;
    grid-template-columns: repeat(4, 170px);
    gap: 14px;
}

.evolution-card {
    position: relative;
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    align-items: center;
    width: 170px;
    padding: 10px 10px 14px;
    border: 2px solid transparent;
    border-radius: 12px;
    background-color: #F8F8F8;
    color: #141414;
    transition: 0.3s;
}

.evolution-card:hover {
    background-color: #fff;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.25);
}

.evolution-card--current {
    border-color: #D18ABD;
    background-color: #fff;
}

.evolution-card--current::before {
    content: "Сейчас";
    position: absolute;
    top: -10px;
    left: 50%;
    padding: 1px 8px;
    border-radius: 20px;
    background-color: #D18ABD;
    font-size: 11px;
    color: #fff;
    transform: translateX(-50%);
}

.evolution-card__number {
    align-self: flex-end;
    font-family: "Alatsi";
    font-size: 12px;
    color: #838383;
}

.evolution-card__img {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 90px;
}

.evolution-card__img img {
    max-width: 90px;
    max-height: 90px;
    object-fit: contain;
}

.evolution-card__name {
    margin-top: 4px;
    margin-bottom: 6px;
    font-size: 14px;
    text-align: center;
    text-transform: uppercase;
}

.evolution-card__types {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin-bottom: 10px;
}

.evolution-card__extra {
    margin-bottom: 10px;
    padding: 2px 8px;
    border-radius: 20px;
    background-color: #f3e3ef;
    font-size: 11px;
    color: #9c5689;
}

/* Способ эволюции — внизу карточки, прижат к нижнему краю */
.evolution-card__cond {
    display: block;
    align-self: stretch;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #e7e7e7;
    font-size: 12px;
    line-height: 130%;
    text-align: center;
}

.evolution-card__cond--base {
    color: #a0a0a0;
}

.evolution-card__icon svg {
    width: 14px;
    height: 14px;
    margin-right: 4px;
    vertical-align: -2px;
}

.evolution-card__icon--level {
    color: #838383;
}

.evolution-card__icon--item {
    color: #2980EF;
}

.evolution-card__icon--friend {
    color: #D18ABD;
}

.evolution-card__icon--other {
    color: #FF8000;
}

/* Формы */
.pokemon-forms {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.pokemon-forms__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 12px 16px;
    border-radius: 12px;
    background-color: #F8F8F8;
    color: #141414;
    transition: 0.3s;
}

.pokemon-forms__item:hover {
    background-color: #fff;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.25);
}

.pokemon-forms__tag {
    align-self: flex-start;
    padding: 3px 9px;
    border-radius: 20px;
    background-color: #f3e3ef;
    font-size: 11px;
    color: #9c5689;
}

.pokemon-forms__zoom {
    cursor: zoom-in;
}

.pokemon-forms__img {
    width: 170px;
    max-width: 100%;
    height: 170px;
    margin-top: 6px;
    margin-bottom: 6px;
    object-fit: contain;
}

.pokemon-forms__name {
    font-size: 14px;
    text-align: center;
    text-transform: uppercase;
}

.pokemon-forms__name--link {
    color: #141414;
    transition: 0.3s;
}

.pokemon-forms__name--link:hover {
    color: #D18ABD;
}

/* Локации: каждая игра отдельной строкой, места — «таблетками» */
.pokemon-locations {
    border-top: 1px solid #f0f0f0;
}

.pokemon-locations__row {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: 0.3s;
}

.pokemon-locations__row:hover {
    background-color: #F8F8F8;
}

.pokemon-locations__game {
    display: flex;
    align-items: center;
    column-gap: 10px;
    font-size: 16px;
    font-weight: 700;
}

.pokemon-locations__game::before {
    content: "";
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--game);
}

.pokemon-locations__places {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pokemon-locations__place {
    padding: 4px 12px;
    border-radius: 20px;
    background-color: #F3F3F3;
    font-size: 14px;
}

.pokemon-locations__more {
    display: flex;
    width: fit-content;
    margin: 20px auto 0;
}

/* Соседние покемоны */
.pokemon-pager {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.pokemon-pager__link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 20px 10px 12px;
    border-radius: 12px;
    background-color: #F8F8F8;
    color: #141414;
    transition: 0.3s;
}

.pokemon-pager__link:hover {
    background-color: #fff;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.25);
}

.pokemon-pager__link--next {
    flex-direction: row-reverse;
    margin-left: auto;
    padding: 10px 12px 10px 20px;
    text-align: right;
}

.pokemon-pager__img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.pokemon-pager__arrow {
    font-size: 22px;
    color: #838383;
}

.pokemon-pager__num {
    display: block;
    font-family: "Alatsi";
    font-size: 13px;
    color: #838383;
}

@media (max-width: 1000px) {
    .pokemon-forms {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .pokemon-page__hero {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 40px;
    }

    .pokemon-page__image {
        min-height: 300px;
    }
}

/* Телефон: дерево эволюций сверху вниз, ветки — колонками */
@media (max-width: 767px) {
    .pokemon-page__name {
        font-size: 30px;
    }

    .pokemon-page__number {
        font-size: 22px;
    }

    .pokemon-page__image {
        min-height: 260px;
    }

    .pokemon-page__img {
        width: 60%;
    }

    .pokemon-tiles {
        grid-template-columns: 1fr 1fr;
    }

    .pokemon-section {
        margin-bottom: 40px;
    }

    .pokemon-section__title {
        font-size: 22px;
    }

    .evolution-tree {
        flex-direction: column;
    }

    .evolution-tree__step {
        width: 100%;
        height: 30px;
    }

    .evolution-tree__step::before {
        top: 0;
        bottom: 2px;
        left: 50%;
        right: auto;
        width: 2px;
        height: auto;
        margin-top: 0;
        margin-left: -1px;
    }

    .evolution-tree__step::after {
        top: auto;
        bottom: 2px;
        left: 50%;
        right: auto;
        transform: translateX(-50%) rotate(135deg);
    }

    .evolution-tree__stem {
        width: 2px;
        height: 16px;
    }

    .evolution-tree__children {
        flex-direction: row;
        justify-content: center;
        width: 100%;
    }

    .evolution-tree__child {
        flex: 1;
        flex-direction: column;
        min-width: 0;
        padding: 16px 4px 0;
    }

    .evolution-tree__child::before {
        top: 0;
        bottom: auto;
        left: 0;
        right: 0;
        border-top: 2px solid var(--line);
        border-left: none;
    }

    .evolution-tree__child:first-child::before {
        top: 0;
        left: 50%;
    }

    .evolution-tree__child:last-child::before {
        bottom: auto;
        right: 50%;
    }

    .evolution-tree__child::after {
        top: 0;
        left: 50%;
        width: 0;
        height: 16px;
        margin-top: 0;
        margin-left: -1px;
        border-top: none;
        border-left: 2px solid var(--line);
    }

    .evolution-tree__grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px 8px;
        width: 100%;
    }

    .evolution-card {
        width: 100%;
        max-width: 170px;
        margin: 0 auto;
    }

    .evolution-card--current {
        margin-top: 10px;
    }

    .evolution-card__img,
    .evolution-card__img img {
        max-height: 70px;
    }

    .evolution-card__img {
        height: 70px;
    }

    .evolution-card__cond {
        font-size: 11px;
    }

    .pokemon-locations__row {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 12px 6px;
    }

    .pokemon-locations__game {
        font-size: 15px;
    }

    .pokemon-locations__place {
        font-size: 13px;
    }

    .pokemon-pager__link {
        flex: 1;
        padding: 8px;
    }

    .pokemon-pager__img {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .pokemon-forms {
        grid-template-columns: 1fr 1fr;
    }

    .pokemon-forms__img {
        width: 120px;
        height: 120px;
    }

    .pokemon-tiles__tile--wide {
        grid-column: span 2;
    }

    .pokemon-page__actions .btn {
        flex-grow: 1;
    }
}
