@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap');

/* =======================
   Дизайн‑токены
   ======================= */

:root {
    --bg-page: #f4f6fa;
    --bg-card: #ffffff;
    --bg-card-soft: #f7fbff;
    --bg-chip: #f3f8ff;

    --border-soft: #d1d7e0;
    --border-strong: #bcd1f1;

    --text-main: #28426b;
    --text-secondary: #444;
    --text-muted: #666;

    --accent: #28426b;
    --accent-light: #2469b7;
    --accent-soft: #e5efff;

    --shadow-soft: 0 4px 32px 0 rgb(40 66 107 / 9%);
    --shadow-card: 0 4px 16px rgba(40, 66, 107, 0.12);
}

/* =======================
   Базовый layout
   ======================= */

html,
body {
    height: 100%;
    margin: 0;
}

body {
    background: var(--bg-page);
    font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
    color: var(--text-main);
    font-size: 13px;
}

/* Общий контейнер для index */

.page-shell {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 32px 16px;
    box-sizing: border-box;
}

.container-main {
    max-width: 1500px;
    width: 100%;
    background: #fff;
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    padding: 32px 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* Контейнер клана */

.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: var(--shadow-soft);
    padding: 24px 24px 30px;
    box-sizing: border-box;
    max-width: 1500px;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Контейнер игрока */

.player-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 32px 16px;
    box-sizing: border-box;
}

.player-page .container {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    padding: 24px 24px 32px 24px;
    box-sizing: border-box;
    max-width: 1500px;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Общие ссылки */

a {
    color: #4285f4;
    text-decoration: none;
}

/* =======================
   Заголовок / hero (index)
   ======================= */

.page-header {
    margin-bottom: 40px;
}

.hero-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.hero-copy {
    flex: 1 1 auto;
}

.page-title {
    text-align: left;
    font-weight: 800;
    font-size: 2.6rem;
    margin-bottom: 16px;
    color: var(--text-main);
}

.hero-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}

.last-update-label {
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    background: var(--accent);
    color: #ffffff;
    font-size: 0.8rem;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(40, 66, 107, 0.3);
}

.last-update-date {
    font-weight: 600;
}

.service-description {
    max-width: 800px;
    margin: 20px 0 8px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #4a5670;
}

.service-usp {
    margin: 0;
    font-size: 0.85rem;
    color: #6a7aa2;
}

/* маленький визуальный блок — если нужен */

.hero-side-visual {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-pill {
    width: 110px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, #5b8def, #7ab7ff);
    box-shadow: 0 12px 26px rgba(65, 105, 225, 0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-pill-icon {
    font-size: 28px;
    margin-bottom: 4px;
}

.hero-pill-bars {
    display: flex;
    gap: 3px;
    align-items: flex-end;
}

.hero-pill-bars span {
    width: 7px;
    border-radius: 4px 4px 0 0;
    background: rgba(255, 255, 255, 0.9);
}

.hero-pill-bars span:nth-child(1) { height: 12px; }
.hero-pill-bars span:nth-child(2) { height: 18px; }
.hero-pill-bars span:nth-child(3) { height: 24px; }

/* =======================
   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;
}

.meta-pill-success {
    background: #28a745;
    color: #ffffff;
    font-size: 0.75rem;
}

/* =======================
   HERO игрока
   ======================= */

.player-page .hero {
    display: flex;
    gap: 20px;
    align-items: stretch;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.player-page .hero-main {
    flex: 1 1 320px;
    background: #f7fbff;
    border-radius: 16px;
    padding: 18px 20px;
    display: flex;
    gap: 16px;
    align-items: center;
}

.player-page .hero-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;
}

.player-page .hero-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.player-page .hero-name {
    font-size: 1.6rem;
    font-weight: 700;
    color: #222;
}

.player-page .hero-clan {
    font-size: 0.98rem;
    color: #444;
}

.player-page .hero-tag {
    font-size: 0.9rem;
    color: #777;
}

.player-page .hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.player-page .hero-badge {
    padding: 4px 10px;
    border-radius: 999px;
    background: #e5efff;
    font-size: 0.78rem;
    color: #28426b;
}

/* =======================
   Хлебные крошки
   ======================= */

.breadcrumbs,
.breadcrumb {
    font-size: 0.8rem;
    color: #7a86a8;
    margin-bottom: 10px;
}

.breadcrumbs a,
.breadcrumb a {
    color: #4285f4;
}

.breadcrumbs-sep,
.breadcrumb-sep {
    margin: 0 4px;
    opacity: 0.6;
}

/* =======================
   Кнопки
   ======================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 24px;
    border-radius: 12px;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
    height: 40px;
}

button.btn,
a.btn {
    font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-light);
}

.btn-secondary {
    background: #f3f8ff;
    color: #4285f4;
    border: 1.5px solid var(--border-strong);
}

.btn-secondary:hover {
    background: #e0edff;
    border-color: var(--accent);
    color: var(--accent);
}

.btn-ghost {
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--border-strong);
}

.btn-ghost:hover {
    background: #e0edff;
}

/* маленькие кнопки (клан/игрок) */

button.btn-small,
a.btn-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 16px;
    height: 32px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 999px;
    line-height: 1.3;
}

/* Основная маленькая (синяя) */
button.btn-small,
a.btn-small:not(.btn-ghost) {
    border: 1px solid #4285f4;
    background-color: #4285f4;
    color: #ffffff;
}

button.btn-small:hover,
a.btn-small:not(.btn-ghost):hover {
    background-color: #2469b7;
    box-shadow: 0 3px 10px rgba(36, 105, 183, 0.45);
    transform: translateY(-1px);
}

/* Вторичная маленькая (прозрачная) */
.btn.btn-ghost.btn-small {
    border: 1px solid #bcd1f1;
    background-color: #f3f8ff;
    color: #4285f4;
    box-shadow: none;
}

.btn.btn-ghost.btn-small:hover {
    background-color: #e2edff;
    border-color: #4285f4;
    transform: translateY(-1px);
}

/* =======================
   Поисковая форма (index)
   ======================= */

.search-section {
    margin-bottom: 36px;
}

.search-form {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.search-form input[type="text"] {
    padding: 8px 12px;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    width: 240px;
    font-size: 0.95rem;
    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);
}

/* =======================
   TOP / фильтры (index)
   ======================= */

.filter-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.filter-tabs::-webkit-scrollbar {
    display: none;
}

.filter-tab,
.filter-tab:link,
.filter-tab:visited {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    color: #4b5563;
    background: #eef2ff;
    border: 1px solid #e5e7eb;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}

.filter-tab:hover,
.filter-tab:active,
.filter-tab:focus {
    background: #e0e7ff;
    color: #111827;
    border-color: #c7d2fe;
    outline: none;
    text-decoration: none;
}

.filter-tab.active {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    font-weight: 600;
}

.tab-icon {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

/* =======================
   TOP карточки кланов
   ======================= */

.top-clans-section {
    margin-top: 20px;
    margin-bottom: 32px;
    width: 100%;
}

.clan-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

/* =======================
   TOP карточки кланов
   ======================= */

   .top-clans-section {
    margin-top: 20px;
    margin-bottom: 32px;
    width: 100%;
}

.clan-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.clan-card {
    background: var(--bg-card-soft);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    padding: 16px 20px;
    box-sizing: border-box;
    display: block;
    text-align: left;
    min-height: 150px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    color: inherit;
}

/* ссылки внутри карточки: никогда не подчёркивать обычным способом */
.clan-card a,
.clan-card a:link,
.clan-card a:visited,
.clan-card a:hover,
.clan-card a:active {
    color: inherit;
    text-decoration: none !important;
    border-bottom: none !important;
}

/* hover карточки */
.clan-card:hover {
    box-shadow: 0 8px 24px rgba(40, 66, 107, 0.18);
    transform: translateY(-2px);
}

/* заголовок клана */
.clan-card-title {
    position: relative;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: var(--text-main);
}

/* заголовок-ссылка тоже без стандартного underline */
.clan-card-title a {
    text-decoration: none !important;
    border-bottom: none !important;
}

/* подчёркивание заголовка только псевдоэлементом */
.clan-card-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    border-radius: 999px;
    background: rgba(40, 66, 107, 0.7);
    transition: width 0.25s ease;
}

.clan-card:hover .clan-card-title::after {
    width: 100%;
}

/* подзаголовок и статистика */
.clan-card-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.clan-card-stats {
    font-size: 0.8rem;
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 4px;
}

.clan-card-stats .label {
    color: var(--text-muted);
    margin-right: 4px;
}

.clan-card-stats .value {
    font-weight: 600;
}

/* подписочный клан — градиентная рамка */
.sub-clan-card {
    position: relative;
    border-radius: 20px;
    padding: 5px;
    background: linear-gradient(135deg, #f97316, #ec4899, #3b82f6);
}

.sub-clan-card .clan-card {
    box-shadow: none;
    border-radius: 16px;
}

/* кнопка Добавить клан */
.add-clan-card {
    background: linear-gradient(135deg, #22c55e, #3b82f6);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 10px 26px rgba(30, 64, 175, 0.4);
}

.add-clan-card:hover {
    filter: brightness(1.05);
    transform: translateY(-2px);
}

.add-clan-icon {
    font-size: 32px;
    line-height: 1;
    font-weight: 700;
    margin-bottom: 8px;
    color: #ffffff;
}

.add-clan-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
}

/* подписочный клан — градиентная рамка */

.sub-clan-card {
    position: relative;
    border-radius: 20px;
    padding: 5px;
    background: linear-gradient(135deg, #f97316, #ec4899, #3b82f6);
}

.sub-clan-card .clan-card {
    box-shadow: none;
    border-radius: 16px;
}

/* кнопка Добавить клан */

.add-clan-card {
    background: linear-gradient(135deg, #22c55e, #3b82f6);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 10px 26px rgba(30, 64, 175, 0.4);
}

.add-clan-card:hover {
    filter: brightness(1.05);
    transform: translateY(-2px);
}

.add-clan-icon {
    font-size: 32px;
    line-height: 1;
    font-weight: 700;
    margin-bottom: 8px;
    color: #ffffff;
}

.add-clan-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
}



/* =======================
   Таблица (общая)
   ======================= */

.table-section {
    margin-top: 10px;
}

.table-title {
    margin: 0 0 4px;
    font-size: 1.3rem;
    font-weight: 600;
}

.table-subtitle {
    margin: 0 0 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.delta-pos-demo { color: #1b5e20; }
.delta-neg-demo { color: #b71c1c; }

.table-wrapper {
    margin-top: 4px;
    background: var(--bg-card-soft);
    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: 130px; }
.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: 130px; }
.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: var(--accent-soft);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 2;
}

.th-info {
    display: inline-block;
    margin-left: 4px;
    padding: 0 4px;
    border-radius: 999px;
    border: 1px solid rgba(40, 66, 107, 0.4);
    font-size: 0.65rem;
    cursor: default;
    color: var(--text-main);
}

.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; }

.tr-sub-clan > td {
    background-image: linear-gradient(
        90deg,
        rgba(249, 115, 22, 0.03),
        rgba(59, 130, 246, 0.06)
    );
}

.my-table tbody tr.tr-sub-clan:hover td {
    background-image: linear-gradient(
        90deg,
        rgba(249, 115, 22, 0.06),
        rgba(59, 130, 246, 0.10)
    );
    background-color: transparent;
}

.last-seen-ago {
    margin-top: 2px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.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);
}

/* =======================
   Подсветка неактивных (клан)
   ======================= */

.table-controls {
    margin: 20px 0 12px;
    background: #f7fbff;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 2px 10px rgba(40, 66, 107, 0.06);
    border: 1px solid rgba(40, 66, 107, 0.08);
}

.inactive-filter-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.inactive-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: flex-start;
}

.inactive-filter-group {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: #2c3e5a;
}

.inactive-filter-range {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    color: #2c3e5a;
}

.inactive-filter-label {
    font-weight: 600;
    color: #283044;
}

.inactive-filter-range label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.inactive-filter-range input[type="number"] {
    width: 60px;
    padding: 4px 5px;
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid #d0d4dd;
    background-color: #f9fafc;
    color: #283044;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.inactive-filter-range input[type="number"]:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.16);
    background-color: #ffffff;
}

.inactive-filter-legend.inline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 16px;
    font-size: 12px;
    color: #6b7280;
}

.legend-box {
    display: inline-block;
    width: 18px;
    height: 10px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.08);
}

.legend-soft { background-color: #fff8d8; }
.legend-hard { background-color: #ffe0dd; }

.inactive-filter-actions.below {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

/* =======================
   Сводка игрока / графики
   ======================= */

.player-summary-row {
    margin-bottom: 22px;
}

.player-summary-block {
    background: #fafbfc;
    border-radius: 16px;
    box-shadow: 0 4px 18px rgba(20, 60, 110, 0.08);
    padding: 14px 18px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    box-sizing: border-box;
}

.summary-column {
    font-size: 0.86rem;
    color: #444;
}

.summary-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #757b90;
    margin-bottom: 4px;
}

.summary-value {
    font-size: 0.98rem;
    font-weight: 600;
    color: #283044;
    margin-bottom: 2px;
}

.summary-sub {
    font-size: 0.83rem;
    color: #4a5670;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: 20px;
}

.chart-wrapper {
    background: #fafbfc;
    border-radius: 16px;
    box-shadow: 0 5px 15px rgba(20, 60, 110, 0.08);
    padding: 14px 18px 22px 18px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.chart-wrapper h3 {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #222;
}

.chart-summary {
    background: #f8f9ff;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #444;
}

.chart-summary-green {
    background: #c8e6c9;
    color: #1b5e20;
}

.chart-canvas-wrap {
    position: relative;
    width: 100%;
    height: 220px;
}

.chart-canvas-wrap .canvas-small {
    height: 190px !important;
}

.canvas-large,
.canvas-small {
    width: 100% !important;
    height: 100% !important;
}

/* =======================
   Футер (общий)
   ======================= */

.page-footer {
    margin-top: 24px;
    padding: 18px 22px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(40, 66, 107, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.4);
    color: #4b5563;
    font-size: 12px;
}

.footer-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    justify-content: center;
}

.footer-nav a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    font-size: 12px;
}

.footer-nav a:hover {
    text-decoration: underline;
}

.footer-note {
    text-align: center;
    font-size: 11px;
    color: #6b7280;
}

/* =======================
   Модальное окно (index)
   ======================= */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(21, 25, 36, 0.65);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal {
    background: #fff;
    border-radius: 18px;
    padding: 24px 24px 20px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.45);
    box-sizing: border-box;
}

.modal h3 {
    margin: 0 0 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
}

.modal p {
    margin: 0 0 14px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.modal input[type="text"] {
    width: 100%;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1.5px solid #ccd3e2;
    font-size: 0.95rem;
    box-sizing: border-box;
    margin-bottom: 16px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
    margin-bottom: 10px;
}

.modal-footnote {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.modal-footnote a {
    color: #79c784;
    text-decoration: none;
}

.modal-footnote a:hover {
    text-decoration: underline;
}

/* =======================
   Пагинация (общая)
   ======================= */

.pagination {
    margin-top: 16px;
    margin-bottom: 32px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    min-width: 32px;
    height: 30px;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid #d1d7e0;
    background-color: #f5f7fb;
    color: #4b5563;
    font-size: 12px;
    font-weight: 500;
    line-height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.pagination a:hover {
    background-color: #e0e7ff;
    border-color: #c7d2fe;
    color: #1f2937;
}

.pagination a.active {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
    font-weight: 600;
    pointer-events: none;
}

.pagination span.ellipsis {
    background: transparent;
    border-color: transparent;
    color: #9ca3af;
    cursor: default;
    padding: 0 4px;
}

.pagination a:first-child,
.pagination a:last-child {
    min-width: 28px;
}

/* =======================
   Адаптив
   ======================= */

@media (max-width: 900px) {

    .hero-layout {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .hero-side-visual {
        align-self: center;
    }

    .container-main,
    .detail-container,
    .player-page .container {
        width: 90%;
        padding: 15px;
        margin: 15px auto;
    }

    .search-form {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .search-form input[type="text"] {
        width: 100%;
        max-width: 350px;
        font-size: 12px;
        padding: 5px 8px;
    }

    .btn {
        font-size: 12px;
        padding: 6px 12px;
        height: 32px;
        min-width: 90px;
    }

    .clan-cards-grid {
        grid-template-columns: 1fr;
    }

    .my-table {
        font-size: 12px;
    }

    .my-table th,
    .my-table td {
        padding: 4px 6px;
    }

    .player-summary-block {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

    .page-footer {
        margin-top: 20px;
        padding: 14px 16px;
        border-radius: 14px;
    }

    .footer-note {
        font-size: 10.5px;
    }

    .detail-container {
        padding: 20px 14px 26px;
        margin: 10px auto;
    }

    .detail-hero {
        flex-direction: row;
    }

    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .inactive-filter-range {
        flex-wrap: wrap;
    }

    .inactive-filter-legend.inline {
        margin-left: 0;
        margin-top: 6px;
    }

    .inactive-filter-actions.below {
        flex-wrap: wrap;
    }

    .player-page .hero {
        flex-direction: column;
    }

    .player-page .container {
        padding: 20px 14px 26px;
        margin: 10px auto;
    }

    .player-summary-block {
        grid-template-columns: 1fr;
    }

    .chart-canvas-wrap {
        height: 200px;
    }
}

@media (max-width: 500px) {

    .container-main,
    .detail-container,
    .player-page .container {
        width: 95%;
        padding: 10px;
    }

    .search-form {
        gap: 10px;
    }

    .search-form input[type="text"] {
        font-size: 11px;
        padding: 4px 6px;
    }

    .btn {
        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;
    }

    .player-page .hero-avatar {
        width: 60px;
        height: 60px;
        font-size: 22px;
    }
}


