@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap');

body {
    background: #f4f6fa;
    font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
    margin: 0;
    color: #28426b;
    font-size: 13px;
}

/* Основной контейнер */

.container {
    max-width: 1500px;
    padding: 32px 24px;
    margin: 32px auto;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 32px 0 rgb(40 66 107 / 9%);
}

/* Заголовки и описание */

.page-title {
    text-align: center;
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #28426b;
}

.service-description {
    max-width: 800px;
    margin: 0 auto 30px;
    font-size: 1.1rem;
    color: #444;
    line-height: 1.5;
    text-align: center;
}

/* Поисковая форма */

.search-form {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.search-form input[type="text"] {
    padding: 8px 12px;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    width: 240px;
    font-size: 1rem;
    background: #f7fbff;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.search-form input[type="text"]:focus {
    border-color: #3697fd;
    outline: none;
    box-shadow: 0 0 6px rgba(54,151,253,0.5);
}

.search-form button {
    padding: 8px 24px;
    border-radius: 12px;
    background: #28426b;
    color: #fff;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.25s ease;
    height: 40px;
}

.search-form button:hover {
    background: #2469b7;
}

.btn-reset-icon {
    padding: 8px 14px;
    border-radius: 12px;
    border: 1.5px solid #bcd1f1;
    background: #f3f8ff;
    color: #4285f4;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    height: 40px;
    line-height: 1;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.btn-reset-icon:hover {
    background: #e0edff;
    border-color: #28426b;
    color: #28426b;
}

/* Таблица игроков */

.table-wrapper {
    margin-top: 32px;
    background: #f7fbff;
    border-radius: 16px;
    box-shadow: 0 2px 16px 0 rgb(49 53 93 / 7%);
    overflow-x: auto;
}

.my-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    font-size: 0.8rem;
}

.my-table col.col-index    { min-width: 40px; }
.my-table col.col-name     { min-width: 150px; }
.my-table col.col-clan-name{ min-width: 170px; }
.my-table col.col-clan-tag { min-width: 100px; }
.my-table col.col-date     { min-width: 115px; }
.my-table col.col-role     { min-width: 105px; }
.my-table col.col-num      { min-width: 90px; }

.my-table th,
.my-table td {
    padding: 8px 12px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid #e2e6ea;
    vertical-align: middle;
}

.my-table thead th {
    background: #e5efff;
    font-weight: 600;
}

.my-table td.date-cell {
    white-space: normal;
    line-height: 1.25;
    word-wrap: break-word;
}

.my-table th a {
    color: inherit;
    text-decoration: none;
    position: relative;
    padding-bottom: 2px;
    display: inline-block;
}

.my-table th a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    border-bottom: 1.5px solid currentColor;
    transition: width 0.3s ease;
}

.my-table th a:hover::after {
    width: 100%;
}

/* Ссылки в таблице */

a.player-link,
a.clan-link {
    color: inherit;
    text-decoration: none;
    position: relative;
    cursor: pointer;
}

a.player-link::after,
a.clan-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    border-bottom: 1.5px solid currentColor;
    transition: width 0.3s ease;
}

a.player-link:hover::after,
a.clan-link:hover::after {
    width: 100%;
}

a.player-link:hover,
a.clan-link:hover,
a.player-link:visited,
a.clan-link:visited {
    color: inherit;
    text-decoration: none;
}

/* Hover по строке */

.my-table tbody tr:hover td {
    background-color: #d5e4fb;
}

/* Подсветка неактивных игроков */

.tr-inactive-15h td {
    background-color: #fff9c4;
}

.tr-inactive-24h td {
    background-color: #ffcdd2;
}

/* Подпись "N часов назад" */

.last-seen-ago {
    margin-top: 2px;
    font-size: 0.75rem;
    color: #666;
}

/* Ячейки и состояния */

.cell-index {
    font-weight: 600;
}

.cell-num {
    font-variant-numeric: tabular-nums;
}

.cell-empty {
    text-align: center;
    padding: 16px;
}

/* Пагинация */

.pagination {
    margin-top: 20px;
    margin-bottom: 40px;
    text-align: center;
}

.pagination a,
.pagination span {
    margin: 0 4px;
    padding: 8px 14px;
    background-color: #f3f8ff;
    border: 1.5px solid #bcd1f1;
    border-radius: 9px;
    color: #4285f4;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
    display: inline-block;
    font-size: 13px;
    min-width: 34px;
    line-height: 20px;
}

.pagination a:hover {
    background-color: #2469b7;
    color: #fff;
    border-color: #2469b7;
}

.pagination a.active {
    background-color: #28426b;
    border-color: #28426b;
    color: #fff;
    pointer-events: none;
}

.pagination span.ellipsis {
    background: none;
    border: none;
    color: #999;
    cursor: default;
    padding: 8px 6px;
}

/* Топ кланы + кнопка "Добавить клан" */

.top-clans-section {
    margin-top: 30px;
    margin-bottom: 40px;
    width: 100%;
}

.top-clans-section h2 {
    margin-bottom: 12px;
    font-size: 1.4rem;
    font-weight: 600;
    color: #28426b;
}

.clan-cards-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 280px;
    gap: 10px;
    justify-content: start;
}

/* Карточка клана */

.clan-card {
    background: #f7fbff;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(40, 66, 107, 0.12);
    padding: 16px 20px;
    box-sizing: border-box;
    display: block;
    text-align: left;
    width: 280px;
    min-height: 150px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.clan-card:hover {
    box-shadow: 0 8px 24px rgba(40, 66, 107, 0.18);
    transform: translateY(-2px);
}

.clan-card-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 8px;
    text-decoration: none;
    color: #28426b;
    display: inline-block;
}

.clan-card-title:hover {
    color: #2469b7;
}

/* Кнопка "Добавить клан" */

.add-clan-card {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.add-clan-card:hover {
    box-shadow: 0 10px 26px rgba(32, 201, 151, 0.4);
    transform: translateY(-2px);
}

.add-clan-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #fff;
    width: 100%;
}

.add-clan-icon {
    font-size: 32px;
    line-height: 1;
    font-weight: 700;
    margin-bottom: 8px;
}

.add-clan-text {
    font-size: 0.95rem;
    font-weight: 600;
}

/* Footer */

.page-footer {
    background-color: #222;
    color: #ccc;
    padding: 20px 0;
    font-size: 0.9rem;
    text-align: center;
    margin-top: 50px;
}

.footer-container {
    max-width: 900px;
    margin: 0 auto;
}

.footer-nav {
    margin: 10px 0;
}

.footer-nav a {
    color: #79c784;
    text-decoration: none;
    margin: 0 12px;
    font-weight: 500;
}

.footer-nav a:hover {
    text-decoration: underline;
}

.footer-note {
    margin-top: 12px;
    font-style: italic;
}

/* Адаптивность */

@media (max-width: 768px) {
    .container {
        width: 90%;
        padding: 15px;
        margin: 15px auto;
    }

    .search-form {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .search-form input[type="text"] {
        width: 100%;
        max-width: 350px;
        font-size: 12px;
        padding: 5px 8px;
    }

    .search-form button,
    .btn-reset-icon {
        font-size: 12px;
        padding: 6px 12px;
        height: 32px;
        min-width: 90px;
    }

    .clan-cards-grid {
        display: grid;
        grid-auto-flow: row;
        grid-template-columns: 1fr;
        justify-content: stretch;
    }

    .clan-card {
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }

    .my-table {
        font-size: 12px;
    }

    .my-table th,
    .my-table td {
        padding: 4px 6px;
    }

    .table-wrapper {
        overflow-x: auto;
    }
}

@media (max-width: 500px) {
    .container {
        width: 95%;
        padding: 10px;
    }

    .search-form {
        gap: 10px;
    }

    .search-form input[type="text"] {
        font-size: 11px;
        padding: 4px 6px;
    }

    .search-form button,
    .btn-reset-icon {
        font-size: 11px;
        padding: 5px 10px;
        height: 28px;
        min-width: 80px;
    }

    .my-table {
        font-size: 11px;
    }

    .my-table th,
    .my-table td {
        padding: 3px 5px;
    }

    .pagination a {
        padding: 6px 10px;
        font-size: 13px;
    }
}
