@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap');

html,
body {
    height: 100%;
    margin: 0;
}

body {
    font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
    background: #f4f6fa;
    color: #28426b;
    font-size: 13px;
}

/* оболочка */

.detail-page-shell {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 32px 16px;
    box-sizing: border-box;
}

.detail-container {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 32px 0 rgb(40 66 107 / 9%);
    padding: 24px 24px 30px;
    box-sizing: border-box;
    max-width: 1500px;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* хлебные крошки */

.breadcrumbs {
    font-size: 0.8rem;
    color: #7a86a8;
    margin-bottom: 10px;
}

.breadcrumbs a {
    color: #4285f4;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs-sep {
    margin: 0 4px;
    opacity: 0.6;
}

/* hero */

.detail-header {
    margin-bottom: 18px;
}

.detail-hero {
    display: flex;
    gap: 16px;
    align-items: center;
    background: #f7fbff;
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 4px 18px rgba(40, 66, 107, 0.08);
}

.detail-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #28426b, #3a7bd5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 26px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.detail-avatar.clan {
    background: linear-gradient(135deg, #0077ff, #24c4ff);
}

.detail-hero-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-title {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 700;
    color: #222;
}

.detail-tag {
    font-size: 0.95rem;
    font-weight: 600;
    color: #6676a2;
    margin-left: 6px;
}

.detail-subtitle {
    margin: 2px 0 4px;
    font-size: 0.9rem;
    color: #4a5670;
}

.detail-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.meta-pill {
    padding: 4px 10px;
    border-radius: 999px;
    background: #e5efff;
    font-size: 0.78rem;
    color: #28426b;
}

/* summary */

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.summary-card {
    background: #fafbfc;
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 2px 12px rgba(40, 66, 107, 0.08);
    box-sizing: border-box;
}

.summary-label {
    font-size: 0.78rem;
    color: #757b90;
    margin-bottom: 4px;
}

.summary-value {
    font-size: 0.98rem;
    font-weight: 600;
    color: #283044;
}

/* секция таблицы — стили как в index.php */

.table-section {
    margin-top: 18px;
}

.table-title {
    margin: 0 0 4px;
    font-size: 1.3rem;
    font-weight: 600;
}

.table-subtitle {
    margin: 0 0 8px;
    font-size: 0.85rem;
    color: #666;
}

.delta-pos-demo { color: #1b5e20; }
.delta-neg-demo { color: #b71c1c; }

.table-wrapper {
    margin-top: 4px;
    background: #f7fbff;
    border-radius: 16px;
    box-shadow: 0 2px 16px 0 rgb(49 53 93 / 7%);
    overflow-x: auto;   /* только горизонтальный скролл */
    max-height: none;   /* без ограничений по высоте */
    overflow-y: visible;
}

.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-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;
    position: sticky;
    top: 0;
    z-index: 2;
}

/* заголовки‑ссылки */

.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%;
}

/* дата в две строки */

.my-table td.date-cell {
    white-space: normal;
    line-height: 1.25;
    word-wrap: break-word;
}

/* ссылки в таблице */

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;
}

/* служебные классы */

.cell-index { font-weight: 600; }
.cell-num   { font-variant-numeric: tabular-nums; }

.cell-empty {
    text-align: center;
    padding: 16px;
}

/* дельты */

.delta-pos,
.delta-neg {
    display: inline-block;
    padding: 1px 4px;
    margin-left: 3px;
    border-radius: 999px;
    font-size: 0.75em;
    font-weight: 500;
}

.delta-pos {
    color: #1b5e20;
    background-color: rgba(76, 175, 80, 0.12);
}

.delta-neg {
    color: #b71c1c;
    background-color: rgba(244, 67, 54, 0.12);
}

/* пагинация — как на главной */

.pagination {
    margin-top: 20px;
    margin-bottom: 10px;
    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 span.active {
    background-color: #28426b;
    border-color: #28426b;
    color: #fff;
}

.pagination span.ellipsis {
    background: none;
    border: none;
    color: #999;
    cursor: default;
    padding: 8px 6px;
}

/* футер (как на главной) */

.page-footer {
    background-color: #222;
    color: #ccc;
    padding: 20px 0;
    font-size: 0.9rem;
    text-align: center;
    margin-top: 26px;
}

.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;
}

.meta-pill-success {
    background: #28a745;
    color: #ffffff;
    font-size: 0.75rem;
}

/* адаптив */

@media (max-width: 768px) {
    .detail-container {
        padding: 20px 14px 26px;
        margin: 10px auto;
    }

    .detail-hero {
        flex-direction: row;
    }

    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .my-table {
        font-size: 12px;
    }

    .my-table th,
    .my-table td {
        padding: 4px 6px;
    }
}

@media (max-width: 500px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .my-table {
        font-size: 11px;
    }

    .my-table th,
    .my-table td {
        padding: 3px 5px;
    }

    .pagination a,
    .pagination span {
        padding: 6px 10px;
        font-size: 13px;
    }
}
