/* ============================================================
   Страница талантов
   ============================================================ */

.talents-heading {
    margin-bottom: 2rem;
}

.talents-heading h1 {
    margin-bottom: 0.35rem;
}

.talents-heading p {
    max-width: 72ch;
    text-align: left;
}

/* Фильтры */

.talent-filters {
    margin: 1.5rem 0;
    padding: 1rem;
    border: 1px solid var(--border-color);
    background: var(--table-row-alt);
}

.talent-filters h2 {
    margin: 0 0 0.8rem;
    font-size: 1.2rem;
}

.talent-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(12rem, 1fr)) auto;
    gap: 0.8rem;
    align-items: end;
}

.talent-filter {
    display: grid;
    gap: 0.35rem;
    color: var(--link-color);
    font-size: 0.9rem;
    font-weight: bold;
    text-align: left;
}

.talent-filter input,
.talent-filter select,
.talent-reset {
    min-height: 2.6rem;
    border: 1px solid var(--border-color);
    border-radius: 0;
    background: var(--bg-color);
    color: var(--text-color);
    font: inherit;
}

.talent-filter select {
    width: 100%;
    padding: 0.45rem 2rem 0.45rem 0.6rem;
}

.talent-filter input {
    width: 100%;
    padding: 0.45rem 0.6rem;
}

.talent-filter input::placeholder {
    color: var(--text-color);
    opacity: 0.65;
}

.talent-reset {
    padding: 0.45rem 0.9rem;
    color: var(--link-color);
    cursor: pointer;
}

.talent-reset:hover {
    background: var(--border-color);
    color: var(--bg-color);
}

.talent-results {
    margin: 0.8rem 0 0;
    color: var(--text-color);
    font-size: 0.9rem;
    text-align: left;
}

/* Единая таблица */

.talents-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

.talents-table {
    width: 100%;
    min-width: 1050px;
    border-collapse: collapse;
    font-family: "Courier New", monospace;
    text-align: left;
}

.talents-table th,
.talents-table td {
    padding: 0.65rem 0.75rem;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    vertical-align: top;
}

.talents-table th:last-child,
.talents-table td:last-child {
    border-right: 0;
}

.talents-table tbody tr:last-child td {
    border-bottom: 0;
}

.talents-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--table-header-bg);
    color: var(--table-header-color);
}

.talents-table th:nth-child(1) {
    width: 18%;
}

.talents-table th:nth-child(2) {
    width: 5rem;
}

.talents-table th:nth-child(3) {
    width: 21%;
}

.talents-table th:nth-child(4),
.talents-table th:nth-child(5) {
    width: 11rem;
}

.talent-row:hover {
    background: var(--table-row-alt);
}

.talent-toggle {
    display: grid;
    grid-template-columns: 1.2rem 1fr;
    gap: 0.35rem;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--link-color);
    font: inherit;
    font-weight: bold;
    line-height: inherit;
    text-align: left;
    cursor: pointer;
}

.talent-toggle-icon {
    color: var(--link-color);
    text-align: center;
}

.talent-rank {
    color: var(--link-color);
    font-weight: bold;
    text-align: center;
}

.description-row {
    background: var(--spoiler-content-bg);
}

.description-row td {
    padding: 1rem 1.2rem;
}

.talent-description {
    width: 100%;
    max-width: none;
    text-align: left;
}

.talent-description p,
.talent-description li {
    max-width: none;
}

.talent-description > :first-child {
    margin-top: 0;
}

.talent-description > :last-child {
    margin-bottom: 0;
}

.talent-description p,
.talent-description ul,
.talent-description ol {
    margin: 0.7rem 0;
}

.talent-description ul,
.talent-description ol {
    padding-left: 1.6rem;
}

.talents-message {
    margin: 0;
    padding: 1rem;
    text-align: left;
}

/* Таблица расценок */

.cost-button {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 50;
    padding: 0.65rem 1rem;
    border: 2px solid var(--border-color);
    background: var(--bg-color);
    color: var(--link-color);
    font: inherit;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
}

.cost-button:hover {
    background: var(--border-color);
    color: var(--bg-color);
}

.cost-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.85);
}

.cost-overlay[hidden] {
    display: none;
}

.cost-window {
    position: relative;
    width: min(100%, 720px);
    max-height: 85vh;
    overflow: auto;
    padding: 1.25rem;
    border: 2px solid var(--border-color);
    background: var(--bg-color);
}

.cost-window h2 {
    margin: 0 2.5rem 1rem 0;
    font-size: 1.25rem;
}

.cost-close {
    position: absolute;
    top: 0.65rem;
    right: 0.8rem;
    padding: 0.1rem 0.45rem;
    border: 0;
    background: transparent;
    color: var(--link-color);
    font: inherit;
    font-size: 1.4rem;
    cursor: pointer;
}

.cost-table-wrap {
    overflow-x: auto;
}

.cost-window table {
    width: 100%;
    min-width: 580px;
    border-collapse: collapse;
}

.cost-window th,
.cost-window td {
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.cost-window thead th {
    background: var(--table-header-bg);
    color: var(--table-header-color);
}

@media (max-width: 1000px) {
    .talent-filter-grid {
        grid-template-columns: repeat(2, minmax(12rem, 1fr));
    }
}

@media (max-width: 620px) {
    .talent-filter-grid {
        grid-template-columns: 1fr;
    }

    .talent-reset {
        width: 100%;
    }

    .cost-button {
        right: 0.75rem;
        bottom: 0.75rem;
    }
}
